[PATCH 04/10] xtensa: Define PLATFORM_ELFFLAGS

Max Filippov jcmvbkbc at gmail.com
Wed May 22 09:09:29 CEST 2024


On Tue, May 21, 2024 at 12:12 AM Max Filippov <jcmvbkbc at gmail.com> wrote:
> On Mon, May 20, 2024 at 9:00 AM Jiaxun Yang <jiaxun.yang at flygoat.com> wrote:
> > >> diff --git a/arch/xtensa/config.mk b/arch/xtensa/config.mk
> > >> index b0809999e403..3ec936272f25 100644
> > >> --- a/arch/xtensa/config.mk
> > >> +++ b/arch/xtensa/config.mk
> > >> @@ -7,3 +7,6 @@ PLATFORM_CPPFLAGS += -D__XTENSA__ -mlongcalls -mforce-no-pic \
> > >>                      -ffunction-sections -fdata-sections
> > >>
> > >>  LDFLAGS_FINAL += --gc-sections
> > >> +
> > >> +PLATFORM_ELFFLAGS += -B xtensa -O elf32-xtensa-le
> > >> +
> > >
> > > This fixes endianness as little for the whole architecture, but xtensa cores
> > > may be either little or big endian.
> >
> > Thanks for reviewing, I can just add a branch with ifdef CONFIG_SYS_BIG_EDNIAN
> > if you wish, but I think all CPUs U-Boot support are little endian only?
> >
> > I have an ongoing series[1] fixing endian selection options, please let me know if
> > U-Boot do work with big endian Xtensa.
>
> I had an impression that there's nothing endian-specific in the xtensa port,
> so it should work for both little- and big-endian cores. Let me test whether
> it's true though (:

Yep, I can confirm that. Importing big endian xtensa core files into the current
u-boot (I tested this one:
  https://github.com/jcmvbkbc/xtensa-toolchain-build/blob/master/overlays/xtensa_test_kc705_be.tar.gz
matching cross-compiler is available here:
  https://github.com/foss-xtensa/toolchain/releases/download/2019.03/x86_64-2019.03-xtensa-test_kc705_be-elf.tar.gz
)
and building it for xtfpga produces a working image.

-- 
Thanks.
-- Max


More information about the U-Boot mailing list