diff options
Diffstat (limited to 'arch/m68k/include/asm/m5249sim.h')
-rw-r--r-- | arch/m68k/include/asm/m5249sim.h | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/arch/m68k/include/asm/m5249sim.h b/arch/m68k/include/asm/m5249sim.h index 366eb8602d2..14bce877ed8 100644 --- a/arch/m68k/include/asm/m5249sim.h +++ b/arch/m68k/include/asm/m5249sim.h | |||
@@ -71,16 +71,22 @@ | |||
71 | #define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */ | 71 | #define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */ |
72 | 72 | ||
73 | /* | 73 | /* |
74 | * Define system peripheral IRQ usage. | ||
75 | */ | ||
76 | #define MCF_IRQ_TIMER 30 /* Timer0, Level 6 */ | ||
77 | #define MCF_IRQ_PROFILER 31 /* Timer1, Level 7 */ | ||
78 | |||
79 | /* | ||
74 | * General purpose IO registers (in MBAR2). | 80 | * General purpose IO registers (in MBAR2). |
75 | */ | 81 | */ |
76 | #define MCFSIM2_GPIOREAD 0x0 /* GPIO read values */ | 82 | #define MCFSIM2_GPIOREAD (MCF_MBAR2 + 0x000) /* GPIO read values */ |
77 | #define MCFSIM2_GPIOWRITE 0x4 /* GPIO write values */ | 83 | #define MCFSIM2_GPIOWRITE (MCF_MBAR2 + 0x004) /* GPIO write values */ |
78 | #define MCFSIM2_GPIOENABLE 0x8 /* GPIO enabled */ | 84 | #define MCFSIM2_GPIOENABLE (MCF_MBAR2 + 0x008) /* GPIO enabled */ |
79 | #define MCFSIM2_GPIOFUNC 0xc /* GPIO function */ | 85 | #define MCFSIM2_GPIOFUNC (MCF_MBAR2 + 0x00C) /* GPIO function */ |
80 | #define MCFSIM2_GPIO1READ 0xb0 /* GPIO1 read values */ | 86 | #define MCFSIM2_GPIO1READ (MCF_MBAR2 + 0x0B0) /* GPIO1 read values */ |
81 | #define MCFSIM2_GPIO1WRITE 0xb4 /* GPIO1 write values */ | 87 | #define MCFSIM2_GPIO1WRITE (MCF_MBAR2 + 0x0B4) /* GPIO1 write values */ |
82 | #define MCFSIM2_GPIO1ENABLE 0xb8 /* GPIO1 enabled */ | 88 | #define MCFSIM2_GPIO1ENABLE (MCF_MBAR2 + 0x0B8) /* GPIO1 enabled */ |
83 | #define MCFSIM2_GPIO1FUNC 0xbc /* GPIO1 function */ | 89 | #define MCFSIM2_GPIO1FUNC (MCF_MBAR2 + 0x0BC) /* GPIO1 function */ |
84 | 90 | ||
85 | #define MCFSIM2_GPIOINTSTAT 0xc0 /* GPIO interrupt status */ | 91 | #define MCFSIM2_GPIOINTSTAT 0xc0 /* GPIO interrupt status */ |
86 | #define MCFSIM2_GPIOINTCLEAR 0xc0 /* GPIO interrupt clear */ | 92 | #define MCFSIM2_GPIOINTCLEAR 0xc0 /* GPIO interrupt clear */ |
@@ -100,20 +106,28 @@ | |||
100 | #define MCFSIM2_IDECONFIG1 0x18c /* IDEconfig1 */ | 106 | #define MCFSIM2_IDECONFIG1 0x18c /* IDEconfig1 */ |
101 | #define MCFSIM2_IDECONFIG2 0x190 /* IDEconfig2 */ | 107 | #define MCFSIM2_IDECONFIG2 0x190 /* IDEconfig2 */ |
102 | 108 | ||
103 | |||
104 | /* | 109 | /* |
105 | * Macro to set IMR register. It is 32 bits on the 5249. | 110 | * Define the base interrupt for the second interrupt controller. |
111 | * We set it to 128, out of the way of the base interrupts, and plenty | ||
112 | * of room for its 64 interrupts. | ||
106 | */ | 113 | */ |
107 | #define MCFSIM_IMR_MASKALL 0x7fffe /* All SIM intr sources */ | 114 | #define MCFINTC2_VECBASE 128 |
108 | 115 | ||
109 | #define mcf_getimr() \ | 116 | #define MCFINTC2_GPIOIRQ0 (MCFINTC2_VECBASE + 32) |
110 | *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) | 117 | #define MCFINTC2_GPIOIRQ1 (MCFINTC2_VECBASE + 33) |
118 | #define MCFINTC2_GPIOIRQ2 (MCFINTC2_VECBASE + 34) | ||
119 | #define MCFINTC2_GPIOIRQ3 (MCFINTC2_VECBASE + 35) | ||
120 | #define MCFINTC2_GPIOIRQ4 (MCFINTC2_VECBASE + 36) | ||
121 | #define MCFINTC2_GPIOIRQ5 (MCFINTC2_VECBASE + 37) | ||
122 | #define MCFINTC2_GPIOIRQ6 (MCFINTC2_VECBASE + 38) | ||
123 | #define MCFINTC2_GPIOIRQ7 (MCFINTC2_VECBASE + 39) | ||
111 | 124 | ||
112 | #define mcf_setimr(imr) \ | 125 | /* |
113 | *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) = (imr); | 126 | * Generic GPIO support |
114 | 127 | */ | |
115 | #define mcf_getipr() \ | 128 | #define MCFGPIO_PIN_MAX 64 |
116 | *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPR)) | 129 | #define MCFGPIO_IRQ_MAX -1 |
130 | #define MCFGPIO_IRQ_VECBASE -1 | ||
117 | 131 | ||
118 | /****************************************************************************/ | 132 | /****************************************************************************/ |
119 | 133 | ||
@@ -137,9 +151,9 @@ | |||
137 | subql #1,%a1 /* get MBAR2 address in a1 */ | 151 | subql #1,%a1 /* get MBAR2 address in a1 */ |
138 | 152 | ||
139 | /* | 153 | /* |
140 | * Move secondary interrupts to base at 128. | 154 | * Move secondary interrupts to their base (128). |
141 | */ | 155 | */ |
142 | moveb #0x80,%d0 | 156 | moveb #MCFINTC2_VECBASE,%d0 |
143 | moveb %d0,0x16b(%a1) /* interrupt base register */ | 157 | moveb %d0,0x16b(%a1) /* interrupt base register */ |
144 | 158 | ||
145 | /* | 159 | /* |