1 // SPDX-License-Identifier: GPL-2.0+
4 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
7 * Copyright (C) 2012 Freescale Semiconductor, Inc.
9 * Author: Fabio Estevam <fabio.estevam@freescale.com>
13 #include <asm/arch/clock.h>
14 #include <asm/arch/imx-regs.h>
15 #include <asm/arch/iomux.h>
16 #include <asm/arch/mx6-pins.h>
17 #include <linux/errno.h>
19 #include <asm/mach-imx/iomux-v3.h>
20 #include <asm/mach-imx/boot_mode.h>
21 #include <asm/mach-imx/video.h>
22 #include <asm/arch/crm_regs.h>
24 #include <asm/arch/sys_proto.h>
28 #include <i2c_eeprom.h>
34 #include <power/pmic.h>
35 #include <power/regulator.h>
36 #include <power/da9063_pmic.h>
40 DECLARE_GLOBAL_DATA_PTR;
47 #define ARI_BT_4 "aristainetos2_4@2"
48 #define ARI_BT_7 "aristainetos2_7@1"
50 int board_phy_config(struct phy_device *phydev)
52 /* control data pad skew - devaddr = 0x02, register = 0x04 */
53 ksz9031_phy_extended_write(phydev, 0x02,
54 MII_KSZ9031_EXT_RGMII_CTRL_SIG_SKEW,
55 MII_KSZ9031_MOD_DATA_NO_POST_INC, 0x0000);
56 /* rx data pad skew - devaddr = 0x02, register = 0x05 */
57 ksz9031_phy_extended_write(phydev, 0x02,
58 MII_KSZ9031_EXT_RGMII_RX_DATA_SKEW,
59 MII_KSZ9031_MOD_DATA_NO_POST_INC, 0x0000);
60 /* tx data pad skew - devaddr = 0x02, register = 0x06 */
61 ksz9031_phy_extended_write(phydev, 0x02,
62 MII_KSZ9031_EXT_RGMII_TX_DATA_SKEW,
63 MII_KSZ9031_MOD_DATA_NO_POST_INC, 0x0000);
64 /* gtx and rx clock pad skew - devaddr = 0x02, register = 0x08 */
65 ksz9031_phy_extended_write(phydev, 0x02,
66 MII_KSZ9031_EXT_RGMII_CLOCK_SKEW,
67 MII_KSZ9031_MOD_DATA_NO_POST_INC, 0x03FF);
69 if (phydev->drv->config)
70 phydev->drv->config(phydev);
75 static int rotate_logo_one(unsigned char *out, unsigned char *in)
79 for (i = 0; i < BMP_LOGO_WIDTH; i++)
80 for (j = 0; j < BMP_LOGO_HEIGHT; j++)
81 out[j * BMP_LOGO_WIDTH + BMP_LOGO_HEIGHT - 1 - i] =
82 in[i * BMP_LOGO_WIDTH + j];
87 * Rotate the BMP_LOGO (only)
88 * Will only work, if the logo is square, as
89 * BMP_LOGO_HEIGHT and BMP_LOGO_WIDTH are defines, not variables
91 void rotate_logo(int rotations)
93 unsigned char out_logo[BMP_LOGO_WIDTH * BMP_LOGO_HEIGHT];
94 struct bmp_header *header;
95 unsigned char *in_logo;
98 if (BMP_LOGO_WIDTH != BMP_LOGO_HEIGHT)
101 header = (struct bmp_header *)bmp_logo_bitmap;
102 in_logo = bmp_logo_bitmap + header->data_offset;
104 /* one 90 degree rotation */
105 if (rotations == 1 || rotations == 2 || rotations == 3)
106 rotate_logo_one(out_logo, in_logo);
108 /* second 90 degree rotation */
109 if (rotations == 2 || rotations == 3)
110 rotate_logo_one(in_logo, out_logo);
112 /* third 90 degree rotation */
114 rotate_logo_one(out_logo, in_logo);
116 /* copy result back to original array */
117 if (rotations == 1 || rotations == 3)
118 for (i = 0; i < BMP_LOGO_WIDTH; i++)
119 for (j = 0; j < BMP_LOGO_HEIGHT; j++)
120 in_logo[i * BMP_LOGO_WIDTH + j] =
121 out_logo[i * BMP_LOGO_WIDTH + j];
124 static void enable_lvds(struct display_info_t const *dev)
126 struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
127 struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
129 s32 timeout = 100000;
132 reg = readl(&ccm->analog_pll_video);
133 reg |= BM_ANADIG_PLL_VIDEO_POWERDOWN;
134 writel(reg, &ccm->analog_pll_video);
136 /* set PLL5 to 232720000Hz */
137 reg &= ~BM_ANADIG_PLL_VIDEO_DIV_SELECT;
138 reg |= BF_ANADIG_PLL_VIDEO_DIV_SELECT(0x26);
139 reg &= ~BM_ANADIG_PLL_VIDEO_POST_DIV_SELECT;
140 reg |= BF_ANADIG_PLL_VIDEO_POST_DIV_SELECT(0);
141 writel(reg, &ccm->analog_pll_video);
143 writel(BF_ANADIG_PLL_VIDEO_NUM_A(0xC0238),
144 &ccm->analog_pll_video_num);
145 writel(BF_ANADIG_PLL_VIDEO_DENOM_B(0xF4240),
146 &ccm->analog_pll_video_denom);
148 reg &= ~BM_ANADIG_PLL_VIDEO_POWERDOWN;
149 writel(reg, &ccm->analog_pll_video);
152 if (readl(&ccm->analog_pll_video) & BM_ANADIG_PLL_VIDEO_LOCK)
155 printf("Warning: video pll lock timeout!\n");
157 reg = readl(&ccm->analog_pll_video);
158 reg |= BM_ANADIG_PLL_VIDEO_ENABLE;
159 reg &= ~BM_ANADIG_PLL_VIDEO_BYPASS;
160 writel(reg, &ccm->analog_pll_video);
162 /* set LDB0, LDB1 clk select to 000/000 (PLL5 clock) */
163 reg = readl(&ccm->cs2cdr);
164 reg &= ~(MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK
165 | MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK);
166 reg |= (0 << MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_OFFSET)
167 | (0 << MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_OFFSET);
168 writel(reg, &ccm->cs2cdr);
170 reg = readl(&ccm->cscmr2);
171 reg |= MXC_CCM_CSCMR2_LDB_DI0_IPU_DIV;
172 writel(reg, &ccm->cscmr2);
174 reg = readl(&ccm->chsccdr);
175 reg |= (CHSCCDR_CLK_SEL_LDB_DI0
176 << MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET);
177 writel(reg, &ccm->chsccdr);
179 reg = IOMUXC_GPR2_BGREF_RRMODE_EXTERNAL_RES
180 | IOMUXC_GPR2_DI1_VS_POLARITY_ACTIVE_HIGH
181 | IOMUXC_GPR2_DI0_VS_POLARITY_ACTIVE_HIGH
182 | IOMUXC_GPR2_BIT_MAPPING_CH0_SPWG
183 | IOMUXC_GPR2_DATA_WIDTH_CH0_24BIT
184 | IOMUXC_GPR2_LVDS_CH1_MODE_DISABLED
185 | IOMUXC_GPR2_LVDS_CH0_MODE_ENABLED_DI0;
186 writel(reg, &iomux->gpr[2]);
188 reg = readl(&iomux->gpr[3]);
189 reg = (reg & ~IOMUXC_GPR3_LVDS0_MUX_CTL_MASK)
190 | (IOMUXC_GPR3_MUX_SRC_IPU1_DI0
191 << IOMUXC_GPR3_LVDS0_MUX_CTL_OFFSET);
192 writel(reg, &iomux->gpr[3]);
195 static void enable_spi_display(struct display_info_t const *dev)
197 struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
198 struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
200 s32 timeout = 100000;
202 #if defined(CONFIG_VIDEO_BMP_LOGO)
203 rotate_logo(3); /* portrait display in landscape mode */
206 reg = readl(&ccm->cs2cdr);
208 /* select pll 5 clock */
209 reg &= ~(MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK
210 | MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK);
211 writel(reg, &ccm->cs2cdr);
213 /* set PLL5 to 197994996Hz */
214 reg &= ~BM_ANADIG_PLL_VIDEO_DIV_SELECT;
215 reg |= BF_ANADIG_PLL_VIDEO_DIV_SELECT(0x21);
216 reg &= ~BM_ANADIG_PLL_VIDEO_POST_DIV_SELECT;
217 reg |= BF_ANADIG_PLL_VIDEO_POST_DIV_SELECT(0);
218 writel(reg, &ccm->analog_pll_video);
220 writel(BF_ANADIG_PLL_VIDEO_NUM_A(0xfbf4),
221 &ccm->analog_pll_video_num);
222 writel(BF_ANADIG_PLL_VIDEO_DENOM_B(0xf4240),
223 &ccm->analog_pll_video_denom);
225 reg &= ~BM_ANADIG_PLL_VIDEO_POWERDOWN;
226 writel(reg, &ccm->analog_pll_video);
229 if (readl(&ccm->analog_pll_video) & BM_ANADIG_PLL_VIDEO_LOCK)
232 printf("Warning: video pll lock timeout!\n");
234 reg = readl(&ccm->analog_pll_video);
235 reg |= BM_ANADIG_PLL_VIDEO_ENABLE;
236 reg &= ~BM_ANADIG_PLL_VIDEO_BYPASS;
237 writel(reg, &ccm->analog_pll_video);
239 /* set LDB0, LDB1 clk select to 000/000 (PLL5 clock) */
240 reg = readl(&ccm->cs2cdr);
241 reg &= ~(MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK
242 | MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK);
243 reg |= (0 << MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_OFFSET)
244 | (0 << MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_OFFSET);
245 writel(reg, &ccm->cs2cdr);
247 reg = readl(&ccm->cscmr2);
248 reg |= MXC_CCM_CSCMR2_LDB_DI0_IPU_DIV;
249 writel(reg, &ccm->cscmr2);
251 reg = readl(&ccm->chsccdr);
252 reg |= (CHSCCDR_CLK_SEL_LDB_DI0
253 << MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET);
254 reg &= ~MXC_CCM_CHSCCDR_IPU1_DI0_PODF_MASK;
255 reg |= (2 << MXC_CCM_CHSCCDR_IPU1_DI0_PODF_OFFSET);
256 reg &= ~MXC_CCM_CHSCCDR_IPU1_DI0_PRE_CLK_SEL_MASK;
257 reg |= (2 << MXC_CCM_CHSCCDR_IPU1_DI0_PRE_CLK_SEL_OFFSET);
258 writel(reg, &ccm->chsccdr);
260 reg = IOMUXC_GPR2_BGREF_RRMODE_EXTERNAL_RES
261 | IOMUXC_GPR2_DI1_VS_POLARITY_ACTIVE_HIGH
262 | IOMUXC_GPR2_DI0_VS_POLARITY_ACTIVE_HIGH
263 | IOMUXC_GPR2_BIT_MAPPING_CH0_SPWG
264 | IOMUXC_GPR2_DATA_WIDTH_CH0_24BIT
265 | IOMUXC_GPR2_LVDS_CH1_MODE_DISABLED
266 | IOMUXC_GPR2_LVDS_CH0_MODE_ENABLED_DI0;
267 writel(reg, &iomux->gpr[2]);
269 reg = readl(&iomux->gpr[3]);
270 reg = (reg & ~IOMUXC_GPR3_LVDS0_MUX_CTL_MASK)
271 | (IOMUXC_GPR3_MUX_SRC_IPU1_DI0
272 << IOMUXC_GPR3_LVDS0_MUX_CTL_OFFSET);
273 writel(reg, &iomux->gpr[3]);
276 static void setup_display(void)
281 static void set_gpr_register(void)
283 struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
285 writel(IOMUXC_GPR1_APP_CLK_REQ_N | IOMUXC_GPR1_PCIE_RDY_L23 |
286 IOMUXC_GPR1_EXC_MON_SLVE |
287 (2 << IOMUXC_GPR1_ADDRS0_OFFSET) |
289 &iomuxc_regs->gpr[1]);
290 writel(0x0, &iomuxc_regs->gpr[8]);
291 writel(IOMUXC_GPR12_ARMP_IPG_CLK_EN | IOMUXC_GPR12_ARMP_AHB_CLK_EN |
292 IOMUXC_GPR12_ARMP_ATB_CLK_EN | IOMUXC_GPR12_ARMP_APB_CLK_EN,
293 &iomuxc_regs->gpr[12]);
296 extern char __bss_start[], __bss_end[];
297 int board_early_init_f(void)
299 select_ldb_di_clock_source(MXC_PLL5_CLK);
303 * clear bss here, so we can use spi driver
304 * before relocation and read Environment
307 memset(__bss_start, 0x00, __bss_end - __bss_start);
312 static void setup_one_led(char *label, int state)
317 ret = led_get_by_label(label, &dev);
319 led_set_state(dev, state);
322 static void setup_board_gpio(void)
324 setup_one_led("led_ena", LEDST_ON);
325 /* switch off Status LEDs */
326 setup_one_led("led_yellow", LEDST_OFF);
327 setup_one_led("led_red", LEDST_OFF);
328 setup_one_led("led_green", LEDST_OFF);
329 setup_one_led("led_blue", LEDST_OFF);
332 #define ARI_RESC_FMT "setenv rescue_reason setenv bootargs \\${bootargs}" \
335 static void aristainetos_run_rescue_command(int reason)
337 char rescue_reason_command[80];
339 sprintf(rescue_reason_command, ARI_RESC_FMT, reason);
340 run_command(rescue_reason_command, 0);
343 static int aristainetos_eeprom(void)
351 off = fdt_path_offset(gd->fdt_blob, "eeprom0");
353 printf("%s: No eeprom0 path offset\n", __func__);
357 ret = uclass_get_device_by_of_offset(UCLASS_I2C_EEPROM, off, &dev);
359 printf("%s: Could not find EEPROM\n", __func__);
363 ret = i2c_set_chip_offset_len(dev, 2);
367 ret = i2c_eeprom_read(dev, 0x1ff0, (uint8_t *)data, 6);
369 printf("%s: Could not read EEPROM\n", __func__);
373 if (strncmp((char *)&data[3], "ReScUe", 6) == 0) {
374 rescue_reason = *(uint8_t *)&data[9];
375 memset(&data[3], 0xff, 7);
376 i2c_eeprom_write(dev, 0x1ff0, (uint8_t *)&data[3], 7);
377 printf("\nBooting into Rescue System (EEPROM)\n");
378 aristainetos_run_rescue_command(rescue_reason);
379 run_command("run rescue_load_fit rescueboot", 0);
380 } else if (strncmp((char *)data, "DeF", 3) == 0) {
381 memset(data, 0xff, 3);
382 i2c_eeprom_write(dev, 0x1ff0, (uint8_t *)data, 3);
383 printf("\nClear u-boot environment (set back to defaults)\n");
384 run_command("run default_env; saveenv; saveenv", 0);
390 static void aristainetos_bootmode_settings(void)
392 struct gpio_desc *desc;
393 struct src *psrc = (struct src *)SRC_BASE_ADDR;
394 unsigned int sbmr1 = readl(&psrc->sbmr1);
400 * Check the boot-source. If booting from NOR Flash,
403 ret = gpio_hog_lookup_name("bootsel0", &desc);
405 bootmode |= (dm_gpio_get_value(desc) ? 1 : 0) << 0;
406 ret = gpio_hog_lookup_name("bootsel1", &desc);
408 bootmode |= (dm_gpio_get_value(desc) ? 1 : 0) << 1;
409 ret = gpio_hog_lookup_name("bootsel2", &desc);
411 bootmode |= (dm_gpio_get_value(desc) ? 1 : 0) << 2;
414 my_bootdelay = env_get("nor_bootdelay");
416 env_set("bootdelay", my_bootdelay);
418 env_set("bootdelay", "-2");
422 env_set("bootmode", "1");
423 printf("SD bootmode jumper set!\n");
425 env_set("bootmode", "0");
428 /* read out some jumper values*/
429 ret = gpio_hog_lookup_name("env_reset", &desc);
431 if (dm_gpio_get_value(desc)) {
432 printf("\nClear env (set back to defaults)\n");
433 run_command("run default_env; saveenv; saveenv", 0);
436 ret = gpio_hog_lookup_name("boot_rescue", &desc);
438 if (dm_gpio_get_value(desc)) {
439 aristainetos_run_rescue_command(16);
440 run_command("run rescue_xload_boot", 0);
445 #if defined(CONFIG_DM_PMIC_DA9063)
447 * On the aristainetos2c boards the PMIC needs to be initialized,
448 * because the Ethernet PHY uses a different regulator that is not
449 * setup per hardware default. This does not influence the other versions
450 * as this regulator isn't used there at all.
452 * Unfortunately we have not yet a interface to setup all
455 static int setup_pmic_voltages(void)
461 off = fdt_path_offset(gd->fdt_blob, "pmic0");
463 printf("%s: No pmic path offset\n", __func__);
467 ret = uclass_get_device_by_of_offset(UCLASS_PMIC, off, &dev);
469 printf("%s: Could not find PMIC\n", __func__);
473 pmic_reg_write(dev, DA9063_REG_PAGE_CON, 0x01);
474 pmic_reg_write(dev, DA9063_REG_BPRO_CFG, 0xc1);
475 ret = pmic_reg_read(dev, DA9063_REG_BUCK_ILIM_B);
477 printf("%s: error %d get register\n", __func__, ret);
482 pmic_reg_write(dev, DA9063_REG_BUCK_ILIM_B, ret);
483 pmic_reg_write(dev, DA9063_REG_VBPRO_A, 0x43);
484 pmic_reg_write(dev, DA9063_REG_VBPRO_B, 0xc3);
489 static int setup_pmic_voltages(void)
495 int board_late_init(void)
500 splash_get_pos(&x, &y);
501 bmp_display((ulong)&bmp_logo_bitmap[0], x, y);
503 aristainetos_bootmode_settings();
506 aristainetos_eeprom();
509 if (gd->board_type == BOARD_TYPE_4)
510 env_set("board_type", ARI_BT_4);
512 env_set("board_type", ARI_BT_7);
514 if (setup_pmic_voltages())
515 printf("Error setup PMIC\n");
522 gd->ram_size = imx_ddr_size();
527 struct display_info_t const displays[] = {
531 .pixfmt = IPU_PIX_FMT_RGB24,
533 .enable = enable_lvds,
547 .vmode = FB_VMODE_NONINTERLACED
550 #if ((CONFIG_SYS_BOARD_VERSION == 2) || \
551 (CONFIG_SYS_BOARD_VERSION == 3) || \
552 (CONFIG_SYS_BOARD_VERSION == 4) || \
553 (CONFIG_SYS_BOARD_VERSION == 5))
557 .pixfmt = IPU_PIX_FMT_RGB24,
559 .enable = enable_spi_display,
572 .sync = FB_SYNC_EXT | FB_SYNC_HOR_HIGH_ACT |
573 FB_SYNC_VERT_HIGH_ACT,
574 .vmode = FB_VMODE_NONINTERLACED
579 size_t display_count = ARRAY_SIZE(displays);
581 #if defined(CONFIG_MTD_RAW_NAND)
582 iomux_v3_cfg_t nfc_pads[] = {
583 MX6_PAD_NANDF_CLE__NAND_CLE | MUX_PAD_CTRL(NO_PAD_CTRL),
584 MX6_PAD_NANDF_ALE__NAND_ALE | MUX_PAD_CTRL(NO_PAD_CTRL),
585 MX6_PAD_NANDF_WP_B__NAND_WP_B | MUX_PAD_CTRL(NO_PAD_CTRL),
586 MX6_PAD_NANDF_RB0__NAND_READY_B | MUX_PAD_CTRL(NO_PAD_CTRL),
587 MX6_PAD_NANDF_CS0__NAND_CE0_B | MUX_PAD_CTRL(NO_PAD_CTRL),
588 MX6_PAD_SD4_CMD__NAND_RE_B | MUX_PAD_CTRL(NO_PAD_CTRL),
589 MX6_PAD_SD4_CLK__NAND_WE_B | MUX_PAD_CTRL(NO_PAD_CTRL),
590 MX6_PAD_NANDF_D0__NAND_DATA00 | MUX_PAD_CTRL(NO_PAD_CTRL),
591 MX6_PAD_NANDF_D1__NAND_DATA01 | MUX_PAD_CTRL(NO_PAD_CTRL),
592 MX6_PAD_NANDF_D2__NAND_DATA02 | MUX_PAD_CTRL(NO_PAD_CTRL),
593 MX6_PAD_NANDF_D3__NAND_DATA03 | MUX_PAD_CTRL(NO_PAD_CTRL),
594 MX6_PAD_NANDF_D4__NAND_DATA04 | MUX_PAD_CTRL(NO_PAD_CTRL),
595 MX6_PAD_NANDF_D5__NAND_DATA05 | MUX_PAD_CTRL(NO_PAD_CTRL),
596 MX6_PAD_NANDF_D6__NAND_DATA06 | MUX_PAD_CTRL(NO_PAD_CTRL),
597 MX6_PAD_NANDF_D7__NAND_DATA07 | MUX_PAD_CTRL(NO_PAD_CTRL),
598 MX6_PAD_SD4_DAT0__NAND_DQS | MUX_PAD_CTRL(NO_PAD_CTRL),
601 static void setup_gpmi_nand(void)
603 struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
605 /* config gpmi nand iomux */
606 imx_iomux_v3_setup_multiple_pads(nfc_pads,
607 ARRAY_SIZE(nfc_pads));
609 /* gate ENFC_CLK_ROOT clock first,before clk source switch */
610 clrbits_le32(&mxc_ccm->CCGR2, MXC_CCM_CCGR2_IOMUX_IPT_CLK_IO_MASK);
612 /* config gpmi and bch clock to 100 MHz */
613 clrsetbits_le32(&mxc_ccm->cs2cdr,
614 MXC_CCM_CS2CDR_ENFC_CLK_PODF_MASK |
615 MXC_CCM_CS2CDR_ENFC_CLK_PRED_MASK |
616 MXC_CCM_CS2CDR_ENFC_CLK_SEL_MASK,
617 MXC_CCM_CS2CDR_ENFC_CLK_PODF(0) |
618 MXC_CCM_CS2CDR_ENFC_CLK_PRED(3) |
619 MXC_CCM_CS2CDR_ENFC_CLK_SEL(3));
621 /* enable ENFC_CLK_ROOT clock */
622 setbits_le32(&mxc_ccm->CCGR2, MXC_CCM_CCGR2_IOMUX_IPT_CLK_IO_MASK);
624 /* enable gpmi and bch clock gating */
625 setbits_le32(&mxc_ccm->CCGR4,
626 MXC_CCM_CCGR4_RAWNAND_U_BCH_INPUT_APB_MASK |
627 MXC_CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_BCH_MASK |
628 MXC_CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_GPMI_IO_MASK |
629 MXC_CCM_CCGR4_RAWNAND_U_GPMI_INPUT_APB_MASK |
630 MXC_CCM_CCGR4_PL301_MX6QPER1_BCH_OFFSET);
632 /* enable apbh clock gating */
633 setbits_le32(&mxc_ccm->CCGR0, MXC_CCM_CCGR0_APBHDMA_MASK);
636 static void setup_gpmi_nand(void)
643 struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
645 /* address of boot parameters */
646 gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
652 /* GPIO_1 for USB_OTG_ID */
653 clrsetbits_le32(&iomux->gpr[1], IOMUXC_GPR1_USB_OTG_ID_SEL_MASK, 0);
657 int board_fit_config_name_match(const char *name)
659 if (gd->board_type == BOARD_TYPE_4 &&
663 if (gd->board_type == BOARD_TYPE_7 &&
670 static void do_board_detect(void)
675 /* default use board type 7 */
676 gd->board_type = BOARD_TYPE_7;
680 ret = env_get_f("panel", s, sizeof(s));
684 if (!strncmp("lg4573", s, 6))
685 gd->board_type = BOARD_TYPE_4;
688 #ifdef CONFIG_DTB_RESELECT
689 int embedded_dtb_select(void)
694 fdtdec_resetup(&rescan);