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 Pi 5 version of dwc2 #5661

Merged
merged 1 commit into from
Oct 19, 2023
Merged

Conversation

pelwell
Copy link
Contributor

@pelwell pelwell commented Oct 19, 2023

Most bus masters on Pi 5 have access to at least the lower 4GB, but the old DWC OTG controller is still restricted to the first 1GB. Create a Pi 5-specific version of the overlay including a fragment that ensures the swiotlb bounce buffers are allocated in that area.

This PR replaces #5658.

@pelwell
Copy link
Contributor Author

pelwell commented Oct 19, 2023

@6by9 Can you confirm that this is a suitable alternative to #5658 (if we're nervous about placing unnecessary restrictions on RAM layout for all Pi 5s)?

@timg236
Copy link
Contributor

timg236 commented Oct 19, 2023

This seems like a good idea

@6by9
Copy link
Contributor

6by9 commented Oct 19, 2023

Should work - I'll double check in a mo.

Is it cleaner to use an include instead of being 50% duplication of dwc2-overlay.dts?

@popcornmix
Copy link
Collaborator

Yes, I prefer this solution.

@6by9
Copy link
Contributor

6by9 commented Oct 19, 2023

It works to the same level that I had the old "always apply the range" change did.

Most bus masters on Pi 5 have access to at least the lower 4GB, but
the old DWC OTG controller is still restricted to the first 1GB.
Create a Pi 5-specific version of the overlay including a fragment
that ensures the swiotlb bounce buffers are allocated in that
area.

Signed-off-by: Phil Elwell <[email protected]>
@pelwell
Copy link
Contributor Author

pelwell commented Oct 19, 2023

Is it cleaner to use an include instead of being 50% duplication of dwc2-overlay.dts?

Much cleaner - done.

@pelwell pelwell merged commit ff2db58 into raspberrypi:rpi-6.1.y Oct 19, 2023
12 checks passed
@6by9
Copy link
Contributor

6by9 commented Oct 19, 2023

Having said this worked, it looks like my system hadn't updated properly :-(

#5658 put a dma-ranges in /, whereas this puts it in /soc.
/soc already has a dma-ranges, and it doesn't get overwritten by the overlay.

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Oct 19, 2023
See: raspberrypi/linux#5661

kernel: Swap DT aliases from underscore to hyphen
See: raspberrypi/linux#5662

kernel: Add DT aliases to map to DRM card names
See: raspberrypi/linux#5629

kernel: Forcing /dev/fbN assignments for DRM cards
See: raspberrypi/linux#5660

kernel: dts: bcm2712: Use the new model name
See: https://forums.raspberrypi.com/viewtopic.php?p=2146474#p2146474
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Oct 19, 2023
See: raspberrypi/linux#5661

kernel: Swap DT aliases from underscore to hyphen
See: raspberrypi/linux#5662

kernel: Add DT aliases to map to DRM card names
See: raspberrypi/linux#5629

kernel: Forcing /dev/fbN assignments for DRM cards
See: raspberrypi/linux#5660

kernel: dts: bcm2712: Use the new model name
See: https://forums.raspberrypi.com/viewtopic.php?p=2146474#p2146474
@pelwell
Copy link
Contributor Author

pelwell commented Oct 19, 2023

it looks like my system hadn't updated properly :-(

Oh well.

/soc already has a dma-ranges, and it doesn't get overwritten by the overlay.

I would have expected that to be okay, but the dma-ranges above the zone_dma's dma-ranges must be interfering. I'll fix it.

@pelwell
Copy link
Contributor Author

pelwell commented Oct 19, 2023

Fixup pushed. Success looks like this:

$ pi@raspberrypi:~$ dmesg | grep -A3 "Zone ranges"
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000003fffffff]
[    0.000000]   DMA32    [mem 0x0000000040000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000001ffffffff]

@6by9
Copy link
Contributor

6by9 commented Oct 19, 2023

Previous patch

pi@bookworm64-rel:~ $ dmesg | grep -A3 "Zone ranges"
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x00000000ffffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000001ffffffff]

New

pi@bookworm64-rel:~ $ dmesg | grep -A3 "Zone ranges"
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000003fffffff]
[    0.000000]   DMA32    [mem 0x0000000040000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000001ffffffff]

:-)

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Oct 19, 2023
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Oct 19, 2023
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