Solved! Go to Solution.
Hello yipingwang,
I solved the problem by using a gap area between PCIe2 and PCIe3. My drivers seems need 2 MB more space after the end of 256 MB offset.
But there are still points I do not understand. Even if I arrange 4 GB or more for PCIe2, kernel is only taking 256 MB + 2MB and not more and the reason behind it seems BUS_ADRESS which is 0xE0000000. I tried to change this to 0x0 but system crashed with machine check. Is it impossible to change this value? Why it's acting like 32 bit linux kernel ?
from dmesg:
Device tree node: /sys/firmware/devicetree/base/pcie@ffe250000/pcie@0
Flags: bus master, fast devsel, latency 0, IRQ 21
Memory at <ignored> (32-bit, non-prefetchable)
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 00000000-0000ffff [size=64K]
Memory behind bridge: e0000000-ffffffff [size=512M] <--------------------
Here, base adress is always beginning with e0000000 and acting like 32 bit.
and I also realized that changing only the linux kernel (.dtsi) file is enough to make driver run. PCIe2 - 3 and 4 does not even have a TLB entry. I checked tlb.c file in u-boot.
This is Device Tree Source successfully worked:
pci0: pcie@ffe240000 {
reg = <0xf 0xfe240000 0 0x10000>;
ranges = <0x02000000 0 0xe0000000 0x2 0x0 0x0 0x10000000
0x01000000 0 0x0 0xf 0xf8000000 0x0 0x00010000>;
pcie@0 {
ranges = <0x02000000 0 0xe0000000
0x02000000 0 0xe0000000
0 0x10000000
0x01000000 0 0x00000000
0x01000000 0 0x00000000
0 0x00010000>;
};
};
pci1: pcie@ffe250000 {
reg = <0xf 0xfe250000 0 0x10000>;
ranges = <0x02000000 0 0xe0000000 0x2 0x10000000 0x1 0x00000000
0x01000000 0 0 0xf 0xf8010000 0 0x00010000>;
pcie@0 {
ranges = <0x02000000 0 0xe0000000
0x02000000 0 0xe0000000
0x1 0x00000000
0x01000000 0 0x00000000
0x01000000 0 0x00000000
0 0x00010000>;
};
};
pci2: pcie@ffe260000 {
reg = <0xf 0xfe260000 0 0x10000>;
ranges = <0x02000000 0 0xe0000000 0x3 0x20000000 0 0x10000000
0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>;
pcie@0 {
ranges = <0x02000000 0 0xe0000000
0x02000000 0 0xe0000000
0 0x10000000
0x01000000 0 0x00000000
0x01000000 0 0x00000000
0 0x00010000>;
};
};
pci3: pcie@ffe270000 {
reg = <0xf 0xfe270000 0 0x10000>;
ranges = <0x02000000 0 0xe0000000 0x3 0x30000000 0 0x10000000
0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>;
pcie@0 {
ranges = <0x02000000 0 0xe0000000
0x02000000 0 0xe0000000
0 0x10000000
0x01000000 0 0x00000000
0x01000000 0 0x00000000
0 0x00010000>;
};
};
Hello yipingwang,
I solved the problem by using a gap area between PCIe2 and PCIe3. My drivers seems need 2 MB more space after the end of 256 MB offset.
But there are still points I do not understand. Even if I arrange 4 GB or more for PCIe2, kernel is only taking 256 MB + 2MB and not more and the reason behind it seems BUS_ADRESS which is 0xE0000000. I tried to change this to 0x0 but system crashed with machine check. Is it impossible to change this value? Why it's acting like 32 bit linux kernel ?
from dmesg:
Device tree node: /sys/firmware/devicetree/base/pcie@ffe250000/pcie@0
Flags: bus master, fast devsel, latency 0, IRQ 21
Memory at <ignored> (32-bit, non-prefetchable)
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 00000000-0000ffff [size=64K]
Memory behind bridge: e0000000-ffffffff [size=512M] <--------------------
Here, base adress is always beginning with e0000000 and acting like 32 bit.
and I also realized that changing only the linux kernel (.dtsi) file is enough to make driver run. PCIe2 - 3 and 4 does not even have a TLB entry. I checked tlb.c file in u-boot.
This is Device Tree Source successfully worked:
pci0: pcie@ffe240000 {
reg = <0xf 0xfe240000 0 0x10000>;
ranges = <0x02000000 0 0xe0000000 0x2 0x0 0x0 0x10000000
0x01000000 0 0x0 0xf 0xf8000000 0x0 0x00010000>;
pcie@0 {
ranges = <0x02000000 0 0xe0000000
0x02000000 0 0xe0000000
0 0x10000000
0x01000000 0 0x00000000
0x01000000 0 0x00000000
0 0x00010000>;
};
};
pci1: pcie@ffe250000 {
reg = <0xf 0xfe250000 0 0x10000>;
ranges = <0x02000000 0 0xe0000000 0x2 0x10000000 0x1 0x00000000
0x01000000 0 0 0xf 0xf8010000 0 0x00010000>;
pcie@0 {
ranges = <0x02000000 0 0xe0000000
0x02000000 0 0xe0000000
0x1 0x00000000
0x01000000 0 0x00000000
0x01000000 0 0x00000000
0 0x00010000>;
};
};
pci2: pcie@ffe260000 {
reg = <0xf 0xfe260000 0 0x10000>;
ranges = <0x02000000 0 0xe0000000 0x3 0x20000000 0 0x10000000
0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>;
pcie@0 {
ranges = <0x02000000 0 0xe0000000
0x02000000 0 0xe0000000
0 0x10000000
0x01000000 0 0x00000000
0x01000000 0 0x00000000
0 0x00010000>;
};
};
pci3: pcie@ffe270000 {
reg = <0xf 0xfe270000 0 0x10000>;
ranges = <0x02000000 0 0xe0000000 0x3 0x30000000 0 0x10000000
0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>;
pcie@0 {
ranges = <0x02000000 0 0xe0000000
0x02000000 0 0xe0000000
0 0x10000000
0x01000000 0 0x00000000
0x01000000 0 0x00000000
0 0x00010000>;
};
};
Hello Yiping, I changed the dtsi and config file as you said. It did not work. Then I changed memory size as 4GB and I/O size as 1MB. The driver worked successfully but Linux started to freeze. This is the console log of driver;
[drm] initializing kernel modesetting (POLARIS12 0x1002:0x6987 0x1787:0x2389 0x80).
[drm] register mmio base: 0x20200000
fsl-fman-port ffe488000.port fm1-gb0: renamed from eth0
[drm] register mmio size: 262144
[drm] add ip block number 0 <vi_common>
[drm] add ip block number 1 <gmc_v8_0>
[drm] add ip block number 2 <tonga_ih>
[drm] add ip block number 3 <powerplay>
[drm] add ip block number 4 <dm>
[drm] add ip block number 5 <gfx_v8_0>
[drm] add ip block number 6 <sdma_v3_0>
[drm] add ip block number 7 <uvd_v6_0>
[drm] add ip block number 8 <vce_v3_0>
[drm] UVD is enabled in VM mode
[drm] UVD ENC is enabled in VM mode
[drm] VCE enabled in VM mode
ATOM BIOS: 113-ER16BFC-001
[drm] GPU posting now...
Disabling lock debugging due to kernel taint
Machine check in kernel mode.
Caused by (from MCSR=a000): Load Error Report
Guarded Load Error Report
Kernel panic - not syncing: Unrecoverable Machine check
CPU: 1 PID: 2023 Comm: udevd Tainted: G M 4.19.26+gc0c2141 #1
Call Trace: