zephyr/soc/arc/snps_emsk/soc_config.c
Kumar Gala 24fb6da4f3 soc: arc: snps_emsk: fix typo bug in DT define
DT_INST_{0,1}_NS16650 should be DT_INST_{0,1}_NS16550.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-19 17:12:39 -04:00

35 lines
809 B
C

/*
* Copyright (c) 2018 Synopsys, Inc. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <device.h>
#include <init.h>
#include "soc.h"
#ifdef CONFIG_UART_NS16550
static int uart_ns16550_init(struct device *dev)
{
ARG_UNUSED(dev);
/* On ARC EM Starter kit board,
* send the UART the command to clear the interrupt
*/
#ifdef DT_INST_0_NS16550
sys_write32(0, DT_INST_0_NS16550_BASE_ADDRESS+0x4);
sys_write32(0, DT_INST_0_NS16550_BASE_ADDRESS+0x10);
#endif /* DT_INST_0_NS16550 */
#ifdef DT_INST_1_NS16550
sys_write32(0, DT_INST_1_NS16550_BASE_ADDRESS+0x4);
sys_write32(0, DT_INST_1_NS16550_BASE_ADDRESS+0x10);
#endif /* DT_INST_1_NS16550 */
return 0;
}
SYS_INIT(uart_ns16550_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_UART_NS16550 */