From ac71344e9eca1f7d1e0ce4a67aca776470639b1c Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Sat, 25 Jan 2020 00:54:38 +0000 Subject: console: Integrate UART base address in generic console_t *All* UART drivers in TF-A are storing their base address as a uintptr_t pointer in the first location of the UART specific driver data. Since the base address is a pretty natural and generic data item, we should integrate this into the generic console_t structure. That will not only allow to remove a lot of seemingly UART specific data structures, but also enables to simplify runtime choices between different UARTs, since they can share the same pointer. This patch just adds the new member, the existing data structures will be handled on a per-UART base in follow-up patches. Change-Id: I59ce49471ccc8f3b870f2cfd8a72ebfd0cb14d12 Signed-off-by: Andre Przywara --- include/drivers/console.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/drivers/console.h') diff --git a/include/drivers/console.h b/include/drivers/console.h index a4859d80f..761816ac7 100644 --- a/include/drivers/console.h +++ b/include/drivers/console.h @@ -14,7 +14,8 @@ #define CONSOLE_T_PUTC (U(2) * REGSZ) #define CONSOLE_T_GETC (U(3) * REGSZ) #define CONSOLE_T_FLUSH (U(4) * REGSZ) -#define CONSOLE_T_DRVDATA (U(5) * REGSZ) +#define CONSOLE_T_BASE (U(5) * REGSZ) +#define CONSOLE_T_DRVDATA (U(6) * REGSZ) #define CONSOLE_FLAG_BOOT (U(1) << 0) #define CONSOLE_FLAG_RUNTIME (U(1) << 1) @@ -43,6 +44,7 @@ typedef struct console { int (*const putc)(int character, struct console *console); int (*const getc)(struct console *console); int (*const flush)(struct console *console); + uintptr_t base; /* Additional private driver data may follow here. */ } console_t; -- cgit v1.2.3 From 831b0e9824e6c7cb07308830c12977acb79156c7 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Wed, 5 Aug 2020 13:44:05 -0500 Subject: Don't return error information from console_flush And from crash_console_flush. We ignore the error information return by console_flush in _every_ place where we call it, and casting the return type to void does not work around the MISRA violation that this causes. Instead, we collect the error information from the driver (to avoid changing that API), and don't return it to the caller. Change-Id: I1e35afe01764d5c8f0efd04f8949d333ffb688c1 Signed-off-by: Jimmy Brisson --- include/drivers/console.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/drivers/console.h') diff --git a/include/drivers/console.h b/include/drivers/console.h index 761816ac7..99bf96041 100644 --- a/include/drivers/console.h +++ b/include/drivers/console.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -43,7 +43,7 @@ typedef struct console { u_register_t flags; int (*const putc)(int character, struct console *console); int (*const getc)(struct console *console); - int (*const flush)(struct console *console); + void (*const flush)(struct console *console); uintptr_t base; /* Additional private driver data may follow here. */ } console_t; @@ -76,7 +76,7 @@ int console_putc(int c); /* Read a character (blocking) from any console registered for current state. */ int console_getc(void); /* Flush all consoles registered for the current state. */ -int console_flush(void); +void console_flush(void); #endif /* __ASSEMBLER__ */ -- cgit v1.2.3