public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] riscv: dts: spacemit: Add initial support for OrangePi RV2
@ 2025-07-18  8:43 Hendrik Hamerlinck
  2025-07-18  8:43 ` [PATCH v2 1/2] dt-bindings: riscv: spacemit: Add OrangePi RV2 board Hendrik Hamerlinck
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Hendrik Hamerlinck @ 2025-07-18  8:43 UTC (permalink / raw)
  To: dlan, robh, krzk+dt, conor+dt, paul.walmsley, aou, alex, palmer
  Cc: skhan, linux-kernel-mentees, devicetree, linux-riscv, spacemit,
	linux-kernel, Hendrik Hamerlinck

This patchset adds initial device tree support for the OrangePi RV2 board.

The OrangePi RV2 [1] is marketed as using the Ky X1 SoC.
However, after research and testing, it is in fact identical to the 
SpacemiT K1 [2]. This is supported by the following:

- Similar integration in the Banana Pi kernel tree [3], which uses the 
  OrangePi RV2 and identifies it as the SpacemiT K1.
- Comparison of the device tree code showing a match to the OrangePi RV2 
  Linux tree [4].
- Locally tested the OrangePi RV2 with the SpacemiT K1 device tree, 
  confirming it boots and operates correctly.

Patch #1 documents the compatible string for the OrangePi RV2, and 
patch #2 adds its minimal device tree. This enables booting to a serial
console with UART output and blinking a LED, similar to other K1-based 
boards such as the Banana Pi BPI-F3 or the Milk-V Jupiter.

Link: http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-RV2.html [1]
Link: https://www.spacemit.com/en/key-stone-k1 [2]
Link: https://github.com/BPI-SINOVOIP/pi-linux/blob/linux-6.6.63-k1/arch/riscv/boot/dts/spacemit/k1-x_orangepi-rv2.dts [3]
Link: https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-6.6-ky [4]

Changes in v2:
Patch 1: no changes.
Patch 2:
- Added aliases section to the device tree.
- Removed the memory section, as it is populated by the bootloader.
- Updated copyright header.

Here is version 1 of this series:
  https://lore.kernel.org/spacemit/20250711183245.256683-1-hendrik.hamerlinck@hammernet.be/
This series is intended for the v6.18 merge window.
I'll follow up after the v6.17-rc1 is released as suggested.

Hendrik Hamerlinck (2):
  dt-bindings: riscv: spacemit: Add OrangePi RV2 board
  riscv: dts: spacemit: Add OrangePi RV2 board device tree

 .../devicetree/bindings/riscv/spacemit.yaml   |  1 +
 arch/riscv/boot/dts/spacemit/Makefile         |  1 +
 .../boot/dts/spacemit/k1-orangepi-rv2.dts     | 40 +++++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts

-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/2] dt-bindings: riscv: spacemit: Add OrangePi RV2 board
  2025-07-18  8:43 [PATCH v2 0/2] riscv: dts: spacemit: Add initial support for OrangePi RV2 Hendrik Hamerlinck
@ 2025-07-18  8:43 ` Hendrik Hamerlinck
  2025-07-18  8:43 ` [PATCH v2 2/2] riscv: dts: spacemit: Add OrangePi RV2 board device tree Hendrik Hamerlinck
  2025-07-18  8:57 ` [PATCH v2 0/2] riscv: dts: spacemit: Add initial support for OrangePi RV2 Yixun Lan
  2 siblings, 0 replies; 6+ messages in thread
From: Hendrik Hamerlinck @ 2025-07-18  8:43 UTC (permalink / raw)
  To: dlan, robh, krzk+dt, conor+dt, paul.walmsley, aou, alex, palmer
  Cc: skhan, linux-kernel-mentees, devicetree, linux-riscv, spacemit,
	linux-kernel, Hendrik Hamerlinck

Document the compatible string for the OrangePi RV2 board [1], which
is marketed as using the Ky X1 SoC but is in fact identical to
the SpacemiT K1 SoC [2].

Link: http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-RV2.html [1]
Link: https://www.spacemit.com/en/key-stone-k1 [2]
Signed-off-by: Hendrik Hamerlinck <hendrik.hamerlinck@hammernet.be>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
---
v2: No changes.
---
 Documentation/devicetree/bindings/riscv/spacemit.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/riscv/spacemit.yaml b/Documentation/devicetree/bindings/riscv/spacemit.yaml
index 077b94f10dca..c56b62a6299a 100644
--- a/Documentation/devicetree/bindings/riscv/spacemit.yaml
+++ b/Documentation/devicetree/bindings/riscv/spacemit.yaml
@@ -22,6 +22,7 @@ properties:
           - enum:
               - bananapi,bpi-f3
               - milkv,jupiter
+              - xunlong,orangepi-rv2
           - const: spacemit,k1
 
 additionalProperties: true
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] riscv: dts: spacemit: Add OrangePi RV2 board device tree
  2025-07-18  8:43 [PATCH v2 0/2] riscv: dts: spacemit: Add initial support for OrangePi RV2 Hendrik Hamerlinck
  2025-07-18  8:43 ` [PATCH v2 1/2] dt-bindings: riscv: spacemit: Add OrangePi RV2 board Hendrik Hamerlinck
@ 2025-07-18  8:43 ` Hendrik Hamerlinck
  2025-07-18  9:10   ` Vivian Wang
  2025-07-18  8:57 ` [PATCH v2 0/2] riscv: dts: spacemit: Add initial support for OrangePi RV2 Yixun Lan
  2 siblings, 1 reply; 6+ messages in thread
From: Hendrik Hamerlinck @ 2025-07-18  8:43 UTC (permalink / raw)
  To: dlan, robh, krzk+dt, conor+dt, paul.walmsley, aou, alex, palmer
  Cc: skhan, linux-kernel-mentees, devicetree, linux-riscv, spacemit,
	linux-kernel, Hendrik Hamerlinck

Add initial device tree support for the OrangePi RV2 board [1], which is
marketed as using the Ky X1 SoC but has been confirmed to be 
identical to the SpacemiT K1 [2].

The device tree is adapted from the OrangePi vendor tree [3], and similar
integration can be found in the Banana Pi kernel tree [4], confirming SoC
compatibility.

This minimal device tree enables booting into a serial console with UART
output and a blinking LED.

Link: http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-RV2.html [1]
Link: https://www.spacemit.com/en/key-stone-k1 [2]
Link: https://github.com/BPI-SINOVOIP/pi-linux/blob/linux-6.6.63-k1/arch/riscv/boot/dts/spacemit/k1-x_orangepi-rv2.dts [3]
Link: https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-6.6-ky [4]
Signed-off-by: Hendrik Hamerlinck <hendrik.hamerlinck@hammernet.be>
---
Changes since v1:
- Added the aliases section to the device tree.
- Removed the memory section, as it is populated by the bootloader.
- Replaced unclear copyright similar to the other K1-based boards.
---
 arch/riscv/boot/dts/spacemit/Makefile         |  1 +
 .../boot/dts/spacemit/k1-orangepi-rv2.dts     | 40 +++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts

diff --git a/arch/riscv/boot/dts/spacemit/Makefile b/arch/riscv/boot/dts/spacemit/Makefile
index 92e13ce1c16d..152832644870 100644
--- a/arch/riscv/boot/dts/spacemit/Makefile
+++ b/arch/riscv/boot/dts/spacemit/Makefile
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_ARCH_SPACEMIT) += k1-bananapi-f3.dtb
 dtb-$(CONFIG_ARCH_SPACEMIT) += k1-milkv-jupiter.dtb
+dtb-$(CONFIG_ARCH_SPACEMIT) += k1-orangepi-rv2.dtb
diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
new file mode 100644
index 000000000000..337240ebb7b7
--- /dev/null
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2024 Yangyu Chen <cyy@cyyself.name>
+ * Copyright (C) 2025 Hendrik Hamerlinck <hendrik.hamerlinck@hammernet.be>
+ */
+
+/dts-v1/;
+
+#include "k1.dtsi"
+#include "k1-pinctrl.dtsi"
+
+/ {
+	model = "OrangePi RV2";
+	compatible = "xunlong,orangepi-rv2", "spacemit,k1";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led1 {
+			label = "sys-led";
+			gpios = <&gpio K1_GPIO(96) GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "heartbeat";
+			default-state = "on";
+		};
+	};
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_2_cfg>;
+	status = "okay";
+};
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/2] riscv: dts: spacemit: Add initial support for OrangePi RV2
  2025-07-18  8:43 [PATCH v2 0/2] riscv: dts: spacemit: Add initial support for OrangePi RV2 Hendrik Hamerlinck
  2025-07-18  8:43 ` [PATCH v2 1/2] dt-bindings: riscv: spacemit: Add OrangePi RV2 board Hendrik Hamerlinck
  2025-07-18  8:43 ` [PATCH v2 2/2] riscv: dts: spacemit: Add OrangePi RV2 board device tree Hendrik Hamerlinck
@ 2025-07-18  8:57 ` Yixun Lan
  2 siblings, 0 replies; 6+ messages in thread
From: Yixun Lan @ 2025-07-18  8:57 UTC (permalink / raw)
  To: Hendrik Hamerlinck
  Cc: robh, krzk+dt, conor+dt, paul.walmsley, aou, alex, palmer, skhan,
	linux-kernel-mentees, devicetree, linux-riscv, spacemit,
	linux-kernel

Hi Hendrik,

On 10:43 Fri 18 Jul     , Hendrik Hamerlinck wrote:
> This patchset adds initial device tree support for the OrangePi RV2 board.
> 
> The OrangePi RV2 [1] is marketed as using the Ky X1 SoC.
> However, after research and testing, it is in fact identical to the 
> SpacemiT K1 [2]. This is supported by the following:
> 
> - Similar integration in the Banana Pi kernel tree [3], which uses the 
>   OrangePi RV2 and identifies it as the SpacemiT K1.
> - Comparison of the device tree code showing a match to the OrangePi RV2 
>   Linux tree [4].
> - Locally tested the OrangePi RV2 with the SpacemiT K1 device tree, 
>   confirming it boots and operates correctly.
> 
> Patch #1 documents the compatible string for the OrangePi RV2, and 
> patch #2 adds its minimal device tree. This enables booting to a serial
> console with UART output and blinking a LED, similar to other K1-based 
> boards such as the Banana Pi BPI-F3 or the Milk-V Jupiter.
> 
> Link: http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-RV2.html [1]
> Link: https://www.spacemit.com/en/key-stone-k1 [2]
> Link: https://github.com/BPI-SINOVOIP/pi-linux/blob/linux-6.6.63-k1/arch/riscv/boot/dts/spacemit/k1-x_orangepi-rv2.dts [3]
> Link: https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-6.6-ky [4]
> 
> Changes in v2:
> Patch 1: no changes.
> Patch 2:
> - Added aliases section to the device tree.
> - Removed the memory section, as it is populated by the bootloader.
> - Updated copyright header.
> 
Looks good

Reviewed-by: Yixun Lan <dlan@gentoo.org>

-- 
Yixun Lan (dlan)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] riscv: dts: spacemit: Add OrangePi RV2 board device tree
  2025-07-18  8:43 ` [PATCH v2 2/2] riscv: dts: spacemit: Add OrangePi RV2 board device tree Hendrik Hamerlinck
@ 2025-07-18  9:10   ` Vivian Wang
  2025-07-18 10:07     ` Yixun Lan
  0 siblings, 1 reply; 6+ messages in thread
From: Vivian Wang @ 2025-07-18  9:10 UTC (permalink / raw)
  To: Hendrik Hamerlinck, dlan, robh, krzk+dt, conor+dt, paul.walmsley,
	aou, alex, palmer
  Cc: skhan, linux-kernel-mentees, devicetree, linux-riscv, spacemit,
	linux-kernel

Hi Hendrik,

On 7/18/25 16:43, Hendrik Hamerlinck wrote:
> Add initial device tree support for the OrangePi RV2 board [1], which is
> marketed as using the Ky X1 SoC but has been confirmed to be 
> identical to the SpacemiT K1 [2].
>
> The device tree is adapted from the OrangePi vendor tree [3], and similar
> integration can be found in the Banana Pi kernel tree [4], confirming SoC
> compatibility.

