m68knommu: clean up and merge common ColdFire UART code
cover m68knommu: clean up and merge common ColdFire UART code
The code to init and platform setup the ColdFire UART devices is duplicated throughout the CPU specific config.c files. It is all common, these are the same UARTs, just with different base addresses and IRQ numbers used.
Cleanup and merge the common UART code. Ends up saving quite a few hundred lines of code.
arch/m68k/platform/5206/config.c | 78 +++------------------------------ arch/m68k/platform/520x/config.c | 65 +++++---------------------- arch/m68k/platform/523x/config.c | 23 --------- arch/m68k/platform/5249/config.c | 63 +++----------------------- arch/m68k/platform/5272/config.c | 46 +++---------------- arch/m68k/platform/527x/config.c | 44 ------------------ arch/m68k/platform/528x/config.c | 45 +------------------ arch/m68k/platform/5307/config.c | 78 +++------------------------------ arch/m68k/platform/532x/config.c | 42 +---------------- arch/m68k/platform/5407/config.c | 78 +++------------------------------ arch/m68k/platform/54xx/config.c | 76 +++----------------------------- arch/m68k/platform/coldfire/device.c | 20 ++++++++ b/arch/m68k/include/asm/m5206sim.h | 10 ++-- b/arch/m68k/include/asm/m520xsim.h | 10 ++-- b/arch/m68k/include/asm/m523xsim.h | 12 +++-- b/arch/m68k/include/asm/m5249sim.h | 7 ++ b/arch/m68k/include/asm/m5272sim.h | 8 +-- b/arch/m68k/include/asm/m527xsim.h | 10 ++-- b/arch/m68k/include/asm/m528xsim.h | 12 +++-- b/arch/m68k/include/asm/m5307sim.h | 10 ++-- b/arch/m68k/include/asm/m532xsim.h | 10 ++-- b/arch/m68k/include/asm/m5407sim.h | 6 +- b/arch/m68k/include/asm/m54xxsim.h | 16 ++++-- b/arch/m68k/include/asm/mcfuart.h | 5 +- b/arch/m68k/platform/5206/config.c | 12 ++--- b/arch/m68k/platform/520x/config.c | 12 ++--- b/arch/m68k/platform/523x/config.c | 12 ++--- b/arch/m68k/platform/5249/config.c | 12 ++--- b/arch/m68k/platform/5272/config.c | 8 +-- b/arch/m68k/platform/527x/config.c | 12 ++--- b/arch/m68k/platform/528x/config.c | 12 ++--- b/arch/m68k/platform/5307/config.c | 12 ++--- b/arch/m68k/platform/532x/config.c | 12 ++--- b/arch/m68k/platform/5407/config.c | 12 ++--- b/arch/m68k/platform/54xx/config.c | 16 +++--- b/arch/m68k/platform/coldfire/Makefile | 2 b/arch/m68k/platform/coldfire/device.c | 60 +++++++++++++++++++++++++ 37 files changed, 299 insertions(+), 669 deletions(-)
PATCH 1/23 m68knommu: make 5206 UART platform addressing consistent
From: Greg Ungerer <[email protected]>
If we make all UART addressing consistent across all ColdFire family members then we will be able to remove the duplicated plaform data and use a single setup for all.
So modify the ColdFire 5206 UART addressing so that:
. UARTs are numbered from 0 up
. base addresses are absolute (not relative to MBAR peripheral register) . use a common name for IRQs used
--- arch/m68k/include/asm/m5206sim.h | 10 ++++++---- arch/m68k/platform/5206/config.c | 12 ++++++------ 2 files changed, 12 insertions(+), 10 deletions(-)
arch/m68k/include/asm/m5206sim.h +6 -4
@@ -100,11 +100,11 @@#define MCFDMA_BASE1 (MCF_MBAR + 0x240)/* Base address DMA 1 */ #if defined(CONFIG_NETtel) -#define MCFUART_BASE1 0x180/* Base address of UART1 */ -#define MCFUART_BASE2 0x140/* Base address of UART2 */ +#define MCFUART_BASE0 (MCF_MBAR + 0x180)/* Base address UART0 */ +#define MCFUART_BASE1 (MCF_MBAR + 0x140)/* Base address UART1 */ #else -#define MCFUART_BASE1 0x140/* Base address of UART1 */ -#define MCFUART_BASE2 0x180/* Base address of UART2 */ +#define MCFUART_BASE0 (MCF_MBAR + 0x140)/* Base address UART0 */ +#define MCFUART_BASE1 (MCF_MBAR + 0x180)/* Base address UART1 */ #endif /*
@@ -112,6 +112,8 @@*/ #define MCF_IRQ_TIMER 30/* Timer0, Level 6 */ #define MCF_IRQ_PROFILER 31/* Timer1, Level 7 */ +#define MCF_IRQ_UART0 73/* UART0 */ +#define MCF_IRQ_UART1 74/* UART1 */ /* * Generic GPIO
arch/m68k/platform/5206/config.c +6 -6
@@ -22,12 +22,12 @@static struct mcf_platform_uart m5206_uart_platform[] = { { - .mapbase =MCF_MBAR +MCFUART_BASE1 , - .irq =73 , + .mapbase =MCFUART_BASE0 , + .irq =MCF_IRQ_UART0 , }, { - .mapbase =MCF_MBAR +MCFUART_BASE2 , - .irq =74 , + .mapbase =MCFUART_BASE1 , + .irq =MCF_IRQ_UART1 , }, { }, };
@@ -48,11 +48,11 @@ static void __init m5206_uart_init_line(int line, int irq) {if (line ==0 ) {writel (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); -writeb (irq,MCFUART_BASE1 +MCFUART_UIVR ); +writeb (irq,MCFUART_BASE0 +MCFUART_UIVR );mcf_mapirq2imr (irq,MCFINTC_UART0 ); }else if (line ==1 ) {writel (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); -writeb (irq,MCFUART_BASE2 +MCFUART_UIVR ); +writeb (irq,MCFUART_BASE1 +MCFUART_UIVR );mcf_mapirq2imr (irq,MCFINTC_UART1 ); } }
Signature · 1 line
1.7.0.4
PATCH 2/23 m68knommu: make 520x UART platform addressing consistent
In reply to [email protected]From: Greg Ungerer <[email protected]>
If we make all UART addressing consistent across all ColdFire family members then we will be able to remove the duplicated plaform data and use a single setup for all.
So modify the ColdFire 520x UART addressing so that:
. UARTs are numbered from 0 up
. use a common name for IRQs used
--- arch/m68k/include/asm/m520xsim.h | 10 +++++++--- arch/m68k/platform/520x/config.c | 12 ++++++------ 2 files changed, 13 insertions(+), 9 deletions(-)
arch/m68k/include/asm/m520xsim.h +7 -3
@@ -50,6 +50,10 @@#define MCFINT_QSPI 31/* Interrupt number for QSPI */ #define MCFINT_PIT1 4/* Interrupt number for PIT1 (PIT0 in processor) */ +#define MCF_IRQ_UART0 (MCFINT_VECBASE + MCFINT_UART0) +#define MCF_IRQ_UART1 (MCFINT_VECBASE + MCFINT_UART1) +#define MCF_IRQ_UART2 (MCFINT_VECBASE + MCFINT_UART2) +/* * SDRAM configuration registers. */
@@ -144,9 +148,9 @@/* * UART module. */ -#define MCFUART_BASE1 0xFC060000/* Base address of UART1 */ -#define MCFUART_BASE2 0xFC064000/* Base address of UART2 */ -#define MCFUART_BASE3 0xFC068000/* Base address of UART2 */ +#define MCFUART_BASE0 0xFC060000/* Base address of UART0 */ +#define MCFUART_BASE1 0xFC064000/* Base address of UART1 */ +#define MCFUART_BASE2 0xFC068000/* Base address of UART2 */ /* * FEC module.
arch/m68k/platform/520x/config.c +6 -6
@@ -27,16 +27,16 @@static struct mcf_platform_uart m520x_uart_platform[] = { { - .mapbase =MCFUART_BASE1 , - .irq =MCFINT_VECBASE +MCFINT_UART0 , + .mapbase =MCFUART_BASE0 , + .irq =MCF_IRQ_UART0 , }, { - .mapbase =MCFUART_BASE2 , - .irq =MCFINT_VECBASE +MCFINT_UART1 , + .mapbase =MCFUART_BASE1 , + .irq =MCF_IRQ_UART1 , }, { - .mapbase =MCFUART_BASE3 , - .irq =MCFINT_VECBASE +MCFINT_UART2 , + .mapbase =MCFUART_BASE2 , + .irq =MCF_IRQ_UART2 , }, { }, };
Signature · 1 line
1.7.0.4
PATCH 3/23 m68knommu: make 523x UART platform addressing consistent
In reply to [email protected]From: Greg Ungerer <[email protected]>
If we make all UART addressing consistent across all ColdFire family members then we will be able to remove the duplicated plaform data and use a single setup for all.
So modify the ColdFire 523x UART addressing so that:
. UARTs are numbered from 0 up
. use a common name for IRQs used
--- arch/m68k/include/asm/m523xsim.h | 12 +++++++++--- arch/m68k/platform/523x/config.c | 12 ++++++------ 2 files changed, 15 insertions(+), 9 deletions(-)
arch/m68k/include/asm/m523xsim.h +9 -3
@@ -35,9 +35,15 @@#define MCFINT_VECBASE 64/* Vector base number */ #define MCFINT_UART0 13/* Interrupt number for UART0 */ +#define MCFINT_UART1 14/* Interrupt number for UART1 */ +#define MCFINT_UART2 15/* Interrupt number for UART2 */ #define MCFINT_PIT1 36/* Interrupt number for PIT1 */ #define MCFINT_QSPI 18/* Interrupt number for QSPI */ +#define MCF_IRQ_UART0 (MCFINT_VECBASE + MCFINT_UART0) +#define MCF_IRQ_UART1 (MCFINT_VECBASE + MCFINT_UART1) +#define MCF_IRQ_UART2 (MCFINT_VECBASE + MCFINT_UART2) +/* * SDRAM configuration registers. */
@@ -59,9 +65,9 @@/* * UART module. */ -#define MCFUART_BASE1 (MCF_IPSBAR + 0x200) -#define MCFUART_BASE2 (MCF_IPSBAR + 0x240) -#define MCFUART_BASE3 (MCF_IPSBAR + 0x280) +#define MCFUART_BASE0 (MCF_IPSBAR + 0x200) +#define MCFUART_BASE1 (MCF_IPSBAR + 0x240) +#define MCFUART_BASE2 (MCF_IPSBAR + 0x280)/* * FEC ethernet module.
arch/m68k/platform/523x/config.c +6 -6
@@ -28,16 +28,16 @@static struct mcf_platform_uart m523x_uart_platform[] = { { - .mapbase =MCFUART_BASE1 , - .irq =MCFINT_VECBASE +MCFINT_UART0 , + .mapbase =MCFUART_BASE0 , + .irq =MCF_IRQ_UART0 , }, { - .mapbase =MCFUART_BASE2 , - .irq =MCFINT_VECBASE +MCFINT_UART0 +1 , + .mapbase =MCFUART_BASE1 , + .irq =MCF_IRQ_UART1 , }, { - .mapbase =MCFUART_BASE3 , - .irq =MCFINT_VECBASE +MCFINT_UART0 +2 , + .mapbase =MCFUART_BASE2 , + .irq =MCF_IRQ_UART2 , }, { }, };
Signature · 1 line
1.7.0.4
PATCH 4/23 m68knommu: make 5249 UART platform addressing consistent
In reply to [email protected]From: Greg Ungerer <[email protected]>
If we make all UART addressing consistent across all ColdFire family members then we will be able to remove the duplicated plaform data and use a single setup for all.
So modify the ColdFire 5249 UART addressing so that:
. UARTs are numbered from 0 up
. base addresses are absolute (not relative to MBAR peripheral register) . use a common name for IRQs used
--- arch/m68k/include/asm/m5249sim.h | 7 +++++-- arch/m68k/platform/5249/config.c | 12 ++++++------ 2 files changed, 11 insertions(+), 8 deletions(-)
arch/m68k/include/asm/m5249sim.h +5 -2
@@ -76,8 +76,8 @@/* * UART module. */ -#define MCFUART_BASE1 0x1c0/* Base address of UART1 */ -#define MCFUART_BASE2 0x200/* Base address of UART2 */ +#define MCFUART_BASE0 (MCF_MBAR + 0x1c0)/* Base address UART0 */ +#define MCFUART_BASE1 (MCF_MBAR + 0x200)/* Base address UART1 */ /* * DMA unit base addresses.
@@ -108,6 +108,9 @@#define MCF_IRQ_TIMER 30/* Timer0, Level 6 */ #define MCF_IRQ_PROFILER 31/* Timer1, Level 7 */ +#define MCF_IRQ_UART0 73/* UART0 */ +#define MCF_IRQ_UART1 74/* UART1 */ +/* * General purpose IO registers (in MBAR2). */
arch/m68k/platform/5249/config.c +6 -6
@@ -24,12 +24,12 @@static struct mcf_platform_uart m5249_uart_platform[] = { { - .mapbase =MCF_MBAR +MCFUART_BASE1 , - .irq =73 , + .mapbase =MCFUART_BASE0 , + .irq =MCF_IRQ_UART0 , }, { - .mapbase =MCF_MBAR +MCFUART_BASE2 , - .irq =74 , + .mapbase =MCFUART_BASE1 , + .irq =MCF_IRQ_UART1 , }, { }, };
@@ -238,11 +238,11 @@ static void __init m5249_uart_init_line(int line, int irq) {if (line ==0 ) {writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); -writeb (irq,MCF_MBAR +MCFUART_BASE1 +MCFUART_UIVR ); +writeb (irq,MCFUART_BASE0 +MCFUART_UIVR );mcf_mapirq2imr (irq,MCFINTC_UART0 ); }else if (line ==1 ) {writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); -writeb (irq,MCF_MBAR +MCFUART_BASE2 +MCFUART_UIVR ); +writeb (irq,MCFUART_BASE1 +MCFUART_UIVR );mcf_mapirq2imr (irq,MCFINTC_UART1 ); } }
Signature · 1 line
1.7.0.4
PATCH 5/23 m68knommu: make 5272 UART platform addressing consistent
In reply to [email protected]From: Greg Ungerer <[email protected]>
If we make all UART addressing consistent across all ColdFire family members then we will be able to remove the duplicated plaform data and use a single setup for all.
So modify the ColdFire 5272 UART addressing so that:
. UARTs are numbered from 0 up
. base addresses are absolute (not relative to MBAR peripheral register)
--- arch/m68k/include/asm/m5272sim.h | 8 ++++---- arch/m68k/platform/5272/config.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
arch/m68k/include/asm/m5272sim.h +4 -4
@@ -68,8 +68,8 @@#define MCFSIM_DCMR1 0x5c/* DRAM 1 Mask reg (r/w) */ #define MCFSIM_DCCR1 0x63/* DRAM 1 Control reg (r/w) */ -#define MCFUART_BASE1 0x100/* Base address of UART1 */ -#define MCFUART_BASE2 0x140/* Base address of UART2 */ +#define MCFUART_BASE0 (MCF_MBAR + 0x100)/* Base address UART0 */ +#define MCFUART_BASE1 (MCF_MBAR + 0x140)/* Base address UART1 */ #define MCFSIM_PACNT (MCF_MBAR + 0x80)/* Port A Control (r/w) */ #define MCFSIM_PADDR (MCF_MBAR + 0x84)/* Port A Direction (r/w) */
@@ -101,8 +101,8 @@#define MCF_IRQ_TIMER2 70/* Timer 2 */ #define MCF_IRQ_TIMER3 71/* Timer 3 */ #define MCF_IRQ_TIMER4 72/* Timer 4 */ -#define MCF_IRQ_UART1 73/* UART 1 */ -#define MCF_IRQ_UART2 74/* UART 2 */ +#define MCF_IRQ_UART0 73/* UART 0 */ +#define MCF_IRQ_UART1 74/* UART 1 */ #define MCF_IRQ_PLIP 75/* PLIC 2Khz Periodic */ #define MCF_IRQ_PLIA 76/* PLIC Asynchronous */ #define MCF_IRQ_USB0 77/* USB Endpoint 0 */
arch/m68k/platform/5272/config.c +4 -4
@@ -32,12 +32,12 @@ unsigned char ledbank = 0xff;static struct mcf_platform_uart m5272_uart_platform[] = { { - .mapbase =MCF_MBAR +MCFUART_BASE1 , - .irq =MCF_IRQ_UART1 , + .mapbase =MCFUART_BASE0 , + .irq =MCF_IRQ_UART0 , }, { - .mapbase =MCF_MBAR +MCFUART_BASE2 , - .irq =MCF_IRQ_UART2 , + .mapbase =MCFUART_BASE1 , + .irq =MCF_IRQ_UART1 , }, { }, };
Signature · 1 line
1.7.0.4
PATCH 6/23 m68knommu: make 527x UART platform addressing consistent
In reply to [email protected]From: Greg Ungerer <[email protected]>
If we make all UART addressing consistent across all ColdFire family members then we will be able to remove the duplicated plaform data and use a single setup for all.
So modify the ColdFire 527x UART addressing so that:
. UARTs are numbered from 0 up
. use a common name for IRQs used
--- arch/m68k/include/asm/m527xsim.h | 10 +++++++--- arch/m68k/platform/527x/config.c | 12 ++++++------ 2 files changed, 13 insertions(+), 9 deletions(-)
arch/m68k/include/asm/m527xsim.h +7 -3
@@ -40,6 +40,10 @@#define MCFINT_QSPI 18/* Interrupt number for QSPI */ #define MCFINT_PIT1 36/* Interrupt number for PIT1 */ +#define MCF_IRQ_UART0 (MCFINT_VECBASE + MCFINT_UART0) +#define MCF_IRQ_UART1 (MCFINT_VECBASE + MCFINT_UART1) +#define MCF_IRQ_UART2 (MCFINT_VECBASE + MCFINT_UART2) +/* * SDRAM configuration registers. */
@@ -72,9 +76,9 @@/* * UART module. */ -#define MCFUART_BASE1 (MCF_IPSBAR + 0x200) -#define MCFUART_BASE2 (MCF_IPSBAR + 0x240) -#define MCFUART_BASE3 (MCF_IPSBAR + 0x280) +#define MCFUART_BASE0 (MCF_IPSBAR + 0x200) +#define MCFUART_BASE1 (MCF_IPSBAR + 0x240) +#define MCFUART_BASE2 (MCF_IPSBAR + 0x280)/* * FEC ethernet module.
arch/m68k/platform/527x/config.c +6 -6
@@ -28,16 +28,16 @@static struct mcf_platform_uart m527x_uart_platform[] = { { - .mapbase =MCFUART_BASE1 , - .irq =MCFINT_VECBASE +MCFINT_UART0 , + .mapbase =MCFUART_BASE0 , + .irq =MCF_IRQ_UART0 , }, { - .mapbase =MCFUART_BASE2 , - .irq =MCFINT_VECBASE +MCFINT_UART1 , + .mapbase =MCFUART_BASE1 , + .irq =MCF_IRQ_UART1 , }, { - .mapbase =MCFUART_BASE3 , - .irq =MCFINT_VECBASE +MCFINT_UART2 , + .mapbase =MCFUART_BASE2 , + .irq =MCF_IRQ_UART2 , }, { }, };
Signature · 1 line
1.7.0.4
PATCH 7/23 m68knommu: make 5307 UART platform addressing consistent
In reply to [email protected]From: Greg Ungerer <[email protected]>
If we make all UART addressing consistent across all ColdFire family members then we will be able to remove the duplicated plaform data and use a single setup for all.
So modify the ColdFire 5307 UART addressing so that:
. UARTs are numbered from 0 up
. base addresses are absolute (not relative to MBAR peripheral register) . use a common name for IRQs used
--- arch/m68k/include/asm/m5307sim.h | 10 ++++++---- arch/m68k/platform/5307/config.c | 12 ++++++------ 2 files changed, 12 insertions(+), 10 deletions(-)
arch/m68k/include/asm/m5307sim.h +6 -4
@@ -117,11 +117,11 @@* UART module. */ #if defined(CONFIG_NETtel) || defined(CONFIG_SECUREEDGEMP3 ) -#define MCFUART_BASE1 0x200/* Base address of UART1 */ -#define MCFUART_BASE2 0x1c0/* Base address of UART2 */ +#define MCFUART_BASE0 (MCF_MBAR + 0x200)/* Base address UART0 */ +#define MCFUART_BASE1 (MCF_MBAR + 0x1c0)/* Base address UART1 */ #else -#define MCFUART_BASE1 0x1c0/* Base address of UART1 */ -#define MCFUART_BASE2 0x200/* Base address of UART2 */ +#define MCFUART_BASE0 (MCF_MBAR + 0x1c0)/* Base address UART0 */ +#define MCFUART_BASE1 (MCF_MBAR + 0x200)/* Base address UART1 */ #endif /*
@@ -176,6 +176,8 @@*/ #define MCF_IRQ_TIMER 30/* Timer0, Level 6 */ #define MCF_IRQ_PROFILER 31/* Timer1, Level 7 */ +#define MCF_IRQ_UART0 73/* UART0 */ +#define MCF_IRQ_UART1 74/* UART1 */ /****************************************************************************/ #endif /* m5307sim_h */
arch/m68k/platform/5307/config.c +6 -6
@@ -31,12 +31,12 @@ unsigned char ledbank = 0xff;static struct mcf_platform_uart m5307_uart_platform[] = { { - .mapbase =MCF_MBAR +MCFUART_BASE1 , - .irq =73 , + .mapbase =MCFUART_BASE0 , + .irq =MCF_IRQ_UART0 , }, { - .mapbase =MCF_MBAR +MCFUART_BASE2 , - .irq =74 , + .mapbase =MCFUART_BASE1 , + .irq =MCF_IRQ_UART1 , }, { }, };
@@ -57,11 +57,11 @@ static void __init m5307_uart_init_line(int line, int irq) {if (line ==0 ) {writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); -writeb (irq,MCF_MBAR +MCFUART_BASE1 +MCFUART_UIVR ); +writeb (irq,MCFUART_BASE0 +MCFUART_UIVR );mcf_mapirq2imr (irq,MCFINTC_UART0 ); }else if (line ==1 ) {writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); -writeb (irq,MCF_MBAR +MCFUART_BASE2 +MCFUART_UIVR ); +writeb (irq,MCFUART_BASE1 +MCFUART_UIVR );mcf_mapirq2imr (irq,MCFINTC_UART1 ); } }
Signature · 1 line
1.7.0.4
PATCH 8/23 m68knommu: make 528x UART platform addressing consistent
In reply to [email protected]From: Greg Ungerer <[email protected]>
If we make all UART addressing consistent across all ColdFire family members then we will be able to remove the duplicated plaform data and use a single setup for all.
So modify the ColdFire 528x UART addressing so that:
. UARTs are numbered from 0 up
. use a common name for IRQs used
--- arch/m68k/include/asm/m528xsim.h | 12 +++++++++--- arch/m68k/platform/528x/config.c | 12 ++++++------ 2 files changed, 15 insertions(+), 9 deletions(-)
arch/m68k/include/asm/m528xsim.h +9 -3
@@ -35,9 +35,15 @@#define MCFINT_VECBASE 64/* Vector base number */ #define MCFINT_UART0 13/* Interrupt number for UART0 */ +#define MCFINT_UART1 14/* Interrupt number for UART1 */ +#define MCFINT_UART2 15/* Interrupt number for UART2 */ #define MCFINT_QSPI 18/* Interrupt number for QSPI */ #define MCFINT_PIT1 55/* Interrupt number for PIT1 */ +#define MCF_IRQ_UART0 (MCFINT_VECBASE + MCFINT_UART0) +#define MCF_IRQ_UART1 (MCFINT_VECBASE + MCFINT_UART1) +#define MCF_IRQ_UART2 (MCFINT_VECBASE + MCFINT_UART2) +/* * SDRAM configuration registers. */
@@ -58,9 +64,9 @@/* * UART module. */ -#define MCFUART_BASE1 (MCF_IPSBAR + 0x00000200) -#define MCFUART_BASE2 (MCF_IPSBAR + 0x00000240) -#define MCFUART_BASE3 (MCF_IPSBAR + 0x00000280) +#define MCFUART_BASE0 (MCF_IPSBAR + 0x00000200) +#define MCFUART_BASE1 (MCF_IPSBAR + 0x00000240) +#define MCFUART_BASE2 (MCF_IPSBAR + 0x00000280)/* * FEC ethernet module.
arch/m68k/platform/528x/config.c +6 -6
@@ -29,16 +29,16 @@static struct mcf_platform_uart m528x_uart_platform[] = { { - .mapbase =MCFUART_BASE1 , - .irq =MCFINT_VECBASE +MCFINT_UART0 , + .mapbase =MCFUART_BASE0 , + .irq =MCF_IRQ_UART0 , }, { - .mapbase =MCFUART_BASE2 , - .irq =MCFINT_VECBASE +MCFINT_UART0 +1 , + .mapbase =MCFUART_BASE1 , + .irq =MCF_IRQ_UART1 , }, { - .mapbase =MCFUART_BASE3 , - .irq =MCFINT_VECBASE +MCFINT_UART0 +2 , + .mapbase =MCFUART_BASE2 , + .irq =MCF_IRQ_UART2 , }, { }, };
Signature · 1 line
1.7.0.4
PATCH 9/23 m68knommu: make 532x UART platform addressing consistent
In reply to [email protected]From: Greg Ungerer <[email protected]>
If we make all UART addressing consistent across all ColdFire family members then we will be able to remove the duplicated plaform data and use a single setup for all.
So modify the ColdFire 532x UART addressing so that:
. UARTs are numbered from 0 up
. use a common name for IRQs used
--- arch/m68k/include/asm/m532xsim.h | 10 +++++++--- arch/m68k/platform/532x/config.c | 12 ++++++------ 2 files changed, 13 insertions(+), 9 deletions(-)
arch/m68k/include/asm/m532xsim.h +7 -3
@@ -25,6 +25,10 @@#define MCFINT_UART2 28/* Interrupt number for UART2 */ #define MCFINT_QSPI 31/* Interrupt number for QSPI */ +#define MCF_IRQ_UART0 (MCFINT_VECBASE + MCFINT_UART0) +#define MCF_IRQ_UART1 (MCFINT_VECBASE + MCFINT_UART1) +#define MCF_IRQ_UART2 (MCFINT_VECBASE + MCFINT_UART2) +#define MCF_WTM_WCR MCF_REG16(0xFC098000)/*
@@ -82,9 +86,9 @@/* * UART module. */ -#define MCFUART_BASE1 0xFC060000/* Base address of UART1 */ -#define MCFUART_BASE2 0xFC064000/* Base address of UART2 */ -#define MCFUART_BASE3 0xFC068000/* Base address of UART3 */ +#define MCFUART_BASE0 0xFC060000/* Base address of UART1 */ +#define MCFUART_BASE1 0xFC064000/* Base address of UART2 */ +#define MCFUART_BASE2 0xFC068000/* Base address of UART3 */ /* * Timer module.
arch/m68k/platform/532x/config.c +6 -6
@@ -35,16 +35,16 @@static struct mcf_platform_uart m532x_uart_platform[] = { { - .mapbase =MCFUART_BASE1 , - .irq =MCFINT_VECBASE +MCFINT_UART0 , + .mapbase =MCFUART_BASE0 , + .irq =MCF_IRQ_UART0 , }, { - .mapbase =MCFUART_BASE2 , - .irq =MCFINT_VECBASE +MCFINT_UART1 , + .mapbase =MCFUART_BASE1 , + .irq =MCF_IRQ_UART1 , }, { - .mapbase =MCFUART_BASE3 , - .irq =MCFINT_VECBASE +MCFINT_UART2 , + .mapbase =MCFUART_BASE2 , + .irq =MCF_IRQ_UART2 , }, { }, };
Signature · 1 line
1.7.0.4
PATCH 10/23 m68knommu: make 5407 UART platform addressing consistent
In reply to [email protected]From: Greg Ungerer <[email protected]>
If we make all UART addressing consistent across all ColdFire family members then we will be able to remove the duplicated plaform data and use a single setup for all.
So modify the ColdFire 5407 UART addressing so that:
. UARTs are numbered from 0 up
. base addresses are absolute (not relative to MBAR peripheral register) . use a common name for IRQs used
--- arch/m68k/include/asm/m5407sim.h | 6 ++++-- arch/m68k/platform/5407/config.c | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-)
arch/m68k/include/asm/m5407sim.h +4 -2
@@ -85,8 +85,8 @@#define MCFTIMER_BASE1 (MCF_MBAR + 0x140)/* Base of TIMER1 */ #define MCFTIMER_BASE2 (MCF_MBAR + 0x180)/* Base of TIMER2 */ -#define MCFUART_BASE1 0x1c0/* Base address of UART1 */ -#define MCFUART_BASE2 0x200/* Base address of UART2 */ +#define MCFUART_BASE0 (MCF_MBAR + 0x1c0)/* Base address UART0 */ +#define MCFUART_BASE1 (MCF_MBAR + 0x200)/* Base address UART1 */ #define MCFSIM_PADDR (MCF_MBAR + 0x244)#define MCFSIM_PADAT (MCF_MBAR + 0x248)
@@ -139,6 +139,8 @@*/ #define MCF_IRQ_TIMER 30/* Timer0, Level 6 */ #define MCF_IRQ_PROFILER 31/* Timer1, Level 7 */ +#define MCF_IRQ_UART0 73/* UART0 */ +#define MCF_IRQ_UART1 74/* UART1 */ /****************************************************************************/ #endif /* m5407sim_h */
arch/m68k/platform/5407/config.c +6 -6
@@ -22,12 +22,12 @@static struct mcf_platform_uart m5407_uart_platform[] = { { - .mapbase =MCF_MBAR +MCFUART_BASE1 , - .irq =73 , + .mapbase =MCFUART_BASE0 , + .irq =MCF_IRQ_UART0 , }, { - .mapbase =MCF_MBAR +MCFUART_BASE2 , - .irq =74 , + .mapbase =MCFUART_BASE1 , + .irq =MCF_IRQ_UART1 , }, { }, };
@@ -48,11 +48,11 @@ static void __init m5407_uart_init_line(int line, int irq) {if (line ==0 ) {writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); -writeb (irq,MCF_MBAR +MCFUART_BASE1 +MCFUART_UIVR ); +writeb (irq,MCFUART_BASE0 +MCFUART_UIVR );mcf_mapirq2imr (irq,MCFINTC_UART0 ); }else if (line ==1 ) {writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); -writeb (irq,MCF_MBAR +MCFUART_BASE2 +MCFUART_UIVR ); +writeb (irq,MCFUART_BASE1 +MCFUART_UIVR );mcf_mapirq2imr (irq,MCFINTC_UART1 ); } }
Signature · 1 line
1.7.0.4
PATCH 11/23 m68knommu: make 54xx UART platform addressing consistent
In reply to [email protected]From: Greg Ungerer <[email protected]>
If we make all UART addressing consistent across all ColdFire family members then we will be able to remove the duplicated plaform data and use a single setup for all.
So modify the ColdFire 54xx UART addressing so that:
. UARTs are numbered from 0 up
. base addresses are absolute (not relative to MBAR peripheral register) . use a common name for IRQs used
--- arch/m68k/include/asm/m54xxsim.h | 16 ++++++++++------ arch/m68k/platform/54xx/config.c | 16 ++++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-)
arch/m68k/include/asm/m54xxsim.h +10 -6
@@ -31,16 +31,20 @@/* * UART module. */ -#define MCFUART_BASE1 0x8600/* Base address of UART1 */ -#define MCFUART_BASE2 0x8700/* Base address of UART2 */ -#define MCFUART_BASE3 0x8800/* Base address of UART3 */ -#define MCFUART_BASE4 0x8900/* Base address of UART4 */ +#define MCFUART_BASE0 (MCF_MBAR + 0x8600)/* Base address UART0 */ +#define MCFUART_BASE1 (MCF_MBAR + 0x8700)/* Base address UART1 */ +#define MCFUART_BASE2 (MCF_MBAR + 0x8800)/* Base address UART2 */ +#define MCFUART_BASE3 (MCF_MBAR + 0x8900)/* Base address UART3 */ /* * Define system peripheral IRQ usage. */ -#define MCF_IRQ_TIMER (64 + 54)/* Slice Timer 0 */ -#define MCF_IRQ_PROFILER (64 + 53)/* Slice Timer 1 */ +#define MCF_IRQ_TIMER (MCFINT_VECBASE + 54)/* Slice Timer 0 */ +#define MCF_IRQ_PROFILER (MCFINT_VECBASE + 53)/* Slice Timer 1 */ +#define MCF_IRQ_UART0 (MCFINT_VECBASE + 35) +#define MCF_IRQ_UART1 (MCFINT_VECBASE + 34) +#define MCF_IRQ_UART2 (MCFINT_VECBASE + 33) +#define MCF_IRQ_UART3 (MCFINT_VECBASE + 32)/* * Generic GPIO support
arch/m68k/platform/54xx/config.c +8 -8
@@ -29,20 +29,20 @@static struct mcf_platform_uart m54xx_uart_platform[] = { { - .mapbase =MCF_MBAR +MCFUART_BASE1 , - .irq =64 +35 , + .mapbase =MCFUART_BASE0 , + .irq =MCF_IRQ_UART0 , }, { - .mapbase =MCF_MBAR +MCFUART_BASE2 , - .irq =64 +34 , + .mapbase =MCFUART_BASE1 , + .irq =MCF_IRQ_UART1 , }, { - .mapbase =MCF_MBAR +MCFUART_BASE3 , - .irq =64 +33 , + .mapbase =MCFUART_BASE2 , + .irq =MCF_IRQ_UART2 , }, { - .mapbase =MCF_MBAR +MCFUART_BASE4 , - .irq =64 +32 , + .mapbase =MCFUART_BASE3 , + .irq =MCF_IRQ_UART3 , }, };
Signature · 1 line
1.7.0.4
PATCH 12/23 m68knommu: simplify the 5206 UART setup code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Simplify the UART setup code so that it no longer loops for each UART present. Just make it do all the work it needs in a single function. This will make the code easier to share when we move to a single set of platform data for ColdFire UARTs.
--- arch/m68k/platform/5206/config.c | 27 +++++++++------------------ 1 files changed, 9 insertions(+), 18 deletions(-)
arch/m68k/platform/5206/config.c +9 -18
@@ -44,26 +44,17 @@ static struct platform_device *m5206_devices[] __initdata = {/***************************************************************************/ -static void __init m5206_uart_init_line (int line,int irq) -{ -if (line ==0 ) { -writel (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); -writeb (irq,MCFUART_BASE0 +MCFUART_UIVR ); -mcf_mapirq2imr (irq,MCFINTC_UART0 ); - }else if (line ==1 ) { -writel (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); -writeb (irq,MCFUART_BASE1 +MCFUART_UIVR ); -mcf_mapirq2imr (irq,MCFINTC_UART1 ); - } -} -static void __init m5206_uarts_init (void ) { -const int nrlines =ARRAY_SIZE (m5206_uart_platform); -int line; - -for (line =0 ; (line < nrlines); line++) -m5206_uart_init_line (line, m5206_uart_platform[line].irq); +/* UART0 interrupt setup */ +writel (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); +writeb (MCF_IRQ_UART0 ,MCFUART_BASE0 +MCFUART_UIVR ); +mcf_mapirq2imr (MCF_IRQ_UART0 ,MCFINTC_UART0 ); + +/* UART1 interrupt setup */ +writel (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); +writeb (MCF_IRQ_UART1 ,MCFUART_BASE1 +MCFUART_UIVR ); +mcf_mapirq2imr (MCF_IRQ_UART1 ,MCFINTC_UART1 ); }/***************************************************************************/
Signature · 1 line
1.7.0.4
PATCH 13/23 m68knommu: simplify the 520x UART setup code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Simplify the UART setup code so that it no longer loops for each UART present. Just make it do all the work it needs in a single function. This will make the code easier to share when we move to a single set of platform data for ColdFire UARTs.
--- arch/m68k/platform/520x/config.c | 42 ++++++++++--------------------------- 1 files changed, 12 insertions(+), 30 deletions(-)
arch/m68k/platform/520x/config.c +12 -30
@@ -227,41 +227,23 @@ static struct platform_device *m520x_devices[] __initdata = {/***************************************************************************/ -static void __init m520x_uart_init_line (int line,int irq) +static void __init m520x_uarts_init (void ) {u16 par;u8 par2; -switch (line) { -case 0 : - par =readw (MCF_GPIO_PAR_UART ); - par |=MCF_GPIO_PAR_UART_PAR_UTXD0 | -MCF_GPIO_PAR_UART_PAR_URXD0 ; -writew (par,MCF_GPIO_PAR_UART ); -break ; -case 1 : - par =readw (MCF_GPIO_PAR_UART ); - par |=MCF_GPIO_PAR_UART_PAR_UTXD1 | -MCF_GPIO_PAR_UART_PAR_URXD1 ; -writew (par,MCF_GPIO_PAR_UART ); -break ; -case 2 : - par2 =readb (MCF_GPIO_PAR_FECI2C ); - par2 &= ~0x0F ; - par2 |=MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2 | -MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2 ; -writeb (par2,MCF_GPIO_PAR_FECI2C ); -break ; - } -} - -static void __init m520x_uarts_init (void ) -{ -const int nrlines =ARRAY_SIZE (m520x_uart_platform); -int line; +/* UART0 and UART1 GPIO pin setup */ + par =readw (MCF_GPIO_PAR_UART ); + par |=MCF_GPIO_PAR_UART_PAR_UTXD0 |MCF_GPIO_PAR_UART_PAR_URXD0 ; + par |=MCF_GPIO_PAR_UART_PAR_UTXD1 |MCF_GPIO_PAR_UART_PAR_URXD1 ; +writew (par,MCF_GPIO_PAR_UART ); -for (line =0 ; (line < nrlines); line++) -m520x_uart_init_line (line, m520x_uart_platform[line].irq); +/* UART1 GPIO pin setup */ + par2 =readb (MCF_GPIO_PAR_FECI2C ); + par2 &= ~0x0F ; + par2 |=MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2 | +MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2 ; +writeb (par2,MCF_GPIO_PAR_FECI2C ); }/***************************************************************************/
Signature · 1 line
1.7.0.4
PATCH 14/23 m68knommu: simplify the 5249 UART setup code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Simplify the UART setup code so that it no longer loops for each UART present. Just make it do all the work it needs in a single function. This will make the code easier to share when we move to a single set of platform data for ColdFire UARTs.
--- arch/m68k/platform/5249/config.c | 27 +++++++++------------------ 1 files changed, 9 insertions(+), 18 deletions(-)
arch/m68k/platform/5249/config.c +9 -18
@@ -234,26 +234,17 @@ static struct platform_device *m5249_devices[] __initdata = {/***************************************************************************/ -static void __init m5249_uart_init_line (int line,int irq) -{ -if (line ==0 ) { -writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); -writeb (irq,MCFUART_BASE0 +MCFUART_UIVR ); -mcf_mapirq2imr (irq,MCFINTC_UART0 ); - }else if (line ==1 ) { -writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); -writeb (irq,MCFUART_BASE1 +MCFUART_UIVR ); -mcf_mapirq2imr (irq,MCFINTC_UART1 ); - } -} -static void __init m5249_uarts_init (void ) { -const int nrlines =ARRAY_SIZE (m5249_uart_platform); -int line; - -for (line =0 ; (line < nrlines); line++) -m5249_uart_init_line (line, m5249_uart_platform[line].irq); +/* UART0 interrupt setup */ +writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); +writeb (MCF_IRQ_UART0 ,MCFUART_BASE0 +MCFUART_UIVR ); +mcf_mapirq2imr (MCF_IRQ_UART0 ,MCFINTC_UART0 ); + +/* UART1 interrupt setup */ +writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); +writeb (MCF_IRQ_UART1 ,MCFUART_BASE1 +MCFUART_UIVR ); +mcf_mapirq2imr (MCF_IRQ_UART1 ,MCFINTC_UART1 ); }/***************************************************************************/
Signature · 1 line
1.7.0.4
PATCH 15/23 m68knommu: simplify the 5272 UART setup code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Simplify the UART setup code so that it no longer loops for each UART present. Just make it do all the work it needs in a single function. This will make the code easier to share when we move to a single set of platform data for ColdFire UARTs.
--- arch/m68k/platform/5272/config.c | 27 ++++++++------------------- 1 files changed, 8 insertions(+), 19 deletions(-)
arch/m68k/platform/5272/config.c +8 -19
@@ -85,29 +85,18 @@ static struct platform_device *m5272_devices[] __initdata = {/***************************************************************************/ -static void __init m5272_uart_init_line (int line,int irq) +static void __init m5272_uarts_init (void ) {u32 v; -if ((line >=0 ) && (line <2 )) { -/* Enable the output lines for the serial ports */ - v =readl (MCF_MBAR +MCFSIM_PBCNT ); - v = (v & ~0x000000ff ) |0x00000055 ; -writel (v,MCF_MBAR +MCFSIM_PBCNT ); - - v =readl (MCF_MBAR +MCFSIM_PDCNT ); - v = (v & ~0x000003fc ) |0x000002a8 ; -writel (v,MCF_MBAR +MCFSIM_PDCNT ); - } -} - -static void __init m5272_uarts_init (void ) -{ -const int nrlines =ARRAY_SIZE (m5272_uart_platform); -int line; +/* Enable the output lines for the serial ports */ + v =readl (MCF_MBAR +MCFSIM_PBCNT ); + v = (v & ~0x000000ff ) |0x00000055 ; +writel (v,MCF_MBAR +MCFSIM_PBCNT ); -for (line =0 ; (line < nrlines); line++) -m5272_uart_init_line (line, m5272_uart_platform[line].irq); + v =readl (MCF_MBAR +MCFSIM_PDCNT ); + v = (v & ~0x000003fc ) |0x000002a8 ; +writel (v,MCF_MBAR +MCFSIM_PDCNT ); }/***************************************************************************/
Signature · 1 line
1.7.0.4
PATCH 16/23 m68knommu: simplify the 527x UART setup code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Simplify the UART setup code so that it no longer loops for each UART present. Just make it do all the work it needs in a single function. This will make the code easier to share when we move to a single set of platform data for ColdFire UARTs.
--- arch/m68k/platform/527x/config.c | 21 ++------------------- 1 files changed, 2 insertions(+), 19 deletions(-)
arch/m68k/platform/527x/config.c +2 -19
@@ -295,35 +295,18 @@ static struct platform_device *m527x_devices[] __initdata = {/***************************************************************************/ -static void __init m527x_uart_init_line (int line,int irq) +static void __init m527x_uarts_init (void ) {u16 sepmask; -if ((line <0 ) || (line >2 )) -return ; -/* * External Pin Mask Setting & Enable External Pin for Interface */ sepmask =readw (MCF_IPSBAR +MCF_GPIO_PAR_UART ); -if (line ==0 ) - sepmask |=UART0_ENABLE_MASK ; -else if (line ==1 ) - sepmask |=UART1_ENABLE_MASK ; -else if (line ==2 ) - sepmask |=UART2_ENABLE_MASK ; + sepmask |=UART0_ENABLE_MASK |UART1_ENABLE_MASK |UART2_ENABLE_MASK ;writew (sepmask,MCF_IPSBAR +MCF_GPIO_PAR_UART ); } -static void __init m527x_uarts_init (void ) -{ -const int nrlines =ARRAY_SIZE (m527x_uart_platform); -int line; - -for (line =0 ; (line < nrlines); line++) -m527x_uart_init_line (line, m527x_uart_platform[line].irq); -} -/***************************************************************************/ static void __init m527x_fec_init (void )
Signature · 1 line
1.7.0.4
PATCH 17/23 m68knommu: simplify the 528x UART setup code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Simplify the UART setup code so that it no longer loops for each UART present. Just make it do all the work it needs in a single function. This will make the code easier to share when we move to a single set of platform data for ColdFire UARTs.
--- arch/m68k/platform/528x/config.c | 22 ++++------------------ 1 files changed, 4 insertions(+), 18 deletions(-)
arch/m68k/platform/528x/config.c +4 -18
@@ -218,28 +218,14 @@ static struct platform_device *m528x_devices[] __initdata = {/***************************************************************************/ -static void __init m528x_uart_init_line (int line,int irq) +static void __init m528x_uarts_init (void ) {u8 port; -if ((line <0 ) || (line >2 )) -return ; -/* make sure PUAPAR is set for UART0 and UART1 */ -if (line <2 ) { - port =readb (MCF5282_GPIO_PUAPAR ); - port |= (0x03 << (line *2 )); -writeb (port,MCF5282_GPIO_PUAPAR ); - } -} - -static void __init m528x_uarts_init (void ) -{ -const int nrlines =ARRAY_SIZE (m528x_uart_platform); -int line; - -for (line =0 ; (line < nrlines); line++) -m528x_uart_init_line (line, m528x_uart_platform[line].irq); + port =readb (MCF5282_GPIO_PUAPAR ); + port |=0x03 | (0x03 <<2 ); +writeb (port,MCF5282_GPIO_PUAPAR ); }/***************************************************************************/
Signature · 1 line
1.7.0.4
PATCH 18/23 m68knommu: simplify the 5307 UART setup code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Simplify the UART setup code so that it no longer loops for each UART present. Just make it do all the work it needs in a single function. This will make the code easier to share when we move to a single set of platform data for ColdFire UARTs.
--- arch/m68k/platform/5307/config.c | 25 ++++++++----------------- 1 files changed, 8 insertions(+), 17 deletions(-)
arch/m68k/platform/5307/config.c +9 -18
@@ -53,26 +53,17 @@ static struct platform_device *m5307_devices[] __initdata = {/***************************************************************************/ -static void __init m5307_uart_init_line (int line,int irq) -{ -if (line ==0 ) { -writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); -writeb (irq,MCFUART_BASE0 +MCFUART_UIVR ); -mcf_mapirq2imr (irq,MCFINTC_UART0 ); - }else if (line ==1 ) { -writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); -writeb (irq,MCFUART_BASE1 +MCFUART_UIVR ); -mcf_mapirq2imr (irq,MCFINTC_UART1 ); - } -} -static void __init m5307_uarts_init (void ) { -const int nrlines =ARRAY_SIZE (m5307_uart_platform); -int line; - -for (line =0 ; (line < nrlines); line++) -m5307_uart_init_line (line, m5307_uart_platform[line].irq); +/* UART0 interrupt setup */ +writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); +writeb (MCF_IRQ_UART0 ,MCFUART_BASE0 +MCFUART_UIVR ); +mcf_mapirq2imr (MCF_IRQ_UART0 ,MCFINTC_UART0 ); + +/* UART1 interrupt setup */ +writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); +writeb (MCF_IRQ_UART1 ,MCFUART_BASE1 +MCFUART_UIVR ); +mcf_mapirq2imr (MCF_IRQ_UART1 ,MCFINTC_UART1 ); }/***************************************************************************/
Signature · 1 line
1.7.0.4
PATCH 19/23 m68knommu: simplify the 532x UART setup code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Simplify the UART setup code so that it no longer loops for each UART present. Just make it do all the work it needs in a single function. This will make the code easier to share when we move to a single set of platform data for ColdFire UARTs.
--- arch/m68k/platform/532x/config.c | 19 +++---------------- 1 files changed, 3 insertions(+), 16 deletions(-)
arch/m68k/platform/532x/config.c +3 -16
@@ -210,25 +210,12 @@ static struct platform_device *m532x_devices[] __initdata = {/***************************************************************************/ -static void __init m532x_uart_init_line (int line,int irq) -{ -if (line ==0 ) { -/* GPIO initialization */ -MCF_GPIO_PAR_UART |=0x000F ; - }else if (line ==1 ) { -/* GPIO initialization */ -MCF_GPIO_PAR_UART |=0x0FF0 ; - } -} -static void __init m532x_uarts_init (void ) { -const int nrlines =ARRAY_SIZE (m532x_uart_platform); -int line; - -for (line =0 ; (line < nrlines); line++) -m532x_uart_init_line (line, m532x_uart_platform[line].irq); +/* UART GPIO initialization */ +MCF_GPIO_PAR_UART |=0x0FFF ; } +/***************************************************************************/ static void __init m532x_fec_init (void )
Signature · 1 line
1.7.0.4
PATCH 20/23 m68knommu: simplify the 5407 UART setup code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Simplify the UART setup code so that it no longer loops for each UART present. Just make it do all the work it needs in a single function. This will make the code easier to share when we move to a single set of platform data for ColdFire UARTs.
--- arch/m68k/platform/5407/config.c | 25 ++++++++----------------- 1 files changed, 8 insertions(+), 17 deletions(-)
arch/m68k/platform/5407/config.c +9 -18
@@ -44,26 +44,17 @@ static struct platform_device *m5407_devices[] __initdata = {/***************************************************************************/ -static void __init m5407_uart_init_line (int line,int irq) -{ -if (line ==0 ) { -writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); -writeb (irq,MCFUART_BASE0 +MCFUART_UIVR ); -mcf_mapirq2imr (irq,MCFINTC_UART0 ); - }else if (line ==1 ) { -writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); -writeb (irq,MCFUART_BASE1 +MCFUART_UIVR ); -mcf_mapirq2imr (irq,MCFINTC_UART1 ); - } -} -static void __init m5407_uarts_init (void ) { -const int nrlines =ARRAY_SIZE (m5407_uart_platform); -int line; - -for (line =0 ; (line < nrlines); line++) -m5407_uart_init_line (line, m5407_uart_platform[line].irq); +/* UART0 interrupt setup */ +writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); +writeb (MCF_IRQ_UART0 ,MCFUART_BASE0 +MCFUART_UIVR ); +mcf_mapirq2imr (MCF_IRQ_UART0 ,MCFINTC_UART0 ); + +/* UART1 interrupt setup */ +writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); +writeb (MCF_IRQ_UART1 ,MCFUART_BASE1 +MCFUART_UIVR ); +mcf_mapirq2imr (MCF_IRQ_UART1 ,MCFINTC_UART1 ); }/***************************************************************************/
Signature · 1 line
1.7.0.4
PATCH 21/23 m68knommu: simplify the 54xx UART setup code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Simplify the UART setup code so that it no longer loops for each UART present. Just make it do all the work it needs in a single function. This will make the code easier to share when we move to a single set of platform data for ColdFire UARTs.
--- arch/m68k/platform/54xx/config.c | 33 +++++++++------------------------ 1 files changed, 9 insertions(+), 24 deletions(-)
arch/m68k/platform/54xx/config.c +9 -24
@@ -59,32 +59,17 @@ static struct platform_device *m54xx_devices[] __initdata = {/***************************************************************************/ -static void __init m54xx_uart_init_line (int line,int irq) -{ -int rts_cts; - -/* enable io pins */ -switch (line) { -case 0 : - rts_cts =0 ;break ; -case 1 : - rts_cts =MCF_PAR_PSC_RTS_RTS ;break ; -case 2 : - rts_cts =MCF_PAR_PSC_RTS_RTS |MCF_PAR_PSC_CTS_CTS ;break ; -case 3 : - rts_cts =0 ;break ; - } -__raw_writeb (MCF_PAR_PSC_TXD | rts_cts |MCF_PAR_PSC_RXD , -MCF_MBAR +MCF_PAR_PSC (line)); -} -static void __init m54xx_uarts_init (void ) { -const int nrlines =ARRAY_SIZE (m54xx_uart_platform); -int line; - -for (line =0 ; (line < nrlines); line++) -m54xx_uart_init_line (line, m54xx_uart_platform[line].irq); +/* enable io pins */ +__raw_writeb (MCF_PAR_PSC_TXD |MCF_PAR_PSC_RXD , +MCF_MBAR +MCF_PAR_PSC (0 )); +__raw_writeb (MCF_PAR_PSC_TXD |MCF_PAR_PSC_RXD |MCF_PAR_PSC_RTS_RTS , +MCF_MBAR +MCF_PAR_PSC (1 )); +__raw_writeb (MCF_PAR_PSC_TXD |MCF_PAR_PSC_RXD |MCF_PAR_PSC_RTS_RTS | +MCF_PAR_PSC_CTS_CTS ,MCF_MBAR +MCF_PAR_PSC (2 )); +__raw_writeb (MCF_PAR_PSC_TXD |MCF_PAR_PSC_RXD , +MCF_MBAR +MCF_PAR_PSC (3 )); }/***************************************************************************/
Signature · 1 line
1.7.0.4
PATCH 22/23 m68knommu: merge common ColdFire UART platform setup code
In reply to [email protected]From: Greg Ungerer <[email protected]>
The ColdFire UART is common to all ColdFire CPU's. No need to duplicate its platform setup code for every CPU family member. Merge all the setup code into a single shared file.
--- arch/m68k/platform/5206/config.c | 34 ------------------- arch/m68k/platform/520x/config.c | 23 ------------- arch/m68k/platform/523x/config.c | 23 ------------- arch/m68k/platform/5249/config.c | 19 ----------- arch/m68k/platform/5272/config.c | 19 ----------- arch/m68k/platform/527x/config.c | 23 ------------- arch/m68k/platform/528x/config.c | 23 ------------- arch/m68k/platform/5307/config.c | 34 ------------------- arch/m68k/platform/532x/config.c | 23 ------------- arch/m68k/platform/5407/config.c | 34 ------------------- arch/m68k/platform/54xx/config.c | 43 ------------------------ arch/m68k/platform/coldfire/Makefile | 2 +- arch/m68k/platform/coldfire/device.c | 60 ++++++++++++++++++++++++++++++++++ 13 files changed, 61 insertions(+), 299 deletions(-) create mode 100644 arch/m68k/platform/coldfire/device.c
arch/m68k/platform/5206/config.c +0 -34
@@ -20,30 +20,6 @@/***************************************************************************/ -static struct mcf_platform_uart m5206_uart_platform[] = { - { - .mapbase =MCFUART_BASE0 , - .irq =MCF_IRQ_UART0 , - }, - { - .mapbase =MCFUART_BASE1 , - .irq =MCF_IRQ_UART1 , - }, - { }, -}; - -static struct platform_device m5206_uart = { - .name ="mcfuart" , - .id =0 , - .dev.platform_data = m5206_uart_platform, -}; - -static struct platform_device *m5206_devices[]__initdata = { - &m5206_uart, -}; - -/***************************************************************************/ -static void __init m5206_uarts_init (void ) {/* UART0 interrupt setup */
@@ -106,13 +82,3 @@ void __init config_BSP(char *commandp, int size) }/***************************************************************************/ - -static int __init init_BSP (void ) -{ -platform_add_devices (m5206_devices,ARRAY_SIZE (m5206_devices)); -return 0 ; -} - -arch_initcall (init_BSP); - -/***************************************************************************/
arch/m68k/platform/520x/config.c +0 -23
@@ -25,28 +25,6 @@/***************************************************************************/ -static struct mcf_platform_uart m520x_uart_platform[] = { - { - .mapbase =MCFUART_BASE0 , - .irq =MCF_IRQ_UART0 , - }, - { - .mapbase =MCFUART_BASE1 , - .irq =MCF_IRQ_UART1 , - }, - { - .mapbase =MCFUART_BASE2 , - .irq =MCF_IRQ_UART2 , - }, - { }, -}; - -static struct platform_device m520x_uart = { - .name ="mcfuart" , - .id =0 , - .dev.platform_data = m520x_uart_platform, -}; -static struct resource m520x_fec_resources[] = { { .start =MCFFEC_BASE ,
@@ -218,7 +196,6 @@ static void __init m520x_qspi_init(void)static struct platform_device *m520x_devices[]__initdata = { - &m520x_uart, &m520x_fec, #if defined(CONFIG_SPI_COLDFIRE_QSPI) || defined(CONFIG_SPI_COLDFIRE_QSPI_MODULE) &m520x_qspi,
arch/m68k/platform/523x/config.c +0 -23
@@ -26,28 +26,6 @@/***************************************************************************/ -static struct mcf_platform_uart m523x_uart_platform[] = { - { - .mapbase =MCFUART_BASE0 , - .irq =MCF_IRQ_UART0 , - }, - { - .mapbase =MCFUART_BASE1 , - .irq =MCF_IRQ_UART1 , - }, - { - .mapbase =MCFUART_BASE2 , - .irq =MCF_IRQ_UART2 , - }, - { }, -}; - -static struct platform_device m523x_uart = { - .name ="mcfuart" , - .id =0 , - .dev.platform_data = m523x_uart_platform, -}; -static struct resource m523x_fec_resources[] = { { .start =MCFFEC_BASE ,
@@ -240,7 +218,6 @@ static void __init m523x_qspi_init(void)#endif /* defined(CONFIG_SPI_COLDFIRE_QSPI) || defined(CONFIG_SPI_COLDFIRE_QSPI_MODULE) */ static struct platform_device *m523x_devices[]__initdata = { - &m523x_uart, &m523x_fec, #if defined(CONFIG_SPI_COLDFIRE_QSPI) || defined(CONFIG_SPI_COLDFIRE_QSPI_MODULE) &m523x_qspi,
arch/m68k/platform/5249/config.c +0 -19
@@ -22,24 +22,6 @@/***************************************************************************/ -static struct mcf_platform_uart m5249_uart_platform[] = { - { - .mapbase =MCFUART_BASE0 , - .irq =MCF_IRQ_UART0 , - }, - { - .mapbase =MCFUART_BASE1 , - .irq =MCF_IRQ_UART1 , - }, - { }, -}; - -static struct platform_device m5249_uart = { - .name ="mcfuart" , - .id =0 , - .dev.platform_data = m5249_uart_platform, -}; -#ifdef CONFIG_M5249C3 static struct resource m5249_smc91x_resources[] = {
@@ -223,7 +205,6 @@ static void __init m5249_qspi_init(void)static struct platform_device *m5249_devices[]__initdata = { - &m5249_uart, #ifdef CONFIG_M5249C3 &m5249_smc91x, #endif
arch/m68k/platform/5272/config.c +0 -19
@@ -30,24 +30,6 @@ unsigned char ledbank = 0xff;/***************************************************************************/ -static struct mcf_platform_uart m5272_uart_platform[] = { - { - .mapbase =MCFUART_BASE0 , - .irq =MCF_IRQ_UART0 , - }, - { - .mapbase =MCFUART_BASE1 , - .irq =MCF_IRQ_UART1 , - }, - { }, -}; - -static struct platform_device m5272_uart = { - .name ="mcfuart" , - .id =0 , - .dev.platform_data = m5272_uart_platform, -}; -static struct resource m5272_fec_resources[] = { { .start =MCF_MBAR +0x840 ,
@@ -79,7 +61,6 @@ static struct platform_device m5272_fec = { };static struct platform_device *m5272_devices[]__initdata = { - &m5272_uart, &m5272_fec, };
arch/m68k/platform/527x/config.c +0 -23
@@ -26,28 +26,6 @@/***************************************************************************/ -static struct mcf_platform_uart m527x_uart_platform[] = { - { - .mapbase =MCFUART_BASE0 , - .irq =MCF_IRQ_UART0 , - }, - { - .mapbase =MCFUART_BASE1 , - .irq =MCF_IRQ_UART1 , - }, - { - .mapbase =MCFUART_BASE2 , - .irq =MCF_IRQ_UART2 , - }, - { }, -}; - -static struct platform_device m527x_uart = { - .name ="mcfuart" , - .id =0 , - .dev.platform_data = m527x_uart_platform, -}; -static struct resource m527x_fec0_resources[] = { { .start =MCFFEC_BASE0 ,
@@ -283,7 +261,6 @@ static void __init m527x_qspi_init(void)#endif /* defined(CONFIG_SPI_COLDFIRE_QSPI) || defined(CONFIG_SPI_COLDFIRE_QSPI_MODULE) */ static struct platform_device *m527x_devices[]__initdata = { - &m527x_uart, &m527x_fec[0 ], #ifdef CONFIG_FEC2 &m527x_fec[1],
arch/m68k/platform/528x/config.c +0 -23
@@ -27,28 +27,6 @@/***************************************************************************/ -static struct mcf_platform_uart m528x_uart_platform[] = { - { - .mapbase =MCFUART_BASE0 , - .irq =MCF_IRQ_UART0 , - }, - { - .mapbase =MCFUART_BASE1 , - .irq =MCF_IRQ_UART1 , - }, - { - .mapbase =MCFUART_BASE2 , - .irq =MCF_IRQ_UART2 , - }, - { }, -}; - -static struct platform_device m528x_uart = { - .name ="mcfuart" , - .id =0 , - .dev.platform_data = m528x_uart_platform, -}; -static struct resource m528x_fec_resources[] = { { .start =MCFFEC_BASE ,
@@ -209,7 +187,6 @@ static void __init m528x_qspi_init(void)#endif /* defined(CONFIG_SPI_COLDFIRE_QSPI) || defined(CONFIG_SPI_COLDFIRE_QSPI_MODULE) */ static struct platform_device *m528x_devices[]__initdata = { - &m528x_uart, &m528x_fec, #if defined(CONFIG_SPI_COLDFIRE_QSPI) || defined(CONFIG_SPI_COLDFIRE_QSPI_MODULE) &m528x_qspi,
arch/m68k/platform/5307/config.c +0 -34
@@ -29,30 +29,6 @@ unsigned char ledbank = 0xff;/***************************************************************************/ -static struct mcf_platform_uart m5307_uart_platform[] = { - { - .mapbase =MCFUART_BASE0 , - .irq =MCF_IRQ_UART0 , - }, - { - .mapbase =MCFUART_BASE1 , - .irq =MCF_IRQ_UART1 , - }, - { }, -}; - -static struct platform_device m5307_uart = { - .name ="mcfuart" , - .id =0 , - .dev.platform_data = m5307_uart_platform, -}; - -static struct platform_device *m5307_devices[]__initdata = { - &m5307_uart, -}; - -/***************************************************************************/ -static void __init m5307_uarts_init (void ) {/* UART0 interrupt setup */
@@ -126,13 +102,3 @@ void __init config_BSP(char *commandp, int size) }/***************************************************************************/ - -static int __init init_BSP (void ) -{ -platform_add_devices (m5307_devices,ARRAY_SIZE (m5307_devices)); -return 0 ; -} - -arch_initcall (init_BSP); - -/***************************************************************************/
arch/m68k/platform/532x/config.c +0 -23
@@ -33,28 +33,6 @@/***************************************************************************/ -static struct mcf_platform_uart m532x_uart_platform[] = { - { - .mapbase =MCFUART_BASE0 , - .irq =MCF_IRQ_UART0 , - }, - { - .mapbase =MCFUART_BASE1 , - .irq =MCF_IRQ_UART1 , - }, - { - .mapbase =MCFUART_BASE2 , - .irq =MCF_IRQ_UART2 , - }, - { }, -}; - -static struct platform_device m532x_uart = { - .name ="mcfuart" , - .id =0 , - .dev.platform_data = m532x_uart_platform, -}; -static struct resource m532x_fec_resources[] = { { .start =0xfc030000 ,
@@ -201,7 +179,6 @@ static void __init m532x_qspi_init(void)static struct platform_device *m532x_devices[]__initdata = { - &m532x_uart, &m532x_fec, #if defined(CONFIG_SPI_COLDFIRE_QSPI) || defined(CONFIG_SPI_COLDFIRE_QSPI_MODULE) &m532x_qspi,
arch/m68k/platform/5407/config.c +0 -34
@@ -20,30 +20,6 @@/***************************************************************************/ -static struct mcf_platform_uart m5407_uart_platform[] = { - { - .mapbase =MCFUART_BASE0 , - .irq =MCF_IRQ_UART0 , - }, - { - .mapbase =MCFUART_BASE1 , - .irq =MCF_IRQ_UART1 , - }, - { }, -}; - -static struct platform_device m5407_uart = { - .name ="mcfuart" , - .id =0 , - .dev.platform_data = m5407_uart_platform, -}; - -static struct platform_device *m5407_devices[]__initdata = { - &m5407_uart, -}; - -/***************************************************************************/ -static void __init m5407_uarts_init (void ) {/* UART0 interrupt setup */
@@ -101,13 +77,3 @@ void __init config_BSP(char *commandp, int size) }/***************************************************************************/ - -static int __init init_BSP (void ) -{ -platform_add_devices (m5407_devices,ARRAY_SIZE (m5407_devices)); -return 0 ; -} - -arch_initcall (init_BSP); - -/***************************************************************************/
arch/m68k/platform/54xx/config.c +0 -43
52 lines not on this page · raw message
arch/m68k/platform/coldfire/Makefile +1 -1
@@ -14,7 +14,7 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 -obj-$(CONFIG_COLDFIRE) += cache.o clk.o dma.o entry.o vectors.o +obj-$(CONFIG_COLDFIRE) += cache.o clk.o device.o dma.o entry.o vectors.o obj-$(CONFIG_M5206) += timers.o intc.o obj-$(CONFIG_M5206e) += timers.o intc.o obj-$(CONFIG_M520x) += pit.o intc-simr.o
arch/m68k/platform/coldfire/device.c new file +60 -0
60 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 23/23 m68knommu: merge common ColdFire UART IRQ setup
In reply to [email protected]From: Greg Ungerer <[email protected]>
Some ColdFire CPU UART hardware modules can configure the IRQ they use. Currently the same setup code is duplicated in the init code for each of these ColdFire CPUs. Merge all this code to a single instance.
--- arch/m68k/include/asm/mcfuart.h | 5 ++++- arch/m68k/platform/5206/config.c | 17 ----------------- arch/m68k/platform/5249/config.c | 17 ----------------- arch/m68k/platform/5307/config.c | 17 ----------------- arch/m68k/platform/5407/config.c | 17 ----------------- arch/m68k/platform/coldfire/device.c | 20 ++++++++++++++++++++ 6 files changed, 24 insertions(+), 69 deletions(-)
arch/m68k/include/asm/mcfuart.h +4 -1
@@ -41,7 +41,10 @@ struct mcf_platform_uart {#define MCFUART_UTF 0x28/* Transmitter FIFO (r/w) */ #define MCFUART_URF 0x2c/* Receiver FIFO (r/w) */ #define MCFUART_UFPD 0x30/* Frac Prec. Divider (r/w) */ -#else +#endif +#if defined(CONFIG_M5206 ) || defined(CONFIG_M5206e) || \ + defined(CONFIG_M5249 ) || defined(CONFIG_M5307 ) || \ + defined(CONFIG_M5407 )#define MCFUART_UIVR 0x30/* Interrupt Vector (r/w) */ #endif #define MCFUART_UIPR 0x34/* Input Port (r) */
arch/m68k/platform/5206/config.c +0 -17
@@ -16,22 +16,6 @@#include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> -#include <asm/mcfuart.h> - -/***************************************************************************/ - -static void __init m5206_uarts_init (void ) -{ -/* UART0 interrupt setup */ -writel (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); -writeb (MCF_IRQ_UART0 ,MCFUART_BASE0 +MCFUART_UIVR ); -mcf_mapirq2imr (MCF_IRQ_UART0 ,MCFINTC_UART0 ); - -/* UART1 interrupt setup */ -writel (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); -writeb (MCF_IRQ_UART1 ,MCFUART_BASE1 +MCFUART_UIVR ); -mcf_mapirq2imr (MCF_IRQ_UART1 ,MCFINTC_UART1 ); -}/***************************************************************************/
@@ -73,7 +57,6 @@ void __init config_BSP(char *commandp, int size) mach_reset = m5206_cpu_reset;m5206_timers_init (); -m5206_uarts_init ();/* Only support the external interrupts on their primary level */ mcf_mapirq2imr (25 ,MCFINTC_EINT1 );
arch/m68k/platform/5249/config.c +0 -17
@@ -17,7 +17,6 @@#include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> -#include <asm/mcfuart.h> #include <asm/mcfqspi.h> /***************************************************************************/
@@ -215,21 +214,6 @@ static struct platform_device *m5249_devices[] __initdata = {/***************************************************************************/ -static void __init m5249_uarts_init (void ) -{ -/* UART0 interrupt setup */ -writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); -writeb (MCF_IRQ_UART0 ,MCFUART_BASE0 +MCFUART_UIVR ); -mcf_mapirq2imr (MCF_IRQ_UART0 ,MCFINTC_UART0 ); - -/* UART1 interrupt setup */ -writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); -writeb (MCF_IRQ_UART1 ,MCFUART_BASE1 +MCFUART_UIVR ); -mcf_mapirq2imr (MCF_IRQ_UART1 ,MCFINTC_UART1 ); -} - -/***************************************************************************/ -#ifdef CONFIG_M5249C3 static void __init m5249_smc91x_init (void )
@@ -280,7 +264,6 @@ void __init config_BSP(char *commandp, int size) { mach_reset = m5249_cpu_reset;m5249_timers_init (); -m5249_uarts_init ();#ifdef CONFIG_M5249C3 m5249_smc91x_init ();#endif
arch/m68k/platform/5307/config.c +0 -17
@@ -16,7 +16,6 @@#include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> -#include <asm/mcfuart.h> #include <asm/mcfwdebug.h> /***************************************************************************/
@@ -29,21 +28,6 @@ unsigned char ledbank = 0xff;/***************************************************************************/ -static void __init m5307_uarts_init (void ) -{ -/* UART0 interrupt setup */ -writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); -writeb (MCF_IRQ_UART0 ,MCFUART_BASE0 +MCFUART_UIVR ); -mcf_mapirq2imr (MCF_IRQ_UART0 ,MCFINTC_UART0 ); - -/* UART1 interrupt setup */ -writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); -writeb (MCF_IRQ_UART1 ,MCFUART_BASE1 +MCFUART_UIVR ); -mcf_mapirq2imr (MCF_IRQ_UART1 ,MCFINTC_UART1 ); -} - -/***************************************************************************/ -static void __init m5307_timers_init (void ) {/* Timer1 is always used as system timer */
@@ -83,7 +67,6 @@ void __init config_BSP(char *commandp, int size) mach_reset = m5307_cpu_reset;m5307_timers_init (); -m5307_uarts_init ();/* Only support the external interrupts on their primary level */ mcf_mapirq2imr (25 ,MCFINTC_EINT1 );
arch/m68k/platform/5407/config.c +0 -17
@@ -16,22 +16,6 @@#include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> -#include <asm/mcfuart.h> - -/***************************************************************************/ - -static void __init m5407_uarts_init (void ) -{ -/* UART0 interrupt setup */ -writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); -writeb (MCF_IRQ_UART0 ,MCFUART_BASE0 +MCFUART_UIVR ); -mcf_mapirq2imr (MCF_IRQ_UART0 ,MCFINTC_UART0 ); - -/* UART1 interrupt setup */ -writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); -writeb (MCF_IRQ_UART1 ,MCFUART_BASE1 +MCFUART_UIVR ); -mcf_mapirq2imr (MCF_IRQ_UART1 ,MCFINTC_UART1 ); -}/***************************************************************************/
@@ -67,7 +51,6 @@ void __init config_BSP(char *commandp, int size) { mach_reset = m5407_cpu_reset;m5407_timers_init (); -m5407_uarts_init ();/* Only support the external interrupts on their primary level */ mcf_mapirq2imr (25 ,MCFINTC_EINT1 );
arch/m68k/platform/coldfire/device.c +20 -0
@@ -50,8 +50,28 @@ static struct platform_device *mcf_devices[] __initdata = { &mcf_uart, }; + +/* +* Some ColdFire UARTs let you set the IRQ line to use. +*/ +static void __init mcf_uart_set_irq (void ) +{ +#ifdef MCFUART_UIVR +/* UART0 interrupt setup */ +writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI1 ,MCF_MBAR +MCFSIM_UART1ICR ); +writeb (MCF_IRQ_UART0 ,MCFUART_BASE0 +MCFUART_UIVR ); +mcf_mapirq2imr (MCF_IRQ_UART0 ,MCFINTC_UART0 ); + +/* UART1 interrupt setup */ +writeb (MCFSIM_ICR_LEVEL6 |MCFSIM_ICR_PRI2 ,MCF_MBAR +MCFSIM_UART2ICR ); +writeb (MCF_IRQ_UART1 ,MCFUART_BASE1 +MCFUART_UIVR ); +mcf_mapirq2imr (MCF_IRQ_UART1 ,MCFINTC_UART1 ); +#endif +} +static int __init mcf_init_devices (void ) { +mcf_uart_set_irq ();platform_add_devices (mcf_devices,ARRAY_SIZE (mcf_devices));return 0 ; }
Signature · 1 line
1.7.0.4