blob: 27cae129e35ab894607c39b0eb4d9bd7c1b32a32 [file] [log] [blame]
Ghennadi Procopciuca9fee052024-01-30 16:19:47 +02001/*
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
12void console_s32g2_register(void)
13{
14 static console_t s32g2_console;
15 int ret;
16
17 (void)memset(&s32g2_console, 0, sizeof(s32g2_console));
18
19 ret = console_linflex_register(UART_BASE, UART_CLOCK_HZ,
20 UART_BAUDRATE, &s32g2_console);
21 if (ret == 0) {
22 panic();
23 }
24
25 console_set_scope(&s32g2_console,
26 CONSOLE_FLAG_BOOT | CONSOLE_FLAG_CRASH |
27 CONSOLE_FLAG_TRANSLATE_CRLF);
28}