diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2016-02-11 14:37:54 +0100 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2016-02-17 10:54:10 +0100 |
commit | 2888019fcd45a314b04c175a651353b132324c8c (patch) | |
tree | 0cf31302d4174086ab6b4fb2675410311bf041b2 | |
parent | d86665d8584dd5bcf936a82b0f2c27a0d974352d (diff) |
colibri_imx7: add do_fuse command
Used during manufacturing for setting the boot fuses.
-rw-r--r-- | board/toradex/colibri_imx7/Kconfig | 9 | ||||
-rw-r--r-- | board/toradex/colibri_imx7/Makefile | 1 | ||||
-rw-r--r-- | board/toradex/colibri_imx7/do_fuse.c | 47 |
3 files changed, 57 insertions, 0 deletions
diff --git a/board/toradex/colibri_imx7/Kconfig b/board/toradex/colibri_imx7/Kconfig index 2323183039..ddaf6cbcc6 100644 --- a/board/toradex/colibri_imx7/Kconfig +++ b/board/toradex/colibri_imx7/Kconfig @@ -12,4 +12,13 @@ config SYS_SOC config SYS_CONFIG_NAME default "colibri_imx7" +menuconfig TRDX_CMD_IMX_MFGR + bool "Enable factory testing commands for Toradex iMX 6 modules" + help + This adds the commands + mfgr_fuse: OTP fusing during module production + pf0100_otp_prog- Program the OTP fuses on the PMIC PF0100 + If executed on already fused modules they don't change any fuse setting. + default y + endif diff --git a/board/toradex/colibri_imx7/Makefile b/board/toradex/colibri_imx7/Makefile index 4b18dff37b..0e13f2440e 100644 --- a/board/toradex/colibri_imx7/Makefile +++ b/board/toradex/colibri_imx7/Makefile @@ -4,6 +4,7 @@ # obj-y := colibri_imx7.o +obj-$(CONFIG_TRDX_CMD_IMX_MFGR) += do_fuse.o extra-$(CONFIG_USE_PLUGIN) := plugin.bin $(obj)/plugin.bin: $(obj)/plugin.o diff --git a/board/toradex/colibri_imx7/do_fuse.c b/board/toradex/colibri_imx7/do_fuse.c new file mode 100644 index 0000000000..13f3efa97c --- /dev/null +++ b/board/toradex/colibri_imx7/do_fuse.c @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2016, Toradex AG + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/* + * Helpers for i.MX OTP fusing during module production +*/ + +#include <common.h> +#include <fuse.h> + +static int mfgr_fuse(void) +{ + unsigned val, val6; + + fuse_sense(1, 3, &val); + printf("Fuse 1, 3: %8x\n", val); + if(val & 0x10000000) + { + puts("BT_FUSE_SEL already fused, will do nothing\n"); + return CMD_RET_FAILURE; + } + /* BT_FUSE_SEL & boot cfg */ + fuse_prog(1, 3, 0x10003400); + return CMD_RET_SUCCESS; +} + +int do_mfgr_fuse(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + int ret; + puts("Fusing...\n"); + ret = mfgr_fuse(); + if (ret == CMD_RET_SUCCESS) + puts("done.\n"); + else + puts("failed.\n"); + return ret; +} + +U_BOOT_CMD( + mfgr_fuse, 1, 0, do_mfgr_fuse, + "OTP fusing during module production\n", + "" +); |