Pankaj Gupta | 6b36c1b | 2020-12-09 14:02:38 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2021 NXP |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include <assert.h> |
| 9 | |
| 10 | #include <common/debug.h> |
| 11 | #include <dcfg.h> |
| 12 | #include <lib/utils.h> |
| 13 | #include <plat_console.h> |
| 14 | |
| 15 | /* |
| 16 | * Perform Arm specific early platform setup. At this moment we only initialize |
| 17 | * the console and the memory layout. |
| 18 | */ |
| 19 | void plat_console_init(uintptr_t nxp_console_addr, uint32_t uart_clk_div, |
| 20 | uint32_t baud) |
| 21 | { |
| 22 | struct sysinfo sys; |
| 23 | static console_t nxp_console; |
| 24 | |
| 25 | zeromem(&sys, sizeof(sys)); |
| 26 | if (get_clocks(&sys)) { |
| 27 | ERROR("System clocks are not set\n"); |
| 28 | panic(); |
| 29 | } |
| 30 | nxp_console_16550_register(nxp_console_addr, |
| 31 | (sys.freq_platform/uart_clk_div), |
| 32 | baud, &nxp_console); |
| 33 | } |