This isn't particularly crucial, but I wonder if we can do something
similar to a jh7110-common.dtsi arrangement, where most of the boards
sharing similar designs can also share devicetree source files.

Easier said than done, probably, but I think it should be possible by
just comparing the vendor dts files.

Again this doesn't need to block this patch.

Yixun: I'm assuming you'll be handling this. What do you think about a
k1-common.dtsi?

Vivian "dramforever" Wang

> This minimal device tree enables booting into a serial console with UART
> output and a blinking LED.
>
> Link: http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-RV2.html [1]
> Link: https://www.spacemit.com/en/key-stone-k1 [2]
> Link: https://github.com/BPI-SINOVOIP/pi-linux/blob/linux-6.6.63-k1/arch/riscv/boot/dts/spacemit/k1-x_orangepi-rv2.dts [3]
> Link: https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-6.6-ky [4]
> Signed-off-by: Hendrik Hamerlinck <hendrik.hamerlinck@hammernet.be>
> ---
> Changes since v1:
> - Added the aliases section to the device tree.
> - Removed the memory section, as it is populated by the bootloader.
> - Replaced unclear copyright similar to the other K1-based boards.
> ---
> [...]


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] riscv: dts: spacemit: Add OrangePi RV2 board device tree
  2025-07-18  9:10   ` Vivian Wang
@ 2025-07-18 10:07     ` Yixun Lan
  0 siblings, 0 replies; 6+ messages in thread
From: Yixun Lan @ 2025-07-18 10:07 UTC (permalink / raw)
  To: Vivian Wang
  Cc: Hendrik Hamerlinck, robh, krzk+dt, conor+dt, paul.walmsley, aou,
	alex, palmer, skhan, linux-kernel-mentees, devicetree,
	linux-riscv, spacemit, linux-kernel

Hi Vivian,

On 17:10 Fri 18 Jul     , Vivian Wang wrote:
> Hi Hendrik,
> 
> On 7/18/25 16:43, Hendrik Hamerlinck wrote:
> > Add initial device tree support for the OrangePi RV2 board [1], which is
> > marketed as using the Ky X1 SoC but has been confirmed to be 
> > identical to the SpacemiT K1 [2].
> >
> > The device tree is adapted from the OrangePi vendor tree [3], and similar
> > integration can be found in the Banana Pi kernel tree [4], confirming SoC
> > compatibility.
> 
> This isn't particularly crucial, but I wonder if we can do something
> similar to a jh7110-common.dtsi arrangement, where most of the boards
> sharing similar designs can also share devicetree source files.
> 
> Easier said than done, probably, but I think it should be possible by
> just comparing the vendor dts files.
> 
> Again this doesn't need to block this patch.
> 
Sure

> Yixun: I'm assuming you'll be handling this. What do you think about a
> k1-common.dtsi?
> 

Sharing dtsi file for similar boards is generally fine, I saw a few
other SoC maintainers have done the same..

In the practical cases, we have to evaluate and plan carefully, it
should be manageable to support fixed number of boards for one file,
but would be nasty if expect one common dts file to cover all boards..

Anyhow, I think we can revisit this idea and having incremental patch
later, it's not the problem for now

Thanks for the suggestion

-- 
Yixun Lan (dlan)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-18 10:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-18  8:43 [PATCH v2 0/2] riscv: dts: spacemit: Add initial support for OrangePi RV2 Hendrik Hamerlinck
2025-07-18  8:43 ` [PATCH v2 1/2] dt-bindings: riscv: spacemit: Add OrangePi RV2 board Hendrik Hamerlinck
2025-07-18  8:43 ` [PATCH v2 2/2] riscv: dts: spacemit: Add OrangePi RV2 board device tree Hendrik Hamerlinck
2025-07-18  9:10   ` Vivian Wang
2025-07-18 10:07     ` Yixun Lan
2025-07-18  8:57 ` [PATCH v2 0/2] riscv: dts: spacemit: Add initial support for OrangePi RV2 Yixun Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox