summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2021-06-24 17:00:52 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-06-25 09:39:19 +0200
commit035bacc187e78eb4deb48f799bc7974cdc583e9b (patch)
treecfdf4aba4d4ed72ed5e1ce70e931bf41c26f8657
parent68f866d4e4867ef97f25049cea6900630386da14 (diff)
downloadbarebox-035bacc187e78eb4deb48f799bc7974cdc583e9b.tar.gz
barebox-035bacc187e78eb4deb48f799bc7974cdc583e9b.tar.xz
ARM: zynqmp: zcu104: register update handler
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@pengutronix.de> Link: https://lore.barebox.org/20210624150054.1205422-6-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/boards/xilinx-zcu104/Makefile1
-rw-r--r--arch/arm/boards/xilinx-zcu104/board.c18
2 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/boards/xilinx-zcu104/Makefile b/arch/arm/boards/xilinx-zcu104/Makefile
index 884d6e63b0..297f77d57a 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 0000000000..7654d2bfac
--- /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@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);