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 ***************************************************************************
\r
29 * SAVE TIME AND MONEY! Why not get us to quote to get FreeRTOS.org *
\r
30 * running on your hardware - or even write all or part of your application*
\r
31 * for you? See http://www.OpenRTOS.com for details. *
\r
33 ***************************************************************************
\r
34 ***************************************************************************
\r
36 Please ensure to read the configuration and relevant port sections of the
\r
37 online documentation.
\r
39 http://www.FreeRTOS.org - Documentation, latest information, license and
\r
42 http://www.SafeRTOS.com - A version that is certified for use in safety
\r
45 http://www.OpenRTOS.com - Commercial support, development, porting,
\r
46 licensing and training services.
\r
49 #include "mcf5xxx.h"
\r
50 #include "mcf523x.h"
\r
52 /* Function prototypes */
\r
53 void init_main( void );
\r
54 static void disable_interrupts( void );
\r
55 static void disable_watchdog_timer( void );
\r
56 static void disable_cache( void );
\r
57 static void init_ipsbar( void );
\r
58 static void init_basics( void );
\r
59 static void init_clock_config( void );
\r
60 static void init_chip_selects( void );
\r
61 static void init_bus_config( void );
\r
62 static void init_cache( void );
\r
63 static void init_eport( void );
\r
64 static void init_flexcan( void );
\r
65 static void init_power_management( void );
\r
66 static void init_dma_timers( void );
\r
67 static void init_interrupt_timers( void );
\r
68 static void init_watchdog_timers( void );
\r
69 static void init_pin_assignments( void );
\r
70 static void init_sdram_controller( void );
\r
71 static void init_interrupt_controller( void );
\r
74 /*********************************************************************
\r
75 * init_main - Main entry point for initialisation code *
\r
76 **********************************************************************/
\r
81 /* Initialise base address of peripherals, VBR, etc */
\r
84 init_clock_config( );
\r
86 /* Disable interrupts, watchdog timer, cache */
\r
87 disable_interrupts( );
\r
88 disable_watchdog_timer( );
\r
91 /* Initialise individual modules */
\r
92 init_chip_selects( );
\r
97 init_power_management( );
\r
99 init_interrupt_timers( );
\r
100 init_watchdog_timers( );
\r
101 init_pin_assignments( );
\r
102 init_sdram_controller( );
\r
104 /* Initialise interrupt controller */
\r
105 init_interrupt_controller( );
\r
108 /*********************************************************************
\r
109 * disable_interrupts - Disable all interrupt sources *
\r
110 **********************************************************************/
\r
112 disable_interrupts( void )
\r
118 /* Set ICR008-ICR063 to 0x0 */
\r
119 p = ( vuint8 * ) & MCF_INTC0_ICR8;
\r
120 for( i = 8; i <= 63; i++ )
\r
123 /* Set ICR108-ICR163 to 0x0 */
\r
124 p = ( vuint8 * ) & MCF_INTC1_ICR8;
\r
125 for( i = 108; i <= 163; i++ )
\r
130 /*********************************************************************
\r
131 * disable_watchdog_timer - Disable system watchdog timer *
\r
132 **********************************************************************/
\r
134 disable_watchdog_timer( void )
\r
137 /* Disable Core Watchdog Timer */
\r
141 /*********************************************************************
\r
142 * disable_cache - Disable and invalidate cache *
\r
143 **********************************************************************/
\r
145 disable_cache( void )
\r
147 asm ( "move.l #0x01000000, %d0" );
\r
148 asm ( "movec %d0, %CACR" );
\r
151 /*********************************************************************
\r
152 * init_basics - Configuration Information & VBR *
\r
153 **********************************************************************/
\r
155 init_basics( void )
\r
158 extern uint32 __RAMVEC[];
\r
159 extern uint32 __ROMVEC[];
\r
161 /* Transfer size not driven on SIZ[1:0] pins during external cycles
\r
162 Processor Status (PST) and Debug Data (DDATA) functions disabled
\r
163 Bus monitor disabled
\r
164 Output pads configured for full strength
\r
166 MCF_CCM_CCR = ( 0x1 << 15 ) | MCF_CCM_CCR_BME;
\r
168 /* Set up RAM vectors */
\r
169 for( i = 0; i < 256; i++ )
\r
172 __RAMVEC[i] = __ROMVEC[i];
\r
174 asm( "move.l %0,%%d0": :"i"( __RAMVEC ) );
\r
175 asm( "movec %d0,%vbr" );
\r
179 /*********************************************************************
\r
180 * init_clock_config - Clock Module *
\r
181 **********************************************************************/
\r
183 init_clock_config( void )
\r
185 /* Clock module uses normal PLL mode with 25.0000 MHz external reference (Fref)
\r
187 Bus clock frequency = 25.00 MHz
\r
188 Processor clock frequency = 2 x bus clock = 50.00 MHz
\r
189 Frequency Modulation disabled
\r
190 Loss of clock detection disabled
\r
191 Reset/Interrupt on loss of lock disabled
\r
193 MCF_FMPLL_SYNCR = 0x00100000; /* Set RFD=RFD+1 to avoid frequency overshoot */
\r
194 while( ( MCF_FMPLL_SYNSR & 0x08 ) == 0 ) /* Wait for PLL to lock */
\r
196 MCF_FMPLL_SYNCR = 0x00080000; /* Set desired RFD */
\r
197 while( ( MCF_FMPLL_SYNSR & 0x08 ) == 0 ) /* Wait for PLL to lock */
\r
202 /*********************************************************************
\r
203 * init_ipsbar - Internal Peripheral System Base Address (IPSBAR) *
\r
204 **********************************************************************/
\r
206 init_ipsbar( void )
\r
210 /* Base address of internal peripherals (IPSBAR) = 0x40000000
\r
212 Note: Processor powers up with IPS base address = 0x40000000
\r
213 Write to IPS base + 0x00000000 to set new value
\r
215 *( vuint32 * ) 0x40000000 = ( vuint32 ) __IPSBAR + 1;
\r
217 /* Configure RAMBAR in SCM module and allow dual-ported access. */
\r
218 MCF_SCM_RAMBAR = ( uint32 ) &__SRAM | MCF_SCM_RAMBAR_BDE;
\r
221 /*********************************************************************
\r
222 * init_chip_selects - Chip Select Module *
\r
223 **********************************************************************/
\r
225 init_chip_selects( void )
\r
227 extern void __FLASH;
\r
228 uint32 FLASH_ADDR = (uint32)&__FLASH;
\r
230 /* Chip Select 0 - External Flash */
\r
231 MCF_CS_CSAR0 = MCF_CS_CSAR_BA( FLASH_ADDR );
\r
233 | MCF_CS_CSCR_IWS( 6 )
\r
234 | MCF_CS_CSCR_AA | MCF_CS_CSCR_PS_16 );
\r
235 MCF_CS_CSMR0 = MCF_CS_CSMR_BAM_2M | MCF_CS_CSMR_V;
\r
237 /* Chip Select 1 disabled (CSMR1[V] = 0) */
\r
242 /* Chip Select 2 disabled (CSMR2[V] = 0) */
\r
247 /* Chip Select 3 disabled (CSMR3[V] = 0) */
\r
252 /* Chip Select 4 disabled (CSMR4[V] = 0) */
\r
257 /* Chip Select 5 disabled (CSMR5[V] = 0) */
\r
262 /* Chip Select 6 disabled (CSMR6[V] = 0) */
\r
267 /* Chip Select 7 disabled (CSMR7[V] = 0) */
\r
273 /*********************************************************************
\r
274 * init_bus_config - Internal Bus Arbitration *
\r
275 **********************************************************************/
\r
277 init_bus_config( void )
\r
280 /* Use round robin arbitration scheme
\r
281 Assigned priorities (highest first):
\r
285 DMA bandwidth control disabled
\r
286 Park on last active bus master
\r
289 MCF_SCM_MPARK_M3_PRTY( 0x3 ) | MCF_SCM_MPARK_M2_PRTY( 0x2 ) |
\r
290 MCF_SCM_MPARK_M1_PRTY( 0x1 );
\r
293 /*********************************************************************
\r
294 * init_cache - Instruction/Data Cache *
\r
295 **********************************************************************/
\r
299 /* Configured as split cache: 4 KByte instruction cache and 4 Kbyte data cache
\r
300 ACR0: Don't cache accesses to 16 MB memory region at address $20000000
\r
301 ACR1: Don't cache accesses to 1 GB memory region at address $40000000
\r
302 CACR: Cache accesses to the rest of memory
\r
304 asm("move.l #0x80000000,%d0");
\r
305 asm("movec %d0,%CACR");
\r
306 asm("move.l #0x2000c040,%d0");
\r
307 asm("movec %d0,%ACR0");
\r
308 asm("move.l #0x403fc040,%d0");
\r
309 asm("movec %d0,%ACR1");
\r
311 /* Instruction/Data cache disabled. */
\r
312 //asm( "move.l #0x00000000, %d0" );
\r
313 //asm( "movec %d0,%cacr" );
\r
316 /*********************************************************************
\r
317 * init_eport - Edge Port Module (EPORT) *
\r
318 **********************************************************************/
\r
323 /* Pins 1-7 configured as GPIO inputs */
\r
324 MCF_EPORT_EPPAR = 0;
\r
325 MCF_EPORT_EPDDR = 0;
\r
326 MCF_EPORT_EPIER = 0;
\r
329 /*********************************************************************
\r
330 * init_flexcan - FlexCAN Module *
\r
331 **********************************************************************/
\r
333 init_flexcan( void )
\r
336 /* FlexCAN controller 0 disabled (CANMCR0[MDIS]=1) */
\r
337 MCF_CAN_IMASK0 = 0;
\r
338 MCF_CAN_RXGMASK0 = MCF_CAN_RXGMASK_MI( 0x1fffffff );
\r
339 MCF_CAN_RX14MASK0 = MCF_CAN_RX14MASK_MI( 0x1fffffff );
\r
340 MCF_CAN_RX15MASK0 = MCF_CAN_RX15MASK_MI( 0x1fffffff );
\r
341 MCF_CAN_CANCTRL0 = 0;
\r
343 MCF_CAN_CANMCR_MDIS | MCF_CAN_CANMCR_FRZ | MCF_CAN_CANMCR_HALT |
\r
344 MCF_CAN_CANMCR_SUPV | MCF_CAN_CANMCR_MAXMB( 0xf );
\r
346 /* FlexCAN controller 1 disabled (CANMCR1[MDIS]=1) */
\r
347 MCF_CAN_IMASK1 = 0;
\r
348 MCF_CAN_RXGMASK1 = MCF_CAN_RXGMASK_MI( 0x1fffffff );
\r
349 MCF_CAN_RX14MASK1 = MCF_CAN_RX14MASK_MI( 0x1fffffff );
\r
350 MCF_CAN_RX15MASK1 = MCF_CAN_RX15MASK_MI( 0x1fffffff );
\r
351 MCF_CAN_CANCTRL1 = 0;
\r
353 MCF_CAN_CANMCR_MDIS | MCF_CAN_CANMCR_FRZ | MCF_CAN_CANMCR_HALT |
\r
354 MCF_CAN_CANMCR_SUPV | MCF_CAN_CANMCR_MAXMB( 0xf );
\r
357 /*********************************************************************
\r
358 * init_power_management - Power Management *
\r
359 **********************************************************************/
\r
361 init_power_management( void )
\r
364 /* On executing STOP instruction, processor enters RUN mode
\r
365 Mode is exited when an interrupt of level 1 or higher is received
\r
367 MCF_SCM_LPICR = MCF_SCM_LPICR_ENBSTOP;
\r
371 /*********************************************************************
\r
372 * init_sdram_controller - SDRAM Controller *
\r
373 **********************************************************************/
\r
375 init_sdram_controller( void )
\r
377 extern void __SDRAM;
\r
378 uint32 SDRAM_ADDR = (uint32)&__SDRAM;
\r
383 * Check to see if the SDRAM has already been initialized
\r
384 * by a run control tool
\r
386 if( !( MCF_SDRAMC_DACR0 & MCF_SDRAMC_DACR0_RE ) )
\r
388 /* Initialize DRAM Control Register: DCR */
\r
389 MCF_SDRAMC_DCR = ( MCF_SDRAMC_DCR_RTIM( 1 ) |
\r
390 MCF_SDRAMC_DCR_RC( ( 15 * FSYS_2 ) >> 4 ) );
\r
392 /* Initialize DACR0 */
\r
393 MCF_SDRAMC_DACR0 = ( MCF_SDRAMC_DACR0_BA( SDRAM_ADDR >> 18UL ) |
\r
394 MCF_SDRAMC_DACR0_CASL( 1 ) |
\r
395 MCF_SDRAMC_DACR0_CBM( 3 ) |
\r
396 MCF_SDRAMC_DACR0_PS( 0 ) );
\r
398 /* Initialize DMR0 */
\r
399 MCF_SDRAMC_DMR0 = ( MCF_SDRAMC_DMR_BAM_16M | MCF_SDRAMC_DMR0_V );
\r
401 /* Set IP (bit 3) in DACR */
\r
402 MCF_SDRAMC_DACR0 |= MCF_SDRAMC_DACR0_IP;
\r
404 /* Wait 30ns to allow banks to precharge */
\r
405 for( i = 0; i < 5; i++ )
\r
407 asm volatile ( " nop" );
\r
409 /* Write to this block to initiate precharge */
\r
410 *( uint32 * ) ( SDRAM_ADDR ) = 0xA5A59696;
\r
412 /* Set RE (bit 15) in DACR */
\r
413 MCF_SDRAMC_DACR0 |= MCF_SDRAMC_DACR0_RE;
\r
415 /* Wait for at least 8 auto refresh cycles to occur */
\r
416 for( i = 0; i < 2000; i++ )
\r
418 asm volatile ( "nop" );
\r
420 /* Finish the configuration by issuing the IMRS. */
\r
421 MCF_SDRAMC_DACR0 |= MCF_SDRAMC_DACR0_MRS;
\r
423 /* Write to the SDRAM Mode Register */
\r
424 *( uint32 * ) ( SDRAM_ADDR + 0x400 ) = 0xA5A59696;
\r
428 /*********************************************************************
\r
429 * init_dma_timers - DMA Timer Modules *
\r
430 **********************************************************************/
\r
432 init_dma_timers( void )
\r
435 /* DMA Timer 0 disabled (DTMR0[RST] = 0) */
\r
436 MCF_TIMER_DTMR0 = 0;
\r
437 MCF_TIMER_DTXMR0 = 0;
\r
438 MCF_TIMER_DTRR0 = 0xffffffff;
\r
440 /* DMA Timer 1 disabled (DTMR1[RST] = 0) */
\r
441 MCF_TIMER_DTMR1 = 0;
\r
442 MCF_TIMER_DTXMR1 = 0;
\r
443 MCF_TIMER_DTRR1 = 0xffffffff;
\r
445 /* DMA Timer 2 disabled (DTMR2[RST] = 0) */
\r
446 MCF_TIMER_DTMR2 = 0;
\r
447 MCF_TIMER_DTXMR2 = 0;
\r
448 MCF_TIMER_DTRR2 = 0xffffffff;
\r
450 /* DMA Timer 3 disabled (DTMR3[RST] = 0) */
\r
451 MCF_TIMER_DTMR3 = 0;
\r
452 MCF_TIMER_DTXMR3 = 0;
\r
453 MCF_TIMER_DTRR3 = 0xffffffff;
\r
456 /**********************************************************************
\r
457 * init_interrupt_timers - Programmable Interrupt Timer (PIT) Modules *
\r
458 ***********************************************************************/
\r
460 init_interrupt_timers( void )
\r
463 /* PIT0 disabled (PCSR0[EN]=0) */
\r
466 /* PIT1 disabled (PCSR1[EN]=0) */
\r
469 /* PIT2 disabled (PCSR2[EN]=0) */
\r
472 /* PIT3 disabled (PCSR3[EN]=0) */
\r
476 /*********************************************************************
\r
477 * init_watchdog_timers - Watchdog Timer Modules *
\r
478 **********************************************************************/
\r
480 init_watchdog_timers( void )
\r
483 /* Watchdog Timer disabled (WCR[EN]=0)
\r
484 NOTE: WCR and WMR cannot be written again until after the
\r
485 processor is reset.
\r
487 MCF_WTM_WCR = MCF_WTM_WCR_WAIT | MCF_WTM_WCR_DOZE | MCF_WTM_WCR_HALTED;
\r
488 MCF_WTM_WMR = 0xffff;
\r
490 /* Core Watchdog Timer disabled (CWCR[CWE]=0) */
\r
494 /*********************************************************************
\r
495 * init_interrupt_controller - Interrupt Controller *
\r
496 **********************************************************************/
\r
498 init_interrupt_controller( void )
\r
501 /* Configured interrupt sources in order of priority...
\r
502 Level 7: External interrupt /IRQ7, (initially masked)
\r
503 Level 6: External interrupt /IRQ6, (initially masked)
\r
504 Level 5: External interrupt /IRQ5, (initially masked)
\r
505 Level 4: External interrupt /IRQ4, (initially masked)
\r
506 Level 3: External interrupt /IRQ3, (initially masked)
\r
507 Level 2: External interrupt /IRQ2, (initially masked)
\r
508 Level 1: External interrupt /IRQ1, (initially masked)
\r
510 MCF_INTC0_ICR1 = 0;
\r
511 MCF_INTC0_ICR2 = 0;
\r
512 MCF_INTC0_ICR3 = 0;
\r
513 MCF_INTC0_ICR4 = 0;
\r
514 MCF_INTC0_ICR5 = 0;
\r
515 MCF_INTC0_ICR6 = 0;
\r
516 MCF_INTC0_ICR7 = 0;
\r
517 MCF_INTC0_ICR8 = 0;
\r
518 MCF_INTC0_ICR9 = 0;
\r
519 MCF_INTC0_ICR10 = 0;
\r
520 MCF_INTC0_ICR11 = 0;
\r
521 MCF_INTC0_ICR12 = 0;
\r
522 MCF_INTC0_ICR13 = 0;
\r
523 MCF_INTC0_ICR14 = 0;
\r
524 MCF_INTC0_ICR15 = 0;
\r
525 MCF_INTC0_ICR17 = 0;
\r
526 MCF_INTC0_ICR18 = 0;
\r
527 MCF_INTC0_ICR19 = 0;
\r
528 MCF_INTC0_ICR20 = 0;
\r
529 MCF_INTC0_ICR21 = 0;
\r
530 MCF_INTC0_ICR22 = 0;
\r
531 MCF_INTC0_ICR23 = 0;
\r
532 MCF_INTC0_ICR24 = 0;
\r
533 MCF_INTC0_ICR25 = 0;
\r
534 MCF_INTC0_ICR26 = 0;
\r
535 MCF_INTC0_ICR27 = 0;
\r
536 MCF_INTC0_ICR28 = 0;
\r
537 MCF_INTC0_ICR29 = 0;
\r
538 MCF_INTC0_ICR30 = 0;
\r
539 MCF_INTC0_ICR31 = 0;
\r
540 MCF_INTC0_ICR32 = 0;
\r
541 MCF_INTC0_ICR33 = 0;
\r
542 MCF_INTC0_ICR34 = 0;
\r
543 MCF_INTC0_ICR35 = 0;
\r
544 MCF_INTC0_ICR36 = 0;
\r
545 MCF_INTC0_ICR37 = 0;
\r
546 MCF_INTC0_ICR38 = 0;
\r
547 MCF_INTC0_ICR39 = 0;
\r
548 MCF_INTC0_ICR40 = 0;
\r
549 MCF_INTC0_ICR41 = 0;
\r
550 MCF_INTC0_ICR42 = 0;
\r
551 MCF_INTC0_ICR43 = 0;
\r
552 MCF_INTC0_ICR44 = 0;
\r
553 MCF_INTC0_ICR45 = 0;
\r
554 MCF_INTC0_ICR46 = 0;
\r
555 MCF_INTC0_ICR47 = 0;
\r
556 MCF_INTC0_ICR48 = 0;
\r
557 MCF_INTC0_ICR49 = 0;
\r
558 MCF_INTC0_ICR50 = 0;
\r
559 MCF_INTC0_ICR51 = 0;
\r
560 MCF_INTC0_ICR52 = 0;
\r
561 MCF_INTC0_ICR53 = 0;
\r
562 MCF_INTC0_ICR54 = 0;
\r
563 MCF_INTC0_ICR55 = 0;
\r
564 MCF_INTC0_ICR56 = 0;
\r
565 MCF_INTC0_ICR57 = 0;
\r
566 MCF_INTC0_ICR58 = 0;
\r
567 MCF_INTC0_ICR59 = 0;
\r
568 MCF_INTC0_ICR60 = 0;
\r
569 MCF_INTC1_ICR8 = 0;
\r
570 MCF_INTC1_ICR9 = 0;
\r
571 MCF_INTC1_ICR10 = 0;
\r
572 MCF_INTC1_ICR11 = 0;
\r
573 MCF_INTC1_ICR12 = 0;
\r
574 MCF_INTC1_ICR13 = 0;
\r
575 MCF_INTC1_ICR14 = 0;
\r
576 MCF_INTC1_ICR15 = 0;
\r
577 MCF_INTC1_ICR16 = 0;
\r
578 MCF_INTC1_ICR17 = 0;
\r
579 MCF_INTC1_ICR18 = 0;
\r
580 MCF_INTC1_ICR19 = 0;
\r
581 MCF_INTC1_ICR20 = 0;
\r
582 MCF_INTC1_ICR21 = 0;
\r
583 MCF_INTC1_ICR22 = 0;
\r
584 MCF_INTC1_ICR23 = 0;
\r
585 MCF_INTC1_ICR24 = 0;
\r
586 MCF_INTC1_ICR25 = 0;
\r
587 MCF_INTC1_ICR27 = 0;
\r
588 MCF_INTC1_ICR28 = 0;
\r
589 MCF_INTC1_ICR29 = 0;
\r
590 MCF_INTC1_ICR30 = 0;
\r
591 MCF_INTC1_ICR31 = 0;
\r
592 MCF_INTC1_ICR32 = 0;
\r
593 MCF_INTC1_ICR33 = 0;
\r
594 MCF_INTC1_ICR34 = 0;
\r
595 MCF_INTC1_ICR35 = 0;
\r
596 MCF_INTC1_ICR36 = 0;
\r
597 MCF_INTC1_ICR37 = 0;
\r
598 MCF_INTC1_ICR38 = 0;
\r
599 MCF_INTC1_ICR39 = 0;
\r
600 MCF_INTC1_ICR40 = 0;
\r
601 MCF_INTC1_ICR41 = 0;
\r
602 MCF_INTC1_ICR42 = 0;
\r
603 MCF_INTC1_ICR59 = 0;
\r
604 MCF_INTC0_IMRH = 0xffffffff;
\r
606 MCF_INTC0_IMRL_INT_MASK31 | MCF_INTC0_IMRL_INT_MASK30 |
\r
607 MCF_INTC0_IMRL_INT_MASK29 | MCF_INTC0_IMRL_INT_MASK28 |
\r
608 MCF_INTC0_IMRL_INT_MASK27 | MCF_INTC0_IMRL_INT_MASK26 |
\r
609 MCF_INTC0_IMRL_INT_MASK25 | MCF_INTC0_IMRL_INT_MASK24 |
\r
610 MCF_INTC0_IMRL_INT_MASK23 | MCF_INTC0_IMRL_INT_MASK22 |
\r
611 MCF_INTC0_IMRL_INT_MASK21 | MCF_INTC0_IMRL_INT_MASK20 |
\r
612 MCF_INTC0_IMRL_INT_MASK19 | MCF_INTC0_IMRL_INT_MASK18 |
\r
613 MCF_INTC0_IMRL_INT_MASK17 | MCF_INTC0_IMRL_INT_MASK16 |
\r
614 MCF_INTC0_IMRL_INT_MASK15 | MCF_INTC0_IMRL_INT_MASK14 |
\r
615 MCF_INTC0_IMRL_INT_MASK13 | MCF_INTC0_IMRL_INT_MASK12 |
\r
616 MCF_INTC0_IMRL_INT_MASK11 | MCF_INTC0_IMRL_INT_MASK10 |
\r
617 MCF_INTC0_IMRL_INT_MASK9 | MCF_INTC0_IMRL_INT_MASK8 |
\r
618 MCF_INTC0_IMRL_INT_MASK7 | MCF_INTC0_IMRL_INT_MASK6 |
\r
619 MCF_INTC0_IMRL_INT_MASK5 | MCF_INTC0_IMRL_INT_MASK4 |
\r
620 MCF_INTC0_IMRL_INT_MASK3 | MCF_INTC0_IMRL_INT_MASK2 |
\r
621 MCF_INTC0_IMRL_INT_MASK1;
\r
622 MCF_INTC1_IMRH = 0xffffffff;
\r
624 MCF_INTC1_IMRL_INT_MASK31 | MCF_INTC1_IMRL_INT_MASK30 |
\r
625 MCF_INTC1_IMRL_INT_MASK29 | MCF_INTC1_IMRL_INT_MASK28 |
\r
626 MCF_INTC1_IMRL_INT_MASK27 | MCF_INTC1_IMRL_INT_MASK26 |
\r
627 MCF_INTC1_IMRL_INT_MASK25 | MCF_INTC1_IMRL_INT_MASK24 |
\r
628 MCF_INTC1_IMRL_INT_MASK23 | MCF_INTC1_IMRL_INT_MASK22 |
\r
629 MCF_INTC1_IMRL_INT_MASK21 | MCF_INTC1_IMRL_INT_MASK20 |
\r
630 MCF_INTC1_IMRL_INT_MASK19 | MCF_INTC1_IMRL_INT_MASK18 |
\r
631 MCF_INTC1_IMRL_INT_MASK17 | MCF_INTC1_IMRL_INT_MASK16 |
\r
632 MCF_INTC1_IMRL_INT_MASK15 | MCF_INTC1_IMRL_INT_MASK14 |
\r
633 MCF_INTC1_IMRL_INT_MASK13 | MCF_INTC1_IMRL_INT_MASK12 |
\r
634 MCF_INTC1_IMRL_INT_MASK11 | MCF_INTC1_IMRL_INT_MASK10 |
\r
635 MCF_INTC1_IMRL_INT_MASK9 | MCF_INTC1_IMRL_INT_MASK8 |
\r
636 MCF_INTC1_IMRL_INT_MASK7 | MCF_INTC1_IMRL_INT_MASK6 |
\r
637 MCF_INTC1_IMRL_INT_MASK5 | MCF_INTC1_IMRL_INT_MASK4 |
\r
638 MCF_INTC1_IMRL_INT_MASK3 | MCF_INTC1_IMRL_INT_MASK2 |
\r
639 MCF_INTC1_IMRL_INT_MASK1;
\r
642 /*********************************************************************
\r
643 * init_pin_assignments - Pin Assignment and General Purpose I/O *
\r
644 **********************************************************************/
\r
646 init_pin_assignments( void )
\r
649 /* Pin assignments for port ADDR
\r
650 Pins are all GPIO inputs
\r
652 MCF_GPIO_PDDR_APDDR = 0;
\r
653 MCF_GPIO_PAR_AD = MCF_GPIO_PAR_AD_PAR_ADDR23
\r
654 | MCF_GPIO_PAR_AD_PAR_ADDR22
\r
655 | MCF_GPIO_PAR_AD_PAR_ADDR21 | MCF_GPIO_PAR_AD_PAR_DATAL;
\r
657 /* Pin assignments for ports DATAH and DATAL
\r
658 Pins are all GPIO inputs
\r
660 MCF_GPIO_PDDR_DATAH = 0;
\r
661 MCF_GPIO_PDDR_DATAL = 0;
\r
663 /* Pin assignments for port BUSCTL
\r
664 Pin /OE : External bus output enable, /OE
\r
665 Pin /TA : External bus transfer acknowledge, /TA
\r
666 Pin /TEA : External bus transfer error acknowledge, /TEA
\r
667 Pin R/W : External bus read/write indication, R/W
\r
668 Pin TSIZ1 : External bus transfer size TSIZ1 or DMA acknowledge /DACK1
\r
669 Pin TSIZ0 : External bus transfer size TSIZ0 or DMA acknowledge /DACK0
\r
670 Pin /TS : External bus transfer start, /TS
\r
671 Pin /TIP : External bus transfer in progess, /TIP
\r
673 MCF_GPIO_PDDR_BUSCTL = 0;
\r
674 MCF_GPIO_PAR_BUSCTL =
\r
675 MCF_GPIO_PAR_BUSCTL_PAR_OE | MCF_GPIO_PAR_BUSCTL_PAR_TA |
\r
676 MCF_GPIO_PAR_BUSCTL_PAR_TEA( 0x3 ) | MCF_GPIO_PAR_BUSCTL_PAR_RWB |
\r
677 MCF_GPIO_PAR_BUSCTL_PAR_TSIZ1 | MCF_GPIO_PAR_BUSCTL_PAR_TSIZ0 |
\r
678 MCF_GPIO_PAR_BUSCTL_PAR_TS( 0x3 ) |
\r
679 MCF_GPIO_PAR_BUSCTL_PAR_TIP( 0x3 );
\r
681 /* Pin assignments for port BS
\r
682 Pin /BS3 : External byte strobe /BS3
\r
683 Pin /BS2 : External byte strobe /BS2
\r
684 Pin /BS1 : External byte strobe /BS1
\r
685 Pin /BS0 : External byte strobe /BS0
\r
687 MCF_GPIO_PDDR_BS = 0;
\r
689 MCF_GPIO_PAR_BS_PAR_BS3 | MCF_GPIO_PAR_BS_PAR_BS2 |
\r
690 MCF_GPIO_PAR_BS_PAR_BS1 | MCF_GPIO_PAR_BS_PAR_BS0;
\r
692 /* Pin assignments for port CS
\r
693 Pin /CS7 : Chip select /CS7
\r
694 Pin /CS6 : Chip select /CS6
\r
695 Pin /CS5 : Chip select /CS5
\r
696 Pin /CS4 : Chip select /CS4
\r
697 Pin /CS3 : Chip select /CS3
\r
698 Pin /CS2 : Chip select /CS2
\r
699 Pin /CS1 : Chip select /CS1
\r
701 MCF_GPIO_PDDR_CS = 0;
\r
703 MCF_GPIO_PAR_CS_PAR_CS7 | MCF_GPIO_PAR_CS_PAR_CS6 |
\r
704 MCF_GPIO_PAR_CS_PAR_CS5 | MCF_GPIO_PAR_CS_PAR_CS4 |
\r
705 MCF_GPIO_PAR_CS_PAR_CS3 | MCF_GPIO_PAR_CS_PAR_CS2 |
\r
706 MCF_GPIO_PAR_CS_PAR_CS1;
\r
708 /* Pin assignments for port SDRAM
\r
709 Pin /SD_WE : SDRAM controller /SD_WE
\r
710 Pin /SD_SCAS : SDRAM controller /SD_SCAS
\r
711 Pin /SD_SRAS : SDRAM controller /SD_SRAS
\r
712 Pin /SD_SCKE : SDRAM controller /SD_SCKE
\r
713 Pin /SD_CS1 : SDRAM controller /SD_CS1
\r
714 Pin /SD_CS0 : SDRAM controller /SD_CS0
\r
716 MCF_GPIO_PDDR_SDRAM = 0;
\r
717 MCF_GPIO_PAR_SDRAM =
\r
718 MCF_GPIO_PAR_SDRAM_PAR_SDWE | MCF_GPIO_PAR_SDRAM_PAR_SCAS |
\r
719 MCF_GPIO_PAR_SDRAM_PAR_SRAS | MCF_GPIO_PAR_SDRAM_PAR_SCKE |
\r
720 MCF_GPIO_PAR_SDRAM_PAR_SDCS1 | MCF_GPIO_PAR_SDRAM_PAR_SDCS0;
\r
722 /* Pin assignments for port FECI2C
\r
723 Pins are all GPIO inputs
\r
725 MCF_GPIO_PDDR_FECI2C = 0;
\r
726 MCF_GPIO_PAR_FECI2C =
\r
727 MCF_GPIO_PAR_FECI2C_PAR_EMDC_FEC | MCF_GPIO_PAR_FECI2C_PAR_EMDIO_FEC;
\r
729 /* Pin assignments for port UARTL
\r
730 Pins are all GPIO inputs
\r
732 MCF_GPIO_PDDR_UARTL = 0;
\r
733 MCF_GPIO_PAR_UART = 0;
\r
735 /* Pin assignments for port UARTH
\r
736 Pin U2TXD : GPIO input
\r
737 Pin U2RXD : GPIO input
\r
738 Pin /IRQ2 : Interrupt request /IRQ2 or GPIO
\r
740 MCF_GPIO_PDDR_UARTH = 0;
\r
742 /* Pin assignments for port QSPI
\r
743 Pins are all GPIO inputs
\r
745 MCF_GPIO_PDDR_QSPI = 0;
\r
746 MCF_GPIO_PAR_QSPI = 0;
\r
748 /* Pin assignments for port TIMER
\r
749 Pins are all GPIO inputs
\r
751 MCF_GPIO_PDDR_TIMER = 0;
\r
752 MCF_GPIO_PAR_TIMER = 0;
\r
754 /* Pin assignments for port ETPU
\r
755 Pins are all GPIO inputs
\r
757 MCF_GPIO_PDDR_ETPU = 0;
\r
758 MCF_GPIO_PAR_ETPU = 0;
\r