aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2011-03-05 08:50:37 -0500
committerGreg Ungerer <gerg@uclinux.org>2011-03-15 07:01:54 -0400
commit571f0608e1a53d6d405c385cc9c11b7902b35b7f (patch)
tree07642ba4284f7287bdeb5b8abaaf987ed5fb9f1b /arch
parentf317c71a2f3dcdae26055e6dd390d06c5efe5795 (diff)
m68knommu: remove MBAR and IPSBAR hacks for the ColdFire 520x CPUs
The ColdFire 5207 and 5208 CPUs have fixed peripheral addresses. They do not use the setable peripheral address registers like the MBAR and IPSBAR used on many other ColdFire parts. Don't use fake values of MBAR and IPSBAR when using peripheral addresses for them, there is no need to. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/m68k/include/asm/coldfire.h7
-rw-r--r--arch/m68k/include/asm/m520xsim.h40
-rw-r--r--arch/m68knommu/platform/520x/config.c36
-rw-r--r--arch/m68knommu/platform/coldfire/head.S4
4 files changed, 44 insertions, 43 deletions
diff --git a/arch/m68k/include/asm/coldfire.h b/arch/m68k/include/asm/coldfire.h
index 8daea2cf202e..c7dce7e55686 100644
--- a/arch/m68k/include/asm/coldfire.h
+++ b/arch/m68k/include/asm/coldfire.h
@@ -31,14 +31,9 @@
31 * This is generally setup by the boards start up code. 31 * This is generally setup by the boards start up code.
32 */ 32 */
33#define MCF_MBAR 0x10000000 33#define MCF_MBAR 0x10000000
34#if defined(CONFIG_M520x)
35#define MCF_IPSBAR 0xFC000000
36#else
37#define MCF_IPSBAR 0x40000000 34#define MCF_IPSBAR 0x40000000
38#endif
39 35
40#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ 36#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x)
41 defined(CONFIG_M520x)
42#undef MCF_MBAR 37#undef MCF_MBAR
43#define MCF_MBAR MCF_IPSBAR 38#define MCF_MBAR MCF_IPSBAR
44#endif 39#endif
diff --git a/arch/m68k/include/asm/m520xsim.h b/arch/m68k/include/asm/m520xsim.h
index afc21ad78f43..87f8ce73b318 100644
--- a/arch/m68k/include/asm/m520xsim.h
+++ b/arch/m68k/include/asm/m520xsim.h
@@ -19,7 +19,7 @@
19/* 19/*
20 * Define the 520x SIM register set addresses. 20 * Define the 520x SIM register set addresses.
21 */ 21 */
22#define MCFICM_INTC0 0x48000 /* Base for Interrupt Ctrl 0 */ 22#define MCFICM_INTC0 0xFC048000 /* Base for Interrupt Ctrl 0 */
23#define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */ 23#define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */
24#define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */ 24#define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */
25#define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */ 25#define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */
@@ -35,9 +35,9 @@
35 * address to the SIMR and CIMR registers (not offsets into IPSBAR). 35 * address to the SIMR and CIMR registers (not offsets into IPSBAR).
36 * The 520x family only has a single INTC unit. 36 * The 520x family only has a single INTC unit.
37 */ 37 */
38#define MCFINTC0_SIMR (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_SIMR) 38#define MCFINTC0_SIMR (MCFICM_INTC0 + MCFINTC_SIMR)
39#define MCFINTC0_CIMR (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_CIMR) 39#define MCFINTC0_CIMR (MCFICM_INTC0 + MCFINTC_CIMR)
40#define MCFINTC0_ICR0 (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0) 40#define MCFINTC0_ICR0 (MCFICM_INTC0 + MCFINTC_ICR0)
41#define MCFINTC1_SIMR (0) 41#define MCFINTC1_SIMR (0)
42#define MCFINTC1_CIMR (0) 42#define MCFINTC1_CIMR (0)
43#define MCFINTC1_ICR0 (0) 43#define MCFINTC1_ICR0 (0)
@@ -52,12 +52,12 @@
52/* 52/*
53 * SDRAM configuration registers. 53 * SDRAM configuration registers.
54 */ 54 */
55#define MCFSIM_SDMR 0x000a8000 /* SDRAM Mode/Extended Mode Register */ 55#define MCFSIM_SDMR 0xFC0a8000 /* SDRAM Mode/Extended Mode Register */
56#define MCFSIM_SDCR 0x000a8004 /* SDRAM Control Register */ 56#define MCFSIM_SDCR 0xFC0a8004 /* SDRAM Control Register */
57#define MCFSIM_SDCFG1 0x000a8008 /* SDRAM Configuration Register 1 */ 57#define MCFSIM_SDCFG1 0xFC0a8008 /* SDRAM Configuration Register 1 */
58#define MCFSIM_SDCFG2 0x000a800c /* SDRAM Configuration Register 2 */ 58#define MCFSIM_SDCFG2 0xFC0a800c /* SDRAM Configuration Register 2 */
59#define MCFSIM_SDCS0 0x000a8110 /* SDRAM Chip Select 0 Configuration */ 59#define MCFSIM_SDCS0 0xFC0a8110 /* SDRAM Chip Select 0 Configuration */
60#define MCFSIM_SDCS1 0x000a8114 /* SDRAM Chip Select 1 Configuration */ 60#define MCFSIM_SDCS1 0xFC0a8114 /* SDRAM Chip Select 1 Configuration */
61 61
62/* 62/*
63 * EPORT and GPIO registers. 63 * EPORT and GPIO registers.
@@ -119,10 +119,10 @@
119#define MCFGPIO_IRQ_MAX 8 119#define MCFGPIO_IRQ_MAX 8
120#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE 120#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
121 121
122#define MCF_GPIO_PAR_UART (0xA4036) 122#define MCF_GPIO_PAR_UART 0xFC0A4036
123#define MCF_GPIO_PAR_FECI2C (0xA4033) 123#define MCF_GPIO_PAR_FECI2C 0xFC0A4033
124#define MCF_GPIO_PAR_QSPI (0xA4034) 124#define MCF_GPIO_PAR_QSPI 0xFC0A4034
125#define MCF_GPIO_PAR_FEC (0xA4038) 125#define MCF_GPIO_PAR_FEC 0xFC0A4038
126 126
127#define MCF_GPIO_PAR_UART_PAR_URXD0 (0x0001) 127#define MCF_GPIO_PAR_UART_PAR_URXD0 (0x0001)
128#define MCF_GPIO_PAR_UART_PAR_UTXD0 (0x0002) 128#define MCF_GPIO_PAR_UART_PAR_UTXD0 (0x0002)
@@ -142,9 +142,15 @@
142/* 142/*
143 * UART module. 143 * UART module.
144 */ 144 */
145#define MCFUART_BASE1 0x60000 /* Base address of UART1 */ 145#define MCFUART_BASE1 0xFC060000 /* Base address of UART1 */
146#define MCFUART_BASE2 0x64000 /* Base address of UART2 */ 146#define MCFUART_BASE2 0xFC064000 /* Base address of UART2 */
147#define MCFUART_BASE3 0x68000 /* Base address of UART2 */ 147#define MCFUART_BASE3 0xFC068000 /* Base address of UART2 */
148
149/*
150 * FEC module.
151 */
152#define MCFFEC_BASE 0xFC030000 /* Base of FEC ethernet */
153#define MCFFEC_SIZE 0x800 /* Register set size */
148 154
149/* 155/*
150 * Reset Controll Unit. 156 * Reset Controll Unit.
diff --git a/arch/m68knommu/platform/520x/config.c b/arch/m68knommu/platform/520x/config.c
index 71d2ba474c63..621238f1a219 100644
--- a/arch/m68knommu/platform/520x/config.c
+++ b/arch/m68knommu/platform/520x/config.c
@@ -27,15 +27,15 @@
27 27
28static struct mcf_platform_uart m520x_uart_platform[] = { 28static struct mcf_platform_uart m520x_uart_platform[] = {
29 { 29 {
30 .mapbase = MCF_MBAR + MCFUART_BASE1, 30 .mapbase = MCFUART_BASE1,
31 .irq = MCFINT_VECBASE + MCFINT_UART0, 31 .irq = MCFINT_VECBASE + MCFINT_UART0,
32 }, 32 },
33 { 33 {
34 .mapbase = MCF_MBAR + MCFUART_BASE2, 34 .mapbase = MCFUART_BASE2,
35 .irq = MCFINT_VECBASE + MCFINT_UART1, 35 .irq = MCFINT_VECBASE + MCFINT_UART1,
36 }, 36 },
37 { 37 {
38 .mapbase = MCF_MBAR + MCFUART_BASE3, 38 .mapbase = MCFUART_BASE3,
39 .irq = MCFINT_VECBASE + MCFINT_UART2, 39 .irq = MCFINT_VECBASE + MCFINT_UART2,
40 }, 40 },
41 { }, 41 { },
@@ -49,8 +49,8 @@ static struct platform_device m520x_uart = {
49 49
50static struct resource m520x_fec_resources[] = { 50static struct resource m520x_fec_resources[] = {
51 { 51 {
52 .start = MCF_MBAR + 0x30000, 52 .start = MCFFEC_BASE,
53 .end = MCF_MBAR + 0x30000 + 0x7ff, 53 .end = MCFFEC_BASE + MCFFEC_SIZE - 1,
54 .flags = IORESOURCE_MEM, 54 .flags = IORESOURCE_MEM,
55 }, 55 },
56 { 56 {
@@ -208,11 +208,11 @@ static void __init m520x_qspi_init(void)
208{ 208{
209 u16 par; 209 u16 par;
210 /* setup Port QS for QSPI with gpio CS control */ 210 /* setup Port QS for QSPI with gpio CS control */
211 writeb(0x3f, MCF_IPSBAR + MCF_GPIO_PAR_QSPI); 211 writeb(0x3f, MCF_GPIO_PAR_QSPI);
212 /* make U1CTS and U2RTS gpio for cs_control */ 212 /* make U1CTS and U2RTS gpio for cs_control */
213 par = readw(MCF_IPSBAR + MCF_GPIO_PAR_UART); 213 par = readw(MCF_GPIO_PAR_UART);
214 par &= 0x00ff; 214 par &= 0x00ff;
215 writew(par, MCF_IPSBAR + MCF_GPIO_PAR_UART); 215 writew(par, MCF_GPIO_PAR_UART);
216} 216}
217#endif /* defined(CONFIG_SPI_COLDFIRE_QSPI) || defined(CONFIG_SPI_COLDFIRE_QSPI_MODULE) */ 217#endif /* defined(CONFIG_SPI_COLDFIRE_QSPI) || defined(CONFIG_SPI_COLDFIRE_QSPI_MODULE) */
218 218
@@ -234,23 +234,23 @@ static void __init m520x_uart_init_line(int line, int irq)
234 234
235 switch (line) { 235 switch (line) {
236 case 0: 236 case 0:
237 par = readw(MCF_IPSBAR + MCF_GPIO_PAR_UART); 237 par = readw(MCF_GPIO_PAR_UART);
238 par |= MCF_GPIO_PAR_UART_PAR_UTXD0 | 238 par |= MCF_GPIO_PAR_UART_PAR_UTXD0 |
239 MCF_GPIO_PAR_UART_PAR_URXD0; 239 MCF_GPIO_PAR_UART_PAR_URXD0;
240 writew(par, MCF_IPSBAR + MCF_GPIO_PAR_UART); 240 writew(par, MCF_GPIO_PAR_UART);
241 break; 241 break;
242 case 1: 242 case 1:
243 par = readw(MCF_IPSBAR + MCF_GPIO_PAR_UART); 243 par = readw(MCF_GPIO_PAR_UART);
244 par |= MCF_GPIO_PAR_UART_PAR_UTXD1 | 244 par |= MCF_GPIO_PAR_UART_PAR_UTXD1 |
245 MCF_GPIO_PAR_UART_PAR_URXD1; 245 MCF_GPIO_PAR_UART_PAR_URXD1;
246 writew(par, MCF_IPSBAR + MCF_GPIO_PAR_UART); 246 writew(par, MCF_GPIO_PAR_UART);
247 break; 247 break;
248 case 2: 248 case 2:
249 par2 = readb(MCF_IPSBAR + MCF_GPIO_PAR_FECI2C); 249 par2 = readb(MCF_GPIO_PAR_FECI2C);
250 par2 &= ~0x0F; 250 par2 &= ~0x0F;
251 par2 |= MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2 | 251 par2 |= MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2 |
252 MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2; 252 MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2;
253 writeb(par2, MCF_IPSBAR + MCF_GPIO_PAR_FECI2C); 253 writeb(par2, MCF_GPIO_PAR_FECI2C);
254 break; 254 break;
255 } 255 }
256} 256}
@@ -271,11 +271,11 @@ static void __init m520x_fec_init(void)
271 u8 v; 271 u8 v;
272 272
273 /* Set multi-function pins to ethernet mode */ 273 /* Set multi-function pins to ethernet mode */
274 v = readb(MCF_IPSBAR + MCF_GPIO_PAR_FEC); 274 v = readb(MCF_GPIO_PAR_FEC);
275 writeb(v | 0xf0, MCF_IPSBAR + MCF_GPIO_PAR_FEC); 275 writeb(v | 0xf0, MCF_GPIO_PAR_FEC);
276 276
277 v = readb(MCF_IPSBAR + MCF_GPIO_PAR_FECI2C); 277 v = readb(MCF_GPIO_PAR_FECI2C);
278 writeb(v | 0x0f, MCF_IPSBAR + MCF_GPIO_PAR_FECI2C); 278 writeb(v | 0x0f, MCF_GPIO_PAR_FECI2C);
279} 279}
280 280
281/***************************************************************************/ 281/***************************************************************************/
diff --git a/arch/m68knommu/platform/coldfire/head.S b/arch/m68knommu/platform/coldfire/head.S
index d5977909ae5f..7967e8ab9fae 100644
--- a/arch/m68knommu/platform/coldfire/head.S
+++ b/arch/m68knommu/platform/coldfire/head.S
@@ -68,14 +68,14 @@
68#elif defined(CONFIG_M520x) 68#elif defined(CONFIG_M520x)
69.macro GET_MEM_SIZE 69.macro GET_MEM_SIZE
70 clrl %d0 70 clrl %d0
71 movel MCF_MBAR+MCFSIM_SDCS0, %d2 /* Get SDRAM chip select 0 config */ 71 movel MCFSIM_SDCS0, %d2 /* Get SDRAM chip select 0 config */
72 andl #0x1f, %d2 /* Get only the chip select size */ 72 andl #0x1f, %d2 /* Get only the chip select size */
73 beq 3f /* Check if it is enabled */ 73 beq 3f /* Check if it is enabled */
74 addql #1, %d2 /* Form exponent */ 74 addql #1, %d2 /* Form exponent */
75 moveql #1, %d0 75 moveql #1, %d0
76 lsll %d2, %d0 /* 2 ^ exponent */ 76 lsll %d2, %d0 /* 2 ^ exponent */
773: 773:
78 movel MCF_MBAR+MCFSIM_SDCS1, %d2 /* Get SDRAM chip select 1 config */ 78 movel MCFSIM_SDCS1, %d2 /* Get SDRAM chip select 1 config */
79 andl #0x1f, %d2 /* Get only the chip select size */ 79 andl #0x1f, %d2 /* Get only the chip select size */
80 beq 4f /* Check if it is enabled */ 80 beq 4f /* Check if it is enabled */
81 addql #1, %d2 /* Form exponent */ 81 addql #1, %d2 /* Form exponent */