summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2014-04-16 15:22:01 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2014-04-16 15:22:01 +0200
commit8c03ad06da7f79be55a723dc77d22465111a65b2 (patch)
tree7592ca7bac7669dde7359ac6830cff68de084458
parent3cd662da4222b27a54dc7bc56d2856aa58f77c22 (diff)
colibri_t20: fix/hack sd boot environment
We wrongly set an obsolete define so the U-Boot environment ended up at the wrong location on the SD card. Add a hack introducing a short delays before doing MMC_CMD_SET_BLOCKLEN as otherwise all 4GB Kingston or SanDisk cards I have failed. While at it fix the USB port naming in the device tree comments to adhere to the standard Colibri convention.
-rw-r--r--board/toradex/colibri_t20/colibri_t20.dts4
-rw-r--r--drivers/mmc/mmc.c6
-rw-r--r--include/configs/colibri_t20_sdboot.h9
3 files changed, 14 insertions, 5 deletions
diff --git a/board/toradex/colibri_t20/colibri_t20.dts b/board/toradex/colibri_t20/colibri_t20.dts
index 92705575400..678300edd36 100644
--- a/board/toradex/colibri_t20/colibri_t20.dts
+++ b/board/toradex/colibri_t20/colibri_t20.dts
@@ -103,7 +103,7 @@
panel-timings = <0 0 0 0>;
};
- /* EHCI instance 0: USB1_DP/N -> USBOTG_P/N */
+ /* EHCI instance 0: USB1_DP/N -> USBC_P/N */
usb@0xc5000000 {
status = "ok";
host-mode = <1>;
@@ -120,7 +120,7 @@
status = "ok";
};
- /* EHCI instance 2: USB3_DP/N -> USBH1_P/N */
+ /* EHCI instance 2: USB3_DP/N -> USBH_P/N */
usb@0xc5008000 {
status = "ok";
utmi = <&usbphy>;
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 76eaf15c7f6..f197ab84cac 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -318,6 +318,12 @@ static ulong mmc_bread(int dev_num, ulong start, lbaint_t blkcnt, void *dst)
return 0;
}
+#if (defined(CONFIG_ENV_IS_IN_MMC) && defined(CONFIG_COLIBRI_T20))
+ /* Hack: All 4GB Kingston or SanDisk cards I have require a short delay
+ otherwise the next command fails. */
+ udelay(1000);
+#endif
+
if (mmc_set_blocklen(mmc, mmc->read_bl_len))
return 0;
diff --git a/include/configs/colibri_t20_sdboot.h b/include/configs/colibri_t20_sdboot.h
index 588419a5f99..6629f42c2f2 100644
--- a/include/configs/colibri_t20_sdboot.h
+++ b/include/configs/colibri_t20_sdboot.h
@@ -34,7 +34,7 @@ SD-BOOT
The sd sector numbers are used as follows:
u-boot needs to find ENV and LNX to get to the environment and the kernel, the kernel needs to find the APP partition for the rootfs.
ENV: colibri_t20_sdboot.h
-Set CONFIG_ENV_MMC_OFFSET to the byte start address of ENV, take the sector address of Partid 6 (which is in 2048 byte sectors)
+Set CONFIG_ENV_OFFSET to the byte start address of ENV, take the sector address of Partid 6 (which is in 2048 byte sectors)
LNX: colibri_t20.h
Set the u-boot environment SDBOOTCMD below, mmc read RAMloadaddr, 512byte sector start, 512byte copy length.
@@ -86,8 +86,11 @@ sector start address 6784 * 2048 -> 27137 * 512 -> GPT start sector is 27137.
#if defined(CONFIG_ENV_IS_IN_MMC)
#define CONFIG_SYS_MMC_ENV_DEV 0 /* use MMC0, slot on eval board and Iris */
-/* once the eMMC is detected the corresponding setting is taken */
-#define CONFIG_ENV_MMC_OFFSET (gd->env_offset * 512)
+#ifdef CONFIG_ENV_OFFSET
+#undef CONFIG_ENV_OFFSET
+#endif
+/* once the SD card is detected the corresponding setting is taken */
+#define CONFIG_ENV_OFFSET (gd->env_offset * 512)
#endif
#endif /* __CONFIG_H */