[v4,2/8] armv8: fsl-layerscape: spl: fix build error when DM_I2C is enabled
diff mbox series

Message ID 20191209063230.33638-2-biwen.li@nxp.com
State Superseded
Delegated to: Priyanka Jain
Headers show
Series
  • [v4,1/8] rtc: pcf8563: Add driver model support
Related show

Commit Message

Biwen Li Dec. 9, 2019, 6:32 a.m. UTC
Fix below SPL build error when DM_I2C is enabled,
- 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]`

Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
Changes in v4:
	- update copyright

Changes in v3:
	- update commit messages

Changes in v2:
	- none

 arch/arm/cpu/armv8/fsl-layerscape/spl.c | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox series

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
index 58a39e1123..30792afe82 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
@@ -1,6 +1,7 @@ 
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2014-2015 Freescale Semiconductor, Inc.
+ * Copyright 2019 NXP
  */
 
 #include <common.h>
@@ -71,9 +72,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