Commit Graph

5 Commits

Author SHA1 Message Date
Joseph Chen c01d448924 sysmem: simplify the memblk name
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Icfe908ade21d1d8f568db796298f67ba9f013da6
2020-02-28 11:22:04 +08:00
Joseph Chen 1d09cf29cd lib: bidram: add 4GB+ memory size support
- On ARMv7: LPAE seems to be not friendly that brings a lot of
  compile errors.

- On ARMv8: MMU translate table is static defined by mem_map[]
  and max 4GB as usual. It is not created dynamically according
  to real memory size, that is different from ARMv7.

- 4GB memory is enough for U-Boot on both ARMv7 an ARMv8.

Considering all that, we decide to make max 4GB size to be visiable
for U-Boot, but still pass the real available memory size to kernel
by bidram_fixup() called at late before fixup "/memory" node.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Idd5fa769e940b0618446909f8f9edc39f596f072
2019-12-16 21:01:54 +08:00
Joseph Chen fc7ff0f015 lib: bidram: add bidram_reserved_is_overlap() interface
Check if the region is overlap with reserved regions.

Change-Id: Ifd9b6a4438dcf954b7e48930e31d0c6cd5d1274c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-22 14:23:49 +08:00
Joseph Chen 356575c3e2 lib: bidram: handle only-one dram bank available situation
LMB default init lmb->reserved.region[0] as zero.

Change-Id: Ib46d9630581bb3a03c5846288b16ae805e3e6944
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-29 18:29:19 +08:00
Joseph Chen 483d049321 lib: introduce bidram for GD board bi_dram[] memory management
Some platform provides more than one dram banks and reserved firmware
regions (eg. ATF, OP-TEE, etc) by pre-loader dynamically. It means
there are memory holes in board dram layout. What's more, U-Boot will
reserved regions at the late bootflow(eg. firmware reserved for AMP).

So we introduce bidram mechanism to manage GD board bi_dram[], which
provides a way to easily manage memory holes and update bi_dram[]. It
dpends on LMB which provides a good algorithm to manage memory blocks.

What's different from sysmem?
- bidram manage and pass the avaliable memory blocks to kernel;
- sysmem is only for U-Boot memory management to avoid ram overlap,
  it doesn't matter about kernel avaliable memory.

Change-Id: I697cbb80bdc961e4ad5ab94548e2dc93feefde6f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00