1.. _qemu_malta:
2
3MIPS Malta Emulation (QEMU)
4###########################
5
6Overview
7********
8
9This board configuration will use QEMU to emulate the MIPS Malta platform.
10
11This configuration provides support for an MIPS 4Kc/24Kc CPU cores and these devices:
12
13* CP0 Interrupt Controller
14* CP0 Core Timer
15* NS16550 UART
16
17
18.. note::
19   This board configuration makes no claims about its suitability for use
20   with an actual MIPS Malta hardware system, or any other hardware system.
21
22Hardware
23********
24
25Supported Features
26==================
27
28The following hardware features are supported:
29
30+----------------+------------+----------------------+
31| Interface      | Controller | Driver/Component     |
32+================+============+======================+
33| CP0 IntC       | on-chip    | interrupt controller |
34+----------------+------------+----------------------+
35| CP0 Core Timer | on-chip    | system clock         |
36+----------------+------------+----------------------+
37| NS16550        | FPGA       | serial port          |
38| UART           |            |                      |
39+----------------+------------+----------------------+
40
41The kernel currently does not support other hardware features on this platform.
42
43Devices
44========
45System Clock
46------------
47
48Qemu CP0 timer uses a clock frequency of 200 MHz,
49see target/mips/cp0_timer.c in Qemu source tree for details.
50
51Serial Port
52-----------
53
54This board configuration uses a single serial communication channel
55with the FPGA UART2.
56
57Programming and Debugging
58*************************
59
60Use this configuration to run basic Zephyr applications and kernel tests in the QEMU
61emulated environment, for example, with the :ref:`synchronization_sample`:
62
63.. zephyr-app-commands::
64   :zephyr-app: samples/synchronization
65   :host-os: unix
66   :board: qemu_malta
67   :goals: run
68
69This will build an image with the synchronization sample app, boot it using
70QEMU, and display the following console output:
71
72.. code-block:: console
73
74        *** Booting Zephyr OS build v2.7.99-1627-g9bea7790d620  ***
75        thread_a: Hello World from cpu 0 on qemu_malta!
76        thread_b: Hello World from cpu 0 on qemu_malta!
77        thread_a: Hello World from cpu 0 on qemu_malta!
78        thread_b: Hello World from cpu 0 on qemu_malta!
79        thread_a: Hello World from cpu 0 on qemu_malta!
80        thread_b: Hello World from cpu 0 on qemu_malta!
81        thread_a: Hello World from cpu 0 on qemu_malta!
82        thread_b: Hello World from cpu 0 on qemu_malta!
83        thread_a: Hello World from cpu 0 on qemu_malta!
84        thread_b: Hello World from cpu 0 on qemu_malta!
85
86
87Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`.
88
89
90Big-Endian
91==========
92
93Use this configuration to run :ref:`synchronization_sample` in big-endian mode:
94
95.. zephyr-app-commands::
96   :zephyr-app: samples/synchronization
97   :host-os: unix
98   :board: qemu_malta_be
99   :goals: run
100
101
102References
103**********
104
105https://www.qemu.org/
106https://www.linux-mips.org/wiki/MIPS_Malta
107