forked from M-Labs/artiq
1
0
Fork 0

firmware: libbsp::board → libboard.

This commit is contained in:
whitequark 2016-12-31 13:32:50 +00:00
parent bd33dca203
commit 4480a1c2ff
19 changed files with 35 additions and 38 deletions

View File

@ -11,7 +11,7 @@ name = "alloc_none"
version = "0.0.0"
[[package]]
name = "bsp"
name = "board"
version = "0.0.0"
[[package]]
@ -41,7 +41,7 @@ name = "ksupport"
version = "0.0.0"
dependencies = [
"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)",
"std_artiq 0.0.0",
]
@ -78,7 +78,7 @@ name = "runtime"
version = "0.0.0"
dependencies = [
"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)",
"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)",

View File

@ -1,8 +1,8 @@
[package]
authors = ["M-Labs"]
name = "bsp"
name = "board"
version = "0.0.0"
[lib]
name = "bsp"
name = "board"
path = "lib.rs"

View File

@ -1,4 +1,5 @@
#![allow(dead_code)]
#![feature(asm)]
#![no_std]
use core::{cmp, ptr, str};

View File

@ -1,4 +0,0 @@
#![feature(asm)]
#![no_std]
pub mod board;

View File

@ -11,5 +11,5 @@ crate-type = ["staticlib"]
[dependencies]
alloc_none = { path = "../liballoc_none" }
std_artiq = { path = "../libstd_artiq" }
bsp = { path = "../libbsp" }
board = { path = "../libboard" }
byteorder = { version = "0.5", default-features = false }

View File

@ -1,4 +1,4 @@
use bsp::board::csr;
use board::csr;
pub extern fn init() {
unsafe {

View File

@ -1,4 +1,4 @@
use bsp::board::csr;
use board::csr;
fn half_period() {
unsafe {
@ -16,7 +16,7 @@ fn half_period() {
#[cfg(has_i2c)]
mod imp {
use bsp::board::csr;
use board::csr;
fn sda_bit(busno: u32) -> u32 { 1 << (2 * busno + 1) }
fn scl_bit(busno: u32) -> u32 { 1 << (2 * busno) }
@ -64,14 +64,14 @@ mod imp {
}
}
// #[cfg(not(has_i2c))]
// mod imp {
// pub fn sda_i(busno: u32) -> bool { true }
// pub fn sda_oe(busno: u32, oe: bool) {}
// pub fn sda_o(busno: u32, o: bool) {}
// pub fn scl_oe(busno: u32, oe: bool) {}
// pub fn scl_o(busno: u32, o: bool) {}
// }
#[cfg(not(has_i2c))]
mod imp {
pub fn sda_i(busno: u32) -> bool { true }
pub fn sda_oe(busno: u32, oe: bool) {}
pub fn sda_o(busno: u32, o: bool) {}
pub fn scl_oe(busno: u32, oe: bool) {}
pub fn scl_o(busno: u32, o: bool) {}
}
use self::imp::*;

View File

@ -8,7 +8,7 @@ extern crate alloc_none;
extern crate std_artiq as std;
extern crate libc;
extern crate byteorder;
extern crate bsp;
extern crate board;
#[path = "../runtime/mailbox.rs"]
mod mailbox;

View File

@ -1,7 +1,7 @@
#[path = "../runtime/kernel_proto.rs"]
mod kernel_proto;
use bsp::board::csr;
use board::csr;
use core::ptr::{read_volatile, write_volatile};
use ::ArtiqList;
use ::send;

View File

@ -16,7 +16,7 @@ path = "lib.rs"
alloc_artiq = { path = "../liballoc_artiq" }
std_artiq = { path = "../libstd_artiq", features = ["alloc"] }
lwip = { path = "../liblwip", default-features = false }
bsp = { path = "../libbsp" }
board = { path = "../libboard" }
fringe = { version = "= 1.1.0", default-features = false, features = ["alloc"] }
log = { version = "0.3", default-features = false }
log_buffer = { version = "1.0" }

View File

@ -1,5 +1,5 @@
use std::io::{self, Write};
use bsp::board::{self, csr};
use board::{self, csr};
use sched::{Waiter, Spawner};
use sched::{TcpListener, TcpStream, SocketAddr, IP_ANY};
use analyzer_proto::*;

View File

@ -1,4 +1,4 @@
use bsp::board::csr;
use board::csr;
const INIT: u64 = ::core::i64::MAX as u64;
const FREQ: u64 = csr::CONFIG_CLOCK_FREQUENCY as u64;

View File

@ -1,5 +1,5 @@
use core::ptr;
use bsp::board::csr;
use board::csr;
use mailbox;
use rpc_queue;

View File

@ -11,7 +11,7 @@ extern crate log_buffer;
extern crate byteorder;
extern crate fringe;
extern crate lwip;
extern crate bsp;
extern crate board;
use core::fmt::Write;
use logger::BufferLogger;
@ -105,7 +105,7 @@ pub unsafe extern fn rust_main() {
clock::init();
info!("booting ARTIQ");
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();
info!("press 'e' to erase startup and idle kernels...");
@ -138,7 +138,7 @@ pub unsafe extern fn rust_main() {
#[no_mangle]
pub unsafe extern fn isr() {
use bsp::board::{irq, csr};
use board::{irq, csr};
extern { fn uart_isr(); }
let irqs = irq::pending() & irq::get_mask();

View File

@ -1,5 +1,5 @@
use core::ptr::{read_volatile, write_volatile};
use bsp::board;
use board;
const MAILBOX: *mut usize = board::mem::MAILBOX_BASE as *mut usize;
static mut LAST: usize = 0;

View File

@ -1,6 +1,6 @@
use std::vec::Vec;
use std::io;
use bsp::board::csr;
use board::csr;
use sched::{Waiter, Spawner};
use sched::{UdpSocket, SocketAddr, IP_ANY};
use moninj_proto::*;

View File

@ -2,7 +2,7 @@
use core::ptr::{read_volatile, write_volatile};
use core::slice;
use bsp::board;
use board;
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;

View File

@ -1,11 +1,11 @@
use config;
use bsp::board::csr;
use board::csr;
use sched::Scheduler;
#[cfg(has_rtio_crg)]
pub mod crg {
use clock;
use bsp::board::csr;
use board::csr;
pub fn init() {
unsafe { csr::rtio_crg::pll_reset_write(0) }
@ -39,7 +39,7 @@ pub mod crg {
#[cfg(has_drtio)]
mod drtio {
use bsp::board::csr;
use board::csr;
use sched::{Scheduler, Waiter, Spawner};
pub fn startup(scheduler: &Scheduler) {

View File

@ -10,7 +10,7 @@ use urc::Urc;
use sched::{ThreadHandle, Waiter, Spawner};
use sched::{TcpListener, TcpStream, SocketAddr, IP_ANY};
use byteorder::{ByteOrder, NetworkEndian};
use bsp::board;
use board;
use rpc_proto as rpc;
use session_proto as host;