?? 2410loader_bak.c
字號:
/************************************************
* NAME : 2410loader.C *
* DESC : *
* History : 2002.02.25 ver 0.0 *
************************************************/
#include <stdlib.h>
#include <string.h>
#include "option.h"
#include "def.h"
#include "2410addr.h"
#include "2410slib.h"
#include "2410addr.h"
#include "k9s1208.h"
#define DOWNLOAD_ADDRESS _RAM_STARTADDRESS
#define LED_ON 0xa
#define LED_OFF 0x0
void (*run)(void)=(void (*)(void))(DOWNLOAD_ADDRESS+0x200000);
void Port_Init(void);
void Led_Display(int);
void Delay(int);
volatile unsigned char *downPt;
void Main(void)
{
int i,j,k;
MMU_EnableICache();
#if ADS10
__rt_lib_init(); //for ADS 1.0
#endif
ChangeClockDivider(1,1); // 1:2:4
ChangeMPllValue(0x5c,0x4,0x0); //Fin=12MHz FCLK=200MHz
// ChangeMPllValue(0x70,0x4,0x1); //Fin=12MHz FCLK=120MHz
// ChangeMPllValue(0x52,0x4,0x0); //Fin=12MHz FCLK=180MHz
Port_Init();
//Uart_Init(PCLK, 115200);
//Uart_SendString("[S3C2410 Nand boot loader...]\n");
downPt=(unsigned char *)DOWNLOAD_ADDRESS+0x200000;
NF_Init();
Led_Display(LED_OFF);
//for(j=1;j<=13;j++) // Read 1~13 block(208KB) for test
for(j=1;j<=808;j++) // Read 1~807 block(13635072B) for WinCE image
// k=0;
// j=1;
// while(1) // Read 1~807 block(13635072B) for WinCE image
{
// if(NF_IsBadBlock(j))
// j++;
// j++;
for(i=0;i<32;i++) // Read 32 page
{
if(!NF_ReadPage(j, i, (U8 *)downPt)) //(U32 block,U32 page,U8 *buffer)
{
//Uart_SendString("Loading error!!!\n");
Led_Display(0x8);
}
else
{
downPt += 512;
//Uart_SendString(".");
}
}
// k++;
// if(k==807)
// {
}
Led_Display(LED_ON);
run();
// }
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -