[U-Boot] [PATCH] dm: core: Add Kconfig for simple bus driver

Simon Glass sjg at chromium.org
Mon Aug 31 00:42:30 CEST 2015


Hi,

On 24 August 2015 at 10:58, Simon Glass <sjg at chromium.org> wrote:
> Hi Masahiro,
>
> On 24 August 2015 at 04:02, Masahiro Yamada
> <yamada.masahiro at socionext.com> wrote:
>> 2015-08-24 11:54 GMT+09:00 Marek Vasut <marex at denx.de>:
>>> On Sunday, August 23, 2015 at 11:21:27 PM, Simon Glass wrote:
>>>> Hi Marek,
>>>
>>> Hi Simon,
>>>
>>> [...]
>>>
>>>> >> > I think the in drivers/core/Kconfig , the SPL_SIMPLE_BUS should now
>>>> >> > depend on SPL_OF_CONTROL, not on OF_CONTROL, right ? :)
>>>> >>
>>>> >> Ah yes that sounds right. Would you like to send a new patch against
>>>> >> mainline? I think it is best to consider this a rewrite rather than a
>>>> >> merge!
>>>> >
>>>> > Heh :) I think that's the last missing bit, so feel free to fix it and
>>>> > we're good. But if you insist on a new patch, please do let me know :)
>>>>
>>>> OK, done. Let me know how it looks.
>>>
>>> Looks great, thanks :)
>>>
>>
>>
>> Nope.
>>
>>
>> If CONFIG_OF_CONTROL is enabled and CONFIG_SIMPLE_BUS is disabled,
>> I get build error.
>>
>>
>>   LD      u-boot
>> drivers/built-in.o: In function `dev_get_addr':
>> /home/yamada/ref/u-boot-dm/drivers/core/device.c:571: undefined
>> reference to `simple_bus_translate'
>> collect2: error: ld returned 1 exit status
>> make: *** [u-boot] Error 1
>>
>>
>> Do you really want to switch OF_CONTROL and SIMPLE_BUS separately?
>>
>> simple-bus.c looks like a part of DM core rather than a driver because
>> the address transformation (simple_bus_translate) is mandatory to
>> handle reg properties in DTS correctly.
>>
>> The reason for disabling SIMPLE_BUS but not OF_CONTROL, if any,
>> is to save memory footprint of drivers/core/simple-bus.c
>> Do you think it is significant?
>
> It's not large but it was enough for me to to split it out as an
> option recently. I'd like to avoid needless bloat particularly where
> it affects SPL.
>
> We can fix that build error - it's just that we have the wrong condition:
>
> #ifndef CONFIG_SPL_BUILD
> if (device_get_uclass_id(dev->parent) == UCLASS_SIMPLE_BUS)
> addr = simple_bus_translate(dev->parent, addr);
> #endif
>
> But I think this patch needs to be redone and resent since I am
> effectively rewriting it in the name of merge conflicts. I'll take a
> look.
>

OK I've had another go at this, so if there are any other problems /
changes, please submit a patch!

Applied (again) to u-boot-dm, thanks!

- Simon


More information about the U-Boot mailing list