mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Tretter <m.tretter@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 5/7] ARM: zynqmp: zcu104: register update handler
Date: Thu, 24 Jun 2021 12:23:40 +0200	[thread overview]
Message-ID: <20210624102342.269363-6-m.tretter@pengutronix.de> (raw)
In-Reply-To: <20210624102342.269363-1-m.tretter@pengutronix.de>

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>
---
 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@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  parent reply	other threads:[~2021-06-24 10:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24 10:23 [PATCH 0/7] ZynqMP: Cleanup and extend board support Michael Tretter
2021-06-24 10:23 ` [PATCH 1/7] ARM: zynqmp: set reset source Michael Tretter
2021-06-24 10:48   ` Ahmad Fatoum
2021-06-24 13:20     ` Michael Tretter
2021-06-24 13:30       ` Ahmad Fatoum
2021-06-24 10:23 ` [PATCH 2/7] clk: zynqmp: do not enable already enabled clocks Michael Tretter
2021-06-24 10:23 ` [PATCH 3/7] dts: zcu104: add Barebox environment Michael Tretter
2021-06-24 10:23 ` [PATCH 4/7] ARM: zynqmp: add update handler Michael Tretter
2021-06-24 10:52   ` Ahmad Fatoum
2021-06-24 13:24     ` Michael Tretter
2021-06-24 13:34       ` Ahmad Fatoum
2021-06-25  9:05         ` Michael Tretter
2021-06-24 10:23 ` Michael Tretter [this message]
2021-06-24 10:23 ` [PATCH 6/7] ARM: zynqmp: defconfig: enable more features Michael Tretter
2021-06-24 10:23 ` [PATCH 7/7] Documentation: zynqmp: add some documentation Michael Tretter

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=20210624102342.269363-6-m.tretter@pengutronix.de \
    --to=m.tretter@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