===========
This uses the displaymode.txt binding except that only xres and yres are
-required properties.
+required properties. Also an additional optional property is defined:
+
+log2-depth: Log base 2 of the U-Boot display buffer depth (4=16bpp, 5=32bpp).
+ If not provided, a value of 4 is used.
Example:
compatible = "sandbox,lcd-sdl";
xres = <800>;
yres = <600>;
+ log2-depth = <5>;
};
{
struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
struct sandbox_sdl_plat *plat = dev_get_platdata(dev);
- const void *blob = gd->fdt_blob;
- int node = dev_of_offset(dev);
int ret = 0;
- plat->xres = fdtdec_get_int(blob, node, "xres", LCD_MAX_WIDTH);
- plat->yres = fdtdec_get_int(blob, node, "yres", LCD_MAX_HEIGHT);
- plat->bpix = VIDEO_BPP16;
+ plat->xres = dev_read_u32_default(dev, "xres", LCD_MAX_WIDTH);
+ plat->yres = dev_read_u32_default(dev, "yres", LCD_MAX_HEIGHT);
+ plat->bpix = dev_read_u32_default(dev, "log2-depth", VIDEO_BPP16);
uc_plat->size = plat->xres * plat->yres * (1 << plat->bpix) / 8;
debug("%s: Frame buffer size %x\n", __func__, uc_plat->size);