Commit 0c3a0b91 authored by danh-arm's avatar danh-arm
Browse files

Merge pull request #463 from jcastillo-arm/jc/tf-issues/216

De-feature PL011 UART driver to match generic UART spec
parents 7ee2b8b3 12f654b6
...@@ -97,6 +97,8 @@ COLD_BOOT_SINGLE_CPU := 0 ...@@ -97,6 +97,8 @@ COLD_BOOT_SINGLE_CPU := 0
# Flag to introduce an infinite loop in BL1 just before it exits into the next # Flag to introduce an infinite loop in BL1 just before it exits into the next
# image. This is meant to help debugging the post-BL2 phase. # image. This is meant to help debugging the post-BL2 phase.
SPIN_ON_BL1_EXIT := 0 SPIN_ON_BL1_EXIT := 0
# Build PL011 UART driver in minimal generic UART mode
PL011_GENERIC_UART := 0
################################################################################ ################################################################################
...@@ -371,6 +373,7 @@ $(eval $(call assert_boolean,PSCI_EXTENDED_STATE_ID)) ...@@ -371,6 +373,7 @@ $(eval $(call assert_boolean,PSCI_EXTENDED_STATE_ID))
$(eval $(call assert_boolean,ERROR_DEPRECATED)) $(eval $(call assert_boolean,ERROR_DEPRECATED))
$(eval $(call assert_boolean,ENABLE_PLAT_COMPAT)) $(eval $(call assert_boolean,ENABLE_PLAT_COMPAT))
$(eval $(call assert_boolean,SPIN_ON_BL1_EXIT)) $(eval $(call assert_boolean,SPIN_ON_BL1_EXIT))
$(eval $(call assert_boolean,PL011_GENERIC_UART))
################################################################################ ################################################################################
...@@ -399,6 +402,7 @@ $(eval $(call add_define,SPIN_ON_BL1_EXIT)) ...@@ -399,6 +402,7 @@ $(eval $(call add_define,SPIN_ON_BL1_EXIT))
ifdef EL3_PAYLOAD_BASE ifdef EL3_PAYLOAD_BASE
$(eval $(call add_define,EL3_PAYLOAD_BASE)) $(eval $(call add_define,EL3_PAYLOAD_BASE))
endif endif
$(eval $(call add_define,PL011_GENERIC_UART))
################################################################################ ################################################################################
......
...@@ -391,6 +391,12 @@ performed. ...@@ -391,6 +391,12 @@ performed.
payload. Please refer to the "Booting an EL3 payload" section for more payload. Please refer to the "Booting an EL3 payload" section for more
details. details.
* `PL011_GENERIC_UART`: Boolean option to indicate the PL011 driver that
the underlying hardware is not a full PL011 UART but a minimally compliant
generic UART, which is a subset of the PL011. The driver will not access
any register that is not part of the SBSA generic UART specification.
Default value is 0 (a full PL011 compliant UART is present).
#### ARM development platform specific build options #### ARM development platform specific build options
* `ARM_TSP_RAM_LOCATION`: location of the TSP binary. Options: * `ARM_TSP_RAM_LOCATION`: location of the TSP binary. Options:
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
func console_core_init func console_core_init
/* Check the input base address */ /* Check the input base address */
cbz x0, core_init_fail cbz x0, core_init_fail
#if !PL011_GENERIC_UART
/* Check baud rate and uart clock for sanity */ /* Check baud rate and uart clock for sanity */
cbz w1, core_init_fail cbz w1, core_init_fail
cbz w2, core_init_fail cbz w2, core_init_fail
...@@ -82,6 +83,7 @@ func console_core_init ...@@ -82,6 +83,7 @@ func console_core_init
/* Enable tx, rx, and uart overall */ /* Enable tx, rx, and uart overall */
mov w1, #(PL011_UARTCR_RXE | PL011_UARTCR_TXE | PL011_UARTCR_UARTEN) mov w1, #(PL011_UARTCR_RXE | PL011_UARTCR_TXE | PL011_UARTCR_UARTEN)
str w1, [x0, #UARTCR] str w1, [x0, #UARTCR]
#endif
mov w0, #1 mov w0, #1
ret ret
core_init_fail: core_init_fail:
......
...@@ -36,17 +36,21 @@ ...@@ -36,17 +36,21 @@
#define UARTRSR 0x004 #define UARTRSR 0x004
#define UARTECR 0x004 #define UARTECR 0x004
#define UARTFR 0x018 #define UARTFR 0x018
#define UARTIMSC 0x038
#define UARTRIS 0x03C
#define UARTICR 0x044
/* PL011 registers (out of the SBSA specification) */
#if !PL011_GENERIC_UART
#define UARTILPR 0x020 #define UARTILPR 0x020
#define UARTIBRD 0x024 #define UARTIBRD 0x024
#define UARTFBRD 0x028 #define UARTFBRD 0x028
#define UARTLCR_H 0x02C #define UARTLCR_H 0x02C
#define UARTCR 0x030 #define UARTCR 0x030
#define UARTIFLS 0x034 #define UARTIFLS 0x034
#define UARTIMSC 0x038
#define UARTRIS 0x03C
#define UARTMIS 0x040 #define UARTMIS 0x040
#define UARTICR 0x044
#define UARTDMACR 0x048 #define UARTDMACR 0x048
#endif /* !PL011_GENERIC_UART */
/* Data status bits */ /* Data status bits */
#define UART_DATA_ERROR_MASK 0x0F00 #define UART_DATA_ERROR_MASK 0x0F00
...@@ -69,6 +73,7 @@ ...@@ -69,6 +73,7 @@
#define PL011_UARTFR_RXFE_BIT 4 /* Receive FIFO empty bit in UARTFR register */ #define PL011_UARTFR_RXFE_BIT 4 /* Receive FIFO empty bit in UARTFR register */
/* Control reg bits */ /* Control reg bits */
#if !PL011_GENERIC_UART
#define PL011_UARTCR_CTSEN (1 << 15) /* CTS hardware flow control enable */ #define PL011_UARTCR_CTSEN (1 << 15) /* CTS hardware flow control enable */
#define PL011_UARTCR_RTSEN (1 << 14) /* RTS hardware flow control enable */ #define PL011_UARTCR_RTSEN (1 << 14) /* RTS hardware flow control enable */
#define PL011_UARTCR_RTS (1 << 11) /* Request to send */ #define PL011_UARTCR_RTS (1 << 11) /* Request to send */
...@@ -95,4 +100,6 @@ ...@@ -95,4 +100,6 @@
#define PL011_UARTLCR_H_PEN (1 << 1) /* Parity Enable */ #define PL011_UARTLCR_H_PEN (1 << 1) /* Parity Enable */
#define PL011_UARTLCR_H_BRK (1 << 0) /* Send break */ #define PL011_UARTLCR_H_BRK (1 << 0) /* Send break */
#endif /* !PL011_GENERIC_UART */
#endif /* __PL011_H__ */ #endif /* __PL011_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment