toradex: imx6: Rework PF0100 fuse programming commands to not be in SPL
PATCH 1/1 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.
--- board/toradex/apalis_imx6/pf0100.c | 9 ++++++--- board/toradex/apalis_imx6/pf0100.h | 3 --- board/toradex/colibri_imx6/pf0100.c | 8 +++++--- board/toradex/colibri_imx6/pf0100.h | 3 --- 4 files changed, 11 insertions(+), 12 deletions(-)
board/toradex/apalis_imx6/pf0100.c +6 -3
@@ -10,6 +10,7 @@#include <common.h> #include <i2c.h> +#include <linux/compiler.h> #include <asm/arch/imx-regs.h> #include <asm/arch/iomux.h> #include <asm/arch/mx6-pins.h>
@@ -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
board/toradex/apalis_imx6/pf0100.h +0 -3
@@ -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_ */
board/toradex/colibri_imx6/pf0100.c +5 -3
@@ -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
board/toradex/colibri_imx6/pf0100.h +0 -3
@@ -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_ */
Signature · 1 line
2.7.4
Fabio Estevam
reviewerPATCH 1/1 toradex: imx6: Rework PF0100 fuse programming commands to not be in SPL
Quoted 7 lines · Tom Rini
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 <[email protected]>Cc Stefano Babic <[email protected]>Cc Fabio Estevam <[email protected]>Signed-off-by Tom Rini <[email protected]>
PATCH 1/1 toradex: imx6: Rework PF0100 fuse programming commands to not be in SPL
Quoted 10 lines · Tom Rini
Quoted 7 lines
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 <[email protected]>Cc Stefano Babic <[email protected]>Cc Fabio Estevam <[email protected]>Signed-off-by Tom Rini <[email protected]>Reviewed-by Fabio Estevam <[email protected]>
PATCH 1/1 toradex: imx6: Rework PF0100 fuse programming commands to not be in SPL
In reply to Tom RiniQuoted 114 lines · Tom Rini
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 <[email protected]>Cc Stefano Babic <[email protected]>Cc Fabio Estevam <[email protected]>Signed-off-by Tom Rini <[email protected]>--- board/toradex/apalis_imx6/pf0100.c | 9 ++++++--- board/toradex/apalis_imx6/pf0100.h | 3 --- board/toradex/colibri_imx6/pf0100.c | 8 +++++--- board/toradex/colibri_imx6/pf0100.h | 3 --- 4 files changed, 11 insertions(+), 12 deletions(-)board/toradex/apalis_imx6/pf0100.c +6
-3@@ -10,6 +10,7 @@#include <common.h> #include <i2c.h> +#include <linux/compiler.h> #include <asm/arch/imx-regs.h> #include <asm/arch/iomux.h> #include <asm/arch/mx6-pins.h> @@ -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 board/toradex/apalis_imx6/pf0100.h +0
-3@@ -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_ */ board/toradex/colibri_imx6/pf0100.c +5
-3@@ -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 board/toradex/colibri_imx6/pf0100.h +0
-0
board/toradex/colibri_imx6/pf0100.h line 53
Quoted 7 lines
board/toradex/colibri_imx6/pf0100.h +0
-3@@ -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_ */
Applied to u-boot-imx, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================