-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Raspberry Pi 4] Add an option to disable "Low Peripheral" mode #1374
Comments
This is something which would probably already have been done were it not for the fact that the 32-bit ARM kernels don't support the "spin-table" mechanism for waking the secondary CPU cores (although with enough effort I'm sure it could be added). Currently we use some mailbox registers to synchronise the starting of the secondary cores, and in high-peripherals mode these would no longer have a 32-bit physical address. We (I) don't want to have to add LPAE support to the 32-bit stub (<100 instructions that run before entering the kernel), meaning that the mailboxes would be out of reach of the stub. LPAE is unnecessary on a 64-bit ARM, so we could reserve the high-peri support for 64-bit builds - wait until the 5.4 switchover is complete and this may happen. |
Is there a way to switch the layout dynamically from the Arm cores? e.g. something that low level kernel/bootloader/firmware entry code could do? Or could it become a config.txt option? |
The controlling register requires a secure write, which only the VPU can do. However, there is a way you can try it. Firmware releases since the 26th March 2020 have supported a new config.txt setting - Three important caveats:
|
Also what about the 64-bit stub? It appears to write to hardcoded ARM-local addresses (LOCAL_CONTROL, LOCAL_PRESCALER, and GIC stuff). |
All those things will need changing, but the source code and tools are available. This is not for the faint-hearted, and it is not supported. |
Is there anything other than the stubs that is executed before the kernel and relies on fixed addresses? |
No - the stubs are by definition the first instructions executed by the ARMs. |
OK, it seems to work. I tested ethernet, USB 3, and display output. However, the firmware still doesn't report the last 64M of RAM as usable:
|
That makes sense. The code that generates the contents of the |
I have a patch for internal testing which is simple enough to be correct by inspection, but if you share your .dts/.dtb file I can test it (along with your stub PR). |
I'm working on making it usable. Give me 15 minutes. Now that you've explained how high peripheral mode can be enabled, should I close this issue and open another one for the remaining memory and one for the stub? |
You've got the PR for the stub which doubles as an issue, and the memory patch is already well under way, so at this point I think more issues would just get in the way. Thanks for asking, though. |
I've also got it booting now. The firmware is auto-detecting the high-peri DTB and setting the config flag:
It's also declaring the memory correctly:
The iomem info also looks good (N.B. it was all zeroes until I randomly sudo'd it):
At this point I need to:
|
Is that with the firmware fix you talked about?
I can do that if you prefer. |
Yes. The patch is merged now, so will be in the next release.
That would be great, if you have the time. |
With 3 taken care of (thanks), the list is now:
All are fairly small tasks, and should be done in the next few days. |
kernel: Revert USB: hub: Don't record a connect-change event during reset-resume See: raspberrypi/linux#3546 firmware: arm_loader: Make 4GB available if arm_peri_high firmware: arm_loader: Complete arm_peri_high support See: #1374 firmware: board_info: Split Model B into rev1 and rev2 See: raspberrypi/linux#3537
kernel: Revert USB: hub: Don't record a connect-change event during reset-resume See: raspberrypi/linux#3546 firmware: arm_loader: Make 4GB available if arm_peri_high firmware: arm_loader: Complete arm_peri_high support See: raspberrypi/firmware#1374 firmware: board_info: Split Model B into rev1 and rev2 See: raspberrypi/linux#3537
I tested the latest firmware update and it fixes the remaining items on the list. Note that for me pcie works (a USB 3 HDD is probed and mounted) even if I keep the commit that removes one of the
If I set
I think the reason is that the inbound window setup uses |
kernel: Revert USB: hub: Don't record a connect-change event during reset-resume See: raspberrypi/linux#3546 firmware: arm_loader: Make 4GB available if arm_peri_high firmware: arm_loader: Complete arm_peri_high support See: raspberrypi/firmware#1374 firmware: board_info: Split Model B into rev1 and rev2 See: raspberrypi/linux#3537
According to the BCM2711 datasheet, the ARM core can use one of two physical address layouts:
In "Low Peripheral" mode, peripherals are mapped over the last 64M of RAM. If that RAM can otherwise be used, a firmware update that lets people disable "Low Peripheral" mode would literally let them "download more RAM".
The text was updated successfully, but these errors were encountered: