]> git.ipfire.org Git - thirdparty/u-boot.git/commit
board: toradex: Make A53 get RAM size from DT in K3 boards master
authorSuhaas Joshi <s-joshi@ti.com>
Thu, 12 Feb 2026 10:28:47 +0000 (15:58 +0530)
committerTom Rini <trini@konsulko.com>
Thu, 12 Feb 2026 14:12:09 +0000 (08:12 -0600)
commitf9ffeec4bdcf1da655a0ffea482062adde78fee8
tree0e6744457ab27365b5fd0cecd66413432a55623c
parentf71ae3952901767094e3cfc1662bfb00319c6775
board: toradex: Make A53 get RAM size from DT in K3 boards

`dram_init()` is called by R5 SPL and U-Boot, both. It starts by
computing the size of the RAM. In verdin-am62(p), it does so by calling
`get_ram_size()`. This function computes the size of the RAM by writing
over the RAM.

When R5 computes the size of the RAM, it does not update the DT with
this size. As a result, when A53 invokes `dram_init()` again, it has to
compute the size through `get_ram_size()` again.

Commit 13c54cf588d82 and 0c3a6f748c9 add firewall over ATF's and OPTEE's
regions. This firewall is added during the R5 SPL stage of boot. So when
A53 attempts to write over RAM in `get_ram_size()`, it writes over the
protected region. Since A53 is a non-secure core, this is blocked by the
firewall.

To fix this, do the following:
    * Implement `spl_perform_board_fixups()` function for verdin-am62
      and verdin-am62p. Make this function call `fixup_memory_node()`,
      which updates the DT.
    * Add an if-block in `dram_init()`, to ensure that only R5 is able
      to call `get_ram_size()`, and that A53 reads this size from the
      DT.

Signed-off-by: Suhaas Joshi <s-joshi@ti.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
board/toradex/verdin-am62/verdin-am62.c
board/toradex/verdin-am62p/verdin-am62p.c