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

Settings not getting saved with upstream spl build #188

Open
moritz-meier opened this issue Feb 13, 2025 · 2 comments
Open

Settings not getting saved with upstream spl build #188

moritz-meier opened this issue Feb 13, 2025 · 2 comments

Comments

@moritz-meier
Copy link

I am building some Nix packages for this project. moritz-meier/edk2-rk3588-nix. With the prebuild blobs (spl, bl31, bl32, dts, mkimage) from this repo this works pretty well, but now i am also trying to replace those with upstream builds.

This works mostly. When i use an upstream uboot-spl build the retention of the settings does not work. I figured out that the data never gets written into the spi flash. The nvdata region (flash addr: 0x7C0000, size: 0x30000) always reads 0xff.ff...

With the prebuild rk3588_spl_v1.12.bin it works, with an upstream build it does not, even tho the edk build is the same.

I don't really understand why this depends on the spl. Does the edk have any requirements for the spi flash state/configuration when booting? Does the edk directly write into the flash via spi commands or does the edk somehow expect the flash to be memory mapped into the global address space / ahb system bus?

Does someone have an idea what could cause this behavior?

Here is a build (and the artifacts) with the upstream uboot-spl for the orangepi-5plus: https://github.com/moritz-meier/edk2-rk3588-nix/blob/main/build-upstream.zip

@mariobalanica
Copy link
Collaborator

EDK2 relies on Rockchip's SPL to populate an ATAG with the device type (FSPI/SD/eMMC) from which it decided to load our firmware, so we can know which one to use for NVRAM. Upstream SPL doesn't appear to support this.

Now it depends less on it (437888c) because some vendor SPL builds are broken and lie about the boot device when using SD/eMMC. This hasn't been necessary for FSPI, and so that remains the only case where we still require that ATAG.

There might be other compatibility issues with the upstream SPL that I'm not immediately aware of.

@moritz-meier
Copy link
Author

thanks. that clarified this for me.

When i patch out the reading of the boot-device atag rkfvbdxe.c and set it directly to spi flash, it works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants