Add sdcard driver based on k210-rust crates && adjust clock freq.

This commit is contained in:
Yifan Wu 2020-12-16 15:19:29 +08:00
parent eca5ee2eb7
commit c5cf3aa83e
7 changed files with 783 additions and 5 deletions

View file

@ -1,4 +1,5 @@
mod virtio_blk;
mod sdcard;
use lazy_static::*;
use alloc::sync::Arc;
@ -12,6 +13,9 @@ pub trait BlockDevice : Send + Sync + Any {
#[cfg(feature = "board_qemu")]
type BlockDeviceImpl = virtio_blk::VirtIOBlock;
#[cfg(feature = "board_k210")]
type BlockDeviceImpl = sdcard::SDCardWrapper;
lazy_static! {
pub static ref BLOCK_DEVICE: Arc<dyn BlockDevice> = Arc::new(BlockDeviceImpl::new());
}