hello:
I'm writing a boot program on dm6437, the boot mode is EMIFA ROM Fastboot without AIS. For it is the first time that I do this work, I have many problems undetermined.
The method i take is as follows:
I new a project with only two files, .cmd file and .c file, which are as follows:
the .cmd file:
MEMORY{
BOOTADDR : o = 0x00100000, l = 0x00010000
EMIFCS2 : o = 0x42000000, l = 0x01000000
}
SECTIONS{
.text : > BOOTADDR
.const : > EMIFCS2
.cinit : > EMIFCS2
}
The .c file is as follows:
#include <std.h>
#define BOOTCFG *( unsigned int* )( 0x01c40014 )
#define PLLCTL1 *( unsigned int* )( 0x01c40900 )
#define PLLM1 *( unsigned int* )( 0x01c40910 )
#define PLLCTL2 *( unsigned int* )( 0x01c40D00 )
#define PLLM2 *( unsigned int* )( 0x01c40D10 )
void main()
{
Uint32 * u32EmifCS2;
Uint32 * u32L2;
int i;
//Configure PLL1 with PLL mode
Uint32 pllms = ( BOOTCFG >> 12 ) & 0x7;
switch(pllms)
{
case 0 : PLLM1 = 19;
case 1 : PLLM1 = 14;
case 2 : PLLM1 = 15;
case 3 : PLLM1 = 17;
case 4 : PLLM1 = 21;
case 5 : PLLM1 = 24;
case 6 : PLLM1 = 26;
case 7 : PLLM1 = 29;
default: ;
}
PLLCTL1 = 0x0073; //PLL mode
//read 1KB code from CS2(0x42000000) to L2(0x10800000)
u32EmifCS2 = ( Uint32* )(0x42000000);
u32L2 = ( Uint32* )(0x10800000);
for( i=0; i<256; i++ )
{
u32L2[i] = u32EmifCS2[i];
}
}
Is there any other work i should do in this project? And is there a demo program i can reference to?
Thank you!
Hanshuai.