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

overlays: Add pcie-32bit-dma-pi5-overlay to enable 32bit DMA on the Pi 5's external PCIe interface #5897

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

RodrigoRosmaninho
Copy link
Contributor

@RodrigoRosmaninho RodrigoRosmaninho commented Jan 25, 2024

The pcie-32bit-dma dts overlay is only compatible with CM4 and does not work for the Pi 5 and its external PCIe interface.
This PR adds a new overlay "pcie-32bit-dma-pi5-overlay" with a fix based on #4216 and #4870.

In this case, the target component is pcie1, and the dma-ranges attribute changes from:
dma-ranges = <0x03000000 0x10 0x00000000 0x00 0x00000000 0x10 0x00000000>;
to:
dma-ranges = <0x03000000 0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>;
in order to ensure that the DMA addressing space is 32bits, at the expense of having to bounce buffers.

I've confirmed that this functions correctly on a Raspberry Pi 5 connected to Pineberry Pi's "Hat AI!", to which I plugged in a MikroTik R11e-5HnD (Atheros AR9580) wireless card.

Issue Link: #5896

Thanks:

  • @vianpl
  • @6by9
  • @geerlingguy
  • Network Architectures and Protocols Group - Instituto de Telecomunicações (Aveiro, Portugal)

@RodrigoRosmaninho RodrigoRosmaninho changed the title overlays: Add pcie-32bit-dma-overlay-pi5 to enable 32bit DMA on the Pi 5's external PCIe interface overlays: Add pcie-32bit-dma-pi5-overlay to enable 32bit DMA on the Pi 5's external PCIe interface Jan 25, 2024
@RodrigoRosmaninho
Copy link
Contributor Author

I have corrected an oversight on my part on the original commit. The dtoverlay workflow check should pass now.
Please let me know if any issues remain.

…rnal PCIe

Changes dma-ranges in the pcie1 component of the bcm2712 dts in order to ensure that the DMA addressing space is 32bits, at the expense of having to bounce buffers.

Signed-off-by: Rodrigo Rosmaninho <r.rosmaninho@ua.pt>
@pelwell pelwell merged commit 1cdbd99 into raspberrypi:rpi-6.1.y Jan 26, 2024
11 of 12 checks passed
@schuschu
Copy link

Probably sightly off topic, but is it possible to (optionally) also have the MSI vector in the 32 bit address space? Using a slightly newer ath11k card (QCNFA765) this seems to be an issue (Raspberry Pi 5, other cards from intel using iwlwifi and mediatek using mt7921/22 kernel modules work just fine).

[    5.445255] ath11k_pci 0000:01:00.0: BAR 0: assigned [mem 0x1b00000000-0x1b001fffff 64bit]
[    5.445282] ath11k_pci 0000:01:00.0: enabling device (0000 -> 0002)
[    5.445417] ath11k_pci 0000:01:00.0: arch assigned 64-bit MSI address 0xffffffe000 but device only supports 32 bits
[    5.445464] ath11k_pci 0000:01:00.0: failed to enable msi: -22
[    5.446728] ath11k_pci: probe of 0000:01:00.0 failed with error -22

@pelwell
Copy link
Contributor

pelwell commented Jan 31, 2024

AFAIK not without restricting the inbound window to the bottom 2GB of RAM: https://github.com/raspberrypi/linux/blob/rpi-6.1.y/drivers/pci/controller/pcie-brcmstb.c#L1269-L1279 (bearing in mind that BARs are power-of-2-sized).

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Feb 8, 2024
See: raspberrypi/linux#5923

kernel: overlays: Delete deprecated overlay mpu6050

kernel: overlays: Correct some compatible strings

kernel: ASoC: DACplusADCPro - fix 16bit sample support in clock consumer mode
See: raspberrypi/linux#5919

kernel: ASoC: adds support for Hifiberry AMP4Pro to the dacplus driver
See: raspberrypi/linux#5918

kernel: ASoC: DACplus - fix 16bit sample support in clock consumer mode
See: raspberrypi/linux#5917

kernel: Improve I2C timing (again)
See: raspberrypi/linux#5916

kernel: Update PiTFT overlays for compatibility and consistency
See: raspberrypi/linux#5903

kernel: Support non-standard I2C timings on Pi 5
See: raspberrypi/linux#5853

kernel: overlays: Add pcie-32bit-dma-pi5-overlay to enable 32bit DMA on the Pi 5's external PCIe interface
See: raspberrypi/linux#5897

kernel: Improvement on backup-switchover-mode overlay value definitions
See: raspberrypi/linux#5884

kernel: Pisound updates for Pi 5
See: raspberrypi/linux#5872
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Feb 8, 2024
See: raspberrypi/linux#5923

kernel: overlays: Delete deprecated overlay mpu6050

kernel: overlays: Correct some compatible strings

kernel: ASoC: DACplusADCPro - fix 16bit sample support in clock consumer mode
See: raspberrypi/linux#5919

kernel: ASoC: adds support for Hifiberry AMP4Pro to the dacplus driver
See: raspberrypi/linux#5918

kernel: ASoC: DACplus - fix 16bit sample support in clock consumer mode
See: raspberrypi/linux#5917

kernel: Improve I2C timing (again)
See: raspberrypi/linux#5916

kernel: Update PiTFT overlays for compatibility and consistency
See: raspberrypi/linux#5903

kernel: Support non-standard I2C timings on Pi 5
See: raspberrypi/linux#5853

kernel: overlays: Add pcie-32bit-dma-pi5-overlay to enable 32bit DMA on the Pi 5's external PCIe interface
See: raspberrypi/linux#5897

kernel: Improvement on backup-switchover-mode overlay value definitions
See: raspberrypi/linux#5884

kernel: Pisound updates for Pi 5
See: raspberrypi/linux#5872
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

Successfully merging this pull request may close these issues.

4 participants