Skip to contentSkip to conversation

riscv: dts: spacemit: enable more devices

PATCH Superseded Aurelien Jarno 4 participants 18 messages Mar 22 – Mar 26

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover riscv: dts: spacemit: enable more devices

This patchset improves support of the Milk-V Jupiter board by enabling more devices. Most notably the NOR flash (useful for upgrading the bootloader), the USB 3 ports and the PCIe ports.

It was inspired by the Banana Pi F3 device tree file. It is based against the k1/dt-for-next branch and does not have any other dependency.

Aurelien Jarno (6):
riscv: dts: spacemit: add LEDs for Milk-V Jupiter board
riscv: dts: spacemit: add 24c04 eeprom on Milk-V Jupiter
riscv: dts: spacemit: add i2c aliases on Milk-V Jupiter
riscv: dts: spacemit: enable QSPI and add SPI NOR on Milk-V Jupiter
riscv: dts: spacemit: enable USB 3 ports on Milk-V Jupiter
riscv: dts: spacemit: enable PCIe ports on Milk-V Jupiter

 .../boot/dts/spacemit/k1-milkv-jupiter.dts    | 189 +++++++++++++++++-
 1 file changed, 188 insertions(+), 1 deletion(-)
Signature · 1 line
2.51.0
#1 lore raw

PATCH 1/6 riscv: dts: spacemit: add LEDs for Milk-V Jupiter board

The Milk-V Jupiter board provides support for two LEDs through the front panel header. The "Power LED" indicates the system is running, and the "HDD LED" shows disk activity. Configure the corresponding LED triggers accordingly.

Caveats:
- The LEDs are driven through a 4.7k series resistor, making them quite faint.
- The disk activity trigger requires a storage controller on the M.2 or PCIe interface. That said, it matches the purpose and the vendor kernel.

---
 .../boot/dts/spacemit/k1-milkv-jupiter.dts      | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +17 -0
index 9959c8023ece0..3cd83c5924e4f 100644
@@ -21,6 +21,23 @@ chosen {
 		stdout-path = "serial0";
 	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		led1 {
+			label = "pwr-led";
+			gpios = <&gpio K1_GPIO(96) GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "default-on";
+			default-state = "on";
+		};
+
+		led2 {
+			label = "hdd-led";
+			gpios = <&gpio K1_GPIO(92) GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "disk-activity";
+		};
+	};
+
 	reg_dc_in: regulator-dc-in-12v {
 		compatible = "regulator-fixed";
 		regulator-name = "dc_in_12v";
Signature · 1 line
2.51.0
Reviewed-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] riscv: dts: spacemit: add LEDs for Milk-V Jupiter board

Aurelien Jarno <[email protected]> writes:

Hello Aurelien,

Quoted 12 lines

The Milk-V Jupiter board provides support for two LEDs through the front panel header. The "Power LED" indicates the system is running, and the "HDD LED" shows disk activity. Configure the corresponding LED triggers accordingly.

Caveats:
- The LEDs are driven through a 4.7k series resistor, making them quite faint.
- The disk activity trigger requires a storage controller on the M.2 or PCIe interface. That said, it matches the purpose and the vendor kernel.

Quoted 2 lines

---

Looks good to me.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#3 lore raw

PATCH 2/6 riscv: dts: spacemit: add 24c04 eeprom on Milk-V Jupiter

In reply to Aurelien Jarno

The Milk-V Jupiter board includes a 24c04 eeprom on the i2c2 bus. The eeprom contains an ONIE TLV table, which on the board I tested only provides a product-name entry. Expose it via an onie,tlv-layout nvmem layout.

The eeprom is marked as read-only since its contents are not supposed to be modified.

---
 .../boot/dts/spacemit/k1-milkv-jupiter.dts    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +22 -0
index 3cd83c5924e4f..bd48208a370cf 100644
@@ -108,6 +108,28 @@ &pdma {
 	status = "okay";
 };
 
+&i2c2 {
+	pinctrl-0 = <&i2c2_0_cfg>;
+	pinctrl-names = "default";
+	status = "okay";
+
+	eeprom@50 {
+		compatible = "atmel,24c04";
+		reg = <0x50>;
+		vcc-supply = <&buck3_1v8>; /* EEPROM_VCC18 */
+		pagesize = <16>;
+		read-only;
+		size = <512>;
+
+		nvmem-layout {
+			compatible = "onie,tlv-layout";
+
+			product-name {
+			};
+		};
+	};
+};
+
 &i2c8 {
 	pinctrl-0 = <&i2c8_cfg>;
 	pinctrl-names = "default";
Signature · 1 line
2.51.0
Reviewed-by on v1 2/6
#4 lore raw

Re: [PATCH 2/6] riscv: dts: spacemit: add 24c04 eeprom on Milk-V Jupiter

Quoted 10 lines · Aurelien Jarno

The Milk-V Jupiter board includes a 24c04 eeprom on the i2c2 bus. The eeprom contains an ONIE TLV table, which on the board I tested only provides a product-name entry. Expose it via an onie,tlv-layout nvmem layout.

The eeprom is marked as read-only since its contents are not supposed to be modified.

---

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#5 lore raw

PATCH 3/6 riscv: dts: spacemit: add i2c aliases on Milk-V Jupiter

In reply to Aurelien Jarno

Add i2c aliases for i2c2 and i2c8 on Milk-V Jupiter. This is useful to keep a stable number for the /dev entries after loading the i2c-dev module.

---
 arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +2 -0
index bd48208a370cf..836311c3f035c 100644
@@ -15,6 +15,8 @@ aliases {
 		ethernet0 = &eth0;
 		ethernet1 = &eth1;
 		serial0 = &uart0;
+		i2c2 = &i2c2;
+		i2c8 = &i2c8;
 	};
 
 	chosen {
Signature · 1 line
2.51.0
Reviewed-by on v1 3/6
#6 lore raw

Re: [PATCH 3/6] riscv: dts: spacemit: add i2c aliases on Milk-V Jupiter

Quoted 6 lines · Aurelien Jarno

Add i2c aliases for i2c2 and i2c8 on Milk-V Jupiter. This is useful to keep a stable number for the /dev entries after loading the i2c-dev module.

---

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#7 lore raw

PATCH 4/6 riscv: dts: spacemit: enable QSPI and add SPI NOR on Milk-V Jupiter

In reply to Aurelien Jarno

Add the QSPI controller node for the Milk-V Jupiter board and describe the attached SPI NOR flash (GD25Q64E).

The flash supports a frequency up to 133MHz (80 MHz for reads), and the SoC supports a frequency up to 104 MHz. However tests have shown that the flash is not reliably detected above 26.5 MHz, consistent with frequency used in the vendor kernel. Therefore, use this frequency.

The m25p,fast-read properties is taken from the vendor kernel.

Add a corresponding flash partition layout, matching the layout and the names used in the vendor U-Boot.

Also add the bootph-pre-ram property to make the device tree usable by early firmware/bootloaders without modification, as U-Boot is stored on this NOR flash.

---
 .../boot/dts/spacemit/k1-milkv-jupiter.dts    | 44 ++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +43 -1
index 836311c3f035c..05ab5df50be51 100644
@@ -173,7 +173,7 @@ buck3_1v8: buck3 {
 				regulator-always-on;
 			};
 
-			buck4 {
+			buck4_3v3: buck4 {
 				regulator-min-microvolt = <500000>;
 				regulator-max-microvolt = <3300000>;
 				regulator-ramp-delay = <5000>;
@@ -256,6 +256,48 @@ dldo7 {
 	};
 };
 
+&qspi {
+	pinctrl-names = "default";
+	pinctrl-0 = <&qspi_cfg>;
+	status = "okay";
+
+	flash@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <26500000>;
+		spi-rx-bus-width = <4>;
+		spi-tx-bus-width = <4>;
+		vcc-supply = <&buck4_3v3>; /* QSPI_VCC1833 */
+		m25p,fast-read;
+		bootph-pre-ram;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			bootinfo@0 {
+				reg = <0x0 0x10000>;
+			};
+			private@10000 {
+				reg = <0x10000 0x10000>;
+			};
+			fsbl@20000 {
+				reg = <0x20000 0x40000>;
+			};
+			env@60000 {
+				reg = <0x60000 0x10000>;
+			};
+			opensbi@70000 {
+				reg = <0x70000 0x30000>;
+			};
+			uboot@a00000 {
+				reg = <0xa0000 0x760000>;
+			};
+		};
+	};
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_2_cfg>;
Signature · 1 line
2.51.0
maintainer
#8 lore raw

Re: [PATCH 4/6] riscv: dts: spacemit: enable QSPI and add SPI NOR on Milk-V Jupiter

Hi Aurelien,

Quoted 8 lines · Aurelien Jarno

Add the QSPI controller node for the Milk-V Jupiter board and describe the attached SPI NOR flash (GD25Q64E).

The flash supports a frequency up to 133MHz (80 MHz for reads), and the SoC supports a frequency up to 104 MHz. However tests have shown that the flash is not reliably detected above 26.5 MHz, consistent with frequency used in the vendor kernel. Therefore, use this frequency.

..

Quoted 2 lines

The m25p,fast-read properties is taken from the vendor kernel.

So long as this is verified and works fine on board?

Quoted 3 lines

Add a corresponding flash partition layout, matching the layout and the names used in the vendor U-Boot.

..

Quoted 3 lines

Also add the bootph-pre-ram property to make the device tree usable by early firmware/bootloaders without modification, as U-Boot is stored on this NOR flash.

Is the dtb file actually used by U-Boot? I'd highly doubt about this, if not the case or has not been tested, I'd suggest then not to add this property..

Quoted 71 lines
---
 .../boot/dts/spacemit/k1-milkv-jupiter.dts    | 44 ++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +43 -1
index 836311c3f035c..05ab5df50be51 100644
@@ -173,7 +173,7 @@ buck3_1v8: buck3 {
 				regulator-always-on;
 			};
 
-			buck4 {
+			buck4_3v3: buck4 {
 				regulator-min-microvolt = <500000>;
 				regulator-max-microvolt = <3300000>;
 				regulator-ramp-delay = <5000>;
@@ -256,6 +256,48 @@ dldo7 {
 	};
 };
 
+&qspi {
+	pinctrl-names = "default";
+	pinctrl-0 = <&qspi_cfg>;
+	status = "okay";
+
+	flash@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <26500000>;
+		spi-rx-bus-width = <4>;
+		spi-tx-bus-width = <4>;
+		vcc-supply = <&buck4_3v3>; /* QSPI_VCC1833 */
+		m25p,fast-read;
+		bootph-pre-ram;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			bootinfo@0 {
+				reg = <0x0 0x10000>;
+			};
+			private@10000 {
+				reg = <0x10000 0x10000>;
+			};
+			fsbl@20000 {
+				reg = <0x20000 0x40000>;
+			};
+			env@60000 {
+				reg = <0x60000 0x10000>;
+			};
+			opensbi@70000 {
+				reg = <0x70000 0x30000>;
+			};
+			uboot@a00000 {
+				reg = <0xa0000 0x760000>;
+			};
+		};
+	};
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_2_cfg>;
Signature · 1 line
2.51.0
Signature · 1 line
Yixun Lan (dlan)
#9 lore raw

Re: [PATCH 4/6] riscv: dts: spacemit: enable QSPI and add SPI NOR on Milk-V Jupiter

Quoted 19 lines · Yixun Lan

Hi Aurelien,

Quoted 8 lines · Aurelien Jarno

Add the QSPI controller node for the Milk-V Jupiter board and describe the attached SPI NOR flash (GD25Q64E).

The flash supports a frequency up to 133MHz (80 MHz for reads), and the SoC supports a frequency up to 104 MHz. However tests have shown that the flash is not reliably detected above 26.5 MHz, consistent with frequency used in the vendor kernel. Therefore, use this frequency.

..

Quoted 2 lines

The m25p,fast-read properties is taken from the vendor kernel.

So long as this is verified and works fine on board?

Quoted 3 lines

Add a corresponding flash partition layout, matching the layout and the names used in the vendor U-Boot.

Quoted 7 lines

..

Quoted 3 lines

Also add the bootph-pre-ram property to make the device tree usable by early firmware/bootloaders without modification, as U-Boot is stored on this NOR flash.

Is the dtb file actually used by U-Boot? I'd highly doubt about this, if not the case or has not been tested, I'd suggest then not to add this property..

Currently no, but it would be a bogus if we could do it at introduction of the device, if it's really necessary in pre-DRAM stages of bootloaders, e.g. U-Boot SPL. This would reduce the duplicated work of downstream projects if they decide to switch to Linux upstream devicetree.

As SpacemiT K1 supports booting from flash, the description of flash nodes are likely useful for pre-DRAM bootloaders.

Quoted 2 lines
Quoted 2 lines

Best regards,
Yao Zi

maintainer
#10 lore raw

Re: [PATCH 4/6] riscv: dts: spacemit: enable QSPI and add SPI NOR on Milk-V Jupiter

Hi Yao,

Quoted 28 lines · Yao Zi
Quoted 19 lines · Yixun Lan

Hi Aurelien,

Quoted 8 lines · Aurelien Jarno

Add the QSPI controller node for the Milk-V Jupiter board and describe the attached SPI NOR flash (GD25Q64E).

The flash supports a frequency up to 133MHz (80 MHz for reads), and the SoC supports a frequency up to 104 MHz. However tests have shown that the flash is not reliably detected above 26.5 MHz, consistent with frequency used in the vendor kernel. Therefore, use this frequency.

..

Quoted 2 lines

The m25p,fast-read properties is taken from the vendor kernel.

So long as this is verified and works fine on board?

Quoted 3 lines

Add a corresponding flash partition layout, matching the layout and the names used in the vendor U-Boot.

Quoted 7 lines

..

Quoted 3 lines

Also add the bootph-pre-ram property to make the device tree usable by early firmware/bootloaders without modification, as U-Boot is stored on this NOR flash.

Is the dtb file actually used by U-Boot? I'd highly doubt about this, if not the case or has not been tested, I'd suggest then not to add this property..

Quoted 6 lines

Currently no, but it would be a bogus if we could do it at introduction of the device, if it's really necessary in pre-DRAM stages of bootloaders, e.g. U-Boot SPL. This would reduce the duplicated work of downstream projects if they decide to switch to Linux upstream devicetree.

All above arguments are based on assumption, I object to add things randomly without real test proved.

Let's wait once U-Boot actually switch to use upstream devicetree.

Quoted 3 lines

As SpacemiT K1 supports booting from flash, the description of flash nodes are likely useful for pre-DRAM bootloaders.

This is still a 'likely' ..

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

Best regards,
Yao Zi

Signature · 1 line
Yixun Lan (dlan)
#11 lore raw

Re: [PATCH 4/6] riscv: dts: spacemit: enable QSPI and add SPI NOR on Milk-V Jupiter

In reply to Yixun Lan

Hi Yixun,

Quoted 11 lines · Yixun Lan

Hi Aurelien,

Quoted 8 lines · Aurelien Jarno

Add the QSPI controller node for the Milk-V Jupiter board and describe the attached SPI NOR flash (GD25Q64E).

The flash supports a frequency up to 133MHz (80 MHz for reads), and the SoC supports a frequency up to 104 MHz. However tests have shown that the flash is not reliably detected above 26.5 MHz, consistent with frequency used in the vendor kernel. Therefore, use this frequency.

Quoted 4 lines

..

Quoted 2 lines

The m25p,fast-read properties is taken from the vendor kernel.

So long as this is verified and works fine on board?

Yes, it's works. And the datasheet also mentions fast read being supported.

Quoted 10 lines
Quoted 3 lines

Add a corresponding flash partition layout, matching the layout and the names used in the vendor U-Boot.

..

Quoted 3 lines

Also add the bootph-pre-ram property to make the device tree usable by early firmware/bootloaders without modification, as U-Boot is stored on this NOR flash.

Is the dtb file actually used by U-Boot? I'd highly doubt about this, if not the case or has not been tested, I'd suggest then not to add this property..

It is currently not used by U-Boot, currently SPL support is not available, but patches have been posted to added it. I just wanted to anticipate the addition of the Milk-V Jupiter board in U-boot, but if that hurt, i can remove it (or you can removed it when merging).

Regards
Aurelien

Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                     http://aurel32.net
maintainer
#12 lore raw

Re: [PATCH 4/6] riscv: dts: spacemit: enable QSPI and add SPI NOR on Milk-V Jupiter

Hi Aurelien,

Quoted 4 lines · Aurelien Jarno

Hi Yixun,

Quoted 1 line · Yixun Lan

Hi Aurelien,

..

Quoted 4 lines
Quoted 4 lines

..

Quoted 3 lines

Also add the bootph-pre-ram property to make the device tree usable by early firmware/bootloaders without modification, as U-Boot is stored on this NOR flash.

Quoted 8 lines
Quoted 3 lines

Is the dtb file actually used by U-Boot? I'd highly doubt about this, if not the case or has not been tested, I'd suggest then not to add this property..

It is currently not used by U-Boot, currently SPL support is not available, but patches have been posted to added it. I just wanted to anticipate the addition of the Milk-V Jupiter board in U-boot, but if that hurt, i can remove it (or you can removed it when merging).

Not hurt since it isn't really used in Kernel, but I just don't want to add things without test..

I can remove it if there is no other changes, then no iteration needed. Let's wait a few more days to see if people have additional comments for this series

Signature · 1 line
Yixun Lan (dlan)
#13 lore raw

PATCH 5/6 riscv: dts: spacemit: enable USB 3 ports on Milk-V Jupiter

In reply to Aurelien Jarno

Enable the DWC3 USB 3.0 controller (USB#2 port in the K1 datasheet) and its associated combo_phy (USB 3 PHY) and usbphy2 (USB 2 PHY) on the Milk-V Jupiter board.

The board uses a VLI VL817 hub, providing four ports. Two are routed to the 3.0 type-A connectors, and two to the F_USB3 front USB header. The hub requires two separate 5V power supplies: one for the hub itself and one for the USB connectors. Add an always-on regulator sourcing 5V from the DC-IN input, along with two GPIO-controlled fixed regulators to manage the hub and connectors power supplies.

Note that the board also provides four USB 2.0 ports (two via type-A connectors and two via the F_USB2 front USB header), but these are handled by a different controller (USB#1 port in the K1 datasheet).

---
 .../boot/dts/spacemit/k1-milkv-jupiter.dts    | 62 +++++++++++++++++++
 1 file changed, 62 insertions(+)
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +62 -0
index 05ab5df50be51..4432f8287eb5c 100644
@@ -58,6 +58,41 @@ reg_vcc_4v: regulator-vcc-4v {
 		regulator-always-on;
 		vin-supply = <&reg_dc_in>;
 	};
+
+	reg_vcc_5v: regulator-vcc-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_5v";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-boot-on;
+		regulator-always-on;
+		vin-supply = <&reg_dc_in>;
+	};
+
+	regulator-usb3-vbus-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "USB30_VBUS";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+		vin-supply = <&reg_vcc_5v>;
+		gpio = <&gpio K1_GPIO(97) GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
+	usb3_hub_5v: regulator-usb3-hub-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "USB30_HUB";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&reg_vcc_5v>;
+		gpio = <&gpio K1_GPIO(123) GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+};
+
+&combo_phy {
+	status = "okay";
 };
 
 &eth0 {
@@ -303,3 +338,30 @@ &uart0 {
 	pinctrl-0 = <&uart0_2_cfg>;
 	status = "okay";
 };
+
+&usbphy2 {
+	status = "okay";
+};
+
+&usb_dwc3 {
+	dr_mode = "host";
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	hub_2_0: hub@1 {
+		compatible = "usb2109,2817";
+		reg = <0x1>;
+		vdd-supply = <&usb3_hub_5v>;
+		peer-hub = <&hub_3_0>;
+		reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>;
+	};
+
+	hub_3_0: hub@2 {
+		compatible = "usb2109,817";
+		reg = <0x2>;
+		vdd-supply = <&usb3_hub_5v>;
+		peer-hub = <&hub_2_0>;
+		reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>;
+	};
+};
Signature · 1 line
2.51.0
Reviewed-by on v1 5/6
#14 lore raw

Re: [PATCH 5/6] riscv: dts: spacemit: enable USB 3 ports on Milk-V Jupiter

Quoted 11 lines · Aurelien Jarno

Enable the DWC3 USB 3.0 controller (USB#2 port in the K1 datasheet) and its associated combo_phy (USB 3 PHY) and usbphy2 (USB 2 PHY) on the Milk-V Jupiter board.

The board uses a VLI VL817 hub, providing four ports. Two are routed to the 3.0 type-A connectors, and two to the F_USB3 front USB header. The hub requires two separate 5V power supplies: one for the hub itself and one for the USB connectors. Add an always-on regulator sourcing 5V from the DC-IN input, along with two GPIO-controlled fixed regulators to manage the hub and connectors power supplies.

Quoted 6 lines

Note that the board also provides four USB 2.0 ports (two via type-A connectors and two via the F_USB2 front USB header), but these are handled by a different controller (USB#1 port in the K1 datasheet).

---

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#15 lore raw

PATCH 6/6 riscv: dts: spacemit: enable PCIe ports on Milk-V Jupiter

In reply to Aurelien Jarno

Enable the two PCIe controller along with and their associated PHY. They are routed to the M.2 M-key connector and to the the PCIe x8 slot.

Add an always-on regulator sourcing 3.3V from the DC-IN input, to power the PCIe ports.

---
 .../boot/dts/spacemit/k1-milkv-jupiter.dts    | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +42 -0
index 4432f8287eb5c..d59dea4149ae7 100644
@@ -40,6 +40,16 @@ led2 {
 		};
 	};
 
+	pcie_vcc_3v3: regulator-pcie-vcc3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "pcie_vcc3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+		vin-supply = <&reg_dc_in>;
+	};
+
 	reg_dc_in: regulator-dc-in-12v {
 		compatible = "regulator-fixed";
 		regulator-name = "dc_in_12v";
@@ -291,6 +301,38 @@ dldo7 {
 	};
 };
 
+&pcie1_phy {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie1_3_cfg>;
+	status = "okay";
+};
+
+&pcie1_port {
+	phys = <&pcie1_phy>;
+	vpcie3v3-supply = <&pcie_vcc_3v3>;
+};
+
+&pcie1 {
+	vpcie3v3-supply = <&pcie_vcc_3v3>;
+	status = "okay";
+};
+
+&pcie2_phy {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie2_4_cfg>;
+	status = "okay";
+};
+
+&pcie2_port {
+	phys = <&pcie2_phy>;
+	vpcie3v3-supply = <&pcie_vcc_3v3>;
+};
+
+&pcie2 {
+	vpcie3v3-supply = <&pcie_vcc_3v3>;
+	status = "okay";
+};
+
 &qspi {
 	pinctrl-names = "default";
 	pinctrl-0 = <&qspi_cfg>;
Signature · 1 line
2.51.0
Reviewed-by on v1 6/6
#16 lore raw

Re: [PATCH 6/6] riscv: dts: spacemit: enable PCIe ports on Milk-V Jupiter

Quoted 8 lines · Aurelien Jarno

Enable the two PCIe controller along with and their associated PHY. They are routed to the M.2 M-key connector and to the the PCIe x8 slot.

Add an always-on regulator sourcing 3.3V from the DC-IN input, to power the PCIe ports.

---

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
maintainer
#17 lore raw

Re: [PATCH 6/6] riscv: dts: spacemit: enable PCIe ports on Milk-V Jupiter

In reply to Aurelien Jarno

Hi Aurelien,

Quoted 2 lines · Aurelien Jarno

Enable the two PCIe controller along with and their associated PHY. They are routed to the M.2 M-key connector and to the the PCIe x8 slot.

                                               ~~~~~~drop one
Quoted 5 lines

Add an always-on regulator sourcing 3.3V from the DC-IN input, to power the PCIe ports.

Can you re-spin one more version? along with previous bootph-pre-ram change, you might also wanna adjust the commit message accordingly..

P.S, It's easy for me to pick from the list instead of amending locally

Signature · 1 line
Yixun Lan (dlan)