[U-Boot] [PATCH] dm: Use dev_get_addr() where possible
Stephen Warren
swarren at wwwdotorg.org
Tue Aug 11 19:33:40 CEST 2015
On 08/11/2015 08:33 AM, Simon Glass wrote:
> This is a convenient way for a driver to get the hardware address of a
> device, when regmap or syscon are not being used. Change existing callers
> to use it as an example to others.
Ah good; I was a little worried about the tiny number of users of
dev_get_addr().
> diff --git a/drivers/core/device.c b/drivers/core/device.c
> @@ -566,8 +566,10 @@ fdt_addr_t dev_get_addr(struct udevice *dev)
>
> addr = fdtdec_get_addr(gd->fdt_blob, dev->of_offset, "reg");
> if (addr != FDT_ADDR_T_NONE) {
> +#ifndef CONFIG_SPL_BUILD
> if (device_get_uclass_id(dev->parent) == UCLASS_SIMPLE_BUS)
> addr = simple_bus_translate(dev->parent, addr);
> +#endif
That seems like an unrelated change; is it a fix for a pre-existing
issue? Either way, it looks like that will cause SPL to get incorrect
values for the address since addresses won't get translated (via the
parent's ranges property??) in SPL. Isn't that a bad thing?
The rest of the patch,
Acked-by: Stephen Warren <swarren at wwwdotorg.org>
More information about the U-Boot
mailing list