2443mon_u.cpp

来自「sansumg s3c2443 bootload 的源码」· C++ 代码 · 共 74 行

CPP
74
字号
/**
* Project Name : S3C2443 verification project
*
* Copyright 2006 by Samsung Electronics, Inc.
* All rights reserved.
*
* Project Description :
* This software is only for verifying functions of the S3C2443. 
* Anybody can use this code without our permission.
*/
#include "def.h"
#include "config.h"
#include "nand.h"
#include "MMUCACHE.H"

void (*run) (void);

DWORD JumpAddr;

DWORD ReadImageFromNand(DWORD dwEntry, DWORD dwSig);

INT32 FIL_Init(void);

int main(void)
{
	DWORD err; 
	
	MMU_EnableICache();

	NAND_Init();
	
	err = ReadImageFromNand(0,0);

	if(err)
	{
		while(1);	
	}
	else 
	{
		run = (void (*)(void))JumpAddr;
		run();
	}	


}

DWORD
ReadImageFromNand(DWORD dwEntry, DWORD dwSig)
{
	DWORD dwStartSector, dwTotalSectors, dwPageStart, dwPageTotal;
	DWORD dwRAM;
	DWORD dwStatus;
	
	int i,j;

	dwPageStart = 6;//changes 0117  fix issue for pair effect
	dwPageTotal = NAND_BLOCK_PAGE-2-dwPageStart;

	dwRAM =IPL_RUN_ADDRESS;
	JumpAddr = IPL_RUN_ADDRESS;

	// Load the disk image directly into RAM
	for(i = dwPageStart; i<dwPageTotal ;i++)
	{
		if (NAND_Read(0, i, (unsigned char *)dwRAM))
		{
			while(1);
		}
		dwRAM += NAND_PAGE_SIZE;
	}
	
	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?