* [U-Boot] [PATCH] Fix typo inside atmel_mci driver
@ 2010-06-22 19:15 Claudio Mignanti
2010-06-30 8:23 ` Claudio Mignanti
2010-08-06 23:17 ` Wolfgang Denk
0 siblings, 2 replies; 6+ messages in thread
From: Claudio Mignanti @ 2010-06-22 19:15 UTC (permalink / raw)
To: u-boot
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",
--
1.7.0.4
--
Claudio
- OpenWrt Developer - Hardware designer -
pub 1024D/0DFD7CBB C94D 759A 2EF0 172F 9673 65E4 C4C1 8627 0DFD 7CBB
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] Fix typo inside atmel_mci driver
2010-06-22 19:15 [U-Boot] [PATCH] Fix typo inside atmel_mci driver Claudio Mignanti
@ 2010-06-30 8:23 ` Claudio Mignanti
2010-08-06 23:17 ` Wolfgang Denk
1 sibling, 0 replies; 6+ messages in thread
From: Claudio Mignanti @ 2010-06-30 8:23 UTC (permalink / raw)
To: u-boot
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] Fix typo inside atmel_mci driver
2010-06-22 19:15 [U-Boot] [PATCH] Fix typo inside atmel_mci driver Claudio Mignanti
2010-06-30 8:23 ` Claudio Mignanti
@ 2010-08-06 23:17 ` Wolfgang Denk
2010-08-06 23:40 ` Reinhard Meyer
1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2010-08-06 23:17 UTC (permalink / raw)
To: u-boot
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
--
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
Bus error -- driver executed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] Fix typo inside atmel_mci driver
2010-08-06 23:17 ` Wolfgang Denk
@ 2010-08-06 23:40 ` Reinhard Meyer
2010-08-13 11:30 ` Claudio Mignanti
0 siblings, 1 reply; 6+ messages in thread
From: Reinhard Meyer @ 2010-08-06 23:40 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] Fix typo inside atmel_mci driver
2010-08-06 23:40 ` Reinhard Meyer
@ 2010-08-13 11:30 ` Claudio Mignanti
2010-08-13 18:07 ` Reinhard Meyer
0 siblings, 1 reply; 6+ messages in thread
From: Claudio Mignanti @ 2010-08-13 11:30 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] Fix typo inside atmel_mci driver
2010-08-13 11:30 ` Claudio Mignanti
@ 2010-08-13 18:07 ` Reinhard Meyer
0 siblings, 0 replies; 6+ messages in thread
From: Reinhard Meyer @ 2010-08-13 18:07 UTC (permalink / raw)
To: u-boot
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.
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-08-13 18:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-22 19:15 [U-Boot] [PATCH] Fix typo inside atmel_mci driver Claudio Mignanti
2010-06-30 8:23 ` Claudio Mignanti
2010-08-06 23:17 ` Wolfgang Denk
2010-08-06 23:40 ` Reinhard Meyer
2010-08-13 11:30 ` Claudio Mignanti
2010-08-13 18:07 ` Reinhard Meyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox