1
0
mirror of https://github.com/rcore-os/rCore.git synced 2025-01-31 10:04:04 +04:00

Add initial support for Rocket Chip platform

This commit is contained in:
Jiajie Chen 2019-04-27 23:01:44 +08:00
parent d55a93172d
commit bfd4f8a2a4
4 changed files with 7 additions and 2 deletions

View File

@ -24,6 +24,7 @@ default = ["sv39"]
sv39 = []
board_u540 = ["sv39", "link_user"]
board_k210 = ["sv39", "link_user"]
board_rocket_chip = ["sv39", "link_user"]
# (for aarch64 RaspberryPi3)
nographic = []
board_raspi3 = ["bcm2837", "link_user"]

View File

@ -26,6 +26,7 @@
# | pc Only available on x86_64, run on real pc
# | u540 Only available on riscv64, run on HiFive U540, use Sv39
# | k210 Only available on riscv64, run on K210, use Sv39
# | rocket_chip Only available on riscv64, run on Rocket Chip, use Sv39
# | raspi3 Only available on aarch64, run on Raspberry Pi 3 Model B/B+
# pci_passthru = 0000:00:00.1 Only available on x86_64, passthrough the specified PCI device
# init = /bin/ls Only available on riscv64, run specified program instead of user shell
@ -60,7 +61,7 @@ ifeq ($(arch), $(filter $(arch), aarch64 mipsel))
export SFSIMG = $(user_dir)/build/$(arch).img
else
# board is pc or qemu?
ifeq ($(board), $(filter $(board), pc u540 k210))
ifeq ($(board), $(filter $(board), pc u540 k210 rocket_chip))
#link user img, so use original image
export SFSIMG = $(user_dir)/build/$(arch).img
else

View File

@ -92,6 +92,8 @@ fn remap_the_kernel(dtb: usize) {
Linear::new(offset),
"bss",
);
// TODO: dtb on rocket chip
#[cfg(not(feature = "board_rocket_chip"))]
ms.push(
dtb,
dtb + super::consts::MAX_DTB_SIZE,

View File

@ -53,10 +53,11 @@ pub extern "C" fn rust_main(hartid: usize, device_tree_paddr: usize) -> ! {
memory::init(device_tree_vaddr);
timer::init();
// FIXME: init driver on u540
#[cfg(not(feature = "board_u540"))]
#[cfg(not(any(feature = "board_u540", feature = "board_rocket_chip")))]
crate::drivers::init(device_tree_vaddr);
#[cfg(not(feature = "board_k210"))]
unsafe {
#[cfg(not(feature = "board_rocket_chip"))]
board::enable_serial_interrupt();
board::init_external_interrupt();
}