diff options
author | John Rigby <john.rigby@linaro.org> | 2011-03-07 12:51:09 -0700 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2011-03-07 12:51:09 -0700 |
commit | 00b399617b948b4e3171e649cf5ed533530e5a6f (patch) | |
tree | 7ac4c8980d4d8ad6aa76b14e03d5cafb25d45952 | |
parent | 0c859d7326ab4d9534d29119011259b5439f8534 (diff) | |
parent | a0ac939c6d7c99812829e8c5d082f95bc8c17dd5 (diff) |
Merge remote branch 'u-boot-pxa/efikasb' into linaro-stable-next
-rw-r--r-- | board/efikamx/config.mk | 2 | ||||
-rw-r--r-- | board/efikamx/efikamx.c | 60 | ||||
-rw-r--r-- | board/efikamx/imximage_mx.cfg (renamed from board/efikamx/imximage.cfg) | 0 | ||||
-rw-r--r-- | board/efikamx/imximage_sb.cfg | 122 | ||||
-rw-r--r-- | boards.cfg | 3 | ||||
-rw-r--r-- | include/configs/efikamx.h | 1 |
6 files changed, 181 insertions, 7 deletions
diff --git a/board/efikamx/config.mk b/board/efikamx/config.mk index 6e90671d0..20e2a618c 100644 --- a/board/efikamx/config.mk +++ b/board/efikamx/config.mk @@ -21,5 +21,5 @@ # CONFIG_SYS_TEXT_BASE = 0x97800000 -IMX_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/imximage.cfg +IMX_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/imximage_$(CONFIG_IMX_IMAGE_TYPE).cfg ALL += $(obj)u-boot.imx diff --git a/board/efikamx/efikamx.c b/board/efikamx/efikamx.c index f7352608b..492f111cb 100644 --- a/board/efikamx/efikamx.c +++ b/board/efikamx/efikamx.c @@ -46,6 +46,19 @@ DECLARE_GLOBAL_DATA_PTR; #error "CONFIG_MXC_SPI not set, this is essential for board's operation!" #endif +#if !defined(CONFIG_MACH_EFIKAMX) && !defined(CONFIG_MACH_EFIKASB) +#error "Missing CONFIG_MACH_EFIKAMX or CONFIG_MACH_EFIKASB in config.h!" +#endif + +/* + * Pin definition + */ +#ifdef CONFIG_MACH_EFIKAMX +#define EFIKA_SD1_CD MX51_PIN_GPIO1_0 +#else +#define EFIKA_SD1_CD MX51_PIN_EIM_CS2 +#endif + /* * Shared variables / local defines */ @@ -65,6 +78,7 @@ void efikamx_toggle_led(uint32_t mask); /* * Board identification */ +#ifdef CONFIG_MACH_EFIKAMX u32 get_efika_rev(void) { u32 rev = 0; @@ -101,6 +115,12 @@ u32 get_efika_rev(void) return (~rev & 0x7) + 1; } +#else +inline u32 get_efika_rev(void) +{ + return 0; +} +#endif u32 get_board_rev(void) { @@ -282,7 +302,7 @@ int board_mmc_getcd(u8 *absent, struct mmc *mmc) struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR) - *absent = mxc_gpio_get(IOMUX_TO_GPIO(MX51_PIN_GPIO1_0)); + *absent = mxc_gpio_get(IOMUX_TO_GPIO(EFIKA_SD1_CD)); else *absent = mxc_gpio_get(IOMUX_TO_GPIO(MX51_PIN_GPIO1_8)); @@ -293,9 +313,9 @@ int board_mmc_init(bd_t *bis) int ret; /* SDHC1 is used on all revisions, setup control pins first */ - mxc_request_iomux(MX51_PIN_GPIO1_0, + mxc_request_iomux(EFIKA_SD1_CD, IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION); - mxc_iomux_set_pad(MX51_PIN_GPIO1_0, + mxc_iomux_set_pad(EFIKA_SD1_CD, PAD_CTL_DRV_HIGH | PAD_CTL_HYS_ENABLE | PAD_CTL_PUE_KEEPER | PAD_CTL_100K_PU | PAD_CTL_ODE_OPENDRAIN_NONE | @@ -307,13 +327,15 @@ int board_mmc_init(bd_t *bis) PAD_CTL_100K_PU | PAD_CTL_ODE_OPENDRAIN_NONE | PAD_CTL_SRE_FAST); - mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_GPIO1_0), + mxc_gpio_direction(IOMUX_TO_GPIO(EFIKA_SD1_CD), MXC_GPIO_DIRECTION_IN); mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_GPIO1_1), MXC_GPIO_DIRECTION_IN); +#ifndef CONFIG_MACH_EFIKASB /* Internal SDHC1 IOMUX + SDHC2 IOMUX on old boards */ - if (get_efika_rev() < EFIKAMX_BOARD_REV_12) { + if ((get_efika_rev() < EFIKAMX_BOARD_REV_12)) { +#endif /* SDHC1 IOMUX */ mxc_request_iomux(MX51_PIN_SD1_CMD, IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION); @@ -397,6 +419,7 @@ int board_mmc_init(bd_t *bis) ret = fsl_esdhc_initialize(bis, &esdhc_cfg[0]); if (!ret) ret = fsl_esdhc_initialize(bis, &esdhc_cfg[1]); +#ifndef CONFIG_MACH_EFIKASB } else { /* New boards use only SDHC1 */ /* SDHC1 IOMUX */ mxc_request_iomux(MX51_PIN_SD1_CMD, @@ -427,6 +450,7 @@ int board_mmc_init(bd_t *bis) ret = fsl_esdhc_initialize(bis, &esdhc_cfg[0]); } +#endif return ret; } #endif @@ -504,6 +528,7 @@ static inline void setup_iomux_ata(void) { } /* * LED configuration */ +#if defined(CONFIG_MACH_EFIKAMX) void setup_iomux_led(void) { /* Blue LED */ @@ -529,6 +554,27 @@ void efikamx_toggle_led(uint32_t mask) mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC), mask & EFIKAMX_LED_RED); } +#else +void setup_iomux_led(void) +{ + /* CAPS-LOCK LED */ + mxc_request_iomux(MX51_PIN_EIM_CS0, IOMUX_CONFIG_GPIO); + mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_EIM_CS0), + MXC_GPIO_DIRECTION_OUT); + /* ALARM-LED LED */ + mxc_request_iomux(MX51_PIN_GPIO1_3, IOMUX_CONFIG_GPIO); + mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_GPIO1_3), + MXC_GPIO_DIRECTION_OUT); +} + +void efikamx_toggle_led(uint32_t mask) +{ + mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_EIM_CS0), + mask & EFIKAMX_LED_BLUE); + mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_GPIO1_3), + !(mask & EFIKAMX_LED_GREEN)); +} +#endif /* * Board initialization @@ -621,7 +667,11 @@ int board_early_init_f(void) int board_init(void) { +#ifdef CONFIG_MACH_EFIKAMX gd->bd->bi_arch_number = MACH_TYPE_MX51_EFIKAMX; +#else + gd->bd->bi_arch_number = MACH_TYPE_MX51_EFIKASB; +#endif gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; return 0; diff --git a/board/efikamx/imximage.cfg b/board/efikamx/imximage_mx.cfg index 6fe0ff9ac..6fe0ff9ac 100644 --- a/board/efikamx/imximage.cfg +++ b/board/efikamx/imximage_mx.cfg diff --git a/board/efikamx/imximage_sb.cfg b/board/efikamx/imximage_sb.cfg new file mode 100644 index 000000000..878146f44 --- /dev/null +++ b/board/efikamx/imximage_sb.cfg @@ -0,0 +1,122 @@ +# +# Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com> +# +# BASED ON: imx51evk +# +# (C) Copyright 2009 +# Stefano Babic DENX Software Engineering sbabic@denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not write to the Free Software +# Foundation Inc. 51 Franklin Street Fifth Floor Boston, +# MA 02110-1301 USA +# +# Refer docs/README.imxmage for more details about how-to configure +# and create imximage boot image +# +# The syntax is taken as close as possible with the kwbimage + +# Boot Device : one of +# spi, sd (the board has no nand neither onenand) +BOOT_FROM spi + +# Device Configuration Data (DCD) +# +# Each entry must have the format: +# Addr-type Address Value +# +# where: +# Addr-type register length (1,2 or 4 bytes) +# Address absolute address of the register +# value value to be stored in the register + +# Setting IOMUXC +DATA 4 0x73fa88a0 0x200 +DATA 4 0x73fa850c 0x20c3 +DATA 4 0x73fa8510 0x20c3 +DATA 4 0x73fa883c 0x2 +DATA 4 0x73fa8848 0x2 +DATA 4 0x73fa84b8 0xe7 +DATA 4 0x73fa84bc 0x45 +DATA 4 0x73fa84c0 0x45 +DATA 4 0x73fa84c4 0x45 +DATA 4 0x73fa84c8 0x45 +DATA 4 0x73fa8820 0x0 +DATA 4 0x73fa84a4 0x5 +DATA 4 0x73fa84a8 0x5 +DATA 4 0x73fa84ac 0xe3 +DATA 4 0x73fa84b0 0xe3 +DATA 4 0x73fa84b4 0xe3 +DATA 4 0x73fa84cc 0xe3 +DATA 4 0x73fa84d0 0xe2 + +DATA 4 0x73fa882c 0x4 +DATA 4 0x73fa88a4 0x4 +DATA 4 0x73fa88ac 0x4 +DATA 4 0x73fa88b8 0x4 + +# Setting DDR for micron +# 13 Rows, 10 Cols, 32 bit, SREF=4 Micron Model +# CAS=3 BL=4 +# ESDCTL_ESDCTL0 +DATA 4 0x83fd9000 0x82a20000 +# ESDCTL_ESDCTL1 +DATA 4 0x83fd9008 0x82a20000 +# ESDCTL_ESDMISC +DATA 4 0x83fd9010 0xcaaaf6d0 +# ESDCTL_ESDCFG0 +DATA 4 0x83fd9004 0x333574aa +# ESDCTL_ESDCFG1 +DATA 4 0x83fd900c 0x333574aa + +# Init DRAM on CS0 +# ESDCTL_ESDSCR +DATA 4 0x83fd9014 0x04008008 +DATA 4 0x83fd9014 0x0000801a +DATA 4 0x83fd9014 0x0000801b +DATA 4 0x83fd9014 0x00448019 +DATA 4 0x83fd9014 0x07328018 +DATA 4 0x83fd9014 0x04008008 +DATA 4 0x83fd9014 0x00008010 +DATA 4 0x83fd9014 0x00008010 +DATA 4 0x83fd9014 0x06328018 +DATA 4 0x83fd9014 0x03808019 +DATA 4 0x83fd9014 0x00408019 +DATA 4 0x83fd9014 0x00008000 + +# Init DRAM on CS1 +DATA 4 0x83fd9014 0x0400800c +DATA 4 0x83fd9014 0x0000801e +DATA 4 0x83fd9014 0x0000801f +DATA 4 0x83fd9014 0x0000801d +DATA 4 0x83fd9014 0x0732801c +DATA 4 0x83fd9014 0x0400800c +DATA 4 0x83fd9014 0x00008014 +DATA 4 0x83fd9014 0x00008014 +DATA 4 0x83fd9014 0x0632801c +DATA 4 0x83fd9014 0x0380801d +DATA 4 0x83fd9014 0x0040801d +DATA 4 0x83fd9014 0x00008004 + +# Write to CTL0 +DATA 4 0x83fd9000 0xb2a20000 +# Write to CTL1 +DATA 4 0x83fd9008 0xb2a20000 +# ESDMISC +DATA 4 0x83fd9010 0xcaaaf6d0 +#ESDCTL_ESDCDLYGD +DATA 4 0x83fd9034 0x90000000 +DATA 4 0x83fd9014 0x00000000 diff --git a/boards.cfg b/boards.cfg index 45c3102b0..6e7180623 100644 --- a/boards.cfg +++ b/boards.cfg @@ -107,7 +107,8 @@ omap5912osk arm arm926ejs - ti edminiv2 arm arm926ejs - LaCie orion5x dkb arm arm926ejs - Marvell pantheon ca9x4_ct_vxp arm armv7 vexpress armltd -efikamx arm armv7 efikamx - mx5 +efikamx arm armv7 efikamx - mx5 efikamx:MACH_EFIKAMX,IMX_IMAGE_TYPE=mx +efikasb arm armv7 efikamx - mx5 efikamx:MACH_EFIKASB,IMX_IMAGE_TYPE=sb mx51evk arm armv7 mx51evk freescale mx5 mx53evk arm armv7 mx53evk freescale mx5 vision2 arm armv7 vision2 ttcontrol mx5 diff --git a/include/configs/efikamx.h b/include/configs/efikamx.h index 1424347aa..a54e75e2e 100644 --- a/include/configs/efikamx.h +++ b/include/configs/efikamx.h @@ -47,6 +47,7 @@ #define CONFIG_CMD_SF #define CONFIG_CMD_MMC #define CONFIG_CMD_FAT +#define CONFIG_CMD_EXT2 #define CONFIG_CMD_IDE #undef CONFIG_CMD_IMLS |