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