From 500472b2a8404f9dc2c2c9f23578cf5194db80ce Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 19 Nov 2020 19:41:38 +0100 Subject: [PATCH] add feature target_kasli_soc to libsupport_zynq, libconfig, experiments, szl, default.nix --- default.nix | 2 +- experiments/Cargo.toml | 1 + experiments/src/main.rs | 25 +++++++------------------ libconfig/Cargo.toml | 1 + libconfig/src/net_settings.rs | 4 ++++ libsupport_zynq/Cargo.toml | 1 + szl/Cargo.toml | 1 + 7 files changed, 16 insertions(+), 19 deletions(-) diff --git a/default.nix b/default.nix index 104739c..b677239 100644 --- a/default.nix +++ b/default.nix @@ -36,7 +36,7 @@ let "${target}-experiments" = build-crate "${target}-experiments" "experiments" "target_${target}" cargoSha256Experiments; "${target}-szl" = build-crate "${target}-szl" "szl" "target_${target}" cargoSha256SZL; }; - targets = ["zc706" "coraz7" "redpitaya"]; + targets = ["zc706" "coraz7" "redpitaya" "kasli_soc"]; in { inherit cargo-xbuild; diff --git a/experiments/Cargo.toml b/experiments/Cargo.toml index 90c242b..afa0a64 100644 --- a/experiments/Cargo.toml +++ b/experiments/Cargo.toml @@ -9,6 +9,7 @@ edition = "2018" target_zc706 = ["libboard_zynq/target_zc706", "libsupport_zynq/target_zc706"] target_coraz7 = ["libboard_zynq/target_coraz7", "libsupport_zynq/target_coraz7"] target_redpitaya = ["libboard_zynq/target_redpitaya", "libsupport_zynq/target_redpitaya"] +target_kasli_soc = ["libboard_zynq/target_kasli_soc", "libsupport_zynq/target_kasli_soc"] default = ["target_zc706"] [dependencies] diff --git a/experiments/src/main.rs b/experiments/src/main.rs index 47f4753..f6513d0 100644 --- a/experiments/src/main.rs +++ b/experiments/src/main.rs @@ -105,31 +105,20 @@ pub fn main_core0() { .boot_mode_pins() ); - #[cfg(feature = "target_zc706")] + #[cfg(any( + feature = "target_zc706", + feature = "target_redpitaya", + feature = "target_kasli_soc", + ))] const CPU_FREQ: u32 = 800_000_000; #[cfg(feature = "target_coraz7")] const CPU_FREQ: u32 = 650_000_000; - #[cfg(feature = "target_redpitaya")] - const CPU_FREQ: u32 = 800_000_000; info!("Setup clock sources..."); ArmPll::setup(2 * CPU_FREQ); Clocks::set_cpu_freq(CPU_FREQ); - #[cfg(feature = "target_zc706")] - { - IoPll::setup(1_000_000_000); - libboard_zynq::stdio::drop_uart(); - } - #[cfg(feature = "target_coraz7")] - { - IoPll::setup(1_000_000_000); - libboard_zynq::stdio::drop_uart(); - } - #[cfg(feature = "target_redpitaya")] - { - IoPll::setup(1_000_000_000); - libboard_zynq::stdio::drop_uart(); - } + IoPll::setup(1_000_000_000); + libboard_zynq::stdio::drop_uart(); info!("PLLs set up"); let clocks = zynq::clocks::Clocks::get(); info!( diff --git a/libconfig/Cargo.toml b/libconfig/Cargo.toml index cb3d9d5..a490764 100644 --- a/libconfig/Cargo.toml +++ b/libconfig/Cargo.toml @@ -14,4 +14,5 @@ log = "0.4" target_zc706 = [] target_coraz7 = [] target_redpitaya = [] +target_kasli_soc = [] ipv6 = [] diff --git a/libconfig/src/net_settings.rs b/libconfig/src/net_settings.rs index 8939b03..453b247 100644 --- a/libconfig/src/net_settings.rs +++ b/libconfig/src/net_settings.rs @@ -43,6 +43,10 @@ pub fn get_adresses(cfg: &Config) -> NetAddresses { let mut hardware_addr = EthernetAddress([0x02, 0x00, 0x00, 0x00, 0x00, 0x55]); #[cfg(feature = "target_redpitaya")] let mut ipv4_addr = IpAddress::v4(192, 168, 1, 55); + #[cfg(feature = "target_kasli_soc")] + let mut hardware_addr = EthernetAddress([0x02, 0x00, 0x00, 0x00, 0x00, 0x56]); + #[cfg(feature = "target_kasli_soc")] + let mut ipv4_addr = IpAddress::v4(192, 168, 1, 56); if let Ok(Ok(addr)) = cfg.read_str("mac").map(|s| s.parse()) { hardware_addr = addr; diff --git a/libsupport_zynq/Cargo.toml b/libsupport_zynq/Cargo.toml index 6feb08b..6a5a7de 100644 --- a/libsupport_zynq/Cargo.toml +++ b/libsupport_zynq/Cargo.toml @@ -9,6 +9,7 @@ edition = "2018" target_zc706 = ["libboard_zynq/target_zc706"] target_coraz7 = ["libboard_zynq/target_coraz7"] target_redpitaya = ["libboard_zynq/target_redpitaya"] +target_kasli_soc = ["libboard_zynq/target_kasli_soc"] panic_handler = [] dummy_irq_handler = [] alloc_core = [] diff --git a/szl/Cargo.toml b/szl/Cargo.toml index 00691f5..b1a33ae 100644 --- a/szl/Cargo.toml +++ b/szl/Cargo.toml @@ -9,6 +9,7 @@ edition = "2018" target_zc706 = ["libboard_zynq/target_zc706", "libsupport_zynq/target_zc706", "libconfig/target_zc706"] target_coraz7 = ["libboard_zynq/target_coraz7", "libsupport_zynq/target_coraz7", "libconfig/target_coraz7"] target_redpitaya = ["libboard_zynq/target_redpitaya", "libsupport_zynq/target_redpitaya", "libconfig/target_redpitaya"] +target_kasli_soc = ["libboard_zynq/target_kasli_soc", "libsupport_zynq/target_kasli_soc", "libconfig/target_kasli_soc"] default = ["target_zc706"] [dependencies]