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

📄 init.c

📁 mx21 Nor flash Bootloader 源代码
💻 C
字号:
/// @ingroup    AMD_BOOTLOADER/// @file       init.c/// @brief      Init code before booting.////// @remarks    Initialize all peripheral.\n///             Initialize FMCR./// @author     /// @bug        /// @version    $Version$//<<<<<Include#include "../Include/type.h"#include "../Include/mx2.h"//>>>>>Include//<<<<<< Private Macro//<<<<<< Private Structure//>>>>>> Private Macro//<<<<<< Private Structure//>>>>>> Private Structure//<<<<<< Global Variable//>>>>>> Global Variable//<<<<<Private Function Declearation//>>>>>Private Function Declearation//<<<<<Body///Set System to AsynchMode.void SetAsynchMode(void){	__asm__(    	"mrc p15,0,r0,c1,c0,0\n\t"    	"mov r2, #0xC0000000\n\t"    	"orr r0,r2,r0\n\t"    	"mcr p15,0,r0,c1,c0,0\n\t"	);}///Set Fast Bus Modevoid SetFastBusMode(void){	__asm__ (	    "mrc p15,0,r0,c1,c0,0\n\t"	    "mov r2, #0x3FFFFFFF\n\t"	    "and r0,r2,r0\n\t"	    "mcr p15,0,r0,c1,c0,0\n\t"	);    }///Init MX2 Hardwarevoid init(){   	U32 dummy,reg;    // burst-flash initialization       // Initialize all peripheral in AIPI1 PSR[1:0] => 10=32bit, 01=16bit, 00=8bit	 _reg_AIPI1_PSR0 = 0x00040304;	 _reg_AIPI1_PSR1 = 0xFFFBFCFB;    // Initialize all peripheral in AIPI1 PSR[1:0] => 10=32bit, 01=16bit, 00=8bit	_reg_AIPI2_PSR0 = 0x0;	_reg_AIPI2_PSR1 = 0xFFFFFFFF; 	//write to the FMCR [31:24] (CLKMODE[1:0]) in order to get the write enable signal active 	*((volatile unsigned long *)SYS_FMCR) |= 0xAA000000; 			SetAsynchMode();}//>>>>>Body

⌨️ 快捷键说明

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