From: Stefano Babic Date: Tue, 19 Oct 2010 14:25:15 +0200 Subject: [U-Boot] [PATCH V2] MX51: fix mx51evk board, add environment to MMC In-Reply-To: <1287490415-24200-1-git-send-email-sbabic@denx.de> References: <1287490415-24200-1-git-send-email-sbabic@denx.de> Message-ID: <1287491115-6312-1-git-send-email-sbabic@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The patch fixes the compilation of the mx51evk board with the actual u-boot release and stores the environment into the MMC card. Signed-off-by: Stefano Babic --- Changes since V1: - Dead code not removed board/freescale/mx51evk/mx51evk.c | 20 ++++++++++++++++---- include/configs/mx51evk.h | 27 +++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index c8d7d39..d6bb71c 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -52,9 +52,14 @@ u32 get_board_rev(void) int dram_init(void) { +#ifdef CONFIG_SYS_ARM_WITHOUT_RELOC gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE); +#else + gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, + PHYS_SDRAM_1_SIZE); +#endif return 0; } @@ -399,16 +404,25 @@ int board_mmc_init(bd_t *bis) } #endif +int board_early_init_f(void) +{ + setup_iomux_uart(); + setup_iomux_fec(); + + return 0; +} + int board_init(void) { system_rev = get_cpu_rev(); +#ifdef CONFIG_SYS_ARM_WITHOUT_RELOC + board_early_init_f(); +#endif gd->bd->bi_arch_number = MACH_TYPE_MX51_BABBAGE; /* address of boot parameters */ gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; - setup_iomux_uart(); - setup_iomux_fec(); return 0; } @@ -416,10 +430,8 @@ int board_init(void) #ifdef BOARD_LATE_INIT int board_late_init(void) { -#ifdef CONFIG_MXC_SPI setup_iomux_spi(); power_init(); -#endif return 0; } #endif diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h index 6165473..291404c 100644 --- a/include/configs/mx51evk.h +++ b/include/configs/mx51evk.h @@ -28,7 +28,6 @@ /* High Level Configuration Options */ #define CONFIG_MX51 /* in a mx51 */ -#define CONFIG_SKIP_RELOCATE_UBOOT #define CONFIG_SYS_MX5_HCLK 24000000 #define CONFIG_SYS_MX5_CLK32 32768 @@ -55,6 +54,7 @@ #define CONFIG_SYS_GBL_DATA_SIZE 128 #define BOARD_LATE_INIT +#define CONFIG_BOARD_EARLY_INIT_F /* * Hardware drivers @@ -178,13 +178,32 @@ #define CONFIG_SYS_DDR_CLKSEL 0 #define CONFIG_SYS_CLKTL_CBCDR 0x59E35100 +#define CONFIG_SYS_SDRAM_BASE 0x90000000 +#define CONFIG_SYS_INIT_RAM_ADDR 0x1FFE8000 + +#ifndef CONFIG_SYS_ARM_WITHOUT_RELOC +#define CONFIG_SYS_INIT_RAM_END (64 * 1024) +#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - \ + CONFIG_SYS_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ + CONFIG_SYS_GBL_DATA_OFFSET) +#undef CONFIG_SKIP_RELOCATE_UBOOT +#else +#define CONFIG_SKIP_RELOCATE_UBOOT +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + 0x2000) +#endif + + /*----------------------------------------------------------------------- * FLASH and environment organization */ #define CONFIG_SYS_NO_FLASH -#define CONFIG_ENV_SECT_SIZE (128 * 1024) -#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE -#define CONFIG_ENV_IS_NOWHERE +#define CONFIG_ENV_OFFSET (6 * 64 * 1024) +#define CONFIG_ENV_SECT_SIZE (1 * 64 * 1024) +#define CONFIG_ENV_SIZE (4 * 1024) + +#define CONFIG_ENV_IS_IN_MMC +#define CONFIG_SYS_MMC_ENV_DEV 0 #endif -- 1.7.1