summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Gutierrez <juan.gutierrez@nxp.com>2017-04-19 10:51:02 -0500
committerJuan Gutierrez <juan.gutierrez@nxp.com>2017-04-28 12:06:43 -0500
commit5cec04fbb1bc1d1fc5359dd129539716131f3037 (patch)
treeeb4fa64389c1943d37af1d58f1475c0ed07b02b3
parentb6e7670291d791f55e7036f34e54aa593bf02944 (diff)
downloadu-boot-imx-5cec04fbb1bc1d1fc5359dd129539716131f3037.zip
u-boot-imx-5cec04fbb1bc1d1fc5359dd129539716131f3037.tar.gz
u-boot-imx-5cec04fbb1bc1d1fc5359dd129539716131f3037.tar.bz2
MXSCM-291 mx6dqscm: set runtime fdt_file and other fixes
1. set fdt_file according to board_rev which is set at runtime 2. Add macros for proper delimitation for different board builds 3. Fix and add proper iomux configuration Signed-off-by: Juan Gutierrez <juan.gutierrez@nxp.com>
-rw-r--r--board/freescale/mx6dqscm/mx6dqscm.c37
-rw-r--r--include/configs/mx6dqscm.h20
2 files changed, 51 insertions, 6 deletions
diff --git a/board/freescale/mx6dqscm/mx6dqscm.c b/board/freescale/mx6dqscm/mx6dqscm.c
index 98f91cc..ffae922 100644
--- a/board/freescale/mx6dqscm/mx6dqscm.c
+++ b/board/freescale/mx6dqscm/mx6dqscm.c
@@ -169,12 +169,16 @@ static iomux_v3_cfg_t const usdhc3_pads[] = {
MX6_PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
MX6_PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
#ifndef CONFIG_QWKS_REV3
- MX6_PAD_SD3_DAT4__GPIO7_IO01 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
+ MX6_PAD_SD3_DAT4__SD3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
#endif
MX6_PAD_SD3_DAT5__SD3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
MX6_PAD_SD3_DAT6__SD3_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
MX6_PAD_SD3_DAT7__SD3_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
+#ifdef CONFIG_QWKS_REV3
+ MX6_PAD_SD3_DAT4__GPIO7_IO01 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
+#else
MX6_PAD_NANDF_D0__GPIO2_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL), /* CD */
+#endif
};
static iomux_v3_cfg_t const usdhc4_pads[] = {
@@ -632,6 +636,7 @@ static iomux_v3_cfg_t const usb_otg_pads[] = {
MX6_PAD_KEY_COL4__USB_OTG_OC | MUX_PAD_CTRL(NO_PAD_CTRL),
#else
MX6_PAD_EIM_D22__USB_OTG_PWR | MUX_PAD_CTRL(NO_PAD_CTRL),
+ MX6_PAD_EIM_D21__USB_OTG_OC | MUX_PAD_CTRL(NO_PAD_CTRL),
#endif
#ifdef CONFIG_SCMEVB
MX6_PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(OTG_ID_PAD_CTRL),
@@ -659,10 +664,12 @@ static void setup_usb(void)
imx_iomux_set_gpr_register(1, 13, 1, 1);
#endif
+#ifdef CONFIG_SCMEVB
imx_iomux_v3_setup_multiple_pads(usb_hc1_pads,
ARRAY_SIZE(usb_hc1_pads));
gpio_request(IMX_GPIO_NR(1, 29), "USB HC1 Power Enable");
+#endif
}
int board_ehci_hcd_init(int port)
@@ -686,11 +693,13 @@ int board_ehci_power(int port, int on)
case 0:
break;
case 1:
+#ifdef CONFIG_SCMEVB
if (on)
gpio_direction_output(IMX_GPIO_NR(1, 29), 1);
else
gpio_direction_output(IMX_GPIO_NR(1, 29), 0);
break;
+#endif
default:
printf("MXC USB port %d not yet supported\n", port);
return -EINVAL;
@@ -1066,6 +1075,25 @@ int board_late_init(void)
add_board_boot_modes(board_boot_modes);
#endif
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+#ifdef CONFIG_SCMHVB
+ setenv("board_name", "hvb");
+#elif CONFIG_SCMEVB
+ setenv("board_name", "evb");
+#elif CONFIG_QWKS_REV3
+ setenv("board_name", "qwks-rev3");
+#else
+ setenv("board_name", "qwks-rev2");
+#endif
+#ifdef CONFIG_SCM_LPDDR2_512MB
+ setenv("lpddr2_size", "512mb");
+#elif CONFIG_SCM_LPDDR2_2GB
+ setenv("lpddr2_size", "2gb");
+#else
+ setenv("lpddr2_size", "1gb");
+#endif
+#endif /*CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG*/
+
#ifdef CONFIG_ENV_IS_IN_MMC
board_late_mmc_env_init();
#endif
@@ -1081,7 +1109,7 @@ int checkboard(void)
#elif CONFIG_QWKS_REV3
puts("Board: MX6DQSCM-QWKS-REV3\n");
#else
- puts("Board: MX6DQSCM-QWKS\n");
+ puts("Board: MX6DQSCM-QWKS-REV2\n");
#endif
return 0;
}
@@ -1129,10 +1157,12 @@ void board_fastboot_setup(void)
#ifdef CONFIG_ANDROID_RECOVERY
+#ifdef CONFIG_SCM_EVB
#define GPIO_VOL_DN_KEY IMX_GPIO_NR(1, 5)
iomux_v3_cfg_t const recovery_key_pads[] = {
(MX6_PAD_GPIO_5__GPIO1_IO05 | MUX_PAD_CTRL(NO_PAD_CTRL)),
};
+#endif
int check_recovery_cmd_file(void)
{
@@ -1140,7 +1170,8 @@ int check_recovery_cmd_file(void)
int recovery_mode = 0;
recovery_mode = recovery_check_and_clean_flag();
-#ifdef CONFIG_EVB_SETTINGS
+
+#ifdef CONFIG_SCM_EVB
/* Check Recovery Combo Button press or not. */
imx_iomux_v3_setup_multiple_pads(recovery_key_pads,
ARRAY_SIZE(recovery_key_pads));
diff --git a/include/configs/mx6dqscm.h b/include/configs/mx6dqscm.h
index 6f92cab..ec215d7 100644
--- a/include/configs/mx6dqscm.h
+++ b/include/configs/mx6dqscm.h
@@ -290,13 +290,15 @@
#define CONFIG_USB_MAX_CONTROLLER_COUNT 1 /* Enabled USB controller number */
#endif
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
#if !defined(CONFIG_FASTBOOT)
#undef CONFIG_EXTRA_ENV_SETTINGS
#define CONFIG_EXTRA_ENV_SETTINGS \
CONFIG_MFG_ENV_SETTINGS \
"script=boot.scr\0" \
"image=zImage\0" \
- "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+ "fdt_file=undefined\0" \
"fdt_addr=0x18000000\0" \
"boot_fdt=try\0" \
"ip_dyn=yes\0" \
@@ -367,10 +369,16 @@
"fi; " \
"else " \
"bootz; " \
+ "fi;\0" \
+ "findfdt="\
+ "if test $fdt_file = undefined; then " \
+ "setenv fdt_file " \
+ "imx6dqscm-${lpddr2_size}-${board_name}-fix-ldo.dtb;" \
"fi;\0"
#undef CONFIG_BOOTCOMMAND
#define CONFIG_BOOTCOMMAND \
+ "run findfdt;" \
"mmc dev ${mmcdev};" \
"if mmc rescan; then " \
"if run loadbootscript; then " \
@@ -412,7 +420,7 @@
CONFIG_MFG_ENV_SETTINGS \
"script=boot.scr\0" \
"image=zImage\0" \
- "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+ "fdt_file=undefined\0" \
"fdt_addr=0x18000000\0" \
"boot_fdt=try\0" \
"ip_dyn=yes\0" \
@@ -491,10 +499,16 @@
"run spinorargs; sf probe; " \
"sf read 0x12000000 0x90000 0x700000; " \
"sf read 0x18000000 0x80000 0x10000; " \
- "bootz 0x12000000 - 0x18000000"
+ "bootz 0x12000000 - 0x18000000\0" \
+ "findfdt="\
+ "if test $fdt_file = undefined; then " \
+ "setenv fdt_file " \
+ "imx6dqscm-${lpddr2_size}-${board_name}-fix-ldo.dtb;" \
+ "fi;\0"
#undef CONFIG_BOOTCOMMAND
#define CONFIG_BOOTCOMMAND \
+ "run findfdt;" \
"run spinorboot; " \
"mmc dev ${mmcdev};" \
"if mmc rescan; then " \