diff mbox series

[RFC,v7,23/23] DO NOT MERGE: only to make CI happy

Message ID 20230330194716.23623-24-francis.laniel@amarulasolutions.com
State RFC
Delegated to: Tom Rini
Headers show
Series Modernize U-Boot shell | expand

Commit Message

Francis Laniel March 30, 2023, 7:47 p.m. UTC
This commit set CONFIG_HUSH_PARSER_2021 as the default to trigger the CI with
this parser.

Nonetheless, the keymile (i.e. VENDOR_KM) board family is not compatible with
new 2021 hush parser.
Indeed, This boards used set_local_var() to store some variables as local shell.
They then used get_local_var() to retrieve the variables values.
Sadly, this two functions do not exist with CONFIG_HUSH_PARSER_2021.
A patch was proposed to use environment variables rather than local variables
but it does not tackle the problem, so complementary work is needed to make
this boards use CONFIG_HUSH_PARSER_2021 [1].

We also remove a #undef of CONFIG_FEATURE_SH_STANDALONE as it does not exist in
U-Boot and causes troubles in the CI.

We also set CONFIG_LTO for kirkwoord sheevaplug and phytec bk4r1, otherwise it
hits its board size limit.
By enabling this option, we also had to add assembly for __gnu_thumb1_case_si.
It was taken from upstream gcc and adapted as width suffix was removed for the
add [2].

Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
[1] https://marc.info/?l=u-boot&m=165541917618725&w=2
[2] https://github.com/gcc-mirror/gcc/blob/4f181f9c7ee3efc509d185fdfda33be9018f1611/libgcc/config/arm/lib1funcs.S#L2156
---
 arch/arm/lib/lib1funcs.S     | 17 +++++++++++++++++
 cmd/Kconfig                  |  3 ++-
 common/cli_hush_upstream.c   |  1 -
 configs/bk4r1_defconfig      |  1 +
 configs/sheevaplug_defconfig |  1 +
 5 files changed, 21 insertions(+), 2 deletions(-)

Comments

Tony Dinh March 30, 2023, 8:17 p.m. UTC | #1
Hi Francis,

On Thu, Mar 30, 2023 at 12:50 PM Francis Laniel
<francis.laniel@amarulasolutions.com> wrote:
>
> This commit set CONFIG_HUSH_PARSER_2021 as the default to trigger the CI with
> this parser.
>
> Nonetheless, the keymile (i.e. VENDOR_KM) board family is not compatible with
> new 2021 hush parser.
> Indeed, This boards used set_local_var() to store some variables as local shell.
> They then used get_local_var() to retrieve the variables values.
> Sadly, this two functions do not exist with CONFIG_HUSH_PARSER_2021.
> A patch was proposed to use environment variables rather than local variables
> but it does not tackle the problem, so complementary work is needed to make
> this boards use CONFIG_HUSH_PARSER_2021 [1].
>
> We also remove a #undef of CONFIG_FEATURE_SH_STANDALONE as it does not exist in
> U-Boot and causes troubles in the CI.
>
> We also set CONFIG_LTO for kirkwoord sheevaplug and phytec bk4r1, otherwise it
> hits its board size limit.
> By enabling this option, we also had to add assembly for __gnu_thumb1_case_si.
> It was taken from upstream gcc and adapted as width suffix was removed for the
> add [2].

Thanks for adding __gnu_thumb1_case_si ! It will help not just the
Sheevaplug board, but also a few other boards too. I'll give this a
try.

All the best,
Tony

>
> Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
> [1] https://marc.info/?l=u-boot&m=165541917618725&w=2
> [2] https://github.com/gcc-mirror/gcc/blob/4f181f9c7ee3efc509d185fdfda33be9018f1611/libgcc/config/arm/lib1funcs.S#L2156
> ---
>  arch/arm/lib/lib1funcs.S     | 17 +++++++++++++++++
>  cmd/Kconfig                  |  3 ++-
>  common/cli_hush_upstream.c   |  1 -
>  configs/bk4r1_defconfig      |  1 +
>  configs/sheevaplug_defconfig |  1 +
>  5 files changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S
> index de15d09e36..a1f44d9454 100644
> --- a/arch/arm/lib/lib1funcs.S
> +++ b/arch/arm/lib/lib1funcs.S
> @@ -419,4 +419,21 @@ ENTRY(__gnu_thumb1_case_uhi)
>         ret     lr
>  ENDPROC(__gnu_thumb1_case_uhi)
>  .popsection
> +
> +/* Taken and adapted from: https://github.com/gcc-mirror/gcc/blob/4f181f9c7ee3efc509d185fdfda33be9018f1611/libgcc/config/arm/lib1funcs.S#L2156 */
> +.pushsection .text.__gnu_thumb1_case_si, "ax"
> +ENTRY(__gnu_thumb1_case_si)
> +       push    {r0, r1}
> +       mov     r1, lr
> +       adds    r1, r1, #2      /* Align to word.  */
> +       lsrs    r1, r1, #2
> +       lsls    r0, r0, #2
> +       lsls    r1, r1, #2
> +       ldr     r0, [r1, r0]
> +       adds    r0, r0, r1
> +       mov     lr, r0
> +       pop     {r0, r1}
> +       mov     pc, lr          /* We know we were called from thumb code.  */
> +ENDPROC(__gnu_thumb1_case_si)
> +.popsection
>  #endif
> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index 1b9d04680d..d4809fcfa4 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -28,7 +28,7 @@ menu "Hush flavor to use"
>
>         config HUSH_OLD_PARSER
>                 bool "Use hush old parser"
> -               default y
> +               default y if VENDOR_KM
>                 help
>                   This option enables the old flavor of hush based on hush Busybox from
>                   2005.
> @@ -37,6 +37,7 @@ menu "Hush flavor to use"
>
>         config HUSH_2021_PARSER
>                 bool "Use hush 2021 parser"
> +               default y if !VENDOR_KM
>                 help
>                   This option enables the new flavor of hush based on hush Busybox from
>                   2021.
> diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c
> index 93796e87c5..78a13eeb62 100644
> --- a/common/cli_hush_upstream.c
> +++ b/common/cli_hush_upstream.c
> @@ -427,7 +427,6 @@
>  #include "NUM_APPLETS.h"
>  #if NUM_APPLETS == 1
>  /* STANDALONE does not make sense, and won't compile */
> -# undef CONFIG_FEATURE_SH_STANDALONE
>  # undef ENABLE_FEATURE_SH_STANDALONE
>  # undef IF_FEATURE_SH_STANDALONE
>  # undef IF_NOT_FEATURE_SH_STANDALONE
> diff --git a/configs/bk4r1_defconfig b/configs/bk4r1_defconfig
> index 66adeac725..95f0c30cde 100644
> --- a/configs/bk4r1_defconfig
> +++ b/configs/bk4r1_defconfig
> @@ -18,6 +18,7 @@ CONFIG_TARGET_BK4R1=y
>  CONFIG_SYS_LOAD_ADDR=0x82000000
>  CONFIG_SYS_MEMTEST_START=0x80010000
>  CONFIG_SYS_MEMTEST_END=0x87c00000
> +CONFIG_LTO=y
>  CONFIG_HAS_BOARD_SIZE_LIMIT=y
>  CONFIG_BOARD_SIZE_LIMIT=520192
>  CONFIG_FIT=y
> diff --git a/configs/sheevaplug_defconfig b/configs/sheevaplug_defconfig
> index 2e4901b840..365f779cc8 100644
> --- a/configs/sheevaplug_defconfig
> +++ b/configs/sheevaplug_defconfig
> @@ -16,6 +16,7 @@ CONFIG_ENV_OFFSET=0x80000
>  CONFIG_DEFAULT_DEVICE_TREE="kirkwood-sheevaplug"
>  CONFIG_IDENT_STRING="\nMarvell-Sheevaplug"
>  CONFIG_SYS_LOAD_ADDR=0x800000
> +CONFIG_LTO=y
>  CONFIG_HAS_BOARD_SIZE_LIMIT=y
>  CONFIG_BOARD_SIZE_LIMIT=524288
>  CONFIG_BOOTDELAY=3
> --
> 2.34.1
>
Francis Laniel March 30, 2023, 10:14 p.m. UTC | #2
Hi.

Le jeudi 30 mars 2023, 21:17:33 WEST Tony Dinh a écrit :
> Hi Francis,
> 
> On Thu, Mar 30, 2023 at 12:50 PM Francis Laniel
> 
> <francis.laniel@amarulasolutions.com> wrote:
> > This commit set CONFIG_HUSH_PARSER_2021 as the default to trigger the CI
> > with this parser.
> > 
> > Nonetheless, the keymile (i.e. VENDOR_KM) board family is not compatible
> > with new 2021 hush parser.
> > Indeed, This boards used set_local_var() to store some variables as local
> > shell. They then used get_local_var() to retrieve the variables values.
> > Sadly, this two functions do not exist with CONFIG_HUSH_PARSER_2021.
> > A patch was proposed to use environment variables rather than local
> > variables but it does not tackle the problem, so complementary work is
> > needed to make this boards use CONFIG_HUSH_PARSER_2021 [1].
> > 
> > We also remove a #undef of CONFIG_FEATURE_SH_STANDALONE as it does not
> > exist in U-Boot and causes troubles in the CI.
> > 
> > We also set CONFIG_LTO for kirkwoord sheevaplug and phytec bk4r1,
> > otherwise it hits its board size limit.
> > By enabling this option, we also had to add assembly for
> > __gnu_thumb1_case_si. It was taken from upstream gcc and adapted as width
> > suffix was removed for the add [2].
> 
> Thanks for adding __gnu_thumb1_case_si ! It will help not just the
> Sheevaplug board, but also a few other boards too. I'll give this a
> try.

You are welcome!
I nonetheless cannot ensure the modifications I brought to the code are correct 
as I do not have the board to test them.
So, if you can test it on a board it will be really welcomed and in case you 
find any problem I will add your suggested changes to the commit!

