diff options
author | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2013-05-01 17:56:12 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2013-05-01 17:56:12 +0200 |
commit | e1eacdf689663818d698c48d5b441a20538263d4 (patch) | |
tree | f5a5ce012e46895e95bc7edb1680b49e7b10448a /arch | |
parent | 4fefbc020aa3239b3fe030662e54d5a96d4b7e16 (diff) |
colibri_t20/30: mmc: integrate NVIDIA partition table parsing
NVIDIA's MMC/SD layout includes a partition table that can be used to
generically determine U-Boot environment, kernel, configuration block
as well as GPT offsets. As an added benefit this is completely
independent of the underlying MMC/SD card used which might differ with
various future module versions or particularly cards used for T20 SD
boot. Also handles the case of T20 SD boot where the configuration
block is still taken from NAND flash while the rest resides on the SD
card.
Initial partition table parsing courtesy of Mitja Špes from LXNAV.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/arch-tegra/tegra.h | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/global_data.h | 7 | ||||
-rw-r--r-- | arch/arm/lib/board.c | 22 |
3 files changed, 21 insertions, 9 deletions
diff --git a/arch/arm/include/asm/arch-tegra/tegra.h b/arch/arm/include/asm/arch-tegra/tegra.h index db00ebf167d..73cd230e119 100644 --- a/arch/arm/include/asm/arch-tegra/tegra.h +++ b/arch/arm/include/asm/arch-tegra/tegra.h @@ -80,7 +80,6 @@ struct timerus { #define NVBOOTINFOTABLE_BCTSIZE 0x38 /* BCT size in BIT in IRAM */ #define NVBOOTINFOTABLE_BCTPTR 0x3C /* BCT pointer in BIT in IRAM */ -#define BCT_PTINFO_OFFSET 3820 /* These are the available SKUs (product types) for Tegra */ enum { diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index 97cfbf67c63..87c6761326d 100644 --- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -80,10 +80,13 @@ typedef struct global_data { void **jt; /* jump table */ char env_buf[32]; /* buffer for getenv() before reloc. */ #if defined(CONFIG_COLIBRI_T20) || defined(CONFIG_COLIBRI_T30) - unsigned env_offset; /* offset to U-Boot environment */ unsigned conf_blk_offset; /* offset to Toradex config block */ - unsigned kernel_offset; /* offset to kernel in mass storage */ + unsigned env_offset; /* offset to U-Boot environment */ +#if (defined(CONFIG_ENV_IS_IN_MMC) && defined(CONFIG_COLIBRI_T20)) || defined(CONFIG_COLIBRI_T30) + unsigned gpt_offset; /* offset to GPT in mass storage */ #endif + unsigned kernel_offset; /* offset to kernel in mass storage */ +#endif /* CONFIG_COLIBRI_T20 | CONFIG_COLIBRI_T30 */ } gd_t; /* diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index c6a12463e03..43b3733087b 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -87,8 +87,8 @@ extern void rtl8019_get_enetaddr (uchar * addr); #include <i2c.h> #endif -#ifdef CONFIG_COLIBRI_T20 -extern void tegra_partition_init(void); +#if defined(CONFIG_COLIBRI_T20) || defined(CONFIG_COLIBRI_T30) +extern void tegra_partition_init(int boot_type); #endif @@ -598,15 +598,25 @@ void board_init_r (gd_t *id, ulong dest_addr) onenand_init(); #endif -#ifdef CONFIG_COLIBRI_T20 - tegra_partition_init(); -#endif - #ifdef CONFIG_GENERIC_MMC puts("MMC: "); mmc_initialize(bd); #endif +#if defined(CONFIG_COLIBRI_T20) || defined(CONFIG_COLIBRI_T30) + tegra_partition_init( +#ifdef CONFIG_COLIBRI_T20 +#ifndef CONFIG_ENV_IS_IN_MMC + 0 +#else /* !CONFIG_ENV_IS_IN_MMC */ + 1 +#endif /* !CONFIG_ENV_IS_IN_MMC */ +#else /* CONFIG_COLIBRI_T20 */ + 2 +#endif /* CONFIG_COLIBRI_T20 */ + ); +#endif /* CONFIG_COLIBRI_T20 | CONFIG_COLIBRI_T30 */ + #ifdef CONFIG_HAS_DATAFLASH AT91F_DataflashInit(); dataflash_print_info(); |