ppc4xx: Use common ns16550 functions in 4xx UART POST driver
PATCH 1/1 ppc4xx: Use common ns16550 functions in 4xx UART POST driver
This patch changes the PPC4xx POST UART driver to use the common NS16550 functions for receiving and sending. Additionally the local function for SoC divisor setup are removed. Instead the functions from arch/powerpc/cpu/ppc4xx/4xx_uart.c are used. This removes code duplication.
Also the common CONFIG_SYS_NS16550_COMx defines are now used to describe the POST UART's.
And a compile breakage is fixed, introduced by a git merge of the ppc4xx/next branch into master. Now "ppc4xx.h" is moved to "asm/ppc4xx.h". Fixed as well with this patch.
--- include/configs/hcu4.h | 2 +- include/configs/hcu5.h | 2 +- include/configs/kilauea.h | 3 +- include/configs/lwmon5.h | 3 +- include/configs/makalu.h | 3 +- include/configs/mcu25.h | 2 +- include/configs/zeus.h | 2 +- post/cpu/ppc4xx/uart.c | 302 ++++----------------------------------------- 8 files changed, 32 insertions(+), 287 deletions(-)
include/configs/hcu4.h +1 -1
@@ -191,7 +191,7 @@ CONFIG_SYS_POST_ETHER | \ CONFIG_SYS_POST_SPR) -#define CONFIG_SYS_POST_UART_TABLE {UART0_BASE} +#define CONFIG_SYS_POST_UART_TABLE { CONFIG_SYS_NS16550_COM1 }#undef CONFIG_LOGBUFFER#define CONFIG_SYS_POST_CACHE_ADDR 0x00800000/* free virtual address */ #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */
include/configs/hcu5.h +1 -1
@@ -208,7 +208,7 @@ CONFIG_SYS_POST_ETHER | \ CONFIG_SYS_POST_SPR) -#define CONFIG_SYS_POST_UART_TABLE {UART0_BASE} +#define CONFIG_SYS_POST_UART_TABLE { CONFIG_SYS_NS16550_COM1 }#define CONFIG_SYS_POST_CACHE_ADDR 0x7fff0000/* free virtual address */ #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */
include/configs/kilauea.h +2 -1
@@ -457,7 +457,8 @@ CONFIG_SYS_POST_UART)/* Define here the base-addresses of the UARTs to test in POST */ -#define CONFIG_SYS_POST_UART_TABLE {UART0_BASE, UART1_BASE} +#define CONFIG_SYS_POST_UART_TABLE { CONFIG_SYS_NS16550_COM1, \ + CONFIG_SYS_NS16550_COM2 }#define CONFIG_LOGBUFFER #define CONFIG_SYS_POST_CACHE_ADDR 0x00800000/* free virtual address */
include/configs/lwmon5.h +2 -1
@@ -185,7 +185,8 @@ CONFIG_SYS_POST_BSPEC5)/* Define here the base-addresses of the UARTs to test in POST */ -#define CONFIG_SYS_POST_UART_TABLE { UART0_BASE, UART1_BASE } +#define CONFIG_SYS_POST_UART_TABLE { CONFIG_SYS_NS16550_COM1, \ + CONFIG_SYS_NS16550_COM2 }#define CONFIG_POST_WATCHDOG { \ "Watchdog timer test", \
include/configs/makalu.h +2 -1
@@ -264,7 +264,8 @@ CONFIG_SYS_POST_UART)/* Define here the base-addresses of the UARTs to test in POST */ -#define CONFIG_SYS_POST_UART_TABLE {UART0_BASE, UART1_BASE} +#define CONFIG_SYS_POST_UART_TABLE { CONFIG_SYS_NS16550_COM1, \ + CONFIG_SYS_NS16550_COM2 }#define CONFIG_LOGBUFFER #define CONFIG_SYS_POST_CACHE_ADDR 0x00800000/* free virtual address */
include/configs/mcu25.h +1 -1
@@ -192,7 +192,7 @@ CONFIG_SYS_POST_ETHER | \ CONFIG_SYS_POST_SPR) -#define CONFIG_SYS_POST_UART_TABLE {UART0_BASE} +#define CONFIG_SYS_POST_UART_TABLE { CONFIG_SYS_NS16550_COM1 }#undef CONFIG_LOGBUFFER#define CONFIG_SYS_POST_CACHE_ADDR 0x00800000/* free virtual address */ #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */
include/configs/zeus.h +1 -1
@@ -94,7 +94,7 @@#define CONFIG_SYS_POST_ETHER_EXT_LOOPBACK /* eth POST using ext loopack connector */ /* Define here the base-addresses of the UARTs to test in POST */ -#define CONFIG_SYS_POST_UART_TABLE {UART0_BASE} +#define CONFIG_SYS_POST_UART_TABLE { CONFIG_SYS_NS16550_COM1 }#define CONFIG_LOGBUFFER #define CONFIG_SYS_POST_CACHE_ADDR 0x00800000/* free virtual address */
post/cpu/ppc4xx/uart.c +22 -280
330 lines not on this page · raw message
Signature · 1 line
1.7.3
PATCH 1/1 ppc4xx: Use common ns16550 functions in 4xx UART POST driver
Quoted 6 lines · On Wednesday 29 September 2010 17:23:03 Stefan Roese wrote:
This patch changes the PPC4xx POST UART driver to use the common NS16550 functions for receiving and sending. Additionally the local function for SoC divisor setup are removed. Instead the functions from
arch/powerpc/cpu/ppc4xx/4xx_uart.care used. This removes code duplication.
Quoted 6 lines
Also the common
CONFIG_SYS_NS16550_COMxdefines are now used to describe the POST UART's.And a compile breakage is fixed, introduced by a git merge of the ppc4xx/next branch into master. Now "
ppc4xx.h" is moved to "asm/ppc4xx.h". Fixed as well with this patch.
Applied to u-boot-ppc4xx/master. Thanks.
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de