mirror of https://github.com/m-labs/artiq.git
firmware: libbsp::board → libboard.
This commit is contained in:
parent
bd33dca203
commit
4480a1c2ff
|
@ -11,7 +11,7 @@ name = "alloc_none"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bsp"
|
name = "board"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -41,7 +41,7 @@ name = "ksupport"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alloc_none 0.0.0",
|
"alloc_none 0.0.0",
|
||||||
"bsp 0.0.0",
|
"board 0.0.0",
|
||||||
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"std_artiq 0.0.0",
|
"std_artiq 0.0.0",
|
||||||
]
|
]
|
||||||
|
@ -78,7 +78,7 @@ name = "runtime"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alloc_artiq 0.0.0",
|
"alloc_artiq 0.0.0",
|
||||||
"bsp 0.0.0",
|
"board 0.0.0",
|
||||||
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"fringe 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fringe 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
[package]
|
[package]
|
||||||
authors = ["M-Labs"]
|
authors = ["M-Labs"]
|
||||||
name = "bsp"
|
name = "board"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "bsp"
|
name = "board"
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
|
@ -1,4 +1,5 @@
|
||||||
#![allow(dead_code)]
|
#![feature(asm)]
|
||||||
|
#![no_std]
|
||||||
|
|
||||||
use core::{cmp, ptr, str};
|
use core::{cmp, ptr, str};
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
#![feature(asm)]
|
|
||||||
#![no_std]
|
|
||||||
|
|
||||||
pub mod board;
|
|
|
@ -11,5 +11,5 @@ crate-type = ["staticlib"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
alloc_none = { path = "../liballoc_none" }
|
alloc_none = { path = "../liballoc_none" }
|
||||||
std_artiq = { path = "../libstd_artiq" }
|
std_artiq = { path = "../libstd_artiq" }
|
||||||
bsp = { path = "../libbsp" }
|
board = { path = "../libboard" }
|
||||||
byteorder = { version = "0.5", default-features = false }
|
byteorder = { version = "0.5", default-features = false }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use bsp::board::csr;
|
use board::csr;
|
||||||
|
|
||||||
pub extern fn init() {
|
pub extern fn init() {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use bsp::board::csr;
|
use board::csr;
|
||||||
|
|
||||||
fn half_period() {
|
fn half_period() {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -16,7 +16,7 @@ fn half_period() {
|
||||||
|
|
||||||
#[cfg(has_i2c)]
|
#[cfg(has_i2c)]
|
||||||
mod imp {
|
mod imp {
|
||||||
use bsp::board::csr;
|
use board::csr;
|
||||||
|
|
||||||
fn sda_bit(busno: u32) -> u32 { 1 << (2 * busno + 1) }
|
fn sda_bit(busno: u32) -> u32 { 1 << (2 * busno + 1) }
|
||||||
fn scl_bit(busno: u32) -> u32 { 1 << (2 * busno) }
|
fn scl_bit(busno: u32) -> u32 { 1 << (2 * busno) }
|
||||||
|
@ -64,14 +64,14 @@ mod imp {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// #[cfg(not(has_i2c))]
|
#[cfg(not(has_i2c))]
|
||||||
// mod imp {
|
mod imp {
|
||||||
// pub fn sda_i(busno: u32) -> bool { true }
|
pub fn sda_i(busno: u32) -> bool { true }
|
||||||
// pub fn sda_oe(busno: u32, oe: bool) {}
|
pub fn sda_oe(busno: u32, oe: bool) {}
|
||||||
// pub fn sda_o(busno: u32, o: bool) {}
|
pub fn sda_o(busno: u32, o: bool) {}
|
||||||
// pub fn scl_oe(busno: u32, oe: bool) {}
|
pub fn scl_oe(busno: u32, oe: bool) {}
|
||||||
// pub fn scl_o(busno: u32, o: bool) {}
|
pub fn scl_o(busno: u32, o: bool) {}
|
||||||
// }
|
}
|
||||||
|
|
||||||
use self::imp::*;
|
use self::imp::*;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ extern crate alloc_none;
|
||||||
extern crate std_artiq as std;
|
extern crate std_artiq as std;
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
extern crate byteorder;
|
extern crate byteorder;
|
||||||
extern crate bsp;
|
extern crate board;
|
||||||
|
|
||||||
#[path = "../runtime/mailbox.rs"]
|
#[path = "../runtime/mailbox.rs"]
|
||||||
mod mailbox;
|
mod mailbox;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#[path = "../runtime/kernel_proto.rs"]
|
#[path = "../runtime/kernel_proto.rs"]
|
||||||
mod kernel_proto;
|
mod kernel_proto;
|
||||||
|
|
||||||
use bsp::board::csr;
|
use board::csr;
|
||||||
use core::ptr::{read_volatile, write_volatile};
|
use core::ptr::{read_volatile, write_volatile};
|
||||||
use ::ArtiqList;
|
use ::ArtiqList;
|
||||||
use ::send;
|
use ::send;
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "lib.rs"
|
||||||
alloc_artiq = { path = "../liballoc_artiq" }
|
alloc_artiq = { path = "../liballoc_artiq" }
|
||||||
std_artiq = { path = "../libstd_artiq", features = ["alloc"] }
|
std_artiq = { path = "../libstd_artiq", features = ["alloc"] }
|
||||||
lwip = { path = "../liblwip", default-features = false }
|
lwip = { path = "../liblwip", default-features = false }
|
||||||
bsp = { path = "../libbsp" }
|
board = { path = "../libboard" }
|
||||||
fringe = { version = "= 1.1.0", default-features = false, features = ["alloc"] }
|
fringe = { version = "= 1.1.0", default-features = false, features = ["alloc"] }
|
||||||
log = { version = "0.3", default-features = false }
|
log = { version = "0.3", default-features = false }
|
||||||
log_buffer = { version = "1.0" }
|
log_buffer = { version = "1.0" }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use std::io::{self, Write};
|
use std::io::{self, Write};
|
||||||
use bsp::board::{self, csr};
|
use board::{self, csr};
|
||||||
use sched::{Waiter, Spawner};
|
use sched::{Waiter, Spawner};
|
||||||
use sched::{TcpListener, TcpStream, SocketAddr, IP_ANY};
|
use sched::{TcpListener, TcpStream, SocketAddr, IP_ANY};
|
||||||
use analyzer_proto::*;
|
use analyzer_proto::*;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use bsp::board::csr;
|
use board::csr;
|
||||||
|
|
||||||
const INIT: u64 = ::core::i64::MAX as u64;
|
const INIT: u64 = ::core::i64::MAX as u64;
|
||||||
const FREQ: u64 = csr::CONFIG_CLOCK_FREQUENCY as u64;
|
const FREQ: u64 = csr::CONFIG_CLOCK_FREQUENCY as u64;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use core::ptr;
|
use core::ptr;
|
||||||
use bsp::board::csr;
|
use board::csr;
|
||||||
use mailbox;
|
use mailbox;
|
||||||
use rpc_queue;
|
use rpc_queue;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ extern crate log_buffer;
|
||||||
extern crate byteorder;
|
extern crate byteorder;
|
||||||
extern crate fringe;
|
extern crate fringe;
|
||||||
extern crate lwip;
|
extern crate lwip;
|
||||||
extern crate bsp;
|
extern crate board;
|
||||||
|
|
||||||
use core::fmt::Write;
|
use core::fmt::Write;
|
||||||
use logger::BufferLogger;
|
use logger::BufferLogger;
|
||||||
|
@ -105,7 +105,7 @@ pub unsafe extern fn rust_main() {
|
||||||
clock::init();
|
clock::init();
|
||||||
info!("booting ARTIQ");
|
info!("booting ARTIQ");
|
||||||
info!("software version {}", GIT_COMMIT);
|
info!("software version {}", GIT_COMMIT);
|
||||||
info!("gateware version {}", bsp::board::ident(&mut [0; 64]));
|
info!("gateware version {}", board::ident(&mut [0; 64]));
|
||||||
|
|
||||||
let t = clock::get_ms();
|
let t = clock::get_ms();
|
||||||
info!("press 'e' to erase startup and idle kernels...");
|
info!("press 'e' to erase startup and idle kernels...");
|
||||||
|
@ -138,7 +138,7 @@ pub unsafe extern fn rust_main() {
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern fn isr() {
|
pub unsafe extern fn isr() {
|
||||||
use bsp::board::{irq, csr};
|
use board::{irq, csr};
|
||||||
extern { fn uart_isr(); }
|
extern { fn uart_isr(); }
|
||||||
|
|
||||||
let irqs = irq::pending() & irq::get_mask();
|
let irqs = irq::pending() & irq::get_mask();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use core::ptr::{read_volatile, write_volatile};
|
use core::ptr::{read_volatile, write_volatile};
|
||||||
use bsp::board;
|
use board;
|
||||||
|
|
||||||
const MAILBOX: *mut usize = board::mem::MAILBOX_BASE as *mut usize;
|
const MAILBOX: *mut usize = board::mem::MAILBOX_BASE as *mut usize;
|
||||||
static mut LAST: usize = 0;
|
static mut LAST: usize = 0;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::vec::Vec;
|
use std::vec::Vec;
|
||||||
use std::io;
|
use std::io;
|
||||||
use bsp::board::csr;
|
use board::csr;
|
||||||
use sched::{Waiter, Spawner};
|
use sched::{Waiter, Spawner};
|
||||||
use sched::{UdpSocket, SocketAddr, IP_ANY};
|
use sched::{UdpSocket, SocketAddr, IP_ANY};
|
||||||
use moninj_proto::*;
|
use moninj_proto::*;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use core::ptr::{read_volatile, write_volatile};
|
use core::ptr::{read_volatile, write_volatile};
|
||||||
use core::slice;
|
use core::slice;
|
||||||
use bsp::board;
|
use board;
|
||||||
|
|
||||||
const SEND_MAILBOX: *mut usize = (board::mem::MAILBOX_BASE + 4) as *mut usize;
|
const SEND_MAILBOX: *mut usize = (board::mem::MAILBOX_BASE + 4) as *mut usize;
|
||||||
const RECV_MAILBOX: *mut usize = (board::mem::MAILBOX_BASE + 8) as *mut usize;
|
const RECV_MAILBOX: *mut usize = (board::mem::MAILBOX_BASE + 8) as *mut usize;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use config;
|
use config;
|
||||||
use bsp::board::csr;
|
use board::csr;
|
||||||
use sched::Scheduler;
|
use sched::Scheduler;
|
||||||
|
|
||||||
#[cfg(has_rtio_crg)]
|
#[cfg(has_rtio_crg)]
|
||||||
pub mod crg {
|
pub mod crg {
|
||||||
use clock;
|
use clock;
|
||||||
use bsp::board::csr;
|
use board::csr;
|
||||||
|
|
||||||
pub fn init() {
|
pub fn init() {
|
||||||
unsafe { csr::rtio_crg::pll_reset_write(0) }
|
unsafe { csr::rtio_crg::pll_reset_write(0) }
|
||||||
|
@ -39,7 +39,7 @@ pub mod crg {
|
||||||
|
|
||||||
#[cfg(has_drtio)]
|
#[cfg(has_drtio)]
|
||||||
mod drtio {
|
mod drtio {
|
||||||
use bsp::board::csr;
|
use board::csr;
|
||||||
use sched::{Scheduler, Waiter, Spawner};
|
use sched::{Scheduler, Waiter, Spawner};
|
||||||
|
|
||||||
pub fn startup(scheduler: &Scheduler) {
|
pub fn startup(scheduler: &Scheduler) {
|
||||||
|
|
|
@ -10,7 +10,7 @@ use urc::Urc;
|
||||||
use sched::{ThreadHandle, Waiter, Spawner};
|
use sched::{ThreadHandle, Waiter, Spawner};
|
||||||
use sched::{TcpListener, TcpStream, SocketAddr, IP_ANY};
|
use sched::{TcpListener, TcpStream, SocketAddr, IP_ANY};
|
||||||
use byteorder::{ByteOrder, NetworkEndian};
|
use byteorder::{ByteOrder, NetworkEndian};
|
||||||
use bsp::board;
|
use board;
|
||||||
|
|
||||||
use rpc_proto as rpc;
|
use rpc_proto as rpc;
|
||||||
use session_proto as host;
|
use session_proto as host;
|
||||||
|
|
Loading…
Reference in New Issue