Skip to content

Commit 686726f

Browse files
committed
QEMU: qemu support booting 32bit linux 5.4 with opensbi
qemu source: atclnx01:/home/project/git_repo/toolchain/qemu.git qemu branch: andes-v5-v3.1.0 // important !!!!!! // opensbi MUST using this revision, otherwise the system will hang. opensbi revision: 15ed1e74526d85f94c2cda338c572e36e249c803 command: sudo qemu-system-riscv32 \ -smp 2 \ -machine 'andes_ae350'\ -nographic \ -m 1G \ -kernel /local/dylan/vcu118_32bit/bin/fw_payload.elf \ -netdev type=tap,id=net0 \ -device virtio-net-device,netdev=net0
1 parent 3964a81 commit 686726f

39 files changed

+11227
-0
lines changed

arch/riscv/Kconfig.socs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,11 @@ config SOC_SIFIVE
1010
help
1111
This enables support for SiFive SoC platform hardware.
1212

13+
config ANDES_QEMU_SUPPORT
14+
bool "Andes QEMU SUPPORT"
15+
depends on SOC_SIFIVE
16+
default n
17+
help
18+
Andes QEMU Support.
19+
1320
endmenu
Lines changed: 302 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
/dts-v1/;
2+
3+
/ {
4+
compatible = "andestech,ae350";
5+
#address-cells = <0x2>;
6+
#size-cells = <0x2>;
7+
dma-coherent;
8+
9+
cpus {
10+
#address-cells = <0x1>;
11+
#size-cells = <0x0>;
12+
timebase-frequency = <0x3938700>;
13+
14+
cpu@0 {
15+
device_type = "cpu";
16+
reg = <0x0>;
17+
status = "okay";
18+
compatible = "riscv";
19+
riscv,isa = "rv32i2p0m2p0a2p0c2p0xv5-0p0";
20+
riscv,priv-major = <0x1>;
21+
riscv,priv-minor = <0xa>;
22+
mmu-type = "riscv,sv32";
23+
clock-frequency = <0x3938700>;
24+
i-cache-size = <0x8000>;
25+
i-cache-line-size = <0x20>;
26+
d-cache-size = <0x8000>;
27+
d-cache-line-size = <0x20>;
28+
next-level-cache = <0x1>;
29+
30+
interrupt-controller {
31+
#interrupt-cells = <0x1>;
32+
interrupt-controller;
33+
compatible = "riscv,cpu-intc";
34+
phandle = <0x2>;
35+
};
36+
};
37+
};
38+
39+
l2-cache@e0500000 {
40+
compatible = "cache";
41+
cache-level = <0x2>;
42+
cache-size = <0x40000>;
43+
reg = <0x0 0xe0500000 0x0 0x40000>;
44+
andes,inst-prefetch = <0x3>;
45+
andes,data-prefetch = <0x3>;
46+
andes,tag-ram-ctl = <0x0 0x0>;
47+
andes,data-ram-ctl = <0x0 0x0>;
48+
phandle = <0x1>;
49+
};
50+
51+
memory@0 {
52+
device_type = "memory";
53+
reg = <0x0 0x0 0x0 0x40000000>;
54+
};
55+
56+
soc {
57+
#address-cells = <0x2>;
58+
#size-cells = <0x2>;
59+
compatible = "andestech,riscv-ae350-soc";
60+
ranges;
61+
62+
interrupt-controller@e4000000 {
63+
compatible = "riscv,plic0";
64+
#address-cells = <0x2>;
65+
#interrupt-cells = <0x2>;
66+
interrupt-controller;
67+
reg = <0x0 0xe4000000 0x0 0x2000000>;
68+
riscv,ndev = <0x47>;
69+
interrupts-extended = <0x2 0xb 0x2 0x9>;
70+
phandle = <0x3>;
71+
};
72+
73+
interrupt-controller@e6400000 {
74+
compatible = "riscv,plic1";
75+
#address-cells = <0x2>;
76+
#interrupt-cells = <0x2>;
77+
interrupt-controller;
78+
reg = <0x0 0xe6400000 0x0 0x400000>;
79+
riscv,ndev = <0x1>;
80+
interrupts-extended = <0x2 0x3>;
81+
};
82+
83+
plmt0@e6000000 {
84+
compatible = "riscv,plmt0";
85+
reg = <0x0 0xe6000000 0x0 0x100000>;
86+
interrupts-extended = <0x2 0x7>;
87+
};
88+
};
89+
90+
virt_100mhz {
91+
#clock-cells = <0x0>;
92+
compatible = "fixed-clock";
93+
clock-frequency = <0x5f5e100>;
94+
phandle = <0x4>;
95+
};
96+
97+
smu@f0100000 {
98+
compatible = "andestech,atcsmu";
99+
reg = <0x0 0xf0100000 0x0 0x1000>;
100+
};
101+
102+
wdt@f0500000 {
103+
compatible = "andestech,atcwdt200";
104+
interrupts = <0x0 0x4>;
105+
reg = <0x0 0xf0500000 0x0 0x1000>;
106+
clock-frequency = <0xe4e1c0>;
107+
interrupt-parent = <0x3>;
108+
};
109+
110+
timer@f0400000 {
111+
compatible = "andestech,atcpit100";
112+
reg = <0x0 0xf0400000 0x0 0x1000>;
113+
clock-frequency = <0x3938700>;
114+
interrupts = <0x3 0x4>;
115+
interrupt-parent = <0x3>;
116+
};
117+
118+
serial@f0300000 {
119+
compatible = "andestech,uart16550", "ns16550a";
120+
reg = <0x0 0xf0300000 0x0 0x1000>;
121+
interrupts = <0x9 0x4>;
122+
clock-frequency = <0x12c0000>;
123+
reg-shift = <0x2>;
124+
reg-offset = <0x20>;
125+
no-loopback-test = <0x1>;
126+
interrupt-parent = <0x3>;
127+
};
128+
129+
gpio@f0700000 {
130+
compatible = "andestech,atcgpio100";
131+
reg = <0x0 0xf0700000 0x0 0x1000>;
132+
interrupts = <0x7 0x4>;
133+
interrupt-parent = <0x3>;
134+
};
135+
136+
rtc@f0600000 {
137+
compatible = "andestech,atcrtc100";
138+
reg = <0x0 0xf0600000 0x0 0x1000>;
139+
interrupts = <0x1 0x4 0x2 0x4>;
140+
interrupt-parent = <0x3>;
141+
wakeup-source;
142+
};
143+
144+
mac@e0100000 {
145+
compatible = "andestech,atmac100";
146+
reg = <0x0 0xe0100000 0x0 0x1000>;
147+
interrupts = <0x13 0x4>;
148+
interrupt-parent = <0x3>;
149+
};
150+
151+
mmc@f0e00000 {
152+
compatible = "andestech,atfsdc010";
153+
max-frequency = <0x5f5e100>;
154+
clock-freq-min-max = <0x61a80 0x5f5e100>;
155+
fifo-depth = <0x10>;
156+
reg = <0x0 0xf0e00000 0x0 0x1000>;
157+
interrupts = <0x12 0x4>;
158+
cap-sd-highspeed;
159+
interrupt-parent = <0x3>;
160+
};
161+
162+
dma@f0c00000 {
163+
compatible = "andestech,atcdmac300";
164+
reg = <0x0 0xf0c00000 0x0 0x1000>;
165+
interrupts = <0xa 0x4 0x40 0x4 0x41 0x4 0x42 0x4 0x43 0x4 0x44 0x4 0x45 0x4 0x46 0x4 0x47 0x4>;
166+
dma-channels = <0x8>;
167+
interrupt-parent = <0x3>;
168+
};
169+
170+
lcd@e0200000 {
171+
compatible = "andestech,atflcdc100";
172+
reg = <0x0 0xe0200000 0x0 0x1000>;
173+
interrupts = <0x14 0x4>;
174+
interrupt-parent = <0x3>;
175+
};
176+
177+
smc@e0400000 {
178+
compatible = "andestech,atfsmc020";
179+
reg = <0x0 0xe0400000 0x0 0x1000>;
180+
};
181+
182+
snd@f0d00000 {
183+
compatible = "andestech,atfac97";
184+
reg = <0x0 0xf0d00000 0x0 0x1000>;
185+
interrupts = <0x11 0x4>;
186+
interrupt-parent = <0x3>;
187+
};
188+
189+
pmu {
190+
device_type = "pmu";
191+
compatible = "riscv,andes-pmu";
192+
};
193+
194+
virtio_mmio@fe007000 {
195+
interrupts = <0x17 0x4>;
196+
interrupt-parent = <0x3>;
197+
reg = <0x0 0xfe007000 0x0 0x1000>;
198+
compatible = "virtio,mmio";
199+
};
200+
201+
virtio_mmio@fe006000 {
202+
interrupts = <0x16 0x4>;
203+
interrupt-parent = <0x3>;
204+
reg = <0x0 0xfe006000 0x0 0x1000>;
205+
compatible = "virtio,mmio";
206+
};
207+
208+
virtio_mmio@fe005000 {
209+
interrupts = <0x15 0x4>;
210+
interrupt-parent = <0x3>;
211+
reg = <0x0 0xfe005000 0x0 0x1000>;
212+
compatible = "virtio,mmio";
213+
};
214+
215+
virtio_mmio@fe004000 {
216+
interrupts = <0x14 0x4>;
217+
interrupt-parent = <0x3>;
218+
reg = <0x0 0xfe004000 0x0 0x1000>;
219+
compatible = "virtio,mmio";
220+
};
221+
222+
virtio_mmio@fe003000 {
223+
interrupts = <0x13 0x4>;
224+
interrupt-parent = <0x3>;
225+
reg = <0x0 0xfe003000 0x0 0x1000>;
226+
compatible = "virtio,mmio";
227+
};
228+
229+
virtio_mmio@fe002000 {
230+
interrupts = <0x12 0x4>;
231+
interrupt-parent = <0x3>;
232+
reg = <0x0 0xfe002000 0x0 0x1000>;
233+
compatible = "virtio,mmio";
234+
};
235+
236+
virtio_mmio@fe001000 {
237+
interrupts = <0x11 0x4>;
238+
interrupt-parent = <0x3>;
239+
reg = <0x0 0xfe001000 0x0 0x1000>;
240+
compatible = "virtio,mmio";
241+
};
242+
243+
virtio_mmio@fe000000 {
244+
interrupts = <0x10 0x4>;
245+
interrupt-parent = <0x3>;
246+
reg = <0x0 0xfe000000 0x0 0x1000>;
247+
compatible = "virtio,mmio";
248+
};
249+
250+
nor@0,0 {
251+
compatible = "cfi-flash";
252+
reg = <0x0 0x88000000 0x0 0x1000>;
253+
bank-width = <0x2>;
254+
device-width = <0x1>;
255+
};
256+
257+
spi@f0b00000 {
258+
compatible = "andestech,atcspi200";
259+
reg = <0x0 0xf0b00000 0x0 0x1000>;
260+
#address-cells = <0x1>;
261+
#size-cells = <0x0>;
262+
num-cs = <0x1>;
263+
clocks = <0x4>;
264+
interrupts = <0x4 0x4>;
265+
interrupt-parent = <0x3>;
266+
267+
flash@0 {
268+
compatible = "spi-flash";
269+
spi-max-frequency = <0x2faf080>;
270+
reg = <0x0>;
271+
spi-cpol;
272+
spi-cpha;
273+
};
274+
};
275+
276+
pwm@f0400000 {
277+
compatible = "andestech,atcpit100-pwm";
278+
reg = <0x0 0xf0400000 0x0 0x1000>;
279+
clock-frequency = <0x3938700>;
280+
interrupts = <0x3 0x4>;
281+
interrupt-parent = <0x3>;
282+
pwm-cells = <0x2>;
283+
};
284+
285+
i2c@f0a00000 {
286+
compatible = "andestech,atciic100";
287+
reg = <0x0 0xf0a00000 0x0 0x1000>;
288+
interrupts = <0x6 0x4>;
289+
interrupt-parent = <0x3>;
290+
};
291+
292+
aliases {
293+
uart0 = "/serial@f0300000";
294+
spi0 = "/spi@f0b00000";
295+
i2c0 = "/i2c@f0a00000";
296+
};
297+
298+
chosen {
299+
bootargs = "console=ttyS0,38400n8 earlycon=sbi debug loglevel=7";
300+
stdout-path = "uart0:38400n8";
301+
};
302+
};

0 commit comments

Comments
 (0)