]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ATMEL: use generic mmc framework
authorSven Schnelle <svens@stackframe.org>
Fri, 21 Oct 2011 12:49:25 +0000 (14:49 +0200)
committerAndreas Bießmann <andreas@localhost>
Tue, 13 Mar 2012 11:06:41 +0000 (12:06 +0100)
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>
arch/avr32/lib/board.c
include/atmel_mci.h [moved from drivers/mmc/atmel_mci.h with 98% similarity]
include/configs/atngw100.h
include/configs/atstk1002.h
include/configs/atstk1003.h
include/configs/atstk1004.h
include/configs/atstk1006.h
include/configs/favr-32-ezkit.h
include/configs/hammerhead.h
include/configs/mimc200.h
include/mmc.h

index 63fe2979e71d6ce377b6ed3e3ba2c126ee71f769..e110d234e885babe8d32d634d77a0e449aec41bb 100644 (file)
@@ -25,6 +25,7 @@
 #include <stdio_dev.h>
 #include <version.h>
 #include <net.h>
+#include <atmel_mci.h>
 
 #ifdef CONFIG_BITBANGMII
 #include <miiphy.h>
 
 #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();
        }
similarity index 98%
rename from drivers/mmc/atmel_mci.h
rename to include/atmel_mci.h
index 90ab6a8a6d088436ffd9323d59f62b0c35436529..0158f972a8c43bd8efd1130bb3c7a85a0247d986 100644 (file)
  * 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__ */
index 8f9ed238976c52248abe6760b5cb4f97915db145..5e3155dffcebf7b5334972acd2501f99413ac663 100644 (file)
 #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
index 44ce24296163ab67343721ba0c8c6cd3ad210f22..bb426f1edbe84de1a5c71d7f91a8f944fc022d6e 100644 (file)
 #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
index c5e357f6d0c24987b699fd318dc7e8bc38f13ab3..817d94373e1065674d400e6c14b4a1a0c283ecbf 100644 (file)
        "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
 #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
index 3814732b3ad735e65d5c9f8ed8adf2e90132eaf2..5134b7ffa5e19295b1bb0328504d901acf2b2b40 100644 (file)
        "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
 #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
index a30aa70b1a4d923d2c7550cc00aea7868c7d508e..29fdd126a7c2a2f06b4d8e47c71b91864b9a1c57 100644 (file)
 #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
index 757636decba2a4d598ff2b27afa968c90c4e532e..71d2473a90d020d8ad12a29cf1b91f3451114de3 100644 (file)
 #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
index 94e680c42c7993c40c87d57371f0b85c4da3fefe..532feb2f6c9d19fe4308c9ffa863ce106153cbc6 100644 (file)
 #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
index d8d82561f02912d60adb9817a33bca9354153d64..d5797cb2e6fbd1a7a74fd2ede29c8d3a6855d970 100644 (file)
 #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
index 30c2375357fb8ab76ff6b131c71afc330ada22f0..f52df70ad4879782fa15efb6943490dd74eab56b 100644 (file)
@@ -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