int board_mmc_init(bd_t *bis)
{
- int i;
+ int i, err;
int buswidth = 4;
if (s5p_no_mmc_support())
gpio_set_pull(&gpio->j2, 7, GPIO_PULL_NONE);
}
- return s5p_mmc_init(0, buswidth);
+ /* T-flash detect */
+ gpio_cfg_pin(&gpio->h3, 4, 0xf);
+ gpio_set_pull(&gpio->h3, 4, GPIO_PULL_UP);
+
+ err = s5p_mmc_init(0, buswidth);
+
+ if (!gpio_get_value(&gpio->h3, 4)) {
+ for (i = 0; i < 7; i++) {
+ if (i == 2)
+ continue;
+ /* GPG0[0:6] special function 2 */
+ gpio_cfg_pin(&gpio->g2, i, 0x2);
+ /* GPG0[0:6] pull disable */
+ gpio_set_pull(&gpio->g2, i, GPIO_PULL_NONE);
+ /* GPG0[0:6] drv 4x */
+ gpio_set_drv(&gpio->g2, i, GPIO_DRV_4X);
+ }
+ err =s5p_mmc_init(2, 4);
+ }
+
+ return err;
}
#endif
#define CONFIG_CMD_SLEEP
#define CONFIG_CMD_PMIC
#define CONFIG_CMD_DEVICE_POWER
+#define CONFIG_CMD_FAT
/* disabled commands */
//#define CONFIG_CMD_GPIO
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
-#define CONFIG_BOOTCOMMAND "run ubifsboot"
+#define CONFIG_BOOTCOMMAND \
+ "if mmc rescan 1; then " \
+ "if run loaduimage; then " \
+ "run sdboot; " \
+ "else run ubifsboot; " \
+ "fi; " \
+ "else run ubifsboot; fi"
#define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
"mmcboot=set bootargs root=${mmcblk} rootfstype=${rootfstype}" \
CONFIG_UBI_MTD " ${opts} ${lcdinfo} " CONFIG_COMMON_BOOT "; run bootk\0" \
"bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \
+ "sdboot=set bootargs root=/dev/mmcblk0p2 " CONFIG_COMMON_BOOT \
+ CONFIG_UBI_MTD "; bootm 0x30007FC0\0" \
"verify=n\0" \
"rootfstype=cramfs\0" \
"console=" CONFIG_DEFAULT_CONSOLE \
"bootblock=" CONFIG_BOOTBLOCK "\0" \
"ubiblock=" CONFIG_UBIBLOCK" \0" \
"ubi=enabled\0" \
+ "loaduimage=fatload mmc 1 0x30007FC0 uImage\0" \
"opts=always_resume=1"
/*