[U-Boot] [PATCH] dm: core: Add platform specific bus translation function

Simon Glass
2015-11-27T18:36:19Z

Hi,

On 27 November 2015 at 02:22, Stefan Roese <sr@denx.de> wrote:
> This patch adds the additional platform_translate_address() call to
> dev_get_addr(). A weak default with a 1-to-1 translation is also
> provided. Platforms that need a special address translation can
> overwrite this function.
>
> Here the explanation, why this is needed for MVEBU:
>
> When using DM with DT address translation, this does not work
> with the standard fdt_translate_address() function on MVEBU
> in SPL. Since the DT translates to the 0xf100.0000 base
> address for the internal registers. But SPL still has the
> registers mapped to the 0xd000.0000 (SOC_REGS_PHY_BASE)
> address that is used by the BootROM. This is because SPL
> may return to the BootROM for boot continuation (e.g. UART
> xmodem boot mode).
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Luka Perkov <luka.perkov@sartura.hr>
> Cc: Dirk Eibach <dirk.eibach@gdsys.cc>
> ---
> drivers/core/device.c | 36 +++++++++++++++++++++++++-----------
> 1 file changed, 25 insertions(+), 11 deletions(-)

I wonder if there is a way to handle this with device tree? I would
very much like to avoid adding weak functions and other types of
hooks. Are you saying that there are two values for 'ranges', one in
SPL and one for U-Boot proper? What actually triggers the change?

One option would be to have a ranges-spl property, or similar.

Regards,
Simon