aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2012-09-16 22:07:21 -0400
committerGreg Ungerer <gerg@uclinux.org>2012-09-27 09:33:56 -0400
commitf821e349cf2539bc7752652ef7b60030c1fc49fb (patch)
tree31f0e529b2ab4ca65cfcc39c187d74577a835a19
parent8a415c4be5401f94d7be075682b8c0f43440329a (diff)
m68knommu: remove address offsets relative to IPSBAR for ColdFire 527x
Remove the last address definitions relative to the IPSBAR peripheral region for the ColdFire 527x family. This involved cleaning up some magic numbers used in the code part, and making them proper register definitions in the 527x specific header. This is part of the process of cleaning up the ColdFire register definitions to make them consistently use absolute addresses for the primary registers. This will reduce the occasional bugs caused by inconsistent definition of the register addresses. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
-rw-r--r--arch/m68k/include/asm/m527xsim.h52
-rw-r--r--arch/m68k/platform/coldfire/m527x.c24
2 files changed, 46 insertions, 30 deletions
diff --git a/arch/m68k/include/asm/m527xsim.h b/arch/m68k/include/asm/m527xsim.h
index 71aa5104d3d6..6335e4298dc8 100644
--- a/arch/m68k/include/asm/m527xsim.h
+++ b/arch/m68k/include/asm/m527xsim.h
@@ -194,9 +194,23 @@
194#define MCFGPIO_IRQ_MAX 8 194#define MCFGPIO_IRQ_MAX 8
195#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE 195#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
196 196
197/*
198 * Port Pin Assignment registers.
199 */
200#define MCFGPIO_PAR_AD (MCF_IPSBAR + 0x100040)
201#define MCFGPIO_PAR_BUSCTL (MCF_IPSBAR + 0x100042)
202#define MCFGPIO_PAR_BS (MCF_IPSBAR + 0x100044)
203#define MCFGPIO_PAR_CS (MCF_IPSBAR + 0x100045)
204#define MCFGPIO_PAR_SDRAM (MCF_IPSBAR + 0x100046)
205#define MCFGPIO_PAR_FECI2C (MCF_IPSBAR + 0x100047)
206#define MCFGPIO_PAR_UART (MCF_IPSBAR + 0x100048)
197#define MCFGPIO_PAR_QSPI (MCF_IPSBAR + 0x10004A) 207#define MCFGPIO_PAR_QSPI (MCF_IPSBAR + 0x10004A)
198#define MCFGPIO_PAR_TIMER (MCF_IPSBAR + 0x10004C) 208#define MCFGPIO_PAR_TIMER (MCF_IPSBAR + 0x10004C)
199#endif 209
210#define UART0_ENABLE_MASK 0x000f
211#define UART1_ENABLE_MASK 0x0ff0
212#define UART2_ENABLE_MASK 0x3000
213#endif /* CONFIG_M5271 */
200 214
201#ifdef CONFIG_M5275 215#ifdef CONFIG_M5275
202#define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100004) 216#define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100004)
@@ -289,8 +303,26 @@
289#define MCFGPIO_IRQ_MAX 8 303#define MCFGPIO_IRQ_MAX 8
290#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE 304#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
291 305
306/*
307 * Port Pin Assignment registers.
308 */
309#define MCFGPIO_PAR_AD (MCF_IPSBAR + 0x100070)
310#define MCFGPIO_PAR_CS (MCF_IPSBAR + 0x100071)
311#define MCFGPIO_PAR_BUSCTL (MCF_IPSBAR + 0x100072)
312#define MCFGPIO_PAR_USB (MCF_IPSBAR + 0x100076)
313#define MCFGPIO_PAR_FEC0HL (MCF_IPSBAR + 0x100078)
314#define MCFGPIO_PAR_FEC1HL (MCF_IPSBAR + 0x100079)
315#define MCFGPIO_PAR_TIMER (MCF_IPSBAR + 0x10007A)
316#define MCFGPIO_PAR_UART (MCF_IPSBAR + 0x10007C)
292#define MCFGPIO_PAR_QSPI (MCF_IPSBAR + 0x10007E) 317#define MCFGPIO_PAR_QSPI (MCF_IPSBAR + 0x10007E)
293#endif 318#define MCFGPIO_PAR_SDRAM (MCF_IPSBAR + 0x100080)
319#define MCFGPIO_PAR_FECI2C (MCF_IPSBAR + 0x100082)
320#define MCFGPIO_PAR_BS (MCF_IPSBAR + 0x100084)
321
322#define UART0_ENABLE_MASK 0x000f
323#define UART1_ENABLE_MASK 0x00f0
324#define UART2_ENABLE_MASK 0x3f00
325#endif /* CONFIG_M5275 */
294 326
295/* 327/*
296 * PIT timer base addresses. 328 * PIT timer base addresses.
@@ -311,22 +343,6 @@
311#define MCFEPORT_EPFR (MCF_IPSBAR + 0x130006) 343#define MCFEPORT_EPFR (MCF_IPSBAR + 0x130006)
312 344
313/* 345/*
314 * GPIO pins setups to enable the UARTs.
315 */
316#ifdef CONFIG_M5271
317#define MCF_GPIO_PAR_UART 0x100048 /* PAR UART address */
318#define UART0_ENABLE_MASK 0x000f
319#define UART1_ENABLE_MASK 0x0ff0
320#define UART2_ENABLE_MASK 0x3000
321#endif
322#ifdef CONFIG_M5275
323#define MCF_GPIO_PAR_UART 0x10007c /* PAR UART address */
324#define UART0_ENABLE_MASK 0x000f
325#define UART1_ENABLE_MASK 0x00f0
326#define UART2_ENABLE_MASK 0x3f00
327#endif
328
329/*
330 * Reset Control Unit (relative to IPSBAR). 346 * Reset Control Unit (relative to IPSBAR).
331 */ 347 */
332#define MCF_RCR (MCF_IPSBAR + 0x110000) 348#define MCF_RCR (MCF_IPSBAR + 0x110000)
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