[PATCH 5/7] ARM: zynqmp: zcu104: register update handler
Michael Tretter
m.tretter at pengutronix.de
Thu Jun 24 03:23:40 PDT 2021
As the zcu104 stores the environment in the same partition as the
barebox image, the partition is already mounted in ENV_MNT_DIR
("/boot"). Therefore, the update handler has to use the already
existing mount point for the update.
Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
---
arch/arm/boards/xilinx-zcu104/Makefile | 1 +
arch/arm/boards/xilinx-zcu104/board.c | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 arch/arm/boards/xilinx-zcu104/board.c
diff --git a/arch/arm/boards/xilinx-zcu104/Makefile b/arch/arm/boards/xilinx-zcu104/Makefile
index 884d6e63b019..297f77d57ab1 100644
--- a/arch/arm/boards/xilinx-zcu104/Makefile
+++ b/arch/arm/boards/xilinx-zcu104/Makefile
@@ -1,2 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-or-later
+obj-y += board.o
lwl-y += lowlevel.o lowlevel_init.o
diff --git a/arch/arm/boards/xilinx-zcu104/board.c b/arch/arm/boards/xilinx-zcu104/board.c
new file mode 100644
index 000000000000..7654d2bfac90
--- /dev/null
+++ b/arch/arm/boards/xilinx-zcu104/board.c
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2020 Michael Tretter <m.tretter at pengutronix.de>
+ */
+
+#include <common.h>
+#include <init.h>
+#include <mach/zynqmp-bbu.h>
+
+static int zcu104_register_update_handler(void)
+{
+ if (!of_machine_is_compatible("xlnx,zynqmp-zcu104"))
+ return 0;
+
+ return zynqmp_bbu_register_handler("SD", "/boot/BOOT.BIN",
+ BBU_HANDLER_FLAG_DEFAULT);
+}
+device_initcall(zcu104_register_update_handler);
--
2.29.2
More information about the barebox
mailing list