Skip to contentSkip to conversation

arm: boards: Add support for Protonic PRTPUK board

PATCH Applied David Jander 3 participants 8 messages Aug 13, 2025 – Aug 25, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: boards: Add support for Protonic PRTPUK board

PRTPUK is a credit-card sized ISOBUS virtual terminal, based on the Rockchip RK3576 SoC, that features a CAN interface and a 100/1000Base-T1 interface for HS-ISOBUS (HSI), as well as a USB-C port for connecting to a touch-screen monitor.

---
 arch/arm/boards/Makefile                   |   1 +
 arch/arm/boards/protonic-prtpuk/Makefile   |   3 +
 arch/arm/boards/protonic-prtpuk/board.c    | 162 ++++++++
 arch/arm/boards/protonic-prtpuk/lowlevel.c |  23 +
 arch/arm/configs/multi_v8_defconfig        |   1 +
 arch/arm/configs/rockchip_v8_defconfig     |   1 +
 arch/arm/dts/Makefile                      |   1 +
 arch/arm/dts/rk3576-prtpuk-linux.dts       | 462 +++++++++++++++++++++
 arch/arm/dts/rk3576-prtpuk.dts             | 124 ++++++
 arch/arm/mach-rockchip/Kconfig             |   6 +
 dts/Bindings/arm/rockchip.yaml             |   5 +
 images/Makefile.rockchip                   |   1 +
 12 files changed, 790 insertions(+)
 create mode 100644 arch/arm/boards/protonic-prtpuk/Makefile
 create mode 100644 arch/arm/boards/protonic-prtpuk/board.c
 create mode 100644 arch/arm/boards/protonic-prtpuk/lowlevel.c
 create mode 100644 arch/arm/dts/rk3576-prtpuk-linux.dts
 create mode 100644 arch/arm/dts/rk3576-prtpuk.dts
arch/arm/boards/Makefile +1 -0
index ac1fa74d4c..01062783b1 100644
@@ -92,6 +92,7 @@ obj-$(CONFIG_MACH_POLYHEX_DEBIX)		+= polyhex-debix/
 obj-$(CONFIG_MACH_PROTONIC_IMX6)		+= protonic-imx6/
 obj-$(CONFIG_MACH_PROTONIC_IMX8M)		+= protonic-imx8m/
 obj-$(CONFIG_MACH_PROTONIC_MECSBC)		+= protonic-mecsbc/
+obj-$(CONFIG_MACH_PROTONIC_PRTPUK)		+= protonic-prtpuk/
 obj-$(CONFIG_MACH_PROTONIC_STM32MP1)		+= protonic-stm32mp1/
 obj-$(CONFIG_MACH_PROTONIC_STM32MP13)		+= protonic-stm32mp13/
 obj-$(CONFIG_MACH_QIL_A9260)			+= qil-a926x/
arch/arm/boards/protonic-prtpuk/Makefile new file +3 -0
new file mode 100644
index 0000000000..b37b6c870b
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-y += board.o
+lwl-y += lowlevel.o
arch/arm/boards/protonic-prtpuk/board.c new file +162 -0

162 lines not on this page · raw message

arch/arm/boards/protonic-prtpuk/lowlevel.c new file +23 -0
new file mode 100644
index 0000000000..08de527bf6
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <common.h>
+#include <asm/barebox-arm.h>
+#include <mach/rockchip/hardware.h>
+#include <mach/rockchip/atf.h>
+#include <debug_ll.h>
+
+extern char __dtb_rk3576_prtpuk_start[];
+
+ENTRY_FUNCTION(start_prtpuk, r0, r1, r2)
+{
+	putc_ll('>');
+
+	if (current_el() == 3)
+		relocate_to_adr_full(RK3576_BAREBOX_LOAD_ADDRESS);
+	else
+		relocate_to_current_adr();
+
+	setup_c();
+
+	rk3576_barebox_entry(__dtb_rk3576_prtpuk_start);
+}
arch/arm/configs/multi_v8_defconfig +1 -0
index a487d331d0..d63899b278 100644
@@ -37,6 +37,7 @@ CONFIG_MACH_RK3568_BPI_R2PRO=y
 CONFIG_MACH_PINE64_PINETAB2=y
 CONFIG_MACH_PINE64_QUARTZ64=y
 CONFIG_MACH_PROTONIC_MECSBC=y
+CONFIG_MACH_PROTONIC_PRTPUK=y
 CONFIG_MACH_RADXA_ROCK3=y
 CONFIG_MACH_RADXA_ROCK5=y
 CONFIG_MACH_RADXA_CM3=y
