]> code.ossystems Code Review - bsp/u-boot.git/commit
arm: vf610: lpuart: fix status register handling
authorStefan Agner <stefan@agner.ch>
Tue, 19 Aug 2014 15:54:27 +0000 (17:54 +0200)
committerOtavio Salvador <otavio@ossystems.com.br>
Tue, 9 Sep 2014 15:30:37 +0000 (12:30 -0300)
commit11571b6cbbac8ab091412d39192ceadf00d37f2b
treef6b8982c97456b359139df9a38076f2be5785fb3
parent09e81f419b312f7de3f5a5e25fb15134688ec63b
arm: vf610: lpuart: fix status register handling

The status register 1 (S1) is not writeable, hence we should not
write it. In order to clear the RDRF flag we only need to read
the data register.

Also, when stressing U-Boot a lot with serial input, an overflow can
occur which asserts the S1_OR flag (while not asserting the S1_RDRF
flag). To clear this flag we again just need to read the data
register, hence add this flag to the abort conditions for the while
loop.

Insert a compiler barrier to make sure reading the data register
gets executed after reading the status register.

Signed-off-by: Stefan Agner <stefan@agner.ch>
drivers/serial/serial_lpuart.c