[U-Boot] [PATCH] Fix typo inside atmel_mci driver

The function get_mci_clk_rate is used inside atmel_mci driver but never defined. Fix this typo.
Signed-off-by: Claudio Mignanti c.mignanti@gmail.com --- drivers/mmc/atmel_mci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/atmel_mci.c b/drivers/mmc/atmel_mci.c index 3946ffe..628aac9 100644 --- a/drivers/mmc/atmel_mci.c +++ b/drivers/mmc/atmel_mci.c @@ -67,7 +67,7 @@ static void mci_set_mode(unsigned long hz, unsigned long blklen) unsigned long bus_hz; unsigned long clkdiv;
- bus_hz = get_mci_clk_rate(); + bus_hz = get_mck_clk_rate(); clkdiv = (bus_hz / hz) / 2 - 1;
pr_debug("mmc: setting clock %lu Hz, block size %lu\n",

2010/6/22 Claudio Mignanti c.mignanti@gmail.com:
The function get_mci_clk_rate is used inside atmel_mci driver but never defined. Fix this typo.
No comment on this topic.

Dear Claudio Mignanti,
In message AANLkTikkNw19U8yiQokqyE-WxjuO4b8RwqO-IBPa18W3@mail.gmail.com you wrote:
The function get_mci_clk_rate is used inside atmel_mci driver but never defined. Fix this typo.
Well, it is certainly defined in arch/avr32/include/asm/arch-at32ap700x/clk.h:
74 #ifdef AT32AP700x_CHIP_HAS_MMCI 75 static inline unsigned long get_mci_clk_rate(void) 76 { 77 return get_pbb_clk_rate(); 78 } 79 #endif
--- a/drivers/mmc/atmel_mci.c +++ b/drivers/mmc/atmel_mci.c @@ -67,7 +67,7 @@ static void mci_set_mode(unsigned long hz, unsigned long blklen) unsigned long bus_hz; unsigned long clkdiv;
- bus_hz = get_mci_clk_rate();
- bus_hz = get_mck_clk_rate();
Are you sure this patch is working and does not break anything?
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
Dear Claudio Mignanti,
In message AANLkTikkNw19U8yiQokqyE-WxjuO4b8RwqO-IBPa18W3@mail.gmail.com you wrote:
The function get_mci_clk_rate is used inside atmel_mci driver but never defined. Fix this typo.
Thats NOT a typo. The current atmel_mci.c is for AVR32 ONLY.
Well, it is certainly defined in arch/avr32/include/asm/arch-at32ap700x/clk.h:
74 #ifdef AT32AP700x_CHIP_HAS_MMCI 75 static inline unsigned long get_mci_clk_rate(void) 76 { 77 return get_pbb_clk_rate(); 78 } 79 #endif
--- a/drivers/mmc/atmel_mci.c +++ b/drivers/mmc/atmel_mci.c @@ -67,7 +67,7 @@ static void mci_set_mode(unsigned long hz, unsigned long blklen) unsigned long bus_hz; unsigned long clkdiv;
- bus_hz = get_mci_clk_rate();
- bus_hz = get_mck_clk_rate();
Are you sure this patch is working and does not break anything?
It will break on the AVR32 architecture. Besides, the current atmel_mci.c driver WILL NOT work on the AT91SAM9. My patch from 07-Jul-10 fixes all issues and makes it work on AT91SAM9.
Reinhard

2010/8/7 Reinhard Meyer reinhard.meyer@emk-elektronik.de:
Wolfgang Denk wrote:
Dear Claudio Mignanti,
In message AANLkTikkNw19U8yiQokqyE-WxjuO4b8RwqO-IBPa18W3@mail.gmail.com you wrote:
The function get_mci_clk_rate is used inside atmel_mci driver but never defined. Fix this typo.
Thats NOT a typo. The current atmel_mci.c is for AVR32 ONLY.
With the proposed patch I successfully use this driver on at91sam9g20! Probabily they share the same mci controller I don't know, I want only report this experience.
U-Boot 2009.08 (Dec 22 2009 - 13:15:07)
CPU: AT91SAM9G20 Crystal frequency: 18.432 MHz CPU clock : 396.288 MHz Master clock : 132.096 MHz DRAM: 64 MB DataFlash:AT45DB642 Nb pages: 8192 Page Size: 1056 Size= 8650752 bytes .... u-boot> mmc init mmc: setting clock 150000 Hz, block size 512 mmc: clock 150000 too low; setting CLKDIV to 255 Manufacturer ID: 1B OEM/Application ID: 534D Product name: UD Product Revision: 1.0 Product Serial Number: 3550481429 Manufacturing Date: 07/10 SD Card detected (RCA 45928) CSD data: 32002f00 000195f5 feb6df33 0009a5fc CSD structure version: 1.0 MMC System Spec version: 0 Card command classes: 5f5 Read block length: 512
Supports partial reads Write block length: 512 Does not support partial writes Supports group WP: 16 Card capacity: 510132224 bytes File format: 0/0 Write protection: mmc: Using 3145728 cycles data timeout (DTOR=0x73) mmc: setting clock 5000000 Hz, block size 512 .mmc1 is available

Claudio Mignanti wrote:
2010/8/7 Reinhard Meyer reinhard.meyer@emk-elektronik.de:
Wolfgang Denk wrote:
Dear Claudio Mignanti,
In message AANLkTikkNw19U8yiQokqyE-WxjuO4b8RwqO-IBPa18W3@mail.gmail.com you wrote:
The function get_mci_clk_rate is used inside atmel_mci driver but never defined. Fix this typo.
Thats NOT a typo. The current atmel_mci.c is for AVR32 ONLY.
With the proposed patch I successfully use this driver on at91sam9g20! Probabily they share the same mci controller I don't know, I want only report this experience.
NAK. That will break the driver for AVR32.
The correct way is to add get_mci_clk_rate() to clk.h:
diff --git a/arch/arm/include/asm/arch-at91/clk.h b/arch/arm/include/asm/arch-at91/clk.h index f642dd9..457e6c9 100644 --- a/arch/arm/include/asm/arch-at91/clk.h +++ b/arch/arm/include/asm/arch-at91/clk.h @@ -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__ */
On AVR32 there is no MCK and each peripherals' clock can be prescaled individually. Its just that the current AT91 have all clocks the same.
Best Regards, Reinhard
PS: that driver will soon become obsolete, because a new, mmc framework based driver is in the mold already.
participants (4)
-
Claudio Mignanti
-
Reinhard Meyer
-
Reinhard Meyer
-
Wolfgang Denk