[PATCH] ARM: stm32: Increase USB power-good delay on DHSOM

Patrice CHOTARD patrice.chotard at foss.st.com
Tue Nov 30 14:18:36 CET 2021


Hi Marek

While preparing and testing the next u-boot-stm32 pull request, i found an issue with this patch during
compilation.

I got the following error:

In file included from include/config.h:4,
                 from include/common.h:16,
                 from env/common.c:10:
include/configs/stm32mp15_common.h:173:2: error: expected '}' before 'STM32MP_BOARD_EXTRA_ENV'
  173 |  STM32MP_BOARD_EXTRA_ENV
      |  ^~~~~~~~~~~~~~~~~~~~~~~
include/env_default.h:125:2: note: in expansion of macro 'CONFIG_EXTRA_ENV_SETTINGS'
  125 |  CONFIG_EXTRA_ENV_SETTINGS
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from env/common.c:32:
include/env_default.h:29:36: note: to match this '{'
   29 | const char default_environment[] = {
      |                                    ^


If you have time to send a fix quickly i can wait for it before sending the pull-request
Or i exclude these 2 patches as there are dependent :

https://patchwork.ozlabs.org/project/uboot/patch/20211113022444.231801-1-marex@denx.de/
https://patchwork.ozlabs.org/project/uboot/patch/20211113022513.231840-1-marex@denx.de/

Thanks
Patrice


On 11/30/21 11:27 AM, Patrice CHOTARD wrote:
> Hi Marek
> 
> On 11/15/21 1:59 PM, Marek Vasut wrote:
>> On 11/15/21 12:18 PM, Patrick DELAUNAY wrote:
>>
>> Hi,
>>
>> [...]
>>
>>>> diff --git a/include/configs/stm32mp15_common.h b/include/configs/stm32mp15_common.h
>>>> index 4e2cabff2e7..be22d3ea7f1 100644
>>>> --- a/include/configs/stm32mp15_common.h
>>>> +++ b/include/configs/stm32mp15_common.h
>>>> @@ -169,7 +169,8 @@
>>>>       STM32MP_BOOTCMD \
>>>>       STM32MP_PARTS_DEFAULT \
>>>>       BOOTENV \
>>>> -    STM32MP_EXTRA
>>>> +    STM32MP_EXTRA \
>>>> +    STM32MP_BOARD_EXTRA_ENV
>>>
>>> I think you that patch failed for the board which include "stm32mp15_common.h" only
>>>
>>> STM32MP_BOARD_EXTRA_ENV is not define
>>>
>>> => board/engicam/stm32mp1/Kconfig:10:    default "stm32mp15_common"
>>>
>>> at minimal, you need to add:
>>>
>>> #ifndef STM32MP_BOARD_EXTRA_ENV
>>>
>>> #defineSTM32MP_BOARD_EXTRA_ENV
>>> #endif
>>>
>>>
>>> But for my point of view CONFIG_EXTRA_ENV_SETTINGS is already a "default" value
>>>
>>> => it can be override in board (after #undef)
>>>
>>> or the overidde should be also managed by  STM32MP_EXTRA, if we add in the common file:
>>>
>>>
>>> #ifndef STM32MP_EXTRA
>>>
>>> #defineSTM32MP_EXTRA \
>>> "altbootcmd=run bootcmd\0"\
>>> "env_check=if env info -p -d -q; then env save; fi\0"\
>>> "boot_net_usb_start=true\0"
>>>
>>> #endif
>>
>> Except in either case, you end up with a lot of duplication.
>>
>>>>   #endif /* ifndef CONFIG_SPL_BUILD */
>>>>   #endif /* ifdef CONFIG_DISTRO_DEFAULTS*/
>>>> diff --git a/include/configs/stm32mp15_dh_dhsom.h b/include/configs/stm32mp15_dh_dhsom.h
>>>> index c559cd72da7..bac9e8388a7 100644
>>>> --- a/include/configs/stm32mp15_dh_dhsom.h
>>>> +++ b/include/configs/stm32mp15_dh_dhsom.h
>>>> @@ -8,6 +8,9 @@
>>>>   #ifndef __CONFIG_STM32MP15_DH_DHSOM_H__
>>>>   #define __CONFIG_STM32MP15_DH_DHSOM_H__
>>>> +#define STM32MP_BOARD_EXTRA_ENV \
>>>> +    "usb_pgood_delay=1000\0"
>>>> +
>>>>   #include <configs/stm32mp15_common.h>
>>>
>>> proposal 1: overiddeCONFIG_EXTRA_ENV_SETTINGS as it is done in stm32mp15_st_common.h
>>>
>>> #include <configs/stm32mp15_common.h>
>>>
>>> #define STM32MP_DH_EXTRA_ENV \
>>>      "usb_pgood_delay=1000\0"
>>>
>>> #undefCONFIG_EXTRA_ENV_SETTINGS
>>> #defineCONFIG_EXTRA_ENV_SETTINGS \
>>> STM32MP_MEM_LAYOUT \
>>> ST_STM32MP1_BOOTCMD \
>>> STM32MP_PARTS_DEFAULT \
>>> BOOTENV \
>>> STM32MP_EXTRA \
>>>
>>>          STM32MP_DH_EXTRA_ENV
>>>
>>> or
>>>
>>> #include <configs/stm32mp15_common.h>
>>>
>>> #undefCONFIG_EXTRA_ENV_SETTINGS
>>>
>>> #defineCONFIG_EXTRA_ENV_SETTINGS \
>>> STM32MP_MEM_LAYOUT \
>>> ST_STM32MP1_BOOTCMD \
>>> STM32MP_PARTS_DEFAULT \
>>> BOOTENV \
>>> STM32MP_EXTRA \
>>> "usb_pgood_delay=1000\0"
>>>
>>>
>>> proposal 2: you can overrideSTM32MP_EXTRA
>>> #defineSTM32MP_EXTRA \
>>>
>>> "altbootcmd=run bootcmd\0"\
>>> "env_check=if env info -p -d -q; then env save; fi\0"\
>>> "boot_net_usb_start=true\0" \
>>>
>>>      "usb_pgood_delay=1000\0"
>>>
>>> #include <configs/stm32mp15_common.h>
>>> open point : do you really need "altbootcmd" ? "boot_net_usb_start" ?"env_check" ?
>>
>> altbootcmd is for when bootcounter reaches bootlimit, so yes.
>> boot_net_usb_start, depends on board.
>>
>> [...]
> Applied to u-boot-stm32/next
> 
> Thanks
> Patrice
> 


More information about the U-Boot mailing list