DistroKit Mailinglist
 help / color / mirror / Atom feed
From: Roland Hieber <rhi@pengutronix.de>
To: distrokit@pengutronix.de
Cc: Roland Hieber <rhi@pengutronix.de>
Subject: [DistroKit] [PATCH v3 04/14] v7a: barebox: include generic bootstate node in device tree
Date: Thu, 27 Apr 2023 12:01:24 +0200	[thread overview]
Message-ID: <20230427100134.2934937-5-rhi@pengutronix.de> (raw)
In-Reply-To: <20230427100134.2934937-1-rhi@pengutronix.de>

Add a device tree fragment via CONFIG_EXTERNAL_DTS_FRAGMENTS in the
barebox config, which is appended to each device tree built by barebox.
Then add definitions for the state variables, which are the same on all
boards; board-specific state backends will be added in the next patches.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-v7a/barebox-am335x.config    |  2 +-
 .../platform-v7a/barebox-am335x.config.diff   |  2 +-
 configs/platform-v7a/barebox-at91.config      |  2 +-
 configs/platform-v7a/barebox-at91.config.diff |  2 +-
 configs/platform-v7a/barebox-mx6.config       |  2 +-
 configs/platform-v7a/barebox-mx6.config.diff  |  2 +-
 configs/platform-v7a/barebox-rpi2.config      |  2 +-
 configs/platform-v7a/barebox-rpi2.config.diff |  2 +-
 configs/platform-v7a/barebox-stm32mp.config   |  2 +-
 .../platform-v7a/barebox-stm32mp.config.diff  |  2 +-
 configs/platform-v7a/barebox-vexpress.config  |  2 +-
 .../platform-v7a/barebox-vexpress.config.diff |  2 +-
 configs/platform-v7a/barebox.config           |  2 +-
 configs/platform-v7a/dts/bootstate.dtsi       | 50 +++++++++++++++++++
 14 files changed, 63 insertions(+), 13 deletions(-)
 create mode 100644 configs/platform-v7a/dts/bootstate.dtsi

diff --git a/configs/platform-v7a/barebox-am335x.config b/configs/platform-v7a/barebox-am335x.config
index 647d7162297c..2c4a6af1804b 100644
--- a/configs/platform-v7a/barebox-am335x.config
+++ b/configs/platform-v7a/barebox-am335x.config
@@ -215,7 +215,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/barebox-am335x.config.diff b/configs/platform-v7a/barebox-am335x.config.diff
index 20ab6803c846..f82d8531bf97 100644
--- a/configs/platform-v7a/barebox-am335x.config.diff
+++ b/configs/platform-v7a/barebox-am335x.config.diff
@@ -1,4 +1,4 @@
-68457081af06bd8377bc38ef02c7d415
+b377506ccc60db21f1050002e1af6f17
 # CONFIG_32BIT is undefined
 # CONFIG_64BIT is undefined
 # CONFIG_AM33XX_NET_BOOT is not set
diff --git a/configs/platform-v7a/barebox-at91.config b/configs/platform-v7a/barebox-at91.config
index b9f129a0ef5f..bc4af1c26039 100644
--- a/configs/platform-v7a/barebox-at91.config
+++ b/configs/platform-v7a/barebox-at91.config
@@ -224,7 +224,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/barebox-at91.config.diff b/configs/platform-v7a/barebox-at91.config.diff
index 2b7b71b6879b..fb7cd0860375 100644
--- a/configs/platform-v7a/barebox-at91.config.diff
+++ b/configs/platform-v7a/barebox-at91.config.diff
@@ -1,4 +1,4 @@
-68457081af06bd8377bc38ef02c7d415
+b377506ccc60db21f1050002e1af6f17
 # CONFIG_32BIT is undefined
 # CONFIG_64BIT is undefined
 CONFIG_ARCH_AT91=y
diff --git a/configs/platform-v7a/barebox-mx6.config b/configs/platform-v7a/barebox-mx6.config
index f6a1003d1570..c0a8faa33292 100644
--- a/configs/platform-v7a/barebox-mx6.config
+++ b/configs/platform-v7a/barebox-mx6.config
@@ -289,7 +289,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/barebox-mx6.config.diff b/configs/platform-v7a/barebox-mx6.config.diff
index 0ff150f6ebbc..f51daa42375e 100644
--- a/configs/platform-v7a/barebox-mx6.config.diff
+++ b/configs/platform-v7a/barebox-mx6.config.diff
@@ -1,4 +1,4 @@
-68457081af06bd8377bc38ef02c7d415
+b377506ccc60db21f1050002e1af6f17
 # CONFIG_32BIT is undefined
 # CONFIG_64BIT is undefined
 # CONFIG_ARCH_BCM283X is not set
diff --git a/configs/platform-v7a/barebox-rpi2.config b/configs/platform-v7a/barebox-rpi2.config
index 96b416fe414a..54b89f74525d 100644
--- a/configs/platform-v7a/barebox-rpi2.config
+++ b/configs/platform-v7a/barebox-rpi2.config
@@ -212,7 +212,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/barebox-rpi2.config.diff b/configs/platform-v7a/barebox-rpi2.config.diff
index 852c2717059c..b53c429a3e9b 100644
--- a/configs/platform-v7a/barebox-rpi2.config.diff
+++ b/configs/platform-v7a/barebox-rpi2.config.diff
@@ -1,4 +1,4 @@
-68457081af06bd8377bc38ef02c7d415
+b377506ccc60db21f1050002e1af6f17
 CONFIG_ARM_ASM_UNIFIED=y
 # CONFIG_CMD_NVMEM is not set
 # CONFIG_CMD_USBGADGET is undefined
diff --git a/configs/platform-v7a/barebox-stm32mp.config b/configs/platform-v7a/barebox-stm32mp.config
index 8a6f6d9474d2..aee11c5ecd8d 100644
--- a/configs/platform-v7a/barebox-stm32mp.config
+++ b/configs/platform-v7a/barebox-stm32mp.config
@@ -207,7 +207,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/barebox-stm32mp.config.diff b/configs/platform-v7a/barebox-stm32mp.config.diff
index 42950765f911..4db2f15f9f75 100644
--- a/configs/platform-v7a/barebox-stm32mp.config.diff
+++ b/configs/platform-v7a/barebox-stm32mp.config.diff
@@ -1,4 +1,4 @@
-68457081af06bd8377bc38ef02c7d415
+b377506ccc60db21f1050002e1af6f17
 # CONFIG_32BIT is undefined
 # CONFIG_64BIT is undefined
 # CONFIG_ARCH_BCM283X is not set
diff --git a/configs/platform-v7a/barebox-vexpress.config b/configs/platform-v7a/barebox-vexpress.config
index 80d446ceccd1..ed7dcad99d4b 100644
--- a/configs/platform-v7a/barebox-vexpress.config
+++ b/configs/platform-v7a/barebox-vexpress.config
@@ -192,7 +192,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/barebox-vexpress.config.diff b/configs/platform-v7a/barebox-vexpress.config.diff
index abbea1a621ce..2ad6a7fd0229 100644
--- a/configs/platform-v7a/barebox-vexpress.config.diff
+++ b/configs/platform-v7a/barebox-vexpress.config.diff
@@ -1,4 +1,4 @@
-68457081af06bd8377bc38ef02c7d415
+b377506ccc60db21f1050002e1af6f17
 # CONFIG_32BIT is undefined
 # CONFIG_64BIT is undefined
 CONFIG_AMBA_SP804=y
diff --git a/configs/platform-v7a/barebox.config b/configs/platform-v7a/barebox.config
index 2e1d844e9512..594bd83c7003 100644
--- a/configs/platform-v7a/barebox.config
+++ b/configs/platform-v7a/barebox.config
@@ -213,7 +213,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/dts/bootstate.dtsi b/configs/platform-v7a/dts/bootstate.dtsi
new file mode 100644
index 000000000000..d41c888dbd43
--- /dev/null
+++ b/configs/platform-v7a/dts/bootstate.dtsi
@@ -0,0 +1,50 @@
+/** Generic bootstate node for all platforms **********************************/
+/ {
+	state: state {
+		bootstate: bootstate {};
+	};
+};
+
+&bootstate {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	system0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		remaining_attempts@0 {
+			reg = <0x0 0x4>;
+			type = "uint32";
+			default = <3>;
+		};
+
+		priority@4 {
+			reg = <0x4 0x4>;
+			type = "uint32";
+			default = <20>;
+		};
+	};
+
+	system1 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		remaining_attempts@8 {
+			reg = <0x8 0x4>;
+			type = "uint32";
+			default = <3>;
+		};
+
+		priority@c {
+			reg = <0xc 0x4>;
+			type = "uint32";
+			default = <10>;
+		};
+	};
+
+	last_chosen@10 {
+		reg = <0x10 0x4>;
+		type = "uint32";
+	};
+};
-- 
2.39.2




  parent reply	other threads:[~2023-04-27 10:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 10:01 [DistroKit] [PATCH v3 00/14] v7a: add redundant update support via RAUC Roland Hieber
2023-04-27 10:01 ` [DistroKit] [PATCH v3 01/14] platforms: revert to default systemd loglevel Roland Hieber
2023-04-27 10:01 ` [DistroKit] [PATCH v3 02/14] ptxconfig: enable more tools for debugging Roland Hieber
2023-04-27 10:01 ` [DistroKit] [PATCH v3 03/14] rauc-udev: add a compatibility layer for mapping partitions Roland Hieber
2023-04-27 10:01 ` Roland Hieber [this message]
2023-04-27 10:01 ` [DistroKit] [PATCH v3 05/14] v7a: add RAUC support for qemu-vexpress Roland Hieber
2023-04-27 10:01 ` [DistroKit] [PATCH v3 06/14] v7a: add RAUC support for beaglebone black Roland Hieber
2023-04-27 10:01 ` [DistroKit] [PATCH v3 07/14] v7a: add RAUC support for rpi3 Roland Hieber
2023-04-27 10:01 ` [DistroKit] [PATCH v3 08/14] v7a: add RAUC support for riotboard Roland Hieber
2023-04-27 10:01 ` [DistroKit] [PATCH v3 09/14] v7a: kernel: enable features necessary for RAUC Roland Hieber
2023-04-27 10:01 ` [DistroKit] [PATCH v3 10/14] rauc: add initial support Roland Hieber
2023-04-27 10:01 ` [DistroKit] [PATCH v3 11/14] v7a: enable RAUC bundle creation Roland Hieber
2023-04-27 10:01 ` [DistroKit] [PATCH v3 12/14] image-rauc: fork config from PTXdist 2023.04.0 Roland Hieber
2023-04-27 10:01 ` [DistroKit] [PATCH v3 13/14] image-rauc: use ext4 rootfs instead of tar.gz Roland Hieber
2023-04-27 10:01 ` [DistroKit] [PATCH v3 14/14] v7a: run: start with barebox by default Roland Hieber
2023-06-20 13:46 ` [DistroKit] [PATCH v3 00/14] v7a: add redundant update support via RAUC Robert Schwebel
2023-06-23 12:50   ` Roland Hieber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230427100134.2934937-5-rhi@pengutronix.de \
    --to=rhi@pengutronix.de \
    --cc=distrokit@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox