Ghennadi Procopciuc | 8b81a39 | 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> |
Ghennadi Procopciuc | a1e07b3 | 2024-11-26 16:32:26 +0200 | [diff] [blame^] | 8 | #include <lib/xlat_tables/xlat_tables_v2.h> |
Ghennadi Procopciuc | 8b81a39 | 2024-01-30 16:19:47 +0200 | [diff] [blame] | 9 | #include <linflex.h> |
| 10 | #include <plat_console.h> |
| 11 | #include <platform_def.h> |
| 12 | |
| 13 | void console_s32g2_register(void) |
| 14 | { |
Ghennadi Procopciuc | bf01296 | 2024-05-10 15:17:57 +0300 | [diff] [blame] | 15 | static console_t s32g2_console = { |
| 16 | .next = NULL, |
| 17 | .flags = 0u, |
| 18 | }; |
Ghennadi Procopciuc | 8b81a39 | 2024-01-30 16:19:47 +0200 | [diff] [blame] | 19 | int ret; |
| 20 | |
Ghennadi Procopciuc | a1e07b3 | 2024-11-26 16:32:26 +0200 | [diff] [blame^] | 21 | ret = mmap_add_dynamic_region(UART_BASE, UART_BASE, PAGE_SIZE, |
| 22 | MT_DEVICE | MT_RW | MT_SECURE); |
| 23 | if (ret != 0) { |
| 24 | panic(); |
| 25 | } |
| 26 | |
Ghennadi Procopciuc | 8b81a39 | 2024-01-30 16:19:47 +0200 | [diff] [blame] | 27 | ret = console_linflex_register(UART_BASE, UART_CLOCK_HZ, |
| 28 | UART_BAUDRATE, &s32g2_console); |
| 29 | if (ret == 0) { |
| 30 | panic(); |
| 31 | } |
| 32 | |
| 33 | console_set_scope(&s32g2_console, |
| 34 | CONSOLE_FLAG_BOOT | CONSOLE_FLAG_CRASH | |
| 35 | CONSOLE_FLAG_TRANSLATE_CRLF); |
| 36 | } |