[U-Boot] [PATCH] dm: Use dev_get_addr() where possible
Simon Glass
sjg at chromium.org
Thu Aug 13 04:16:44 CEST 2015
Hi,
On 11 August 2015 at 11:41, Simon Glass <sjg at chromium.org> wrote:
> Hi Stephen,
>
> On 11 August 2015 at 11:33, Stephen Warren <swarren at wwwdotorg.org> wrote:
>>
>> 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?
>
> Masahiro has a series pending which will clean this up, and I'll
> revisit it after that. But for now SPL does not support simple bus. It
> does not affect current platforms.
>
>>
>> The rest of the patch,
>> Acked-by: Stephen Warren <swarren at wwwdotorg.org>
>
Unless there are objections I plan to apply this clean-up patch to
dm/master next week.
Regards,
Simon
More information about the U-Boot
mailing list