arch/arm/configs/rockchip_v8_defconfig +1 -0
index 0239f857aa..bd23cadc18 100644
@@ -4,6 +4,7 @@ CONFIG_MACH_RK3568_BPI_R2PRO=y
 CONFIG_MACH_PINE64_PINETAB2=y
 CONFIG_MACH_PINE64_QUARTZ64=y
 CONFIG_MACH_PROTONIC_MECSBC=y
+CONFIG_MACH_PROTONIC_PRTPUK=y
 CONFIG_MACH_RADXA_ROCK3=y
 CONFIG_MACH_RADXA_ROCK5=y
 CONFIG_MACH_RADXA_CM3=y
arch/arm/dts/Makefile +1 -0
index 6612a51452..75d7c1923b 100644
@@ -112,6 +112,7 @@ lwl-$(CONFIG_MACH_PROTONIC_IMX6) += \
 	imx6ull-jozacp.dtb.o
 lwl-$(CONFIG_MACH_PROTONIC_IMX8M) += imx8mm-prt8mm.dtb.o
 lwl-$(CONFIG_MACH_PROTONIC_MECSBC) += rk3568-mecsbc.dtb.o
+lwl-$(CONFIG_MACH_PROTONIC_PRTPUK) += rk3576-prtpuk.dtb.o
 lwl-$(CONFIG_MACH_PROTONIC_STM32MP1) += \
 	stm32mp151-prtt1a.dtb.o \
 	stm32mp151-prtt1c.dtb.o \
arch/arm/dts/rk3576-prtpuk-linux.dts new file +462 -0

462 lines not on this page · raw message

arch/arm/dts/rk3576-prtpuk.dts new file +124 -0

124 lines not on this page · raw message

arch/arm/mach-rockchip/Kconfig +6 -0
index d172522c6f..cc9ea304af 100644
@@ -95,6 +95,12 @@ config MACH_PROTONIC_MECSBC
 	help
 	  Say Y here if you are using a Protonic MECSBC
 
+config MACH_PROTONIC_PRTPUK
+	select ARCH_RK3576
+	bool "Protonic PRTPUK"
+	help
+	  Say Y here if you are using a Protonic PRTPUK
+
 config MACH_RADXA_ROCK3
 	select ARCH_RK3568
 	bool "Radxa ROCK3"
dts/Bindings/arm/rockchip.yaml +5 -0
index 5772d905f3..93f9c4bb7c 100644
@@ -828,6 +828,11 @@ properties:
           - const: prt,mecsbc
           - const: rockchip,rk3568
 
+      - description: Protonic PRTPUK board
+        items:
+          - const: prt,prtpuk
+          - const: rockchip,rk3576
+
       - description: QNAP TS-433-4G 4-Bay NAS
         items:
           - const: qnap,ts433
images/Makefile.rockchip +1 -0
index 761c6b8149..99376b010f 100644
@@ -35,6 +35,7 @@ $(call build_rockchip_image, CONFIG_MACH_PINE64_PINETAB2, start_pinetab2_v0, pin
 $(call build_rockchip_image, CONFIG_MACH_PINE64_PINETAB2, start_pinetab2_v2, pine64-pinetab2/sdram-init.bin, pinetab2-v2)
 $(call build_rockchip_image, CONFIG_MACH_PINE64_QUARTZ64, start_quartz64a, pine64-quartz64/sdram-init.bin, quartz64a)
 $(call build_rockchip_image, CONFIG_MACH_PROTONIC_MECSBC, start_mecsbc, protonic-mecsbc/sdram-init.bin, mecsbc)
+$(call build_rockchip_image, CONFIG_MACH_PROTONIC_PRTPUK, start_prtpuk, protonic-prtpuk/sdram-init.bin, prtpuk)
 $(call build_rockchip_image, CONFIG_MACH_RADXA_ROCK3, start_rock3a, radxa-rock3/sdram-init.bin, rock3a)
 $(call build_rockchip_image, CONFIG_MACH_RADXA_ROCK5, start_rock5b, radxa-rock5/sdram-init.bin, rock5b)
 $(call build_rockchip_image, CONFIG_MACH_RADXA_CM3, start_radxa_cm3_io, radxa-cm3/sdram-init.bin, radxa-cm3-io)
Signature · 1 line
2.47.2
#1 lore raw
Quoted 4 lines · On Wed, 13 Aug 2025 09:01:49 +0200 David Jander <[email protected]> wrote:

PRTPUK is a credit-card sized ISOBUS virtual terminal, based on the Rockchip RK3576 SoC, that features a CAN interface and a 100/1000Base-T1 interface for HS-ISOBUS (HSI), as well as a USB-C port for connecting to a touch-screen monitor.

Note: This code should apply to next as of today, but next doesn't compile right now. On v2025.07.0 it depends on the RK3576 support patches, but will build (and run) fine when both are applied.

Best regards,

Signature · 1 line
David Jander
#2 lore raw

Hello David,

Quoted 11 lines · David Jander
Quoted 4 lines · On Wed, 13 Aug 2025 09:01:49 +0200 David Jander <[email protected]> wrote:

PRTPUK is a credit-card sized ISOBUS virtual terminal, based on the Rockchip RK3576 SoC, that features a CAN interface and a 100/1000Base-T1 interface for HS-ISOBUS (HSI), as well as a USB-C port for connecting to a touch-screen monitor.

Note: This code should apply to next as of today, but next doesn't compile right now. On v2025.07.0 it depends on the RK3576 support patches, but will build (and run) fine when both are applied.

Firstly, thanks for your patches!

I'd like to more prominently advertise new hardware support in the future and I am happy about screenshots of new hardware running bfetch[1] or other eye candy to be posted (or reposted if you have a Mastodon account) on @[email protected].

Just saying. :-)

