[PATCH 12/13] ARM: stm32mp: 135-DK: enable environment, bbu handler and deep probe

Ahmad Fatoum a.fatoum at pengutronix.de
Sun Nov 26 22:49:46 PST 2023


Now that we have proper clock controller support, let's configure the
board to have an environment on SD-Card, a barebox update handler for
the SD-Card and enable deep probe as well.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/boards/stm32mp13xx-dk/Makefile |  1 +
 arch/arm/boards/stm32mp13xx-dk/board.c  | 25 +++++++++++++++++++++++++
 arch/arm/dts/stm32mp135f-dk.dts         |  9 +++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 arch/arm/boards/stm32mp13xx-dk/board.c

diff --git a/arch/arm/boards/stm32mp13xx-dk/Makefile b/arch/arm/boards/stm32mp13xx-dk/Makefile
index 9961af02a3ea..1d052d28c9fc 100644
--- a/arch/arm/boards/stm32mp13xx-dk/Makefile
+++ b/arch/arm/boards/stm32mp13xx-dk/Makefile
@@ -1,2 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
 lwl-y += lowlevel.o
+obj-y += board.o
diff --git a/arch/arm/boards/stm32mp13xx-dk/board.c b/arch/arm/boards/stm32mp13xx-dk/board.c
new file mode 100644
index 000000000000..24104328f0db
--- /dev/null
+++ b/arch/arm/boards/stm32mp13xx-dk/board.c
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <driver.h>
+#include <init.h>
+#include <mach/stm32mp/bbu.h>
+#include <deep-probe.h>
+
+static int stm32mp13xx_dk_probe(struct device *dev)
+{
+	stm32mp_bbu_mmc_fip_register("sd", "/dev/mmc0", BBU_HANDLER_FLAG_DEFAULT);
+	return 0;
+}
+
+static const struct of_device_id stm32mp13xx_dk_of_match[] = {
+	{ .compatible = "st,stm32mp135f-dk" },
+	{ /* sentinel */ },
+};
+BAREBOX_DEEP_PROBE_ENABLE(stm32mp13xx_dk_of_match);
+
+static struct driver stm32mp13xx_dk_board_driver = {
+	.name = "board-stm32mp13xx_dk",
+	.probe = stm32mp13xx_dk_probe,
+	.of_compatible = stm32mp13xx_dk_of_match,
+} ;
+device_platform_driver(stm32mp13xx_dk_board_driver);
diff --git a/arch/arm/dts/stm32mp135f-dk.dts b/arch/arm/dts/stm32mp135f-dk.dts
index f07f7f5536fe..5f0f52d00535 100644
--- a/arch/arm/dts/stm32mp135f-dk.dts
+++ b/arch/arm/dts/stm32mp135f-dk.dts
@@ -5,4 +5,13 @@
 
 / {
 	model = "STM32MP135F-DK";
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+
+		environment {
+			compatible = "barebox,environment";
+			device-path = &sdmmc1, "partname:barebox-environment";
+		};
+	};
 };
-- 
2.39.2




More information about the barebox mailing list