From c3e94d38ae87358bba85fa06fd4e226f47602c24 Mon Sep 17 00:00:00 2001 From: Harry Chen Date: Sat, 6 Apr 2019 01:57:23 +0800 Subject: [PATCH] Fix early uart on malta, now malta board can print things! Signed-off-by: Harry Chen --- kernel/Makefile | 2 +- kernel/src/arch/mipsel/board/malta/device.dts | 6 ++++++ kernel/src/arch/mipsel/board/malta/mod.rs | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index b156828..ec9f892 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -127,7 +127,7 @@ else ifeq ($(arch), mipsel) ifeq ($(board), malta) qemu_opts += \ -machine $(board) \ - -serial none -serial none -serial mon:stdio \ + -serial mon:stdio \ -kernel $(kernel_img) endif endif diff --git a/kernel/src/arch/mipsel/board/malta/device.dts b/kernel/src/arch/mipsel/board/malta/device.dts index c68424b..ddaaa72 100644 --- a/kernel/src/arch/mipsel/board/malta/device.dts +++ b/kernel/src/arch/mipsel/board/malta/device.dts @@ -24,6 +24,12 @@ reg = <0x00000000 0x10000000>; }; + uart0: serial@b80003f8 { + compatible = "ns16550a"; + reg = <0xb80003f8 0x8>; + clock-frequency = <1843200>; + }; + uart2: serial@bf000900 { compatible = "ns16550a"; reg = <0xbf000900 0x40>; diff --git a/kernel/src/arch/mipsel/board/malta/mod.rs b/kernel/src/arch/mipsel/board/malta/mod.rs index f5f892a..d9b9d0b 100644 --- a/kernel/src/arch/mipsel/board/malta/mod.rs +++ b/kernel/src/arch/mipsel/board/malta/mod.rs @@ -10,7 +10,7 @@ pub mod console; /// Initialize serial port first pub fn init_serial_early() { assert_has_not_been_called!("board::init must be called only once"); - serial::init(0xbf000900); + serial::init(0xb80003f8); println!("Hello QEMU Malta!"); }