[U-Boot] [PATCH 2/5] Revert "configs: am335x: usb: do not define CONFIG_DM_USB for spl"

Alexandru Gagniuc alex.g at adaptrum.com
Mon Feb 6 22:02:56 UTC 2017



On 02/06/2017 01:30 PM, Grygorii Strashko wrote:
>
>
> On 02/06/2017 01:43 PM, Andrew F. Davis wrote:
>> On 02/06/2017 12:47 PM, Alex wrote:
>>>
>>>
>>> On 02/06/2017 07:52 AM, Andrew F. Davis wrote:
>>>> On 02/03/2017 05:42 PM, Alexandru Gagniuc wrote:
>>>>> This reverts commit 4623f974a585b59bd07fb60a326a096290aa4c53.
>>>>> This confuses the #ifdef logic in am33xx/board.c. This results in
>>>>> undefined symbols when USB gadget mode is disabled in .config.
> The CONFIG_DM_USB seems has nothing common with issue you're trying to fix here.
> problem you saw depends on

It seems that arch_misc_init() is not properly guarded with 
CONFIG_MUSB_* (see Appendix A).

>  # CONFIG_USB_MUSB_HOST is not set
>  # CONFIG_USB_MUSB_GADGET is not set

Yeah, it's a nightmare.

> sry, but NACK.
>
> And Could you add error output from your log to the commit message next time, please?

I got grilled for doing this in other projects, so I generally avoid it, 
but sure, I can do it when requested.

Alex


APPENDIX A:

if (!CONFIG_DM_USB && CONFIG_MUSB* && CONFIG_AM335X_USB*) {
	if(CONFIG_AM335X_USB0) {
		declare otg0_board_data
		declare otg0_plat
	}

	if(CONFIG_AM335X_USB1) {
		declare otg1_board_data
		declare otg1_plat
	}
}


if (!CONFIG_DM_USB) {
	if(CONFIG_AM335X_USB0) {
		use otg0_board_data
		use otg0_plat
	}

	if(CONFIG_AM335X_USB1) {
		use otg1_board_data
		use otg1_plat
	}
} else {
	/* Don't care */
}



> Smth. like this:
>
> arch/arm/mach-omap2/am33xx/board.c: In function 'arch_misc_init':
> arch/arm/mach-omap2/am33xx/board.c:199:17: error: 'otg0_plat' undeclared (first use in this function)
>   musb_register(&otg0_plat, &otg0_board_data,
>                  ^
> arch/arm/mach-omap2/am33xx/board.c:199:17: note: each undeclared identifier is reported only once for each function it appears in
> arch/arm/mach-omap2/am33xx/board.c:199:29: error: 'otg0_board_data' undeclared (first use in this function)
>   musb_register(&otg0_plat, &otg0_board_data,
>                              ^
> arch/arm/mach-omap2/am33xx/board.c:203:17: error: 'otg1_plat' undeclared (first use in this function)
>   musb_register(&otg1_plat, &otg1_board_data,
>                  ^
> arch/arm/mach-omap2/am33xx/board.c:203:29: error: 'otg1_board_data' undeclared (first use in this function)
>   musb_register(&otg1_plat, &otg1_board_data,
>
>
>
>
>>>
>>>> Undefined symbols will happen until the Kconfig conversion is finished
>>>> and some proper kconfig dependencies are defined. In the meantime, the
>>>> only other fix for this commit will be to convert DM_USB code to work
>>>> with SPL.
>>>
>>> Of course! And as you noticed this patch is a "lesser of two evils" fix.
>>> I do not have the bandwidth to rework the USB/SPL code, though I would
>>> like to avoid blocking ACRS2 support on SPL refactoring. Is this
>>> reasonable?
>>>
>>
>> Absolutely reasonable to me, because I too do not have spare bandwidth
>> for this, I just like pointing it out every-time someone messes with SPL
>> and DM, maybe someday someone will find the time actually fix it, then I
>> can at least feel like I helped :)
>
>
>
>
>


More information about the U-Boot mailing list