📄 norflash_main.c
字号:
/***************************************优龙科技责任有限公司*********************************************
**--------------文件信息--------------------------------------------------------------------------------
**文 件 名: NorFlash_Main.c
**创 建 人: hzh
**最后修改日期: 2005-11-28
**描 述: PXA270的主程序
**
********************************************************************************************************/
#include <stdio.h>
#include <string.h>
#include "systypes.h"
#include "XsIntCtrlApi.h"
#include "utils.h"
#include "norflash.h"
#define GPLR0 *(volatile UINT *)0x40E00000
#define GPLR2 *(volatile UINT *)0x40E00008
#define GPSR0 *(volatile UINT *)0x40E00018
#define GPCR0 *(volatile UINT *)0x40E00024
#define GAFR3_U *(volatile UINT *)0x40E00070
#define MDCNFG *(volatile UINT *)0x48000000
#define MDREFR *(volatile UINT *)0x48000004
#define MSC0 *(volatile UINT *)0x48000008
#define MSC1 *(volatile UINT *)0x4800000C
#define MSC2 *(volatile UINT *)0x48000010
typedef unsigned char U8;
typedef unsigned short U16;
typedef unsigned int U32;
UINT downloadAddress, downloadFileSize;
#define ESC_KEY 0x1b
#define ENTER_KEY 0x0d
#define BACK_KEY 0x08
/*****************************************************************************
** 函数名称: PlatformMain
** 功能描述: PXA270平台主函数
** 输 入: 无
** 输 出 : 无
** 全局变量: 无
** 调用模块: 无
** 作 者:
** 日 期:
**----------------------------------------------------------------------------
*****************************************************************************/
void TestNorFlash(void);
void PlatformMain(void * memTop)
{
int i, sel, ks1, ks2;
// mdelay(100);
int boot_flag=1;
show_led(1, 1); //D4 light
show_led(2, 1); //D5 light
SerialConsoleInit(115200); //
SerialConsleSel(0); //0->FFUART, 1->BTUART
//配置存储器控制寄存器,主要是为配置BANK的相关参数
MSC0 = (MSC0&0xffff)|0x94690000;
MSC1 = 0xB8C9B8DC;
MSC2 = 0xFFF99134; //lan91c111
ChkNorFlash(); //检测NOR FLASH
printf("Nor Flash Test\n");
TestNorFlash();
}
//DumpProcessorRegisters do nothing
VOID DumpProcessorRegisters(UINT exception, void *regsP)
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -