diff options
Diffstat (limited to 'arch/m68k/platform/coldfire')
-rw-r--r-- | arch/m68k/platform/coldfire/clk.c | 6 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/device.c | 4 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/head.S | 2 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/intc-5249.c | 10 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/intc-5272.c | 20 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/intc.c | 28 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/m523x.c | 8 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/m5249.c | 10 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/m525x.c | 4 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/m5272.c | 19 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/m527x.c | 24 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/m528x.c | 6 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/m532x.c | 221 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/m54xx.c | 16 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/nettel.c | 4 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/pci.c | 4 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/reset.c | 2 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/sltimers.c | 4 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/timers.c | 4 |
19 files changed, 192 insertions, 204 deletions
diff --git a/arch/m68k/platform/coldfire/clk.c b/arch/m68k/platform/coldfire/clk.c index 75f9ee967ea7..9cd13b4ce42b 100644 --- a/arch/m68k/platform/coldfire/clk.c +++ b/arch/m68k/platform/coldfire/clk.c | |||
@@ -146,9 +146,3 @@ struct clk_ops clk_ops1 = { | |||
146 | }; | 146 | }; |
147 | #endif /* MCFPM_PPMCR1 */ | 147 | #endif /* MCFPM_PPMCR1 */ |
148 | #endif /* MCFPM_PPMCR0 */ | 148 | #endif /* MCFPM_PPMCR0 */ |
149 | |||
150 | struct clk *devm_clk_get(struct device *dev, const char *id) | ||
151 | { | ||
152 | return NULL; | ||
153 | } | ||
154 | EXPORT_SYMBOL(devm_clk_get); | ||
diff --git a/arch/m68k/platform/coldfire/device.c b/arch/m68k/platform/coldfire/device.c index 81f0fb5e51cf..71ea4c02795d 100644 --- a/arch/m68k/platform/coldfire/device.c +++ b/arch/m68k/platform/coldfire/device.c | |||
@@ -347,12 +347,12 @@ static void __init mcf_uart_set_irq(void) | |||
347 | { | 347 | { |
348 | #ifdef MCFUART_UIVR | 348 | #ifdef MCFUART_UIVR |
349 | /* UART0 interrupt setup */ | 349 | /* UART0 interrupt setup */ |
350 | writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); | 350 | writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCFSIM_UART1ICR); |
351 | writeb(MCF_IRQ_UART0, MCFUART_BASE0 + MCFUART_UIVR); | 351 | writeb(MCF_IRQ_UART0, MCFUART_BASE0 + MCFUART_UIVR); |
352 | mcf_mapirq2imr(MCF_IRQ_UART0, MCFINTC_UART0); | 352 | mcf_mapirq2imr(MCF_IRQ_UART0, MCFINTC_UART0); |
353 | 353 | ||
354 | /* UART1 interrupt setup */ | 354 | /* UART1 interrupt setup */ |
355 | writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); | 355 | writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCFSIM_UART2ICR); |
356 | writeb(MCF_IRQ_UART1, MCFUART_BASE1 + MCFUART_UIVR); | 356 | writeb(MCF_IRQ_UART1, MCFUART_BASE1 + MCFUART_UIVR); |
357 | mcf_mapirq2imr(MCF_IRQ_UART1, MCFINTC_UART1); | 357 | mcf_mapirq2imr(MCF_IRQ_UART1, MCFINTC_UART1); |
358 | #endif | 358 | #endif |
diff --git a/arch/m68k/platform/coldfire/head.S b/arch/m68k/platform/coldfire/head.S index b88f5716f357..fa31be297b85 100644 --- a/arch/m68k/platform/coldfire/head.S +++ b/arch/m68k/platform/coldfire/head.S | |||
@@ -60,7 +60,7 @@ | |||
60 | 60 | ||
61 | #elif defined(CONFIG_M5272) | 61 | #elif defined(CONFIG_M5272) |
62 | .macro GET_MEM_SIZE | 62 | .macro GET_MEM_SIZE |
63 | movel MCF_MBAR+MCFSIM_CSOR7,%d0 /* get SDRAM address mask */ | 63 | movel MCFSIM_CSOR7,%d0 /* get SDRAM address mask */ |
64 | andil #0xfffff000,%d0 /* mask out chip select options */ | 64 | andil #0xfffff000,%d0 /* mask out chip select options */ |
65 | negl %d0 /* negate bits */ | 65 | negl %d0 /* negate bits */ |
66 | .endm | 66 | .endm |
diff --git a/arch/m68k/platform/coldfire/intc-5249.c b/arch/m68k/platform/coldfire/intc-5249.c index f343bf7bf5b0..0864b836699a 100644 --- a/arch/m68k/platform/coldfire/intc-5249.c +++ b/arch/m68k/platform/coldfire/intc-5249.c | |||
@@ -20,22 +20,22 @@ | |||
20 | static void intc2_irq_gpio_mask(struct irq_data *d) | 20 | static void intc2_irq_gpio_mask(struct irq_data *d) |
21 | { | 21 | { |
22 | u32 imr; | 22 | u32 imr; |
23 | imr = readl(MCF_MBAR2 + MCFSIM2_GPIOINTENABLE); | 23 | imr = readl(MCFSIM2_GPIOINTENABLE); |
24 | imr &= ~(0x1 << (d->irq - MCFINTC2_GPIOIRQ0)); | 24 | imr &= ~(0x1 << (d->irq - MCFINTC2_GPIOIRQ0)); |
25 | writel(imr, MCF_MBAR2 + MCFSIM2_GPIOINTENABLE); | 25 | writel(imr, MCFSIM2_GPIOINTENABLE); |
26 | } | 26 | } |
27 | 27 | ||
28 | static void intc2_irq_gpio_unmask(struct irq_data *d) | 28 | static void intc2_irq_gpio_unmask(struct irq_data *d) |
29 | { | 29 | { |
30 | u32 imr; | 30 | u32 imr; |
31 | imr = readl(MCF_MBAR2 + MCFSIM2_GPIOINTENABLE); | 31 | imr = readl(MCFSIM2_GPIOINTENABLE); |
32 | imr |= (0x1 << (d->irq - MCFINTC2_GPIOIRQ0)); | 32 | imr |= (0x1 << (d->irq - MCFINTC2_GPIOIRQ0)); |
33 | writel(imr, MCF_MBAR2 + MCFSIM2_GPIOINTENABLE); | 33 | writel(imr, MCFSIM2_GPIOINTENABLE); |
34 | } | 34 | } |
35 | 35 | ||
36 | static void intc2_irq_gpio_ack(struct irq_data *d) | 36 | static void intc2_irq_gpio_ack(struct irq_data *d) |
37 | { | 37 | { |
38 | writel(0x1 << (d->irq - MCFINTC2_GPIOIRQ0), MCF_MBAR2 + MCFSIM2_GPIOINTCLEAR); | 38 | writel(0x1 << (d->irq - MCFINTC2_GPIOIRQ0), MCFSIM2_GPIOINTCLEAR); |
39 | } | 39 | } |
40 | 40 | ||
41 | static struct irq_chip intc2_irq_gpio_chip = { | 41 | static struct irq_chip intc2_irq_gpio_chip = { |
diff --git a/arch/m68k/platform/coldfire/intc-5272.c b/arch/m68k/platform/coldfire/intc-5272.c index 7160e618b0a9..d7b695629a7e 100644 --- a/arch/m68k/platform/coldfire/intc-5272.c +++ b/arch/m68k/platform/coldfire/intc-5272.c | |||
@@ -86,7 +86,7 @@ static void intc_irq_mask(struct irq_data *d) | |||
86 | u32 v; | 86 | u32 v; |
87 | irq -= MCFINT_VECBASE; | 87 | irq -= MCFINT_VECBASE; |
88 | v = 0x8 << intc_irqmap[irq].index; | 88 | v = 0x8 << intc_irqmap[irq].index; |
89 | writel(v, MCF_MBAR + intc_irqmap[irq].icr); | 89 | writel(v, intc_irqmap[irq].icr); |
90 | } | 90 | } |
91 | } | 91 | } |
92 | 92 | ||
@@ -98,7 +98,7 @@ static void intc_irq_unmask(struct irq_data *d) | |||
98 | u32 v; | 98 | u32 v; |
99 | irq -= MCFINT_VECBASE; | 99 | irq -= MCFINT_VECBASE; |
100 | v = 0xd << intc_irqmap[irq].index; | 100 | v = 0xd << intc_irqmap[irq].index; |
101 | writel(v, MCF_MBAR + intc_irqmap[irq].icr); | 101 | writel(v, intc_irqmap[irq].icr); |
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||
@@ -111,10 +111,10 @@ static void intc_irq_ack(struct irq_data *d) | |||
111 | irq -= MCFINT_VECBASE; | 111 | irq -= MCFINT_VECBASE; |
112 | if (intc_irqmap[irq].ack) { | 112 | if (intc_irqmap[irq].ack) { |
113 | u32 v; | 113 | u32 v; |
114 | v = readl(MCF_MBAR + intc_irqmap[irq].icr); | 114 | v = readl(intc_irqmap[irq].icr); |
115 | v &= (0x7 << intc_irqmap[irq].index); | 115 | v &= (0x7 << intc_irqmap[irq].index); |
116 | v |= (0x8 << intc_irqmap[irq].index); | 116 | v |= (0x8 << intc_irqmap[irq].index); |
117 | writel(v, MCF_MBAR + intc_irqmap[irq].icr); | 117 | writel(v, intc_irqmap[irq].icr); |
118 | } | 118 | } |
119 | } | 119 | } |
120 | } | 120 | } |
@@ -127,12 +127,12 @@ static int intc_irq_set_type(struct irq_data *d, unsigned int type) | |||
127 | irq -= MCFINT_VECBASE; | 127 | irq -= MCFINT_VECBASE; |
128 | if (intc_irqmap[irq].ack) { | 128 | if (intc_irqmap[irq].ack) { |
129 | u32 v; | 129 | u32 v; |
130 | v = readl(MCF_MBAR + MCFSIM_PITR); | 130 | v = readl(MCFSIM_PITR); |
131 | if (type == IRQ_TYPE_EDGE_FALLING) | 131 | if (type == IRQ_TYPE_EDGE_FALLING) |
132 | v &= ~(0x1 << (32 - irq)); | 132 | v &= ~(0x1 << (32 - irq)); |
133 | else | 133 | else |
134 | v |= (0x1 << (32 - irq)); | 134 | v |= (0x1 << (32 - irq)); |
135 | writel(v, MCF_MBAR + MCFSIM_PITR); | 135 | writel(v, MCFSIM_PITR); |
136 | } | 136 | } |
137 | } | 137 | } |
138 | return 0; | 138 | return 0; |
@@ -163,10 +163,10 @@ void __init init_IRQ(void) | |||
163 | int irq, edge; | 163 | int irq, edge; |
164 | 164 | ||
165 | /* Mask all interrupt sources */ | 165 | /* Mask all interrupt sources */ |
166 | writel(0x88888888, MCF_MBAR + MCFSIM_ICR1); | 166 | writel(0x88888888, MCFSIM_ICR1); |
167 | writel(0x88888888, MCF_MBAR + MCFSIM_ICR2); | 167 | writel(0x88888888, MCFSIM_ICR2); |
168 | writel(0x88888888, MCF_MBAR + MCFSIM_ICR3); | 168 | writel(0x88888888, MCFSIM_ICR3); |
169 | writel(0x88888888, MCF_MBAR + MCFSIM_ICR4); | 169 | writel(0x88888888, MCFSIM_ICR4); |
170 | 170 | ||
171 | for (irq = 0; (irq < NR_IRQS); irq++) { | 171 | for (irq = 0; (irq < NR_IRQS); irq++) { |
172 | irq_set_chip(irq, &intc_irq_chip); | 172 | irq_set_chip(irq, &intc_irq_chip); |
diff --git a/arch/m68k/platform/coldfire/intc.c b/arch/m68k/platform/coldfire/intc.c index 5c0c150b4067..cce257420388 100644 --- a/arch/m68k/platform/coldfire/intc.c +++ b/arch/m68k/platform/coldfire/intc.c | |||
@@ -45,23 +45,23 @@ unsigned char mcf_irq2imr[NR_IRQS]; | |||
45 | void mcf_setimr(int index) | 45 | void mcf_setimr(int index) |
46 | { | 46 | { |
47 | u16 imr; | 47 | u16 imr; |
48 | imr = __raw_readw(MCF_MBAR + MCFSIM_IMR); | 48 | imr = __raw_readw(MCFSIM_IMR); |
49 | __raw_writew(imr | (0x1 << index), MCF_MBAR + MCFSIM_IMR); | 49 | __raw_writew(imr | (0x1 << index), MCFSIM_IMR); |
50 | } | 50 | } |
51 | 51 | ||
52 | void mcf_clrimr(int index) | 52 | void mcf_clrimr(int index) |
53 | { | 53 | { |
54 | u16 imr; | 54 | u16 imr; |
55 | imr = __raw_readw(MCF_MBAR + MCFSIM_IMR); | 55 | imr = __raw_readw(MCFSIM_IMR); |
56 | __raw_writew(imr & ~(0x1 << index), MCF_MBAR + MCFSIM_IMR); | 56 | __raw_writew(imr & ~(0x1 << index), MCFSIM_IMR); |
57 | } | 57 | } |
58 | 58 | ||
59 | void mcf_maskimr(unsigned int mask) | 59 | void mcf_maskimr(unsigned int mask) |
60 | { | 60 | { |
61 | u16 imr; | 61 | u16 imr; |
62 | imr = __raw_readw(MCF_MBAR + MCFSIM_IMR); | 62 | imr = __raw_readw(MCFSIM_IMR); |
63 | imr |= mask; | 63 | imr |= mask; |
64 | __raw_writew(imr, MCF_MBAR + MCFSIM_IMR); | 64 | __raw_writew(imr, MCFSIM_IMR); |
65 | } | 65 | } |
66 | 66 | ||
67 | #else | 67 | #else |
@@ -69,23 +69,23 @@ void mcf_maskimr(unsigned int mask) | |||
69 | void mcf_setimr(int index) | 69 | void mcf_setimr(int index) |
70 | { | 70 | { |
71 | u32 imr; | 71 | u32 imr; |
72 | imr = __raw_readl(MCF_MBAR + MCFSIM_IMR); | 72 | imr = __raw_readl(MCFSIM_IMR); |
73 | __raw_writel(imr | (0x1 << index), MCF_MBAR + MCFSIM_IMR); | 73 | __raw_writel(imr | (0x1 << index), MCFSIM_IMR); |
74 | } | 74 | } |
75 | 75 | ||
76 | void mcf_clrimr(int index) | 76 | void mcf_clrimr(int index) |
77 | { | 77 | { |
78 | u32 imr; | 78 | u32 imr; |
79 | imr = __raw_readl(MCF_MBAR + MCFSIM_IMR); | 79 | imr = __raw_readl(MCFSIM_IMR); |
80 | __raw_writel(imr & ~(0x1 << index), MCF_MBAR + MCFSIM_IMR); | 80 | __raw_writel(imr & ~(0x1 << index), MCFSIM_IMR); |
81 | } | 81 | } |
82 | 82 | ||
83 | void mcf_maskimr(unsigned int mask) | 83 | void mcf_maskimr(unsigned int mask) |
84 | { | 84 | { |
85 | u32 imr; | 85 | u32 imr; |
86 | imr = __raw_readl(MCF_MBAR + MCFSIM_IMR); | 86 | imr = __raw_readl(MCFSIM_IMR); |
87 | imr |= mask; | 87 | imr |= mask; |
88 | __raw_writel(imr, MCF_MBAR + MCFSIM_IMR); | 88 | __raw_writel(imr, MCFSIM_IMR); |
89 | } | 89 | } |
90 | 90 | ||
91 | #endif | 91 | #endif |
@@ -104,9 +104,9 @@ void mcf_autovector(int irq) | |||
104 | #ifdef MCFSIM_AVR | 104 | #ifdef MCFSIM_AVR |
105 | if ((irq >= EIRQ1) && (irq <= EIRQ7)) { | 105 | if ((irq >= EIRQ1) && (irq <= EIRQ7)) { |
106 | u8 avec; | 106 | u8 avec; |
107 | avec = __raw_readb(MCF_MBAR + MCFSIM_AVR); | 107 | avec = __raw_readb(MCFSIM_AVR); |
108 | avec |= (0x1 << (irq - EIRQ1 + 1)); | 108 | avec |= (0x1 << (irq - EIRQ1 + 1)); |
109 | __raw_writeb(avec, MCF_MBAR + MCFSIM_AVR); | 109 | __raw_writeb(avec, MCFSIM_AVR); |
110 | } | 110 | } |
111 | #endif | 111 | #endif |
112 | } | 112 | } |
diff --git a/arch/m68k/platform/coldfire/m523x.c b/arch/m68k/platform/coldfire/m523x.c index d47dfd8f50a2..ff37fe9553ea 100644 --- a/arch/m68k/platform/coldfire/m523x.c +++ b/arch/m68k/platform/coldfire/m523x.c | |||
@@ -42,14 +42,8 @@ static void __init m523x_qspi_init(void) | |||
42 | 42 | ||
43 | static void __init m523x_fec_init(void) | 43 | static void __init m523x_fec_init(void) |
44 | { | 44 | { |
45 | u16 par; | ||
46 | u8 v; | ||
47 | |||
48 | /* Set multi-function pins to ethernet use */ | 45 | /* Set multi-function pins to ethernet use */ |
49 | par = readw(MCF_IPSBAR + 0x100082); | 46 | writeb(readb(MCFGPIO_PAR_FECI2C) | 0xf0, MCFGPIO_PAR_FECI2C); |
50 | writew(par | 0xf00, MCF_IPSBAR + 0x100082); | ||
51 | v = readb(MCF_IPSBAR + 0x100078); | ||
52 | writeb(v | 0xc0, MCF_IPSBAR + 0x100078); | ||
53 | } | 47 | } |
54 | 48 | ||
55 | /***************************************************************************/ | 49 | /***************************************************************************/ |
diff --git a/arch/m68k/platform/coldfire/m5249.c b/arch/m68k/platform/coldfire/m5249.c index 300e729a58d0..23b19cb7ab50 100644 --- a/arch/m68k/platform/coldfire/m5249.c +++ b/arch/m68k/platform/coldfire/m5249.c | |||
@@ -57,7 +57,7 @@ static void __init m5249_qspi_init(void) | |||
57 | { | 57 | { |
58 | /* QSPI irq setup */ | 58 | /* QSPI irq setup */ |
59 | writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI0, | 59 | writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI0, |
60 | MCF_MBAR + MCFSIM_QSPIICR); | 60 | MCFSIM_QSPIICR); |
61 | mcf_mapirq2imr(MCF_IRQ_QSPI, MCFINTC_QSPI); | 61 | mcf_mapirq2imr(MCF_IRQ_QSPI, MCFINTC_QSPI); |
62 | } | 62 | } |
63 | 63 | ||
@@ -72,11 +72,11 @@ static void __init m5249_smc91x_init(void) | |||
72 | u32 gpio; | 72 | u32 gpio; |
73 | 73 | ||
74 | /* Set the GPIO line as interrupt source for smc91x device */ | 74 | /* Set the GPIO line as interrupt source for smc91x device */ |
75 | gpio = readl(MCF_MBAR2 + MCFSIM2_GPIOINTENABLE); | 75 | gpio = readl(MCFSIM2_GPIOINTENABLE); |
76 | writel(gpio | 0x40, MCF_MBAR2 + MCFSIM2_GPIOINTENABLE); | 76 | writel(gpio | 0x40, MCFSIM2_GPIOINTENABLE); |
77 | 77 | ||
78 | gpio = readl(MCF_MBAR2 + MCFSIM2_INTLEVEL5); | 78 | gpio = readl(MCFSIM2_INTLEVEL5); |
79 | writel(gpio | 0x04000000, MCF_MBAR2 + MCFSIM2_INTLEVEL5); | 79 | writel(gpio | 0x04000000, MCFSIM2_INTLEVEL5); |
80 | } | 80 | } |
81 | 81 | ||
82 | #endif /* CONFIG_M5249C3 */ | 82 | #endif /* CONFIG_M5249C3 */ |
diff --git a/arch/m68k/platform/coldfire/m525x.c b/arch/m68k/platform/coldfire/m525x.c index 8ce905f9b84f..fce8f8a45bf0 100644 --- a/arch/m68k/platform/coldfire/m525x.c +++ b/arch/m68k/platform/coldfire/m525x.c | |||
@@ -30,7 +30,7 @@ static void __init m525x_qspi_init(void) | |||
30 | 30 | ||
31 | /* QSPI irq setup */ | 31 | /* QSPI irq setup */ |
32 | writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI0, | 32 | writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI0, |
33 | MCF_MBAR + MCFSIM_QSPIICR); | 33 | MCFSIM_QSPIICR); |
34 | mcf_mapirq2imr(MCF_IRQ_QSPI, MCFINTC_QSPI); | 34 | mcf_mapirq2imr(MCF_IRQ_QSPI, MCFINTC_QSPI); |
35 | #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ | 35 | #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ |
36 | } | 36 | } |
@@ -42,7 +42,7 @@ static void __init m525x_i2c_init(void) | |||
42 | 42 | ||
43 | /* first I2C controller uses regular irq setup */ | 43 | /* first I2C controller uses regular irq setup */ |
44 | writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL5 | MCFSIM_ICR_PRI0, | 44 | writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL5 | MCFSIM_ICR_PRI0, |
45 | MCF_MBAR + MCFSIM_I2CICR); | 45 | MCFSIM_I2CICR); |
46 | mcf_mapirq2imr(MCF_IRQ_I2C0, MCFINTC_I2C); | 46 | mcf_mapirq2imr(MCF_IRQ_I2C0, MCFINTC_I2C); |
47 | 47 | ||
48 | /* second I2C controller is completely different */ | 48 | /* second I2C controller is completely different */ |
diff --git a/arch/m68k/platform/coldfire/m5272.c b/arch/m68k/platform/coldfire/m5272.c index e68bc7a148eb..45b246d052ef 100644 --- a/arch/m68k/platform/coldfire/m5272.c +++ b/arch/m68k/platform/coldfire/m5272.c | |||
@@ -35,13 +35,13 @@ static void __init m5272_uarts_init(void) | |||
35 | u32 v; | 35 | u32 v; |
36 | 36 | ||
37 | /* Enable the output lines for the serial ports */ | 37 | /* Enable the output lines for the serial ports */ |
38 | v = readl(MCF_MBAR + MCFSIM_PBCNT); | 38 | v = readl(MCFSIM_PBCNT); |
39 | v = (v & ~0x000000ff) | 0x00000055; | 39 | v = (v & ~0x000000ff) | 0x00000055; |
40 | writel(v, MCF_MBAR + MCFSIM_PBCNT); | 40 | writel(v, MCFSIM_PBCNT); |
41 | 41 | ||
42 | v = readl(MCF_MBAR + MCFSIM_PDCNT); | 42 | v = readl(MCFSIM_PDCNT); |
43 | v = (v & ~0x000003fc) | 0x000002a8; | 43 | v = (v & ~0x000003fc) | 0x000002a8; |
44 | writel(v, MCF_MBAR + MCFSIM_PDCNT); | 44 | writel(v, MCFSIM_PDCNT); |
45 | } | 45 | } |
46 | 46 | ||
47 | /***************************************************************************/ | 47 | /***************************************************************************/ |
@@ -50,9 +50,9 @@ static void m5272_cpu_reset(void) | |||
50 | { | 50 | { |
51 | local_irq_disable(); | 51 | local_irq_disable(); |
52 | /* Set watchdog to reset, and enabled */ | 52 | /* Set watchdog to reset, and enabled */ |
53 | __raw_writew(0, MCF_MBAR + MCFSIM_WIRR); | 53 | __raw_writew(0, MCFSIM_WIRR); |
54 | __raw_writew(1, MCF_MBAR + MCFSIM_WRRR); | 54 | __raw_writew(1, MCFSIM_WRRR); |
55 | __raw_writew(0, MCF_MBAR + MCFSIM_WCR); | 55 | __raw_writew(0, MCFSIM_WCR); |
56 | for (;;) | 56 | for (;;) |
57 | /* wait for watchdog to timeout */; | 57 | /* wait for watchdog to timeout */; |
58 | } | 58 | } |
@@ -62,11 +62,8 @@ static void m5272_cpu_reset(void) | |||
62 | void __init config_BSP(char *commandp, int size) | 62 | void __init config_BSP(char *commandp, int size) |
63 | { | 63 | { |
64 | #if defined (CONFIG_MOD5272) | 64 | #if defined (CONFIG_MOD5272) |
65 | volatile unsigned char *pivrp; | ||
66 | |||
67 | /* Set base of device vectors to be 64 */ | 65 | /* Set base of device vectors to be 64 */ |
68 | pivrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_PIVR); | 66 | writeb(0x40, MCFSIM_PIVR); |
69 | *pivrp = 0x40; | ||
70 | #endif | 67 | #endif |
71 | 68 | ||
72 | #if defined(CONFIG_NETtel) || defined(CONFIG_SCALES) | 69 | #if defined(CONFIG_NETtel) || defined(CONFIG_SCALES) |
diff --git a/arch/m68k/platform/coldfire/m527x.c b/arch/m68k/platform/coldfire/m527x.c index b3cb378c5e94..1431ba03c602 100644 --- a/arch/m68k/platform/coldfire/m527x.c +++ b/arch/m68k/platform/coldfire/m527x.c | |||
@@ -53,9 +53,9 @@ static void __init m527x_uarts_init(void) | |||
53 | /* | 53 | /* |
54 | * External Pin Mask Setting & Enable External Pin for Interface | 54 | * External Pin Mask Setting & Enable External Pin for Interface |
55 | */ | 55 | */ |
56 | sepmask = readw(MCF_IPSBAR + MCF_GPIO_PAR_UART); | 56 | sepmask = readw(MCFGPIO_PAR_UART); |
57 | sepmask |= UART0_ENABLE_MASK | UART1_ENABLE_MASK | UART2_ENABLE_MASK; | 57 | sepmask |= UART0_ENABLE_MASK | UART1_ENABLE_MASK | UART2_ENABLE_MASK; |
58 | writew(sepmask, MCF_IPSBAR + MCF_GPIO_PAR_UART); | 58 | writew(sepmask, MCFGPIO_PAR_UART); |
59 | } | 59 | } |
60 | 60 | ||
61 | /***************************************************************************/ | 61 | /***************************************************************************/ |
@@ -67,19 +67,19 @@ static void __init m527x_fec_init(void) | |||
67 | 67 | ||
68 | /* Set multi-function pins to ethernet mode for fec0 */ | 68 | /* Set multi-function pins to ethernet mode for fec0 */ |
69 | #if defined(CONFIG_M5271) | 69 | #if defined(CONFIG_M5271) |
70 | v = readb(MCF_IPSBAR + 0x100047); | 70 | v = readb(MCFGPIO_PAR_FECI2C); |
71 | writeb(v | 0xf0, MCF_IPSBAR + 0x100047); | 71 | writeb(v | 0xf0, MCFGPIO_PAR_FECI2C); |
72 | #else | 72 | #else |
73 | par = readw(MCF_IPSBAR + 0x100082); | 73 | par = readw(MCFGPIO_PAR_FECI2C); |
74 | writew(par | 0xf00, MCF_IPSBAR + 0x100082); | 74 | writew(par | 0xf00, MCFGPIO_PAR_FECI2C); |
75 | v = readb(MCF_IPSBAR + 0x100078); | 75 | v = readb(MCFGPIO_PAR_FEC0HL); |
76 | writeb(v | 0xc0, MCF_IPSBAR + 0x100078); | 76 | writeb(v | 0xc0, MCFGPIO_PAR_FEC0HL); |
77 | 77 | ||
78 | /* Set multi-function pins to ethernet mode for fec1 */ | 78 | /* Set multi-function pins to ethernet mode for fec1 */ |
79 | par = readw(MCF_IPSBAR + 0x100082); | 79 | par = readw(MCFGPIO_PAR_FECI2C); |
80 | writew(par | 0xa0, MCF_IPSBAR + 0x100082); | 80 | writew(par | 0xa0, MCFGPIO_PAR_FECI2C); |
81 | v = readb(MCF_IPSBAR + 0x100079); | 81 | v = readb(MCFGPIO_PAR_FEC1HL); |
82 | writeb(v | 0xc0, MCF_IPSBAR + 0x100079); | 82 | writeb(v | 0xc0, MCFGPIO_PAR_FEC1HL); |
83 | #endif | 83 | #endif |
84 | } | 84 | } |
85 | 85 | ||
diff --git a/arch/m68k/platform/coldfire/m528x.c b/arch/m68k/platform/coldfire/m528x.c index f1319e5d2546..f9f7e6a13d04 100644 --- a/arch/m68k/platform/coldfire/m528x.c +++ b/arch/m68k/platform/coldfire/m528x.c | |||
@@ -53,9 +53,9 @@ static void __init m528x_fec_init(void) | |||
53 | u16 v16; | 53 | u16 v16; |
54 | 54 | ||
55 | /* Set multi-function pins to ethernet mode for fec0 */ | 55 | /* Set multi-function pins to ethernet mode for fec0 */ |
56 | v16 = readw(MCF_IPSBAR + 0x100056); | 56 | v16 = readw(MCFGPIO_PASPAR); |
57 | writew(v16 | 0xf00, MCF_IPSBAR + 0x100056); | 57 | writew(v16 | 0xf00, MCFGPIO_PASPAR); |
58 | writeb(0xc0, MCF_IPSBAR + 0x100058); | 58 | writeb(0xc0, MCFGPIO_PEHLPAR); |
59 | } | 59 | } |
60 | 60 | ||
61 | /***************************************************************************/ | 61 | /***************************************************************************/ |
diff --git a/arch/m68k/platform/coldfire/m532x.c b/arch/m68k/platform/coldfire/m532x.c index 4819a44991ed..7951d1d43357 100644 --- a/arch/m68k/platform/coldfire/m532x.c +++ b/arch/m68k/platform/coldfire/m532x.c | |||
@@ -172,7 +172,7 @@ static void __init m532x_clk_init(void) | |||
172 | static void __init m532x_qspi_init(void) | 172 | static void __init m532x_qspi_init(void) |
173 | { | 173 | { |
174 | /* setup QSPS pins for QSPI with gpio CS control */ | 174 | /* setup QSPS pins for QSPI with gpio CS control */ |
175 | writew(0x01f0, MCF_GPIO_PAR_QSPI); | 175 | writew(0x01f0, MCFGPIO_PAR_QSPI); |
176 | } | 176 | } |
177 | 177 | ||
178 | #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ | 178 | #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ |
@@ -182,18 +182,24 @@ static void __init m532x_qspi_init(void) | |||
182 | static void __init m532x_uarts_init(void) | 182 | static void __init m532x_uarts_init(void) |
183 | { | 183 | { |
184 | /* UART GPIO initialization */ | 184 | /* UART GPIO initialization */ |
185 | MCF_GPIO_PAR_UART |= 0x0FFF; | 185 | writew(readw(MCFGPIO_PAR_UART) | 0x0FFF, MCFGPIO_PAR_UART); |
186 | } | 186 | } |
187 | 187 | ||
188 | /***************************************************************************/ | 188 | /***************************************************************************/ |
189 | 189 | ||
190 | static void __init m532x_fec_init(void) | 190 | static void __init m532x_fec_init(void) |
191 | { | 191 | { |
192 | u8 v; | ||
193 | |||
192 | /* Set multi-function pins to ethernet mode for fec0 */ | 194 | /* Set multi-function pins to ethernet mode for fec0 */ |
193 | MCF_GPIO_PAR_FECI2C |= (MCF_GPIO_PAR_FECI2C_PAR_MDC_EMDC | | 195 | v = readb(MCFGPIO_PAR_FECI2C); |
194 | MCF_GPIO_PAR_FECI2C_PAR_MDIO_EMDIO); | 196 | v |= MCF_GPIO_PAR_FECI2C_PAR_MDC_EMDC | |
195 | MCF_GPIO_PAR_FEC = (MCF_GPIO_PAR_FEC_PAR_FEC_7W_FEC | | 197 | MCF_GPIO_PAR_FECI2C_PAR_MDIO_EMDIO; |
196 | MCF_GPIO_PAR_FEC_PAR_FEC_MII_FEC); | 198 | writeb(v, MCFGPIO_PAR_FECI2C); |
199 | |||
200 | v = readb(MCFGPIO_PAR_FEC); | ||
201 | v = MCF_GPIO_PAR_FEC_PAR_FEC_7W_FEC | MCF_GPIO_PAR_FEC_PAR_FEC_MII_FEC; | ||
202 | writeb(v, MCFGPIO_PAR_FEC); | ||
197 | } | 203 | } |
198 | 204 | ||
199 | /***************************************************************************/ | 205 | /***************************************************************************/ |
@@ -298,7 +304,7 @@ asmlinkage void __init sysinit(void) | |||
298 | void wtm_init(void) | 304 | void wtm_init(void) |
299 | { | 305 | { |
300 | /* Disable watchdog timer */ | 306 | /* Disable watchdog timer */ |
301 | MCF_WTM_WCR = 0; | 307 | writew(0, MCF_WTM_WCR); |
302 | } | 308 | } |
303 | 309 | ||
304 | #define MCF_SCM_BCR_GBW (0x00000100) | 310 | #define MCF_SCM_BCR_GBW (0x00000100) |
@@ -307,53 +313,53 @@ void wtm_init(void) | |||
307 | void scm_init(void) | 313 | void scm_init(void) |
308 | { | 314 | { |
309 | /* All masters are trusted */ | 315 | /* All masters are trusted */ |
310 | MCF_SCM_MPR = 0x77777777; | 316 | writel(0x77777777, MCF_SCM_MPR); |
311 | 317 | ||
312 | /* Allow supervisor/user, read/write, and trusted/untrusted | 318 | /* Allow supervisor/user, read/write, and trusted/untrusted |
313 | access to all slaves */ | 319 | access to all slaves */ |
314 | MCF_SCM_PACRA = 0; | 320 | writel(0, MCF_SCM_PACRA); |
315 | MCF_SCM_PACRB = 0; | 321 | writel(0, MCF_SCM_PACRB); |
316 | MCF_SCM_PACRC = 0; | 322 | writel(0, MCF_SCM_PACRC); |
317 | MCF_SCM_PACRD = 0; | 323 | writel(0, MCF_SCM_PACRD); |
318 | MCF_SCM_PACRE = 0; | 324 | writel(0, MCF_SCM_PACRE); |
319 | MCF_SCM_PACRF = 0; | 325 | writel(0, MCF_SCM_PACRF); |
320 | 326 | ||
321 | /* Enable bursts */ | 327 | /* Enable bursts */ |
322 | MCF_SCM_BCR = (MCF_SCM_BCR_GBR | MCF_SCM_BCR_GBW); | 328 | writel(MCF_SCM_BCR_GBR | MCF_SCM_BCR_GBW, MCF_SCM_BCR); |
323 | } | 329 | } |
324 | 330 | ||
325 | 331 | ||
326 | void fbcs_init(void) | 332 | void fbcs_init(void) |
327 | { | 333 | { |
328 | MCF_GPIO_PAR_CS = 0x0000003E; | 334 | writeb(0x3E, MCFGPIO_PAR_CS); |
329 | 335 | ||
330 | /* Latch chip select */ | 336 | /* Latch chip select */ |
331 | MCF_FBCS1_CSAR = 0x10080000; | 337 | writel(0x10080000, MCF_FBCS1_CSAR); |
332 | 338 | ||
333 | MCF_FBCS1_CSCR = 0x002A3780; | 339 | writel(0x002A3780, MCF_FBCS1_CSCR); |
334 | MCF_FBCS1_CSMR = (MCF_FBCS_CSMR_BAM_2M | MCF_FBCS_CSMR_V); | 340 | writel(MCF_FBCS_CSMR_BAM_2M | MCF_FBCS_CSMR_V, MCF_FBCS1_CSMR); |
335 | 341 | ||
336 | /* Initialize latch to drive signals to inactive states */ | 342 | /* Initialize latch to drive signals to inactive states */ |
337 | *((u16 *)(0x10080000)) = 0xFFFF; | 343 | writew(0xffff, 0x10080000); |
338 | 344 | ||
339 | /* External SRAM */ | 345 | /* External SRAM */ |
340 | MCF_FBCS1_CSAR = EXT_SRAM_ADDRESS; | 346 | writel(EXT_SRAM_ADDRESS, MCF_FBCS1_CSAR); |
341 | MCF_FBCS1_CSCR = (MCF_FBCS_CSCR_PS_16 | 347 | writel(MCF_FBCS_CSCR_PS_16 | |
342 | | MCF_FBCS_CSCR_AA | 348 | MCF_FBCS_CSCR_AA | |
343 | | MCF_FBCS_CSCR_SBM | 349 | MCF_FBCS_CSCR_SBM | |
344 | | MCF_FBCS_CSCR_WS(1)); | 350 | MCF_FBCS_CSCR_WS(1), |
345 | MCF_FBCS1_CSMR = (MCF_FBCS_CSMR_BAM_512K | 351 | MCF_FBCS1_CSCR); |
346 | | MCF_FBCS_CSMR_V); | 352 | writel(MCF_FBCS_CSMR_BAM_512K | MCF_FBCS_CSMR_V, MCF_FBCS1_CSMR); |
347 | 353 | ||
348 | /* Boot Flash connected to FBCS0 */ | 354 | /* Boot Flash connected to FBCS0 */ |
349 | MCF_FBCS0_CSAR = FLASH_ADDRESS; | 355 | writel(FLASH_ADDRESS, MCF_FBCS0_CSAR); |
350 | MCF_FBCS0_CSCR = (MCF_FBCS_CSCR_PS_16 | 356 | writel(MCF_FBCS_CSCR_PS_16 | |
351 | | MCF_FBCS_CSCR_BEM | 357 | MCF_FBCS_CSCR_BEM | |
352 | | MCF_FBCS_CSCR_AA | 358 | MCF_FBCS_CSCR_AA | |
353 | | MCF_FBCS_CSCR_SBM | 359 | MCF_FBCS_CSCR_SBM | |
354 | | MCF_FBCS_CSCR_WS(7)); | 360 | MCF_FBCS_CSCR_WS(7), |
355 | MCF_FBCS0_CSMR = (MCF_FBCS_CSMR_BAM_32M | 361 | MCF_FBCS0_CSCR); |
356 | | MCF_FBCS_CSMR_V); | 362 | writel(MCF_FBCS_CSMR_BAM_32M | MCF_FBCS_CSMR_V, MCF_FBCS0_CSMR); |
357 | } | 363 | } |
358 | 364 | ||
359 | void sdramc_init(void) | 365 | void sdramc_init(void) |
@@ -362,102 +368,102 @@ void sdramc_init(void) | |||
362 | * Check to see if the SDRAM has already been initialized | 368 | * Check to see if the SDRAM has already been initialized |
363 | * by a run control tool | 369 | * by a run control tool |
364 | */ | 370 | */ |
365 | if (!(MCF_SDRAMC_SDCR & MCF_SDRAMC_SDCR_REF)) { | 371 | if (!(readl(MCF_SDRAMC_SDCR) & MCF_SDRAMC_SDCR_REF)) { |
366 | /* SDRAM chip select initialization */ | 372 | /* SDRAM chip select initialization */ |
367 | 373 | ||
368 | /* Initialize SDRAM chip select */ | 374 | /* Initialize SDRAM chip select */ |
369 | MCF_SDRAMC_SDCS0 = (0 | 375 | writel(MCF_SDRAMC_SDCS_BA(SDRAM_ADDRESS) | |
370 | | MCF_SDRAMC_SDCS_BA(SDRAM_ADDRESS) | 376 | MCF_SDRAMC_SDCS_CSSZ(MCF_SDRAMC_SDCS_CSSZ_32MBYTE), |
371 | | MCF_SDRAMC_SDCS_CSSZ(MCF_SDRAMC_SDCS_CSSZ_32MBYTE)); | 377 | MCF_SDRAMC_SDCS0); |
372 | 378 | ||
373 | /* | 379 | /* |
374 | * Basic configuration and initialization | 380 | * Basic configuration and initialization |
375 | */ | 381 | */ |
376 | MCF_SDRAMC_SDCFG1 = (0 | 382 | writel(MCF_SDRAMC_SDCFG1_SRD2RW((int)((SDRAM_CASL + 2) + 0.5)) | |
377 | | MCF_SDRAMC_SDCFG1_SRD2RW((int)((SDRAM_CASL + 2) + 0.5 )) | 383 | MCF_SDRAMC_SDCFG1_SWT2RD(SDRAM_TWR + 1) | |
378 | | MCF_SDRAMC_SDCFG1_SWT2RD(SDRAM_TWR + 1) | 384 | MCF_SDRAMC_SDCFG1_RDLAT((int)((SDRAM_CASL * 2) + 2)) | |
379 | | MCF_SDRAMC_SDCFG1_RDLAT((int)((SDRAM_CASL*2) + 2)) | 385 | MCF_SDRAMC_SDCFG1_ACT2RW((int)(SDRAM_TRCD + 0.5)) | |
380 | | MCF_SDRAMC_SDCFG1_ACT2RW((int)((SDRAM_TRCD ) + 0.5)) | 386 | MCF_SDRAMC_SDCFG1_PRE2ACT((int)(SDRAM_TRP + 0.5)) | |
381 | | MCF_SDRAMC_SDCFG1_PRE2ACT((int)((SDRAM_TRP ) + 0.5)) | 387 | MCF_SDRAMC_SDCFG1_REF2ACT((int)(SDRAM_TRFC + 0.5)) | |
382 | | MCF_SDRAMC_SDCFG1_REF2ACT((int)(((SDRAM_TRFC) ) + 0.5)) | 388 | MCF_SDRAMC_SDCFG1_WTLAT(3), |
383 | | MCF_SDRAMC_SDCFG1_WTLAT(3)); | 389 | MCF_SDRAMC_SDCFG1); |
384 | MCF_SDRAMC_SDCFG2 = (0 | 390 | writel(MCF_SDRAMC_SDCFG2_BRD2PRE(SDRAM_BL / 2 + 1) | |
385 | | MCF_SDRAMC_SDCFG2_BRD2PRE(SDRAM_BL/2 + 1) | 391 | MCF_SDRAMC_SDCFG2_BWT2RW(SDRAM_BL / 2 + SDRAM_TWR) | |
386 | | MCF_SDRAMC_SDCFG2_BWT2RW(SDRAM_BL/2 + SDRAM_TWR) | 392 | MCF_SDRAMC_SDCFG2_BRD2WT((int)((SDRAM_CASL + SDRAM_BL / 2 - 1.0) + 0.5)) | |
387 | | MCF_SDRAMC_SDCFG2_BRD2WT((int)((SDRAM_CASL+SDRAM_BL/2-1.0)+0.5)) | 393 | MCF_SDRAMC_SDCFG2_BL(SDRAM_BL - 1), |
388 | | MCF_SDRAMC_SDCFG2_BL(SDRAM_BL-1)); | 394 | MCF_SDRAMC_SDCFG2); |
389 | 395 | ||
390 | 396 | ||
391 | /* | 397 | /* |
392 | * Precharge and enable write to SDMR | 398 | * Precharge and enable write to SDMR |
393 | */ | 399 | */ |
394 | MCF_SDRAMC_SDCR = (0 | 400 | writel(MCF_SDRAMC_SDCR_MODE_EN | |
395 | | MCF_SDRAMC_SDCR_MODE_EN | 401 | MCF_SDRAMC_SDCR_CKE | |
396 | | MCF_SDRAMC_SDCR_CKE | 402 | MCF_SDRAMC_SDCR_DDR | |
397 | | MCF_SDRAMC_SDCR_DDR | 403 | MCF_SDRAMC_SDCR_MUX(1) | |
398 | | MCF_SDRAMC_SDCR_MUX(1) | 404 | MCF_SDRAMC_SDCR_RCNT((int)(((SDRAM_TREFI / (SYSTEM_PERIOD * 64)) - 1) + 0.5)) | |
399 | | MCF_SDRAMC_SDCR_RCNT((int)(((SDRAM_TREFI/(SYSTEM_PERIOD*64)) - 1) + 0.5)) | 405 | MCF_SDRAMC_SDCR_PS_16 | |
400 | | MCF_SDRAMC_SDCR_PS_16 | 406 | MCF_SDRAMC_SDCR_IPALL, |
401 | | MCF_SDRAMC_SDCR_IPALL); | 407 | MCF_SDRAMC_SDCR); |
402 | 408 | ||
403 | /* | 409 | /* |
404 | * Write extended mode register | 410 | * Write extended mode register |
405 | */ | 411 | */ |
406 | MCF_SDRAMC_SDMR = (0 | 412 | writel(MCF_SDRAMC_SDMR_BNKAD_LEMR | |
407 | | MCF_SDRAMC_SDMR_BNKAD_LEMR | 413 | MCF_SDRAMC_SDMR_AD(0x0) | |
408 | | MCF_SDRAMC_SDMR_AD(0x0) | 414 | MCF_SDRAMC_SDMR_CMD, |
409 | | MCF_SDRAMC_SDMR_CMD); | 415 | MCF_SDRAMC_SDMR); |
410 | 416 | ||
411 | /* | 417 | /* |
412 | * Write mode register and reset DLL | 418 | * Write mode register and reset DLL |
413 | */ | 419 | */ |
414 | MCF_SDRAMC_SDMR = (0 | 420 | writel(MCF_SDRAMC_SDMR_BNKAD_LMR | |
415 | | MCF_SDRAMC_SDMR_BNKAD_LMR | 421 | MCF_SDRAMC_SDMR_AD(0x163) | |
416 | | MCF_SDRAMC_SDMR_AD(0x163) | 422 | MCF_SDRAMC_SDMR_CMD, |
417 | | MCF_SDRAMC_SDMR_CMD); | 423 | MCF_SDRAMC_SDMR); |
418 | 424 | ||
419 | /* | 425 | /* |
420 | * Execute a PALL command | 426 | * Execute a PALL command |
421 | */ | 427 | */ |
422 | MCF_SDRAMC_SDCR |= MCF_SDRAMC_SDCR_IPALL; | 428 | writel(readl(MCF_SDRAMC_SDCR) | MCF_SDRAMC_SDCR_IPALL, MCF_SDRAMC_SDCR); |
423 | 429 | ||
424 | /* | 430 | /* |
425 | * Perform two REF cycles | 431 | * Perform two REF cycles |
426 | */ | 432 | */ |
427 | MCF_SDRAMC_SDCR |= MCF_SDRAMC_SDCR_IREF; | 433 | writel(readl(MCF_SDRAMC_SDCR) | MCF_SDRAMC_SDCR_IREF, MCF_SDRAMC_SDCR); |
428 | MCF_SDRAMC_SDCR |= MCF_SDRAMC_SDCR_IREF; | 434 | writel(readl(MCF_SDRAMC_SDCR) | MCF_SDRAMC_SDCR_IREF, MCF_SDRAMC_SDCR); |
429 | 435 | ||
430 | /* | 436 | /* |
431 | * Write mode register and clear reset DLL | 437 | * Write mode register and clear reset DLL |
432 | */ | 438 | */ |
433 | MCF_SDRAMC_SDMR = (0 | 439 | writel(MCF_SDRAMC_SDMR_BNKAD_LMR | |
434 | | MCF_SDRAMC_SDMR_BNKAD_LMR | 440 | MCF_SDRAMC_SDMR_AD(0x063) | |
435 | | MCF_SDRAMC_SDMR_AD(0x063) | 441 | MCF_SDRAMC_SDMR_CMD, |
436 | | MCF_SDRAMC_SDMR_CMD); | 442 | MCF_SDRAMC_SDMR); |
437 | 443 | ||
438 | /* | 444 | /* |
439 | * Enable auto refresh and lock SDMR | 445 | * Enable auto refresh and lock SDMR |
440 | */ | 446 | */ |
441 | MCF_SDRAMC_SDCR &= ~MCF_SDRAMC_SDCR_MODE_EN; | 447 | writel(readl(MCF_SDRAMC_SDCR) & ~MCF_SDRAMC_SDCR_MODE_EN, |
442 | MCF_SDRAMC_SDCR |= (0 | 448 | MCF_SDRAMC_SDCR); |
443 | | MCF_SDRAMC_SDCR_REF | 449 | writel(MCF_SDRAMC_SDCR_REF | MCF_SDRAMC_SDCR_DQS_OE(0xC), |
444 | | MCF_SDRAMC_SDCR_DQS_OE(0xC)); | 450 | MCF_SDRAMC_SDCR); |
445 | } | 451 | } |
446 | } | 452 | } |
447 | 453 | ||
448 | void gpio_init(void) | 454 | void gpio_init(void) |
449 | { | 455 | { |
450 | /* Enable UART0 pins */ | 456 | /* Enable UART0 pins */ |
451 | MCF_GPIO_PAR_UART = ( 0 | 457 | writew(MCF_GPIO_PAR_UART_PAR_URXD0 | MCF_GPIO_PAR_UART_PAR_UTXD0, |
452 | | MCF_GPIO_PAR_UART_PAR_URXD0 | 458 | MCFGPIO_PAR_UART); |
453 | | MCF_GPIO_PAR_UART_PAR_UTXD0); | ||
454 | |||
455 | /* Initialize TIN3 as a GPIO output to enable the write | ||
456 | half of the latch */ | ||
457 | MCF_GPIO_PAR_TIMER = 0x00; | ||
458 | __raw_writeb(0x08, MCFGPIO_PDDR_TIMER); | ||
459 | __raw_writeb(0x00, MCFGPIO_PCLRR_TIMER); | ||
460 | 459 | ||
460 | /* | ||
461 | * Initialize TIN3 as a GPIO output to enable the write | ||
462 | * half of the latch. | ||
463 | */ | ||
464 | writeb(0x00, MCFGPIO_PAR_TIMER); | ||
465 | writeb(0x08, MCFGPIO_PDDR_TIMER); | ||
466 | writeb(0x00, MCFGPIO_PCLRR_TIMER); | ||
461 | } | 467 | } |
462 | 468 | ||
463 | int clock_pll(int fsys, int flags) | 469 | int clock_pll(int fsys, int flags) |
@@ -469,7 +475,7 @@ int clock_pll(int fsys, int flags) | |||
469 | 475 | ||
470 | if (fsys == 0) { | 476 | if (fsys == 0) { |
471 | /* Return current PLL output */ | 477 | /* Return current PLL output */ |
472 | mfd = MCF_PLL_PFDR; | 478 | mfd = readb(MCF_PLL_PFDR); |
473 | 479 | ||
474 | return (fref * mfd / (BUSDIV * 4)); | 480 | return (fref * mfd / (BUSDIV * 4)); |
475 | } | 481 | } |
@@ -495,9 +501,10 @@ int clock_pll(int fsys, int flags) | |||
495 | * If it has then the SDRAM needs to be put into self refresh | 501 | * If it has then the SDRAM needs to be put into self refresh |
496 | * mode before reprogramming the PLL. | 502 | * mode before reprogramming the PLL. |
497 | */ | 503 | */ |
498 | if (MCF_SDRAMC_SDCR & MCF_SDRAMC_SDCR_REF) | 504 | if (readl(MCF_SDRAMC_SDCR) & MCF_SDRAMC_SDCR_REF) |
499 | /* Put SDRAM into self refresh mode */ | 505 | /* Put SDRAM into self refresh mode */ |
500 | MCF_SDRAMC_SDCR &= ~MCF_SDRAMC_SDCR_CKE; | 506 | writel(readl(MCF_SDRAMC_SDCR) & ~MCF_SDRAMC_SDCR_CKE, |
507 | MCF_SDRAMC_SDCR); | ||
501 | 508 | ||
502 | /* | 509 | /* |
503 | * Initialize the PLL to generate the new system clock frequency. | 510 | * Initialize the PLL to generate the new system clock frequency. |
@@ -508,11 +515,10 @@ int clock_pll(int fsys, int flags) | |||
508 | clock_limp(DEFAULT_LPD); | 515 | clock_limp(DEFAULT_LPD); |
509 | 516 | ||
510 | /* Reprogram PLL for desired fsys */ | 517 | /* Reprogram PLL for desired fsys */ |
511 | MCF_PLL_PODR = (0 | 518 | writeb(MCF_PLL_PODR_CPUDIV(BUSDIV/3) | MCF_PLL_PODR_BUSDIV(BUSDIV), |
512 | | MCF_PLL_PODR_CPUDIV(BUSDIV/3) | 519 | MCF_PLL_PODR); |
513 | | MCF_PLL_PODR_BUSDIV(BUSDIV)); | ||
514 | 520 | ||
515 | MCF_PLL_PFDR = mfd; | 521 | writeb(mfd, MCF_PLL_PFDR); |
516 | 522 | ||
517 | /* Exit LIMP mode */ | 523 | /* Exit LIMP mode */ |
518 | clock_exit_limp(); | 524 | clock_exit_limp(); |
@@ -520,12 +526,13 @@ int clock_pll(int fsys, int flags) | |||
520 | /* | 526 | /* |
521 | * Return the SDRAM to normal operation if it is in use. | 527 | * Return the SDRAM to normal operation if it is in use. |
522 | */ | 528 | */ |
523 | if (MCF_SDRAMC_SDCR & MCF_SDRAMC_SDCR_REF) | 529 | if (readl(MCF_SDRAMC_SDCR) & MCF_SDRAMC_SDCR_REF) |
524 | /* Exit self refresh mode */ | 530 | /* Exit self refresh mode */ |
525 | MCF_SDRAMC_SDCR |= MCF_SDRAMC_SDCR_CKE; | 531 | writel(readl(MCF_SDRAMC_SDCR) | MCF_SDRAMC_SDCR_CKE, |
532 | MCF_SDRAMC_SDCR); | ||
526 | 533 | ||
527 | /* Errata - workaround for SDRAM opeartion after exiting LIMP mode */ | 534 | /* Errata - workaround for SDRAM opeartion after exiting LIMP mode */ |
528 | MCF_SDRAMC_LIMP_FIX = MCF_SDRAMC_REFRESH; | 535 | writel(MCF_SDRAMC_REFRESH, MCF_SDRAMC_LIMP_FIX); |
529 | 536 | ||
530 | /* wait for DQS logic to relock */ | 537 | /* wait for DQS logic to relock */ |
531 | for (i = 0; i < 0x200; i++) | 538 | for (i = 0; i < 0x200; i++) |
@@ -546,14 +553,12 @@ int clock_limp(int div) | |||
546 | 553 | ||
547 | /* Save of the current value of the SSIDIV so we don't | 554 | /* Save of the current value of the SSIDIV so we don't |
548 | overwrite the value*/ | 555 | overwrite the value*/ |
549 | temp = (MCF_CCM_CDR & MCF_CCM_CDR_SSIDIV(0xF)); | 556 | temp = readw(MCF_CCM_CDR) & MCF_CCM_CDR_SSIDIV(0xF); |
550 | 557 | ||
551 | /* Apply the divider to the system clock */ | 558 | /* Apply the divider to the system clock */ |
552 | MCF_CCM_CDR = ( 0 | 559 | writew(MCF_CCM_CDR_LPDIV(div) | MCF_CCM_CDR_SSIDIV(temp), MCF_CCM_CDR); |
553 | | MCF_CCM_CDR_LPDIV(div) | ||
554 | | MCF_CCM_CDR_SSIDIV(temp)); | ||
555 | 560 | ||
556 | MCF_CCM_MISCCR |= MCF_CCM_MISCCR_LIMP; | 561 | writew(readw(MCF_CCM_MISCCR) | MCF_CCM_MISCCR_LIMP, MCF_CCM_MISCCR); |
557 | 562 | ||
558 | return (FREF/(3*(1 << div))); | 563 | return (FREF/(3*(1 << div))); |
559 | } | 564 | } |
@@ -563,10 +568,10 @@ int clock_exit_limp(void) | |||
563 | int fout; | 568 | int fout; |
564 | 569 | ||
565 | /* Exit LIMP mode */ | 570 | /* Exit LIMP mode */ |
566 | MCF_CCM_MISCCR = (MCF_CCM_MISCCR & ~ MCF_CCM_MISCCR_LIMP); | 571 | writew(readw(MCF_CCM_MISCCR) & ~MCF_CCM_MISCCR_LIMP, MCF_CCM_MISCCR); |
567 | 572 | ||
568 | /* Wait for PLL to lock */ | 573 | /* Wait for PLL to lock */ |
569 | while (!(MCF_CCM_MISCCR & MCF_CCM_MISCCR_PLL_LOCK)) | 574 | while (!(readw(MCF_CCM_MISCCR) & MCF_CCM_MISCCR_PLL_LOCK)) |
570 | ; | 575 | ; |
571 | 576 | ||
572 | fout = get_sys_clock(); | 577 | fout = get_sys_clock(); |
@@ -579,10 +584,10 @@ int get_sys_clock(void) | |||
579 | int divider; | 584 | int divider; |
580 | 585 | ||
581 | /* Test to see if device is in LIMP mode */ | 586 | /* Test to see if device is in LIMP mode */ |
582 | if (MCF_CCM_MISCCR & MCF_CCM_MISCCR_LIMP) { | 587 | if (readw(MCF_CCM_MISCCR) & MCF_CCM_MISCCR_LIMP) { |
583 | divider = MCF_CCM_CDR & MCF_CCM_CDR_LPDIV(0xF); | 588 | divider = readw(MCF_CCM_CDR) & MCF_CCM_CDR_LPDIV(0xF); |
584 | return (FREF/(2 << divider)); | 589 | return (FREF/(2 << divider)); |
585 | } | 590 | } |
586 | else | 591 | else |
587 | return ((FREF * MCF_PLL_PFDR) / (BUSDIV * 4)); | 592 | return (FREF * readb(MCF_PLL_PFDR)) / (BUSDIV * 4); |
588 | } | 593 | } |
diff --git a/arch/m68k/platform/coldfire/m54xx.c b/arch/m68k/platform/coldfire/m54xx.c index 2081c6cbb3de..b587bf35175b 100644 --- a/arch/m68k/platform/coldfire/m54xx.c +++ b/arch/m68k/platform/coldfire/m54xx.c | |||
@@ -30,14 +30,12 @@ | |||
30 | static void __init m54xx_uarts_init(void) | 30 | static void __init m54xx_uarts_init(void) |
31 | { | 31 | { |
32 | /* enable io pins */ | 32 | /* enable io pins */ |
33 | __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD, | 33 | __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD, MCFGPIO_PAR_PSC0); |
34 | MCF_MBAR + MCF_PAR_PSC(0)); | ||
35 | __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD | MCF_PAR_PSC_RTS_RTS, | 34 | __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD | MCF_PAR_PSC_RTS_RTS, |
36 | MCF_MBAR + MCF_PAR_PSC(1)); | 35 | MCFGPIO_PAR_PSC1); |
37 | __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD | MCF_PAR_PSC_RTS_RTS | | 36 | __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD | MCF_PAR_PSC_RTS_RTS | |
38 | MCF_PAR_PSC_CTS_CTS, MCF_MBAR + MCF_PAR_PSC(2)); | 37 | MCF_PAR_PSC_CTS_CTS, MCFGPIO_PAR_PSC2); |
39 | __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD, | 38 | __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD, MCFGPIO_PAR_PSC3); |
40 | MCF_MBAR + MCF_PAR_PSC(3)); | ||
41 | } | 39 | } |
42 | 40 | ||
43 | /***************************************************************************/ | 41 | /***************************************************************************/ |
@@ -46,10 +44,10 @@ static void mcf54xx_reset(void) | |||
46 | { | 44 | { |
47 | /* disable interrupts and enable the watchdog */ | 45 | /* disable interrupts and enable the watchdog */ |
48 | asm("movew #0x2700, %sr\n"); | 46 | asm("movew #0x2700, %sr\n"); |
49 | __raw_writel(0, MCF_MBAR + MCF_GPT_GMS0); | 47 | __raw_writel(0, MCF_GPT_GMS0); |
50 | __raw_writel(MCF_GPT_GCIR_CNT(1), MCF_MBAR + MCF_GPT_GCIR0); | 48 | __raw_writel(MCF_GPT_GCIR_CNT(1), MCF_GPT_GCIR0); |
51 | __raw_writel(MCF_GPT_GMS_WDEN | MCF_GPT_GMS_CE | MCF_GPT_GMS_TMS(4), | 49 | __raw_writel(MCF_GPT_GMS_WDEN | MCF_GPT_GMS_CE | MCF_GPT_GMS_TMS(4), |
52 | MCF_MBAR + MCF_GPT_GMS0); | 50 | MCF_GPT_GMS0); |
53 | } | 51 | } |
54 | 52 | ||
55 | /***************************************************************************/ | 53 | /***************************************************************************/ |
diff --git a/arch/m68k/platform/coldfire/nettel.c b/arch/m68k/platform/coldfire/nettel.c index e925ea4602f8..ddc48ec1b800 100644 --- a/arch/m68k/platform/coldfire/nettel.c +++ b/arch/m68k/platform/coldfire/nettel.c | |||
@@ -121,14 +121,14 @@ static void __init nettel_smc91x_setmac(unsigned int ioaddr, unsigned int flasha | |||
121 | 121 | ||
122 | static void __init nettel_smc91x_init(void) | 122 | static void __init nettel_smc91x_init(void) |
123 | { | 123 | { |
124 | writew(0x00ec, MCF_MBAR + MCFSIM_PADDR); | 124 | writew(0x00ec, MCFSIM_PADDR); |
125 | mcf_setppdata(0, 0x0080); | 125 | mcf_setppdata(0, 0x0080); |
126 | writew(1, NETTEL_SMC0_ADDR + SMC91xx_BANKSELECT); | 126 | writew(1, NETTEL_SMC0_ADDR + SMC91xx_BANKSELECT); |
127 | writew(0x0067, NETTEL_SMC0_ADDR + SMC91xx_BASEADDR); | 127 | writew(0x0067, NETTEL_SMC0_ADDR + SMC91xx_BASEADDR); |
128 | mcf_setppdata(0x0080, 0); | 128 | mcf_setppdata(0x0080, 0); |
129 | 129 | ||
130 | /* Set correct chip select timing for SMC9196 accesses */ | 130 | /* Set correct chip select timing for SMC9196 accesses */ |
131 | writew(0x1180, MCF_MBAR + MCFSIM_CSCR3); | 131 | writew(0x1180, MCFSIM_CSCR3); |
132 | 132 | ||
133 | /* Set the SMC interrupts to be auto-vectored */ | 133 | /* Set the SMC interrupts to be auto-vectored */ |
134 | mcf_autovector(NETTEL_SMC0_IRQ); | 134 | mcf_autovector(NETTEL_SMC0_IRQ); |
diff --git a/arch/m68k/platform/coldfire/pci.c b/arch/m68k/platform/coldfire/pci.c index 553210d3d4c1..8572246db84d 100644 --- a/arch/m68k/platform/coldfire/pci.c +++ b/arch/m68k/platform/coldfire/pci.c | |||
@@ -272,8 +272,8 @@ static int __init mcf_pci_init(void) | |||
272 | PACR_EXTMINTE(0x1f), PACR); | 272 | PACR_EXTMINTE(0x1f), PACR); |
273 | 273 | ||
274 | /* Set required multi-function pins for PCI bus use */ | 274 | /* Set required multi-function pins for PCI bus use */ |
275 | __raw_writew(0x3ff, MCF_PAR_PCIBG); | 275 | __raw_writew(0x3ff, MCFGPIO_PAR_PCIBG); |
276 | __raw_writew(0x3ff, MCF_PAR_PCIBR); | 276 | __raw_writew(0x3ff, MCFGPIO_PAR_PCIBR); |
277 | 277 | ||
278 | /* Set up config space for local host bus controller */ | 278 | /* Set up config space for local host bus controller */ |
279 | __raw_writel(PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | | 279 | __raw_writel(PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | |
diff --git a/arch/m68k/platform/coldfire/reset.c b/arch/m68k/platform/coldfire/reset.c index 933e54eacc69..f30952f0cbe6 100644 --- a/arch/m68k/platform/coldfire/reset.c +++ b/arch/m68k/platform/coldfire/reset.c | |||
@@ -27,7 +27,7 @@ static void mcf_cpu_reset(void) | |||
27 | { | 27 | { |
28 | local_irq_disable(); | 28 | local_irq_disable(); |
29 | /* Set watchdog to soft reset, and enabled */ | 29 | /* Set watchdog to soft reset, and enabled */ |
30 | __raw_writeb(0xc0, MCF_MBAR + MCFSIM_SYPCR); | 30 | __raw_writeb(0xc0, MCFSIM_SYPCR); |
31 | for (;;) | 31 | for (;;) |
32 | /* wait for watchdog to timeout */; | 32 | /* wait for watchdog to timeout */; |
33 | } | 33 | } |
diff --git a/arch/m68k/platform/coldfire/sltimers.c b/arch/m68k/platform/coldfire/sltimers.c index 2027fc20b876..bb5a25ada848 100644 --- a/arch/m68k/platform/coldfire/sltimers.c +++ b/arch/m68k/platform/coldfire/sltimers.c | |||
@@ -32,7 +32,7 @@ | |||
32 | /* | 32 | /* |
33 | * By default use Slice Timer 1 as the profiler clock timer. | 33 | * By default use Slice Timer 1 as the profiler clock timer. |
34 | */ | 34 | */ |
35 | #define PA(a) (MCF_MBAR + MCFSLT_TIMER1 + (a)) | 35 | #define PA(a) (MCFSLT_TIMER1 + (a)) |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * Choose a reasonably fast profile timer. Make it an odd value to | 38 | * Choose a reasonably fast profile timer. Make it an odd value to |
@@ -76,7 +76,7 @@ void mcfslt_profile_init(void) | |||
76 | /* | 76 | /* |
77 | * By default use Slice Timer 0 as the system clock timer. | 77 | * By default use Slice Timer 0 as the system clock timer. |
78 | */ | 78 | */ |
79 | #define TA(a) (MCF_MBAR + MCFSLT_TIMER0 + (a)) | 79 | #define TA(a) (MCFSLT_TIMER0 + (a)) |
80 | 80 | ||
81 | static u32 mcfslt_cycles_per_jiffy; | 81 | static u32 mcfslt_cycles_per_jiffy; |
82 | static u32 mcfslt_cnt; | 82 | static u32 mcfslt_cnt; |
diff --git a/arch/m68k/platform/coldfire/timers.c b/arch/m68k/platform/coldfire/timers.c index 0a273e75408c..51f6d2af807f 100644 --- a/arch/m68k/platform/coldfire/timers.c +++ b/arch/m68k/platform/coldfire/timers.c | |||
@@ -56,13 +56,13 @@ static void init_timer_irq(void) | |||
56 | #ifdef MCFSIM_ICR_AUTOVEC | 56 | #ifdef MCFSIM_ICR_AUTOVEC |
57 | /* Timer1 is always used as system timer */ | 57 | /* Timer1 is always used as system timer */ |
58 | writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI3, | 58 | writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI3, |
59 | MCF_MBAR + MCFSIM_TIMER1ICR); | 59 | MCFSIM_TIMER1ICR); |
60 | mcf_mapirq2imr(MCF_IRQ_TIMER, MCFINTC_TIMER1); | 60 | mcf_mapirq2imr(MCF_IRQ_TIMER, MCFINTC_TIMER1); |
61 | 61 | ||
62 | #ifdef CONFIG_HIGHPROFILE | 62 | #ifdef CONFIG_HIGHPROFILE |
63 | /* Timer2 is to be used as a high speed profile timer */ | 63 | /* Timer2 is to be used as a high speed profile timer */ |
64 | writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3, | 64 | writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3, |
65 | MCF_MBAR + MCFSIM_TIMER2ICR); | 65 | MCFSIM_TIMER2ICR); |
66 | mcf_mapirq2imr(MCF_IRQ_PROFILER, MCFINTC_TIMER2); | 66 | mcf_mapirq2imr(MCF_IRQ_PROFILER, MCFINTC_TIMER2); |
67 | #endif | 67 | #endif |
68 | #endif /* MCFSIM_ICR_AUTOVEC */ | 68 | #endif /* MCFSIM_ICR_AUTOVEC */ |