summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/stm32mp15x-ev1/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/boards/stm32mp15x-ev1/board.c')
-rw-r--r--arch/arm/boards/stm32mp15x-ev1/board.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/boards/stm32mp15x-ev1/board.c b/arch/arm/boards/stm32mp15x-ev1/board.c
new file mode 100644
index 0000000000..b8e26cd37b
--- /dev/null
+++ b/arch/arm/boards/stm32mp15x-ev1/board.c
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <bootsource.h>
+#include <common.h>
+#include <init.h>
+#include <mach/bbu.h>
+
+static int ed1_probe(struct device_d *dev)
+{
+ int flags;
+
+ flags = bootsource_get_instance() == 0 ? BBU_HANDLER_FLAG_DEFAULT : 0;
+ stm32mp_bbu_mmc_register_handler("sd", "/dev/mmc0.ssbl", flags);
+
+ flags = bootsource_get_instance() == 1 ? BBU_HANDLER_FLAG_DEFAULT : 0;
+ stm32mp_bbu_mmc_register_handler("emmc", "/dev/mmc1.ssbl", flags);
+
+ if (bootsource_get_instance() == 0)
+ of_device_enable_path("/chosen/environment-sd");
+ else
+ of_device_enable_path("/chosen/environment-emmc");
+
+ barebox_set_model("STM32MP157C-ED1");
+
+ return 0;
+}
+
+/* ED1 is the SoM on top of the EV1 */
+static const struct of_device_id ed1_of_match[] = {
+ { .compatible = "st,stm32mp157c-ed1" },
+ { /* sentinel */ },
+};
+
+static struct driver_d ed1_board_driver = {
+ .name = "board-stm32mp15x-ed1",
+ .probe = ed1_probe,
+ .of_compatible = ed1_of_match,
+};
+postcore_platform_driver(ed1_board_driver);