From 102b0d2daa97dae68d3eed54d8fe37a9cc38a892 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:13:47 +0200 Subject: Adding upstream version 2.8.0+dfsg. Signed-off-by: Daniel Baumann --- drivers/nxp/console/console_16550.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 drivers/nxp/console/console_16550.c (limited to 'drivers/nxp/console/console_16550.c') diff --git a/drivers/nxp/console/console_16550.c b/drivers/nxp/console/console_16550.c new file mode 100644 index 0000000..fa5c5bb --- /dev/null +++ b/drivers/nxp/console/console_16550.c @@ -0,0 +1,33 @@ +/* + * Copyright 2021 NXP + * + * SPDX-License-Identifier: BSD-3-Clause + * + */ + +#include + +#include +#include +#include +#include + +/* + * Perform Arm specific early platform setup. At this moment we only initialize + * the console and the memory layout. + */ +void plat_console_init(uintptr_t nxp_console_addr, uint32_t uart_clk_div, + uint32_t baud) +{ + struct sysinfo sys; + static console_t nxp_console; + + zeromem(&sys, sizeof(sys)); + if (get_clocks(&sys)) { + ERROR("System clocks are not set\n"); + panic(); + } + nxp_console_16550_register(nxp_console_addr, + (sys.freq_platform/uart_clk_div), + baud, &nxp_console); +} -- cgit v1.2.3