rk3288: Handle framebuffer through memlayout, not the resource system

Hardware / Coreboot - Julius Werner [chromium.org] - 17 April 2015 02:23 UTC

We've traditionally tucked the framebuffer at the end of memory (above CBMEM) on ARM and declared it reserved through coreboot's resource allocator. This causes depthcharge to mark this area as reserved in the kernel's device tree, which may be necessary to avoid display corruption on handoff but also wastes space that the OS could use instead.

Since rk3288 boards now have proper display shutdown code in depthcharge, keeping the framebuffer memory reserved across the handoff (and thus throughout the lifetime of the system) should no longer be necessary. For now let's just switch the rk3288 implementation to define it through memlayout instead, which is not communicated through the coreboot tables and will get treated as normal memory by depthcharge. Note that this causes it to get wiped in developer/recovery mode, which should not be a problem because that is done in response to VbInit() (long before any images are drawn) and 0 is the default value for a corebootfb anyway (a black pixel).

Eventually, we might want to think about adding more memory types to coreboot's resource system (e.g. "reserved until kernel handoff", or something specifically for the frame buffer) to model this situation better, and maybe merge it with memlayout somehow.

CQ-DEPEND=CL:239470 BRANCH=veyron BUG=chrome-os-partner:34713 TEST=Booted Jerry, noticed that 'free' now displays 0x7f000 more bytes than before (curiously not 0x80000 bytes, I guess there's some alignment waste in the kernel somewhere). Made sure the memory map output from coreboot looks as expected, there's no visible display corruption in developer/recovery mode and the 'cbmem' utility still works.

Change-Id: I12b7bfc1b7525f5a08cb7c64f0ff1b174df252d4

249f9cc rk3288: Handle framebuffer through memlayout, not the resource system
src/arch/arm/include/arch/memlayout.h | 11 +++++++++--
src/include/symbols.h | 4 ++++
src/soc/rockchip/rk3288/cbmem.c | 4 ++--
src/soc/rockchip/rk3288/include/soc/memlayout.ld | 1 +
src/soc/rockchip/rk3288/include/soc/soc.h | 8 --------
src/soc/rockchip/rk3288/soc.c | 12 +++++-------
6 files changed, 21 insertions(+), 19 deletions(-)

Upstream: review.coreboot.org


  • Share