2 FreeRTOS MCF5235 port - Copyright (C) 2006 Christian Walter.
\r
4 This file is part of the FreeRTOS distribution.
\r
6 FreeRTOS is free software; you can redistribute it and/or modify
\r
7 it under the terms of the GNU General Public License as published by
\r
8 the Free Software Foundation; either version 2 of the License, or
\r
9 (at your option) any later version.
\r
11 FreeRTOS is distributed in the hope that it will be useful,
\r
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 GNU General Public License for more details.
\r
16 You should have received a copy of the GNU General Public License
\r
17 along with FreeRTOS; if not, write to the Free Software
\r
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
20 A special exception to the GPL can be applied should you wish to distribute
\r
21 a combined work that includes FreeRTOS, without being obliged to provide
\r
22 the source code for any proprietary components. See the licensing section
\r
23 of http://www.FreeRTOS.org for full details of how and when the exception
\r
26 ***************************************************************************
\r
27 See http://www.FreeRTOS.org for documentation, latest information, license
\r
28 and contact details. Please ensure to read the configuration and relevant
\r
29 port sections of the online documentation.
\r
31 Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
\r
32 with commercial development and support options.
\r
33 ***************************************************************************
\r
36 #include "mcf5xxx.h"
\r
37 #include "mcf523x.h"
\r
39 /* Function prototypes */
\r
40 void init_main( void );
\r
41 static void disable_interrupts( void );
\r
42 static void disable_watchdog_timer( void );
\r
43 static void disable_cache( void );
\r
44 static void init_ipsbar( void );
\r
45 static void init_basics( void );
\r
46 static void init_clock_config( void );
\r
47 static void init_chip_selects( void );
\r
48 static void init_bus_config( void );
\r
49 static void init_cache( void );
\r
50 static void init_eport( void );
\r
51 static void init_flexcan( void );
\r
52 static void init_power_management( void );
\r
53 static void init_dma_timers( void );
\r
54 static void init_interrupt_timers( void );
\r
55 static void init_watchdog_timers( void );
\r
56 static void init_pin_assignments( void );
\r
57 static void init_sdram_controller( void );
\r
58 static void init_interrupt_controller( void );
\r
61 /*********************************************************************
\r
62 * init_main - Main entry point for initialisation code *
\r
63 **********************************************************************/
\r
68 /* Initialise base address of peripherals, VBR, etc */
\r
71 init_clock_config( );
\r
73 /* Disable interrupts, watchdog timer, cache */
\r
74 disable_interrupts( );
\r
75 disable_watchdog_timer( );
\r
78 /* Initialise individual modules */
\r
79 init_chip_selects( );
\r
84 init_power_management( );
\r
86 init_interrupt_timers( );
\r
87 init_watchdog_timers( );
\r
88 init_pin_assignments( );
\r
89 init_sdram_controller( );
\r
91 /* Initialise interrupt controller */
\r
92 init_interrupt_controller( );
\r
95 /*********************************************************************
\r
96 * disable_interrupts - Disable all interrupt sources *
\r
97 **********************************************************************/
\r
99 disable_interrupts( void )
\r
105 /* Set ICR008-ICR063 to 0x0 */
\r
106 p = ( vuint8 * ) & MCF_INTC0_ICR8;
\r
107 for( i = 8; i <= 63; i++ )
\r
110 /* Set ICR108-ICR163 to 0x0 */
\r
111 p = ( vuint8 * ) & MCF_INTC1_ICR8;
\r
112 for( i = 108; i <= 163; i++ )
\r
117 /*********************************************************************
\r
118 * disable_watchdog_timer - Disable system watchdog timer *
\r
119 **********************************************************************/
\r
121 disable_watchdog_timer( void )
\r
124 /* Disable Core Watchdog Timer */
\r
128 /*********************************************************************
\r
129 * disable_cache - Disable and invalidate cache *
\r
130 **********************************************************************/
\r
132 disable_cache( void )
\r
134 asm ( "move.l #0x01000000, %d0" );
\r
135 asm ( "movec %d0, %CACR" );
\r
138 /*********************************************************************
\r
139 * init_basics - Configuration Information & VBR *
\r
140 **********************************************************************/
\r
142 init_basics( void )
\r
145 extern uint32 __RAMVEC[];
\r
146 extern uint32 __ROMVEC[];
\r
148 /* Transfer size not driven on SIZ[1:0] pins during external cycles
\r
149 Processor Status (PST) and Debug Data (DDATA) functions disabled
\r
150 Bus monitor disabled
\r
151 Output pads configured for full strength
\r
153 MCF_CCM_CCR = ( 0x1 << 15 ) | MCF_CCM_CCR_BME;
\r
155 /* Set up RAM vectors */
\r
156 for( i = 0; i < 256; i++ )
\r
159 __RAMVEC[i] = __ROMVEC[i];
\r
161 asm( "move.l %0,%%d0": :"i"( __RAMVEC ) );
\r
162 asm( "movec %d0,%vbr" );
\r
166 /*********************************************************************
\r
167 * init_clock_config - Clock Module *
\r
168 **********************************************************************/
\r
170 init_clock_config( void )
\r
172 /* Clock module uses normal PLL mode with 25.0000 MHz external reference (Fref)
\r
174 Bus clock frequency = 25.00 MHz
\r
175 Processor clock frequency = 2 x bus clock = 50.00 MHz
\r
176 Frequency Modulation disabled
\r
177 Loss of clock detection disabled
\r
178 Reset/Interrupt on loss of lock disabled
\r
180 MCF_FMPLL_SYNCR = 0x00100000; /* Set RFD=RFD+1 to avoid frequency overshoot */
\r
181 while( ( MCF_FMPLL_SYNSR & 0x08 ) == 0 ) /* Wait for PLL to lock */
\r
183 MCF_FMPLL_SYNCR = 0x00080000; /* Set desired RFD */
\r
184 while( ( MCF_FMPLL_SYNSR & 0x08 ) == 0 ) /* Wait for PLL to lock */
\r
189 /*********************************************************************
\r
190 * init_ipsbar - Internal Peripheral System Base Address (IPSBAR) *
\r
191 **********************************************************************/
\r
193 init_ipsbar( void )
\r
197 /* Base address of internal peripherals (IPSBAR) = 0x40000000
\r
199 Note: Processor powers up with IPS base address = 0x40000000
\r
200 Write to IPS base + 0x00000000 to set new value
\r
202 *( vuint32 * ) 0x40000000 = ( vuint32 ) __IPSBAR + 1;
\r
204 /* Configure RAMBAR in SCM module and allow dual-ported access. */
\r
205 MCF_SCM_RAMBAR = ( uint32 ) &__SRAM | MCF_SCM_RAMBAR_BDE;
\r
208 /*********************************************************************
\r
209 * init_chip_selects - Chip Select Module *
\r
210 **********************************************************************/
\r
212 init_chip_selects( void )
\r
214 extern void __FLASH;
\r
215 uint32 FLASH_ADDR = (uint32)&__FLASH;
\r
217 /* Chip Select 0 - External Flash */
\r
218 MCF_CS_CSAR0 = MCF_CS_CSAR_BA( FLASH_ADDR );
\r
220 | MCF_CS_CSCR_IWS( 6 )
\r
221 | MCF_CS_CSCR_AA | MCF_CS_CSCR_PS_16 );
\r
222 MCF_CS_CSMR0 = MCF_CS_CSMR_BAM_2M | MCF_CS_CSMR_V;
\r
224 /* Chip Select 1 disabled (CSMR1[V] = 0) */
\r
229 /* Chip Select 2 disabled (CSMR2[V] = 0) */
\r
234 /* Chip Select 3 disabled (CSMR3[V] = 0) */
\r
239 /* Chip Select 4 disabled (CSMR4[V] = 0) */
\r
244 /* Chip Select 5 disabled (CSMR5[V] = 0) */
\r
249 /* Chip Select 6 disabled (CSMR6[V] = 0) */
\r
254 /* Chip Select 7 disabled (CSMR7[V] = 0) */
\r
260 /*********************************************************************
\r
261 * init_bus_config - Internal Bus Arbitration *
\r
262 **********************************************************************/
\r
264 init_bus_config( void )
\r
267 /* Use round robin arbitration scheme
\r
268 Assigned priorities (highest first):
\r
272 DMA bandwidth control disabled
\r
273 Park on last active bus master
\r
276 MCF_SCM_MPARK_M3_PRTY( 0x3 ) | MCF_SCM_MPARK_M2_PRTY( 0x2 ) |
\r
277 MCF_SCM_MPARK_M1_PRTY( 0x1 );
\r
280 /*********************************************************************
\r
281 * init_cache - Instruction/Data Cache *
\r
282 **********************************************************************/
\r
286 /* Configured as split cache: 4 KByte instruction cache and 4 Kbyte data cache
\r
287 ACR0: Don't cache accesses to 16 MB memory region at address $20000000
\r
288 ACR1: Don't cache accesses to 1 GB memory region at address $40000000
\r
289 CACR: Cache accesses to the rest of memory
\r
291 asm("move.l #0x80000000,%d0");
\r
292 asm("movec %d0,%CACR");
\r
293 asm("move.l #0x2000c040,%d0");
\r
294 asm("movec %d0,%ACR0");
\r
295 asm("move.l #0x403fc040,%d0");
\r
296 asm("movec %d0,%ACR1");
\r
298 /* Instruction/Data cache disabled. */
\r
299 //asm( "move.l #0x00000000, %d0" );
\r
300 //asm( "movec %d0,%cacr" );
\r
303 /*********************************************************************
\r
304 * init_eport - Edge Port Module (EPORT) *
\r
305 **********************************************************************/
\r
310 /* Pins 1-7 configured as GPIO inputs */
\r
311 MCF_EPORT_EPPAR = 0;
\r
312 MCF_EPORT_EPDDR = 0;
\r
313 MCF_EPORT_EPIER = 0;
\r
316 /*********************************************************************
\r
317 * init_flexcan - FlexCAN Module *
\r
318 **********************************************************************/
\r
320 init_flexcan( void )
\r
323 /* FlexCAN controller 0 disabled (CANMCR0[MDIS]=1) */
\r
324 MCF_CAN_IMASK0 = 0;
\r
325 MCF_CAN_RXGMASK0 = MCF_CAN_RXGMASK_MI( 0x1fffffff );
\r
326 MCF_CAN_RX14MASK0 = MCF_CAN_RX14MASK_MI( 0x1fffffff );
\r
327 MCF_CAN_RX15MASK0 = MCF_CAN_RX15MASK_MI( 0x1fffffff );
\r
328 MCF_CAN_CANCTRL0 = 0;
\r
330 MCF_CAN_CANMCR_MDIS | MCF_CAN_CANMCR_FRZ | MCF_CAN_CANMCR_HALT |
\r
331 MCF_CAN_CANMCR_SUPV | MCF_CAN_CANMCR_MAXMB( 0xf );
\r
333 /* FlexCAN controller 1 disabled (CANMCR1[MDIS]=1) */
\r
334 MCF_CAN_IMASK1 = 0;
\r
335 MCF_CAN_RXGMASK1 = MCF_CAN_RXGMASK_MI( 0x1fffffff );
\r
336 MCF_CAN_RX14MASK1 = MCF_CAN_RX14MASK_MI( 0x1fffffff );
\r
337 MCF_CAN_RX15MASK1 = MCF_CAN_RX15MASK_MI( 0x1fffffff );
\r
338 MCF_CAN_CANCTRL1 = 0;
\r
340 MCF_CAN_CANMCR_MDIS | MCF_CAN_CANMCR_FRZ | MCF_CAN_CANMCR_HALT |
\r
341 MCF_CAN_CANMCR_SUPV | MCF_CAN_CANMCR_MAXMB( 0xf );
\r
344 /*********************************************************************
\r
345 * init_power_management - Power Management *
\r
346 **********************************************************************/
\r
348 init_power_management( void )
\r
351 /* On executing STOP instruction, processor enters RUN mode
\r
352 Mode is exited when an interrupt of level 1 or higher is received
\r
354 MCF_SCM_LPICR = MCF_SCM_LPICR_ENBSTOP;
\r
358 /*********************************************************************
\r
359 * init_sdram_controller - SDRAM Controller *
\r
360 **********************************************************************/
\r
362 init_sdram_controller( void )
\r
364 extern void __SDRAM;
\r
365 uint32 SDRAM_ADDR = (uint32)&__SDRAM;
\r
370 * Check to see if the SDRAM has already been initialized
\r
371 * by a run control tool
\r
373 if( !( MCF_SDRAMC_DACR0 & MCF_SDRAMC_DACR0_RE ) )
\r
375 /* Initialize DRAM Control Register: DCR */
\r
376 MCF_SDRAMC_DCR = ( MCF_SDRAMC_DCR_RTIM( 1 ) |
\r
377 MCF_SDRAMC_DCR_RC( ( 15 * FSYS_2 ) >> 4 ) );
\r
379 /* Initialize DACR0 */
\r
380 MCF_SDRAMC_DACR0 = ( MCF_SDRAMC_DACR0_BA( SDRAM_ADDR >> 18UL ) |
\r
381 MCF_SDRAMC_DACR0_CASL( 1 ) |
\r
382 MCF_SDRAMC_DACR0_CBM( 3 ) |
\r
383 MCF_SDRAMC_DACR0_PS( 0 ) );
\r
385 /* Initialize DMR0 */
\r
386 MCF_SDRAMC_DMR0 = ( MCF_SDRAMC_DMR_BAM_16M | MCF_SDRAMC_DMR0_V );
\r
388 /* Set IP (bit 3) in DACR */
\r
389 MCF_SDRAMC_DACR0 |= MCF_SDRAMC_DACR0_IP;
\r
391 /* Wait 30ns to allow banks to precharge */
\r
392 for( i = 0; i < 5; i++ )
\r
394 asm volatile ( " nop" );
\r
396 /* Write to this block to initiate precharge */
\r
397 *( uint32 * ) ( SDRAM_ADDR ) = 0xA5A59696;
\r
399 /* Set RE (bit 15) in DACR */
\r
400 MCF_SDRAMC_DACR0 |= MCF_SDRAMC_DACR0_RE;
\r
402 /* Wait for at least 8 auto refresh cycles to occur */
\r
403 for( i = 0; i < 2000; i++ )
\r
405 asm volatile ( "nop" );
\r
407 /* Finish the configuration by issuing the IMRS. */
\r
408 MCF_SDRAMC_DACR0 |= MCF_SDRAMC_DACR0_MRS;
\r
410 /* Write to the SDRAM Mode Register */
\r
411 *( uint32 * ) ( SDRAM_ADDR + 0x400 ) = 0xA5A59696;
\r
415 /*********************************************************************
\r
416 * init_dma_timers - DMA Timer Modules *
\r
417 **********************************************************************/
\r
419 init_dma_timers( void )
\r
422 /* DMA Timer 0 disabled (DTMR0[RST] = 0) */
\r
423 MCF_TIMER_DTMR0 = 0;
\r
424 MCF_TIMER_DTXMR0 = 0;
\r
425 MCF_TIMER_DTRR0 = 0xffffffff;
\r
427 /* DMA Timer 1 disabled (DTMR1[RST] = 0) */
\r
428 MCF_TIMER_DTMR1 = 0;
\r
429 MCF_TIMER_DTXMR1 = 0;
\r
430 MCF_TIMER_DTRR1 = 0xffffffff;
\r
432 /* DMA Timer 2 disabled (DTMR2[RST] = 0) */
\r
433 MCF_TIMER_DTMR2 = 0;
\r
434 MCF_TIMER_DTXMR2 = 0;
\r
435 MCF_TIMER_DTRR2 = 0xffffffff;
\r
437 /* DMA Timer 3 disabled (DTMR3[RST] = 0) */
\r
438 MCF_TIMER_DTMR3 = 0;
\r
439 MCF_TIMER_DTXMR3 = 0;
\r
440 MCF_TIMER_DTRR3 = 0xffffffff;
\r
443 /**********************************************************************
\r
444 * init_interrupt_timers - Programmable Interrupt Timer (PIT) Modules *
\r
445 ***********************************************************************/
\r
447 init_interrupt_timers( void )
\r
450 /* PIT0 disabled (PCSR0[EN]=0) */
\r
453 /* PIT1 disabled (PCSR1[EN]=0) */
\r
456 /* PIT2 disabled (PCSR2[EN]=0) */
\r
459 /* PIT3 disabled (PCSR3[EN]=0) */
\r
463 /*********************************************************************
\r
464 * init_watchdog_timers - Watchdog Timer Modules *
\r
465 **********************************************************************/
\r
467 init_watchdog_timers( void )
\r
470 /* Watchdog Timer disabled (WCR[EN]=0)
\r
471 NOTE: WCR and WMR cannot be written again until after the
\r
472 processor is reset.
\r
474 MCF_WTM_WCR = MCF_WTM_WCR_WAIT | MCF_WTM_WCR_DOZE | MCF_WTM_WCR_HALTED;
\r
475 MCF_WTM_WMR = 0xffff;
\r
477 /* Core Watchdog Timer disabled (CWCR[CWE]=0) */
\r
481 /*********************************************************************
\r
482 * init_interrupt_controller - Interrupt Controller *
\r
483 **********************************************************************/
\r
485 init_interrupt_controller( void )
\r
488 /* Configured interrupt sources in order of priority...
\r
489 Level 7: External interrupt /IRQ7, (initially masked)
\r
490 Level 6: External interrupt /IRQ6, (initially masked)
\r
491 Level 5: External interrupt /IRQ5, (initially masked)
\r
492 Level 4: External interrupt /IRQ4, (initially masked)
\r
493 Level 3: External interrupt /IRQ3, (initially masked)
\r
494 Level 2: External interrupt /IRQ2, (initially masked)
\r
495 Level 1: External interrupt /IRQ1, (initially masked)
\r
497 MCF_INTC0_ICR1 = 0;
\r
498 MCF_INTC0_ICR2 = 0;
\r
499 MCF_INTC0_ICR3 = 0;
\r
500 MCF_INTC0_ICR4 = 0;
\r
501 MCF_INTC0_ICR5 = 0;
\r
502 MCF_INTC0_ICR6 = 0;
\r
503 MCF_INTC0_ICR7 = 0;
\r
504 MCF_INTC0_ICR8 = 0;
\r
505 MCF_INTC0_ICR9 = 0;
\r
506 MCF_INTC0_ICR10 = 0;
\r
507 MCF_INTC0_ICR11 = 0;
\r
508 MCF_INTC0_ICR12 = 0;
\r
509 MCF_INTC0_ICR13 = 0;
\r
510 MCF_INTC0_ICR14 = 0;
\r
511 MCF_INTC0_ICR15 = 0;
\r
512 MCF_INTC0_ICR17 = 0;
\r
513 MCF_INTC0_ICR18 = 0;
\r
514 MCF_INTC0_ICR19 = 0;
\r
515 MCF_INTC0_ICR20 = 0;
\r
516 MCF_INTC0_ICR21 = 0;
\r
517 MCF_INTC0_ICR22 = 0;
\r
518 MCF_INTC0_ICR23 = 0;
\r
519 MCF_INTC0_ICR24 = 0;
\r
520 MCF_INTC0_ICR25 = 0;
\r
521 MCF_INTC0_ICR26 = 0;
\r
522 MCF_INTC0_ICR27 = 0;
\r
523 MCF_INTC0_ICR28 = 0;
\r
524 MCF_INTC0_ICR29 = 0;
\r
525 MCF_INTC0_ICR30 = 0;
\r
526 MCF_INTC0_ICR31 = 0;
\r
527 MCF_INTC0_ICR32 = 0;
\r
528 MCF_INTC0_ICR33 = 0;
\r
529 MCF_INTC0_ICR34 = 0;
\r
530 MCF_INTC0_ICR35 = 0;
\r
531 MCF_INTC0_ICR36 = 0;
\r
532 MCF_INTC0_ICR37 = 0;
\r
533 MCF_INTC0_ICR38 = 0;
\r
534 MCF_INTC0_ICR39 = 0;
\r
535 MCF_INTC0_ICR40 = 0;
\r
536 MCF_INTC0_ICR41 = 0;
\r
537 MCF_INTC0_ICR42 = 0;
\r
538 MCF_INTC0_ICR43 = 0;
\r
539 MCF_INTC0_ICR44 = 0;
\r
540 MCF_INTC0_ICR45 = 0;
\r
541 MCF_INTC0_ICR46 = 0;
\r
542 MCF_INTC0_ICR47 = 0;
\r
543 MCF_INTC0_ICR48 = 0;
\r
544 MCF_INTC0_ICR49 = 0;
\r
545 MCF_INTC0_ICR50 = 0;
\r
546 MCF_INTC0_ICR51 = 0;
\r
547 MCF_INTC0_ICR52 = 0;
\r
548 MCF_INTC0_ICR53 = 0;
\r
549 MCF_INTC0_ICR54 = 0;
\r
550 MCF_INTC0_ICR55 = 0;
\r
551 MCF_INTC0_ICR56 = 0;
\r
552 MCF_INTC0_ICR57 = 0;
\r
553 MCF_INTC0_ICR58 = 0;
\r
554 MCF_INTC0_ICR59 = 0;
\r
555 MCF_INTC0_ICR60 = 0;
\r
556 MCF_INTC1_ICR8 = 0;
\r
557 MCF_INTC1_ICR9 = 0;
\r
558 MCF_INTC1_ICR10 = 0;
\r
559 MCF_INTC1_ICR11 = 0;
\r
560 MCF_INTC1_ICR12 = 0;
\r
561 MCF_INTC1_ICR13 = 0;
\r
562 MCF_INTC1_ICR14 = 0;
\r
563 MCF_INTC1_ICR15 = 0;
\r
564 MCF_INTC1_ICR16 = 0;
\r
565 MCF_INTC1_ICR17 = 0;
\r
566 MCF_INTC1_ICR18 = 0;
\r
567 MCF_INTC1_ICR19 = 0;
\r
568 MCF_INTC1_ICR20 = 0;
\r
569 MCF_INTC1_ICR21 = 0;
\r
570 MCF_INTC1_ICR22 = 0;
\r
571 MCF_INTC1_ICR23 = 0;
\r
572 MCF_INTC1_ICR24 = 0;
\r
573 MCF_INTC1_ICR25 = 0;
\r
574 MCF_INTC1_ICR27 = 0;
\r
575 MCF_INTC1_ICR28 = 0;
\r
576 MCF_INTC1_ICR29 = 0;
\r
577 MCF_INTC1_ICR30 = 0;
\r
578 MCF_INTC1_ICR31 = 0;
\r
579 MCF_INTC1_ICR32 = 0;
\r
580 MCF_INTC1_ICR33 = 0;
\r
581 MCF_INTC1_ICR34 = 0;
\r
582 MCF_INTC1_ICR35 = 0;
\r
583 MCF_INTC1_ICR36 = 0;
\r
584 MCF_INTC1_ICR37 = 0;
\r
585 MCF_INTC1_ICR38 = 0;
\r
586 MCF_INTC1_ICR39 = 0;
\r
587 MCF_INTC1_ICR40 = 0;
\r
588 MCF_INTC1_ICR41 = 0;
\r
589 MCF_INTC1_ICR42 = 0;
\r
590 MCF_INTC1_ICR59 = 0;
\r
591 MCF_INTC0_IMRH = 0xffffffff;
\r
593 MCF_INTC0_IMRL_INT_MASK31 | MCF_INTC0_IMRL_INT_MASK30 |
\r
594 MCF_INTC0_IMRL_INT_MASK29 | MCF_INTC0_IMRL_INT_MASK28 |
\r
595 MCF_INTC0_IMRL_INT_MASK27 | MCF_INTC0_IMRL_INT_MASK26 |
\r
596 MCF_INTC0_IMRL_INT_MASK25 | MCF_INTC0_IMRL_INT_MASK24 |
\r
597 MCF_INTC0_IMRL_INT_MASK23 | MCF_INTC0_IMRL_INT_MASK22 |
\r
598 MCF_INTC0_IMRL_INT_MASK21 | MCF_INTC0_IMRL_INT_MASK20 |
\r
599 MCF_INTC0_IMRL_INT_MASK19 | MCF_INTC0_IMRL_INT_MASK18 |
\r
600 MCF_INTC0_IMRL_INT_MASK17 | MCF_INTC0_IMRL_INT_MASK16 |
\r
601 MCF_INTC0_IMRL_INT_MASK15 | MCF_INTC0_IMRL_INT_MASK14 |
\r
602 MCF_INTC0_IMRL_INT_MASK13 | MCF_INTC0_IMRL_INT_MASK12 |
\r
603 MCF_INTC0_IMRL_INT_MASK11 | MCF_INTC0_IMRL_INT_MASK10 |
\r
604 MCF_INTC0_IMRL_INT_MASK9 | MCF_INTC0_IMRL_INT_MASK8 |
\r
605 MCF_INTC0_IMRL_INT_MASK7 | MCF_INTC0_IMRL_INT_MASK6 |
\r
606 MCF_INTC0_IMRL_INT_MASK5 | MCF_INTC0_IMRL_INT_MASK4 |
\r
607 MCF_INTC0_IMRL_INT_MASK3 | MCF_INTC0_IMRL_INT_MASK2 |
\r
608 MCF_INTC0_IMRL_INT_MASK1;
\r
609 MCF_INTC1_IMRH = 0xffffffff;
\r
611 MCF_INTC1_IMRL_INT_MASK31 | MCF_INTC1_IMRL_INT_MASK30 |
\r
612 MCF_INTC1_IMRL_INT_MASK29 | MCF_INTC1_IMRL_INT_MASK28 |
\r
613 MCF_INTC1_IMRL_INT_MASK27 | MCF_INTC1_IMRL_INT_MASK26 |
\r
614 MCF_INTC1_IMRL_INT_MASK25 | MCF_INTC1_IMRL_INT_MASK24 |
\r
615 MCF_INTC1_IMRL_INT_MASK23 | MCF_INTC1_IMRL_INT_MASK22 |
\r
616 MCF_INTC1_IMRL_INT_MASK21 | MCF_INTC1_IMRL_INT_MASK20 |
\r
617 MCF_INTC1_IMRL_INT_MASK19 | MCF_INTC1_IMRL_INT_MASK18 |
\r
618 MCF_INTC1_IMRL_INT_MASK17 | MCF_INTC1_IMRL_INT_MASK16 |
\r
619 MCF_INTC1_IMRL_INT_MASK15 | MCF_INTC1_IMRL_INT_MASK14 |
\r
620 MCF_INTC1_IMRL_INT_MASK13 | MCF_INTC1_IMRL_INT_MASK12 |
\r
621 MCF_INTC1_IMRL_INT_MASK11 | MCF_INTC1_IMRL_INT_MASK10 |
\r
622 MCF_INTC1_IMRL_INT_MASK9 | MCF_INTC1_IMRL_INT_MASK8 |
\r
623 MCF_INTC1_IMRL_INT_MASK7 | MCF_INTC1_IMRL_INT_MASK6 |
\r
624 MCF_INTC1_IMRL_INT_MASK5 | MCF_INTC1_IMRL_INT_MASK4 |
\r
625 MCF_INTC1_IMRL_INT_MASK3 | MCF_INTC1_IMRL_INT_MASK2 |
\r
626 MCF_INTC1_IMRL_INT_MASK1;
\r
629 /*********************************************************************
\r
630 * init_pin_assignments - Pin Assignment and General Purpose I/O *
\r
631 **********************************************************************/
\r
633 init_pin_assignments( void )
\r
636 /* Pin assignments for port ADDR
\r
637 Pins are all GPIO inputs
\r
639 MCF_GPIO_PDDR_APDDR = 0;
\r
640 MCF_GPIO_PAR_AD = MCF_GPIO_PAR_AD_PAR_ADDR23
\r
641 | MCF_GPIO_PAR_AD_PAR_ADDR22
\r
642 | MCF_GPIO_PAR_AD_PAR_ADDR21 | MCF_GPIO_PAR_AD_PAR_DATAL;
\r
644 /* Pin assignments for ports DATAH and DATAL
\r
645 Pins are all GPIO inputs
\r
647 MCF_GPIO_PDDR_DATAH = 0;
\r
648 MCF_GPIO_PDDR_DATAL = 0;
\r
650 /* Pin assignments for port BUSCTL
\r
651 Pin /OE : External bus output enable, /OE
\r
652 Pin /TA : External bus transfer acknowledge, /TA
\r
653 Pin /TEA : External bus transfer error acknowledge, /TEA
\r
654 Pin R/W : External bus read/write indication, R/W
\r
655 Pin TSIZ1 : External bus transfer size TSIZ1 or DMA acknowledge /DACK1
\r
656 Pin TSIZ0 : External bus transfer size TSIZ0 or DMA acknowledge /DACK0
\r
657 Pin /TS : External bus transfer start, /TS
\r
658 Pin /TIP : External bus transfer in progess, /TIP
\r
660 MCF_GPIO_PDDR_BUSCTL = 0;
\r
661 MCF_GPIO_PAR_BUSCTL =
\r
662 MCF_GPIO_PAR_BUSCTL_PAR_OE | MCF_GPIO_PAR_BUSCTL_PAR_TA |
\r
663 MCF_GPIO_PAR_BUSCTL_PAR_TEA( 0x3 ) | MCF_GPIO_PAR_BUSCTL_PAR_RWB |
\r
664 MCF_GPIO_PAR_BUSCTL_PAR_TSIZ1 | MCF_GPIO_PAR_BUSCTL_PAR_TSIZ0 |
\r
665 MCF_GPIO_PAR_BUSCTL_PAR_TS( 0x3 ) |
\r
666 MCF_GPIO_PAR_BUSCTL_PAR_TIP( 0x3 );
\r
668 /* Pin assignments for port BS
\r
669 Pin /BS3 : External byte strobe /BS3
\r
670 Pin /BS2 : External byte strobe /BS2
\r
671 Pin /BS1 : External byte strobe /BS1
\r
672 Pin /BS0 : External byte strobe /BS0
\r
674 MCF_GPIO_PDDR_BS = 0;
\r
676 MCF_GPIO_PAR_BS_PAR_BS3 | MCF_GPIO_PAR_BS_PAR_BS2 |
\r
677 MCF_GPIO_PAR_BS_PAR_BS1 | MCF_GPIO_PAR_BS_PAR_BS0;
\r
679 /* Pin assignments for port CS
\r
680 Pin /CS7 : Chip select /CS7
\r
681 Pin /CS6 : Chip select /CS6
\r
682 Pin /CS5 : Chip select /CS5
\r
683 Pin /CS4 : Chip select /CS4
\r
684 Pin /CS3 : Chip select /CS3
\r
685 Pin /CS2 : Chip select /CS2
\r
686 Pin /CS1 : Chip select /CS1
\r
688 MCF_GPIO_PDDR_CS = 0;
\r
690 MCF_GPIO_PAR_CS_PAR_CS7 | MCF_GPIO_PAR_CS_PAR_CS6 |
\r
691 MCF_GPIO_PAR_CS_PAR_CS5 | MCF_GPIO_PAR_CS_PAR_CS4 |
\r
692 MCF_GPIO_PAR_CS_PAR_CS3 | MCF_GPIO_PAR_CS_PAR_CS2 |
\r
693 MCF_GPIO_PAR_CS_PAR_CS1;
\r
695 /* Pin assignments for port SDRAM
\r
696 Pin /SD_WE : SDRAM controller /SD_WE
\r
697 Pin /SD_SCAS : SDRAM controller /SD_SCAS
\r
698 Pin /SD_SRAS : SDRAM controller /SD_SRAS
\r
699 Pin /SD_SCKE : SDRAM controller /SD_SCKE
\r
700 Pin /SD_CS1 : SDRAM controller /SD_CS1
\r
701 Pin /SD_CS0 : SDRAM controller /SD_CS0
\r
703 MCF_GPIO_PDDR_SDRAM = 0;
\r
704 MCF_GPIO_PAR_SDRAM =
\r
705 MCF_GPIO_PAR_SDRAM_PAR_SDWE | MCF_GPIO_PAR_SDRAM_PAR_SCAS |
\r
706 MCF_GPIO_PAR_SDRAM_PAR_SRAS | MCF_GPIO_PAR_SDRAM_PAR_SCKE |
\r
707 MCF_GPIO_PAR_SDRAM_PAR_SDCS1 | MCF_GPIO_PAR_SDRAM_PAR_SDCS0;
\r
709 /* Pin assignments for port FECI2C
\r
710 Pins are all GPIO inputs
\r
712 MCF_GPIO_PDDR_FECI2C = 0;
\r
713 MCF_GPIO_PAR_FECI2C =
\r
714 MCF_GPIO_PAR_FECI2C_PAR_EMDC_FEC | MCF_GPIO_PAR_FECI2C_PAR_EMDIO_FEC;
\r
716 /* Pin assignments for port UARTL
\r
717 Pins are all GPIO inputs
\r
719 MCF_GPIO_PDDR_UARTL = 0;
\r
720 MCF_GPIO_PAR_UART = 0;
\r
722 /* Pin assignments for port UARTH
\r
723 Pin U2TXD : GPIO input
\r
724 Pin U2RXD : GPIO input
\r
725 Pin /IRQ2 : Interrupt request /IRQ2 or GPIO
\r
727 MCF_GPIO_PDDR_UARTH = 0;
\r
729 /* Pin assignments for port QSPI
\r
730 Pins are all GPIO inputs
\r
732 MCF_GPIO_PDDR_QSPI = 0;
\r
733 MCF_GPIO_PAR_QSPI = 0;
\r
735 /* Pin assignments for port TIMER
\r
736 Pins are all GPIO inputs
\r
738 MCF_GPIO_PDDR_TIMER = 0;
\r
739 MCF_GPIO_PAR_TIMER = 0;
\r
741 /* Pin assignments for port ETPU
\r
742 Pins are all GPIO inputs
\r
744 MCF_GPIO_PDDR_ETPU = 0;
\r
745 MCF_GPIO_PAR_ETPU = 0;
\r