1 //*----------------------------------------------------------------------------
2 //* ATMEL Microcontroller Software Support - ROUSSET -
3 //*----------------------------------------------------------------------------
4 //* The software is delivered "AS IS" without warranty or condition of any
5 //* kind, either express, implied or statutory. This includes without
6 //* limitation any warranty or condition with respect to merchantability or
7 //* fitness for any particular purpose, or against the infringements of
8 //* intellectual property rights of others.
9 //*----------------------------------------------------------------------------
10 //* File Name : init.c
11 //* Object : Low level initialisations written in C
12 //* Creation : HIi 10/10/2003
14 //*----------------------------------------------------------------------------
16 #include "AT91RM9200.h"
17 #include "lib_AT91RM9200.h"
20 //*----------------------------------------------------------------------------
21 //* \fn AT91F_DataAbort
22 //* \brief This function reports an Abort
23 //*----------------------------------------------------------------------------
24 static void AT91F_SpuriousHandler()
31 //*----------------------------------------------------------------------------
32 //* \fn AT91F_DataAbort
33 //* \brief This function reports an Abort
34 //*----------------------------------------------------------------------------
35 static void AT91F_DataAbort()
41 //*----------------------------------------------------------------------------
42 //* \fn AT91F_FetchAbort
43 //* \brief This function reports an Abort
44 //*----------------------------------------------------------------------------
45 static void AT91F_FetchAbort()
51 //*----------------------------------------------------------------------------
52 //* \fn AT91F_UndefHandler
53 //* \brief This function reports that no handler have been set for current IT
54 //*----------------------------------------------------------------------------
55 static void AT91F_UndefHandler()
62 //*--------------------------------------------------------------------------------------
63 //* Function Name : AT91F_InitSdram
64 //* Object : Initialize the SDRAM
65 //* Input Parameters :
66 //* Output Parameters :
67 //*--------------------------------------------------------------------------------------
68 static void AT91F_InitSdram()
72 //* Configure PIOC as peripheral (D16/D31)
75 AT91C_BASE_PIOC
, // PIO controller base address
81 pRegister
= (int *)0xFFFFFF98;
82 *pRegister
= 0x2188c155;
83 pRegister
= (int *)0xFFFFFF90;
85 pRegister
= (int *)0x20000000;
87 pRegister
= (int *)0xFFFFFF90;
89 pRegister
= (int *)0x20000000;
98 pRegister
= (int *)0xFFFFFF90;
100 pRegister
= (int *)0x20000080;
103 pRegister
= (int *)0xFFFFFF94;
105 pRegister
= (int *)0x20000000;
108 pRegister
= (int *)0xFFFFFF90;
110 pRegister
= (int *)0x20000000;
115 //*----------------------------------------------------------------------------
116 //* \fn AT91F_InitFlash
117 //* \brief This function performs low level HW initialization
118 //*----------------------------------------------------------------------------
119 static void AT91F_InitMemories()
121 int *pEbi
= (int *)0xFFFFFF60;
123 //* Setup MEMC to support all connected memories (CS0 = FLASH; CS1=SDRAM)
124 pEbi
= (int *)0xFFFFFF60;
128 pEbi
= (int *)0xFFFFFF70;
136 //*----------------------------------------------------------------------------
137 //* \fn AT91F_LowLevelInit
138 //* \brief This function performs very low level HW initialization
139 //*----------------------------------------------------------------------------
140 void AT91F_LowLevelInit(void)
144 // Init Interrupt Controller
146 AT91C_BASE_AIC
, // pointer to the AIC registers
147 AT91C_AIC_BRANCH_OPCODE
, // IRQ exception vector
148 AT91F_UndefHandler
, // FIQ exception vector
149 AT91F_UndefHandler
, // AIC default handler
150 AT91F_SpuriousHandler
, // AIC spurious handler
153 // Perform 8 End Of Interrupt Command to make sýre AIC will not Lock out nIRQ
155 AT91F_AIC_AcknowledgeIt(AT91C_BASE_AIC
);
157 AT91F_AIC_SetExceptionVector((unsigned int *)0x0C, AT91F_FetchAbort
);
158 AT91F_AIC_SetExceptionVector((unsigned int *)0x10, AT91F_DataAbort
);
159 AT91F_AIC_SetExceptionVector((unsigned int *)0x4, AT91F_UndefHandler
);
161 //Initialize SDRAM and Flash
162 AT91F_InitMemories();
This page took 0.074834 seconds and 5 git commands to generate.