Avnet Electronics Marketing - Community Forum
    |   
 
Home Design Services My Account About Avnet
Reply
Contributor
pankaj2701
Posts: 11
Registered: ‎07-04-2011
0

EMIF clock frequency

Hello,

 

What files should be modified to change the EMIF clk frequency. In my OMAP spartan6 board after startup the default EMIF clk frequency is being set at 25 MHz. I want to increase it to 100 Mhz.

 

Regards

Pankaj

Avnet Employee
AlbertaBeef
Posts: 319
Registered: ‎04-16-2009
0

Re: EMIF clock frequency

Pankaj,

 

This is documented in the OMAP-L138 datasheet.

 

The EMIFA clock frequency can be either:

- SYSCLK3

- PLL0 output clock divided by 4.5

 

The attached image illustrates this.

 

Regards,

 

Mario.

Contributor
pankaj2701
Posts: 11
Registered: ‎07-04-2011
0

Re: EMIF clock frequency

Hi,

 

Sorry I didn't make my question clear.  I am able to change the frequency by modifying the PLL registers through command line of u-boot. But I am unable to do so in Linux. I wanted to know the location of source code where the clocks are being initialized in linux.

 

Regards

Pankaj

Avnet Employee
JohnW
Posts: 93
Registered: ‎04-20-2009
0

Re: EMIF clock frequency

Pankaj,

 

You need to get really comfortable with the Linux kernel.  Don't be afraid to explore.

 

Our kernel is essentially the same kernel as the one in the OMAP-L138 EVM and eXperimenter kit.  I haven't tried changing the clock myself, but I hope that I can point you to the right files and some code and you can do the rest for yourself.

 

Look at the following files:

arch/arm/mach-davinci/board-da850-evm.c

arch/arm/mach-davinci/da580.c

 

These files contain some low-level initialization code for the chip and board.

 

If you do a search for 'emif' in these files, it will lead you to the following.

 

In da850.c:

static struct clk emif3_clk = {
        .name           = "emif3",
        .parent         = &pll0_sysclk5,
        .lpsc           = DA8XX_LPSC1_EMIF3C,
        .gpsc           = 1,
        .flags          = ALWAYS_ENABLED,
};

 

....further down in the file:

static struct clk aemif_clk = {
        .name           = "aemif",
        .parent         = &pll0_sysclk3,
        .lpsc           = DA8XX_LPSC0_EMIF25,
};

 

These structs get plugged into a big clock table, that in turn gets plugged into a larger structure that is used to initialize the chip.  Look at arch/arm/mach-davinci/clock.c (contains the clock init code that loops through the big clock table and inits/registers the clocks) and arch/arm/mach-davinci/common.c  (contains the common DaVinci init routine) in this directory as well.

 

John