AT91SAM9260/9XE: add support for MultiMedia Card Interface (MCI)
Subsystems (3)
PATCH 1/1 AT91SAM9260/9XE: add support for MultiMedia Card Interface (MCI)
This patch adds support for the Atmel MultiMedia Card Interface (MCI) in AT91SAM9260 and AT91SAM9XE SoCs and preserves the original support for the AVR32AP700x SoCs.
It patches the original atmel_mci.c driver to remove byte order and toolchain dependencies and makes it a common MCI driver for Atmels AVR32AP7000 and AT91SAM9260 based SoCs.
The driver itself is not specific to those SoCs and should work with other Atmel devices having an identical MultiMedia Card Interface (MCI), provided the functions get_mci_clk_rate() and <SoC>_mci_hw_init() are defined.
Tested on AT91SAM9XE-EK (AT91SAM9XE512)
Tested on ATNGW100 (AVR32AP7000)
--- arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c | 20 ++++ arch/arm/include/asm/arch-at91/clk.h | 5 + arch/arm/include/asm/arch-at91/hardware.h | 1 + doc/README.atmel_mci | 68 +++++++++++++ drivers/mmc/atmel_mci.c | 112 ++++++++++----------- drivers/mmc/atmel_mci.h | 6 +- include/mmc.h | 93 ++++++++++------- 7 files changed, 207 insertions(+), 98 deletions(-) create mode 100644 doc/README.atmel_mci
arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c +20 -0
@@ -194,3 +194,23 @@ void at91_macb_hw_init(void) #endif }#endif + +#ifdef CONFIG_ATMEL_MCI +void at91_mci_hw_init (void ) +{ +at91_set_a_periph (AT91_PIO_PORTA ,8 ,0 );/* MCCK */ +#if defined(CONFIG_ATMEL_MCI_PORTB ) +at91_set_b_periph (AT91_PIO_PORTA ,1 ,0 );/* MCCDB */ +at91_set_b_periph (AT91_PIO_PORTA ,0 ,0 );/* MCDB0 */ +at91_set_b_periph (AT91_PIO_PORTA ,5 ,0 );/* MCDB1 */ +at91_set_b_periph (AT91_PIO_PORTA ,4 ,0 );/* MCDB2 */ +at91_set_b_periph (AT91_PIO_PORTA ,3 ,0 );/* MCDB3 */ +#else +at91_set_a_periph (AT91_PIO_PORTA ,7 ,0 );/* MCCDA */ +at91_set_a_periph (AT91_PIO_PORTA ,6 ,0 );/* MCDA0 */ +at91_set_a_periph (AT91_PIO_PORTA ,9 ,0 );/* MCDA1 */ +at91_set_a_periph (AT91_PIO_PORTA ,10 ,0 );/* MCDA2 */ +at91_set_a_periph (AT91_PIO_PORTA ,11 ,0 );/* MCDA3 */ +#endif +} +#endif
arch/arm/include/asm/arch-at91/clk.h +5 -0
@@ -59,5 +59,10 @@ static inline unsigned long get_twi_clk_rate(unsigned int dev_id) return get_mck_clk_rate(); } +static inline unsigned long get_mci_clk_rate (void ) +{ +return get_mck_clk_rate (); +} +int at91_clock_init (unsigned long main_clock);#endif /* __ASM_ARM_ARCH_CLK_H__ */
arch/arm/include/asm/arch-at91/hardware.h +1 -0
@@ -23,6 +23,7 @@#define AT91_BASE_SPI AT91SAM9260_BASE_SPI0#define AT91_ID_UHP AT91SAM9260_ID_UHP#define AT91_PMC_UHP AT91SAM926x_PMC_UHP +#define MMCI_BASE AT91SAM9260_BASE_MCI#elif defined(CONFIG_AT91SAM9261 ) || defined(CONFIG_AT91SAM9G10 )#include <asm/arch/at91sam9261.h> #define AT91_BASE_SPI AT91SAM9261_BASE_SPI0
doc/README.atmel_mci new file +68 -0
68 lines not on this page · raw message
drivers/mmc/atmel_mci.c +55 -57
193 lines not on this page · raw message
drivers/mmc/atmel_mci.h +3 -3
@@ -19,8 +19,8 @@* 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__/* Atmel MultiMedia Card Interface (MCI) registers */ #define MMCI_CR 0x0000
@@ -198,4 +198,4 @@#define mmci_writel (reg,value) \ writel((value), (void *)MMCI_BASE + MMCI_##reg) -#endif /* __CPU_AT32AP_ATMEL_MCI_H__ */ +#endif /* __ATMEL_MCI_H__ */
include/mmc.h +55 -38
99 lines not on this page · raw message
Signature · 1 line
1.5.6.5
PATCH 1/1 AT91SAM9260/9XE: add support for MultiMedia Card Interface (MCI)
Dear Reinhard,
Could you please rebase your code to master@git://git.denx.de/u-boot-at91.git ?
Thanks!
BR,
Eric
Quoted 29 lines · Reinhard Meyer (-VC)
This patch adds support for the Atmel MultiMedia Card Interface (MCI) in AT91SAM9260 and AT91SAM9XE SoCs and preserves the original support for the AVR32AP700x SoCs.
It patches the originalatmel_mci.cdriver to remove byte order and toolchain dependencies and makes it a common MCI driver for Atmels AVR32AP7000 and AT91SAM9260 based SoCs.
The driver itself is not specific to those SoCs and should work with other Atmel devices having an identical MultiMedia Card Interface (MCI), provided the functionsget_mci_clk_rate()and <SoC>_mci_hw_init() are defined.Tested on AT91SAM9XE-EK (AT91SAM9XE512)
Tested on ATNGW100 (AVR32AP7000)Signed-off-by Reinhard Meyer <[email protected]>--- arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c | 20 ++++ arch/arm/include/asm/arch-at91/clk.h | 5 + arch/arm/include/asm/arch-at91/hardware.h | 1 + doc/README.atmel_mci | 68 +++++++++++++ drivers/mmc/atmel_mci.c | 112 ++++++++++----------- drivers/mmc/atmel_mci.h | 6 +- include/mmc.h | 93 ++++++++++------- 7 files changed, 207 insertions(+), 98 deletions(-) create mode 100644 doc/README.atmel_mci
PATCH 1/1 AT91SAM9260/9XE: add support for MultiMedia Card Interface (MCI)
Quoted 5 lines · Eric Xu
Dear Reinhard,
Could you please rebase your code to master@
git://git.denx.de/u-boot-at91.git?
Quoted 10 lines
Thanks!
BR,
EricQuoted 4 lines · Reinhard Meyer (-VC)
This patch adds support for the Atmel MultiMedia Card Interface (MCI) in AT91SAM9260 and AT91SAM9XE SoCs and preserves the original support for the AVR32AP700x SoCs.
Hi Eric,
I am not a GIT specialist and working in the main GIT tree. How do I rebase into another tree?
Does the patch not apply to your at91.git tree?
Reinhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reinhard_meyer.vcf
Type: text/x-vcard
Size: 370 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100705/07711e8e/attachment.vcf
PATCH 1/1 AT91SAM9260/9XE: add support for MultiMedia Card Interface (MCI)
In reply to Eric XuDear Eric Xu,
Quoted 3 lines · In message <[email protected]> you wrote:
Could you please rebase your code to master@
git://git.denx.de/u-boot-at91.git?
Why are you requesting this?
I do not want a situation that patches need to be submitted agaionst a number of different trees or branches, with the unavoidable result that the majority of readers here on the list cannot test the postings bcause they do not apply against the master repository.
Because of that, http://www.denx.de/wiki/U-Boot/Patches states explicitly:
Please use the "master" branch of the mainline U-Boot git repository (git://git.denx.de/u-boot.git) as reference, unless (usually late in a release cycle) there has been an announcement to use the "next" branch of this repository instead.
If your AT91 repository requires a different state, it is your task as custodian to keep it in sync with master, and to resolve any merge conflicts resulting from the remaining differences.
Reinhards patch appears to apply cleanly against master, so it should NOT be changed.
Thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Real computer scientists despise the idea of actual hardware. Hard- ware has limitations, software doesn't. It's a real shame that Turing machines are so poor at I/O.
Xu
Dear Wolfgang,
The reason is I tried to apply the patch on top of
1) "master" branch of the mainline U-Boot
2) current "master" of u-boot-at91.git
3) The old "master" of u-boot-at91.git
all of them are failed.
Since you said the patch is cleanly against master of mainline U-Boot, I'll rework.
Thanks.
BR,
Eric
-----Original Message-----
From: Wolfgang Denk [mailto:wd at denx.de]
Sent: 2010-7-5 (???) 17:59
To: Xu, Hong
Cc: reinhard.meyer at emk-elektronik.de; u-boot
Subject: Re: [U-Boot] [PATCH] AT91SAM9260/9XE: add support for MultiMedia Card Interface (MCI)
Dear Eric Xu,
Quoted 3 lines · In message <[email protected]> you wrote:
Could you please rebase your code to master@
git://git.denx.de/u-boot-at91.git?
Why are you requesting this?
I do not want a situation that patches need to be submitted agaionst a number of different trees or branches, with the unavoidable result that the majority of readers here on the list cannot test the postings bcause they do not apply against the master repository.
Because of that, http://www.denx.de/wiki/U-Boot/Patches states explicitly:
Please use the "master" branch of the mainline U-Boot git repository (git://git.denx.de/u-boot.git) as reference, unless (usually late in a release cycle) there has been an announcement to use the "next" branch of this repository instead.
If your AT91 repository requires a different state, it is your task as custodian to keep it in sync with master, and to resolve any merge conflicts resulting from the remaining differences.
Reinhards patch appears to apply cleanly against master, so it should NOT be changed.
Thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Real computer scientists despise the idea of actual hardware. Hard- ware has limitations, software doesn't. It's a real shame that Turing machines are so poor at I/O.
Dear "Xu, Hong",
Quoted 9 lines · In message <[email protected]> you…
The reason is I tried to apply the patch on top of
1) "master" branch of the mainline U-Boot
2) current "master" of u-boot-at91.git
3) The old "master" of u-boot-at91.git
all of them are failed.Since you said the patch is cleanly against master of mainline U-Boot, = I'll rework.
It applies indeed without problems on top of the current master branch (i. e. on top of commit v2010.06-73-g54841ab) :
-> git-am -3 -i -u --whitespace=strip ~/Mail/U-Boot/8433 Commit Body is:
--------------------------
AT91SAM9260/9XE: add support for MultiMedia Card Interface (MCI)
This patch adds support for the Atmel MultiMedia Card Interface (MCI) in AT91SAM9260 and AT91SAM9XE SoCs and preserves the original support for the AVR32AP700x SoCs.
It patches the original atmel_mci.c driver to remove byte order and toolchain dependencies and makes it a common MCI driver for Atmels AVR32AP7000 and AT91SAM9260 based SoCs.
The driver itself is not specific to those SoCs and should work with other Atmel devices having an identical MultiMedia Card Interface (MCI), provided the functions get_mci_clk_rate() and <SoC>_mci_hw_init() are defined.
Tested on AT91SAM9XE-EK (AT91SAM9XE512)
Tested on ATNGW100 (AVR32AP7000)
--------------------------
Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all y
Applying: AT91SAM9260/9XE: add support for MultiMedia Card Interface (MCI) ->
Best regards,
Wolfgang Denk
Signature · 9 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The project was large enough and management communication poor enough
to prompt many members of the team to see themselves as contestants
making brownie points, rather than as builders making programming
products. Each suboptimized his piece to meet his targets; few
stopped to think about the total effect on the customer.
- Fred Brooks, "The Mythical Man Month"Xu
PATCH 1/1 AT91SAM9260/9XE: add support for MultiMedia Card Interface (MCI)
Dear Wolfgang,
It seems the root cause of my failure of applying Reinhard's patch is the exchange server settings. Some of the space/tabs are converted/expanded in a wrong way.
Thanks for the help and hints from you and Mr.Reinhard.
BR,
Eric
-----Original Message-----
From: Wolfgang Denk [mailto:wd at denx.de]
Sent: 2010-7-5 (???) 20:46
To: Xu, Hong
Cc: reinhard.meyer at emk-elektronik.de; u-boot
Subject: Re: ??: [U-Boot] [PATCH] AT91SAM9260/9XE: add support for MultiMedia Card Interface (MCI)
Dear "Xu, Hong",
Quoted 9 lines · In message <[email protected]> you…
The reason is I tried to apply the patch on top of
1) "master" branch of the mainline U-Boot
2) current "master" of u-boot-at91.git
3) The old "master" of u-boot-at91.git
all of them are failed.Since you said the patch is cleanly against master of mainline U-Boot, = I'll rework.
It applies indeed without problems on top of the current master branch (i. e. on top of commit v2010.06-73-g54841ab) :
-> git-am -3 -i -u --whitespace=strip ~/Mail/U-Boot/8433 Commit Body is:
--------------------------
AT91SAM9260/9XE: add support for MultiMedia Card Interface (MCI)
This patch adds support for the Atmel MultiMedia Card Interface (MCI) in AT91SAM9260 and AT91SAM9XE SoCs and preserves the original support for the AVR32AP700x SoCs.
It patches the original atmel_mci.c driver to remove byte order and toolchain dependencies and makes it a common MCI driver for Atmels AVR32AP7000 and AT91SAM9260 based SoCs.
The driver itself is not specific to those SoCs and should work with other Atmel devices having an identical MultiMedia Card Interface (MCI),
[...]
PATCH v2 1/1 AT91: add SD/MMC support
In reply to Reinhard Meyer (-VC)--- arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c | 20 +++ arch/arm/include/asm/arch-at91/at91_common.h | 1 + arch/arm/include/asm/arch-at91/clk.h | 5 + arch/arm/include/asm/arch-at91/hardware.h | 1 + doc/README.atmel_mci | 68 +++++++++++ drivers/mmc/atmel_mci.c | 134 ++++++++++----------- drivers/mmc/atmel_mci.h | 6 +- include/mmc.h | 93 +++++++++------ 8 files changed, 217 insertions(+), 111 deletions(-) create mode 100644 doc/README.atmel_mci
arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c +20 -0
@@ -194,3 +194,23 @@ void at91_macb_hw_init(void) #endif }#endif + +#ifdef CONFIG_ATMEL_MCI +void at91_mci_hw_init (void ) +{ +at91_set_a_periph (AT91_PIO_PORTA ,8 ,0 );/* MCCK */ +#if defined(CONFIG_ATMEL_MCI_PORTB ) +at91_set_b_periph (AT91_PIO_PORTA ,1 ,0 );/* MCCDB */ +at91_set_b_periph (AT91_PIO_PORTA ,0 ,0 );/* MCDB0 */ +at91_set_b_periph (AT91_PIO_PORTA ,5 ,0 );/* MCDB1 */ +at91_set_b_periph (AT91_PIO_PORTA ,4 ,0 );/* MCDB2 */ +at91_set_b_periph (AT91_PIO_PORTA ,3 ,0 );/* MCDB3 */ +#else +at91_set_a_periph (AT91_PIO_PORTA ,7 ,0 );/* MCCDA */ +at91_set_a_periph (AT91_PIO_PORTA ,6 ,0 );/* MCDA0 */ +at91_set_a_periph (AT91_PIO_PORTA ,9 ,0 );/* MCDA1 */ +at91_set_a_periph (AT91_PIO_PORTA ,10 ,0 );/* MCDA2 */ +at91_set_a_periph (AT91_PIO_PORTA ,11 ,0 );/* MCDA3 */ +#endif +} +#endif
arch/arm/include/asm/arch-at91/at91_common.h +1 -0
@@ -35,5 +35,6 @@ void at91_serial3_hw_init(void);void at91_spi0_hw_init (unsigned long cs_mask);void at91_spi1_hw_init (unsigned long cs_mask);void at91_uhp_hw_init (void ); +void at91_mci_hw_init (void );#endif /* AT91_COMMON_H */
arch/arm/include/asm/arch-at91/clk.h +5 -0
@@ -59,5 +59,10 @@ static inline unsigned long get_twi_clk_rate(unsigned int dev_id) return get_mck_clk_rate(); } +static inline unsigned long get_mci_clk_rate (void ) +{ +return get_mck_clk_rate (); +} +int at91_clock_init (unsigned long main_clock);#endif /* __ASM_ARM_ARCH_CLK_H__ */
arch/arm/include/asm/arch-at91/hardware.h +1 -0
@@ -23,6 +23,7 @@#define AT91_BASE_SPI AT91SAM9260_BASE_SPI0#define AT91_ID_UHP AT91SAM9260_ID_UHP#define AT91_PMC_UHP AT91SAM926x_PMC_UHP +#define MMCI_BASE AT91SAM9260_BASE_MCI#elif defined(CONFIG_AT91SAM9261 ) || defined(CONFIG_AT91SAM9G10 )#include <asm/arch/at91sam9261.h> #define AT91_BASE_SPI AT91SAM9261_BASE_SPI0
doc/README.atmel_mci new file +68 -0
68 lines not on this page · raw message
drivers/mmc/atmel_mci.c +64 -70
248 lines not on this page · raw message
drivers/mmc/atmel_mci.h +3 -3
@@ -19,8 +19,8 @@* 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__/* Atmel MultiMedia Card Interface (MCI) registers */ #define MMCI_CR 0x0000
@@ -198,4 +198,4 @@#define mmci_writel (reg,value) \ writel((value), (void *)MMCI_BASE + MMCI_##reg) -#endif /* __CPU_AT32AP_ATMEL_MCI_H__ */ +#endif /* __ATMEL_MCI_H__ */
include/mmc.h +55 -38
99 lines not on this page · raw message
PATCH 1/1 AT91: add SD/MMC support
This patch adds support for the Atmel MultiMedia Card Interface (MCI) in AT91SAM9260 and AT91SAM9XE SoCs and preserves the original support for the AVR32AP700x SoCs.
It patches the original atmel_mci.c driver to remove byte order and toolchain dependencies and makes it a common MCI driver for Atmels AVR32AP7000 and AT91SAM9260 based SoCs.
The driver itself is not specific to those SoCs and should work with other Atmel devices having an identical MultiMedia Card Interface (MCI), provided the functions get_mci_clk_rate() and <SoC>_mci_hw_init() are defined.
Tested on AT91SAM9XE-EK (AT91SAM9XE512)
Tested on ATNGW100 (AVR32AP7000)
---
Sorry, my mouse slipped and sent v2 prematurely :)
arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c | 20 +++ arch/arm/include/asm/arch-at91/at91_common.h | 1 + arch/arm/include/asm/arch-at91/clk.h | 5 + arch/arm/include/asm/arch-at91/hardware.h | 1 + doc/README.atmel_mci | 68 +++++++++++ drivers/mmc/atmel_mci.c | 134 ++++++++++----------- drivers/mmc/atmel_mci.h | 6 +- include/mmc.h | 93 +++++++++------ 8 files changed, 217 insertions(+), 111 deletions(-) create mode 100644 doc/README.atmel_mci
arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c +20 -0
@@ -194,3 +194,23 @@ void at91_macb_hw_init(void) #endif }#endif + +#ifdef CONFIG_ATMEL_MCI +void at91_mci_hw_init (void ) +{ +at91_set_a_periph (AT91_PIO_PORTA ,8 ,0 );/* MCCK */ +#if defined(CONFIG_ATMEL_MCI_PORTB ) +at91_set_b_periph (AT91_PIO_PORTA ,1 ,0 );/* MCCDB */ +at91_set_b_periph (AT91_PIO_PORTA ,0 ,0 );/* MCDB0 */ +at91_set_b_periph (AT91_PIO_PORTA ,5 ,0 );/* MCDB1 */ +at91_set_b_periph (AT91_PIO_PORTA ,4 ,0 );/* MCDB2 */ +at91_set_b_periph (AT91_PIO_PORTA ,3 ,0 );/* MCDB3 */ +#else +at91_set_a_periph (AT91_PIO_PORTA ,7 ,0 );/* MCCDA */ +at91_set_a_periph (AT91_PIO_PORTA ,6 ,0 );/* MCDA0 */ +at91_set_a_periph (AT91_PIO_PORTA ,9 ,0 );/* MCDA1 */ +at91_set_a_periph (AT91_PIO_PORTA ,10 ,0 );/* MCDA2 */ +at91_set_a_periph (AT91_PIO_PORTA ,11 ,0 );/* MCDA3 */ +#endif +} +#endif
arch/arm/include/asm/arch-at91/at91_common.h +1 -0
@@ -35,5 +35,6 @@ void at91_serial3_hw_init(void);void at91_spi0_hw_init (unsigned long cs_mask);void at91_spi1_hw_init (unsigned long cs_mask);void at91_uhp_hw_init (void ); +void at91_mci_hw_init (void );#endif /* AT91_COMMON_H */
arch/arm/include/asm/arch-at91/clk.h +5 -0
@@ -59,5 +59,10 @@ static inline unsigned long get_twi_clk_rate(unsigned int dev_id) return get_mck_clk_rate(); } +static inline unsigned long get_mci_clk_rate (void ) +{ +return get_mck_clk_rate (); +} +int at91_clock_init (unsigned long main_clock);#endif /* __ASM_ARM_ARCH_CLK_H__ */
arch/arm/include/asm/arch-at91/hardware.h +1 -0
@@ -23,6 +23,7 @@#define AT91_BASE_SPI AT91SAM9260_BASE_SPI0#define AT91_ID_UHP AT91SAM9260_ID_UHP#define AT91_PMC_UHP AT91SAM926x_PMC_UHP +#define MMCI_BASE AT91SAM9260_BASE_MCI#elif defined(CONFIG_AT91SAM9261 ) || defined(CONFIG_AT91SAM9G10 )#include <asm/arch/at91sam9261.h> #define AT91_BASE_SPI AT91SAM9261_BASE_SPI0
doc/README.atmel_mci new file +68 -0
68 lines not on this page · raw message
drivers/mmc/atmel_mci.c +64 -70
248 lines not on this page · raw message
drivers/mmc/atmel_mci.h +3 -3
@@ -19,8 +19,8 @@* 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__/* Atmel MultiMedia Card Interface (MCI) registers */ #define MMCI_CR 0x0000
@@ -198,4 +198,4 @@#define mmci_writel (reg,value) \ writel((value), (void *)MMCI_BASE + MMCI_##reg) -#endif /* __CPU_AT32AP_ATMEL_MCI_H__ */ +#endif /* __ATMEL_MCI_H__ */
include/mmc.h +55 -38
99 lines not on this page · raw message
Signature · 1 line
1.5.6.5
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 AT91: add SD/MMC support
Quoted 11 lines · Hong
Hi Reinhard,
To format the SD card, I did following
----8<----# dd if=/dev/zero of=/dev/sdc bs=512 count=100000 # mke2fs /dev/sdc # mount /dev/sdc /mnt/ext2disk # '' copy some files to /mnt/ext2disk ----8<----I guess you tested fatls or fatload or fatinfo or ext2ls, could you give me a hint why I failed with 'ext2ls'?
/dev/sdc is the whole card, not a partition on it.
I tested with a proper partitioned card (/dev/sdc1 under LinuX).
Reinhard
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 AT91: add SD/MMC support
Quoted 19 lines · Hong
Hi Reinhard,
In Linux, I used `fdisk' to cerate 2 primiary partitions on SD card, each is about 1G bytes.
I used `mkfs.ext2/dev/sdc1' and 'mkfs.ext2/dev/sd2' to format the 2 partitions and then copy some files on them.I used SanDisk 2GB SD Card.
But in U-Boot,
----8<----
U-Boot> mmc initmmc: requested clock 150000 is too low; changed to 194000 Manufacturer ID: 03 OEM/Application ID: 5344 Product name: SD02G Product Revision: 8.0 Product Serial Number: 27337763 Manufacturing Date: 09/12
Quoted 14 lines
SD Card detected (RCA 43690)
raw CSD data: 002600325f5a83aefefbcfff928040dfRead block length: 1024
(Supports partial reads)
Card capacity: 1884 Mbytes
mmc: Using 131072 cycles data timeout (DTOR=0x62)
mmc: blocksize reduced to 512, number of blocks: 3862528 mmc1 is available
U-Boot> ext2ls mmc 0
bad MBR sector signature0x0000
** Bad partition - mmc 0:1 **
U-Boot> ext2ls mmc 1
bad MBR sector signature0x0000
** Bad partition - mmc 1:1 **
The number before the ":" is irrelevant (with this driver), after the ":" is the partition number. So anything:1 would be like /dev/sda1.
I can't test right now (not in the office) but it seems that a proper mbr is required. You killed that when zeroing the card. Not sure right now how you get that back under LinuX (win: fdisk /mbr)
And please replies to the list as well.
Reinhard
PATCH 1/1 AT91: add SD/MMC support
Disregard this patch, please.
I found a better solution based on Rob Emanuele's work, it will be presented as a patch soon.
Reinhard
PATCH 1/1 AT91: add SD/MMC support
In reply to Reinhard MeyerHello! I have successfully applied your patch on a AT91SAM9G20 cpu and it reads the correct CID & CSD info.
At the end of initialization the bread function fails with the following error:
mmc: bread failed, status = 0040c0e5, card status = 00000900
Does someone else received this error or have a hint on this error message?
Thanks,
Alex
Signature · 2 lines
View this message in context: http://old.nabble.com/-U-Boot---PATCH--AT91SAM9260-9XE%3A-add-support-for-MultiMedia-Card-Interface-%28MCI%29-tp29068839p29427373.html Sent from the Uboot - Users mailing list archive at Nabble.com.
PATCH 1/1 AT91: add SD/MMC support
Quoted 8 lines · asc0 wrote:
Hello! I have successfully applied your patch on a AT91SAM9G20 cpu and it reads the correct CID & CSD info.
At the end of initialization the bread function fails with the following error:mmc: bread failed, status =
0040c0e5, card status = 00000900Does someone else received this error or have a hint on this error message?
a) it works fine on ATNGW100 and AT91SAM9XE-EK. Have you tried other cards? The driver will not work with SDHC cards or cards that do not allow partial reads. Maybe supply us here with the CID and CSD output from the driver.
b) that driver has become obsolete now... A few days ago I managed to get the mmc framework based driver originally by Rob Emanuele running. That one can deal with large cards (still have to test that, a 32GB card is in the mail to me). During the weekend I might post a first patch of that to the list.
Best Regards,
Reinhard
Schleifer
PATCH 1/1 AT91: add SD/MMC support
Thanks for your reply...
The CID part is:
mmc: response: 1a50514d 53202020 1018301a ec007b8b Manufacturer ID: 1A OEM/Application ID: 5051 Product name: MS Product Revision: 1.0 Product Serial Number: 405805804 Manufacturing Date: 07/11
The CSD part is:
mmc: response: 005e0032 5f5983cf edb6ff87 9640003f raw CSD data: 005e0032 5f5983cf edb6ff87 9640003f Read block length: 512
(Supports partial reads)
Card capacity: 244 Mbytes
Warning: Using maximum data timeout
mmc: Using 983040 cycles data timeout (DTOR=0x7f)
...MCI_DTOR = 0000007f
...
mmc: bread failed, status = 0040c0e5, card status = 00000900
...
The maximum data timeout is set hard-coded for testing purposes because the bread status has the DTOE bit set. I have also tried a 2GB SD card (no SDHC) with the same error and status code.
Best regards,
Alexander
-----Original Message-----
From: Reinhard Meyer [mailto:u-boot at emk-elektronik.de]
Sent: Friday, August 13, 2010 1:17 PM
To: Schleifer, Alexander
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH v2a] AT91: add SD/MMC support
Quoted 9 lines · asc0 wrote:
Hello! I have successfully applied your patch on a AT91SAM9G20 cpu and it reads the correct CID & CSD info.
At the end of initialization the bread function fails with the following
error:mmc: bread failed, status =
0040c0e5, card status = 00000900Does someone else received this error or have a hint on this error message?
a) it works fine on ATNGW100 and AT91SAM9XE-EK. Have you tried other cards? The driver will not work with SDHC cards or cards that do not allow partial reads. Maybe supply us here with the CID and CSD output from the driver.
b) that driver has become obsolete now... A few days ago I managed to get the mmc framework based driver originally by Rob Emanuele running. That one can deal with large cards (still have to test that, a 32GB card is in the mail to me). During the weekend I might post a first patch of that to the list.
Best Regards,
Reinhard
PATCH 1/1 AT91: add SD/MMC support
Dear Schleifer, Alexander,
Quoted 11 lines
Thanks for your reply...
The CID part is:
mmc: response: 1a50514d 53202020 1018301a ec007b8b Manufacturer ID: 1A OEM/Application ID: 5051 Product name: MS Product Revision: 1.0 Product Serial Number: 405805804 Manufacturing Date: 07/11
Quoted 8 lines
The CSD part is:
mmc: response:005e00325f5983cfedb6ff879640003fraw CSD data:005e00325f5983cfedb6ff879640003fRead block length: 512
(Supports partial reads)
Card capacity: 244 Mbytes
Warning: Using maximum data timeout
mmc: Using 983040 cycles data timeout (DTOR=0x7f)
I miss the clock messages here. Whats the MCK and which divider is calculated?
Quoted 1 line
mmc: bread failed, status =
0040c0e5, card status = 00000900
0040c0e5=
DTOE=1(data time out error)
TXBUFE=1
RXBUFF=1(rx buffer full)
and other bits
That seems to me like some timing problem, or a hardware problem, where reading data with slow clock (used to get CID/CSD) works, but reading at several MHz (depending on card) does not work. Besides the clock calculation in this driver rounds the divider down, so on a typical system a 25MHz card will receive a 48 MHz clock instead of a 24 MHz. I figured this out while testing the new driver...
If you really want to bother with this now old driver use this excerpt from the new driver:
debug("mci: bus_hz is %u, setting clock %u Hz, block size %u\n",
bus_hz, hz, blklen);
if (hz > 0) {
/* find lowest clkdiv yielding a rate <= than requested */
for (clkdiv=0; clkdiv<255; clkdiv++) {
if ((bus_hz / (clkdiv+1) / 2) <= hz)
break;
}
}
printf("mci: setting clock %u Hz, block size %u\n",
(bus_hz / (clkdiv+1)) / 2, blklen);If you have two days patience, wait for the new driver, I will be most happy to have a tester ;)
Best Regards,
Reinhard
PATCH 1/1 AT91: add SD/MMC support
Dear Schleifer, Alexander,
Quoted 2 lines
If you have two days patience, wait for the new driver, I will be most happy to have a tester ;)
TOP9000> mmci
mci: setting clock 194000 Hz, block size 512
mci: setting clock 24832000 Hz, block size 512
mci: setting clock 194000 Hz, block size 512
mci: setting clock 194000 Hz, block size 512
mci: setting clock 24832000 Hz, block size 512
Device: mci
Manufacturer ID: 3
OEM: 5344
Name: SD32G
Tran Speed: 25000000
Rd Block Len: 512
SD version 2.0
High Capacity: Yes <<<<< SDHC
Capacity: 31914983424 <<<< 32 GB !!!
Bus Width: 4-bit
TOP9000> mmc read mci 21000000 3b70000 100
MMC read: dev # 0, block # 62324736, count 256 ... mci: setting clock 194000 Hz,
block size 512
mci: setting clock 24832000 Hz, block size 512
mci: setting clock 194000 Hz, block size 512
mci: setting clock 194000 Hz, block size 512
mci: setting clock 24832000 Hz, block size 512
256 blocks read: OK
TOP9000> mmc read mci 0 3b70000 100
MMC read: dev # 0, block # 62324736, count 256 ... mci: setting clock 194000 Hz,
block size 512
mci: setting clock 24832000 Hz, block size 512
mci: setting clock 194000 Hz, block size 512
mci: setting clock 194000 Hz, block size 512
mci: setting clock 24832000 Hz, block size 512
256 blocks read: OK
fatls, however fails, probably cannot handle 32 Gigs :) (fatls works with a SDHC card with 4 Gigs)
Once my other question pertaining to *.h files is answered, I can supply the driver as a patch.
Reinhard
Schleifer
PATCH 1/1 AT91: add SD/MMC support
In reply to Reinhard MeyerThe clock messages are ..
mmc: bus_hz is 99072000, setting clock 150000 Hz, block size 512
mmc: requested clock 150000 is too low; changed to 193500
But I found out, that the AT91Bootstrap initialization impacts the U-Boot code. If I use the AT91Bootstrap (without mci initialization) from NAND flash, the mmc init command successfully reads the card. It fails if I use the AT91Bootstrap with mci initialization.
The new driver may help me out of this - so I would be happy to test your patch ;)
Best Regards,
Alex
-----Original Message-----
From: Reinhard Meyer [mailto:u-boot at emk-elektronik.de]
Sent: Friday, August 13, 2010 8:32 PM
To: Schleifer, Alexander
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH v2a] AT91: add SD/MMC support
Dear Schleifer, Alexander,
Quoted 11 lines
Thanks for your reply...
The CID part is:
mmc: response: 1a50514d 53202020 1018301a ec007b8b Manufacturer ID: 1A OEM/Application ID: 5051 Product name: MS Product Revision: 1.0 Product Serial Number: 405805804 Manufacturing Date: 07/11
Quoted 7 lines
The CSD part is:
mmc: response:005e00325f5983cfedb6ff879640003fraw CSD data:005e00325f5983cfedb6ff879640003fRead block length: 512
(Supports partial reads)
Card capacity: 244 Mbytes
Warning: Using maximum data timeout
mmc: Using 983040 cycles data timeout (DTOR=0x7f)
I miss the clock messages here. Whats the MCK and which divider is calculated?
Quoted 1 line
mmc: bread failed, status =
0040c0e5, card status = 00000900
0040c0e5=
DTOE=1(data time out error)
TXBUFE=1
RXBUFF=1(rx buffer full)
and other bits
That seems to me like some timing problem, or a hardware problem, where reading data with slow clock (used to get CID/CSD) works, but reading at several MHz (depending on card) does not work. Besides the clock calculation in this driver rounds the divider down, so on a typical system a 25MHz card will receive a 48 MHz clock instead of a 24 MHz. I figured this out while testing the new driver...
If you really want to bother with this now old driver use this excerpt from the new driver:
debug("mci: bus_hz is %u, setting clock %u Hz, block size %u\n",
bus_hz, hz, blklen);
if (hz > 0) {
/* find lowest clkdiv yielding a rate <= than requested */
for (clkdiv=0; clkdiv<255; clkdiv++) {
if ((bus_hz / (clkdiv+1) / 2) <= hz)
break;
}
}
printf("mci: setting clock %u Hz, block size %u\n",
(bus_hz / (clkdiv+1)) / 2, blklen);If you have two days patience, wait for the new driver, I will be most happy to have a tester ;)
Best Regards,
Reinhard
PATCH 1/1 AT91: add SD/MMC support
Dear Schleifer, Alexander,
Quoted 1 line
But I found out, that the AT91Bootstrap initialization impacts
the U-Boot code. If I use the AT91Bootstrap (without mci initialization)
from NAND flash, the mmc init command successfully reads the card.
It fails if I use the AT91Bootstrap with mci initialization.
That's unlikely (it has the same init sequences)...
Do you have at91_mci_hw_init(void) in your at91samXXXX_devices.c and do you call that function from your board init?
Can you list me what that bootstrap does initialize differently if mci is enabled?
Best Regards,
Reinhard
PATCH 1/1 AT91: add SD/MMC support
Dear Reinhard Meyer,
Quoted 5 lines · In message <[email protected]> you wrote:
Dear Schleifer, Alexander,
Quoted 1 line
But I found out, that the AT91Bootstrap initialization impacts
the U-Boot code. If I use the AT91Bootstrap (without mci initialization)
Quoted 8 lines
from NAND flash, the mmc init command successfully reads the card.
It fails if I use the AT91Bootstrap with mci initialization.
That's unlikely (it has the same init sequences)...
Do you have
at91_mci_hw_init(void)in yourat91samXXXX_devices.cand do you call that function from your board init?
Please fix your mailer. Your quoting is seriously broken!
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The optimum committee has no members.
- Norman AugustinePATCH 1/1 AT91: add SD/MMC support
Quoted 9 lines · Wolfgang Denk
Dear Reinhard Meyer,
Quoted 6 lines · In message <[email protected]> you wrote:
Dear Schleifer, Alexander,
Quoted 1 line
But I found out, that the AT91Bootstrap initialization impacts
the U-Boot code. If I use the AT91Bootstrap (without mci initialization)
from NAND flash, the mmc init command successfully reads the card.
Quoted 8 lines
Quoted 6 lines
It fails if I use the AT91Bootstrap with mci initialization.
That's unlikely (it has the same init sequences)...
Do you have
at91_mci_hw_init(void)in yourat91samXXXX_devices.cand do you call that function from your board init?Please fix your mailer. Your quoting is seriously broken!
No, its not. I manually added breaks to that line because it was not wrapped at all - and I did not bother to add extra ">"s.
Reinhard
PATCH 1/1 AT91: add SD/MMC support
Dear Reinhard Meyer,
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 2 lines
Please fix your mailer. Your quoting is seriously broken!
No, its not. I manually added breaks to that line because it was not wrapped at all - and I did not bother to add extra ">"s.
I wrote "Your quoting is seriously broken", and indeed it is ;-) I was just polite enough to blame it on your mailer...
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The only time the world beats a path to your door is when you are in the bathroom.
Schleifer
PATCH 1/1 AT91: add SD/MMC support
In reply to Reinhard MeyerHello Reinhard,
thanks for your reply.
I checked the register settings and sorted out, that the SDCBUS was initialized in 4-bit mode by the bootstrap.
So I added the explicit initialization when port A is used:
#if defined(CONFIG_ATMEL_MCI_PORTB)
mmci_writel(SDCR, (MMCI_BF(SCDSEL, 1)
| MMCI_BF(SCDBUS, 0)));
#else
mmci_writel(SDCR, (MMCI_BF(SCDSEL, 0)
| MMCI_BF(SCDBUS, 0)));
#endif
Best regards,
Alex
-----Original Message-----
From: Reinhard Meyer [mailto:u-boot at emk-elektronik.de]
Sent: Montag, 16. August 2010 12:16
To: Schleifer, Alexander
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH v2a] AT91: add SD/MMC support
Dear Schleifer, Alexander,
Quoted 1 line
But I found out, that the AT91Bootstrap initialization impacts
the U-Boot code. If I use the AT91Bootstrap (without mci initialization)
from NAND flash, the mmc init command successfully reads the card.
It fails if I use the AT91Bootstrap with mci initialization.
That's unlikely (it has the same init sequences)...
Do you have at91_mci_hw_init(void) in your at91samXXXX_devices.c and do you call that function from your board init?
Can you list me what that bootstrap does initialize differently if mci is enabled?
Best Regards,
Reinhard
PATCH 1/1 AT91: add SD/MMC support
Dear Schleifer, Alexander,
Quoted 7 lines
Hello Reinhard,
thanks for your reply.
I checked the register settings and sorted out, that the SDCBUS was initialized in 4-bit mode by the bootstrap.So I added the explicit initialization when port A is used:
Quoted 7 lines
#if
defined(CONFIG_ATMEL_MCI_PORTB)
mmci_writel(SDCR, (MMCI_BF(SCDSEL, 1)
|MMCI_BF(SCDBUS, 0)));
#else
mmci_writel(SDCR, (MMCI_BF(SCDSEL, 0)
|MMCI_BF(SCDBUS, 0)));
#endif
Arghh, thats why getting the "geometry" worked, but not a block read.
And you were right, the new driver would have handled that correctly :)
Since currently the new driver is among the "newest" in my series of changes here, I'll have to try to rebase to get it to the "oldest" position.
Reinhard
PATCH v3 1/1 AT91: MCI: add SD/MMC driver using mmc framework
This patch adds SD/MMC support to AT91SAM9260/9XE/9G20 using the generic MMC framework.
---
The driver itself is not dependent on any particular AT91 or AVR32 device, but further work in device specific files is required to enable its use for other AT91 (and AVR32) devices:
at91<*>_devices.c, hardware.h, at91<*>.h.
Patches welcome!
arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c | 21 ++ arch/arm/include/asm/arch-at91/at91_common.h | 1 + arch/arm/include/asm/arch-at91/clk.h | 5 + arch/arm/include/asm/arch-at91/hardware.h | 1 + doc/README.atmel_mci | 86 +++++ drivers/mmc/Makefile | 5 +- drivers/mmc/atmel_mci.h | 48 +++- drivers/mmc/gen_atmel_mci.c | 353 +++++++++++++++++++++ include/mmc.h | 15 +- 9 files changed, 530 insertions(+), 5 deletions(-) create mode 100644 doc/README.atmel_mci create mode 100644 drivers/mmc/gen_atmel_mci.c
arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c +21 -0
@@ -194,3 +194,24 @@ void at91_macb_hw_init(void) #endif }#endif + +#if defined(CONFIG_ATMEL_MCI ) || defined(CONFIG_GENERIC_ATMEL_MCI ) +void at91_mci_hw_init (void ) +{ +at91_set_a_periph (AT91_PIO_PORTA ,8 ,1 );/* MCCK */ +#if defined(CONFIG_ATMEL_MCI_PORTB ) +at91_set_b_periph (AT91_PIO_PORTA ,1 ,1 );/* MCCDB */ +at91_set_b_periph (AT91_PIO_PORTA ,0 ,1 );/* MCDB0 */ +at91_set_b_periph (AT91_PIO_PORTA ,5 ,1 );/* MCDB1 */ +at91_set_b_periph (AT91_PIO_PORTA ,4 ,1 );/* MCDB2 */ +at91_set_b_periph (AT91_PIO_PORTA ,3 ,1 );/* MCDB3 */ +#else +at91_set_a_periph (AT91_PIO_PORTA ,7 ,1 );/* MCCDA */ +at91_set_a_periph (AT91_PIO_PORTA ,6 ,1 );/* MCDA0 */ +at91_set_a_periph (AT91_PIO_PORTA ,9 ,1 );/* MCDA1 */ +at91_set_a_periph (AT91_PIO_PORTA ,10 ,1 );/* MCDA2 */ +at91_set_a_periph (AT91_PIO_PORTA ,11 ,1 );/* MCDA3 */ +#endif +} +#endif +
arch/arm/include/asm/arch-at91/at91_common.h +1 -0
@@ -27,6 +27,7 @@void at91_can_hw_init (void );void at91_macb_hw_init (void ); +void at91_mci_hw_init (void );void at91_serial_hw_init (void );void at91_serial0_hw_init (void );void at91_serial1_hw_init (void );
arch/arm/include/asm/arch-at91/clk.h +5 -0
@@ -59,5 +59,10 @@ static inline unsigned long get_twi_clk_rate(unsigned int dev_id) return get_mck_clk_rate(); } +static inline unsigned long get_mci_clk_rate (void ) +{ +return get_mck_clk_rate (); +} +int at91_clock_init (unsigned long main_clock);#endif /* __ASM_ARM_ARCH_CLK_H__ */
arch/arm/include/asm/arch-at91/hardware.h +1 -0
@@ -20,6 +20,7 @@#include <asm/arch-at91/at91rm9200.h> #elif defined(CONFIG_AT91SAM9260 ) || defined(CONFIG_AT91SAM9G20 )#include <asm/arch/at91sam9260.h> +#define AT91_BASE_MCI AT91SAM9260_BASE_MCI#define AT91_BASE_SPI AT91SAM9260_BASE_SPI0#define AT91_ID_UHP AT91SAM9260_ID_UHP#define AT91_PMC_UHP AT91SAM926x_PMC_UHP
doc/README.atmel_mci new file +86 -0
86 lines not on this page · raw message
drivers/mmc/Makefile +3 -2
@@ -25,12 +25,13 @@ include $(TOPDIR)/config.mk LIB := $(obj)libmmc.a -COBJS-$(CONFIG_GENERIC_MMC) += mmc.o COBJS-$(CONFIG_ATMEL_MCI) += atmel_mci.o COBJS-$(CONFIG_BFIN_SDH) += bfin_sdh.o -COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o +COBJS-$(CONFIG_GENERIC_MMC) += mmc.o +COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o +COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o COBJS := $(COBJS-y)
drivers/mmc/atmel_mci.h +46 -2
60 lines not on this page · raw message
drivers/mmc/gen_atmel_mci.c new file +353 -0
353 lines not on this page · raw message
include/mmc.h +14 -1
@@ -179,6 +179,16 @@ struct mmc_cid {char pnm[7 ]; }; +/* +* WARNING! +* +* This structure is used by atmel_mci.c only. +* It works for the AVR32 architecture but NOT +* for ARM/AT91 architectures. +* Its use is highly depreciated. +* After the atmel_mci.c driver for AVR32 has +* been replaced this structure will be removed. +*/ struct mmc_csd { u8 csd_structure:2,
@@ -275,7 +285,10 @@ int mmc_set_dev(int dev_num);void print_mmc_devices (char separator);int board_mmc_getcd (u8 *cd,struct mmc *mmc); -#ifndef CONFIG_GENERIC_MMC +#ifdef CONFIG_GENERIC_MMC +int atmel_mci_init (void *regs); +#else int mmc_legacy_init (int verbose);#endif +#endif /* _MMC_H_ */
Signature · 1 line
1.5.6.5
PATCH v3 1/1 AT91: MCI: add SD/MMC driver using mmc framework
Quoted 11 lines · Reinhard Meyer
This patch adds SD/MMC support to AT91SAM9260/9XE/9G20 using the generic MMC framework.
Signed-off-by Reinhard Meyer <[email protected]>---
The driver itself is not dependent on any particular AT91 or AVR32 device, but further work in device specific files is required to enable its use for other AT91 (and AVR32) devices:
at91<*>_devices.c,hardware.h, at91<*>.h.
Patches welcome!
Quoted 10 lines
arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c | 21 ++ arch/arm/include/asm/arch-at91/at91_common.h | 1 + arch/arm/include/asm/arch-at91/clk.h | 5 + arch/arm/include/asm/arch-at91/hardware.h | 1 + doc/README.atmel_mci | 86 +++++ drivers/mmc/Makefile | 5 +- drivers/mmc/atmel_mci.h | 48 +++- drivers/mmc/gen_atmel_mci.c | 353 +++++++++++++++++++++ include/mmc.h | 15 +- 9 files changed, 530 insertions(+), 5 deletions(-)
Applied to u-boot-atmel/next
Thanks,
Reinhard
Xu
PATCH 1/1 AT91: add SD/MMC support
In reply to asc0Hi Alex,
Thanks to Reinhard, his previous work does well on SAM9260 SAM9G20 SAM9XE SAM9RL (I tested all of them). Since he said he'll provide a more fancy one, I'm just on hold :-)
For your issue, could you try (If you're using the original EK board from Atmel)
Remove R42
- or -
In at91_mci_hw_init() @ arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c , Add a line
at91_set_pio_input(AT91_PIO_PORTA, 2, 0);
This will let the CLK line of dataflash appear high resistance state. (By default, the CLK line of dataflash and SD slot are connected together by a 0R resistor)
BR,
Eric
Quoted 33 lines
-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of asc0
Sent: 2010?8?13? 18:19
To: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH v2a] AT91: add SD/MMC supportHello! I have successfully applied your patch on a AT91SAM9G20 cpu and it reads the correct CID & CSD info. At the end of initialization the bread function fails with the following
error:mmc: bread failed, status =
0040c0e5, card status = 00000900Does someone else received this error or have a hint on this error message?
Thanks,
Alex
--
View this message in context:
http://old.nabble.com/-U-Boot---PATCH--AT91SAM9260-9XE%3A-add-
support-for-MultiMedia-Card-Interface-%28MCI%29-tp29068839p294 27373.html
Sent from the Uboot - Users mailing list archive at Nabble.com._______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Schleifer
PATCH 1/1 AT91: add SD/MMC support
Hi Eric,
Thanks for your reply. I sorted out, that the AT91Bootstrap impacts the U-Boot. See http://lists.denx.de/pipermail/u-boot/2010-August/075646.html.
I am using a hardware which is based on the EK board from Atmel and I will try out the new driver patch from Reinhard to see if it helps me out.
Best regards,
Alex
-----Original Message-----
From: Xu, Hong [mailto:Hong.Xu at atmel.com]
Sent: Monday, August 16, 2010 4:04 AM
To: Schleifer, Alexander
Cc: u-boot at lists.denx.de; u-boot at emk-elektronik.de
Subject: RE: [U-Boot] [PATCH v2a] AT91: add SD/MMC support
Hi Alex,
Thanks to Reinhard, his previous work does well on SAM9260 SAM9G20 SAM9XE SAM9RL (I tested all of them). Since he said he'll provide a more fancy one, I'm just on hold :-)
For your issue, could you try (If you're using the original EK board from Atmel)
Remove R42
- or -
In at91_mci_hw_init() @ arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c , Add a line
at91_set_pio_input(AT91_PIO_PORTA, 2, 0);
This will let the CLK line of dataflash appear high resistance state. (By default, the CLK line of dataflash and SD slot are connected together by a 0R resistor)
BR,
Eric
Quoted 33 lines
-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of asc0
Sent: 2010?8?13? 18:19
To: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH v2a] AT91: add SD/MMC supportHello! I have successfully applied your patch on a AT91SAM9G20 cpu and it reads the correct CID & CSD info. At the end of initialization the bread function fails with the following
error:mmc: bread failed, status =
0040c0e5, card status = 00000900Does someone else received this error or have a hint on this error message?
Thanks,
Alex
--
View this message in context:
http://old.nabble.com/-U-Boot---PATCH--AT91SAM9260-9XE%3A-add-
support-for-MultiMedia-Card-Interface-%28MCI%29-tp29068839p294 27373.html
Sent from the Uboot - Users mailing list archive at Nabble.com._______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot