diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-07-06 12:25:11 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-07-06 12:34:23 +0200 |
commit | 2f5f0d6aa11410d65da4dc368f8e81daec079d23 (patch) | |
tree | 0b3efeb04f36a493333321c8e50e036f5798f96d /drivers | |
parent | 7be1519c694a374147b3a68155b64eb49d31c4f3 (diff) | |
download | barebox-2f5f0d6aa11410d65da4dc368f8e81daec079d23.tar.gz barebox-2f5f0d6aa11410d65da4dc368f8e81daec079d23.tar.xz |
video: Add generic fixup handler to reserve fb memory
When a framebuffer is kept enabled when Linux starts its framebuffer
memory should be reserved. Otherwise Linux may overwrite its contents.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/fb.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/video/fb.c b/drivers/video/fb.c index e30ab59377..931c99ce66 100644 --- a/drivers/video/fb.c +++ b/drivers/video/fb.c @@ -103,6 +103,27 @@ static int fb_setup_mode(struct fb_info *info) return 0; } +static int fb_of_reserve_fixup(struct device_node *root, void *context) +{ + struct fb_info *info = context; + + if (!info->enabled) + return 0; + + of_add_reserve_entry((unsigned long)info->screen_base, + (unsigned long)info->screen_base + info->screen_size); + + return 0; +} + +void fb_of_reserve_add_fixup(struct fb_info *info) +{ + if (!IS_ENABLED(CONFIG_OFDEVICE)) + return; + + of_register_fixup(fb_of_reserve_fixup, info); +} + static int fb_set_modename(struct param_d *param, void *priv) { struct fb_info *info = priv; |