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@xxxxxxxxxxxxxx> --- 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@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox