summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-07-06 12:25:11 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-07-06 12:34:23 +0200
commit2f5f0d6aa11410d65da4dc368f8e81daec079d23 (patch)
tree0b3efeb04f36a493333321c8e50e036f5798f96d /drivers
parent7be1519c694a374147b3a68155b64eb49d31c4f3 (diff)
downloadbarebox-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.c21
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;