Skip to content

Commit 9cde077

Browse files
Jacky Leekartben
authored andcommitted
soc: Add Egis et171
This is a SOC based on AE350. In addition to the core, some modifications have been made to the peripheral functions, including the integration of built-in USB. Signed-off-by: Jacky Lee <[email protected]>
1 parent 8760db3 commit 9cde077

18 files changed

+442
-0
lines changed

dts/bindings/vendor-prefixes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ eckelmann Eckelmann AG
201201
edt Emerging Display Technologies
202202
eeti eGalax_eMPIA Technology Inc
203203
efinix Efinix Inc
204+
egis Egis Technology Inc
204205
einfochips Einfochips
205206
elan Elan Microelectronic Corp.
206207
electronut Electronut Labs

dts/riscv/egis/egis_et171.dtsi

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
/*
2+
* Copyright (c) 2025 Egis Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <zephyr/dt-bindings/gpio/gpio.h>
9+
#include <mem.h>
10+
11+
/ {
12+
#address-cells = <1>;
13+
#size-cells = <1>;
14+
15+
cpus {
16+
#address-cells = <1>;
17+
#size-cells = <0>;
18+
19+
cpu0: cpu@0 {
20+
compatible = "andestech,andescore-v5", "riscv";
21+
device_type = "cpu";
22+
reg = <0>;
23+
riscv,isa = "rv32imafc_zicsr_zifencei";
24+
mmu-type = "riscv,sv32";
25+
i-cache-line-size = <32>;
26+
d-cache-line-size = <32>;
27+
28+
cpu0_intc: interrupt-controller {
29+
compatible = "riscv,cpu-intc";
30+
#address-cells = <0>;
31+
#interrupt-cells = <1>;
32+
interrupt-controller;
33+
};
34+
};
35+
};
36+
37+
sram: memory@0 {
38+
device_type = "memory";
39+
compatible = "mmio-sram";
40+
reg = <0x00000000 DT_SIZE_K(384)>;
41+
};
42+
43+
soc {
44+
#address-cells = <1>;
45+
#size-cells = <1>;
46+
compatible = "egis,et171";
47+
ranges;
48+
49+
plic0: interrupt-controller@e4000000 {
50+
compatible = "sifive,plic-1.0.0", "andestech,nceplic100";
51+
#address-cells = <1>;
52+
#interrupt-cells = <2>;
53+
interrupt-controller;
54+
reg = <0xe4000000 0x02000000>;
55+
riscv,max-priority = <255>;
56+
riscv,ndev = <1023>;
57+
interrupts-extended = <&cpu0_intc 11>;
58+
};
59+
60+
plic_sw: interrupt-controller@e6400000 {
61+
compatible = "sifive,plic-1.0.0", "andestech,nceplic100";
62+
#address-cells = <1>;
63+
#interrupt-cells = <2>;
64+
interrupt-controller;
65+
reg = <0xe6400000 0x00400000>;
66+
riscv,max-priority = <255>;
67+
riscv,ndev = <1023>;
68+
interrupts-extended = <&cpu0_intc 3>;
69+
};
70+
71+
mtimer: timer@e6000000 {
72+
compatible = "riscv,machine-timer";
73+
reg-names = "mtime", "mtimecmp";
74+
reg = <0xe6000000 0x8 0xe6000008 0x8>;
75+
interrupts-extended = <&cpu0_intc 7>;
76+
};
77+
78+
syscon: syscon@f0100000 {
79+
compatible = "syscon", "egis,et171-aosmu";
80+
reg = <0xf0100000 0x1000>;
81+
status = "disabled";
82+
};
83+
84+
uart0: serial@f0200020 {
85+
compatible = "ns16550";
86+
reg = <0xf0200020 0x1000>;
87+
reg-shift = <2>;
88+
interrupts = <20 1>;
89+
interrupt-parent = <&plic0>;
90+
status = "disabled";
91+
};
92+
93+
pit0: pit@f0400000 {
94+
compatible = "andestech,atcpit100";
95+
reg = <0xf0400000 0x1000>;
96+
interrupts = <22 1>;
97+
interrupt-parent = <&plic0>;
98+
clock-frequency = <60000000>;
99+
prescaler = <600>;
100+
status = "disabled";
101+
};
102+
103+
rtc0: rtc@f0600000 {
104+
compatible = "andestech,atcrtc100";
105+
reg = <0xf0600000 0x1000>;
106+
interrupts = <31 1>;
107+
interrupt-parent = <&plic0>;
108+
wakeup-source;
109+
status = "disabled";
110+
};
111+
112+
gpio0: gpio@f0700000 {
113+
compatible = "andestech,atcgpio100";
114+
reg = <0xf0700000 0x1000>;
115+
interrupts = <21 1>;
116+
interrupt-parent = <&plic0>;
117+
gpio-controller;
118+
ngpios = <17>;
119+
#gpio-cells = <2>;
120+
status = "disabled";
121+
};
122+
123+
i2c0: i2c@f0a00000 {
124+
compatible = "andestech,atciic100";
125+
reg = <0xf0a00000 0x1000>;
126+
interrupts = <19 1>;
127+
interrupt-parent = <&plic0>;
128+
#address-cells = <1>;
129+
#size-cells = <0>;
130+
status = "disabled";
131+
};
132+
133+
dma0: dma@f0c00000 {
134+
compatible = "andestech,atcdmacx00";
135+
reg = <0xf0c00000 0x1000>;
136+
interrupts = <16 1>;
137+
interrupt-parent = <&plic0>;
138+
dma-channels = <8>;
139+
dma-requests = <16>;
140+
chain-transfer = <1>;
141+
#dma-cells = <3>;
142+
status = "disabled";
143+
};
144+
145+
wdt: wdt@f0500000 {
146+
compatible = "andestech,atcwdt200";
147+
reg = <0xf0500000 0x1000>;
148+
interrupts = <20 1>;
149+
interrupt-parent = <&plic0>;
150+
status = "disabled";
151+
};
152+
};
153+
};

soc/egis/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 Egis Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(${SOC_NAME})

soc/egis/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2025 Egis Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_EGIS_ET171
5+
6+
rsource "*/Kconfig"
7+
8+
endif # SOC_EGIS_ET171

soc/egis/Kconfig.defconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2025 Egis Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_EGIS_ET171
5+
6+
rsource "*/Kconfig.defconfig"
7+
8+
endif # SOC_EGIS_ET171

soc/egis/Kconfig.soc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 Egis Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
rsource "*/Kconfig.soc"

soc/egis/et171/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_include_directories(.)
4+
5+
zephyr_sources(
6+
soc.c
7+
start.S
8+
)
9+
10+
zephyr_linker_sources(ROM_START SORT_KEY 0x0 common_linker/init.ld)
11+
zephyr_linker_sources_ifdef(CONFIG_XIP RAM_SECTIONS SORT_KEY 0x0 common_linker/ram_start_nonzero.ld)
12+
13+
set(SOC_LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld CACHE INTERNAL "")

soc/egis/et171/Kconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2025 Egis Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_EGIS_ET171
5+
imply XIP
6+
select RISCV
7+
select RISCV_PRIVILEGED
8+
select RISCV_HAS_PLIC
9+
select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING
10+
select RISCV_ISA_RV32I
11+
select RISCV_ISA_EXT_M
12+
select RISCV_ISA_EXT_A
13+
select RISCV_ISA_EXT_C
14+
select RISCV_ISA_EXT_ZICSR
15+
select RISCV_ISA_EXT_ZIFENCEI
16+
select ATOMIC_OPERATIONS_BUILTIN
17+
select INCLUDE_RESET_VECTOR
18+
select CPU_HAS_FPU
19+
select CPU_HAS_DCACHE
20+
select CPU_HAS_ICACHE
21+
select RISCV_PMP
22+
select HAS_FLASH_LOAD_OFFSET
23+
select SOC_EARLY_INIT_HOOK
24+
25+
config SOC_EGIS_ET171_FIRMWARE_VERSION
26+
hex "Firmware version"
27+
default 0xAAAAAAAA
28+
help
29+
Firmware version info of bin header

soc/egis/et171/Kconfig.defconfig

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright (c) 2025 Egis Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_EGIS_ET171
5+
6+
rsource "Kconfig.defconfig.et171"
7+
8+
config SYS_CLOCK_HW_CYCLES_PER_SEC
9+
default $(dt_node_int_prop_int,/clocks/clk_mtimer,clock-frequency)
10+
11+
config KERNEL_ENTRY
12+
default "entry"
13+
14+
config RISCV_GENERIC_TOOLCHAIN
15+
default y if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr"
16+
17+
config RISCV_SOC_INTERRUPT_INIT
18+
default y
19+
20+
config PMP_NO_NA4
21+
default y
22+
23+
config PMP_GRANULARITY
24+
default 8
25+
26+
config 2ND_LVL_ISR_TBL_OFFSET
27+
default 12
28+
29+
config 2ND_LVL_INTR_00_OFFSET
30+
default 11
31+
32+
config 2ND_LVL_INTR_01_OFFSET
33+
default 3
34+
35+
config MAX_IRQ_PER_AGGREGATOR
36+
default 52
37+
38+
config NUM_2ND_LEVEL_AGGREGATORS
39+
default 2
40+
41+
config NUM_IRQS
42+
default 116
43+
44+
choice CACHE_TYPE
45+
default EXTERNAL_CACHE
46+
endchoice
47+
48+
endif # SOC_EGIS_ET171
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2025 Egis Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_EGIS_ET171
5+
6+
config SYS_CLOCK_TICKS_PER_SEC
7+
default 100 if (!ICACHE || XIP)
8+
9+
config MAIN_STACK_SIZE
10+
default 2048
11+
12+
config IDLE_STACK_SIZE
13+
default 1536
14+
15+
config LINKER_USE_RELAX
16+
default n if XIP
17+
18+
endif # SOC_EGIS_ET171

0 commit comments

Comments
 (0)