summaryrefslogtreecommitdiff
path: root/board
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 /board
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.
Diffstat (limited to 'board')
-rw-r--r--board/toradex/common/tegra2_partitions.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/board/toradex/common/tegra2_partitions.c b/board/toradex/common/tegra2_partitions.c
index 77308d165d..7f69e4b72e 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 */