diff options
author | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2017-04-20 10:53:38 +0100 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2017-04-20 10:01:53 +0000 |
commit | 10d135127b336914febd74a617fc2b25af9936be (patch) | |
tree | 7cf92a61354ee1c5ce0ee7f611f687872206194a /drivers | |
parent | 179312854c47a4c8e9fb2a94009eda15cb59262c (diff) |
AArch32: Fix PL011 driver functions
This patch fixes the bitmasks and condition codes used to check the
state of the PL011 Transmit & Receive FIFOs. The 'tst' instruction
performs a bitwise AND operation on the given register value and
immediate value. Therefore, in the case of the PL011 driver, we must
pass a bitmask, not a bit position. Also change the branch condition
code used thereafter.
Change-Id: I01f0b64e3cdd4b2eb7fd346da4e733a0ef5d50aa
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/arm/pl011/aarch32/pl011_console.S | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/arm/pl011/aarch32/pl011_console.S b/drivers/arm/pl011/aarch32/pl011_console.S index 5677f04..90124dc 100644 --- a/drivers/arm/pl011/aarch32/pl011_console.S +++ b/drivers/arm/pl011/aarch32/pl011_console.S @@ -158,15 +158,15 @@ func console_core_putc 1: /* Check if the transmit FIFO is full */ ldr r2, [r1, #UARTFR] - tst r2, #PL011_UARTFR_TXFF_BIT - beq 1b + tst r2, #PL011_UARTFR_TXFF + bne 1b mov r2, #0xD str r2, [r1, #UARTDR] 2: /* Check if the transmit FIFO is full */ ldr r2, [r1, #UARTFR] - tst r2, #PL011_UARTFR_TXFF_BIT - beq 2b + tst r2, #PL011_UARTFR_TXFF + bne 2b str r0, [r1, #UARTDR] bx lr putc_error: @@ -190,8 +190,8 @@ func console_getc 1: /* Check if the receive FIFO is empty */ ldr r1, [r0, #UARTFR] - tst r1, #PL011_UARTFR_RXFE_BIT - beq 1b + tst r1, #PL011_UARTFR_RXFE + bne 1b ldr r1, [r0, #UARTDR] mov r0, r1 bx lr |