> 
> All the best,
> Tony
> 
> > Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
> > [1] https://marc.info/?l=u-boot&m=165541917618725&w=2
> > [2]
> > https://github.com/gcc-mirror/gcc/blob/4f181f9c7ee3efc509d185fdfda33be901
> > 8f1611/libgcc/config/arm/lib1funcs.S#L2156 ---
> > 
> >  arch/arm/lib/lib1funcs.S     | 17 +++++++++++++++++
> >  cmd/Kconfig                  |  3 ++-
> >  common/cli_hush_upstream.c   |  1 -
> >  configs/bk4r1_defconfig      |  1 +
> >  configs/sheevaplug_defconfig |  1 +
> >  5 files changed, 21 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S
> > index de15d09e36..a1f44d9454 100644
> > --- a/arch/arm/lib/lib1funcs.S
> > +++ b/arch/arm/lib/lib1funcs.S
> > @@ -419,4 +419,21 @@ ENTRY(__gnu_thumb1_case_uhi)
> > 
> >         ret     lr
> >  
> >  ENDPROC(__gnu_thumb1_case_uhi)
> >  .popsection
> > 
> > +
> > +/* Taken and adapted from:
> > https://github.com/gcc-mirror/gcc/blob/4f181f9c7ee3efc509d185fdfda33be901
> > 8f1611/libgcc/config/arm/lib1funcs.S#L2156 */ +.pushsection
> > .text.__gnu_thumb1_case_si, "ax"
> > +ENTRY(__gnu_thumb1_case_si)
> > +       push    {r0, r1}
> > +       mov     r1, lr
> > +       adds    r1, r1, #2      /* Align to word.  */
> > +       lsrs    r1, r1, #2
> > +       lsls    r0, r0, #2
> > +       lsls    r1, r1, #2
> > +       ldr     r0, [r1, r0]
> > +       adds    r0, r0, r1
> > +       mov     lr, r0
> > +       pop     {r0, r1}
> > +       mov     pc, lr          /* We know we were called from thumb code.
> >  */ +ENDPROC(__gnu_thumb1_case_si)
> > +.popsection
> > 
> >  #endif
> > 
> > diff --git a/cmd/Kconfig b/cmd/Kconfig
> > index 1b9d04680d..d4809fcfa4 100644
> > --- a/cmd/Kconfig
> > +++ b/cmd/Kconfig
> > @@ -28,7 +28,7 @@ menu "Hush flavor to use"
> > 
> >         config HUSH_OLD_PARSER
> >         
> >                 bool "Use hush old parser"
> > 
> > -               default y
> > +               default y if VENDOR_KM
> > 
> >                 help
> >                 
> >                   This option enables the old flavor of hush based on hush
> >                   Busybox from
> >                   2005.
> > 
> > @@ -37,6 +37,7 @@ menu "Hush flavor to use"
> > 
> >         config HUSH_2021_PARSER
> >         
> >                 bool "Use hush 2021 parser"
> > 
> > +               default y if !VENDOR_KM
> > 
> >                 help
> >                 
> >                   This option enables the new flavor of hush based on hush
> >                   Busybox from
> >                   2021.
> > 
> > diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c
> > index 93796e87c5..78a13eeb62 100644
> > --- a/common/cli_hush_upstream.c
> > +++ b/common/cli_hush_upstream.c
> > @@ -427,7 +427,6 @@
> > 
> >  #include "NUM_APPLETS.h"
> >  #if NUM_APPLETS == 1
> >  /* STANDALONE does not make sense, and won't compile */
> > 
> > -# undef CONFIG_FEATURE_SH_STANDALONE
> > 
> >  # undef ENABLE_FEATURE_SH_STANDALONE
> >  # undef IF_FEATURE_SH_STANDALONE
> >  # undef IF_NOT_FEATURE_SH_STANDALONE
> > 
> > diff --git a/configs/bk4r1_defconfig b/configs/bk4r1_defconfig
> > index 66adeac725..95f0c30cde 100644
> > --- a/configs/bk4r1_defconfig
> > +++ b/configs/bk4r1_defconfig
> > @@ -18,6 +18,7 @@ CONFIG_TARGET_BK4R1=y
> > 
> >  CONFIG_SYS_LOAD_ADDR=0x82000000
> >  CONFIG_SYS_MEMTEST_START=0x80010000
> >  CONFIG_SYS_MEMTEST_END=0x87c00000
> > 
> > +CONFIG_LTO=y
> > 
> >  CONFIG_HAS_BOARD_SIZE_LIMIT=y
> >  CONFIG_BOARD_SIZE_LIMIT=520192
> >  CONFIG_FIT=y
> > 
> > diff --git a/configs/sheevaplug_defconfig b/configs/sheevaplug_defconfig
> > index 2e4901b840..365f779cc8 100644
> > --- a/configs/sheevaplug_defconfig
> > +++ b/configs/sheevaplug_defconfig
> > @@ -16,6 +16,7 @@ CONFIG_ENV_OFFSET=0x80000
> > 
> >  CONFIG_DEFAULT_DEVICE_TREE="kirkwood-sheevaplug"
> >  CONFIG_IDENT_STRING="\nMarvell-Sheevaplug"
> >  CONFIG_SYS_LOAD_ADDR=0x800000
> > 
> > +CONFIG_LTO=y
> > 
> >  CONFIG_HAS_BOARD_SIZE_LIMIT=y
> >  CONFIG_BOARD_SIZE_LIMIT=524288
> >  CONFIG_BOOTDELAY=3
> > 
> > --
> > 2.34.1


Best regards.
Tony Dinh March 31, 2023, 11:17 p.m. UTC | #3
Hi Francis,

