forked from M-Labs/artiq-zynq
Initial commit
This commit is contained in:
parent
6585b9b441
commit
6937059a10
@ -10,6 +10,7 @@ name = "libboard_artiq"
|
|||||||
[features]
|
[features]
|
||||||
target_zc706 = ["libboard_zynq/target_zc706", "libconfig/target_zc706"]
|
target_zc706 = ["libboard_zynq/target_zc706", "libconfig/target_zc706"]
|
||||||
target_kasli_soc = ["libboard_zynq/target_kasli_soc", "libconfig/target_kasli_soc"]
|
target_kasli_soc = ["libboard_zynq/target_kasli_soc", "libconfig/target_kasli_soc"]
|
||||||
|
target_ebaz4205 = ["libboard_zynq/target_ebaz4205", "libconfig/target_ebaz4205"]
|
||||||
calibrate_wrpll_skew = []
|
calibrate_wrpll_skew = []
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
@ -11,7 +11,10 @@ use super::{cache,
|
|||||||
core1::rtio_get_destination_status,
|
core1::rtio_get_destination_status,
|
||||||
dma, linalg,
|
dma, linalg,
|
||||||
rpc::{rpc_recv, rpc_send, rpc_send_async}};
|
rpc::{rpc_recv, rpc_send, rpc_send_async}};
|
||||||
use crate::{eh_artiq, i2c, rtio};
|
|
||||||
|
use crate::{eh_artiq, rtio};
|
||||||
|
#[cfg(not(feature = "target_ebaz4205"))]
|
||||||
|
use crate::i2c;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
fn vsnprintf_(buffer: *mut c_char, count: size_t, format: *const c_char, va: VaList) -> c_int;
|
fn vsnprintf_(buffer: *mut c_char, count: size_t, format: *const c_char, va: VaList) -> c_int;
|
||||||
@ -109,11 +112,17 @@ pub fn resolve(required: &[u8]) -> Option<u32> {
|
|||||||
api!(cache_put = cache::put),
|
api!(cache_put = cache::put),
|
||||||
|
|
||||||
// i2c
|
// i2c
|
||||||
|
#[cfg(not(feature = "target_ebaz4205"))]
|
||||||
api!(i2c_start = i2c::start),
|
api!(i2c_start = i2c::start),
|
||||||
|
#[cfg(not(feature = "target_ebaz4205"))]
|
||||||
api!(i2c_restart = i2c::restart),
|
api!(i2c_restart = i2c::restart),
|
||||||
|
#[cfg(not(feature = "target_ebaz4205"))]
|
||||||
api!(i2c_stop = i2c::stop),
|
api!(i2c_stop = i2c::stop),
|
||||||
|
#[cfg(not(feature = "target_ebaz4205"))]
|
||||||
api!(i2c_write = i2c::write),
|
api!(i2c_write = i2c::write),
|
||||||
|
#[cfg(not(feature = "target_ebaz4205"))]
|
||||||
api!(i2c_read = i2c::read),
|
api!(i2c_read = i2c::read),
|
||||||
|
#[cfg(not(feature = "target_ebaz4205"))]
|
||||||
api!(i2c_switch_select = i2c::switch_select),
|
api!(i2c_switch_select = i2c::switch_select),
|
||||||
|
|
||||||
// subkernel
|
// subkernel
|
||||||
|
@ -21,6 +21,7 @@ pub use pl::csr::rtio_core;
|
|||||||
use void::Void;
|
use void::Void;
|
||||||
|
|
||||||
pub mod eh_artiq;
|
pub mod eh_artiq;
|
||||||
|
#[cfg(not(feature = "target_ebaz4205"))]
|
||||||
pub mod i2c;
|
pub mod i2c;
|
||||||
pub mod irq;
|
pub mod irq;
|
||||||
pub mod kernel;
|
pub mod kernel;
|
||||||
|
@ -8,6 +8,7 @@ edition = "2018"
|
|||||||
[features]
|
[features]
|
||||||
target_zc706 = ["libboard_zynq/target_zc706", "libsupport_zynq/target_zc706", "libconfig/target_zc706", "libboard_artiq/target_zc706"]
|
target_zc706 = ["libboard_zynq/target_zc706", "libsupport_zynq/target_zc706", "libconfig/target_zc706", "libboard_artiq/target_zc706"]
|
||||||
target_kasli_soc = ["libboard_zynq/target_kasli_soc", "libsupport_zynq/target_kasli_soc", "libconfig/target_kasli_soc", "libboard_artiq/target_kasli_soc"]
|
target_kasli_soc = ["libboard_zynq/target_kasli_soc", "libsupport_zynq/target_kasli_soc", "libconfig/target_kasli_soc", "libboard_artiq/target_kasli_soc"]
|
||||||
|
target_ebaz4205 = ["libboard_zynq/target_ebaz4205", "libsupport_zynq/target_ebaz4205", "libconfig/target_ebaz4205", "libboard_artiq/target_ebaz4205"]
|
||||||
default = ["target_zc706"]
|
default = ["target_zc706"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
@ -100,6 +100,7 @@ pub fn main_core0() {
|
|||||||
|
|
||||||
info!("gateware ident: {}", identifier_read(&mut [0; 64]));
|
info!("gateware ident: {}", identifier_read(&mut [0; 64]));
|
||||||
|
|
||||||
|
#[cfg(not(feature = "target_ebaz4205"))]
|
||||||
ksupport::i2c::init();
|
ksupport::i2c::init();
|
||||||
#[cfg(feature = "target_kasli_soc")]
|
#[cfg(feature = "target_kasli_soc")]
|
||||||
{
|
{
|
||||||
|
@ -69,7 +69,7 @@ fn get_rtio_clock_cfg(cfg: &Config) -> RtioClock {
|
|||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(has_drtio))]
|
#[cfg(not(any(has_drtio, feature = "target_ebaz4205")))]
|
||||||
fn init_rtio(timer: &mut GlobalTimer) {
|
fn init_rtio(timer: &mut GlobalTimer) {
|
||||||
info!("Switching SYS clocks...");
|
info!("Switching SYS clocks...");
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -429,7 +429,7 @@ pub fn init(timer: &mut GlobalTimer, cfg: &Config) {
|
|||||||
#[cfg(has_drtio)]
|
#[cfg(has_drtio)]
|
||||||
init_drtio(timer);
|
init_drtio(timer);
|
||||||
|
|
||||||
#[cfg(not(has_drtio))]
|
#[cfg(not(any(has_drtio, feature = "target_ebaz4205")))]
|
||||||
init_rtio(timer);
|
init_rtio(timer);
|
||||||
|
|
||||||
#[cfg(all(has_si549, has_wrpll))]
|
#[cfg(all(has_si549, has_wrpll))]
|
||||||
|
Loading…
Reference in New Issue
Block a user