Linux on AT91RM9200

Nov 27, 2003 9 Replies

Hello,



I'm designing a system based on ATMEL AT91RM9200 SOC.



The system will run under Linux.



I've couple of quetsion regarding processor initialisation code.



I'm trying to find this code in the linux 2.4 kernel sources and unable to locate it. In particular i'm looking for the code initializing the processor internal PLLs and selecting the master clock source.



Looking in the include/asm-arm/arch-at91rm9200/at91rm9200dk.h



i see following code and comments



#define AT91C_MAIN_CLOCK 179712000 /* from 18.432 MHz crystal (18432000 / 4



  • 39) */ #define AT91C_MASTER_CLOCK 59904000 /* peripheral clock (AT91C_MASTER_CLOCK / 3) */

BTW the second comment id erroneous it should be /* peripheral clock (AT91C_MAIN_CLOCK / 3) */


These 4 and 39 constants are apparently parameters for PLL divider and multiplyer But i'm unable to locate the code where these values are actually programmed into the PLL control registers.



My hardware will be a subset of at91rm9200dk with a twist. I'd like to scrap the 50 MHZ oscilator used to drive RMII REFCLK and istead to connect the at91rm9200 to the 25 Mhz crystal and derive then the 50MHZ from one of the PMC outputs.



Any suggestions or pointers? Thanks Vadim Lebedev CTO



7Chips






It is not the Linux Kernel's responsibility to do such initialisation - this is done by the bootloader. The Atmel supported version is U-boot - available at sourceforge.

Mhz

Don't do this.

From bitter experience, I can tell you that this won't work. The problem is that a 50MHz clock generated by the PMC is not stable enough for RMII. You will find that Ethernet packets over a certain length (approx 300 bytes) loose synchromisation to the clock and are dropped.

If you want to save the cost of an oscillator, I would suggest using a crystal on your phy and using MII rather than RMII.

Simon

Simon,

Thanks a lot for the advice

Vadim

"Simon Berry" a écrit dans le message de news: snipped-for-privacy@is.co.za...

to

internal

this

available

is

Simon,

I've filed to find the the PLL initialisatoin code int the u-boot source....

Can you please point me to the exact file?

Thanks Vadim

"Simon Berry" a écrit dans le message de news: snipped-for-privacy@is.co.za...

to

internal

this

available

is

There is a file "initboot.c". Function is AT91F_InitClocks

Adrian

Not in the u-boot which is available on sourceforge

Vadim

"Adrian Bica" a écrit dans le message de news: snipped-for-privacy@posting.google.com...

source....

Get the AT91 CD, Das U-Boot there contains what You need.

-- Best Regards Ulf at atmel dot com These comments are intended to be my own opinion and they may, or may not be shared by my employer, Atmel Sweden.

Check the September 2003 CD-ROM for AT91RM9200DK board.

...

Ummm.. why is there soemthing on a proprietary CDROM which is not available on the publich CVS server, too?

Did I reject this???

Best regards,

Wolfgang Denk

Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Web: www.denx.de I am a computer. I am dumber than any human and smarter than any ad- ministrator.

I am not sure, The code is probably in "boot.bin" which is loaded into SRAM at reset. boot.bin will unzip U-boot. I do not know if this is actually considered part of u-boot.

The CD is available free of charge.

-- Best Regards Ulf at atmel dot com These comments are >

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required