]>
Commit | Line | Data |
---|---|---|
4f50d9d6 YK |
1 | /* |
2 | * iotdk-setup.c -- provide _setup_low_level() to initialize UART. | |
3 | * | |
4 | * Copyright (c) 2024 Synopsys Inc. | |
5 | * | |
6 | * The authors hereby grant permission to use, copy, modify, distribute, | |
7 | * and license this software and its documentation for any purpose, provided | |
8 | * that existing copyright notices are retained in all copies and that this | |
9 | * notice is included verbatim in any distributions. No written agreement, | |
10 | * license, or royalty fee is required for any of the authorized uses. | |
11 | * Modifications to this software may be copyrighted by their authors | |
12 | * and need not follow the licensing terms described here, provided that | |
13 | * the new terms are clearly indicated on the first page of each file where | |
14 | * they apply. | |
15 | * | |
16 | */ | |
17 | ||
18 | #include "uart-8250.h" | |
19 | ||
20 | /* Setup UART parameters. */ | |
21 | int | |
22 | _setup_low_level (void) | |
23 | { | |
24 | void * const uart_base = (void *) 0x80014000; | |
25 | const uint32_t uart_clk_ena = 0xC0; | |
26 | const int uart_aux_mapped = 1; | |
27 | const uint32_t uart_clock = 16000000; | |
28 | const uint32_t uart_baud = 115200; | |
29 | ||
30 | /* For this platform we have to enable UART clock before configuring it. */ | |
31 | __builtin_arc_sr (0x01, (uint32_t) uart_base + uart_clk_ena); | |
32 | ||
33 | _uart_8250_setup (uart_base, uart_aux_mapped, uart_clock, uart_baud); | |
34 | ||
35 | return 0; | |
36 | } |