Ghennadi Procopciuc | a9fee05 | 2024-01-30 16:19:47 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2024 NXP |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <common/debug.h> |
| 8 | #include <linflex.h> |
| 9 | #include <plat_console.h> |
| 10 | #include <platform_def.h> |
| 11 | |
| 12 | void console_s32g2_register(void) |
| 13 | { |
Ghennadi Procopciuc | d3d6f54 | 2024-05-10 15:17:57 +0300 | [diff] [blame] | 14 | static console_t s32g2_console = { |
| 15 | .next = NULL, |
| 16 | .flags = 0u, |
| 17 | }; |
Ghennadi Procopciuc | a9fee05 | 2024-01-30 16:19:47 +0200 | [diff] [blame] | 18 | int ret; |
| 19 | |
Ghennadi Procopciuc | a9fee05 | 2024-01-30 16:19:47 +0200 | [diff] [blame] | 20 | ret = console_linflex_register(UART_BASE, UART_CLOCK_HZ, |
| 21 | UART_BAUDRATE, &s32g2_console); |
| 22 | if (ret == 0) { |
| 23 | panic(); |
| 24 | } |
| 25 | |
| 26 | console_set_scope(&s32g2_console, |
| 27 | CONSOLE_FLAG_BOOT | CONSOLE_FLAG_CRASH | |
| 28 | CONSOLE_FLAG_TRANSLATE_CRLF); |
| 29 | } |