On Thu, Mar 30, 2023 at 3:14 PM Francis Laniel
<francis.laniel@amarulasolutions.com> wrote:
>
> Hi.
>
> Le jeudi 30 mars 2023, 21:17:33 WEST Tony Dinh a écrit :
> > Hi Francis,
> >
> > On Thu, Mar 30, 2023 at 12:50 PM Francis Laniel
> >
> > <francis.laniel@amarulasolutions.com> wrote:
> > > This commit set CONFIG_HUSH_PARSER_2021 as the default to trigger the CI
> > > with this parser.
> > >
> > > Nonetheless, the keymile (i.e. VENDOR_KM) board family is not compatible
> > > with new 2021 hush parser.
> > > Indeed, This boards used set_local_var() to store some variables as local
> > > shell. They then used get_local_var() to retrieve the variables values.
> > > Sadly, this two functions do not exist with CONFIG_HUSH_PARSER_2021.
> > > A patch was proposed to use environment variables rather than local
> > > variables but it does not tackle the problem, so complementary work is
> > > needed to make this boards use CONFIG_HUSH_PARSER_2021 [1].
> > >
> > > We also remove a #undef of CONFIG_FEATURE_SH_STANDALONE as it does not
> > > exist in U-Boot and causes troubles in the CI.
> > >
> > > We also set CONFIG_LTO for kirkwoord sheevaplug and phytec bk4r1,
> > > otherwise it hits its board size limit.
> > > By enabling this option, we also had to add assembly for
> > > __gnu_thumb1_case_si. It was taken from upstream gcc and adapted as width
> > > suffix was removed for the add [2].
> >
> > Thanks for adding __gnu_thumb1_case_si ! It will help not just the
> > Sheevaplug board, but also a few other boards too. I'll give this a
> > try.
>
> You are welcome!
> I nonetheless cannot ensure the modifications I brought to the code are correct
> as I do not have the board to test them.
> So, if you can test it on a board it will be really welcomed and in case you
> find any problem I will add your suggested changes to the commit!

I applied the arch/arm/lib/lib1funcs.S patch, built, and ran the
u-boot-2023.04-rc5 for Pogo V4 board (Kirkwood 6192 SoC). Everything
is working fine. Thanks!

Is it possible for you to send in this patch for lib1funcs.S
separately? Given this RFC patch series probably will take a while to
get merged. In the meantime, it would be great to have this earlier so
we all can start building LTO+Thumb enabled u-boots with gcc 12.x. I
can do more testing with other boards that have CONFIG_HAS_THUMB2 and
CONFIG_SPL_SYS_THUMB_BUILD. Please let me know if I can help with that
individual patch.

Ref [1] https://lists.denx.de/pipermail/u-boot/2022-November/500460.html
Ref [2] https://lists.denx.de/pipermail/u-boot/2022-November/500463.html

Tested-by: Tony Dinh <mibodhi@gmail.com>

All the best,
Tony

