ppc4xx: POST UART: Use in/out_8() io-accessor functions
PATCH 1/1 ppc4xx: POST UART: Use in/out_8() io-accessor functions
This patch fixes a problem in the PPC4xx POST UART driver. This driver incorrectly used the in/out8() io-accessor functions. This could lead to problems since these functions don't guarantee execution ordering. This patch now replaces these functions with the correct ones.
Additionally the driver is converted to using the NS16550 struct instead of macros for the register offsets.
And some common code is factored out for better maintainability.
--- include/ppc4xx.h | 10 +++++ post/cpu/ppc4xx/uart.c | 105 +++++++++++++++++++----------------------------- 2 files changed, 51 insertions(+), 64 deletions(-)
include/ppc4xx.h +10 -0
@@ -99,6 +99,16 @@#endif /* 440EP/EPX 440GR/GRX 440SP/SPE 460EX/GT/SX 405EX*/ +/* +* Define ns16550 register offset for all PPC4xx SoC's. Some +* mostly FPGA based PPC4xx implementations use a different +* offset. So let's give them a chance to define their offset +* in the board config header. +*/ +#if !defined(CONFIG_SYS_NS16550_REG_SIZE ) +#define CONFIG_SYS_NS16550_REG_SIZE 1 +#endif +#if defined(CONFIG_440 )#include <ppc440.h> #else
post/cpu/ppc4xx/uart.c +41 -64
205 lines not on this page · raw message
Signature · 1 line
1.7.2.3
PATCH 1/1 ppc4xx: POST UART: Use in/out_8() io-accessor functions
Quoted 9 lines · On Tuesday 14 September 2010 10:42:33 Stefan Roese wrote:
This patch fixes a problem in the PPC4xx POST UART driver. This driver incorrectly used the in/out8() io-accessor functions. This could lead to problems since these functions don't guarantee execution ordering. This patch now replaces these functions with the correct ones.
Additionally the driver is converted to using the NS16550 struct instead of macros for the register offsets.
And some common code is factored out for better maintainability.
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