* [PATCH 1/1] riscv: dts: spacemit: Add 'linux,pci-domain' to PCIe nodes for K1
@ 2026-02-02 10:00 Chukun Pan
2026-03-02 7:15 ` Chukun Pan
0 siblings, 1 reply; 6+ messages in thread
From: Chukun Pan @ 2026-02-02 10:00 UTC (permalink / raw)
To: Yixun Lan
Cc: Rob Herring, Paul Walmsley, Alexandre Ghiti, Albert Ou,
Conor Dooley, Palmer Dabbelt, Krzysztof Kozlowski, linux-riscv,
linux-kernel, devicetree, spacemit, Chukun Pan
The SpacemiT K1 SoC has 3 PCIe EP controller nodes. Add the
'linux,pci-domain' property to assign a PCI domain number to
each of the controllers instead of assigning it randomly.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
arch/riscv/boot/dts/spacemit/k1.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
index 529ec68e9c23..d2015201f8e5 100644
--- a/arch/riscv/boot/dts/spacemit/k1.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
@@ -1033,6 +1033,7 @@ pcie-bus {
#size-cells = <2>;
dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>,
<0x0 0xb8000000 0x1 0x38000000 0x3 0x48000000>;
+
pcie0: pcie@ca000000 {
device_type = "pci";
compatible = "spacemit,k1-pcie";
@@ -1044,6 +1045,7 @@ pcie0: pcie@ca000000 {
"atu",
"config",
"link";
+ linux,pci-domain = <0>;
#address-cells = <3>;
#size-cells = <2>;
ranges = <0x01000000 0x0 0x00000000 0x0 0x8f002000 0x0 0x00100000>,
@@ -1087,6 +1089,7 @@ pcie1: pcie@ca400000 {
"atu",
"config",
"link";
+ linux,pci-domain = <1>;
#address-cells = <3>;
#size-cells = <2>;
ranges = <0x01000000 0x0 0x00000000 0x0 0x9f002000 0x0 0x00100000>,
@@ -1130,6 +1133,7 @@ pcie2: pcie@ca800000 {
"atu",
"config",
"link";
+ linux,pci-domain = <2>;
#address-cells = <3>;
#size-cells = <2>;
ranges = <0x01000000 0x0 0x00000000 0x0 0xb7002000 0x0 0x00100000>,
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] riscv: dts: spacemit: Add 'linux,pci-domain' to PCIe nodes for K1
2026-02-02 10:00 [PATCH 1/1] riscv: dts: spacemit: Add 'linux,pci-domain' to PCIe nodes for K1 Chukun Pan
@ 2026-03-02 7:15 ` Chukun Pan
2026-03-02 7:42 ` Yixun Lan
0 siblings, 1 reply; 6+ messages in thread
From: Chukun Pan @ 2026-03-02 7:15 UTC (permalink / raw)
To: amadeus
Cc: alex, aou, conor+dt, devicetree, dlan, krzk+dt, linux-kernel,
linux-riscv, palmer, pjw, robh, spacemit
Hi,
> The SpacemiT K1 SoC has 3 PCIe EP controller nodes. Add the
> 'linux,pci-domain' property to assign a PCI domain number to
> each of the controllers instead of assigning it randomly.
Does anyone have any thoughts on this?
Without this patch, the PCI domain number is random.
```
/# find /sys/devices -name net
/sys/devices/platform/soc/soc:pcie-bus/ca800000.pcie/pci0001:00/0001:00:00.0/0001:01:00.0/net
/sys/devices/platform/soc/soc:pcie-bus/ca400000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net
/# find /sys/devices -name net
/sys/devices/platform/soc/soc:pcie-bus/ca800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net
/sys/devices/platform/soc/soc:pcie-bus/ca400000.pcie/pci0001:00/0001:00:00.0/0001:01:00.0/net
```
Thanks,
Chukun
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] riscv: dts: spacemit: Add 'linux,pci-domain' to PCIe nodes for K1
2026-03-02 7:15 ` Chukun Pan
@ 2026-03-02 7:42 ` Yixun Lan
2026-03-03 9:54 ` Vivian Wang
2026-03-07 4:38 ` Chukun Pan
0 siblings, 2 replies; 6+ messages in thread
From: Yixun Lan @ 2026-03-02 7:42 UTC (permalink / raw)
To: Chukun Pan
Cc: alex, aou, conor+dt, devicetree, dlan, krzk+dt, linux-kernel,
linux-riscv, palmer, pjw, robh, spacemit
Hi Chukun,
On 15:15 Mon 02 Mar , Chukun Pan wrote:
> Hi,
>
> > The SpacemiT K1 SoC has 3 PCIe EP controller nodes. Add the
> > 'linux,pci-domain' property to assign a PCI domain number to
> > each of the controllers instead of assigning it randomly.
>
> Does anyone have any thoughts on this?
> Without this patch, the PCI domain number is random.
>
You describe what's has been done here, but no why?
Can you add description about why problem with random domain,
and the motivation of the change behind?
from my understanding of reading DT document, either way seems
fine..
> ```
> /# find /sys/devices -name net
> /sys/devices/platform/soc/soc:pcie-bus/ca800000.pcie/pci0001:00/0001:00:00.0/0001:01:00.0/net
> /sys/devices/platform/soc/soc:pcie-bus/ca400000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net
>
> /# find /sys/devices -name net
> /sys/devices/platform/soc/soc:pcie-bus/ca800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net
> /sys/devices/platform/soc/soc:pcie-bus/ca400000.pcie/pci0001:00/0001:00:00.0/0001:01:00.0/net
> ```
>
> Thanks,
> Chukun
>
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] riscv: dts: spacemit: Add 'linux,pci-domain' to PCIe nodes for K1
2026-03-02 7:42 ` Yixun Lan
@ 2026-03-03 9:54 ` Vivian Wang
2026-03-07 4:38 ` Chukun Pan
1 sibling, 0 replies; 6+ messages in thread
From: Vivian Wang @ 2026-03-03 9:54 UTC (permalink / raw)
To: Yixun Lan, Chukun Pan
Cc: alex, aou, conor+dt, devicetree, dlan, krzk+dt, linux-kernel,
linux-riscv, palmer, pjw, robh, spacemit
On 3/2/26 15:42, Yixun Lan wrote:
> Hi Chukun,
>
> On 15:15 Mon 02 Mar , Chukun Pan wrote:
>> Hi,
>>
>>> The SpacemiT K1 SoC has 3 PCIe EP controller nodes. Add the
>>> 'linux,pci-domain' property to assign a PCI domain number to
>>> each of the controllers instead of assigning it randomly.
>> Does anyone have any thoughts on this?
>> Without this patch, the PCI domain number is random.
>>
> You describe what's has been done here, but no why?
> Can you add description about why problem with random domain,
> and the motivation of the change behind?
>
> from my understanding of reading DT document, either way seems
> fine..
For example systemd-udevd provides the interface name based on the
segment group / domain number, so if you add an additional PCIe network
card, the name of the network interface will flip between enP0p1s0 and
enP1p1s0, which is a bit inconvenient.
This isn't inherently a problem (these things were never as predictible
as they wanted anyway) but a convenience would still be nice.
Vivian "dramforever" Wang
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] riscv: dts: spacemit: Add 'linux,pci-domain' to PCIe nodes for K1
2026-03-02 7:42 ` Yixun Lan
2026-03-03 9:54 ` Vivian Wang
@ 2026-03-07 4:38 ` Chukun Pan
2026-03-08 9:18 ` Yixun Lan
1 sibling, 1 reply; 6+ messages in thread
From: Chukun Pan @ 2026-03-07 4:38 UTC (permalink / raw)
To: dlan
Cc: alex, amadeus, aou, conor+dt, devicetree, dlan, krzk+dt,
linux-kernel, linux-riscv, palmer, pjw, robh, spacemit
Hi,
> You describe what's has been done here, but no why?
Because the PCIe boot order is random, if there are two R8125
network cards, their interface names will not be fixed.
For example:
First boot:
pcie@ca400000 -> eth2
pcie@ca800000 -> eth3
Second boot:
pcie@ca400000 -> eth3
pcie@ca800000 -> eth2
If their PCI domain numbers are fixed, I can fix the interface
names by matching /sys/devices using a script.
> Can you add description about why problem with random domain,
> and the motivation of the change behind?
Should I improve the commit messages?
Thanks,
Chukun
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] riscv: dts: spacemit: Add 'linux,pci-domain' to PCIe nodes for K1
2026-03-07 4:38 ` Chukun Pan
@ 2026-03-08 9:18 ` Yixun Lan
0 siblings, 0 replies; 6+ messages in thread
From: Yixun Lan @ 2026-03-08 9:18 UTC (permalink / raw)
To: Chukun Pan
Cc: alex, aou, conor+dt, devicetree, dlan, krzk+dt, linux-kernel,
linux-riscv, palmer, pjw, robh, spacemit
Hi Chukun,
On 12:38 Sat 07 Mar , Chukun Pan wrote:
> Hi,
>
> > You describe what's has been done here, but no why?
>
> Because the PCIe boot order is random, if there are two R8125
> network cards, their interface names will not be fixed.
>
> For example:
> First boot:
> pcie@ca400000 -> eth2
> pcie@ca800000 -> eth3
>
> Second boot:
> pcie@ca400000 -> eth3
> pcie@ca800000 -> eth2
>
Ok, I can understand your problem
> If their PCI domain numbers are fixed, I can fix the interface
> names by matching /sys/devices using a script.
>
If you want to have a fixed interface name, you could setup a udev
rules according to mac address? something like:
$ cat /etc/udev/rules.d/70-network.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="01:02:03:12:34:56", NAME="eth2"
but, I see no harm to add a pci domain property..
> > Can you add description about why problem with random domain,
> > and the motivation of the change behind?
>
> Should I improve the commit messages?
>
Yes, please, thanks
> Thanks,
> Chukun
>
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-08 9:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-02 10:00 [PATCH 1/1] riscv: dts: spacemit: Add 'linux,pci-domain' to PCIe nodes for K1 Chukun Pan
2026-03-02 7:15 ` Chukun Pan
2026-03-02 7:42 ` Yixun Lan
2026-03-03 9:54 ` Vivian Wang
2026-03-07 4:38 ` Chukun Pan
2026-03-08 9:18 ` Yixun Lan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox