Move dts to board dir, fix some import error

Signed-off-by: Harry Chen <i@harrychen.xyz>
master
Harry Chen 6 years ago
parent 015cc72aa4
commit 6245d86a27

@ -49,20 +49,22 @@ user_dir := ../user
### export environments ### ### export environments ###
export ARCH = $(arch)
export BOARD = $(board)
export SMP = $(smp)
export DTB = $(dtb)
export SFSIMG = $(user_dir)/build/$(arch).qcow2 export SFSIMG = $(user_dir)/build/$(arch).qcow2
ifeq ($(arch), aarch64) ifeq ($(arch), aarch64)
board := raspi3 board := raspi3
export SFSIMG = $(user_dir)/build/$(arch).img export SFSIMG = $(user_dir)/build/$(arch).img
else ifeq ($(arch), mipsel)
board := malta
endif endif
dtb := src/arch/$(arch)/boot/dts/$(board).dtb # currently only mipsel architecture needs DTB linked to the kernel
ifeq ($(arch), mipsel)
dtb := src/arch/$(arch)/board/$(board)/device.dtb
endif
export ARCH = $(arch)
export BOARD = $(board)
export SMP = $(smp)
export DTB = $(dtb)
### qemu options ### ### qemu options ###

@ -1,3 +1,7 @@
//! stub frame buffer driver for malta board
use spin::Mutex;
lazy_static! { lazy_static! {
pub static ref FRAME_BUFFER: Mutex<Option<Framebuffer>> = Mutex::new(None); pub static ref FRAME_BUFFER: Mutex<Option<Framebuffer>> = Mutex::new(None);
} }

@ -1,5 +1,8 @@
//! 16550 serial adapter driver for malta board
use core::fmt::{Write, Result, Arguments}; use core::fmt::{Write, Result, Arguments};
use core::ptr::{read_volatile, write_volatile}; use core::ptr::{read_volatile, write_volatile};
use spin::Mutex;
struct SerialPort { struct SerialPort {
base: usize base: usize
@ -7,7 +10,9 @@ struct SerialPort {
impl SerialPort { impl SerialPort {
fn new() -> SerialPort { fn new() -> SerialPort {
SerialPort { } SerialPort {
base: 0
}
} }
pub fn init(&mut self, base: usize) { pub fn init(&mut self, base: usize) {

@ -1,5 +1,5 @@
use mips::interrupts::*; use mips::interrupts;
use mips::registers::*; use mips::registers::cp0;
use crate::drivers::DRIVERS; use crate::drivers::DRIVERS;
pub use self::context::*; pub use self::context::*;
use log::*; use log::*;

@ -9,7 +9,7 @@ pub fn getchar() -> char {
SERIAL_PORT.lock().getchar() SERIAL_PORT.lock().getchar()
} }
pub fn getchar_option() -> Option<Char> { pub fn getchar_option() -> Option<char> {
unsafe { SERIAL_PORT.force_unlock() } unsafe { SERIAL_PORT.force_unlock() }
SERIAL_PORT.lock().getchar_option() SERIAL_PORT.lock().getchar_option()
} }

@ -11,7 +11,7 @@ pub mod rand;
pub mod driver; pub mod driver;
use log::*; use log::*;
use mips::registers; use mips::registers::cp0;
use mips::instructions; use mips::instructions;
#[cfg(feature = "board_malta")] #[cfg(feature = "board_malta")]

Loading…
Cancel
Save