⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scatter_load.c

📁 s3c6410基于USB OTG下载内核至NORFLASH的源代码
💻 C
字号:
/**************************************************************************************
* 
*	Project Name : S3C6410 Validation
*
*	Copyright 2006 by Samsung Electronics, Inc.
*	All rights reserved.
*
*	Project Description :
*		This software is only for validating functions of the S3C6410.
*		Anybody can use this software without our permission.
*  
*--------------------------------------------------------------------------------------
* 
*	File Name : scatter_load.c
*  
*	File Description : This file implements the scatterloading function.
*
*	Author : Haksoo,Kim
*	Dept. : AP Development Team
*	Created Date : 2007/02/16
*	Version : 0.1 
* 
*	History
*	- Created(Haksoo,Kim 2007/02/16)
*  
**************************************************************************************/

#if (USE_SCATTER_LOAD==1)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#include "option.h"

void ScatterMemcpy (volatile u32* d, volatile u32* s, u32 l)
{
  volatile u32 i;

  for (i=0,l/=4 ; i<l ; i++)
    d[i] = s[i];
}

void ScatterMemset (volatile u32* d, u32 v, u32 l)
{
  volatile u32 i;

  for (i=0,l/=4 ; i<l ; i++)
    d[i] = v;
}

void ScatterLoad (void)
{
  extern u32 Load$$DRAM$$Base, Image$$DRAM$$Base, Image$$DRAM$$Length, Image$$DRAM$$ZI$$Base, Image$$DRAM$$ZI$$Length;
  
  if (&Load$$DRAM$$Base != &Image$$DRAM$$Base)
    ScatterMemcpy(&Image$$DRAM$$Base, &Load$$DRAM$$Base, (u32)&Image$$DRAM$$Length);
  if ((u32)&Image$$DRAM$$ZI$$Length != 0)
    ScatterMemset(&Image$$DRAM$$ZI$$Base, 0, (u32)&Image$$DRAM$$ZI$$Length);
    
  return;
}
#endif

⌨️ 快捷键说明

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