📄 lib_sdram.c
字号:
//*----------------------------------------------------------------------------//* ATMEL Microcontroller Software Support - ROUSSET -//*----------------------------------------------------------------------------//* The software is delivered "AS IS" without warranty or condition of any//* kind, either express, implied or statutory. This includes without//* limitation any warranty or condition with respect to merchantability or//* fitness for any particular purpose, or against the infringements of//* intellectual property rights of others.//*----------------------------------------------------------------------------//* File Name : lib_sdram.c//* Object : //*//* 1.0 06/25/02 ED : SDRAM Controller test//* 1.1 15/05/2003 : address range added //*----------------------------------------------------------------------------#include "main.h"//#include <stdio.h>//#include "periph/stdc/std_c.h"/*----------------*//* Standard types *//*----------------*/typedef unsigned int u_int ;typedef unsigned short u_short ;typedef unsigned char u_char ;#define ARM_CODE 0#define THUMB_CODE 1#define SDRAM_BASE 0x0#define SDRAM_BASE_ADDR 0x20000000#define SDRAM_SIZE (64*1024*1024) // 64Mbytes#define SDRAMCPY_START (SDRAM_BASE_ADDR + 0x00FC4000) // choosed to activate #define SDRAMCPY_STOP (SDRAM_BASE_ADDR + 0x01055870) // all address bitsextern u_int ExecuteTest (u_int *address, u_int arm);//*----------------------------------------------------------------------------//* Function Name : AT91F_SDRAM_Test//* Object : //*----------------------------------------------------------------------------int AT91F_SDRAM_Test (void){ u_int *pmemcr; u_int code_length; u_int loop_count; pmemcr = (u_int *)SDRAMCPY_START; loop_count = 0; do { // Execute Thumb code code_length = ExecuteTest(pmemcr, THUMB_CODE); // Execute ARM code code_length = ExecuteTest(pmemcr, ARM_CODE); // Updating loop count loop_count ++; // Updating code load address pmemcr = (u_int *) ( (u_int)pmemcr + (u_int)code_length ); } while ( (u_int)pmemcr < (u_int)SDRAMCPY_STOP );// while ( loop_count < 0xd7a /*( ( ( u_int ) SDRAMCPY_STOP - ( u_int ) SDRAMCPY_START / code_length )*/) ; return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -