From 550650ddd0fde00f245bc3da72d7272844198394 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Mon, 20 Sep 2010 16:05:31 +0200 Subject: ppc4xx: Use common NS16550 driver for PPC4xx UART This patch removes the PPC4xx UART driver. Instead the common NS16550 driver is used, since all PPC4xx SoC's use this peripheral device. The file 4xx_uart.c now only implements the UART clock calculation function which also sets the SoC internal UART divisors. All PPC4xx board config headers are changed to use this common NS16550 driver now. Tested on these boards: acadia, canyonlands, katmai, kilauea, sequoia, zeus Signed-off-by: Stefan Roese --- arch/powerpc/include/asm/ppc405cr.h | 7 ++++++- arch/powerpc/include/asm/ppc405ep.h | 7 ++++++- arch/powerpc/include/asm/ppc405ex.h | 7 ++++++- arch/powerpc/include/asm/ppc405ez.h | 9 +++++++-- arch/powerpc/include/asm/ppc405gp.h | 7 ++++++- arch/powerpc/include/asm/ppc440ep_gr.h | 14 ++++++++++++-- arch/powerpc/include/asm/ppc440epx_grx.h | 12 +++++++++--- arch/powerpc/include/asm/ppc440gp.h | 9 ++++++++- arch/powerpc/include/asm/ppc440gx.h | 10 +++++++++- arch/powerpc/include/asm/ppc440sp.h | 10 +++++++++- arch/powerpc/include/asm/ppc440spe.h | 9 ++++++++- arch/powerpc/include/asm/ppc460ex_gt.h | 12 ++++++++++-- arch/powerpc/include/asm/ppc460sx.h | 8 +++++++- arch/powerpc/include/asm/ppc4xx.h | 16 ++++++++++++++++ 14 files changed, 119 insertions(+), 18 deletions(-) (limited to 'arch/powerpc/include/asm') diff --git a/arch/powerpc/include/asm/ppc405cr.h b/arch/powerpc/include/asm/ppc405cr.h index 176c427d058..01078f79214 100644 --- a/arch/powerpc/include/asm/ppc405cr.h +++ b/arch/powerpc/include/asm/ppc405cr.h @@ -24,7 +24,12 @@ #define CONFIG_SDRAM_PPC4xx_IBM_SDRAM /* IBM SDRAM controller */ /* Memory mapped register */ -#define GPIO0_BASE 0xef600700 +#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */ + +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700) /* DCR's */ #define DCP0_CFGADDR 0x0014 /* Decompression controller addr reg */ diff --git a/arch/powerpc/include/asm/ppc405ep.h b/arch/powerpc/include/asm/ppc405ep.h index e0b6a8586e5..96916040a23 100644 --- a/arch/powerpc/include/asm/ppc405ep.h +++ b/arch/powerpc/include/asm/ppc405ep.h @@ -24,7 +24,12 @@ #define CONFIG_SDRAM_PPC4xx_IBM_SDRAM /* IBM SDRAM controller */ /* Memory mapped register */ -#define GPIO0_BASE 0xef600700 +#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */ + +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700) /* DCR */ #define OCM0_ISCNTL 0x0019 /* OCM I-side control reg */ diff --git a/arch/powerpc/include/asm/ppc405ex.h b/arch/powerpc/include/asm/ppc405ex.h index 880d53a1617..36d3149b8c3 100644 --- a/arch/powerpc/include/asm/ppc405ex.h +++ b/arch/powerpc/include/asm/ppc405ex.h @@ -26,7 +26,12 @@ #define CONFIG_NAND_NDFC /* Memory mapped register */ -#define GPIO0_BASE 0xef600800 +#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */ + +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0800) /* SDR */ #define SDR0_SDCS0 0x0060 diff --git a/arch/powerpc/include/asm/ppc405ez.h b/arch/powerpc/include/asm/ppc405ez.h index 9192c628135..cb8e994b222 100644 --- a/arch/powerpc/include/asm/ppc405ez.h +++ b/arch/powerpc/include/asm/ppc405ez.h @@ -24,8 +24,13 @@ #define CONFIG_NAND_NDFC /* Memory mapped register */ -#define GPIO0_BASE 0xef600700 -#define GPIO1_BASE 0xef600800 +#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */ + +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700) +#define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0800) /* DCR register */ #define OCM0_PLBCR1 0x0020 /* OCM PLB3 Bank 1 Config */ diff --git a/arch/powerpc/include/asm/ppc405gp.h b/arch/powerpc/include/asm/ppc405gp.h index 79f930bda51..91beeb8d08c 100644 --- a/arch/powerpc/include/asm/ppc405gp.h +++ b/arch/powerpc/include/asm/ppc405gp.h @@ -24,7 +24,12 @@ #define CONFIG_SDRAM_PPC4xx_IBM_SDRAM /* IBM SDRAM controller */ /* Memory mapped register */ -#define GPIO0_BASE 0xef600700 +#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */ + +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700) /* DCR's */ #define DCP0_CFGADDR 0x0014 /* Decompression controller addr reg */ diff --git a/arch/powerpc/include/asm/ppc440ep_gr.h b/arch/powerpc/include/asm/ppc440ep_gr.h index 0fd40196335..dfd1532b0e7 100644 --- a/arch/powerpc/include/asm/ppc440ep_gr.h +++ b/arch/powerpc/include/asm/ppc440ep_gr.h @@ -28,9 +28,19 @@ /* * Some SoC specific registers (not common for all 440 SoC's) */ -#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x00000B00) -#define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x00000C00) +/* Memory mapped registers */ +#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */ + +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400) +#define CONFIG_SYS_NS16550_COM3 (CONFIG_SYS_PERIPHERAL_BASE + 0x0500) +#define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_PERIPHERAL_BASE + 0x0600) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0b00) +#define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0c00) + +/* SDR's */ #define SDR0_PCI0 0x0300 #define SDR0_SDSTP2 0x4001 #define SDR0_SDSTP3 0x4003 diff --git a/arch/powerpc/include/asm/ppc440epx_grx.h b/arch/powerpc/include/asm/ppc440epx_grx.h index e0d7e3f6c22..252f35bdc62 100644 --- a/arch/powerpc/include/asm/ppc440epx_grx.h +++ b/arch/powerpc/include/asm/ppc440epx_grx.h @@ -30,9 +30,15 @@ */ /* Memory mapped registers */ -#define SPI0_MODE 0xef600090 -#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x00000B00) -#define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x00000C00) +#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */ + +#define SPI0_MODE (CONFIG_SYS_PERIPHERAL_BASE + 0x0090) + +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0b00) +#define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0c00) /* DCR */ #define CPM0_ER 0x00b0 diff --git a/arch/powerpc/include/asm/ppc440gp.h b/arch/powerpc/include/asm/ppc440gp.h index 0c95e914615..3ebe2a12027 100644 --- a/arch/powerpc/include/asm/ppc440gp.h +++ b/arch/powerpc/include/asm/ppc440gp.h @@ -26,7 +26,14 @@ /* * Some SoC specific registers (not common for all 440 SoC's) */ -#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x00000700) + +/* Memory mapped register */ +#define CONFIG_SYS_PERIPHERAL_BASE 0xe0000000 /* Internal Peripherals */ + +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700) #define SDR0_PCI0 0x0300 diff --git a/arch/powerpc/include/asm/ppc440gx.h b/arch/powerpc/include/asm/ppc440gx.h index 157e46794cf..6f8581ba738 100644 --- a/arch/powerpc/include/asm/ppc440gx.h +++ b/arch/powerpc/include/asm/ppc440gx.h @@ -26,8 +26,16 @@ /* * Some SoC specific registers (not common for all 440 SoC's) */ -#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x00000700) +/* Memory mapped register */ +#define CONFIG_SYS_PERIPHERAL_BASE 0xe0000000 /* Internal Peripherals */ + +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700) + +/* SDR's */ #define SDR0_PCI0 0x0300 #define SDR0_SDSTP2 0x4001 diff --git a/arch/powerpc/include/asm/ppc440sp.h b/arch/powerpc/include/asm/ppc440sp.h index eb7e1d9e0e2..4387495cd73 100644 --- a/arch/powerpc/include/asm/ppc440sp.h +++ b/arch/powerpc/include/asm/ppc440sp.h @@ -26,8 +26,16 @@ /* * Some SoC specific registers (not common for all 440 SoC's) */ -#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x00000700) +/* Memory mapped register */ +#define CONFIG_SYS_PERIPHERAL_BASE 0xf0000000 /* Internal Peripherals */ + +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700) + +/* SDR's */ #define SDR0_PCI0 0x0300 #define SDR0_SDSTP2 0x0022 #define SDR0_SDSTP3 0x0023 diff --git a/arch/powerpc/include/asm/ppc440spe.h b/arch/powerpc/include/asm/ppc440spe.h index 05fe104db51..bad9a407313 100644 --- a/arch/powerpc/include/asm/ppc440spe.h +++ b/arch/powerpc/include/asm/ppc440spe.h @@ -27,8 +27,15 @@ * Some SoC specific registers (not common for all 440 SoC's) */ -#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x00000700) +/* Memory mapped register */ +#define CONFIG_SYS_PERIPHERAL_BASE 0xa0000000 /* Internal Peripherals */ +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700) + +/* SDR's */ #define SDR0_PCI0 0x0300 #define SDR0_SDSTP2 0x0022 #define SDR0_SDSTP3 0x0023 diff --git a/arch/powerpc/include/asm/ppc460ex_gt.h b/arch/powerpc/include/asm/ppc460ex_gt.h index 04c3fbe1df9..732fcacd6a3 100644 --- a/arch/powerpc/include/asm/ppc460ex_gt.h +++ b/arch/powerpc/include/asm/ppc460ex_gt.h @@ -29,8 +29,16 @@ * Some SoC specific registers */ -#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x00000B00) -#define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x00000C00) +/* Memory mapped registers */ +#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */ + +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400) +#define CONFIG_SYS_NS16550_COM3 (CONFIG_SYS_PERIPHERAL_BASE + 0x0500) +#define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_PERIPHERAL_BASE + 0x0600) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0b00) +#define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0c00) /* DCR */ #define AHB_TOP 0x00a4 diff --git a/arch/powerpc/include/asm/ppc460sx.h b/arch/powerpc/include/asm/ppc460sx.h index cb72e287776..f93ef0ea9a2 100644 --- a/arch/powerpc/include/asm/ppc460sx.h +++ b/arch/powerpc/include/asm/ppc460sx.h @@ -23,7 +23,13 @@ #define CONFIG_SDRAM_PPC4xx_IBM_DDR2 /* IBM DDR(2) controller */ -#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x00000700) +/* Memory mapped registers */ +#define CONFIG_SYS_PERIPHERAL_BASE 0xa0000000 /* Internal Peripherals */ + +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300) + +#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700) #define SDR0_SRST0_DMC 0x00200000 diff --git a/arch/powerpc/include/asm/ppc4xx.h b/arch/powerpc/include/asm/ppc4xx.h index 15be343a684..87a16ec986b 100644 --- a/arch/powerpc/include/asm/ppc4xx.h +++ b/arch/powerpc/include/asm/ppc4xx.h @@ -202,6 +202,22 @@ #define GPT0_DCT0 0x00000110 #define GPT0_DCIS 0x0000011C +#if 0 // test-only +/* + * All PPC4xx share the same NS16550 UART(s). Only base addresses + * may differ. We define here the integration of the common NS16550 + * driver for all PPC4xx SoC's. The board config header must specify + * on which UART the console should be located via CONFIG_CONS_INDEX. + */ +#if 0 /* test-only */ +#define CONFIG_SERIAL_MULTI +#endif +#define CONFIG_SYS_NS16550 +#define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_REG_SIZE 1 +#define CONFIG_SYS_NS16550_CLK get_serial_clock() +#endif + #if defined(CONFIG_440) #include #else -- cgit v1.2.3