1 /*
2  * Copyright (c) 2016, Freescale Semiconductor, Inc.
3  * Copyright 2016-2017 NXP
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #include <stdint.h>
10 #include "fsl_common.h"
11 #include "clock_config.h"
12 #include "board.h"
13 #include "fsl_debug_console.h"
14 
15 /*******************************************************************************
16  * Variables
17  ******************************************************************************/
18 
19 /* Clock rate on the CLKIN pin */
20 const uint32_t ExtClockIn = BOARD_EXTCLKINRATE;
21 
22 /*******************************************************************************
23  * Code
24  ******************************************************************************/
25 /* Initialize debug console. */
BOARD_InitDebugConsole(void)26 status_t BOARD_InitDebugConsole(void)
27 {
28 #if ((SDK_DEBUGCONSOLE == DEBUGCONSOLE_REDIRECT_TO_SDK) || defined(SDK_DEBUGCONSOLE_UART))
29     status_t result;
30     CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);
31     RESET_PeripheralReset(BOARD_DEBUG_UART_RST);
32     result = DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE,
33                              BOARD_DEBUG_UART_CLK_FREQ);
34     assert(kStatus_Success == result);
35     return result;
36 #else
37     return kStatus_Success;
38 #endif
39 }
40