mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 10/10] ARM: stm32mp: lxa: enable TLV support for TAC & FairyTux2
Date: Fri, 11 Apr 2025 09:40:45 +0200	[thread overview]
Message-ID: <20250411074045.2019372-11-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250411074045.2019372-1-a.fatoum@pengutronix.de>

Now that TLV support is in place and the LXA-specific parsers have been
added, enable them in the respective board code.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/boards/lxa-fairytux2/board.c           | 8 ++++++++
 arch/arm/boards/lxa-tac/board.c                 | 8 ++++++++
 arch/arm/dts/stm32mp153c-lxa-fairytux2-gen2.dts | 1 +
 arch/arm/dts/stm32mp153c-lxa-fairytux2.dtsi     | 1 +
 arch/arm/dts/stm32mp15xc-lxa-tac.dtsi           | 2 ++
 arch/arm/mach-stm32mp/Kconfig                   | 2 ++
 6 files changed, 22 insertions(+)

diff --git a/arch/arm/boards/lxa-fairytux2/board.c b/arch/arm/boards/lxa-fairytux2/board.c
index 2dc625c40408..5c5a76353d32 100644
--- a/arch/arm/boards/lxa-fairytux2/board.c
+++ b/arch/arm/boards/lxa-fairytux2/board.c
@@ -7,13 +7,21 @@
 #include <bootsource.h>
 #include <deep-probe.h>
 #include <of.h>
+#include <tlv/tlv.h>
 
 static int fairytux2_probe(struct device *dev)
 {
+	struct tlv_device *tlvcpu;
+
 	barebox_set_hostname("fairytux2");
 
 	stm32mp_bbu_mmc_fip_register("mmc", "/dev/mmc1", BBU_HANDLER_FLAG_DEFAULT);
 
+	tlvcpu = tlv_ensure_probed_by_alias("baseboard-factory-data");
+	if (!IS_ERR(tlvcpu))
+		dev_info(dev, "HW release: %s\n",
+			 dev_get_param(&tlvcpu->dev, "device-hardware-release"));
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/lxa-tac/board.c b/arch/arm/boards/lxa-tac/board.c
index 96ffc46500bf..e513175c1b04 100644
--- a/arch/arm/boards/lxa-tac/board.c
+++ b/arch/arm/boards/lxa-tac/board.c
@@ -7,13 +7,21 @@
 #include <bootsource.h>
 #include <deep-probe.h>
 #include <of.h>
+#include <tlv/tlv.h>
 
 static int tac_probe(struct device *dev)
 {
+	struct tlv_device *tlvcpu;
+
 	barebox_set_hostname("lxatac");
 
 	stm32mp_bbu_mmc_fip_register("mmc", "/dev/mmc1", BBU_HANDLER_FLAG_DEFAULT);
 
+	tlvcpu = tlv_ensure_probed_by_alias("baseboard-factory-data");
+	if (!IS_ERR(tlvcpu))
+		dev_info(dev, "HW release: %s\n",
+			 dev_get_param(&tlvcpu->dev, "device-hardware-release"));
+
 	return 0;
 }
 
diff --git a/arch/arm/dts/stm32mp153c-lxa-fairytux2-gen2.dts b/arch/arm/dts/stm32mp153c-lxa-fairytux2-gen2.dts
index 2040959965f3..fe549db3f30a 100644
--- a/arch/arm/dts/stm32mp153c-lxa-fairytux2-gen2.dts
+++ b/arch/arm/dts/stm32mp153c-lxa-fairytux2-gen2.dts
@@ -19,6 +19,7 @@ partitions {
 		#size-cells = <1>;
 
 		io_board_factory_data: factory-data@0 {
+			compatible = "lxa,tlv-ioboard-v1";
 			reg = <0 0x100>;
 			label = "tlv";
 		};
diff --git a/arch/arm/dts/stm32mp153c-lxa-fairytux2.dtsi b/arch/arm/dts/stm32mp153c-lxa-fairytux2.dtsi
index 12a7c290dd0b..a5a5f6296558 100644
--- a/arch/arm/dts/stm32mp153c-lxa-fairytux2.dtsi
+++ b/arch/arm/dts/stm32mp153c-lxa-fairytux2.dtsi
@@ -96,6 +96,7 @@ partitions {
 		#size-cells = <1>;
 
 		baseboard_factory_data: factory-data@0 {
+			compatible = "lxa,tlv-baseboard-v1";
 			reg = <0 0x400>;
 			label = "tlv";
 		};
diff --git a/arch/arm/dts/stm32mp15xc-lxa-tac.dtsi b/arch/arm/dts/stm32mp15xc-lxa-tac.dtsi
index 32f42e4b04d8..3437e81cc1af 100644
--- a/arch/arm/dts/stm32mp15xc-lxa-tac.dtsi
+++ b/arch/arm/dts/stm32mp15xc-lxa-tac.dtsi
@@ -88,6 +88,7 @@ partitions {
 		#size-cells = <1>;
 
 		baseboard_factory_data: factory-data@0 {
+			compatible = "lxa,tlv-baseboard-v1";
 			reg = <0 0x400>;
 			label = "tlv";
 		};
@@ -101,6 +102,7 @@ partitions {
 		#size-cells = <1>;
 
 		powerboard_factory_data: factory-data@0 {
+			compatible = "lxa,tlv-powerboard-v1";
 			reg = <0 0x100>;
 			label = "tlv";
 		};
diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
index ad6c4e202fc1..5ea0c4004f2c 100644
--- a/arch/arm/mach-stm32mp/Kconfig
+++ b/arch/arm/mach-stm32mp/Kconfig
@@ -32,10 +32,12 @@ config MACH_LXA_MC1
 config MACH_LXA_TAC
 	select ARCH_STM32MP157
 	bool "Linux Automation TAC board"
+	select BOARD_LXA
 
 config MACH_LXA_FAIRYTUX2
 	select ARCH_STM32MP157
 	bool "Linux Automation FairyTux 2"
+	select BOARD_LXA
 
 config MACH_SEEED_ODYSSEY
 	select ARCH_STM32MP157
-- 
2.39.5




      parent reply	other threads:[~2025-04-11  9:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11  7:40 [PATCH 00/10] Add barebox TLV infrastructure Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 01/10] net: factor out eth_of_get_fixup_node Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 02/10] net: export list of registered ethernet addresses Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 03/10] common: add optional systemd.hostname generation Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 04/10] common: add barebox TLV support Ahmad Fatoum
2025-04-14 14:49   ` Sascha Hauer
2025-04-14 14:57     ` Ahmad Fatoum
2025-04-14 15:06       ` Sascha Hauer
2025-04-11  7:40 ` [PATCH 05/10] commands: add TLV debugging command Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 06/10] scripts: add bareboxtlv host/target tool Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 07/10] boards: add decoder for LXA TLV v1 format Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 08/10] scripts: Add Barebox TLV Generator Tooling Ahmad Fatoum
2025-04-14 15:00   ` Sascha Hauer
2025-04-11  7:40 ` [PATCH 09/10] doc: Add User-Documentation for Barebox TLV Ahmad Fatoum
2025-04-11  7:40 ` Ahmad Fatoum [this message]

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=20250411074045.2019372-11-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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