From 10d135127b336914febd74a617fc2b25af9936be Mon Sep 17 00:00:00 2001 From: Sandrine Bailleux Date: Thu, 20 Apr 2017 10:53:38 +0100 Subject: 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 --- drivers/arm/pl011/aarch32/pl011_console.S | 12 ++++++------ 1 file 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 -- cgit v1.2.3