2016-05-21 11:59:25 +08:00
|
|
|
/*
|
arch: arc: refactor the soc part of em_starterkit
The original em7d, em9d and em11d are different configurations of
em_starterkit. They have the same peripherals, e.g. uart, spi, gpio
, ddr. The differences of them are in arc core configurations, interrupt
number assignment.
So em7d, em9d and em11d can be viewed in the same SoC family or SoC
series.
Referring other arch's implementation, this commit merges em7d, em9d
and em11d into the same SoC, named snps_emsk. This will eliminate
unnecessary duplication and make it easier for future maintainment.
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2018-04-28 10:10:15 +08:00
|
|
|
* Copyright (c) 2018 Synopsys, Inc. All rights reserved.
|
2016-05-21 11:59:25 +08:00
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-05-21 11:59:25 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#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 CONFIG_UART_NS16550_PORT_0
|
2018-11-13 22:15:23 +08:00
|
|
|
sys_write32(0, DT_UART_NS16550_PORT_0_BASE_ADDR+0x4);
|
|
|
|
sys_write32(0, DT_UART_NS16550_PORT_0_BASE_ADDR+0x10);
|
2016-05-21 11:59:25 +08:00
|
|
|
#endif /* CONFIG_UART_NS16550_PORT_0 */
|
|
|
|
#ifdef CONFIG_UART_NS16550_PORT_1
|
2018-11-13 22:15:23 +08:00
|
|
|
sys_write32(0, DT_UART_NS16550_PORT_1_BASE_ADDR+0x4);
|
|
|
|
sys_write32(0, DT_UART_NS16550_PORT_1_BASE_ADDR+0x10);
|
2016-05-21 11:59:25 +08:00
|
|
|
#endif /* CONFIG_UART_NS16550_PORT_1 */
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-11-09 03:06:55 +08:00
|
|
|
SYS_INIT(uart_ns16550_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
2016-05-21 11:59:25 +08:00
|
|
|
|
|
|
|
#endif /* CONFIG_UART_NS16550 */
|