>
> >
> > All the best,
> > Tony
> >
> > > Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
> > > [1] https://marc.info/?l=u-boot&m=165541917618725&w=2
> > > [2]
> > > https://github.com/gcc-mirror/gcc/blob/4f181f9c7ee3efc509d185fdfda33be901
> > > 8f1611/libgcc/config/arm/lib1funcs.S#L2156 ---
> > >
> > >  arch/arm/lib/lib1funcs.S     | 17 +++++++++++++++++
> > >  cmd/Kconfig                  |  3 ++-
> > >  common/cli_hush_upstream.c   |  1 -
> > >  configs/bk4r1_defconfig      |  1 +
> > >  configs/sheevaplug_defconfig |  1 +
> > >  5 files changed, 21 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S
> > > index de15d09e36..a1f44d9454 100644
> > > --- a/arch/arm/lib/lib1funcs.S
> > > +++ b/arch/arm/lib/lib1funcs.S
> > > @@ -419,4 +419,21 @@ ENTRY(__gnu_thumb1_case_uhi)
> > >
> > >         ret     lr
> > >
> > >  ENDPROC(__gnu_thumb1_case_uhi)
> > >  .popsection
> > >
> > > +
> > > +/* Taken and adapted from:
> > > https://github.com/gcc-mirror/gcc/blob/4f181f9c7ee3efc509d185fdfda33be901
> > > 8f1611/libgcc/config/arm/lib1funcs.S#L2156 */ +.pushsection
> > > .text.__gnu_thumb1_case_si, "ax"
> > > +ENTRY(__gnu_thumb1_case_si)
> > > +       push    {r0, r1}
> > > +       mov     r1, lr
> > > +       adds    r1, r1, #2      /* Align to word.  */
> > > +       lsrs    r1, r1, #2
> > > +       lsls    r0, r0, #2
> > > +       lsls    r1, r1, #2
> > > +       ldr     r0, [r1, r0]
> > > +       adds    r0, r0, r1
> > > +       mov     lr, r0
> > > +       pop     {r0, r1}
> > > +       mov     pc, lr          /* We know we were called from thumb code.
> > >  */ +ENDPROC(__gnu_thumb1_case_si)
> > > +.popsection
> > >
> > >  #endif
> > >
> > > diff --git a/cmd/Kconfig b/cmd/Kconfig
> > > index 1b9d04680d..d4809fcfa4 100644
> > > --- a/cmd/Kconfig
> > > +++ b/cmd/Kconfig
> > > @@ -28,7 +28,7 @@ menu "Hush flavor to use"
> > >
> > >         config HUSH_OLD_PARSER
> > >
> > >                 bool "Use hush old parser"
> > >
> > > -               default y
> > > +               default y if VENDOR_KM
> > >
> > >                 help
> > >
> > >                   This option enables the old flavor of hush based on hush
> > >                   Busybox from
> > >                   2005.
> > >
> > > @@ -37,6 +37,7 @@ menu "Hush flavor to use"
> > >
> > >         config HUSH_2021_PARSER
> > >
> > >                 bool "Use hush 2021 parser"
> > >
> > > +               default y if !VENDOR_KM
> > >
> > >                 help
> > >
> > >                   This option enables the new flavor of hush based on hush
> > >                   Busybox from
> > >                   2021.
> > >
> > > diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c
> > > index 93796e87c5..78a13eeb62 100644
> > > --- a/common/cli_hush_upstream.c
> > > +++ b/common/cli_hush_upstream.c
> > > @@ -427,7 +427,6 @@
> > >
> > >  #include "NUM_APPLETS.h"
> > >  #if NUM_APPLETS == 1
> > >  /* STANDALONE does not make sense, and won't compile */
> > >
> > > -# undef CONFIG_FEATURE_SH_STANDALONE
> > >
> > >  # undef ENABLE_FEATURE_SH_STANDALONE
> > >  # undef IF_FEATURE_SH_STANDALONE
> > >  # undef IF_NOT_FEATURE_SH_STANDALONE
> > >
> > > diff --git a/configs/bk4r1_defconfig b/configs/bk4r1_defconfig
> > > index 66adeac725..95f0c30cde 100644
> > > --- a/configs/bk4r1_defconfig
> > > +++ b/configs/bk4r1_defconfig
> > > @@ -18,6 +18,7 @@ CONFIG_TARGET_BK4R1=y
> > >
> > >  CONFIG_SYS_LOAD_ADDR=0x82000000
> > >  CONFIG_SYS_MEMTEST_START=0x80010000
> > >  CONFIG_SYS_MEMTEST_END=0x87c00000
> > >
> > > +CONFIG_LTO=y
> > >
> > >  CONFIG_HAS_BOARD_SIZE_LIMIT=y
> > >  CONFIG_BOARD_SIZE_LIMIT=520192
> > >  CONFIG_FIT=y
> > >
> > > diff --git a/configs/sheevaplug_defconfig b/configs/sheevaplug_defconfig
> > > index 2e4901b840..365f779cc8 100644
> > > --- a/configs/sheevaplug_defconfig
> > > +++ b/configs/sheevaplug_defconfig
> > > @@ -16,6 +16,7 @@ CONFIG_ENV_OFFSET=0x80000
> > >
> > >  CONFIG_DEFAULT_DEVICE_TREE="kirkwood-sheevaplug"
> > >  CONFIG_IDENT_STRING="\nMarvell-Sheevaplug"
> > >  CONFIG_SYS_LOAD_ADDR=0x800000
> > >
> > > +CONFIG_LTO=y
> > >
> > >  CONFIG_HAS_BOARD_SIZE_LIMIT=y
> > >  CONFIG_BOARD_SIZE_LIMIT=524288
> > >  CONFIG_BOOTDELAY=3
> > >
> > > --
> > > 2.34.1
>
>
> Best regards.
>
>
diff mbox series

