* [PATCH 1/2] gen-dtb-s: reference OF IMD entries automatically @ 2023-02-17 20:37 Ahmad Fatoum 2023-02-17 20:37 ` [PATCH 2/2] treewide: remove no-longer needed IMD_USED_OF Ahmad Fatoum 2023-02-21 9:36 ` [PATCH 1/2] gen-dtb-s: reference OF IMD entries automatically Sascha Hauer 0 siblings, 2 replies; 4+ messages in thread From: Ahmad Fatoum @ 2023-02-17 20:37 UTC (permalink / raw) To: barebox; +Cc: Ahmad Fatoum We currently require IMD_OF_USED to get the DT compatible into the barebox image data meta section. As the PBL is already referencing the DT to pass it along to barebox proper, let's add a reference from the DT to the image data section to make IMD_OF_USED unnecessary. Suggested-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> --- scripts/gen-dtb-s | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s index c5c46a4d8675..9cc2e7a72cc2 100755 --- a/scripts/gen-dtb-s +++ b/scripts/gen-dtb-s @@ -49,6 +49,9 @@ echo "__dtb_${name}_start:" echo ".incbin \"$dtb\"" echo "__dtb_${name}_end:" echo ".global __dtb_${name}_end" +if [ "$imd" = "y" ]; then + echo ".word __barebox_imd_OF_${name}" +fi echo ".balign STRUCT_ALIGNMENT" compressed=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" $dtb.z) @@ -66,4 +69,7 @@ echo ".incbin \"$dtb.z\"" echo "__dtb_z_${name}_end:" echo ".global __dtb_z_${name}_end" echo ".balign STRUCT_ALIGNMENT" +if [ "$imd" = "y" ]; then + echo ".word __barebox_imd_OF_${name}" +fi echo "#endif" -- 2.30.2 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] treewide: remove no-longer needed IMD_USED_OF 2023-02-17 20:37 [PATCH 1/2] gen-dtb-s: reference OF IMD entries automatically Ahmad Fatoum @ 2023-02-17 20:37 ` Ahmad Fatoum 2023-02-20 17:31 ` Marco Felsch 2023-02-21 9:36 ` [PATCH 1/2] gen-dtb-s: reference OF IMD entries automatically Sascha Hauer 1 sibling, 1 reply; 4+ messages in thread From: Ahmad Fatoum @ 2023-02-17 20:37 UTC (permalink / raw) To: barebox; +Cc: Ahmad Fatoum Now that a __dtb* reference automatically pulls in the IMD tag if support is compiled in, we can drop all IMD_USED_OF and turn the macro into a no-op until we remove it completely. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> --- arch/arm/boards/innocomm-imx8mm-wb15/lowlevel.c | 2 -- arch/arm/boards/ls1046ardb/lowlevel.c | 2 -- arch/arm/boards/nxp-imx8mm-evk/lowlevel.c | 2 -- arch/arm/boards/nxp-imx8mp-evk/lowlevel.c | 2 -- arch/arm/boards/nxp-imx8mq-evk/lowlevel.c | 2 -- arch/arm/boards/phytec-som-imx6/lowlevel.c | 1 - arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c | 2 -- arch/arm/boards/tqmls1046a/lowlevel.c | 2 -- arch/arm/boards/zii-imx8mq-dev/lowlevel.c | 3 --- include/image-metadata.h | 5 +---- 10 files changed, 1 insertion(+), 22 deletions(-) diff --git a/arch/arm/boards/innocomm-imx8mm-wb15/lowlevel.c b/arch/arm/boards/innocomm-imx8mm-wb15/lowlevel.c index f7753bd32671..f4c6239551f9 100644 --- a/arch/arm/boards/innocomm-imx8mm-wb15/lowlevel.c +++ b/arch/arm/boards/innocomm-imx8mm-wb15/lowlevel.c @@ -74,8 +74,6 @@ void innocomm_wb15_power_init_board(void) ENTRY_FUNCTION(start_innocomm_wb15_evk, r0, r1, r2) { - IMD_USED_OF(imx8mm_innocomm_wb15_evk); - imx8mm_cpu_lowlevel_init(); relocate_to_current_adr(); diff --git a/arch/arm/boards/ls1046ardb/lowlevel.c b/arch/arm/boards/ls1046ardb/lowlevel.c index 9eae032377d7..fdb5202182db 100644 --- a/arch/arm/boards/ls1046ardb/lowlevel.c +++ b/arch/arm/boards/ls1046ardb/lowlevel.c @@ -202,8 +202,6 @@ static noinline __noreturn void ls1046ardb_r_entry(unsigned long memsize) debug_ll_init(); ls1046a_init_lowlevel(); - IMD_USED_OF(fsl_ls1046a_rdb); - i2c = ls1046_i2c_init(IOMEM(LSCH2_I2C1_BASE_ADDR)); ret = spd_read_eeprom(i2c, 0x51, &spd_eeprom, SPD_MEMTYPE_DDR4); if (ret) { diff --git a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c index 5861d8d8bece..6381ed3a3690 100644 --- a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c +++ b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c @@ -159,7 +159,5 @@ ENTRY_FUNCTION(start_nxp_imx8mm_evk, r0, r1, r2) relocate_to_current_adr(); setup_c(); - IMD_USED_OF(imx8mm_evk); - nxp_imx8mm_evk_start(); } diff --git a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c index d6fc32e65b61..88764b9f6549 100644 --- a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c +++ b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c @@ -140,7 +140,5 @@ ENTRY_FUNCTION(start_nxp_imx8mp_evk, r0, r1, r2) relocate_to_current_adr(); setup_c(); - IMD_USED_OF(imx8mp_evk); - nxp_imx8mp_evk_start(); } diff --git a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c index 0c9f6345ff30..f0020e2a1cc3 100644 --- a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c +++ b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c @@ -107,7 +107,5 @@ ENTRY_FUNCTION(start_nxp_imx8mq_evk, r0, r1, r2) relocate_to_current_adr(); setup_c(); - IMD_USED_OF(imx8mq_evk); - nxp_imx8mq_evk_start(); } diff --git a/arch/arm/boards/phytec-som-imx6/lowlevel.c b/arch/arm/boards/phytec-som-imx6/lowlevel.c index 62a1c8de7309..31c1e056aa1f 100644 --- a/arch/arm/boards/phytec-som-imx6/lowlevel.c +++ b/arch/arm/boards/phytec-som-imx6/lowlevel.c @@ -75,7 +75,6 @@ static void __noreturn start_imx6_phytec_common(uint32_t size, extern char __dtb_##fdt_name##_start[]; \ \ IMD_USED(physom_mx6_memsize_##memory_size); \ - IMD_USED_OF(fdt_name); \ \ start_imx6_phytec_common(memory_size, do_early_uart_config, \ __dtb_##fdt_name##_start); \ diff --git a/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c b/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c index bfae39ea522e..56fc24b2d6b7 100644 --- a/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c +++ b/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c @@ -87,7 +87,5 @@ ENTRY_FUNCTION(start_prt_prt8mm, r0, r1, r2) relocate_to_current_adr(); setup_c(); - IMD_USED_OF(imx8mm_prt8mm); - prt_prt8mm_start(); } diff --git a/arch/arm/boards/tqmls1046a/lowlevel.c b/arch/arm/boards/tqmls1046a/lowlevel.c index 99dcf1eff7ab..17da09eb515d 100644 --- a/arch/arm/boards/tqmls1046a/lowlevel.c +++ b/arch/arm/boards/tqmls1046a/lowlevel.c @@ -109,8 +109,6 @@ static noinline __noreturn void tqmls1046a_r_entry(void) udelay(500); putc_ll('>'); - IMD_USED_OF(fsl_tqmls1046a_mbls10xxa); - fsl_ddr_set_memctl_regs(&ddrc[0], 0); ls1046a_errata_post_ddr(); diff --git a/arch/arm/boards/zii-imx8mq-dev/lowlevel.c b/arch/arm/boards/zii-imx8mq-dev/lowlevel.c index cf53fb2defd6..d2b677d3890f 100644 --- a/arch/arm/boards/zii-imx8mq-dev/lowlevel.c +++ b/arch/arm/boards/zii-imx8mq-dev/lowlevel.c @@ -201,8 +201,5 @@ ENTRY_FUNCTION(start_zii_imx8mq_dev, r0, r1, r2) relocate_to_current_adr(); setup_c(); - IMD_USED_OF(imx8mq_zii_ultra_rmb3); - IMD_USED_OF(imx8mq_zii_ultra_zest); - zii_imx8mq_dev_start(); } diff --git a/include/image-metadata.h b/include/image-metadata.h index bf4e08d98a47..619154dcbe11 100644 --- a/include/image-metadata.h +++ b/include/image-metadata.h @@ -156,10 +156,7 @@ static inline void imd_used(const void *unused) #define IMD_USED(_name) \ imd_used(&__barebox_imd_##_name) -#define IMD_USED_OF(_name) ({ \ - extern char __barebox_imd_OF_ ## _name[]; \ - imd_used(&__barebox_imd_OF_ ## _name); \ - }) +#define IMD_USED_OF(_name) do { } while (0) #endif /* __BAREBOX__ */ -- 2.30.2 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] treewide: remove no-longer needed IMD_USED_OF 2023-02-17 20:37 ` [PATCH 2/2] treewide: remove no-longer needed IMD_USED_OF Ahmad Fatoum @ 2023-02-20 17:31 ` Marco Felsch 0 siblings, 0 replies; 4+ messages in thread From: Marco Felsch @ 2023-02-20 17:31 UTC (permalink / raw) To: Ahmad Fatoum; +Cc: barebox Hi Ahmad, On 23-02-17, Ahmad Fatoum wrote: > Now that a __dtb* reference automatically pulls in the IMD tag if > support is compiled in, we can drop all IMD_USED_OF and turn the macro > into a no-op until we remove it completely. > > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> > --- > arch/arm/boards/innocomm-imx8mm-wb15/lowlevel.c | 2 -- > arch/arm/boards/ls1046ardb/lowlevel.c | 2 -- > arch/arm/boards/nxp-imx8mm-evk/lowlevel.c | 2 -- > arch/arm/boards/nxp-imx8mp-evk/lowlevel.c | 2 -- > arch/arm/boards/nxp-imx8mq-evk/lowlevel.c | 2 -- > arch/arm/boards/phytec-som-imx6/lowlevel.c | 1 - > arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c | 2 -- > arch/arm/boards/tqmls1046a/lowlevel.c | 2 -- > arch/arm/boards/zii-imx8mq-dev/lowlevel.c | 3 --- > include/image-metadata.h | 5 +---- > 10 files changed, 1 insertion(+), 22 deletions(-) > > diff --git a/arch/arm/boards/innocomm-imx8mm-wb15/lowlevel.c b/arch/arm/boards/innocomm-imx8mm-wb15/lowlevel.c > index f7753bd32671..f4c6239551f9 100644 > --- a/arch/arm/boards/innocomm-imx8mm-wb15/lowlevel.c > +++ b/arch/arm/boards/innocomm-imx8mm-wb15/lowlevel.c > @@ -74,8 +74,6 @@ void innocomm_wb15_power_init_board(void) > > ENTRY_FUNCTION(start_innocomm_wb15_evk, r0, r1, r2) > { > - IMD_USED_OF(imx8mm_innocomm_wb15_evk); Nit: after removing this we can also remove the header: image-metadata.h. Regards, Marco > - > imx8mm_cpu_lowlevel_init(); > > relocate_to_current_adr(); > diff --git a/arch/arm/boards/ls1046ardb/lowlevel.c b/arch/arm/boards/ls1046ardb/lowlevel.c > index 9eae032377d7..fdb5202182db 100644 > --- a/arch/arm/boards/ls1046ardb/lowlevel.c > +++ b/arch/arm/boards/ls1046ardb/lowlevel.c > @@ -202,8 +202,6 @@ static noinline __noreturn void ls1046ardb_r_entry(unsigned long memsize) > debug_ll_init(); > ls1046a_init_lowlevel(); > > - IMD_USED_OF(fsl_ls1046a_rdb); > - > i2c = ls1046_i2c_init(IOMEM(LSCH2_I2C1_BASE_ADDR)); > ret = spd_read_eeprom(i2c, 0x51, &spd_eeprom, SPD_MEMTYPE_DDR4); > if (ret) { > diff --git a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c > index 5861d8d8bece..6381ed3a3690 100644 > --- a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c > +++ b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c > @@ -159,7 +159,5 @@ ENTRY_FUNCTION(start_nxp_imx8mm_evk, r0, r1, r2) > relocate_to_current_adr(); > setup_c(); > > - IMD_USED_OF(imx8mm_evk); > - > nxp_imx8mm_evk_start(); > } > diff --git a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c > index d6fc32e65b61..88764b9f6549 100644 > --- a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c > +++ b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c > @@ -140,7 +140,5 @@ ENTRY_FUNCTION(start_nxp_imx8mp_evk, r0, r1, r2) > relocate_to_current_adr(); > setup_c(); > > - IMD_USED_OF(imx8mp_evk); > - > nxp_imx8mp_evk_start(); > } > diff --git a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c > index 0c9f6345ff30..f0020e2a1cc3 100644 > --- a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c > +++ b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c > @@ -107,7 +107,5 @@ ENTRY_FUNCTION(start_nxp_imx8mq_evk, r0, r1, r2) > relocate_to_current_adr(); > setup_c(); > > - IMD_USED_OF(imx8mq_evk); > - > nxp_imx8mq_evk_start(); > } > diff --git a/arch/arm/boards/phytec-som-imx6/lowlevel.c b/arch/arm/boards/phytec-som-imx6/lowlevel.c > index 62a1c8de7309..31c1e056aa1f 100644 > --- a/arch/arm/boards/phytec-som-imx6/lowlevel.c > +++ b/arch/arm/boards/phytec-som-imx6/lowlevel.c > @@ -75,7 +75,6 @@ static void __noreturn start_imx6_phytec_common(uint32_t size, > extern char __dtb_##fdt_name##_start[]; \ > \ > IMD_USED(physom_mx6_memsize_##memory_size); \ > - IMD_USED_OF(fdt_name); \ > \ > start_imx6_phytec_common(memory_size, do_early_uart_config, \ > __dtb_##fdt_name##_start); \ > diff --git a/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c b/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c > index bfae39ea522e..56fc24b2d6b7 100644 > --- a/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c > +++ b/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c > @@ -87,7 +87,5 @@ ENTRY_FUNCTION(start_prt_prt8mm, r0, r1, r2) > relocate_to_current_adr(); > setup_c(); > > - IMD_USED_OF(imx8mm_prt8mm); > - > prt_prt8mm_start(); > } > diff --git a/arch/arm/boards/tqmls1046a/lowlevel.c b/arch/arm/boards/tqmls1046a/lowlevel.c > index 99dcf1eff7ab..17da09eb515d 100644 > --- a/arch/arm/boards/tqmls1046a/lowlevel.c > +++ b/arch/arm/boards/tqmls1046a/lowlevel.c > @@ -109,8 +109,6 @@ static noinline __noreturn void tqmls1046a_r_entry(void) > udelay(500); > putc_ll('>'); > > - IMD_USED_OF(fsl_tqmls1046a_mbls10xxa); > - > fsl_ddr_set_memctl_regs(&ddrc[0], 0); > > ls1046a_errata_post_ddr(); > diff --git a/arch/arm/boards/zii-imx8mq-dev/lowlevel.c b/arch/arm/boards/zii-imx8mq-dev/lowlevel.c > index cf53fb2defd6..d2b677d3890f 100644 > --- a/arch/arm/boards/zii-imx8mq-dev/lowlevel.c > +++ b/arch/arm/boards/zii-imx8mq-dev/lowlevel.c > @@ -201,8 +201,5 @@ ENTRY_FUNCTION(start_zii_imx8mq_dev, r0, r1, r2) > relocate_to_current_adr(); > setup_c(); > > - IMD_USED_OF(imx8mq_zii_ultra_rmb3); > - IMD_USED_OF(imx8mq_zii_ultra_zest); > - > zii_imx8mq_dev_start(); > } > diff --git a/include/image-metadata.h b/include/image-metadata.h > index bf4e08d98a47..619154dcbe11 100644 > --- a/include/image-metadata.h > +++ b/include/image-metadata.h > @@ -156,10 +156,7 @@ static inline void imd_used(const void *unused) > > #define IMD_USED(_name) \ > imd_used(&__barebox_imd_##_name) > -#define IMD_USED_OF(_name) ({ \ > - extern char __barebox_imd_OF_ ## _name[]; \ > - imd_used(&__barebox_imd_OF_ ## _name); \ > - }) > +#define IMD_USED_OF(_name) do { } while (0) > > #endif /* __BAREBOX__ */ > > -- > 2.30.2 > > > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] gen-dtb-s: reference OF IMD entries automatically 2023-02-17 20:37 [PATCH 1/2] gen-dtb-s: reference OF IMD entries automatically Ahmad Fatoum 2023-02-17 20:37 ` [PATCH 2/2] treewide: remove no-longer needed IMD_USED_OF Ahmad Fatoum @ 2023-02-21 9:36 ` Sascha Hauer 1 sibling, 0 replies; 4+ messages in thread From: Sascha Hauer @ 2023-02-21 9:36 UTC (permalink / raw) To: Ahmad Fatoum; +Cc: barebox On Fri, Feb 17, 2023 at 09:37:32PM +0100, Ahmad Fatoum wrote: > We currently require IMD_OF_USED to get the DT compatible into the > barebox image data meta section. As the PBL is already referencing the > DT to pass it along to barebox proper, let's add a reference from the DT > to the image data section to make IMD_OF_USED unnecessary. > > Suggested-by: Antony Pavlov <antonynpavlov@gmail.com> > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> > --- > scripts/gen-dtb-s | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s > index c5c46a4d8675..9cc2e7a72cc2 100755 > --- a/scripts/gen-dtb-s > +++ b/scripts/gen-dtb-s > @@ -49,6 +49,9 @@ echo "__dtb_${name}_start:" > echo ".incbin \"$dtb\"" > echo "__dtb_${name}_end:" > echo ".global __dtb_${name}_end" > +if [ "$imd" = "y" ]; then > + echo ".word __barebox_imd_OF_${name}" > +fi > echo ".balign STRUCT_ALIGNMENT" > > compressed=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" $dtb.z) > @@ -66,4 +69,7 @@ echo ".incbin \"$dtb.z\"" > echo "__dtb_z_${name}_end:" > echo ".global __dtb_z_${name}_end" > echo ".balign STRUCT_ALIGNMENT" > +if [ "$imd" = "y" ]; then > + echo ".word __barebox_imd_OF_${name}" > +fi > echo "#endif" This results in several linker errors here when compiling imx_v8_defconfig: /opt/OSELAS.Toolchain-2022.10.0/aarch64-v8a-linux-gnu/gcc-12.2.1-clang-15.0.2-glibc-2.36-binutils-2.39-kernel-6.0.5-sanitized/bin/aarch64-v8a-linux-gnu-ld: arch/arm/dts/imx8mm-innocomm-wb15-evk.dtb.pbl.o: relocation R_AARCH64_ABS32 against `__barebox_imd_OF_imx8mm_innocomm_wb15_evk' can not be used when making a shared object 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 | ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-21 9:38 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-02-17 20:37 [PATCH 1/2] gen-dtb-s: reference OF IMD entries automatically Ahmad Fatoum 2023-02-17 20:37 ` [PATCH 2/2] treewide: remove no-longer needed IMD_USED_OF Ahmad Fatoum 2023-02-20 17:31 ` Marco Felsch 2023-02-21 9:36 ` [PATCH 1/2] gen-dtb-s: reference OF IMD entries automatically Sascha Hauer
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox