Skip to content

Commit 602e19c

Browse files
committed
refactor(rt): rearrange chip specific features to cluster specific
The `arch` module are now gated under microarchitecture specific features, not SoC cluster features. Signed-off-by: Zhouqi Jiang <[email protected]>
1 parent 098f702 commit 602e19c

File tree

5 files changed

+21
-8
lines changed

5 files changed

+21
-8
lines changed

allwinner-rt/Cargo.toml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,19 @@ riscv-target-parser = "0.1.3"
3030

3131
[features]
3232
default = ["nezha", "panic-halt"]
33-
# D1-like chips: D1-H, D1s, F133.
34-
d1 = []
35-
v821 = []
33+
panic-halt = []
34+
35+
# SoC hart cluster specific features.
36+
# D1-like chips: D1-H, D1s, F133. Only one cluster per chip.
37+
d1 = ["thead-c906"]
38+
# V821 chip. There are both CPU cluster and MCU cluster.
39+
v821-cpu = ["andes-a27l2"]
40+
v821-mcu = [] # TODO thead-e907
41+
42+
# Microarchitecture specific features.
43+
andes-a27l2 = []
44+
thead-c906 = []
45+
thead-c907 = []
3646

3747
nezha = []
3848
lichee = []
39-
40-
panic-halt = []

allwinner-rt/src/arch/andes_a27l2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
///
33
/// TODO Andes start code.
44
#[cfg_attr(
5-
any(all(feature = "v821", target_arch = "riscv64"), doc),
5+
any(all(feature = "andes-a27l2", target_arch = "riscv64"), doc),
66
unsafe(link_section = ".text.entry")
77
)]
88
#[unsafe(naked)]

allwinner-rt/src/arch/thead_c906.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/// NOTE: `mxstatus` is a custom T-Head register. Do not confuse with `mstatus`.
88
/// It allows for configuring special eXtensions. See further below for details.
99
#[cfg_attr(
10-
any(all(feature = "d1", target_arch = "riscv64"), doc),
10+
any(all(feature = "thead-c906", target_arch = "riscv64"), doc),
1111
unsafe(link_section = ".text.entry")
1212
)]
1313
#[unsafe(naked)]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//! T-Head E907 microarchitecture support.
2+
3+
// TODO thead_e907_start
4+
// TODO thead_e907_halt

allwinner-rt/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub mod arch {
3434
pub mod riscv_fpu;
3535
pub mod thead_c906;
3636
pub mod thead_c907;
37+
pub mod thead_e907;
3738
}
3839

3940
pub mod soc {
@@ -55,7 +56,7 @@ cfg_if::cfg_if! {
5556
self::arch::thead_c906::{thead_c906_start as start, thead_c906_halt as halt},
5657
self::soc::d1::{__rom_init_params, Peripherals, Clocks},
5758
};
58-
} else if #[cfg(feature = "v821")] {
59+
} else if #[cfg(feature = "v821-cpu")] {
5960
pub use {
6061
self::arch::andes_a27l2::start,
6162
self::soc::v821::{__rom_init_params, Peripherals, Clocks},

0 commit comments

Comments
 (0)