Skip to content

Commit 7486ce4

Browse files
authored
Merge pull request #1 from bullhh/axtest
适配 axstd 0.3.0,更新依赖与配置
2 parents bb9c798 + ac4b94d commit 7486ce4

File tree

14 files changed

+1436
-261
lines changed

14 files changed

+1436
-261
lines changed

.axconfig.toml

Lines changed: 68 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Architecture identifier.
2-
arch = "x86_64" # str
3-
# Platform Package.
4-
package = "axplat-x86-pc" # str
2+
arch = "riscv64" # str
3+
# Platform package.
4+
package = "axplat-riscv64-qemu-virt" # str
55
# Platform identifier.
6-
platform = "x86-pc" # str
6+
platform = "riscv64-qemu-virt" # str
77
# Stack size of each task.
88
task-stack-size = 0x40000 # uint
99
# Number of timer ticks per second (Hz). A timer tick may contain several timer
@@ -15,51 +15,92 @@ ticks-per-sec = 100 # uint
1515
#
1616
[devices]
1717
# IPI interrupt num
18-
ipi-irq = 0xf3 # uint
18+
ipi-irq = "0x8000_0000_0000_0001" # uint
1919
# MMIO ranges with format (`base_paddr`, `size`).
2020
mmio-ranges = [
21-
[0xb000_0000, 0x1000_0000],
22-
[0xfe00_0000, 0xc0_0000],
23-
[0xfec0_0000, 0x1000],
24-
[0xfed0_0000, 0x1000],
25-
[0xfee0_0000, 0x1000]
21+
[0x0010_1000, 0x1000],
22+
[0x0c00_0000, 0x21_0000],
23+
[0x1000_0000, 0x1000],
24+
[0x1000_1000, 0x8000],
25+
[0x3000_0000, 0x1000_0000],
26+
[0x4000_0000, 0x4000_0000]
2627
] # [(uint, uint)]
27-
# End PCI bus number.
28+
# End PCI bus number (`bus-range` property in device tree).
2829
pci-bus-end = 0xff # uint
29-
# Base physical address of the PCIe ECAM space (should read from ACPI 'MCFG' table).
30-
pci-ecam-base = 0xb000_0000 # uint
31-
# PCI device memory ranges (not used on x86).
32-
pci-ranges = [] # [(uint, uint)]
33-
# Timer interrupt frequency in Hz. (4.0GHz)
34-
timer-frequency = 4_000_000_000 # uint
30+
# Base physical address of the PCIe ECAM space.
31+
pci-ecam-base = 0x3000_0000 # uint
32+
# PCI device memory ranges (`ranges` property in device tree).
33+
pci-ranges = [
34+
[0x0300_0000, 0x1_0000],
35+
[0x4000_0000, 0x4000_0000],
36+
[0x4_0000_0000, 0x4_0000_0000]
37+
] # [(uint, uint)]
38+
# plic@c000000 {
39+
# phandle = <0x03>;
40+
# riscv,ndev = <0x5f>;
41+
# reg = <0x00 0xc000000 0x00 0x600000>;
42+
# interrupts-extended = <0x02 0x0b 0x02 0x09>;
43+
# interrupt-controller;
44+
# compatible = "sifive,plic-1.0.0\0riscv,plic0";
45+
# };
46+
plic-paddr = 0x0c00_0000 # uint
47+
# rtc@101000 {
48+
# interrupts = <0x0b>;
49+
# interrupt-parent = <0x03>;
50+
# reg = <0x00 0x101000 0x00 0x1000>;
51+
# compatible = "google,goldfish-rtc";
52+
# };
53+
# RTC (goldfish) Address
54+
rtc-paddr = 0x10_1000 # uint
55+
# Timer interrupt frequency in Hz.
56+
timer-frequency = 10_000_000 # uint
3557
# Timer interrupt num.
36-
timer-irq = 0xf0 # uint
58+
timer-irq = "0x8000_0000_0000_0005" # uint
59+
uart-irq = 0x0a # uint
60+
# serial@10000000 {
61+
# interrupts = <0x0a>;
62+
# interrupt-parent = <0x03>;
63+
# clock-frequency = "\08@";
64+
# reg = <0x00 0x10000000 0x00 0x100>;
65+
# compatible = "ns16550a";
66+
# };
67+
uart-paddr = 0x1000_0000 # uint
3768
# VirtIO MMIO ranges with format (`base_paddr`, `size`).
38-
virtio-mmio-ranges = [] # [(uint, uint)]
69+
virtio-mmio-ranges = [
70+
[0x1000_1000, 0x1000],
71+
[0x1000_2000, 0x1000],
72+
[0x1000_3000, 0x1000],
73+
[0x1000_4000, 0x1000],
74+
[0x1000_5000, 0x1000],
75+
[0x1000_6000, 0x1000],
76+
[0x1000_7000, 0x1000],
77+
[0x1000_8000, 0x1000]
78+
] # [(uint, uint)]
3979

4080
#
4181
# Platform configs
4282
#
4383
[plat]
4484
# Stack size on bootstrapping. (256K)
4585
boot-stack-size = 0x40000 # uint
46-
# Number of CPUs.
47-
cpu-num = 1 # uint
86+
# Maximum number of CPUs. For platforms that do not support runtime CPU number
87+
# detection, it's also the number of CPUs to boot.
88+
max-cpu-num = 1
4889
# Kernel address space base.
49-
kernel-aspace-base = "0xffff_8000_0000_0000" # uint
90+
kernel-aspace-base = "0xffff_ffc0_0000_0000" # uint
5091
# Kernel address space size.
51-
kernel-aspace-size = "0x0000_7fff_ffff_f000" # uint
92+
kernel-aspace-size = "0x0000_003f_ffff_f000" # uint
5293
# Base physical address of the kernel image.
53-
kernel-base-paddr = 0x20_0000 # uint
94+
kernel-base-paddr = 0x8020_0000 # uint
5495
# Base virtual address of the kernel image.
55-
kernel-base-vaddr = "0xffff_8000_0020_0000" # uint
96+
kernel-base-vaddr = "0xffff_ffc0_8020_0000" # uint
5697
# Offset of bus address and phys address. some boards, the bus address is
5798
# different from the physical address.
5899
phys-bus-offset = 0 # uint
59100
# Base address of the whole physical memory.
60-
phys-memory-base = 0 # uint
101+
phys-memory-base = 0x8000_0000 # uint
61102
# Size of the whole physical memory. (128M)
62103
phys-memory-size = 0x800_0000 # uint
63104
# Linear mapping offset, for quick conversions between physical and virtual
64105
# addresses.
65-
phys-virt-offset = "0xffff_8000_0000_0000" # uint
106+
phys-virt-offset = "0xffff_ffc0_0000_0000" # uint

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, dev, master]
6+
pull_request:
7+
branches: [main, dev, master]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
container: ghcr.io/chyyuu/tangram-crates
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Verify tools
19+
run: |
20+
echo "=== Checking Rust version ==="
21+
rustc --version --verbose
22+
echo ""
23+
echo "=== Checking QEMU version ==="
24+
qemu-system-riscv64 --version
25+
qemu-system-x86_64 --version
26+
qemu-system-aarch64 --version
27+
qemu-system-loongarch64 --version
28+
echo ""
29+
30+
- name: Run tests
31+
run: ./scripts/test.sh

0 commit comments

Comments
 (0)