summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2014-03-12 14:28:19 +0100
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2014-03-12 14:28:19 +0100
commit7b6d69722c0b3ccc25df1eaffa7c1c3052223e00 (patch)
tree120b2d610249a743fcfb169115dda91f6b416b0a
parent779aa107451ec3f66939a42b1c9b8667527d4fff (diff)
apalis/colibri_t20/30: hw boot partition support
The new production lot of Apalis T30 2GB V1.0C now features the new SK Hynix H26M42003GMR rather than Hynix H26M42002GMR. Even though both chips feature the same silicon they differ in respective eMMC firmware and therefore have a different hardware boot partition layout. This patch enables hardware boot partition support (via 'mmc dev [dev] [part]' command) and handles NVIDIA's proprietary NvFlash/Fastboot\ behaviour now putting their partition table in the second boot partition rather than the regular user area. While at it also get rid of the spurious 'video=tegrafb' kernel boot argument, adjust the optional ubiargs and add 'noatime' to the usbargs.
-rw-r--r--board/toradex/common/tegra2_partitions.c24
-rw-r--r--common/cmd_mmc.c5
-rw-r--r--include/configs/apalis_t30.h8
-rw-r--r--include/configs/colibri_t20.h16
-rw-r--r--include/configs/colibri_t30.h8
5 files changed, 43 insertions, 18 deletions
diff --git a/board/toradex/common/tegra2_partitions.c b/board/toradex/common/tegra2_partitions.c
index 77308d165d8..7f69e4b72e3 100644
--- a/board/toradex/common/tegra2_partitions.c
+++ b/board/toradex/common/tegra2_partitions.c
@@ -244,13 +244,25 @@ int nvtegra_read_partition_table(nvtegra_parttable_t * pt, int boot_media)
offset from the start of the user region the size of the
boot regions must be subtracted. */
struct mmc *mmc = find_mmc_device(EMMC_DEV);
- if (mmc && !mmc_init(mmc) && (get_boot_size_mult(mmc) == 16))
- pt_logical -= 0x5000; //why?
-#endif
+ u32 boot_size_mult = 0;
+ if (mmc && !mmc_init(mmc)) {
+ boot_size_mult = get_boot_size_mult(mmc);
+ if (boot_size_mult == 16)
+ pt_logical -= 0x5000; //why?
+ }
/* StartLogicalSector / LogicalBlockSize * PhysicalBlockSize +
BootPartitions */
- pt_offset = pt_logical / block_size * 512 + 1024 * 1024;
+ if (boot_size_mult == 32) {
+#if DEBUG > 1
+ printf("switch to second boot partition for PT access\n");
+#endif
+ mmc_switch_part(0, 2);
+ pt_offset = 0;
+ } else
+#endif /* (CONFIG_ENV_IS_IN_MMC && CONFIG_COLIBRI_T20) || CONFIG_COLIBRI_T30 ||
+ CONFIG_APALIS_T30 */
+ pt_offset = pt_logical / block_size * 512 + 1024 * 1024;
}
#if DEBUG > 1
printf("physical=0x%08x\n", pt_offset);
@@ -279,8 +291,12 @@ int nvtegra_read_partition_table(nvtegra_parttable_t * pt, int boot_media)
if (!size || size != sizeof(nvtegra_parttable_t)) {
printf("%s: Error! mmc block read failed. Read=%d\n",
__FUNCTION__, size);
+ /* make sure we are back at the user partition */
+ mmc_switch_part(0, 0);
return 0;
}
+ /* make sure we are back at the user partition */
+ mmc_switch_part(0, 0);
}
#endif /* (CONFIG_ENV_IS_IN_MMC & CONFIG_COLIBRI_T20) | CONFIG_COLIBRI_T30 |
CONFIG_APALIS_T30 */
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 5df66e431d4..22f207f6480 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -160,6 +160,11 @@ int initialize_mmc_device(int dev_num)
}
}
+int do_mmcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+ return initialize_mmc_device(0);
+}
+
U_BOOT_CMD(
mmcinfo, 1, 0, do_mmcinfo,
"display MMC info",
diff --git a/include/configs/apalis_t30.h b/include/configs/apalis_t30.h
index e9f43ceddc0..e17a461e03a 100644
--- a/include/configs/apalis_t30.h
+++ b/include/configs/apalis_t30.h
@@ -78,9 +78,9 @@
#define EMMC_BOOTCMD \
"run setup; " \
"setenv bootargs ${defargs} ${mmcargs} ${setupargs} " \
- "${vidargs};" \
+ "${vidargs}; " \
"echo Booting from internal eMMC chip...; " \
- "mmc read 0 ${loadaddr} ${lnxoffset} ${mmc_kernel_size} && bootm"
+ "mmc read ${loadaddr} ${lnxoffset} ${mmc_kernel_size} && bootm"
#define NFS_BOOTCMD \
"run setup; " \
@@ -107,7 +107,7 @@
#define CONFIG_LOADADDR 0x80408000
#define CONFIG_EXTRA_ENV_SETTINGS \
CONFIG_STD_DEVICES_SETTINGS \
- "defargs=video=tegrafb core_edp_mv=1300 usb_high_speed=1\0" \
+ "defargs=core_edp_mv=1300 usb_high_speed=1\0" \
"emmcboot=" EMMC_BOOTCMD "\0" \
"mmcargs=ip=off root=/dev/mmcblk0p1 rw,noatime rootfstype=ext3 " \
"rootwait\0" \
@@ -117,7 +117,7 @@
"igb_mac=${ethaddr} no_console_suspend=1 console=tty1 " \
"console=ttyS0,${baudrate}n8 debug_uartport=lsport,0 " \
"${memargs} fbcon=map:1\0" \
- "usbargs=root=/dev/sda2 rw rootwait\0" \
+ "usbargs=root=/dev/sda2 rw,noatime rootwait\0" \
"usbboot=" USB_BOOTCMD "\0" \
"vidargs=video=tegrafb0:640x480-16@60\0" \
""
diff --git a/include/configs/colibri_t20.h b/include/configs/colibri_t20.h
index 59b7f9673b4..8c8b9d43dd2 100644
--- a/include/configs/colibri_t20.h
+++ b/include/configs/colibri_t20.h
@@ -45,7 +45,11 @@
#define CONFIG_SYS_NAND_BASE_LIST {}
//#define USB_KBD_DEBUG
-#define CONFIG_USB_KEYBOARD
+//#define CONFIG_USB_KEYBOARD
+#ifdef CONFIG_USB_KEYBOARD
+#define CONFIG_SYS_USB_EVENT_POLL
+#define CONFIG_PREBOOT "usb start"
+#endif /* CONFIG_USB_KEYBOARD */
#define CONFIG_CONSOLE_MUX
#define CONFIG_SYS_CONSOLE_IS_IN_ENV
@@ -108,7 +112,7 @@
"setenv bootargs ${defargs} ${mtdparts} ${nfsargs} " \
"${setupargs} ${vidargs}; " \
"echo Booting via DHCP/TFTP/NFS...; " \
- "usb start; && dhcp && bootm"
+ "usb start && dhcp && bootm"
#define UBI_BOOTCMD \
"run setup; " \
@@ -135,7 +139,7 @@
"setenv bootargs ${defargs} ${mtdparts} ${sdargs} " \
"${setupargs} ${vidargs}; " \
"echo Booting from MMC/SD card...; " \
- "mmc read 0 ${loadaddr} ${lnxoffset} ${sd_kernel_size} && bootm"
+ "mmc read ${loadaddr} ${lnxoffset} ${sd_kernel_size} && bootm"
#define SD_BOOT_ARGS \
"sdargs=root=/dev/mmcblk0p1 ip=off rw,noatime " \
@@ -162,7 +166,7 @@
#define CONFIG_EXTRA_ENV_SETTINGS \
CONFIG_STD_DEVICES_SETTINGS \
- "defargs=video=tegrafb vmalloc=128M usb_high_speed=1\0" \
+ "defargs=vmalloc=128M usb_high_speed=1\0" \
"flashargs=ip=off root=/dev/mtdblock0 rw rootfstype=yaffs2\0" \
"flashboot=" FLASH_BOOTCMD "\0" \
"nfsargs=ip=:::::eth0:on root=/dev/nfs rw netdevwait\0" \
@@ -172,9 +176,9 @@
"asix_mac=${ethaddr} no_console_suspend=1 console=tty1 " \
"console=ttyS0,${baudrate}n8 debug_uartport=lsport,0 " \
"${memargs}\0" \
- "ubiargs=ubi.mtd=7 root=ubi0:rootfs rootfstype=ubifs\0" \
+ "ubiargs=ip=off ubi.mtd=7 root=ubi0:rootfs rw rootfstype=ubifs\0" \
"ubiboot=" UBI_BOOTCMD "\0" \
- "usbargs=root=/dev/sda2 rw rootwait\0" \
+ "usbargs=root=/dev/sda2 rw,noatime rootwait\0" \
"usbboot=" USB_BOOTCMD "\0" \
"vidargs=video=tegrafb0:640x480-16@60\0" \
""
diff --git a/include/configs/colibri_t30.h b/include/configs/colibri_t30.h
index cfedd42a1c7..8115357c062 100644
--- a/include/configs/colibri_t30.h
+++ b/include/configs/colibri_t30.h
@@ -78,9 +78,9 @@
#define EMMC_BOOTCMD \
"run setup; " \
"setenv bootargs ${defargs} ${mmcargs} ${setupargs} " \
- "${vidargs};" \
+ "${vidargs}; " \
"echo Booting from internal eMMC chip...; " \
- "mmc read 0 ${loadaddr} ${lnxoffset} ${mmc_kernel_size} && bootm"
+ "mmc read ${loadaddr} ${lnxoffset} ${mmc_kernel_size} && bootm"
#define NFS_BOOTCMD \
"run setup; " \
@@ -107,7 +107,7 @@
#define CONFIG_LOADADDR 0x80408000
#define CONFIG_EXTRA_ENV_SETTINGS \
CONFIG_STD_DEVICES_SETTINGS \
- "defargs=video=tegrafb core_edp_mv=1300 usb_high_speed=1\0" \
+ "defargs=core_edp_mv=1300 usb_high_speed=1\0" \
"emmcboot=" EMMC_BOOTCMD "\0" \
"mmcargs=ip=off root=/dev/mmcblk0p1 rw,noatime rootfstype=ext3 " \
"rootwait\0" \
@@ -117,7 +117,7 @@
"asix_mac=${ethaddr} no_console_suspend=1 console=tty1 " \
"console=ttyS0,${baudrate}n8 debug_uartport=lsport,0 " \
"${memargs}\0" \
- "usbargs=root=/dev/sda2 rw rootwait\0" \
+ "usbargs=root=/dev/sda2 rw,noatime rootwait\0" \
"usbboot=" USB_BOOTCMD "\0" \
"vidargs=video=tegrafb0:640x480-16@60\0" \
""