• 我为MT6582 Build 了Linux kernel Cortex-A7(ARMv7-A)

  • 在真实设备上这个内核工作

  • 在QEMU中我跑完后有空白屏幕

  • 我希望看到一些内核初始化消息但什么都没有

  • 是否可以使用QEMU模拟MediaTek ARM处理器?

  • 如何查看有关错误的qemu详细信息,或者除了空白控制台和屏幕之外的其他信息?

Also I tried to make some device tree for qemu, but I don't know can his help or not

mt6582,evbp1.dts

/dts-v1/;

/include/ "mt6582.dtsi"

/ {
    model = "MediaTek mt6582 evaluation board";
    compatible = "mediatek,mt6582-evbp1", "mediatek,mt6582";

    aliases {
        serial0 = &uart0;
        serial1 = &uart1;
    };

    chosen {
        stdout-path = "serial0:921600n8";
    };

    memory {
        reg = <0x80000000 0x20000000>;
    };
};

&uart0 {
    status = "okay";
};

mt6582.dtsi

/include/ "skeleton.dtsi"

/ {
    compatible = "mediatek,mt6582";
    #address-cells = <1>;
    #size-cells = <1>;
    interrupt-parent = <&sysirq>;

    cpus {
        #address-cells = <1>;
        #size-cells = <0>;

        cpu@0 {
            device_type = "cpu";
            compatible = "arm,cortex-a7";
            reg = <0x0>;
        };
        cpu@1 {
            device_type = "cpu";
            compatible = "arm,cortex-a7";
            reg = <0x1>;
        };
        cpu@2 {
            device_type = "cpu";
            compatible = "arm,cortex-a7";
            reg = <0x2>;
        };
        cpu@3 {
            device_type = "cpu";
            compatible = "arm,cortex-a7";
            reg = <0x3>;
        };

    };

    system_clk: dummy13m {
        compatible = "fixed-clock";
        clock-frequency = <13000000>;
        #clock-cells = <0>;
    };

    rtc_clk: dummy32k {
        compatible = "fixed-clock";
        clock-frequency = <32000>;
        #clock-cells = <0>;
    };

    uart_clk: dummy26m {
        compatible = "fixed-clock";
        clock-frequency = <26000000>;
        #clock-cells = <0>;
    };

    timer: timer@10008000 {
        compatible = "mediatek,mt6582-timer";
        reg = <0x10008000 0x80>;
        clocks = <&system_clk>, <&rtc_clk>;
        clock-names = "system-clk", "rtc-clk";
    };

    sysirq: interrupt-controller@10200100 {
        compatible = "mediatek,mt6582-sysirq";
        interrupt-controller;
        #interrupt-cells = <3>;
        interrupt-parent = <&gic>;
        reg = <0x10200100 0x1c>;
    };

    gic: interrupt-controller@10211000 {
        compatible = "arm,cortex-a7-gic";
        interrupt-controller;
        #interrupt-cells = <3>;
        interrupt-parent = <&gic>;
        reg = <0x10211000 0x1000>,
              <0x10212000 0x2000>,
              <0x10214000 0x2000>,
              <0x10216000 0x2000>;
    };

    v2m_serial0: uart@090000 {
        compatible = "mediatek,mt6582-uart";
        reg = <0x090000 0x1000>;
        interrupts = <5>;
        clocks = <&uart_clk>;
        clock-names = "uartclk", "apb_pclk";
    };

    uart0: serial@11005000 {
        compatible = "mediatek,mt6582-uart";
        reg = <0x11005000 0x400>;
        clocks = <&uart_clk>;
        status = "disabled";
    };

    uart1: serial@11006000 {
        compatible = "mediatek,mt6582-uart";
        reg = <0x11006000 0x400>;
        clocks = <&uart_clk>;
        status = "disabled";
    };
};

skeleton.dtsi

/*
 * Skeleton device tree; the bare minimum needed to boot; just include and
 * add a compatible value.  The bootloader will typically populate the memory
 * node.
 */

/ {
    #address-cells = <2>;
    #size-cells = <1>;
    chosen { };
    aliases { };
    memory { device_type = "memory"; reg = <0 0 0>; };
};

我如何运行dtc - 设备树编译器:

dtc -I dts -O dtb mt6582-evbp1.dts > mt6582.dtb

我如何运行qemu:

qemu-system-arm -kernel /git/lenovo-android-phone-linux-kernel/out/target/product/stella/obj/KERNEL_OBJ/arch/arm/boot/zImage -append 'fbcon=font:VGA8x8 no_console_suspend androidboot.console=tty0 logo.nologo sched_debug loglevel=7 console=tty0 console=ttyS0 console=ttyMT3,921600n1 vmalloc=496M slub_max_order=0 lcm=1-hx8394a_hd720_dsi_vdo_tianma lcm_meta=0 fps=5949 bootprof.pl_t=3897 bootprof.lk_t=1318 console=serial0 printk.disable_uart=0 boot_reason=4 console=ttyMT0 console=ttyMT1 console=ttyMT2 console=ttyAMA0 console=ttyS1 console=_kmsg_ androidboot.console=ttyS2 qemu.gles=0 qemu=1 noinitrd earlyprintk loglevel=8 init=/init' -sdl -serial stdio -machine versatilepb
pulseaudio: set_sink_input_volume() failed
pulseaudio: Reason: Invalid argument
pulseaudio: set_sink_input_mute() failed
pulseaudio: Reason: Invalid argument
qemu-system-arm: terminating on signal 2