mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/4] imx/esdctl: Define new helper macros to reduce board entry boilerplate
Date: Thu, 17 Sep 2020 22:17:06 +0200	[thread overview]
Message-ID: <20200917201708.12168-2-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20200917201708.12168-1-u.kleine-koenig@pengutronix.de>

The macro provides the extern declaration of the devicetree variable, calls
IMD_USED_OF to add metadata to the resulting barebox image and then calls
the right entry function.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-imx/include/mach/esdctl.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/mach-imx/include/mach/esdctl.h b/arch/arm/mach-imx/include/mach/esdctl.h
index 8073b7f40937..506dda2d5a1c 100644
--- a/arch/arm/mach-imx/include/mach/esdctl.h
+++ b/arch/arm/mach-imx/include/mach/esdctl.h
@@ -145,6 +145,27 @@ void __noreturn imx8mp_barebox_entry(void *boarddata);
 void __noreturn imx8mq_barebox_entry(void *boarddata);
 void __noreturn vf610_barebox_entry(void *boarddata);
 
+#include <image-metadata.h>
+
+#define IMX_BAREBOX__ENTRY(_fdtname, _suffix, _compressed) ({ extern char __dtb_ ## _compressed ## _fdtname ## _start[]; IMD_USED_OF(_fdtname); imx ## _suffix ## _barebox_entry(__dtb_ ## _compressed ## _fdtname ## _start + get_runtime_offset()); })
+#define IMX_BAREBOX_ENTRY(_fdtname, _suffix) IMX_BAREBOX__ENTRY(_fdtname, _suffix, )
+#define IMX_BAREBOX_ZENTRY(_fdtname, _suffix) IMX_BAREBOX__ENTRY(_fdtname, _suffix, z_)
+
+#define IMX53_BAREBOX_ENTRY(_fdtname) IMX_BAREBOX_ENTRY(_fdtname, 53)
+#define IMX53_BAREBOX_ZENTRY(_fdtname) IMX_BAREBOX_ZENTRY(_fdtname, 53)
+
+#define IMX6Q_BAREBOX_ENTRY(_fdtname) IMX_BAREBOX_ENTRY(_fdtname, 6q)
+#define IMX6Q_BAREBOX_ZENTRY(_fdtname) IMX_BAREBOX_ZENTRY(_fdtname, 6q)
+
+#define IMX6SX_BAREBOX_ENTRY(_fdtname) IMX_BAREBOX_ENTRY(_fdtname, 6sx)
+#define IMX6SX_BAREBOX_ZENTRY(_fdtname) IMX_BAREBOX_ZENTRY(_fdtname, 6sx)
+
+#define IMX6UL_BAREBOX_ENTRY(_fdtname) IMX_BAREBOX_ENTRY(_fdtname, 6ul)
+#define IMX6UL_BAREBOX_ZENTRY(_fdtname) IMX_BAREBOX_ZENTRY(_fdtname, 6ul)
+
+#define IMX7D_BAREBOX_ENTRY(_fdtname) IMX_BAREBOX_ENTRY(_fdtname, 7d)
+#define IMX7D_BAREBOX_ZENTRY(_fdtname) IMX_BAREBOX_ZENTRY(_fdtname, 7d)
+
 void imx_esdctl_disable(void);
 #endif
 
-- 
2.27.0


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

  reply	other threads:[~2020-09-17 20:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 20:17 [PATCH 1/4] imx/esdctl: reorder some function declarations to be sorted by SoC Uwe Kleine-König
2020-09-17 20:17 ` Uwe Kleine-König [this message]
2020-09-18 10:32   ` [PATCH 2/4] imx/esdctl: Define new helper macros to reduce board entry boilerplate Sascha Hauer
2020-09-17 20:17 ` [PATCH 3/4] arm/boards: Convert a few boards to the new entry macros Uwe Kleine-König
2020-09-17 20:17 ` [PATCH 4/4] arm/boards: Add IMD_USED_OF for a few boards Uwe Kleine-König
2020-09-18 10:03   ` Sascha Hauer

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=20200917201708.12168-2-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@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