1 /*
2 * Copyright (c) 2018 Synopsys, Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/arch/cpu.h>
8 #include <zephyr/devicetree.h>
9 #include <zephyr/init.h>
10
11
12 #ifdef CONFIG_UART_NS16550
13
soc_early_init_hook(void)14 void soc_early_init_hook(void)
15 {
16
17 /* On ARC EM Starter kit board,
18 * send the UART the command to clear the interrupt
19 */
20 #if DT_NODE_HAS_STATUS_OKAY(DT_INST(0, ns16550))
21 sys_write32(0, DT_REG_ADDR(DT_INST(0, ns16550))+0x4);
22 sys_write32(0, DT_REG_ADDR(DT_INST(0, ns16550))+0x10);
23 #endif /* DT_NODE_HAS_STATUS_OKAY(DT_INST(0, ns16550)) */
24 #if DT_NODE_HAS_STATUS_OKAY(DT_INST(1, ns16550))
25 sys_write32(0, DT_REG_ADDR(DT_INST(1, ns16550))+0x4);
26 sys_write32(0, DT_REG_ADDR(DT_INST(1, ns16550))+0x10);
27 #endif /* DT_NODE_HAS_STATUS_OKAY(DT_INST(1, ns16550)) */
28 }
29
30 #endif /* CONFIG_UART_NS16550 */
31