Patch

diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S
index de15d09e36..a1f44d9454 100644
--- a/arch/arm/lib/lib1funcs.S
+++ b/arch/arm/lib/lib1funcs.S
@@ -419,4 +419,21 @@  ENTRY(__gnu_thumb1_case_uhi)
 	ret	lr
 ENDPROC(__gnu_thumb1_case_uhi)
 .popsection
+
+/* Taken and adapted from: https://github.com/gcc-mirror/gcc/blob/4f181f9c7ee3efc509d185fdfda33be9018f1611/libgcc/config/arm/lib1funcs.S#L2156 */
+.pushsection .text.__gnu_thumb1_case_si, "ax"
+ENTRY(__gnu_thumb1_case_si)
+	push	{r0, r1}
+	mov	r1, lr
+	adds	r1, r1, #2	/* Align to word.  */
+	lsrs	r1, r1, #2
+	lsls	r0, r0, #2
+	lsls	r1, r1, #2
+	ldr	r0, [r1, r0]
+	adds	r0, r0, r1
+	mov	lr, r0
+	pop	{r0, r1}
+	mov	pc, lr		/* We know we were called from thumb code.  */
+ENDPROC(__gnu_thumb1_case_si)
+.popsection
 #endif
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 1b9d04680d..d4809fcfa4 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -28,7 +28,7 @@  menu "Hush flavor to use"
 
 	config HUSH_OLD_PARSER
 		bool "Use hush old parser"
-		default y
+		default y if VENDOR_KM
 		help
 		  This option enables the old flavor of hush based on hush Busybox from
 		  2005.
@@ -37,6 +37,7 @@  menu "Hush flavor to use"
 
 	config HUSH_2021_PARSER
 		bool "Use hush 2021 parser"
+		default y if !VENDOR_KM
 		help
 		  This option enables the new flavor of hush based on hush Busybox from
 		  2021.
diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c
index 93796e87c5..78a13eeb62 100644
--- a/common/cli_hush_upstream.c
+++ b/common/cli_hush_upstream.c
@@ -427,7 +427,6 @@ 
 #include "NUM_APPLETS.h"
 #if NUM_APPLETS == 1
 /* STANDALONE does not make sense, and won't compile */
-# undef CONFIG_FEATURE_SH_STANDALONE
 # undef ENABLE_FEATURE_SH_STANDALONE
 # undef IF_FEATURE_SH_STANDALONE
 # undef IF_NOT_FEATURE_SH_STANDALONE
diff --git a/configs/bk4r1_defconfig b/configs/bk4r1_defconfig
index 66adeac725..95f0c30cde 100644
--- a/configs/bk4r1_defconfig
+++ b/configs/bk4r1_defconfig
@@ -18,6 +18,7 @@  CONFIG_TARGET_BK4R1=y
 CONFIG_SYS_LOAD_ADDR=0x82000000
 CONFIG_SYS_MEMTEST_START=0x80010000
 CONFIG_SYS_MEMTEST_END=0x87c00000
+CONFIG_LTO=y
 CONFIG_HAS_BOARD_SIZE_LIMIT=y
 CONFIG_BOARD_SIZE_LIMIT=520192
 CONFIG_FIT=y
diff --git a/configs/sheevaplug_defconfig b/configs/sheevaplug_defconfig
index 2e4901b840..365f779cc8 100644
--- a/configs/sheevaplug_defconfig
+++ b/configs/sheevaplug_defconfig
@@ -16,6 +16,7 @@  CONFIG_ENV_OFFSET=0x80000
 CONFIG_DEFAULT_DEVICE_TREE="kirkwood-sheevaplug"
 CONFIG_IDENT_STRING="\nMarvell-Sheevaplug"
 CONFIG_SYS_LOAD_ADDR=0x800000
+CONFIG_LTO=y
 CONFIG_HAS_BOARD_SIZE_LIMIT=y
 CONFIG_BOARD_SIZE_LIMIT=524288
 CONFIG_BOOTDELAY=3