Hi all,

In u-boot we only provide a single MMU table for all k3 platforms, this   does
not scale for devices where atf and optee lie outside the range   0x80000000 -
0x80080000 and 0x9e780000 - 0xa0000000 respectively.

There are also issues for devices with < 2GiB of memory (eg am62SiP with 512MiB
of RAM) as the maximum size is hardcoded to 2GiB. Furthermore higher DDR banks
are mapped even for devices with NR_DRAM_BANKS < 2.

Therefore this patch set adds the required functionality to create the MMU table
at runtime with proper configuration for the spl stage as well an added entry
for the framebuffer for supported platforms.

The patch set has been build tested on all effected platforms but boot-tested
only on TI's K3 EVMs and the beagleplay.

The following effected boards have not been boot tested:
 - phycore-am62a
 - phycore-am62x
 - phycore-am64x
 - verdin-am62
 - iot2050

Best Wishes,
Anshul
---
Changes in v5:
 - Don't create carveouts for every reserved-memory node
 - Only create carveouts for ATF/OP-TEE
 - Expand the call to k3_mem_map_init to vendor boards as well
 - Map area for framebuffer for CONFIG_VIDEO=y platforms
v4: https://lore.kernel.org/u-boot/20250618124210.1936140-1-ansh...@ti.com/

Changes for v4:
 - Add call to k3_mem_map_init for beagleplay
 - Mark reserved regions as non-cacheable
 - More debug logs
v3: https://lore.kernel.org/u-boot/20250617135844.2873701-1-ansh...@ti.com/

Changes for v3:
 - Remove unused memory regions in SPL's map
 - Add runtime addition of MMU entry for the framebuffer in SPL
 - Refactor k3_mem_map_init to use standard u-boot APIs
 - Unmap reserved-memory regions instead of keeping them uncached
v2: https://lore.kernel.org/u-boot/20250610160833.1705534-1-ansh...@ti.com/

Changes in v2:
- Removed dependency to:
  https://lore.kernel.org/u-boot/20250522150941.563959-1-ansh...@ti.com/
v1: https://lore.kernel.org/u-boot/20250602120054.1466951-1-ansh...@ti.com/
---
Anshul Dalal (4):
  mach-k3: use minimal MMU table for all k3
  mach-k3: add runtime configuration of MMU table
  mach-k3: add dynamic mmu fixups for SPL stage
  board: add call to k3_mem_map_init for all k3 boards

 arch/arm/mach-k3/arm64/arm64-mmu.c           | 182 ++++++++++++++++---
 arch/arm/mach-k3/common.c                    |  17 +-
 arch/arm/mach-k3/include/mach/k3-ddr.h       |   1 +
 arch/arm/mach-k3/r5/common.c                 |   5 +
 board/beagle/beagleplay/beagleplay.c         |   9 +-
 board/phytec/phycore_am62ax/phycore-am62ax.c |   9 +-
 board/phytec/phycore_am62x/phycore-am62x.c   |   3 +-
 board/phytec/phycore_am64x/phycore-am64x.c   |   3 +-
 board/siemens/iot2050/board.c                |   3 +-
 board/ti/common/k3-ddr.c                     |   9 +-
 board/toradex/verdin-am62/verdin-am62.c      |   3 +-
 11 files changed, 211 insertions(+), 33 deletions(-)

-- 
2.49.0

Reply via email to