diff options
author | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-06-30 12:35:03 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2008-07-15 08:14:49 -0400 |
commit | 7d2be0749a59096a334c94dc48f43294193cb8ed (patch) | |
tree | a14faa58c61071fb548c223268650153b5aa865a /arch/avr32/boards | |
parent | 6d37333163025b46afbcad434ec9a5f2e88e7254 (diff) |
atmel-mci: Driver for Atmel on-chip MMC controllers
This is a driver for the MMC controller on the AP7000 chips from
Atmel. It should in theory work on AT91 systems too with some
tweaking, but since the DMA interface is quite different, it's not
entirely clear if it's worth merging this with the at91_mci driver.
This driver has been around for a while in BSPs and kernel sources
provided by Atmel, but this particular version uses the generic DMA
Engine framework (with the slave extensions) instead of an
avr32-only DMA controller framework.
This driver can also use PIO transfers when no DMA channels are
available, and for transfers where using DMA may be difficult or
impractical for some reason (e.g. the DMA setup overhead is usually
not worth it for very short transfers, and badly aligned buffers or
lengths are difficult to handle.)
Currently, the driver only support PIO transfers. DMA support has been
split out to a separate patch to hopefully make it easier to review.
The driver has been tested using mmc-block and ext3fs on several SD,
SDHC and MMC+ cards. Reads and writes work fine, with read transfer
rates up to 3.5 MiB/s on fast cards with debugging disabled.
The driver has also been tested using the mmc_test module on the same
cards. All tests except 7, 9, 15 and 17 succeed. The first two are
unsupported by all the cards I have, so I don't know if the driver
handles this correctly. The last two fail because the hardware flags a
Data CRC Error instead of a Data Timeout error. I'm not sure how to deal
with that.
Documentation for this controller can be found in many data sheets from
Atmel, including the AT32AP7000 data sheet which can be found here:
http://www.atmel.com/dyn/products/datasheets.asp?family_id=682
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'arch/avr32/boards')
-rw-r--r-- | arch/avr32/boards/atngw100/setup.c | 7 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c index a51bb9fb3c89..c7fe94d03a1e 100644 --- a/arch/avr32/boards/atngw100/setup.c +++ b/arch/avr32/boards/atngw100/setup.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/leds.h> | 19 | #include <linux/leds.h> |
20 | #include <linux/spi/spi.h> | 20 | #include <linux/spi/spi.h> |
21 | 21 | ||
22 | #include <asm/atmel-mci.h> | ||
22 | #include <asm/io.h> | 23 | #include <asm/io.h> |
23 | #include <asm/setup.h> | 24 | #include <asm/setup.h> |
24 | 25 | ||
@@ -51,6 +52,11 @@ static struct spi_board_info spi0_board_info[] __initdata = { | |||
51 | }, | 52 | }, |
52 | }; | 53 | }; |
53 | 54 | ||
55 | static struct mci_platform_data __initdata mci0_data = { | ||
56 | .detect_pin = GPIO_PIN_PC(25), | ||
57 | .wp_pin = GPIO_PIN_PE(0), | ||
58 | }; | ||
59 | |||
54 | /* | 60 | /* |
55 | * The next two functions should go away as the boot loader is | 61 | * The next two functions should go away as the boot loader is |
56 | * supposed to initialize the macb address registers with a valid | 62 | * supposed to initialize the macb address registers with a valid |
@@ -170,6 +176,7 @@ static int __init atngw100_init(void) | |||
170 | set_hw_addr(at32_add_device_eth(1, ð_data[1])); | 176 | set_hw_addr(at32_add_device_eth(1, ð_data[1])); |
171 | 177 | ||
172 | at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); | 178 | at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); |
179 | at32_add_device_mci(0, &mci0_data); | ||
173 | at32_add_device_usba(0, NULL); | 180 | at32_add_device_usba(0, NULL); |
174 | 181 | ||
175 | for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) { | 182 | for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) { |
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 86b363c1c25b..e11659b732fa 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -234,6 +234,9 @@ static int __init atstk1002_init(void) | |||
234 | #ifdef CONFIG_BOARD_ATSTK100X_SPI1 | 234 | #ifdef CONFIG_BOARD_ATSTK100X_SPI1 |
235 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); | 235 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); |
236 | #endif | 236 | #endif |
237 | #ifndef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM | ||
238 | at32_add_device_mci(0, NULL); | ||
239 | #endif | ||
237 | #ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM | 240 | #ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM |
238 | set_hw_addr(at32_add_device_eth(1, ð_data[1])); | 241 | set_hw_addr(at32_add_device_eth(1, ð_data[1])); |
239 | #else | 242 | #else |