1 /**
2 * @file UART_soc.h
3 *
4 * @brief UART SoC level driver
5 */
6 /*
7 * Copyright (c) 2015 - 2020, Texas Instruments Incorporated
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 *
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 *
17 * * Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 *
21 * * Neither the name of Texas Instruments Incorporated nor the names of
22 * its contributors may be used to endorse or promote products derived
23 * from this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
38 #ifndef ti_drivers_uart_UARTsoc__include
39 #define ti_drivers_uart_UARTsoc__include
41 #include <ti/drv/uart/UART.h>
42 #if defined(SOC_K2H) || defined(SOC_K2K) || defined(SOC_K2L) || defined(SOC_K2E) || defined(SOC_K2G) || defined(SOC_C6678) || defined(SOC_C6657) || defined(SOC_OMAPL137) || defined(SOC_OMAPL138) ||\
43 defined(DEVICE_K2H) || defined(DEVICE_K2K) || defined(DEVICE_K2L) || defined(DEVICE_K2E) || defined(DEVICE_K2G) || defined(DEVICE_C6678) || defined(DEVICE_C6657) || defined(DEVICE_OMAPL137) || defined(DEVICE_OMAPL138)
44 #include <ti/csl/src/ip/uart/V0/uart.h>
45 #include <ti/drv/uart/src/v0/UART_v0.h>
46 #elif defined(SOC_TPR12)
47 #include <ti/drv/uart/src/v3/uartsci_soc.h>
48 #else
49 #include <ti/csl/src/ip/uart/V1/uart.h>
50 #include <ti/drv/uart/src/v1/UART_v1.h>
51 #if defined(SOC_AM335x) || defined(SOC_AM335X)
52 #include <ti/drv/uart/src/v2/UART_v2.h>
53 #endif
54 #endif
55 #include <ti/osal/osal.h>
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
61 /* UART SoC level API */
62 #ifdef UART_DMA_ENABLE
63 extern void UART_getEdmaInfo(uint32_t idx, uint32_t *edma3Id, uint32_t *edma3Event);
64 #endif
66 /* UART SoC HW IP level API */
67 extern int32_t UART_socGetInitCfg(uint32_t idx, UART_HwAttrs *cfg);
68 extern int32_t UART_socSetInitCfg(uint32_t idx, const UART_HwAttrs *cfg);
70 /* UART SoC SW IP level API */
71 #if defined(SOC_AM335x) || defined(SOC_AM335X)
72 extern int32_t UART_socGetFwCfg(uint32_t index, UART_SWIPAttrs *cfg);
73 extern int32_t UART_socSetFwCfg(uint32_t index, const UART_SWIPAttrs *cfg);
74 extern void UART_socInitFwCfg(void);
75 #endif
77 #if defined(SOC_AM64X)
78 #define UART_MODULE_CLK_48M (48000000U)
79 #define UART_MODULE_CLK_96M (96000000U)
80 #define UART_MODULE_CLK_160M (160000000U)
81 #define UART_MODULE_CLOCK UART_MODULE_CLK_48M
82 #endif
84 #ifdef __cplusplus
85 }
86 #endif
88 #endif /* ti_drivers_UARTsoc__include */