From: Tom Rini Date: Wed, 3 Jan 2018 14:19:17 +0000 (-0500) Subject: toradex: imx6: Rework PF0100 fuse programming commands to not be in SPL X-Git-Tag: v2018.03-rc1~176^2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64c7abf0235a3cb5efc32b6c926b6ff8cc0d1d9b;p=platform%2Fkernel%2Fu-boot.git toradex: imx6: Rework PF0100 fuse programming commands to not be in SPL The code for programming the OTP fuses on the PMIC PF0100 can only be used in full U-Boot, so do not build / link it into SPL. Cc: Max Krummenacher Cc: Stefano Babic Cc: Fabio Estevam Signed-off-by: Tom Rini Reviewed-by: Fabio Estevam Tested-by: Max Krummenacher --- diff --git a/board/toradex/apalis_imx6/pf0100.c b/board/toradex/apalis_imx6/pf0100.c index 5eaf9c0..013801e 100644 --- a/board/toradex/apalis_imx6/pf0100.c +++ b/board/toradex/apalis_imx6/pf0100.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -23,7 +24,7 @@ /*#define DEBUG */ /* use Apalis GPIO1 to switch on VPGM, ON: 1 */ -static iomux_v3_cfg_t const pmic_prog_pads[] = { +static __maybe_unused iomux_v3_cfg_t const pmic_prog_pads[] = { MX6_PAD_NANDF_D4__GPIO2_IO04 | MUX_PAD_CTRL(NO_PAD_CTRL), # define PMIC_PROG_VOLTAGE IMX_GPIO_NR(2, 4) }; @@ -161,7 +162,8 @@ unsigned pmic_init(void) return programmed; } -int pf0100_prog(void) +#ifndef CONFIG_SPL_BUILD +static int pf0100_prog(void) { unsigned char bus = 1; unsigned char val; @@ -208,7 +210,7 @@ int pf0100_prog(void) return CMD_RET_SUCCESS; } -int do_pf0100_prog(cmd_tbl_t *cmdtp, int flag, int argc, +static int do_pf0100_prog(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int ret; @@ -226,3 +228,4 @@ U_BOOT_CMD( "Program the OTP fuses on the PMIC PF0100", "" ); +#endif diff --git a/board/toradex/apalis_imx6/pf0100.h b/board/toradex/apalis_imx6/pf0100.h index c84cab8..af1e88f 100644 --- a/board/toradex/apalis_imx6/pf0100.h +++ b/board/toradex/apalis_imx6/pf0100.h @@ -50,7 +50,4 @@ /* i.e. 0: unprogrammed, 3: programmed, other: undefined prog. state */ unsigned pmic_init(void); -/* programmes OTP fuses to values required on a Toradex Apalis iMX6 */ -int pf0100_prog(void); - #endif /* PF0100_H_ */ diff --git a/board/toradex/colibri_imx6/pf0100.c b/board/toradex/colibri_imx6/pf0100.c index 6889287..62e64ab 100644 --- a/board/toradex/colibri_imx6/pf0100.c +++ b/board/toradex/colibri_imx6/pf0100.c @@ -23,7 +23,7 @@ /*#define DEBUG */ /* use GPIO: EXT_IO1 to switch on VPGM, ON: 1 */ -static iomux_v3_cfg_t const pmic_prog_pads[] = { +static __maybe_unused iomux_v3_cfg_t const pmic_prog_pads[] = { MX6_PAD_NANDF_D3__GPIO2_IO03 | MUX_PAD_CTRL(NO_PAD_CTRL), # define PMIC_PROG_VOLTAGE IMX_GPIO_NR(2, 3) }; @@ -144,7 +144,8 @@ unsigned pmic_init(void) return programmed; } -int pf0100_prog(void) +#ifndef CONFIG_SPL_BUILD +static int pf0100_prog(void) { unsigned char bus = 1; unsigned char val; @@ -191,7 +192,7 @@ int pf0100_prog(void) return CMD_RET_SUCCESS; } -int do_pf0100_prog(cmd_tbl_t *cmdtp, int flag, int argc, +static int do_pf0100_prog(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int ret; @@ -209,3 +210,4 @@ U_BOOT_CMD( "Program the OTP fuses on the PMIC PF0100", "" ); +#endif diff --git a/board/toradex/colibri_imx6/pf0100.h b/board/toradex/colibri_imx6/pf0100.h index c84cab8..af1e88f 100644 --- a/board/toradex/colibri_imx6/pf0100.h +++ b/board/toradex/colibri_imx6/pf0100.h @@ -50,7 +50,4 @@ /* i.e. 0: unprogrammed, 3: programmed, other: undefined prog. state */ unsigned pmic_init(void); -/* programmes OTP fuses to values required on a Toradex Apalis iMX6 */ -int pf0100_prog(void); - #endif /* PF0100_H_ */