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

Locked out of mtdblock edk2 updates on orangepi 5 plus #140

Open
zuzzurro opened this issue May 5, 2024 · 12 comments
Open

Locked out of mtdblock edk2 updates on orangepi 5 plus #140

zuzzurro opened this issue May 5, 2024 · 12 comments

Comments

@zuzzurro
Copy link

zuzzurro commented May 5, 2024

I am using Fedora 40/rawhide on my orangepi 5 plus after having installed edk2 on the mtdblock device (latest nightly release version in order to get a working keyboard).
I can't update the firmware anymore because fedora doesn't see any mtd devices (using ACPI, it won't work, that's understood) and if I try using dtb the system just fails rebooting. Do you have a suggestion on how to break the deadlock?

@mariobalanica
Copy link
Collaborator

You need to use a DTB compatible with your kernel version. The one bundled with the firmware only works along Rockchip's SDK kernel.

Updating the firmware on SPI NOR is not currently supported with ACPI boot, so you'd have to use a separate computer.

@zuzzurro
Copy link
Author

zuzzurro commented May 9, 2024

OK, so let me have another go at this. Just to be clear, when you say "you need to use a DTB compatible with your kernel version" what do you mean precisely? Are you talking about https://github.com/edk2-porting/edk2-rk3588?tab=readme-ov-file#custom-device-tree-blob-dtb-override-and-overlays?

@mariobalanica
Copy link
Collaborator

Yes.

@zuzzurro
Copy link
Author

zuzzurro commented May 9, 2024

OK, thanks. So I actually have tried doing that but the system crashes and I cannot really see where. Initially it seemed to crash when accessing my nvme SATA 5 ports card but I will have to test again.
One more thing, if I understand correctly the dtb needs to be stored in the /boot/uefi vfat partition under /dtb/base, but Fedora puts the dtbs in /boot if I'm not wrong. Are you saying that this copy would need to be done manually every time there is a change in the dtb?

@mariobalanica
Copy link
Collaborator

It needs to be placed in the same partition as the bootloader, that is the FAT32 EFI System Partition.

Are you saying that this copy would need to be done manually every time there is a change in the dtb?

Yes, the firmware only looks in that specific location. You could probably load the DTB from another path with Grub instead.

@zuzzurro
Copy link
Author

zuzzurro commented May 20, 2024

Thanks, I was able to move on by using a separate computer.
Can you explain what can be expected to happen once the mainline kernel fully supports the rk3588 hardware? I think you mentioned somewhere that you use fedora as you development platform, so I assume you should know this very well.
In particular, is it going to be necessary to use edk2 for booting fedora or an update to u-boot will be enough? I'm thinking about arm-image-installer adding support for the various rk3588 boards out of the box.

@mariobalanica
Copy link
Collaborator

EDK2 vs U-Boot is just a matter of preference in this case, either will do provided you use a compatible device tree.

I am not up-to-date on the mainlining efforts, but the plan is to eventually include mainline DTBs for a few of the supported boards in EDK2, which would greatly simplify booting off-the-shelf distro images.

@zuzzurro
Copy link
Author

zuzzurro commented May 22, 2024

This is interesting. Are you actually testing it? And who's going to declare that a board is "supported"? From what I see the level of "support" is never black and white... Are you going to provide both a mainline DTB and a legacy one?

@mariobalanica
Copy link
Collaborator

mariobalanica commented May 22, 2024

Are you actually testing it?

Yeah, I'd need to test a few distros that have recent enough kernel by that time. So Fedora would be a candidate.

And who's going to declare that a board is "supported"?

"Supported" in the sense that I have validated it to boot and has reasonable functionality (goal is better than ACPI). For this, I am only going to pick popular boards that have decent mainline support.

Still missing functionality in Linux falls outside the scope of this project. Mainline DTBs will only be provided for convenience.

From what I see the level of "support" is never black and white

True. As soon as you leave Rockchip's legacy BSP, your mileage will greatly vary. Since most board vendors don't care about investing in mainline, proper firmware, etc, users are at the mercy of community support (i.e. if it even exists for the board in question). This has always been the case with SBCs.

Are you going to provide both a mainline DTB and a legacy one?

Yes, that's the plan.

@zuzzurro
Copy link
Author

zuzzurro commented Jun 2, 2024

So, 6.10.0rc1 exists on koji and I tried to run it. However (as I kind of expected) while panthor is compiled, is not loaded and if I try force loading it it doesn't get used.
I suspect this is again a matter of using a legacy DTB, but it also means I'm kind of stuck because as I said previously I suspect that if I try using the included DTB, SATA won't work and therefore I won't be able to load my installation.
I guess I'm still stuck until I find out how to unblock the SATA thing

@mariobalanica
Copy link
Collaborator

SATA likely needs a DT overlay. See: https://github.com/edk2-porting/edk2-rk3588?tab=readme-ov-file#device-tree-configuration for more info.

@zuzzurro
Copy link
Author

zuzzurro commented Jun 3, 2024

You mean something like this?

https://github.com/radxa/kernel/blob/linux-5.10-gen-rkr3.4/arch/arm64/boot/dts/rockchip/overlay/rock-5b-sata.dts

But for the pcie3 nvme slot?

And in my case (I'm just trying here...):

// ROCK 5B Pcie M.2 to sata
/dts-v1/;
/plugin/;

/ {
	fragment@0 {
		target = <&pcie3x4>;

		__overlay__ {
			status = "disabled";
		};
	};

	fragment@1 {
		target = <&sata1>;

		__overlay__ {
			status = "okay";
		};
	};
};

Or maybe just:

// ROCK 5B Pcie M.2 to sata
/dts-v1/;
/plugin/;

/ {
	fragment@0 {
		target = <&sata1>;

		__overlay__ {
			status = "okay";
		};
	};
};

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