From ea90d9dcbae7bfffa42f2287bb33060e6a95bd0b Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Wed, 26 Sep 2018 07:33:01 +0200 Subject: [PATCH 1/9] meta-resin-allwinner:layer.conf: Remove missing dtbs for Nanopi Neo Air We switched the Nanopi Neo Air to the mainline kernel and this kernel does not yet have these additional dtbs that the armbian kernel has. Changelog-entry: Do not package missing armbian dtbs for the Nanopi Neo Air Signed-off-by: Florin Sarbu --- .../recipes-core/images/resin-image.inc | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/layers/meta-resin-allwinner/recipes-core/images/resin-image.inc b/layers/meta-resin-allwinner/recipes-core/images/resin-image.inc index 5cb78f1..e66d7a9 100644 --- a/layers/meta-resin-allwinner/recipes-core/images/resin-image.inc +++ b/layers/meta-resin-allwinner/recipes-core/images/resin-image.inc @@ -85,27 +85,7 @@ RESIN_IMAGE_BOOTLOADER_nanopi-neo-air = "u-boot" RESIN_BOOT_PARTITION_FILES_nanopi-neo-air = " \ ${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin:/${KERNEL_IMAGETYPE} \ uImage-sun8i-h3-nanopi-neo-air.dtb:/dtb/sun8i-h3-nanopi-neo-air.dtb \ - uImage-sun8i-h3-fixup.scr:/dtb/overlay/sun8i-h3-fixup.scr \ - uImage-sun8i-h3-analog-codec.dtbo:/dtb/overlay/sun8i-h3-analog-codec.dtbo \ - uImage-sun8i-h3-cir.dtbo:/dtb/overlay/sun8i-h3-cir.dtbo \ - uImage-sun8i-h3-i2c0.dtbo:/dtb/overlay/sun8i-h3-i2c0.dtbo \ - uImage-sun8i-h3-i2c1.dtbo:/dtb/overlay/sun8i-h3-i2c1.dtbo \ - uImage-sun8i-h3-i2c2.dtbo:/dtb/overlay/sun8i-h3-i2c2.dtbo \ - uImage-sun8i-h3-pps-gpio.dtbo:/dtb/overlay/sun8i-h3-pps-gpio.dtbo \ - uImage-sun8i-h3-pwm.dtbo:/dtb/overlay/sun8i-h3-pwm.dtbo \ - uImage-sun8i-h3-spdif-out.dtbo:/dtb/overlay/sun8i-h3-spdif-out.dtbo \ - uImage-sun8i-h3-spi-add-cs1.dtbo:/dtb/overlay/sun8i-h3-spi-add-cs1.dtbo \ - uImage-sun8i-h3-spi-jedec-nor.dtbo:/dtb/overlay/sun8i-h3-spi-jedec-nor.dtbo \ - uImage-sun8i-h3-spi-spidev.dtbo:/dtb/overlay/sun8i-h3-spi-spidev.dtbo \ - uImage-sun8i-h3-uart1.dtbo:/dtb/overlay/sun8i-h3-uart1.dtbo \ - uImage-sun8i-h3-uart2.dtbo:/dtb/overlay/sun8i-h3-uart2.dtbo \ - uImage-sun8i-h3-uart3.dtbo:/dtb/overlay/sun8i-h3-uart3.dtbo \ - uImage-sun8i-h3-usbhost0.dtbo:/dtb/overlay/sun8i-h3-usbhost0.dtbo \ - uImage-sun8i-h3-usbhost2.dtbo:/dtb/overlay/sun8i-h3-usbhost1.dtbo \ - uImage-sun8i-h3-usbhost3.dtbo:/dtb/overlay/sun8i-h3-usbhost2.dtbo \ - uImage-sun8i-h3-w1-gpio.dtbo:/dtb/overlay/sun8i-h3-w1-gpio.dtbo \ boot.scr:/boot.scr \ - armbianEnv.txt:/ \ " IMAGE_CMD_resinos-img_append_nanopi-neo-air () { From 568484ce19051d8301dd4edf92ced920365d964f Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Wed, 26 Sep 2018 07:49:12 +0200 Subject: [PATCH 2/9] layers/meta-sunxi: Update to latest sumo This update adds eMMC support in u-boot and kernel Changelog-entry: Update the meta-sunxi submodule to latest sumo Signed-off-by: Florin Sarbu --- layers/meta-sunxi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layers/meta-sunxi b/layers/meta-sunxi index df468d7..29b20da 160000 --- a/layers/meta-sunxi +++ b/layers/meta-sunxi @@ -1 +1 @@ -Subproject commit df468d72d74b6af224060b78e4d5daf66c536cb6 +Subproject commit 29b20da5e8cdea846c26d47a930d16114d71e0ca From d9db680fbdfb2027ec2a38b4bbd72fd5e234cf88 Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Tue, 9 Oct 2018 09:06:56 +0200 Subject: [PATCH 3/9] u-boot_2018.03.bbappend: Integrate with resin-u-boot Signed-off-by: Florin Sarbu --- ...0001-Add-Resin-specific-boot-command.patch | 34 +++++++++++++++++++ .../u-boot/u-boot_2018.03.bbappend | 6 ++++ 2 files changed, 40 insertions(+) create mode 100644 layers/meta-resin-allwinner/recipes-bsp/u-boot/files/0001-Add-Resin-specific-boot-command.patch create mode 100644 layers/meta-resin-allwinner/recipes-bsp/u-boot/u-boot_2018.03.bbappend diff --git a/layers/meta-resin-allwinner/recipes-bsp/u-boot/files/0001-Add-Resin-specific-boot-command.patch b/layers/meta-resin-allwinner/recipes-bsp/u-boot/files/0001-Add-Resin-specific-boot-command.patch new file mode 100644 index 0000000..c02d721 --- /dev/null +++ b/layers/meta-resin-allwinner/recipes-bsp/u-boot/files/0001-Add-Resin-specific-boot-command.patch @@ -0,0 +1,34 @@ +From 38cf0c1e4a9c1e0f73740f6ba8dc7c39964a0288 Mon Sep 17 00:00:00 2001 +From: Sebastian Panceac +Date: Fri, 16 Mar 2018 15:35:32 +0100 +Subject: [PATCH] Add Resin specific boot command + +Upstream-Status: Inappropriate [Resin specific] + +Signed-off-by: Sebastian Panceac +--- + include/configs/sunxi-common.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h +index 4391a8c..2c82dda 100644 +--- a/include/configs/sunxi-common.h ++++ b/include/configs/sunxi-common.h +@@ -454,6 +454,14 @@ extern int soft_i2c_gpio_scl; + #endif + + #include ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND \ ++ "setenv resin_kernel_load_addr ${kernel_addr_r};" \ ++ "run resin_set_kernel_root;" \ ++ "setenv bootargs ${resin_kernel_root} rootfstype=ext4 rootwait console=$console;" \ ++ "fatload ${resin_dev_type} ${resin_dev_index}:${resin_boot_part} ${resin_kernel_load_addr} uimage;" \ ++ "fatload ${resin_dev_type} ${resin_dev_index}:${resin_boot_part} ${fdt_addr_r} dtb/${fdtfile};" \ ++ "bootm ${resin_kernel_load_addr} - ${fdt_addr_r}" + + #ifdef CONFIG_USB_KEYBOARD + #define CONSOLE_STDIN_SETTINGS \ +-- +2.7.4 + diff --git a/layers/meta-resin-allwinner/recipes-bsp/u-boot/u-boot_2018.03.bbappend b/layers/meta-resin-allwinner/recipes-bsp/u-boot/u-boot_2018.03.bbappend new file mode 100644 index 0000000..b0d8e18 --- /dev/null +++ b/layers/meta-resin-allwinner/recipes-bsp/u-boot/u-boot_2018.03.bbappend @@ -0,0 +1,6 @@ +UBOOT_KCONFIG_SUPPORT = "1" +inherit resin-u-boot + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += "file://0001-Add-Resin-specific-boot-command.patch" From 505916c4fbe4605502268c66b402aaddda2fb369 Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Tue, 9 Oct 2018 09:30:39 +0200 Subject: [PATCH 4/9] meta-resin-allwinner:layer.conf: Use kernel 4.16.13 for Nanopi Neo Air For the Nanopi Neo Air we stick to the kernel from the BSP Signed-off-by: Florin Sarbu --- layers/meta-resin-allwinner/conf/layer.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layers/meta-resin-allwinner/conf/layer.conf b/layers/meta-resin-allwinner/conf/layer.conf index f78f2de..00a1677 100644 --- a/layers/meta-resin-allwinner/conf/layer.conf +++ b/layers/meta-resin-allwinner/conf/layer.conf @@ -8,3 +8,5 @@ BBFILE_PATTERN_resin-allwinner := "^${LAYERDIR}/" BBFILE_PRIORITY_resin-allwinner = "1337" LAYERSERIES_COMPAT_resin-allwinner = "sumo" + +PREFERRED_VERSION_linux-mainline_nanopi-neo-air = "4.16.13" From 1fba472bf67812e93ef6d391e6c83f786aa81cf9 Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Tue, 9 Oct 2018 09:36:48 +0200 Subject: [PATCH 5/9] nanopi-neo-air.coffee: Update instructions The Nanopi Neo Air has an eMMC so we update barys and the user provisioning instructions to match this fact. Signed-off-by: Florin Sarbu --- nanopi-neo-air.coffee | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/nanopi-neo-air.coffee b/nanopi-neo-air.coffee index 12e0152..ab81fa0 100644 --- a/nanopi-neo-air.coffee +++ b/nanopi-neo-air.coffee @@ -2,6 +2,12 @@ deviceTypesCommon = require '@resin.io/device-types/common' { networkOptions, commonImg, instructions } = deviceTypesCommon +postProvisioningInstructions = [ + instructions.BOARD_SHUTDOWN + instructions.REMOVE_INSTALL_MEDIA + instructions.BOARD_REPOWER +] + module.exports = version: 1 slug: 'nanopi-neo-air' @@ -9,7 +15,16 @@ module.exports = arch: 'armv7hf' state: 'experimental' - instructions: commonImg.instructions + stateInstructions: + postProvisioning: postProvisioningInstructions + + instructions: [ + instructions.ETCHER_SD + instructions.EJECT_SD + instructions.FLASHER_WARNING + instructions.CONNECT_AND_BOOT + ].concat(postProvisioningInstructions) + gettingStartedLink: windows: 'https://docs.resin.io/nanopi-neo-air/nodejs/getting-started/#adding-your-first-device' osx: 'https://docs.resin.io/nanopi-neo-air/nodejs/getting-started/#adding-your-first-device' @@ -20,10 +35,10 @@ module.exports = yocto: machine: 'nanopi-neo-air' - image: 'resin-image' + image: 'resin-image-flasher' fstype: 'resinos-img' version: 'yocto-sumo' - deployArtifact: 'resin-image-nanopi-neo-air.resinos-img' + deployArtifact: 'resin-image-flasher-nanopi-neo-air.resinos-img' compressed: true configuration: From 18a43a8e6a53d7666028cae0295b842a5fa562de Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Tue, 9 Oct 2018 10:08:43 +0200 Subject: [PATCH 6/9] resin-image.inc: Add the SPL in resin-boot for Nanopi Neo Air This additon is needed for hostOS updates Signed-off-by: Florin Sarbu --- layers/meta-resin-allwinner/recipes-core/images/resin-image.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/layers/meta-resin-allwinner/recipes-core/images/resin-image.inc b/layers/meta-resin-allwinner/recipes-core/images/resin-image.inc index e66d7a9..d1d79ca 100644 --- a/layers/meta-resin-allwinner/recipes-core/images/resin-image.inc +++ b/layers/meta-resin-allwinner/recipes-core/images/resin-image.inc @@ -86,6 +86,7 @@ RESIN_BOOT_PARTITION_FILES_nanopi-neo-air = " \ ${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin:/${KERNEL_IMAGETYPE} \ uImage-sun8i-h3-nanopi-neo-air.dtb:/dtb/sun8i-h3-nanopi-neo-air.dtb \ boot.scr:/boot.scr \ + u-boot-sunxi-with-spl.bin: \ " IMAGE_CMD_resinos-img_append_nanopi-neo-air () { From e9dfd398affa92ff79f660b2406a53f3e0e32c3d Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Tue, 9 Oct 2018 14:03:56 +0200 Subject: [PATCH 7/9] linux-firmware_%.bbappend: Add and package nvram settings for AP6212A This WiFi chipset is on a Nanopi Neo Air variant. File is taken from https://github.com/BPI-SINOVOIP/BPI-files/blob/master/others/brcm/ lib/firmware/ap6212/nvram.txt Signed-off-by: Florin Sarbu --- .../files/brcmfmac43430-sdio.txt | 54 +++++++++++++++++++ .../linux-firmware/linux-firmware_%.bbappend | 10 ++++ 2 files changed, 64 insertions(+) create mode 100644 layers/meta-resin-allwinner/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.txt diff --git a/layers/meta-resin-allwinner/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.txt b/layers/meta-resin-allwinner/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.txt new file mode 100644 index 0000000..578376c --- /dev/null +++ b/layers/meta-resin-allwinner/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.txt @@ -0,0 +1,54 @@ +#AP6212_NVRAM_V1.0_20140603 +# 2.4 GHz, 20 MHz BW mode + +# The following parameter values are just placeholders, need to be updated. +manfid=0x2d0 +prodid=0x0726 +vendid=0x14e4 +devid=0x43e2 +boardtype=0x0726 +boardrev=0x1101 +boardnum=22 +macaddr=00:90:4c:c5:12:38 +sromrev=11 +boardflags=0x00404201 +xtalfreq=26000 +nocrc=1 +ag0=255 +aa2g=1 +ccode=ALL + +pa0itssit=0x20 +extpagain2g=0 + +#PA parameters for 2.4GHz, measured at CHIP OUTPUT +pa2ga0=-168,7161,-820 +AvVmid_c0=0x0,0xc8 +cckpwroffset0=5 + +# PPR params +maxp2ga0=90 +txpwrbckof=6 +cckbw202gpo=0x5555 +legofdmbw202gpo=0x77777777 +mcsbw202gpo=0xaaaaaaaa + +# OFDM IIR : +ofdmdigfilttype=7 +# PAPD mode: +papdmode=2 + +il0macaddr=00:90:4c:c5:12:38 +wl0id=0x431b + +#OOB parameters +hostwake=0x40 +hostrdy=0x41 +usbrdy=0x03 +usbrdydelay=100 +deadman_to=0xffffffff +# muxenab: 0x1 for UART enable, 0x10 for Host awake +muxenab=0x10 +# CLDO PWM voltage settings - 0x4 - 1.1 volt +#cldo_pwm=0x4 + diff --git a/layers/meta-resin-allwinner/recipes-kernel/linux-firmware/linux-firmware_%.bbappend b/layers/meta-resin-allwinner/recipes-kernel/linux-firmware/linux-firmware_%.bbappend index 9d9b954..f38511b 100644 --- a/layers/meta-resin-allwinner/recipes-kernel/linux-firmware/linux-firmware_%.bbappend +++ b/layers/meta-resin-allwinner/recipes-kernel/linux-firmware/linux-firmware_%.bbappend @@ -9,6 +9,7 @@ SRC_URI_append = " \ file://brcmfmac43430a0-sdio.txt \ file://config.txt \ file://brcmfmac43362-sdio.txt \ + file://brcmfmac43430-sdio.txt \ " do_install_append() { @@ -22,6 +23,11 @@ do_install_append() { cp ${WORKDIR}/brcmfmac43362-sdio.txt ${D}/lib/firmware/brcm/ } +do_install_append_nanopi-neo-air() { + mkdir -p ${D}/${nonarch_base_libdir}/firmware/brcm + install -m 0644 ${WORKDIR}/brcmfmac43430-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm +} + PACKAGES =+ "${PN}-ap6212 ${PN}-brcm43362" FILES_${PN}-ap6212 = " \ @@ -37,3 +43,7 @@ FILES_${PN}-brcm43362 = " \ /lib/firmware/brcm/brcmfmac43362-sdio.bin \ /lib/firmware/brcm/brcmfmac43362-sdio.txt \ " + +FILES_${PN}-bcm43430_append_nanopi-neo-air = " \ + ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt \ +" From ae4164c044a4bda4a2708025086aeabfc6f925e7 Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Tue, 9 Oct 2018 14:05:48 +0200 Subject: [PATCH 8/9] packagegroup-resin-connectivity.bbappend: Add linux-firmware-bcm43430 This package adds the firmware for a WiFi chipset (AP6212A) present on a variant of the Nanopi Neo Air. Signed-off-by: Florin Sarbu --- .../packagegroups/packagegroup-resin-connectivity.bbappend | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layers/meta-resin-allwinner/recipes-core/packagegroups/packagegroup-resin-connectivity.bbappend b/layers/meta-resin-allwinner/recipes-core/packagegroups/packagegroup-resin-connectivity.bbappend index de8cf2c..e34d669 100644 --- a/layers/meta-resin-allwinner/recipes-core/packagegroups/packagegroup-resin-connectivity.bbappend +++ b/layers/meta-resin-allwinner/recipes-core/packagegroups/packagegroup-resin-connectivity.bbappend @@ -1,2 +1,4 @@ CONNECTIVITY_FIRMWARES_append = " linux-firmware-ap6212 linux-firmware-brcm43362" CONNECTIVITY_MODULES_append = " rtl8189" + +CONNECTIVITY_FIRMWARES_append_nanopi-neo-air = " linux-firmware-bcm43430" From 4cd258fe9042b9d28e815e361c9756ece1fe56df Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Wed, 26 Sep 2018 07:50:11 +0200 Subject: [PATCH 9/9] layers/meta-resin: Update to v2.19.0 Update meta-resin from 2.14.3 to 2.19.0 Changelog-entry: Update the meta-resin submodule from v2.14.3 to v2.19.0 Signed-off-by: Florin Sarbu --- layers/meta-resin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layers/meta-resin b/layers/meta-resin index 6936d46..47a185d 160000 --- a/layers/meta-resin +++ b/layers/meta-resin @@ -1 +1 @@ -Subproject commit 6936d4603e71eb162edbb5d65c6027b80cf10a11 +Subproject commit 47a185d60ca0af6ff4bd156f1abc31df59e71f40