qemu

FORK: QEMU emulator
git clone https://git.neptards.moe/neptards/qemu.git
Log | Files | Refs | Submodules | LICENSE

sabrelite.rst (3593B)


      1 Boundary Devices SABRE Lite (``sabrelite``)
      2 ===========================================
      3 
      4 Boundary Devices SABRE Lite i.MX6 Development Board is a low-cost development
      5 platform featuring the powerful Freescale / NXP Semiconductor's i.MX 6 Quad
      6 Applications Processor.
      7 
      8 Supported devices
      9 -----------------
     10 
     11 The 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 
     29 Please note above list is a complete superset the QEMU SABRE Lite machine can
     30 support. For a normal use case, a device tree blob that represents a real world
     31 SABRE Lite board, only exposes a subset of devices to the guest software.
     32 
     33 Boot options
     34 ------------
     35 
     36 The SABRE Lite machine can start using the standard -kernel functionality
     37 for loading a Linux kernel, U-Boot bootloader or ELF executable.
     38 
     39 Running Linux kernel
     40 --------------------
     41 
     42 Linux mainline v5.10 release is tested at the time of writing. To build a Linux
     43 mainline kernel that can be booted by the SABRE Lite machine, simply configure
     44 the 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 
     53 To 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 
     64 Running U-Boot
     65 --------------
     66 
     67 U-Boot mainline v2020.10 release is tested at the time of writing. To build a
     68 U-Boot mainline bootloader that can be booted by the SABRE Lite machine, use
     69 the 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 
     76 Note we need to adjust settings by:
     77 
     78 .. code-block:: bash
     79 
     80   $ make menuconfig
     81 
     82 then manually select the following configuration in U-Boot:
     83 
     84   Device Tree Control > Provider of DTB for DT Control > Embedded DTB
     85 
     86 To start U-Boot using the SABRE Lite machine, provide the u-boot binary to
     87 the -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 
     95 The following example shows booting Linux kernel from dhcp, and uses the
     96 rootfs on an SD card. This requires some additional command line parameters
     97 for 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 
    104 The directory for the built-in TFTP server should also contain the device tree
    105 blob of the SABRE Lite board. The sample SD card image was populated with the
    106 root file system with one single partition. You may adjust the kernel "root="
    107 boot parameter accordingly.
    108 
    109 After U-Boot boots, type the following commands in the U-Boot command shell to
    110 boot 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