diff options
| author | Sven Schnelle <svens@stackframe.org> | 2011-10-21 14:49:25 +0200 | 
|---|---|---|
| committer | Andreas Bießmann <andreas@localhost> | 2012-03-13 12:06:41 +0100 | 
| commit | 72fa467988e7944407a634ddc4bc6a2df685c04c (patch) | |
| tree | fa5fc3ddf5337aaabbfbe0ae1c2ff567d536be6d | |
| parent | 6751b05f855bbe56005d5b88d4eb58bcd52170d2 (diff) | |
| download | olio-uboot-2014.01-72fa467988e7944407a634ddc4bc6a2df685c04c.tar.xz olio-uboot-2014.01-72fa467988e7944407a634ddc4bc6a2df685c04c.zip | |
ATMEL: use generic mmc framework
gen_atmel_mci works on AVR32 as well, so no need to use the legacy
mmc driver. This also has the nice side effect of being able to use
SDHC cards an those boards.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
| -rw-r--r-- | arch/avr32/lib/board.c | 15 | ||||
| -rw-r--r-- | include/atmel_mci.h (renamed from drivers/mmc/atmel_mci.h) | 8 | ||||
| -rw-r--r-- | include/configs/atngw100.h | 4 | ||||
| -rw-r--r-- | include/configs/atstk1002.h | 4 | ||||
| -rw-r--r-- | include/configs/atstk1003.h | 6 | ||||
| -rw-r--r-- | include/configs/atstk1004.h | 6 | ||||
| -rw-r--r-- | include/configs/atstk1006.h | 4 | ||||
| -rw-r--r-- | include/configs/favr-32-ezkit.h | 4 | ||||
| -rw-r--r-- | include/configs/hammerhead.h | 4 | ||||
| -rw-r--r-- | include/configs/mimc200.h | 4 | ||||
| -rw-r--r-- | include/mmc.h | 1 | 
11 files changed, 46 insertions, 14 deletions
| diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index 63fe2979e..e110d234e 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -25,6 +25,7 @@  #include <stdio_dev.h>  #include <version.h>  #include <net.h> +#include <atmel_mci.h>  #ifdef CONFIG_BITBANGMII  #include <miiphy.h> @@ -32,11 +33,15 @@  #include <asm/sections.h>  #include <asm/arch/mmu.h> +#include <asm/arch/hardware.h>  #ifndef CONFIG_IDENT_STRING  #define CONFIG_IDENT_STRING ""  #endif +#ifdef CONFIG_ATMEL_MCI +#include <mmc.h> +#endif  DECLARE_GLOBAL_DATA_PTR;  unsigned long monitor_flash_len; @@ -49,6 +54,13 @@ static int __do_nothing(void)  int board_postclk_init(void) __attribute__((weak, alias("__do_nothing")));  int board_early_init_r(void) __attribute__((weak, alias("__do_nothing"))); +/* provide cpu_mmc_init, to overwrite provide board_mmc_init */ +int cpu_mmc_init(bd_t *bd) +{ +	/* This calls the atmel_mci_init in gen_atmel_mci.c */ +	return atmel_mci_init((void *)ATMEL_BASE_MMCI); +} +  #ifdef CONFIG_SYS_DMA_ALLOC_LEN  #include <asm/arch/cacheflush.h>  #include <asm/io.h> @@ -324,6 +336,9 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)  	eth_initialize(gd->bd);  #endif +#ifdef CONFIG_GENERIC_ATMEL_MCI +	mmc_initialize(gd->bd); +#endif  	for (;;) {  		main_loop();  	} diff --git a/drivers/mmc/atmel_mci.h b/include/atmel_mci.h index 90ab6a8a6..0158f972a 100644 --- a/drivers/mmc/atmel_mci.h +++ b/include/atmel_mci.h @@ -19,8 +19,10 @@   * Foundation, Inc., 59 Temple Place, Suite 330, Boston,   * MA 02111-1307 USA   */ -#ifndef __CPU_AT32AP_ATMEL_MCI_H__ -#define __CPU_AT32AP_ATMEL_MCI_H__ +#ifndef __ATMEL_MCI_H__ +#define __ATMEL_MCI_H__ + +int atmel_mci_init(void *regs);  #ifndef __ASSEMBLY__ @@ -242,4 +244,4 @@ typedef struct atmel_mci {  #define mmci_writel(reg,value)				\  	writel((value), (void *)ATMEL_BASE_MMCI + MMCI_##reg) -#endif /* __CPU_AT32AP_ATMEL_MCI_H__ */ +#endif /* __ATMEL_MCI_H__ */ diff --git a/include/configs/atngw100.h b/include/configs/atngw100.h index 8f9ed2389..5e3155dff 100644 --- a/include/configs/atngw100.h +++ b/include/configs/atngw100.h @@ -128,7 +128,9 @@  #define CONFIG_SYS_NR_PIOS			5  #define CONFIG_SYS_HSDRAMC  #define CONFIG_MMC -#define CONFIG_ATMEL_MCI +#define CONFIG_GENERIC_ATMEL_MCI +#define CONFIG_GENERIC_MMC +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 1  #define CONFIG_ATMEL_SPI  #define CONFIG_SPI_FLASH diff --git a/include/configs/atstk1002.h b/include/configs/atstk1002.h index 44ce24296..bb426f1ed 100644 --- a/include/configs/atstk1002.h +++ b/include/configs/atstk1002.h @@ -151,7 +151,9 @@  #define CONFIG_SYS_NR_PIOS			5  #define CONFIG_SYS_HSDRAMC  #define CONFIG_MMC -#define CONFIG_ATMEL_MCI +#define CONFIG_GENERIC_ATMEL_MCI +#define CONFIG_GENERIC_MMC +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 1  #define CONFIG_SYS_DCACHE_LINESZ		32  #define CONFIG_SYS_ICACHE_LINESZ		32 diff --git a/include/configs/atstk1003.h b/include/configs/atstk1003.h index c5e357f6d..817d94373 100644 --- a/include/configs/atstk1003.h +++ b/include/configs/atstk1003.h @@ -100,7 +100,7 @@  	"console=ttyS0 root=/dev/mmcblk0p1 rootwait"  #define CONFIG_BOOTCOMMAND						\ -	"mmcinit; ext2load mmc 0:1 0x10400000 /boot/uImage; bootm" +	"mmc rescan; ext2load mmc 0:1 0x10400000 /boot/uImage; bootm"  /*   * Only interrupt autoboot if <space> is pressed. Otherwise, garbage @@ -135,7 +135,9 @@  #define CONFIG_PORTMUX_PIO  #define CONFIG_SYS_HSDRAMC  #define CONFIG_MMC -#define CONFIG_ATMEL_MCI +#define CONFIG_GENERIC_ATMEL_MCI +#define CONFIG_GENERIC_MMC +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 1  #define CONFIG_SYS_DCACHE_LINESZ		32  #define CONFIG_SYS_ICACHE_LINESZ		32 diff --git a/include/configs/atstk1004.h b/include/configs/atstk1004.h index 3814732b3..5134b7ffa 100644 --- a/include/configs/atstk1004.h +++ b/include/configs/atstk1004.h @@ -100,7 +100,7 @@  	"console=ttyS0 root=/dev/mmcblk0p1 rootwait"  #define CONFIG_BOOTCOMMAND						\ -	"mmcinit; ext2load mmc 0:1 0x10200000 /boot/uImage; bootm" +	"mmc rescan; ext2load mmc 0:1 0x10200000 /boot/uImage; bootm"  /*   * Only interrupt autoboot if <space> is pressed. Otherwise, garbage @@ -135,7 +135,9 @@  #define CONFIG_PORTMUX_PIO  #define CONFIG_SYS_HSDRAMC  #define CONFIG_MMC -#define CONFIG_ATMEL_MCI +#define CONFIG_GENERIC_ATMEL_MCI +#define CONFIG_GENERIC_MMC +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 1  #define CONFIG_SYS_DCACHE_LINESZ		32  #define CONFIG_SYS_ICACHE_LINESZ		32 diff --git a/include/configs/atstk1006.h b/include/configs/atstk1006.h index a30aa70b1..29fdd126a 100644 --- a/include/configs/atstk1006.h +++ b/include/configs/atstk1006.h @@ -151,7 +151,9 @@  #define CONFIG_SYS_NR_PIOS			5  #define CONFIG_SYS_HSDRAMC  #define CONFIG_MMC -#define CONFIG_ATMEL_MCI +#define CONFIG_GENERIC_ATMEL_MCI +#define CONFIG_GENERIC_MMC +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 1  #define CONFIG_SYS_DCACHE_LINESZ		32  #define CONFIG_SYS_ICACHE_LINESZ		32 diff --git a/include/configs/favr-32-ezkit.h b/include/configs/favr-32-ezkit.h index 757636dec..71d2473a9 100644 --- a/include/configs/favr-32-ezkit.h +++ b/include/configs/favr-32-ezkit.h @@ -150,7 +150,9 @@  #define CONFIG_SYS_NR_PIOS			5  #define CONFIG_SYS_HSDRAMC  #define CONFIG_MMC -#define CONFIG_ATMEL_MCI +#define CONFIG_GENERIC_ATMEL_MCI +#define CONFIG_GENERIC_MMC +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 1  #define CONFIG_SYS_DCACHE_LINESZ		32  #define CONFIG_SYS_ICACHE_LINESZ		32 diff --git a/include/configs/hammerhead.h b/include/configs/hammerhead.h index 94e680c42..532feb2f6 100644 --- a/include/configs/hammerhead.h +++ b/include/configs/hammerhead.h @@ -124,7 +124,9 @@  #define CONFIG_SYS_NR_PIOS			5  #define CONFIG_SYS_HSDRAMC  #define CONFIG_MMC -#define CONFIG_ATMEL_MCI +#define CONFIG_GENERIC_ATMEL_MCI +#define CONFIG_GENERIC_MMC +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 1  #define CONFIG_SYS_DCACHE_LINESZ		32  #define CONFIG_SYS_ICACHE_LINESZ		32 diff --git a/include/configs/mimc200.h b/include/configs/mimc200.h index d8d82561f..d5797cb2e 100644 --- a/include/configs/mimc200.h +++ b/include/configs/mimc200.h @@ -129,7 +129,9 @@  #define CONFIG_SYS_NR_PIOS			5  #define CONFIG_SYS_HSDRAMC  #define CONFIG_MMC -#define CONFIG_ATMEL_MCI +#define CONFIG_GENERIC_ATMEL_MCI +#define CONFIG_GENERIC_MMC +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 1  #if defined(CONFIG_LCD)  #define CONFIG_CMD_BMP diff --git a/include/mmc.h b/include/mmc.h index 30c237535..f52df70ad 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -322,7 +322,6 @@ int mmc_switch_part(int dev_num, unsigned int part_num);  int mmc_getcd(struct mmc *mmc);  #ifdef CONFIG_GENERIC_MMC -int atmel_mci_init(void *regs);  #define mmc_host_is_spi(mmc)	((mmc)->host_caps & MMC_MODE_SPI)  struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode);  #else |