[1]: b4 shazam https://lore.barebox.org/barebox/[email protected]

Cheers,
Ahmad

Quoted 3 lines

Best regards,

Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#3 lore raw
In reply to David Jander

Hi David,

Quoted 15 lines · David Jander

PRTPUK is a credit-card sized ISOBUS virtual terminal, based on the Rockchip RK3576 SoC, that features a CAN interface and a 100/1000Base-T1 interface for HS-ISOBUS (HSI), as well as a USB-C port for connecting to a touch-screen monitor.

+&sdhci {

arch/arm/dts/rk3576-prtpuk.dts new file +9 -0
+	no-sd;
+
+	partitions {
+		compatible = "barebox,fixed-partitions";
+		#address-cells = <2>;
+		#size-cells = <2>;
+
+		/* eMMC reserved 8MiB for barebox (2 copies?), env and state */
+		environment_emmc: partition@7b0000 {

arch/arm/dts/rk3576-prtpuk.dts line 118

Quoted 10 lines
arch/arm/dts/rk3576-prtpuk.dts new file +10 -0
+			label = "barebox-environment";
+			reg = <0x0 0x7b0000 0x0 0x10000>;
+		};
+
+		/* eMMC state after barebox and environment */
+		state_backend_emmc: partition@7c0000 {
+			label = "state";
+			reg = <0x0 0x7c0000 0x0 0x40000>;
+		};
+	};

We are trying to get away from hardcoding partitions outside the GPT in the device tree and I think we are there.

A partition with the type UUID PARTITION_BAREBOX_ENVIRONMENT_GUID will be used as environment partition automatically.

A partition with the type UUID BAREBOX_STATE_PARTITION_GUID will be used as state partition provided the state node points to the device containing this partition.

We also have a parted command to create/modify partitions and for further convenience a createnv command which will create a barebox environment partition in case you haven't built a full partition image from a BSP.

It would be great if you could test this and eventually switch over to it.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#4 lore raw

Dear Sascha,

Quoted 39 lines · On Thu, 14 Aug 2025 13:26:31 +0200 Sascha Hauer <[email protected]> wrote:

Hi David,

Quoted 15 lines · David Jander

PRTPUK is a credit-card sized ISOBUS virtual terminal, based on the Rockchip RK3576 SoC, that features a CAN interface and a 100/1000Base-T1 interface for HS-ISOBUS (HSI), as well as a USB-C port for connecting to a touch-screen monitor.

+&sdhci {

arch/arm/dts/rk3576-prtpuk.dts new file +9 -0
+	no-sd;
+
+	partitions {
+		compatible = "barebox,fixed-partitions";
+		#address-cells = <2>;
+		#size-cells = <2>;
+
+		/* eMMC reserved 8MiB for barebox (2 copies?), env and state */
+		environment_emmc: partition@7b0000 {

arch/arm/dts/rk3576-prtpuk.dts line 118

Quoted 10 lines
arch/arm/dts/rk3576-prtpuk.dts new file +10 -0
+			label = "barebox-environment";
+			reg = <0x0 0x7b0000 0x0 0x10000>;
+		};
+
+		/* eMMC state after barebox and environment */
+		state_backend_emmc: partition@7c0000 {
+			label = "state";
+			reg = <0x0 0x7c0000 0x0 0x40000>;
+		};
+	};  

We are trying to get away from hardcoding partitions outside the GPT in the device tree and I think we are there.

A partition with the type UUID PARTITION_BAREBOX_ENVIRONMENT_GUID will be used as environment partition automatically.

A partition with the type UUID BAREBOX_STATE_PARTITION_GUID will be used as state partition provided the state node points to the device containing this partition.

Quoted 7 lines

We also have a parted command to create/modify partitions and for further convenience a createnv command which will create a barebox environment partition in case you haven't built a full partition image from a BSP.

It would be great if you could test this and eventually switch over to it.

This was copied over from MECSBC. I didn't know things had changed since.

I agree it is much better to have all storage areas indexed by a GPT, but it will mean that we will need to change every instance of identifying a partition from number-based indexes to UUID or labels. And of course there are a lot more partitions that will have to be included for completeness, specially on Rockchip platforms. See here:

https://opensource.rock-chips.com/wiki_Partitions

This looks like a big mess, but I suppose we should at leas have loader1 (which is the whole of barebox, TF-A and optee). "U-Boot ENV" would be replaced by barebox environment, and loader2 and trust would disappear. On the MECSBC platform we started to use the Vendor Storage partition for storing serial number and MAC address, so unless there is a better place for these, we'd continue adhering to the Rockchip standard... for lack of a better standard.

I'll try to come up with a partition layout that includes everything, including the GUID's you mentioned above. Thanks.

Best regards,

Signature · 1 line
David Jander
#5 lore raw
Quoted 71 lines · David Jander

Dear Sascha,

Quoted 39 lines · On Thu, 14 Aug 2025 13:26:31 +0200 Sascha Hauer <[email protected]> wrote:

Hi David,

Quoted 15 lines · David Jander

PRTPUK is a credit-card sized ISOBUS virtual terminal, based on the Rockchip RK3576 SoC, that features a CAN interface and a 100/1000Base-T1 interface for HS-ISOBUS (HSI), as well as a USB-C port for connecting to a touch-screen monitor.

+&sdhci {

arch/arm/dts/rk3576-prtpuk.dts new file +9 -0
+	no-sd;
+
+	partitions {
+		compatible = "barebox,fixed-partitions";
+		#address-cells = <2>;
+		#size-cells = <2>;
+
+		/* eMMC reserved 8MiB for barebox (2 copies?), env and state */
+		environment_emmc: partition@7b0000 {

arch/arm/dts/rk3576-prtpuk.dts line 118

Quoted 10 lines
arch/arm/dts/rk3576-prtpuk.dts new file +10 -0
+			label = "barebox-environment";
+			reg = <0x0 0x7b0000 0x0 0x10000>;
+		};
+
+		/* eMMC state after barebox and environment */
+		state_backend_emmc: partition@7c0000 {
+			label = "state";
+			reg = <0x0 0x7c0000 0x0 0x40000>;
+		};
+	};  

We are trying to get away from hardcoding partitions outside the GPT in the device tree and I think we are there.

A partition with the type UUID PARTITION_BAREBOX_ENVIRONMENT_GUID will be used as environment partition automatically.

A partition with the type UUID BAREBOX_STATE_PARTITION_GUID will be used as state partition provided the state node points to the device containing this partition.

Quoted 7 lines

We also have a parted command to create/modify partitions and for further convenience a createnv command which will create a barebox environment partition in case you haven't built a full partition image from a BSP.

It would be great if you could test this and eventually switch over to it.

This was copied over from MECSBC. I didn't know things had changed since.

I agree it is much better to have all storage areas indexed by a GPT, but it will mean that we will need to change every instance of identifying a partition from number-based indexes to UUID or labels. And of course there are a lot more partitions that will have to be included for completeness, specially on Rockchip platforms. See here:

https://opensource.rock-chips.com/wiki_Partitions

This looks like a big mess, but I suppose we should at leas have loader1 (which is the whole of barebox, TF-A and optee). "U-Boot ENV" would be replaced by barebox environment, and loader2 and trust would disappear. On the MECSBC platform we started to use the Vendor Storage partition for storing serial number and MAC address, so unless there is a better place for these, we'd continue adhering to the Rockchip standard... for lack of a better standard.

Quoted 2 lines

I'll try to come up with a partition layout that includes everything, including the GUID's you mentioned above. Thanks.

I'm not sure how it helps us to adhere to the partitioning scheme described in your link. If you want to do it, you can do it and still give the barebox environment partition the expected UUID so that barebox detects it.

Anyway, I applied the patch as-is to get some compile coverage for RK3576, you can still change the partitioning later.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#6 lore raw
Quoted 72 lines · On Mon, 25 Aug 2025 11:05:00 +0200 Sascha Hauer <[email protected]> wrote:
Quoted 71 lines · David Jander

Dear Sascha,

Quoted 39 lines · On Thu, 14 Aug 2025 13:26:31 +0200 Sascha Hauer <[email protected]> wrote:

Hi David,

Quoted 15 lines · David Jander

PRTPUK is a credit-card sized ISOBUS virtual terminal, based on the Rockchip RK3576 SoC, that features a CAN interface and a 100/1000Base-T1 interface for HS-ISOBUS (HSI), as well as a USB-C port for connecting to a touch-screen monitor.

+&sdhci {

arch/arm/dts/rk3576-prtpuk.dts new file +9 -0
+	no-sd;
+
+	partitions {
+		compatible = "barebox,fixed-partitions";
+		#address-cells = <2>;
+		#size-cells = <2>;
+
+		/* eMMC reserved 8MiB for barebox (2 copies?), env and state */
+		environment_emmc: partition@7b0000 {

arch/arm/dts/rk3576-prtpuk.dts line 118

Quoted 10 lines
arch/arm/dts/rk3576-prtpuk.dts new file +10 -0
+			label = "barebox-environment";
+			reg = <0x0 0x7b0000 0x0 0x10000>;
+		};
+
+		/* eMMC state after barebox and environment */
+		state_backend_emmc: partition@7c0000 {
+			label = "state";
+			reg = <0x0 0x7c0000 0x0 0x40000>;
+		};
+	};    

We are trying to get away from hardcoding partitions outside the GPT in the device tree and I think we are there.

A partition with the type UUID PARTITION_BAREBOX_ENVIRONMENT_GUID will be used as environment partition automatically.

A partition with the type UUID BAREBOX_STATE_PARTITION_GUID will be used as state partition provided the state node points to the device containing this partition.

Quoted 7 lines

We also have a parted command to create/modify partitions and for further convenience a createnv command which will create a barebox environment partition in case you haven't built a full partition image from a BSP.

It would be great if you could test this and eventually switch over to it.

This was copied over from MECSBC. I didn't know things had changed since.

I agree it is much better to have all storage areas indexed by a GPT, but it will mean that we will need to change every instance of identifying a partition from number-based indexes to UUID or labels. And of course there are a lot more partitions that will have to be included for completeness, specially on Rockchip platforms. See here:

https://opensource.rock-chips.com/wiki_Partitions

This looks like a big mess, but I suppose we should at leas have loader1 (which is the whole of barebox, TF-A and optee). "U-Boot ENV" would be replaced by barebox environment, and loader2 and trust would disappear. On the MECSBC platform we started to use the Vendor Storage partition for storing serial number and MAC address, so unless there is a better place for these, we'd continue adhering to the Rockchip standard... for lack of a better standard.

Quoted 7 lines
Quoted 2 lines

I'll try to come up with a partition layout that includes everything, including the GUID's you mentioned above. Thanks.

I'm not sure how it helps us to adhere to the partitioning scheme described in your link. If you want to do it, you can do it and still give the barebox environment partition the expected UUID so that barebox detects it.

Sure. The link was more or less informative in case you hadn't seen this.

Quoted 2 lines

Anyway, I applied the patch as-is to get some compile coverage for RK3576, you can still change the partitioning later.

Ok, thanks. Sorry I couldn't find time to resubmit a new version yet. I will look into this later and send incremental patches if needed.

Best regards,

Signature · 1 line
David Jander
Applied
#7 lore raw
In reply to David Jander
Quoted 6 lines · David Jander

PRTPUK is a credit-card sized ISOBUS virtual terminal, based on the Rockchip RK3576 SoC, that features a CAN interface and a 100/1000Base-T1 interface for HS-ISOBUS (HSI), as well as a USB-C port for connecting to a touch-screen monitor.

Applied, thanks!

[1/1] arm: boards: Add support for Protonic PRTPUK board
https://git.pengutronix.de/cgit/barebox/commit/?id=f6464bb752ba (link may not be stable)

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>