-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
RPi3 CONFIG_VMSPLIT_3G #1394
Comments
With a 3G/1G split, the kernel virtual addresses can only cover 768MB (lowmem) because address space is needed for other areas such as the 240MB vmalloc area:
On Pi2 and Pi3 the top 16MB of RAM is not addressable by the ARM because the peripherals are mapped there, leaving 240MB of RAM that is physically addressable but can't be used without temporarily mapping it into the vmalloc or other area; this is what enabling highmem does. You could shrink the vmalloc area (and others), but the problem will remain to some extent. The reason the kernel doesn't boot with a 3G/1G split is down to the placement of the initial Device Tree blob. It used to be located at 0x100, but this limits it to (0x4000 - 0x100 = 0x3f00) bytes (about 16KB), and some users have already exceeded this limit with sizeable (but reasonable) overlays. One of the first things the kernel does is "unflatten" the DTB, building internal data structures that are more convenient to work with. After this point, the source memory is free to be used for something else. I changed the firmware logic to place the DTB at the top of memory (just below the space reserved for the GPU and the initrd/initramfs), which works well with the 2G/2G split but can be too high for 3G/1G - the kernel faults trying to copy it. The next (or next but one) firmware release will place a 768MB cap on the initial DTB (and initrd/initramfs) placement, avoiding this booting problem. Until then you achieve the same result by setting gpu_mem=240 (or higher), although this reduces the total memory usable by the ARM. |
By the way, the Pi2 is no different to the Pi3 in this respect, except that you will see "Uncompressing Linux... done, booting the kernel." on the UART before it crashes silently. Do you have a larger gpu_mem on your Pi2 card? |
On my configuration I used gpu_mem=256. This might have enabled RPi2 operation. |
It works for me on a Pi3. My config.txt:
My boot log start:
You could try |
There was a mistake that gpu_mem=256 was not correctly applied to config.txt in my RPi3 boot partition. So, I cross checked that RPi3 VMSPLIT_3G boot-up failure could be avoided by larger (>=240) gpu_mem value in config.txt. Thanks. |
Let's keep this issue open until the firmware takes care of it automatically. |
See: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=136445 firmware: IL ISP: Correct RGB to YUV matrices, and ignore code side info firmware: MJPEG encode: Handle stereoscopic images See: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=138325&p=918041 firmware: IL Camera: Change unspecified colour space to being JFIF See: raspberrypi/userland#78 firmware: OV5647: Option to configure auto lens shading to use potential fix firmware: arm_loader: Factor out DT support into arm_dt See: raspberrypi/linux#1394 firmware: arm_ldconfig: Switch to using arm stubs generated from tools/mkimage firmware: arm_ldconfig: Support loading arm stubs from file See: #579
See: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=136445 firmware: IL ISP: Correct RGB to YUV matrices, and ignore code side info firmware: MJPEG encode: Handle stereoscopic images See: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=138325&p=918041 firmware: IL Camera: Change unspecified colour space to being JFIF See: raspberrypi/userland#78 firmware: OV5647: Option to configure auto lens shading to use potential fix firmware: arm_loader: Factor out DT support into arm_dt See: raspberrypi/linux#1394 firmware: arm_ldconfig: Switch to using arm stubs generated from tools/mkimage firmware: arm_ldconfig: Support loading arm stubs from file See: raspberrypi/firmware#579
Latest rpi-update firmware has a potential fix for this. |
On my Pi3 configuration, new firmware on following commit does not fix the issue. (made it worse) With previous version firmware, |
There is new rpi-update firmware that should fix this problem. |
Tried firmware on following commit, but shows same problems as before : I keep staying on following older version : |
I believe e968a4 has broken device_tree_address attribute. I have this in my config.txt: disable_commandline_tags=0 It works fine with u-boot on 0a96f63 but on e968a4e I get Memory at 0x100 contains ATAG sequence. So it seems device_tree_address is ignored |
@gonzoua I suspect the firmware thinks the 4.4 DTB is too large. Some part of the Linux kernel, perhaps the built-in decompressor, is using the memory from 0x4000-0x8000, so if you start at 0x100 the firmware only has about 16KB to play with. The DT compiler in the 4.4 tree generates larger output files than before. I should be able to get the firmware to strip out some unnecessary extras, but I haven't done this yet so you are probably hitting the 0x3f00-byte limit. If you are using U-boot then the 0x4000 limit probably doesn't apply; you can tell the firmware this by setting |
@gonzoua I had the same problem. The only way I got to boot FreeBSD with this new firmware and with the latest u-boot was to remove the disable_commandline_tags line from config.txt and tag the u-boot.bin binary :-( with: perl mkknlimg --dtok /Volumes/BOOT/U-BOOT.BIN.UNTAGGED /Volumes/BOOT/U-BOOT.BINNow another Linux dependency in our workflow. I tried all other combination disable_commandline_tags=[0,1,2] with tagged and untagged, that is the only one which works. I guess we have to update our u-boot RPI 1 & 2 ports. In such case, a recent u-boot commit (don't know which one but less than 10 days old) made reading from the MMC 6x faster! I was reading ubldr.bin and kernel @ 700 kB/s and now u-boot reading speed is showing 5 MB/s. Let's try to use in our ports a recent u-boot GIT commit then, which takes this improvement into account :-) |
@pelwell Would you make the firmware trust the "kernel" it loads is DTB compliant by default so that we don't need to tag it anymore? I believe you already have done the same thing when in 64bits mode. |
Yes, it's going to happen. |
As of yesterday's firmware release (f063c24a8307ae57040eda58f4751a97efdf7ab8), the kernel is assumed to be DT-capable by default:
|
@pelwell You're right, I no longer need to tag u-boot to make it use the DT and pass it to the FreeBSD kernel. No more disable_commandline_tags is necessary in config.txt now. |
I just don't manage to boot our kernel directly however, I still need u-boot. But it may be FreeBSD-kernel related. |
See: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=136445 firmware: IL ISP: Correct RGB to YUV matrices, and ignore code side info firmware: MJPEG encode: Handle stereoscopic images See: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=138325&p=918041 firmware: IL Camera: Change unspecified colour space to being JFIF See: raspberrypi/userland#78 firmware: OV5647: Option to configure auto lens shading to use potential fix firmware: arm_loader: Factor out DT support into arm_dt See: raspberrypi/linux#1394 firmware: arm_ldconfig: Switch to using arm stubs generated from tools/mkimage firmware: arm_ldconfig: Support loading arm stubs from file See: raspberrypi#579
I hope this is ok to ask here, but is it (theoretically) possible that a change could be made so that CONFIG_VMSPLIT setting could be placed controlled via config.txt (or similar), rather than requiring a kernel recompile? It is useful for certain emulation purposes (eg notaz/pcsx_rearmed#71) but would prefer to stick to regular raspian if possible. |
No, it requires a rebuilt kernel. You could build a second kernel, call it kernel7_3g.img and choose which kernel to use in config.txt (kernel=kernel7_3g.img). |
Closing as original issue is resolved. |
See: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=136445 firmware: IL ISP: Correct RGB to YUV matrices, and ignore code side info firmware: MJPEG encode: Handle stereoscopic images See: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=138325&p=918041 firmware: IL Camera: Change unspecified colour space to being JFIF See: raspberrypi/userland#78 firmware: OV5647: Option to configure auto lens shading to use potential fix firmware: arm_loader: Factor out DT support into arm_dt See: raspberrypi/linux#1394 firmware: arm_ldconfig: Switch to using arm stubs generated from tools/mkimage firmware: arm_ldconfig: Support loading arm stubs from file See: raspberrypi#579
For some applications, we need user/kernel address split of 3G/1G - rather than default 2G/2G.
Until RPi2, modifying kernel source's (github.com/raspberrypi/linux) bcm2709_defconfig
from CONFIG_VMSPLIT_2G to CONFIG_VMSPLIT_3G, and recompiling the kernel - works fine.
On RPi3, modifying it blocks kernel booting. With VMSPLIT_2G, kernel & OS are working fine.
But with VMSPLIT_3G, kernel shows nothing on HDMI output neither on serial console.
I have tried on a few branches - rpi-4.1.y / rpi-4.2.y / rpi-4.5.y - and results were same,
and used device tree files were bcm2709-rpi-2-b.dtb & bcm2710-rpi-3-b.dtb for matched RPi boards.
The text was updated successfully, but these errors were encountered: