[U-Boot] [PATCH 40/42] armv8: fsl-layerscape: spl: fix build error when enabled CONFIG_DM_I2C
Biwen Li
biwen.li at nxp.com
Thu Nov 14 10:36:39 UTC 2019
This is used to fix build error
as follows:
- arch/arm/cpu/armv8/built-in.o: In function `board_init_f:
arch/arm/cpu/armv8/fsl-layerscape/spl.c:74: undefined reference to `i2c_init_all'
arch/arm/cpu/armv8/fsl-layerscape/spl.c:74:(.text.board_init_f+0x30):
relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`i2c_init_all'
make[2]: *** [spl/u-boot-spl] Error 1
make[1]: *** [spl/u-boot-spl] Error 2
make: *** [sub-make] Error 2
arch/arm/cpu/armv8/fsl-layerscape/spl.c: In function 'board_init_f':
arch/arm/cpu/armv8/fsl-layerscape/spl.c:74:2: warning: implicit
declaration of function 'i2c_init_all'; did you mean 'misc_init_r'?
[-Wimplicit-function-declaration]`
Signed-off-by: Biwen Li <biwen.li at nxp.com>
---
arch/arm/cpu/armv8/fsl-layerscape/spl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
index 3f6a5f6a42..f792db9cd8 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
@@ -70,9 +70,11 @@ void board_init_f(ulong dummy)
preloader_console_init();
spl_set_bd();
+#ifdef CONFIG_SYS_I2C
#ifdef CONFIG_SPL_I2C_SUPPORT
i2c_init_all();
#endif
+#endif
#ifdef CONFIG_VID
init_func_vid();
#endif
--
2.17.1
More information about the U-Boot
mailing list