xref: /openbmc/qemu/docs/system/arm/sabrelite.rst (revision 831734cc)
1Boundary Devices SABRE Lite (``sabrelite``)
2===========================================
3
4Boundary Devices SABRE Lite i.MX6 Development Board is a low-cost development
5platform featuring the powerful Freescale / NXP Semiconductor's i.MX 6 Quad
6Applications Processor.
7
8Supported devices
9-----------------
10
11The SABRE Lite machine supports the following devices:
12
13 * Up to 4 Cortex A9 cores
14 * Generic Interrupt Controller
15 * 1 Clock Controller Module
16 * 1 System Reset Controller
17 * 5 UARTs
18 * 2 EPIC timers
19 * 1 GPT timer
20 * 2 Watchdog timers
21 * 1 FEC Ethernet controller
22 * 3 I2C controllers
23 * 7 GPIO controllers
24 * 4 SDHC storage controllers
25 * 4 USB 2.0 host controllers
26 * 5 ECSPI controllers
27 * 1 SST 25VF016B flash
28
29Please note above list is a complete superset the QEMU SABRE Lite machine can
30support. For a normal use case, a device tree blob that represents a real world
31SABRE Lite board, only exposes a subset of devices to the guest software.
32
33Boot options
34------------
35
36The SABRE Lite machine can start using the standard -kernel functionality
37for loading a Linux kernel, U-Boot bootloader or ELF executable.
38
39Running Linux kernel
40--------------------
41
42Linux mainline v5.10 release is tested at the time of writing. To build a Linux
43mainline kernel that can be booted by the SABRE Lite machine, simply configure
44the kernel using the imx_v6_v7_defconfig configuration:
45
46.. code-block:: bash
47
48  $ export ARCH=arm
49  $ export CROSS_COMPILE=arm-linux-gnueabihf-
50  $ make imx_v6_v7_defconfig
51  $ make
52
53To boot the newly built Linux kernel in QEMU with the SABRE Lite machine, use:
54
55.. code-block:: bash
56
57  $ qemu-system-arm -M sabrelite -smp 4 -m 1G \
58      -display none -serial null -serial stdio \
59      -kernel arch/arm/boot/zImage \
60      -dtb arch/arm/boot/dts/imx6q-sabrelite.dtb \
61      -initrd /path/to/rootfs.ext4 \
62      -append "root=/dev/ram"
63
64Running U-Boot
65--------------
66
67U-Boot mainline v2020.10 release is tested at the time of writing. To build a
68U-Boot mainline bootloader that can be booted by the SABRE Lite machine, use
69the mx6qsabrelite_defconfig with similar commands as described above for Linux:
70
71.. code-block:: bash
72
73  $ export CROSS_COMPILE=arm-linux-gnueabihf-
74  $ make mx6qsabrelite_defconfig
75
76Note we need to adjust settings by:
77
78.. code-block:: bash
79
80  $ make menuconfig
81
82then manually select the following configuration in U-Boot:
83
84  Device Tree Control > Provider of DTB for DT Control > Embedded DTB
85
86To start U-Boot using the SABRE Lite machine, provide the u-boot binary to
87the -kernel argument, along with an SD card image with rootfs:
88
89.. code-block:: bash
90
91  $ qemu-system-arm -M sabrelite -smp 4 -m 1G \
92      -display none -serial null -serial stdio \
93      -kernel u-boot
94
95The following example shows booting Linux kernel from dhcp, and uses the
96rootfs on an SD card. This requires some additional command line parameters
97for QEMU:
98
99.. code-block:: none
100
101  -nic user,tftp=/path/to/kernel/zImage \
102  -drive file=sdcard.img,id=rootfs -device sd-card,drive=rootfs
103
104The directory for the built-in TFTP server should also contain the device tree
105blob of the SABRE Lite board. The sample SD card image was populated with the
106root file system with one single partition. You may adjust the kernel "root="
107boot parameter accordingly.
108
109After U-Boot boots, type the following commands in the U-Boot command shell to
110boot the Linux kernel:
111
112.. code-block:: none
113
114  => setenv ethaddr 00:11:22:33:44:55
115  => setenv bootfile zImage
116  => dhcp
117  => tftpboot 14000000 imx6q-sabrelite.dtb
118  => setenv bootargs root=/dev/mmcblk3p1
119  => bootz 12000000 - 14000000
120