Skip to content

Commit 514ef1e

Browse files
paligclement
authored andcommitted
arm64: dts: marvell: armada-37xx: Extend PCIe MEM space
Current PCIe MEM space of size 16 MB is not enough for some combination of PCIe cards (e.g. NVMe disk together with ath11k wifi card). ARM Trusted Firmware for Armada 3700 platform already assigns 128 MB for PCIe window, so extend PCIe MEM space to the end of 128 MB PCIe window which allows to allocate more PCIe BARs for more PCIe cards. Without this change some combination of PCIe cards cannot be used and kernel show error messages in dmesg during initialization: pci 0000:00:00.0: BAR 8: no space for [mem size 0x01800000] pci 0000:00:00.0: BAR 8: failed to assign [mem size 0x01800000] pci 0000:00:00.0: BAR 6: assigned [mem 0xe8000000-0xe80007ff pref] pci 0000:01:00.0: BAR 8: no space for [mem size 0x01800000] pci 0000:01:00.0: BAR 8: failed to assign [mem size 0x01800000] pci 0000:02:03.0: BAR 8: no space for [mem size 0x01000000] pci 0000:02:03.0: BAR 8: failed to assign [mem size 0x01000000] pci 0000:02:07.0: BAR 8: no space for [mem size 0x00100000] pci 0000:02:07.0: BAR 8: failed to assign [mem size 0x00100000] pci 0000:03:00.0: BAR 0: no space for [mem size 0x01000000 64bit] pci 0000:03:00.0: BAR 0: failed to assign [mem size 0x01000000 64bit] Due to bugs in U-Boot port for Turris Mox, the second range in Turris Mox kernel DTS file for PCIe must start at 16 MB offset. Otherwise U-Boot crashes during loading of kernel DTB file. This bug is present only in U-Boot code for Turris Mox and therefore other Armada 3700 devices are not affected by this bug. Bug is fixed in U-Boot version 2021.07. To not break booting new kernels on existing versions of U-Boot on Turris Mox, use first 16 MB range for IO and second range with rest of PCIe window for MEM. Signed-off-by: Pali Rohár <[email protected]> Fixes: 76f6386 ("arm64: dts: marvell: Add Aardvark PCIe support for Armada 3700") Signed-off-by: Gregory CLEMENT <[email protected]>
1 parent 45b2565 commit 514ef1e

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,23 @@
132132
pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>;
133133
status = "okay";
134134
reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>;
135+
/*
136+
* U-Boot port for Turris Mox has a bug which always expects that "ranges" DT property
137+
* contains exactly 2 ranges with 3 (child) address cells, 2 (parent) address cells and
138+
* 2 size cells and also expects that the second range starts at 16 MB offset. If these
139+
* conditions are not met then U-Boot crashes during loading kernel DTB file. PCIe address
140+
* space is 128 MB long, so the best split between MEM and IO is to use fixed 16 MB window
141+
* for IO and the rest 112 MB (64+32+16) for MEM, despite that maximal IO size is just 64 kB.
142+
* This bug is not present in U-Boot ports for other Armada 3700 devices and is fixed in
143+
* U-Boot version 2021.07. See relevant U-Boot commits (the last one contains fix):
144+
* https://source.denx.de/u-boot/u-boot/-/commit/cb2ddb291ee6fcbddd6d8f4ff49089dfe580f5d7
145+
* https://source.denx.de/u-boot/u-boot/-/commit/c64ac3b3185aeb3846297ad7391fc6df8ecd73bf
146+
* https://source.denx.de/u-boot/u-boot/-/commit/4a82fca8e330157081fc132a591ebd99ba02ee33
147+
*/
148+
#address-cells = <3>;
149+
#size-cells = <2>;
150+
ranges = <0x81000000 0 0xe8000000 0 0xe8000000 0 0x01000000 /* Port 0 IO */
151+
0x82000000 0 0xe9000000 0 0xe9000000 0 0x07000000>; /* Port 0 MEM */
135152

136153
/* enabled by U-Boot if PCIe module is present */
137154
status = "disabled";

arch/arm64/boot/dts/marvell/armada-37xx.dtsi

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,15 @@
489489
#interrupt-cells = <1>;
490490
msi-parent = <&pcie0>;
491491
msi-controller;
492-
ranges = <0x82000000 0 0xe8000000 0 0xe8000000 0 0x1000000 /* Port 0 MEM */
493-
0x81000000 0 0xe9000000 0 0xe9000000 0 0x10000>; /* Port 0 IO*/
492+
/*
493+
* The 128 MiB address range [0xe8000000-0xf0000000] is
494+
* dedicated for PCIe and can be assigned to 8 windows
495+
* with size a power of two. Use one 64 KiB window for
496+
* IO at the end and the remaining seven windows
497+
* (totaling 127 MiB) for MEM.
498+
*/
499+
ranges = <0x82000000 0 0xe8000000 0 0xe8000000 0 0x07f00000 /* Port 0 MEM */
500+
0x81000000 0 0xefff0000 0 0xefff0000 0 0x00010000>; /* Port 0 IO */
494501
interrupt-map-mask = <0 0 0 7>;
495502
interrupt-map = <0 0 0 1 &pcie_intc 0>,
496503
<0 0 0 2 &pcie_intc 1>,

0 commit comments

Comments
 (0)