[U-Boot] [PATCH v3 0/3] Add generic FDT memory bank decoding and gd initialization

Nathan Rossi nathan at nathanrossi.com
Sun Dec 18 15:03:34 CET 2016


Currently most boards that have static memory config (which cannot be
detected automatically) use CONFIG_SYS_SDRAM_SIZE to define the size of
memory which is hard coded into U-Boot. With the addition of device tree
support into U-Boot, boards that have device tree data can instead query
the memory bank information from the embedded or appended device tree.
This allows for more dynamic memory configuration and avoids the need to
hard code memory configuration into U-Boot.

The first patch of this series adds two helper functions for handling
the memory bank decoding and initialization of global data which can be
used by boards in their dram_init and dram_init_banksize functions. The
purpose of these helper functions is to provide generic functions that
handle the decoding and setup of memory and memory banks for boards that
intend to use this mechanism.

The series also changes the zynq and zynqmp board implementations to use
these functions to resolve a issue with static variable use.

Changes in v2:
 * Make fdtdec_setup_memory_banksize() return value consistent
 * Add more detail into the function documentation

Changes in v3:
 * Wrap the fdtdec_setup_memory_banksize() function with an #if on
   CONFIG_NR_DRAM_BANKS, so that the function is only available for
   configs that have memory banks available in bd_t.

Nathan Rossi (3):
  fdt: add memory bank decoding functions for board setup
  ARM: zynq: Replace board specific with generic memory bank decoding
  ARM64: zynqmp: Replace board specific with generic memory bank
    decoding

 board/xilinx/zynq/board.c    | 112 ++-----------------------------------------
 board/xilinx/zynqmp/zynqmp.c | 112 ++-----------------------------------------
 include/fdtdec.h             |  34 +++++++++++++
 lib/fdtdec.c                 |  56 ++++++++++++++++++++++
 4 files changed, 96 insertions(+), 218 deletions(-)

-- 
2.11.0


More information about the U-Boot mailing list