zynq7000-rt: small bugs in startup code #26

Merged
muellerr merged 2 commits from mohr/fixes into main 2025-11-28 14:52:04 +01:00
Owner
  • MMU was enabled before MMU table (within .data) was copied into place. No effect in this configuration because MMU table was already in place as the code is run from RAM: > DATA AT>CODE is reduced to > CODE by REGION_ALIAS("DATA", CODE); in memory.x.
  • Added shortcut if .data is already in place as this should be the default case for zynq (.data will be in RAM and loaded by FSBL as part of the binary)
  • r1 was used to mask CPSR but was overwritten in previous step -> replaced by write to cpsr_c (which masks the correct bits).
  • Minor nitpicking: .addr() is more correct than as u32 (see docs)
- MMU was enabled before MMU table (within .data) was copied into place. No effect in this configuration because MMU table was already in place as the code is run from RAM: ` > DATA AT>CODE` is reduced to `> CODE` by `REGION_ALIAS("DATA", CODE);` in memory.x. - Added shortcut if .data is already in place as this should be the default case for zynq (.data will be in RAM and loaded by FSBL as part of the binary) - r1 was used to mask CPSR but was overwritten in previous step -> replaced by write to `cpsr_c` (which masks the correct bits). - Minor nitpicking: `.addr()` is more correct than `as u32` (see [docs](https://doc.rust-lang.org/std/primitive.pointer.html#method.addr))
mohr added 1 commit 2025-11-28 13:31:48 +01:00
zynq7000-rt: small bugs in startup code
Some checks failed
ci / Check build (push) Has been cancelled
ci / Check formatting (push) Has been cancelled
ci / Check Documentation Build (push) Has been cancelled
ci / Clippy (push) Has been cancelled
ci / Check build (pull_request) Has been cancelled
ci / Check formatting (pull_request) Has been cancelled
ci / Check Documentation Build (pull_request) Has been cancelled
ci / Clippy (pull_request) Has been cancelled
52e17c739d
Owner

Are those bugs in the Xilinx startup files as well then? Because a lot of the stuff is copied from the XIlinx startup..

I'll check the xilinx startup code again.

Are those bugs in the Xilinx startup files as well then? Because a lot of the stuff is copied from the XIlinx startup.. I'll check the xilinx startup code again.
Author
Owner

Negative, Xilinx has the MMU table as section in the linker (no copy needed) and reloads r1 before masking CPSR.

Negative, Xilinx has the MMU table as section in the linker (no copy needed) and reloads r1 before masking CPSR.
Owner

That must have been lost when merging the aarch32 rt and the xilinx specific code.

That must have been lost when merging the aarch32 rt and the xilinx specific code.
Owner

LGTM and thanks for finding this! Can you update the CHANGELOG?

LGTM and thanks for finding this! Can you update the CHANGELOG?
mohr added 1 commit 2025-11-28 14:50:02 +01:00
Changelog
Some checks failed
ci / Check build (pull_request) Has been cancelled
ci / Check formatting (pull_request) Has been cancelled
ci / Check Documentation Build (pull_request) Has been cancelled
ci / Clippy (pull_request) Has been cancelled
ci / Check build (push) Has been cancelled
ci / Check formatting (push) Has been cancelled
ci / Check Documentation Build (push) Has been cancelled
ci / Clippy (push) Has been cancelled
df0fc1acc3
muellerr merged commit 0235e1d769 into main 2025-11-28 14:52:04 +01:00
muellerr deleted branch mohr/fixes 2025-11-28 14:52:04 +01:00
Sign in to join this conversation.