hellow to all
I want to use EMIFA ROM Direct Boot about 6437.when i write the boot code with asm, it is sucess, but when I
use the c instead of asm, it fails. I can not make out, I think it is same the c and the asm.
the EMIF bus is 8bit
the asm is:
CODE_START .equ 0x10800400
CODE_SIZE .equ 0x00004000
COPY_TABLE .equ 0x42000400
.sect ".boot_load"
.global _boot
.ref _c_int00
_boot:
*************************************************************
zero B1
_myloop:
nop 5
_myloopend: nop
mvkl EMIFA_AWCC,B4
mvkh EMIFA_AWCC,B4
mvkl 0x00000380,A4
mvkh 0x00000380,A4
stw A4,*B4
mvkl 0x01E00010,B4
mvkh 0x01E00010,B4
mvkl 0x0050043C,A4
mvkh 0x0050043C,A4
stw A4,*B4
mvkl COPY_TABLE,B4
mvkh COPY_TABLE,B4
mvkl CODE_START,A4
mvkh CODE_START,A4
zero A1
_boot_loop1:
ldb *B4++,B5 ; flash read
mvkl CODE_SIZE,B6 ; B6 = CODE_SIZE -1024
add 1,A1,A1
|| mvkh CODE_SIZE,B6
cmplt A1,B6,B0
nop
stb B5,*A4++
[B0] b _boot_loop1
nop 5
mvkl .S2 _c_int00, B0
mvkh .S2 _c_int00, B0
B .S2 B0
nop 5
the C is:
extern far void c_int00(void);
#pragma CODE_SECTION (boot,".boot_load");
#define CODE_START 0x10800400
#define CODE_SIZE 0x00004000
#define COPY_TABLE 0x42000400
#define AEMIF_BASE 0x01E00000
#define AWCCR ( unsigned int* )( 0x01E00004 )
#define A1CR ( unsigned int* )( 0x01E00010 )
void boot(void)
{
unsigned int num_i = 0 ;
*( unsigned int* )( 0x01E00004 ) = 0x00000380; //AWCCR
*( unsigned int* )( 0x01E00010 ) = 0x0050043C; //EMIF A1CR
for (num_i = 0; num_i < 0x00004000 ;num_i++ )
*(unsigned char *)(0x10800400 + num_i) = *(unsigned char *)(0x42000400 + num_i) ;
c_int00();
}
the CMD is:
-l rts64plus.lib
-l evmdm6437bsl.lib
-stack 0x00000800 /* Stack Size */
-heap 0x00000800 /* Heap Size */
MEMORY
{
BOOT: o = 0x10800000 l = 0x00000400
IRAM: o = 0x10800400 l = 0x0001FA00
DDR2: o = 0x80000000 l = 0x10000000
}
SECTIONS
{
.boot_load > BOOT
.bss > IRAM
.cinit > IRAM
.cio > IRAM
.const > IRAM
.data > IRAM
.far > IRAM
.stack > IRAM
.switch > IRAM
.sysmem > IRAM
.text > IRAM
.ddr2 > DDR2
}
Can you tell me the difference??
I also want to ask the code " #pragma CODE_SECTION (boot,".boot_load")"
when i use this ,the code and the data in fun of "boot" will all in the the .boot_load?? also the code only???