mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/4] imx/esdctl: Define new helper macros to reduce board entry boilerplate
Date: Fri, 18 Sep 2020 12:32:04 +0200	[thread overview]
Message-ID: <20200918103204.GW4498@pengutronix.de> (raw)
In-Reply-To: <20200917201708.12168-2-u.kleine-koenig@pengutronix.de>

On Thu, Sep 17, 2020 at 10:17:06PM +0200, Uwe Kleine-König wrote:
> 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()); })

I think this macro does a bit too much.

How about this one first:

#define GET_DTB(name) ({					\
	extern char __dtb_ ## name ## _start[];			\
	__dtb_ ## name ## _start + get_runtime_offset();	\
});

and an analog GET_DTBZ? This would be generally userful and not only on
i.MX.

I am not sure I would put the IMD_USED_OF into this macro. My gut
feeling is that I would rather make it explicit in the board code.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

  reply	other threads:[~2020-09-18 10:32 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 ` [PATCH 2/4] imx/esdctl: Define new helper macros to reduce board entry boilerplate Uwe Kleine-König
2020-09-18 10:32   ` Sascha Hauer [this message]
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=20200918103204.GW4498@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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