How to fix pcie ranges for nvidia GFX card

Kevin Hilman khilman at baylibre.com
Mon Nov 9 18:54:20 EST 2020


Michal Lazo <michal.lazo at mdragon.org> writes:

> Hello
> I have khadas vim3 with nvidia PCIe card
> Anybody has an idea how to fix pcie ranges so we can have nvidia gpu working?

Can you try this patch[1]?  Neil found this issue and we were testing
locally, but hadn't yet submitted a fix.  If this works, we'll get a
formal patch upstream.

Hope that helps,

Kevin

[1]
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
index 1e83ec5b8c91..0a220fb10841 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
@@ -134,8 +134,8 @@ pcie: pcie at fc000000 {
 			#address-cells = <3>;
 			#size-cells = <2>;
 			device_type = "pci";
-			ranges = <0x81000000 0 0 0x0 0xfc600000 0 0x00100000
-				  0x82000000 0 0xfc700000 0x0 0xfc700000 0 0x1900000>;
+			ranges = <0x81000000 0 0 0x0 0xfc600000 0 0x00400000
+				  0x82000000 0 0xfca00000 0x0 0xfca00000 0 0x1600000>;
 
 			clocks = <&clkc CLKID_PCIE_PHY
 				  &clkc CLKID_PCIE_COMB

> This is what I get in dmesg
>
> [    1.548188] pci 0000:01:00.0: 4.000 Gb/s available PCIe bandwidth,
> limited by 5.0 GT/s PCIe x1 link at 0000:00:00.0 (capable of 63.008
> Gb/s with 8.0 GT/s PCIe x8 link)
> [    1.562742] pci 0000:01:00.0: vgaarb: VGA device added:
> decodes=io+mem,owns=none,locks=none
> [    1.571028] pci 0000:01:00.1: [10de:0e0f] type 00 class 0x040300
> [    1.576944] pci 0000:01:00.1: reg 0x10: [mem 0x00000000-0x00003fff]
> [    1.583263] pci 0000:01:00.1: Max Payload Size set to 256 (was 128, max 256)
> [    1.622407] pci 0000:00:00.0: BAR 9: no space for [mem size 0x0c000000 pref]
> [    1.623803] pci 0000:00:00.0: BAR 9: failed to assign [mem size
> 0x0c000000 pref]
> [    1.631136] pci 0000:00:00.0: BAR 8: assigned [mem 0xfc800000-0xfdffffff]
> [    1.637861] pci 0000:00:00.0: BAR 6: assigned [mem
> 0xfc700000-0xfc70ffff pref]
> [    1.645033] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
> [    1.651070] pci 0000:01:00.0: BAR 1: no space for [mem size
> 0x08000000 64bit pref]
> [    1.658576] pci 0000:01:00.0: BAR 1: failed to assign [mem size
> 0x08000000 64bit pref]
> [    1.666410] pci 0000:01:00.0: BAR 3: no space for [mem size
> 0x02000000 64bit pref]
> [    1.673913] pci 0000:01:00.0: BAR 3: failed to assign [mem size
> 0x02000000 64bit pref]
> [    1.681763] pci 0000:01:00.0: BAR 0: assigned [mem 0xfd000000-0xfdffffff]
> [    1.688500] pci 0000:01:00.0: BAR 6: assigned [mem
> 0xfc800000-0xfc87ffff pref]
> [    1.695648] pci 0000:01:00.1: BAR 0: assigned [mem 0xfc880000-0xfc883fff]
> [    1.702385] pci 0000:01:00.0: BAR 5: assigned [io  0x1000-0x107f]
> [    1.708426] pci 0000:00:00.0: PCI bridge to [bus 01-ff]
> [    1.713592] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
> [    1.719626] pci 0000:00:00.0:   bridge window [mem 0xfc800000-0xfdffffff]
>
>
> And this is what we use right now to setup ranges
> https://github.com/chewitt/linux/blob/master/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi#L137
>
>
> Any idea how to properly set up ranges ?
>
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic



More information about the linux-amlogic mailing list