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

Nathan Rossi nathan at nathanrossi.com
Mon Dec 12 08:12:36 CET 2016


On 12 December 2016 at 03:08, Igor Grinberg <grinberg at compulab.co.il> wrote:
> On 12/11/16 18:47, Nathan Rossi wrote:
>> On 12 December 2016 at 01:08, Igor Grinberg <grinberg at compulab.co.il> wrote:
>>> Hi Nathan,
>>>
>>> On 12/11/16 15:58, Nathan Rossi wrote:
>>>> This series adds two functions for handling the memory bank decoding and
>>>> initialization of global data for use by boards in their dram_init and
>>>> dram_init_banksize functions.
>>>
>>> I might have missed some discussions on this meter,
>>> can you please provide the use cases for this?
>>> IMO, the bootloader's job is to initialize the DRAM, detect its size, and pass
>>> the detected DRAM configuration on to an OS.
>>
>> Hi Igor,
>>
>> I do not think there have been any discussions on this (at least none
>> that I am aware of).
>>
>> Some boards (like Zynq and ZynqMP ones) are using
>> CONFIG_SYS_SDRAM_SIZE to define the amount of memory that is available
>> (since detection is not possible). However with the introduction of
>> dtbs for some boards they are also capable of loading the size of
>> memory from the embedded/appended dtb (instead of hardcoded). This
>> allows for more of the board config to be loaded from the device tree
>> instead of from include/configs/*.h. This however is up to the
>> individual board to implement in its dram_init* functions.
>
> Thanks for the explanation!
> I assume that the key point is "detection is not possible" and therefore
> we must rely on a user or a production process to place (append) the correct dtb.
> Makes sense to me now and looks like an improvement to the current situation.
>
>>
>> The first patch of the series is only adding some decoding helper
>> functions to make this generic between the Zynq and ZynqMP boards as
>> well as to allow for any other boards that may want to use the same
>> mechanism to get the memory size from the fdt. There is no requirement
>> for boards to use these functions.
>
> Can you please next time place a similar explanation in at least the cover
> letter. This way, the intent might be understood the first time ;-)

Sorry about that, I will make sure future series have more complete
descriptions in the cover letter. I have however updated the
description for this in the v2 for completeness.

> I would also like to see some parts of the above explanation in the functions
> documentation (e.g. this allows to improve the DRAM configuration mechanics
> on boards that cannot detect its DRAM size/config).

Will add in v2.

Regards,
Nathan

>
> Thanks!
>
>>
>> Regards,
>> Nathan
>>
>>>
>>>>
>>>> The series also changes the zynq and zynqmp board implementations to use
>>>> these functions to resolve a issue with static variable use.
>>>>
>>>> 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             |  25 ++++++++++
>>>>  lib/fdtdec.c                 |  54 +++++++++++++++++++++
>>>>  4 files changed, 85 insertions(+), 218 deletions(-)
>>>>
>>>
>>> --
>>> Regards,
>>> Igor.
>>
>
> --
> Regards,
> Igor.


More information about the U-Boot mailing list