Prepare for new riscv ecosystem

This commit is contained in:
Román Cárdenas Rodríguez 2024-10-23 18:50:12 +02:00 committed by Henrik Tjäder
parent bac77de9bc
commit 183e73904a
14 changed files with 164 additions and 134 deletions

View file

@ -167,8 +167,10 @@ pub enum Backends {
Thumbv8Base,
Thumbv8Main,
RiscvEsp32C3,
Riscv32ImcClint, // not working yet (issues with portable-atomic features...)
Riscv32ImcClint,
Riscv32ImcMecall,
Riscv32ImacClint,
Riscv32ImacMecall,
}
impl Backends {
@ -179,8 +181,10 @@ impl Backends {
Backends::Thumbv7 => ARMV7M,
Backends::Thumbv8Base => ARMV8MBASE,
Backends::Thumbv8Main => ARMV8MMAIN,
Backends::Riscv32ImcClint | Backends::RiscvEsp32C3 => RISCV32IMC,
Backends::Riscv32ImacClint => RISCV32IMAC,
Backends::Riscv32ImcClint | Backends::Riscv32ImcMecall | Backends::RiscvEsp32C3 => {
RISCV32IMC
}
Backends::Riscv32ImacClint | Backends::Riscv32ImacMecall => RISCV32IMAC,
}
}
@ -193,6 +197,7 @@ impl Backends {
Backends::Thumbv8Main => "thumbv8main-backend",
Backends::RiscvEsp32C3 => "riscv-esp32c3-backend",
Backends::Riscv32ImcClint | Backends::Riscv32ImacClint => "riscv-clint-backend",
Backends::Riscv32ImcMecall | Backends::Riscv32ImacMecall => "riscv-mecall-backend",
}
}
#[allow(clippy::wrong_self_convention)]
@ -202,6 +207,7 @@ impl Backends {
Backends::Thumbv7 | Backends::Thumbv8Main => "cortex-m-basepri",
Backends::RiscvEsp32C3 => "riscv-esp32c3",
Backends::Riscv32ImcClint | Backends::Riscv32ImacClint => "riscv-clint",
Backends::Riscv32ImcMecall | Backends::Riscv32ImacMecall => "riscv-mecall",
}
}
}
@ -246,7 +252,12 @@ impl Platforms {
let c = "-C".to_string();
match self {
Platforms::Esp32C3 => vec![c, "link-arg=-Tlinkall.x".to_string()],
Platforms::Hifive1 => vec![c, "link-arg=-Thifive1-link.x".to_string()],
Platforms::Hifive1 => vec![
c.clone(),
"link-arg=-Thifive1-link.x".to_string(),
c,
"portable_atomic_target_feature=\"zaamo\"".to_string(),
],
Platforms::Lm3s6965 => vec![c, "link-arg=-Tlink.x".to_string()],
Platforms::Nrf52840 => vec![
c.clone(),