| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #ifndef SOC_INTEL_COMMON_BLOCK_UART_H |
| 4 | #define SOC_INTEL_COMMON_BLOCK_UART_H |
| 5 | |
| 6 | #include <console/uart.h> |
| 7 | #include <device/device.h> |
| 8 | #include <stdint.h> |
| 9 | |
| 10 | /* |
| 11 | * While using this common UART block for any SOC following is expected from soc |
| 12 | * 1. SOC will define proper UART_BASE which is base address for UART console. |
| 13 | * 2. SOC will return correct device pointer based on console index |
| 14 | * 3. SOC will allow common code to set UART into legacy mode if supported. |
| 15 | */ |
| 16 | |
| 17 | bool uart_is_controller_initialized(void); |
| 18 | |
| 19 | /* |
| 20 | * Check if dev corresponds to UART debug port controller. |
| 21 | */ |
| 22 | bool uart_is_debug_controller(struct device *dev); |
| 23 | |
| 24 | /* |
| 25 | * BootBlock pre initialization of UART console |
| 26 | */ |
| 27 | void uart_bootblock_init(void); |
| 28 | |
| 29 | /* |
| 30 | * Get UART debug controller device structure |
| 31 | * |
| 32 | * Returns: |
| 33 | * Pointer to device structure = If device has a UART debug controller. |
| 34 | * NULL = otherwise |
| 35 | */ |
| 36 | const struct device *uart_get_device(void); |
| 37 | |
| 38 | #endif /* SOC_INTEL_COMMON_BLOCK_UART_H */ |