Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch: arm: cortex_a_r: Improve support for big endian #72693

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sigmundklaa
Copy link

This enables support for big endian Cortex A/R devices. The pull request consists of two changes:

  • Set PROPERTY_OUTPUT_FORMAT to elf32-bigarm when CONFIG_BIG_ENDIAN=y
  • Set the endianness bit of the CPSR register, ensuring that the CPU stays in big endian mode when switching to the main thread. Without this, data accesses used the wrong endianness, causing a (very big) headache.

The CPSR issue was the only problem I noticed when porting the TMS570LS1224 big endian Cortex R4F SoC. With this fixed, it seems to work completely fine. My setup is available at https://github.com/OrbitNTNU/zephyr-hw if that is relevant.

When this bit is not set, it defaults to 0 (little endian). This
causes issues for big-endian devices, as data will be accessed using
little endian.

Signed-off-by: Sigmund Klåpbakken <sigmundklaa@outlook.com>
Sets the property `PROPERTY_OUTPUT_FORMAT` to `elf32-bigarm` when
`CONFIG_BIG_ENDIAN` is set to `y`.

Signed-off-by: Sigmund Klåpbakken <sigmundklaa@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Architectures area: ARM ARM (32-bit) Architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants