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

Reinhard Meyer u-boot at emk-elektronik.de
Fri Aug 13 20:07:42 CEST 2010


Claudio Mignanti wrote:
> 2010/8/7 Reinhard Meyer <reinhard.meyer at emk-elektronik.de>:
>> Wolfgang Denk wrote:
>>> Dear Claudio Mignanti,
>>>
>>> In message <AANLkTikkNw19U8yiQokqyE-WxjuO4b8RwqO-IBPa18W3 at 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.


More information about the U-Boot mailing list