diff --git a/README.md b/README.md index 3f1da63..cebcf8d 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ The different machines you can build for are: * freedom-u540: The SiFive HiFive Unleashed board * beaglev-starlight-jh7100: BeagleV - Based on Starlight JH7100 SOC +* mangopi-mq-pro: MangoPi MQ Pro - Based on Allwinner D1 SOC Note that this layer also provides improvements and features for the upstream qemuriscv32 and qemuriscv64 machines. @@ -86,6 +87,11 @@ To build an image to run on the BeagleV using Wayland run the following MACHINE=beaglev-starlight-jh7100 bitbake core-image-weston ``` +To build an image to run on the MangoPi MQ Pro (console only has been tested so far) run the following: +```text +MACHINE=mangopi-mq-pro bitbake core-image-base +``` + To build a full GUI equipped image running Plasma Mobile see the in-tree documentation [here](https://github.com/riscv/meta-riscv/blob/master/docs/Plasma-Mobile-on-Unleashed.md). ## Running in QEMU @@ -132,12 +138,19 @@ $ sudo bmaptool copy --bmap image.bmap ./freedom-u540-opensbi-201812181337-mmcbl ### dding wic.gz -The output of a ```freedom-u540``` or ```beaglev-starlight-jh7100``` build will be a ```.wic.gz``` file. You can write this file to an sd card using: +The output of a ```freedom-u540```, ```beaglev-starlight-jh7100``` or ```mangopi-mq-pro``` build will be a ```.wic.gz``` file. You can write this file to an sd card using: ```text $ zcat -.wic.gz | sudo dd of=/dev/sdX bs=4M iflag=fullblock oflag=direct conv=fsync status=progress ``` +### Using bmaptoop to write the image + +Instead of dding wic.gz image ```bmaptool``` (available in most Linux distributions and/or pip) can be used for more reliable and faster flashing. You can write this file to an sd card using: +```text +$ sudo bmaptool copy -.wic.gz /dev/sdX +``` + ## Maintainer(s) * Khem Raj `` diff --git a/conf/machine/mangopi-mq-pro.conf b/conf/machine/mangopi-mq-pro.conf new file mode 100644 index 0000000..ec317b4 --- /dev/null +++ b/conf/machine/mangopi-mq-pro.conf @@ -0,0 +1,69 @@ +#@TYPE: Machine +#@NAME: mangopi-mq-pro +#@SOC: Allwinner D1 +#@DESCRIPTION: Machine configuration for MangoPi MQ Pro + +require conf/machine/include/riscv/tune-riscv.inc + +MACHINE_FEATURES = "screen keyboard ext2 ext3 serial wifi bluetooth" + +KERNEL_CLASSES = "kernel-fitimage" +KERNEL_IMAGETYPE = "fitImage" +UBOOT_ENV ?= "boot" +UBOOT_ENV_SUFFIX = "scr.uimg" +PREFERRED_PROVIDER_virtual/kernel ?= "linux-nezha-dev" +PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-nezha" + +PREFERRED_VERSION_openocd-native = "riscv" +PREFERRED_VERSION_openocd = "riscv" + +EXTRA_IMAGEDEPENDS += "opensbi" +RISCV_SBI_PLAT = "generic" + +## This sets u-boot as the default OpenSBI payload +### Nezha board uses TOC1 images loaded by SPL and containing U-Boot, DTB, and +### OpenSBI so 'RISCV_SBI_PAYLOAD' isn't used. +### 'RISCV_SBI_FDT' isn't used because the DTB is loaded from RAM at +### ${fdtcontroladdr} +#RISCV_SBI_PAYLOAD ?= "u-boot.bin" +#RISCV_SBI_FDT ?= "sun20i-d1-nezha.dtb" + +SERIAL_CONSOLES = "115200;ttyS0" + +MACHINE_EXTRA_RRECOMMENDS += " kernel-modules" + +IMAGE_FSTYPES += "wic.gz wic.bmap ext4" + +### 'KERNEL_DEVICETREE' isn't used because the DTB is loaded from RAM +### at address ${fdtcontroladdr} +#KERNEL_DEVICETREE ?= "allwinner/sun20i-d1-nezha.dtb" + +## Do not update fstab file when using wic images +WIC_CREATE_EXTRA_ARGS ?= "--no-fstab-update" + +EXTRA_IMAGEDEPENDS += "u-boot-nezha" +UBOOT_MACHINE = "nezha_defconfig" + + +UBOOT_ENTRYPOINT = "0x40200000" +UBOOT_DTB_LOADADDRESS = "0x4FA00000" +UBOOT_DTB = "1" +UBOOT_DTB_BINARY ?= "sun20i-d1-mangopi-mq-pro.dtb" + +MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= "kernel-module-rtl8723ds" + +## wic default support +WKS_FILE_DEPENDS ?= " \ + u-boot-nezha \ + opensbi \ + e2fsprogs-native \ + bmap-tools-native \ +" + +IMAGE_BOOT_FILES ?= " \ + ${KERNEL_IMAGETYPE} \ + boot.scr.uimg \ + uEnv.txt \ +" + +WKS_FILE ?= "nezha.wks" diff --git a/recipes-bsp/u-boot/u-boot-nezha.bb b/recipes-bsp/u-boot/u-boot-nezha.bb index 03c3f87..d82a1c5 100644 --- a/recipes-bsp/u-boot/u-boot-nezha.bb +++ b/recipes-bsp/u-boot/u-boot-nezha.bb @@ -44,7 +44,7 @@ do_deploy:append() { install -m 644 ${WORKDIR}/uEnv-nezha.txt ${DEPLOYDIR}/uEnv.txt } -COMPATIBLE_MACHINE = "(nezha-allwinner-d1)" +COMPATIBLE_MACHINE = "(nezha-allwinner-d1|mangopi-mq-pro)" TOOLCHAIN = "gcc" diff --git a/recipes-kernel/linux/linux-nezha-dev.bb b/recipes-kernel/linux/linux-nezha-dev.bb index ddc736b..86c25f2 100644 --- a/recipes-kernel/linux/linux-nezha-dev.bb +++ b/recipes-kernel/linux/linux-nezha-dev.bb @@ -27,6 +27,6 @@ KERNEL_FEATURES += "ktypes/standard/standard.cfg" # using out-of-tree #KBUILD_DEFCONFIG = "nezha_defconfig" -COMPATIBLE_MACHINE = "(nezha-allwinner-d1)" +COMPATIBLE_MACHINE = "(nezha-allwinner-d1|mangopi-mq-pro)" KERNEL_VERSION_SANITY_SKIP="1"