1 |
608 |
jeremybenn |
/* ----------------------------------------------------------------------------
|
2 |
|
|
* ATMEL Microcontroller Software Support
|
3 |
|
|
* ----------------------------------------------------------------------------
|
4 |
|
|
* Copyright (c) 2008, Atmel Corporation
|
5 |
|
|
*
|
6 |
|
|
* All rights reserved.
|
7 |
|
|
*
|
8 |
|
|
* Redistribution and use in source and binary forms, with or without
|
9 |
|
|
* modification, are permitted provided that the following conditions are met:
|
10 |
|
|
*
|
11 |
|
|
* - Redistributions of source code must retain the above copyright notice,
|
12 |
|
|
* this list of conditions and the disclaimer below.
|
13 |
|
|
*
|
14 |
|
|
* Atmel's name may not be used to endorse or promote products derived from
|
15 |
|
|
* this software without specific prior written permission.
|
16 |
|
|
*
|
17 |
|
|
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
18 |
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
19 |
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
20 |
|
|
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
21 |
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22 |
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
23 |
|
|
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
24 |
|
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25 |
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
26 |
|
|
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27 |
|
|
* ----------------------------------------------------------------------------
|
28 |
|
|
*/
|
29 |
|
|
|
30 |
|
|
//------------------------------------------------------------------------------
|
31 |
|
|
/// \dir
|
32 |
|
|
/// !Purpose
|
33 |
|
|
///
|
34 |
|
|
/// Definition and functions for using AT91SAM9XE-related features, such
|
35 |
|
|
/// has PIO pins, memories, etc.
|
36 |
|
|
///
|
37 |
|
|
/// !Usage
|
38 |
|
|
/// -# The code for booting the board is provided by board_cstartup.S and
|
39 |
|
|
/// board_lowlevel.c.
|
40 |
|
|
/// -# For using board PIOs, board characteristics (clock, etc.) and external
|
41 |
|
|
/// components, see board.h.
|
42 |
|
|
/// -# For manipulating memories (remapping, SDRAM, etc.), see board_memories.h.
|
43 |
|
|
//------------------------------------------------------------------------------
|
44 |
|
|
|
45 |
|
|
//------------------------------------------------------------------------------
|
46 |
|
|
/// \unit
|
47 |
|
|
/// !Purpose
|
48 |
|
|
///
|
49 |
|
|
/// Definition of AT91SAM9XE-EK characteristics, AT91SAM9XE-dependant PIOs and
|
50 |
|
|
/// external components interfacing.
|
51 |
|
|
///
|
52 |
|
|
/// !Usage
|
53 |
|
|
/// -# For operating frequency information, see "SAM9XE-EK - Operating frequencies".
|
54 |
|
|
/// -# For using portable PIO definitions, see "SAM9XE-EK - PIO definitions".
|
55 |
|
|
/// -# Several USB definitions are included here (see "SAM9XE-EK - USB device").
|
56 |
|
|
/// -# For external components definitions, see "SAM79260-EK - External components".
|
57 |
|
|
/// -# For memory-related definitions, see "SAM79260-EK - Memories".
|
58 |
|
|
//------------------------------------------------------------------------------
|
59 |
|
|
|
60 |
|
|
#ifndef BOARD_H
|
61 |
|
|
#define BOARD_H
|
62 |
|
|
|
63 |
|
|
//------------------------------------------------------------------------------
|
64 |
|
|
// Headers
|
65 |
|
|
//------------------------------------------------------------------------------
|
66 |
|
|
|
67 |
|
|
#if defined(at91sam9xe128)
|
68 |
|
|
#include "at91sam9xe128/AT91SAM9XE128.h"
|
69 |
|
|
#elif defined(at91sam9xe256)
|
70 |
|
|
#include "at91sam9xe256/AT91SAM9XE256.h"
|
71 |
|
|
#elif defined(at91sam9xe512)
|
72 |
|
|
#include "at91sam9xe512/AT91SAM9XE512.h"
|
73 |
|
|
#else
|
74 |
|
|
#error Board does not support the specified chip.
|
75 |
|
|
#endif
|
76 |
|
|
|
77 |
|
|
//------------------------------------------------------------------------------
|
78 |
|
|
// Definitions
|
79 |
|
|
//------------------------------------------------------------------------------
|
80 |
|
|
|
81 |
|
|
//------------------------------------------------------------------------------
|
82 |
|
|
/// \page "SAM9XE-EK - Board Description"
|
83 |
|
|
/// This page lists several definition related to the board description.
|
84 |
|
|
///
|
85 |
|
|
/// !Definitions
|
86 |
|
|
/// - BOARD_NAME
|
87 |
|
|
|
88 |
|
|
/// Name of the board.
|
89 |
|
|
#define BOARD_NAME "AT91SAM9XE-EK"
|
90 |
|
|
/// Board definition.
|
91 |
|
|
#define at91sam9xeek
|
92 |
|
|
/// Family definition.
|
93 |
|
|
#define at91sam9xe
|
94 |
|
|
//------------------------------------------------------------------------------
|
95 |
|
|
|
96 |
|
|
//------------------------------------------------------------------------------
|
97 |
|
|
/// \page "SAM9XE-EK - Operating frequencies"
|
98 |
|
|
/// This page lists several definition related to the board operating frequency
|
99 |
|
|
/// (when using the initialization done by board_lowlevel.c).
|
100 |
|
|
///
|
101 |
|
|
/// !Definitions
|
102 |
|
|
/// - BOARD_MAINOSC
|
103 |
|
|
/// - BOARD_MCK
|
104 |
|
|
|
105 |
|
|
/// Frequency of the board main oscillator.
|
106 |
|
|
#define BOARD_MAINOSC 18432000
|
107 |
|
|
|
108 |
|
|
/// Master clock frequency (when using board_lowlevel.c).
|
109 |
|
|
#define BOARD_MCK ((18432000 * 97 / 9) / 2)
|
110 |
|
|
//------------------------------------------------------------------------------
|
111 |
|
|
|
112 |
|
|
//------------------------------------------------------------------------------
|
113 |
|
|
/// \page "SAM9XE-EK - USB device"
|
114 |
|
|
/// This page lists constants describing several characteristics (controller
|
115 |
|
|
/// type, D+ pull-up type, etc.) of the USB device controller of the chip/board.
|
116 |
|
|
///
|
117 |
|
|
/// !Constants
|
118 |
|
|
/// - BOARD_USB_UDP
|
119 |
|
|
/// - BOARD_USB_PULLUP_INTERNAL
|
120 |
|
|
/// - BOARD_USB_NUMENDPOINTS
|
121 |
|
|
/// - BOARD_USB_ENDPOINTS_MAXPACKETSIZE
|
122 |
|
|
/// - BOARD_USB_ENDPOINTS_BANKS
|
123 |
|
|
/// - BOARD_USB_BMATTRIBUTES
|
124 |
|
|
|
125 |
|
|
/// Chip has a UDP controller.
|
126 |
|
|
#define BOARD_USB_UDP
|
127 |
|
|
|
128 |
|
|
/// Indicates the D+ pull-up is internal to the USB controller.
|
129 |
|
|
#define BOARD_USB_PULLUP_INTERNAL
|
130 |
|
|
|
131 |
|
|
/// Number of endpoints in the USB controller.
|
132 |
|
|
#define BOARD_USB_NUMENDPOINTS 6
|
133 |
|
|
|
134 |
|
|
/// Returns the maximum packet size of the given endpoint.
|
135 |
|
|
#define BOARD_USB_ENDPOINTS_MAXPACKETSIZE(i) ((i >= 4) ? 512 : 64)
|
136 |
|
|
#define BOARD_USB_ENDPOINTS_MAXPACKETSIZE_FS 64
|
137 |
|
|
|
138 |
|
|
/// Returns the number of FIFO banks for the given endpoint.
|
139 |
|
|
#define BOARD_USB_ENDPOINTS_BANKS(i) (((i == 0) || (i == 3)) ? 1 : 2)
|
140 |
|
|
|
141 |
|
|
/// USB attributes configuration descriptor (bus or self powered, remote wakeup)
|
142 |
|
|
#define BOARD_USB_BMATTRIBUTES USBConfigurationDescriptor_SELFPOWERED_NORWAKEUP
|
143 |
|
|
//------------------------------------------------------------------------------
|
144 |
|
|
|
145 |
|
|
//------------------------------------------------------------------------------
|
146 |
|
|
/// \page "SAM9XE-EK - PIO definitions"
|
147 |
|
|
/// This pages lists all the pio definitions contained in board.h. The constants
|
148 |
|
|
/// are named using the following convention: PIN_* for a constant which defines
|
149 |
|
|
/// a single Pin instance (but may include several PIOs sharing the same
|
150 |
|
|
/// controller), and PINS_* for a list of Pin instances.
|
151 |
|
|
///
|
152 |
|
|
/// !DBGU
|
153 |
|
|
/// - PINS_DBGU
|
154 |
|
|
///
|
155 |
|
|
/// !LEDs
|
156 |
|
|
/// - PIN_LED_0
|
157 |
|
|
/// - PIN_LED_1
|
158 |
|
|
/// - PINS_LEDS
|
159 |
|
|
/// - LED_POWER
|
160 |
|
|
/// - LED_DS1
|
161 |
|
|
///
|
162 |
|
|
/// !Push buttons
|
163 |
|
|
/// - PIN_PUSHBUTTON_1
|
164 |
|
|
/// - PIN_PUSHBUTTON_2
|
165 |
|
|
/// - PINS_PUSHBUTTONS
|
166 |
|
|
/// - PUSHBUTTON_BP1
|
167 |
|
|
/// - PUSHBUTTON_BP2
|
168 |
|
|
///
|
169 |
|
|
/// !USART0
|
170 |
|
|
/// - PIN_USART0_RXD
|
171 |
|
|
/// - PIN_USART0_TXD
|
172 |
|
|
/// - PIN_USART0_SCK
|
173 |
|
|
///
|
174 |
|
|
/// !SPI0
|
175 |
|
|
/// - PIN_SPI0_MISO
|
176 |
|
|
/// - PIN_SPI0_MOSI
|
177 |
|
|
/// - PIN_SPI0_SPCK
|
178 |
|
|
/// - PINS_SPI0
|
179 |
|
|
/// - PIN_SPI0_NPCS0
|
180 |
|
|
/// - PIN_SPI0_NPCS1
|
181 |
|
|
///
|
182 |
|
|
/// !SSC
|
183 |
|
|
/// - PINS_SSC_TX
|
184 |
|
|
///
|
185 |
|
|
/// !USB
|
186 |
|
|
/// - PIN_USB_VBUS
|
187 |
|
|
///
|
188 |
|
|
/// !MCI
|
189 |
|
|
/// - PINS_MCI
|
190 |
|
|
///
|
191 |
|
|
/// !TWI0
|
192 |
|
|
/// - PINS_TWI0
|
193 |
|
|
|
194 |
|
|
/// List of all DBGU pin definitions.
|
195 |
|
|
#define PINS_DBGU {(1<<14) | (1<<15), AT91C_BASE_PIOB, AT91C_ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
|
196 |
|
|
|
197 |
|
|
/// LED #0 pin definition.
|
198 |
|
|
#define PIN_LED_0 {1 << 9, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}
|
199 |
|
|
/// LED #1 pin definition.
|
200 |
|
|
#define PIN_LED_1 {1 << 6, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}
|
201 |
|
|
/// List of all LED definitions.
|
202 |
|
|
#define PINS_LEDS PIN_LED_0, PIN_LED_1
|
203 |
|
|
/// Power LED index.
|
204 |
|
|
#define LED_POWER 0
|
205 |
|
|
/// DS1 LED index.
|
206 |
|
|
#define LED_DS1 1
|
207 |
|
|
|
208 |
|
|
/// Push button #1 pin definition.
|
209 |
|
|
#define PIN_PUSHBUTTON_1 {1 << 30, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_INPUT, PIO_PULLUP}
|
210 |
|
|
/// Pusb button #2 pin definition.
|
211 |
|
|
#define PIN_PUSHBUTTON_2 {1UL << 31, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_INPUT, PIO_PULLUP}
|
212 |
|
|
/// List of all pushbutton pin definitions.
|
213 |
|
|
#define PINS_PUSHBUTTONS PIN_PUSHBUTTON_1, PIN_PUSHBUTTON_2
|
214 |
|
|
/// Push button #1 index.
|
215 |
|
|
#define PUSHBUTTON_BP1 0
|
216 |
|
|
/// Push button #2 index.
|
217 |
|
|
#define PUSHBUTTON_BP2 1
|
218 |
|
|
|
219 |
|
|
/// USART0 TXD pin definition.
|
220 |
|
|
#define PIN_USART0_TXD {1 << 4, AT91C_BASE_PIOB, AT91C_ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
|
221 |
|
|
/// USART0 RXD pin definition.
|
222 |
|
|
#define PIN_USART0_RXD {1 << 5, AT91C_BASE_PIOB, AT91C_ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
|
223 |
|
|
/// USART0 RTS pin definition.
|
224 |
|
|
#define PIN_USART0_RTS {1 << 26, AT91C_BASE_PIOB, AT91C_ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
|
225 |
|
|
/// USART0 CTS pin definition.
|
226 |
|
|
#define PIN_USART0_CTS {1 << 27, AT91C_BASE_PIOB, AT91C_ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
|
227 |
|
|
/// USART0 SCK pin definition.
|
228 |
|
|
#define PIN_USART0_SCK {1UL << 31, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
229 |
|
|
|
230 |
|
|
/// SPI0 MISO pin definition.
|
231 |
|
|
#define PIN_SPI0_MISO {1 << 0, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_PERIPH_A, PIO_PULLUP}
|
232 |
|
|
/// SPI0 MOSI pin definition.
|
233 |
|
|
#define PIN_SPI0_MOSI {1 << 1, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
234 |
|
|
/// SPI0 SPCK pin definition.
|
235 |
|
|
#define PIN_SPI0_SPCK {1 << 2, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
236 |
|
|
/// List of SPI0 pin definitions (MISO, MOSI & SPCK).
|
237 |
|
|
#define PINS_SPI0 PIN_SPI0_MISO, PIN_SPI0_MOSI, PIN_SPI0_SPCK
|
238 |
|
|
/// SPI0 chip select 0 pin definition.
|
239 |
|
|
#define PIN_SPI0_NPCS0 {AT91C_PA3_SPI0_NPCS0, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
240 |
|
|
/// SPI0 chip select 1 pin definition.
|
241 |
|
|
#define PIN_SPI0_NPCS1 {AT91C_PC11_SPI0_NPCS1, AT91C_BASE_PIOC, AT91C_ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT}
|
242 |
|
|
|
243 |
|
|
/// SSC transmitter pins definition.
|
244 |
|
|
#define PINS_SSC_TX {0x00038000, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
245 |
|
|
|
246 |
|
|
/// USB VBus monitoring pin definition.
|
247 |
|
|
#define PIN_USB_VBUS {1 << 5, AT91C_BASE_PIOC, AT91C_ID_PIOC, PIO_INPUT, PIO_DEFAULT}
|
248 |
|
|
|
249 |
|
|
/// List of MCI pins definitions.
|
250 |
|
|
#define PINS_MCI {0x0000003B, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}, \
|
251 |
|
|
{1 << 8, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
252 |
|
|
|
253 |
|
|
/// TWI0 pins definition.
|
254 |
|
|
#define PINS_TWI0 {0x01800000, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
255 |
|
|
//------------------------------------------------------------------------------
|
256 |
|
|
|
257 |
|
|
//------------------------------------------------------------------------------
|
258 |
|
|
/// \page "SAM9XE-EK - External components"
|
259 |
|
|
/// This page lists the definitions related to external on-board components
|
260 |
|
|
/// located in the board.h file for the AT91SAM9XE-EK.
|
261 |
|
|
///
|
262 |
|
|
/// !AT45 Dataflash Card (A)
|
263 |
|
|
/// - BOARD_AT45_A_SPI_BASE
|
264 |
|
|
/// - BOARD_AT45_A_SPI_ID
|
265 |
|
|
/// - BOARD_AT45_A_SPI_PINS
|
266 |
|
|
/// - BOARD_AT45_A_SPI
|
267 |
|
|
/// - BOARD_AT45_A_NPCS
|
268 |
|
|
/// - BOARD_AT45_A_NPCS_PIN
|
269 |
|
|
///
|
270 |
|
|
/// !AT45 Dataflash (B)
|
271 |
|
|
/// - BOARD_AT45_B_SPI_BASE
|
272 |
|
|
/// - BOARD_AT45_B_SPI_ID
|
273 |
|
|
/// - BOARD_AT45_B_SPI_PINS
|
274 |
|
|
/// - BOARD_AT45_B_SPI
|
275 |
|
|
/// - BOARD_AT45_B_NPCS
|
276 |
|
|
/// - BOARD_AT45_B_NPCS_PIN
|
277 |
|
|
///
|
278 |
|
|
/// !SD Card
|
279 |
|
|
/// - BOARD_SD_MCI_BASE
|
280 |
|
|
/// - BOARD_SD_MCI_ID
|
281 |
|
|
/// - BOARD_SD_PINS
|
282 |
|
|
/// - BOARD_SD_SLOT
|
283 |
|
|
///
|
284 |
|
|
///
|
285 |
|
|
/// !EMAC
|
286 |
|
|
/// - AT91C_BASE_EMAC
|
287 |
|
|
/// - BOARD_EMAC_POWER_ALWAYS_ON
|
288 |
|
|
/// - BOARD_EMAC_MODE_RMII
|
289 |
|
|
/// - BOARD_EMAC_PINS
|
290 |
|
|
/// - BOARD_EMAC_PIN_TEST
|
291 |
|
|
/// - BOARD_EMAC_PIN_RPTR
|
292 |
|
|
/// - BOARD_EMAC_RST_PINS
|
293 |
|
|
/// - BOARD_EMAC_RUN_PINS
|
294 |
|
|
|
295 |
|
|
|
296 |
|
|
/// Base address of SPI peripheral connected to the dataflash.
|
297 |
|
|
#define BOARD_AT45_A_SPI_BASE AT91C_BASE_SPI0
|
298 |
|
|
/// Identifier of SPI peripheral connected to the dataflash.
|
299 |
|
|
#define BOARD_AT45_A_SPI_ID AT91C_ID_SPI0
|
300 |
|
|
/// Pins of the SPI peripheral connected to the dataflash.
|
301 |
|
|
#define BOARD_AT45_A_SPI_PINS PINS_SPI0
|
302 |
|
|
/// Dataflahs SPI number.
|
303 |
|
|
#define BOARD_AT45_A_SPI 0
|
304 |
|
|
/// Chip select connected to the dataflash.
|
305 |
|
|
#define BOARD_AT45_A_NPCS 0
|
306 |
|
|
/// Chip select pin connected to the dataflash.
|
307 |
|
|
#define BOARD_AT45_A_NPCS_PIN PIN_SPI0_NPCS0
|
308 |
|
|
|
309 |
|
|
/// Base address of SPI peripheral connected to the dataflash.
|
310 |
|
|
#define BOARD_AT45_B_SPI_BASE AT91C_BASE_SPI0
|
311 |
|
|
/// Identifier of SPI peripheral connected to the dataflash.
|
312 |
|
|
#define BOARD_AT45_B_SPI_ID AT91C_ID_SPI0
|
313 |
|
|
/// Pins of the SPI peripheral connected to the dataflash.
|
314 |
|
|
#define BOARD_AT45_B_SPI_PINS PINS_SPI0
|
315 |
|
|
/// Dataflahs SPI number.
|
316 |
|
|
#define BOARD_AT45_B_SPI 0
|
317 |
|
|
/// Chip select connected to the dataflash.
|
318 |
|
|
#define BOARD_AT45_B_NPCS 1
|
319 |
|
|
/// Chip select pin connected to the dataflash.
|
320 |
|
|
#define BOARD_AT45_B_NPCS_PIN PIN_SPI0_NPCS1
|
321 |
|
|
|
322 |
|
|
/// Base address of SPI peripheral connected to the serialflash.
|
323 |
|
|
#define BOARD_AT26_A_SPI_BASE AT91C_BASE_SPI0
|
324 |
|
|
/// Identifier of SPI peripheral connected to the dataflash.
|
325 |
|
|
#define BOARD_AT26_A_SPI_ID AT91C_ID_SPI0
|
326 |
|
|
/// Pins of the SPI peripheral connected to the dataflash.
|
327 |
|
|
#define BOARD_AT26_A_SPI_PINS PINS_SPI0
|
328 |
|
|
/// Dataflahs SPI number.
|
329 |
|
|
#define BOARD_AT26_A_SPI 0
|
330 |
|
|
/// Chip select connected to the dataflash.
|
331 |
|
|
#define BOARD_AT26_A_NPCS 0
|
332 |
|
|
/// Chip select pin connected to the dataflash.
|
333 |
|
|
#define BOARD_AT26_A_NPCS_PIN PIN_SPI0_NPCS0
|
334 |
|
|
|
335 |
|
|
/// Base address of the MCI peripheral connected to the SD card.
|
336 |
|
|
#define BOARD_SD_MCI_BASE AT91C_BASE_MCI
|
337 |
|
|
/// Peripheral identifier of the MCI connected to the SD card.
|
338 |
|
|
#define BOARD_SD_MCI_ID AT91C_ID_MCI
|
339 |
|
|
/// MCI pins that shall be configured to access the SD card.
|
340 |
|
|
#define BOARD_SD_PINS PINS_MCI
|
341 |
|
|
/// MCI slot to which the SD card is connected to.
|
342 |
|
|
#define BOARD_SD_SLOT MCI_SD_SLOTB
|
343 |
|
|
|
344 |
|
|
/// Board EMAC base address
|
345 |
|
|
#if !defined(AT91C_BASE_EMAC) && defined(AT91C_BASE_EMACB)
|
346 |
|
|
#define AT91C_BASE_EMAC AT91C_BASE_EMACB
|
347 |
|
|
#endif
|
348 |
|
|
/// Board EMAC power control - ALWAYS ON
|
349 |
|
|
#define BOARD_EMAC_POWER_ALWAYS_ON
|
350 |
|
|
/// Board EMAC work mode - RMII/MII ( 1 / 0 )
|
351 |
|
|
#define BOARD_EMAC_MODE_RMII 1
|
352 |
|
|
/// The PIN list of PIO for EMAC
|
353 |
|
|
#define BOARD_EMAC_PINS { ((1<<19)|(1<<13)|(1<<12)|(1<<16)|(1<<15)|(1<<14)\
|
354 |
|
|
|(1<<17)|(1<<18)|(1<<20)|(1<<21)|(1<<7)),\
|
355 |
|
|
AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT},\
|
356 |
|
|
{ ((1<<11)|(1<<10)|(1<<26)|(1<<25)|(1<<27)|(1<<22)\
|
357 |
|
|
|(1<<29)|(1<<28)),\
|
358 |
|
|
AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}
|
359 |
|
|
/// The power up reset latch PIO for PHY
|
360 |
|
|
#define BOARD_EMAC_PIN_TEST {(1<<17), AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}
|
361 |
|
|
//#define BOARD_EMAC_PIN_RMII : connected to 3v3 (RMII)
|
362 |
|
|
// We force the address
|
363 |
|
|
// (1<<14) PHY address 0, (1<<15) PHY address 1 (PIO A, perih A)
|
364 |
|
|
// (1<<25) PHY address 2, (1<<26) PHY address 3 (PIO A, perih B)
|
365 |
|
|
#define BOARD_EMAC_PINS_PHYAD { ((1<<14)|(1<<15)),\
|
366 |
|
|
AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT},\
|
367 |
|
|
{ ((1<<25)|(1<<26)),\
|
368 |
|
|
AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}
|
369 |
|
|
//#define BOARD_EMAC_PIN_10BT : not connected
|
370 |
|
|
#define BOARD_EMAC_PIN_RPTR {(1<<27), AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}
|
371 |
|
|
/// The PIN Configure list for EMAC on power up reset
|
372 |
|
|
#define BOARD_EMAC_RST_PINS BOARD_EMAC_PINS_PHYAD,\
|
373 |
|
|
BOARD_EMAC_PIN_TEST,\
|
374 |
|
|
BOARD_EMAC_PIN_RPTR
|
375 |
|
|
/// The runtime pin configure list for EMAC
|
376 |
|
|
#define BOARD_EMAC_RUN_PINS BOARD_EMAC_PINS
|
377 |
|
|
|
378 |
|
|
//------------------------------------------------------------------------------
|
379 |
|
|
|
380 |
|
|
//------------------------------------------------------------------------------
|
381 |
|
|
/// \page "SAM9XE-EK - Memories"
|
382 |
|
|
/// This page lists definitions related to external on-board memories.
|
383 |
|
|
///
|
384 |
|
|
/// !Embedded Flash
|
385 |
|
|
/// - BOARD_FLASH_EEFC
|
386 |
|
|
///
|
387 |
|
|
/// !SDRAM
|
388 |
|
|
/// - BOARD_SDRAM_SIZE
|
389 |
|
|
/// - PINS_SDRAM
|
390 |
|
|
///
|
391 |
|
|
/// !Nandflash
|
392 |
|
|
/// - PINS_NANDFLASH
|
393 |
|
|
/// - BOARD_NF_COMMAND_ADDR
|
394 |
|
|
/// - BOARD_NF_ADDRESS_ADDR
|
395 |
|
|
/// - BOARD_NF_DATA_ADDR
|
396 |
|
|
/// - BOARD_NF_CE_PIN
|
397 |
|
|
/// - BOARD_NF_RB_PIN
|
398 |
|
|
|
399 |
|
|
/// Indicates chip has an Enhanced EFC.
|
400 |
|
|
#define BOARD_FLASH_EEFC
|
401 |
|
|
/// Address of the IAP function in ROM.
|
402 |
|
|
#define BOARD_FLASH_IAP_ADDRESS 0x100008
|
403 |
|
|
|
404 |
|
|
/// Board SDRAM size
|
405 |
|
|
#define BOARD_SDRAM_SIZE 0x02000000
|
406 |
|
|
/// List of all SDRAM pins definitions.
|
407 |
|
|
#define PINS_SDRAM {0xFFFF0000, AT91C_BASE_PIOC, AT91C_ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT}
|
408 |
|
|
|
409 |
|
|
|
410 |
|
|
/// Nandflash controller peripheral pins definition.
|
411 |
|
|
#define PINS_NANDFLASH BOARD_NF_CE_PIN, BOARD_NF_RB_PIN
|
412 |
|
|
/// Nandflash chip enable pin definition.
|
413 |
|
|
#define BOARD_NF_CE_PIN {1 << 14, AT91C_BASE_PIOC, AT91C_ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
|
414 |
|
|
/// Nandflash ready/busy pin definition.
|
415 |
|
|
#define BOARD_NF_RB_PIN {1 << 13, AT91C_BASE_PIOC, AT91C_ID_PIOC, PIO_INPUT, PIO_PULLUP}
|
416 |
|
|
/// Address for transferring command bytes to the nandflash.
|
417 |
|
|
#define BOARD_NF_COMMAND_ADDR 0x40400000
|
418 |
|
|
/// Address for transferring address bytes to the nandflash.
|
419 |
|
|
#define BOARD_NF_ADDRESS_ADDR 0x40200000
|
420 |
|
|
/// Address for transferring data bytes to the nandflash.
|
421 |
|
|
#define BOARD_NF_DATA_ADDR 0x40000000
|
422 |
|
|
|
423 |
|
|
/// Address for transferring command bytes to the norflash.
|
424 |
|
|
#define BOARD_NORFLASH_ADDR 0x10000000
|
425 |
|
|
//------------------------------------------------------------------------------
|
426 |
|
|
|
427 |
|
|
#endif //#ifndef BOARD_H
|
428 |
|
|
|