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

Simon Glass sjg at chromium.org
Mon Aug 24 18:58:57 CEST 2015


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.

>
>
> I think this is enough:
>
> obj-y += device.o lists.o root.o uclass.o util.o
> obj-$(CONFIG_DEVRES) += devres.o
> obj-$(CONFIG_$(SPL_)OF_CONTROL) += simple-bus.o
> obj-$(CONFIG_$(SPL_)DM_DEVICE_REMOVE) += device-remove.o
> obj-$(CONFIG_DM) += dump.o
> obj-$(CONFIG_REGMAP) += regmap.o
> obj-$(CONFIG_SYSCON) += syscon-uclass.o
>
> (drop "ifndef CONFIG_SPL_BUILD" and "endif")

Regards,
Simon


More information about the U-Boot mailing list