-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
rpi-4.19 doesn't boot on RPI 4 with multi_v7_defconfig #3057
Comments
Good luck - I'm very curious to see what you find. |
Didn't have much time for investigation. Current state is that the initial call of dma_set_mask_and_coherent() fails. This function seems to fail because dma_supported returns with 0. |
I followed the error into __dma_supported() and got this message:
I'm looking into why, any ideas? |
Enabling ARM_LPAE fixes the issue for multi_v7_defconfig. The option is enabled in bcm2711_defconfig. With ARM_LPAE enabled, phys_addr_t is defined as a 64bit value, as opposed to the default, which is 32bit. I guess someone is making a wrong type/size assumption somewhere. |
Okay, i was assuming that Raspbian kernel7.img is the non-LPAE variant and kernel7l.img is the LPAE variant of the same kernel. But it seems that both are the LPAE one. At least i've found a workaround for the DMA issue by removing
in this commit 278f37a |
@pelwell Could you provide some info on the dma addressing limitations? I've seen this:
In other words, dma addresses start at 0xc0000000 with a maximum ~1GB size aliased to 0x00000000 which is the beginning of RAM. This seems to be working fine as long as the kernel doesn't map it's buffers outside the first GB of RAM. Sadly depending on the 32bit config and on 64bit in general, dma coherent allocations are located on the top of the memory. Which generates nasty 64bit dma addresses that break the mailbox and other devices. For example, the last dma_alloc_coherent I logged (on a 64bit kernel/4GB device) has this physical address: 0xf8000000 which is translated to this dma address: 0x1b8000000. Which the mailbox isn't prepare to handle (AFAIK). I think this also affects dma_supported() internals, which failed without @lategoodbye's fix. |
It sounds like you understand the limitations, just not how to overcome them. Do you remember that dma_zone_size patch that Stefan reverted? That will limit the coherent pool to the first 1GB. |
Just for the report, my intention wasn't to revert the dma_zone_size patch. The idea was to make it unconditional. |
@vianpl @lategoodbye Even making |
Please follow this discussion: |
If only it was that easy - score one for GiHub, The discussion seems to have dried up. |
I'm still looking into the issue, but getting confident with the DMA code takes time... I was planning on doing a small write-up on the issues to solve. Even maybe a small RFC where I generate the If anyone's curious, there are more semi related DMA addressing issues with PCI https://patchwork.kernel.org/patch/10605957/. BTW do we know if Broadcom is working on a follow up of this? @agherzan In the meantime if you want to play around I managed to get a working setup with this:
|
This works great. Anyone sees any downsides of it? Shall we include it in the rpi fork? |
@pelwell do you have any idea if the new firmware switches to 64bit mode automatically based on kernel filename? Do we still need to force it in the config? |
The current firmware will load a kernel8.img if found and place the Pi in 64-bit mode. The old arm_control flag should still work, but the preferred mechanism to force 64-bit is with "arm_64bit=1". The very latest rpi-update firmware lets you disable 64-bit mode with "arm_64bit=0". Using an explicitly named kernel, provided the name includes "8.img" and there is an external stub file named "armstub8-gic.bin" or "armstub8.bin" (or an explicitly named stub including "8.bin") then it will also enter 64-bit mode. |
@vianpl Regarding to pcie-brcmstb, i tried to contact the original author but didn't get any feedback. For my initial RPi 4 series, i will try to concentrate on the known parts to get at least a booting system which is accessible via serial console. |
@pelwell This doesn't seem to happen with the latest release: https://github.com/raspberrypi/firmware/releases/tag/1.20190709 . I had to force it using |
I've had the opposite experience, when I wanted it to ignore the V8 kernel and it wouldn't, so this bit of the loader clearly needs some work. |
@pelwell should I create an issue for this? I've just retested this just to double check. |
It's going to be a low priority as long as forcing the 64bit-ness works, but an issue is a good place for discussion and tracking. |
HDMI sound fix Hifiberry DAC+DSP soundcard driver ...and many other stuff
I think we can close this. |
I compiled the rpi-4.19 branch of this repo with multi_v7_defconfig. After replacing the original kernel image on my Raspbian Buster, the kernel stuck on RPI 4 (4 GB RAM) at mounting the rootfs. But there are more critical issues before:
I'll try to investigate further.
dmesg.log
The text was updated successfully, but these errors were encountered: