From 4ddcdeb00427d08c02d3c94d85083ff291ba5b2c Mon Sep 17 00:00:00 2001 From: Harry Chen Date: Tue, 2 Apr 2019 01:07:08 +0800 Subject: [PATCH] Complete DTS for qemu-malta Signed-off-by: Harry Chen --- .gitignore | 2 ++ kernel/Cargo.toml | 2 ++ kernel/Makefile | 2 +- kernel/src/arch/mipsel/boot/dts/malta.dts | 44 +++++++++++++++++++++++ 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 446ff27..00657e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ build target /kernel/src/arch/x86_64/interrupt/vector.asm +/kernel/src/arch/*/boot/dtb.S +*.dtb Cargo.lock !kernel/Cargo.lock diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 0dae824..6f32b9d 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -24,6 +24,8 @@ board_u540 = ["sv39", "link_user"] nographic = [] board_raspi3 = ["bcm2837", "link_user"] raspi3_use_generic_timer = ["bcm2837/use_generic_timer"] +# for mipsel qemu malta machine +board_malta = [] # Hard link user program link_user = [] # Run cmdline instead of user shell, useful for automatic testing diff --git a/kernel/Makefile b/kernel/Makefile index c081af4..07b74ce 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -115,7 +115,7 @@ qemu_opts += \ else ifeq ($(arch), mipsel) qemu_opts += \ -machine $(board) \ - -serial null -serial mon:stdio \ + -serial null -serial null -serial mon:stdio \ -kernel $(kernel_img) endif diff --git a/kernel/src/arch/mipsel/boot/dts/malta.dts b/kernel/src/arch/mipsel/boot/dts/malta.dts index e69de29..c68424b 100644 --- a/kernel/src/arch/mipsel/boot/dts/malta.dts +++ b/kernel/src/arch/mipsel/boot/dts/malta.dts @@ -0,0 +1,44 @@ +/dts-v1/; + + +/ { + model = "qemu malta"; + compatible = "qemu,malta"; + #address-cells = <1>; + #size-cells = <1>; + + chosen { + stdio = &uart2; + }; + + aliases { }; + + cpu_intc: interrupt-controller { + compatible = "mti,cpu-interrupt-controller"; + interrupt-controller; + #interrupt-cells = <1>; + }; + + main_memory: memory@0 { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + uart2: serial@bf000900 { + compatible = "ns16550a"; + reg = <0xbf000900 0x40>; + reg-shift = <3>; + clock-frequency = <1843200>; + /* The CBUS UART is attached to the MIPS CPU INT2 pin, ie interrupt 4 */ + interrupt-parent = <&cpu_intc>; + interrupts = <4>; + }; + + nor0: flash@be000000 { + compatible = "cfi-flash"; + reg = <0xbe000000 0x00400000>; + }; + + // TODO: add graphics and ethernet adapter + +};