diff options
author | Etienne Carriere <etienne.carriere@linaro.org> | 2019-01-08 10:02:08 +0100 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2019-01-11 16:02:38 +0100 |
commit | 107d5ec29332dbab4f776228db41a73104357243 (patch) | |
tree | 24fd3686a08d7941cdb21dba80b2139df0985daa /core/drivers | |
parent | c0cfb36c9054e09bdb4249aaea36d3a4c316c63f (diff) |
stm32_uart: rename exported structure and add secure flag
Rename structure console_pdata into stm32_uart_pdata as it will
be exported over the platform and should not use such a generic
naming.
This change adds a secure flag to the UART device instance for
used to get the appropriate virtual address when required.
An UART bus could be used by the secure world in secure mode or
in non-secure mode. A bus to a secure element likely mandates
secure hardening of the UART. A debug console over a non-secure
UART link may require the UART resources to be assigned to the
non-secure world.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Joakim Bech <joakim.bech@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Diffstat (limited to 'core/drivers')
-rw-r--r-- | core/drivers/stm32_uart.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/core/drivers/stm32_uart.c b/core/drivers/stm32_uart.c index 53d9c1e6..6fed9146 100644 --- a/core/drivers/stm32_uart.c +++ b/core/drivers/stm32_uart.c @@ -4,6 +4,7 @@ */ #include <compiler.h> +#include <console.h> #include <drivers/serial.h> #include <drivers/stm32_uart.h> #include <io.h> @@ -40,8 +41,9 @@ static vaddr_t loc_chip_to_base(struct serial_chip *chip) { - struct console_pdata *pd = - container_of(chip, struct console_pdata, chip); + struct stm32_uart_pdata *pd; + + pd = container_of(chip, struct stm32_uart_pdata, chip); return io_pa_or_va(&pd->base); } @@ -85,17 +87,17 @@ static int loc_getchar(struct serial_chip *chip) return read32(base + UART_REG_RDR) & 0xff; } -static const struct serial_ops serial_ops = { +static const struct serial_ops stm32_uart_serial_ops = { .flush = loc_flush, .putc = loc_putc, .have_rx_data = loc_have_rx_data, .getchar = loc_getchar, }; -KEEP_PAGER(serial_ops); +KEEP_PAGER(stm32_uart_serial_ops); -void stm32_uart_init(struct console_pdata *pd, vaddr_t base) +void stm32_uart_init(struct stm32_uart_pdata *pd, vaddr_t base) { pd->base.pa = base; - pd->chip.ops = &serial_ops; + pd->chip.ops = &stm32_uart_serial_ops; } |