From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 26 Apr 2023 22:14:29 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1prlX2-001CSw-J7 for lore@lore.pengutronix.de; Wed, 26 Apr 2023 22:14:29 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1prlX0-0001yf-KT; Wed, 26 Apr 2023 22:14:26 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1prlWv-0001h4-OD; Wed, 26 Apr 2023 22:14:21 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1prlWv-00Dzt3-31; Wed, 26 Apr 2023 22:14:21 +0200 Received: from rhi by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1prlWs-008ZsV-9n; Wed, 26 Apr 2023 22:14:18 +0200 From: Roland Hieber To: distrokit@pengutronix.de Date: Wed, 26 Apr 2023 22:14:04 +0200 Message-Id: <20230426201414.2044409-5-rhi@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230426201414.2044409-1-rhi@pengutronix.de> References: <20230426201414.2044409-1-rhi@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [DistroKit] [PATCH v2 04/14] v7a: barebox: include generic bootstate node in device tree X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roland Hieber Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false 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 --- 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