Skip to content

Commit c8c77ac

Browse files
authored
feat: Added driver support for two platform devices. (#259)
* feat: Added driver support for two platform devices. * fix: fix ci issues
1 parent 3f6b2fd commit c8c77ac

File tree

9 files changed

+403
-41
lines changed

9 files changed

+403
-41
lines changed

Cargo.lock

Lines changed: 266 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ ept-level-4 = ["axaddrspace/4-level-ept"]
1414
fs = ["axstd/fs"]
1515

1616
plat-aarch64-generic = ["axplat-aarch64-generic", "axstd/driver-dyn"]
17+
plat-aarch64-phytium-pi = ["axplat-aarch64-phytium-pi", "axstd/driver-dyn"]
18+
plat-aarch64-roc-rk3568-pc = ["axplat-aarch64-roc-rk3568-pc", "axstd/driver-dyn"]
1719
plat-x86-qemu-q35 = ["axplat-x86-qemu-q35"]
1820

1921
[dependencies]
@@ -28,7 +30,7 @@ spin = "0.9"
2830
timer_list = "0.1.0"
2931

3032
# System dependent modules provided by ArceOS.
31-
axstd = {git = "https://github.com/arceos-hypervisor/arceos.git", tag = "hv-0.3.0", features = [
33+
axstd = {git = "https://github.com/arceos-hypervisor/arceos.git", tag = "hv-0.3.1", features = [
3234
"alloc-level-1",
3335
"paging",
3436
"irq",
@@ -64,6 +66,8 @@ axvisor_api = "0.1"
6466
# platform
6567
axplat-aarch64-generic = {path = "platform/aarch64-generic", optional = true}
6668
axplat-x86-qemu-q35 = {path = "platform/x86-qemu-q35", optional = true}
69+
axplat-aarch64-phytium-pi = {path = "platform/aarch64-phytium-pi", optional = true}
70+
axplat-aarch64-roc-rk3568-pc = {path = "platform/aarch64-roc-rk3568-pc", optional = true}
6771

6872
[target.'cfg(target_arch = "aarch64")'.dependencies]
6973
aarch64-cpu-ext = "0.1"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
edition = "2024"
3+
name = "axplat-aarch64-phytium-pi"
4+
version = "0.1.0"
5+
6+
[dependencies]
7+
axbsp-phytium-pi = {git = "https://github.com/drivercraft/axbsp.git", features = ["irq", "smp", "hv"]}
8+
9+
[build-dependencies]
10+
serde = {version = "1.0", features = ["derive"]}
11+
toml = "0.8"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Architecture identifier.
2+
arch = "aarch64" # str
3+
# Platform package.
4+
package = "axplat-aarch64-phytium-pi" # str
5+
# Platform identifier.
6+
platform = "aarch64-phytium-pi" # str
7+
8+
#
9+
# Device specifications
10+
#
11+
[devices]
12+
# MMIO regions with format (`base_paddr`, `size`).
13+
mmio-regions = [] # [(uint, uint)]
14+
# End PCI bus number.
15+
pci-bus-end = 0 # uint
16+
# Base physical address of the PCIe ECAM space.
17+
pci-ecam-base = 0 # uint
18+
# PCI device memory ranges.
19+
pci-ranges = [] # [(uint, uint)]
20+
# Timer interrupt num (PPI, physical timer).
21+
timer-irq = 26 # uint
22+
# VirtIO MMIO regions with format (`base_paddr`, `size`).
23+
virtio-mmio-regions = [] # [(uint, uint)]
24+
25+
#
26+
# Platform configs
27+
#
28+
[plat]
29+
# Platform family (deprecated).
30+
family = "" # str
31+
# Number of CPUs.
32+
cpu-num = 1 # uint
33+
# No need.
34+
phys-memory-base = 0 # uint
35+
# No need.
36+
phys-memory-size = 0x0 # uint
37+
# No need.
38+
kernel-base-paddr = 0x0 # uint
39+
# Base virtual address of the kernel image.
40+
kernel-base-vaddr = "0x8000_0000_0000" # uint
41+
# No need.
42+
phys-virt-offset = "0" # uint
43+
# Offset of bus address and phys address. some boards, the bus address is
44+
# different from the physical address.
45+
phys-bus-offset = 0 # uint
46+
# Kernel address space base.
47+
kernel-aspace-base = "0x0000_0000_0000" # uint
48+
# Kernel address space size.
49+
kernel-aspace-size = "0xffff_ffff_f000" # uint
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#![no_std]
2+
#![cfg(target_arch = "aarch64")]
3+
4+
extern crate axbsp_phytium_pi;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
edition = "2024"
3+
name = "axplat-aarch64-roc-rk3568-pc"
4+
version = "0.1.0"
5+
6+
[dependencies]
7+
axbsp-roc-rk3568-pc = {git = "https://github.com/drivercraft/axbsp.git", features = ["irq", "smp", "hv"]}
8+
9+
[build-dependencies]
10+
serde = {version = "1.0", features = ["derive"]}
11+
toml = "0.8"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Architecture identifier.
2+
arch = "aarch64" # str
3+
# Platform package.
4+
package = "axplat-aarch64-roc-rk3568-pc" # str
5+
# Platform identifier.
6+
platform = "aarch64-roc-rk3568-pc" # str
7+
8+
#
9+
# Device specifications
10+
#
11+
[devices]
12+
# MMIO regions with format (`base_paddr`, `size`).
13+
mmio-regions = [] # [(uint, uint)]
14+
# End PCI bus number.
15+
pci-bus-end = 0 # uint
16+
# Base physical address of the PCIe ECAM space.
17+
pci-ecam-base = 0 # uint
18+
# PCI device memory ranges.
19+
pci-ranges = [] # [(uint, uint)]
20+
# Timer interrupt num (PPI, physical timer).
21+
timer-irq = 26 # uint
22+
# VirtIO MMIO regions with format (`base_paddr`, `size`).
23+
virtio-mmio-regions = [] # [(uint, uint)]
24+
25+
#
26+
# Platform configs
27+
#
28+
[plat]
29+
# Platform family (deprecated).
30+
family = "" # str
31+
# Number of CPUs.
32+
cpu-num = 1 # uint
33+
# No need.
34+
phys-memory-base = 0 # uint
35+
# No need.
36+
phys-memory-size = 0x0 # uint
37+
# No need.
38+
kernel-base-paddr = 0x0 # uint
39+
# Base virtual address of the kernel image.
40+
kernel-base-vaddr = "0x8000_0000_0000" # uint
41+
# No need.
42+
phys-virt-offset = "0" # uint
43+
# Offset of bus address and phys address. some boards, the bus address is
44+
# different from the physical address.
45+
phys-bus-offset = 0 # uint
46+
# Kernel address space base.
47+
kernel-aspace-base = "0x0000_0000_0000" # uint
48+
# Kernel address space size.
49+
kernel-aspace-size = "0xffff_ffff_f000" # uint
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#![no_std]
2+
#![cfg(target_arch = "aarch64")]
3+
4+
extern crate axbsp_roc_rk3568_pc;

src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ extern crate axstd as std;
1010

1111
#[cfg(feature = "plat-aarch64-generic")]
1212
extern crate axplat_aarch64_generic;
13+
#[cfg(feature = "plat-aarch64-phytium-pi")]
14+
extern crate axplat_aarch64_phytium_pi;
15+
#[cfg(feature = "plat-aarch64-roc-rk3568-pc")]
16+
extern crate axplat_aarch64_roc_rk3568_pc;
1317
#[cfg(feature = "plat-x86-qemu-q35")]
1418
extern crate axplat_x86_qemu_q35;
1519

0 commit comments

Comments
 (0)