Add support for OrangePi Plus2 board

Signed-off-by: Sebastian Panceac <sebastian@resin.io>
This commit is contained in:
Sebastian Panceac 2018-05-09 10:39:54 +02:00 committed by Florin Sarbu
parent a205c887d0
commit d665afba57
15 changed files with 342 additions and 3 deletions

View file

@ -1,6 +1,8 @@
Change log
-----------
* Add support for the OrangePi Plus2 device [Sebastian]
# v2.12.6+rev1
## (2018-05-02)

View file

@ -8,3 +8,4 @@ include conf/machine/bananapi.conf
KERNEL_DEVICETREE = "sun7i-a20-bananapi-m1-plus.dtb"
UBOOT_MACHINE = "bananapi_m1_plus_config"
PREFERRED_VERSION_linux-mainline = "4.14.15"

View file

@ -0,0 +1,9 @@
#@TYPE: Machine
#@NAME: Orange Pi Plus 2
#@DESCRIPTION: Machine configuration for the Orange Pi Plus2, based on allwinner H3 CPU http://www.orangepi.org/
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h3-orangepi-plus.dtb"
UBOOT_MACHINE = "orangepi_plus_defconfig"
PREFERRED_VERSION_linux-mainline = "4.15.18"

View file

@ -0,0 +1,7 @@
do_install_append() {
cat << EOF >> ${D}${sysconfdir}/NetworkManager/NetworkManager.conf
[device]
wifi.scan-rand-mac-address=no
EOF
}

View file

@ -1,3 +1,22 @@
#
# Orange Pi Plus2
#
IMAGE_FSTYPES_append_orangepi-plus2 = " resinos-img"
# Customize resinos-img
RESIN_IMAGE_BOOTLOADER_orangepi-plus2 = "u-boot"
RESIN_BOOT_PARTITION_FILES_orangepi-plus2 = " \
${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin:/${KERNEL_IMAGETYPE} \
uImage-sun8i-h3-orangepi-plus.dtb:/dtb/sun8i-h3-orangepi-plus.dtb \
u-boot-sunxi-with-spl.bin: \
"
IMAGE_CMD_resinos-img_append_orangepi-plus2 () {
# Orange Pi Plus2 needs uboot written at a specific location
dd if=${DEPLOY_DIR_IMAGE}/u-boot-sunxi-with-spl.bin of=${RESIN_RAW_IMG} conv=notrunc seek=8 bs=1024
}
#
# bananapi-M1+
#

View file

@ -1 +1 @@
CONNECTIVITY_FIRMWARES_append = " linux-firmware-ap6212 linux-firmware-brcm43362"
CONNECTIVITY_MODULES_append = " rtl8189"

View file

@ -0,0 +1,153 @@
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_CGROUPS=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_PERF_EVENTS=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_ARCH_SUNXI=y
CONFIG_SMP=y
CONFIG_NR_CPUS=8
CONFIG_AEABI=y
CONFIG_HIGHMEM=y
CONFIG_CMA=y
CONFIG_ARM_APPENDED_DTB=y
CONFIG_ARM_ATAG_DTB_COMPAT=y
CONFIG_CPU_FREQ=y
CONFIG_CPUFREQ_DT=y
CONFIG_VFP=y
CONFIG_NEON=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_DIAG is not set
# CONFIG_IPV6 is not set
CONFIG_CAN=y
CONFIG_CAN_SUN4I=y
# CONFIG_WIRELESS is not set
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_DMA_CMA=y
CONFIG_BLK_DEV_SD=y
CONFIG_ATA=y
CONFIG_AHCI_SUNXI=y
CONFIG_NETDEVICES=y
CONFIG_SUN4I_EMAC=y
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_CADENCE is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CIRRUS is not set
# CONFIG_NET_VENDOR_FARADAY is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SMSC is not set
CONFIG_STMMAC_ETH=y
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_WLAN is not set
CONFIG_INPUT_EVDEV=y
CONFIG_KEYBOARD_SUN4I_LRADC=y
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_SUN4I=y
CONFIG_INPUT_MISC=y
CONFIG_INPUT_AXP20X_PEK=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=8
CONFIG_SERIAL_8250_RUNTIME_UARTS=8
CONFIG_SERIAL_8250_DW=y
CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_HW_RANDOM is not set
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MV64XXX=y
CONFIG_I2C_SUN6I_P2WI=y
CONFIG_SPI=y
CONFIG_SPI_SUN4I=y
CONFIG_SPI_SUN6I=y
CONFIG_GPIO_SYSFS=y
CONFIG_POWER_SUPPLY=y
CONFIG_CHARGER_AXP20X=y
CONFIG_BATTERY_AXP20X=y
CONFIG_AXP20X_POWER=y
CONFIG_THERMAL=y
CONFIG_CPU_THERMAL=y
CONFIG_WATCHDOG=y
CONFIG_SUNXI_WATCHDOG=y
CONFIG_MFD_AC100=y
CONFIG_MFD_AXP20X_I2C=y
CONFIG_MFD_AXP20X_RSB=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_AXP20X=y
CONFIG_REGULATOR_GPIO=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_RC_CORE=y
CONFIG_RC_DEVICES=y
CONFIG_IR_SUNXI=y
CONFIG_DRM=y
CONFIG_DRM_SUN4I=y
CONFIG_DRM_DUMB_VGA_DAC=y
CONFIG_FB_SIMPLE=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_SOC=y
CONFIG_SND_SUN4I_CODEC=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_MUSB_SUNXI=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_GADGET=y
CONFIG_MMC=y
CONFIG_MMC_SUNXI=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_INTF_SYSFS is not set
# CONFIG_RTC_INTF_PROC is not set
CONFIG_RTC_DRV_AC100=y
CONFIG_RTC_DRV_SUNXI=y
CONFIG_DMADEVICES=y
CONFIG_DMA_SUN6I=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_EXTCON=y
CONFIG_IIO=y
CONFIG_AXP20X_ADC=y
CONFIG_PWM=y
CONFIG_PWM_SUN4I=y
CONFIG_PHY_SUN4I_USB=y
CONFIG_PHY_SUN9I_USB=y
CONFIG_NVMEM=y
CONFIG_NVMEM_SUNXI_SID=y
CONFIG_EXT4_FS=y
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_PRINTK_TIME=y
CONFIG_DEBUG_FS=y
CONFIG_CRYPTO_DEV_SUN4I_SS=y

View file

@ -0,0 +1,33 @@
From 1752aabbc60776b8ff887fe6049f0eaab8e57bff Mon Sep 17 00:00:00 2001
From: Sebastian Panceac <sebastian@resin.io>
Date: Fri, 4 May 2018 11:48:13 +0200
Subject: [PATCH] Don't activate by default CFG80211_REQUIRE_SIGNED_REGDB
This kernel configuartion option gets enabled by default when enabling CFG80211 and pulls many other unwanted
configs.
Because it cannot be deactivated through usual means, we make it's activation dependent to its parent config: CFG80211_CERTIFICATION_ONUS.
Inspired by: https://patchwork.kernel.org/patch/10172165/
Upstream-Status: Pending
Signed-off-by: Sebastian Panceac <sebastian@resin.io>
---
net/wireless/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
index 1abcc4f..11f270a 100644
--- a/net/wireless/Kconfig
+++ b/net/wireless/Kconfig
@@ -89,7 +89,7 @@ config CFG80211_CERTIFICATION_ONUS
config CFG80211_REQUIRE_SIGNED_REGDB
bool "require regdb signature" if CFG80211_CERTIFICATION_ONUS
- default y
+ default CFG80211_CERTIFICATION_ONUS
select SYSTEM_DATA_VERIFICATION
help
Require that in addition to the "regulatory.db" file a
--
2.7.4

View file

@ -12,3 +12,11 @@ RESIN_CONFIGS_DEPS[axp_power] = "\
RESIN_CONFIGS[axp_power] ="\
CONFIG_AXP20X_POWER=y \
"
RESIN_CONFIGS_append_orangepi-plus2 = " wifi"
RESIN_CONFIGS[wifi] ="\
CONFIG_WIRELESS=y \
CONFIG_RFKILL=y \
CONFIG_CFG80211=m \
CONFIG_CFG80211_WEXT=y \
"

View file

@ -0,0 +1,25 @@
SECTION = "kernel"
DESCRIPTION = "Mainline Linux kernel"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
COMPATIBLE_MACHINE = "(sun4i|sun5i|sun7i|sun8i|sun50i)"
inherit kernel
# Since we're not using git, this doesn't make a difference, but we need to fill
# in something or kernel-yocto.bbclass will fail.
KBRANCH ?= "master"
# Pull in the devicetree files into the rootfs
RDEPENDS_${KERNEL_PACKAGE_NAME}-base += "kernel-devicetree"
KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
S = "${WORKDIR}/linux-${PV}"
SRC_URI[md5sum] = "2c7a9404ddf29580f14c61eb87e50c6e"
SRC_URI = "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${PV}.tar.xz \
file://defconfig \
file://don-t-default-activate-regdb.patch \
"

View file

@ -0,0 +1,16 @@
SUMMARY = "Realtek 8189ETV Wi-Fi driver"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://Kconfig;md5=042567f397b1c4b5cc35ab0a0cfdfb38"
inherit module
SRC_URI = " \
git://github.com/jwrdegoede/rtl8189ES_linux.git;protocol=https \
file://0001-Use-modules_install-as-wanted-by-yocto.patch \
"
SRCREV ="3dfd3e9ca67405bdd6352d5c2f887382859e0861"
S = "${WORKDIR}/git"
EXTRA_OEMAKE_append = " KSRC=${STAGING_KERNEL_DIR}"

View file

@ -0,0 +1,29 @@
From 8e13d9ad5e31ece37f281fa16801dda9d2ffb345 Mon Sep 17 00:00:00 2001
From: Sebastian Panceac <sebastian@resin.io>
Date: Wed, 2 May 2018 15:14:14 +0200
Subject: [PATCH] Use modules_install as wanted by yocto
Upstream-Status: Pending
Signed-off-by: Sebastian Panceac <sebastian@resin.io>
---
Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Makefile b/Makefile
index d44e822..8b24b3d 100755
--- a/Makefile
+++ b/Makefile
@@ -1639,6 +1639,9 @@ all: modules
modules:
$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) modules
+modules_install:
+ $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) modules_install
+
strip:
$(CROSS_COMPILE)strip $(MODULE_NAME).ko --strip-unneeded
--
2.7.4

View file

@ -11,7 +11,7 @@ uboot_file="u-boot-sunxi-with-spl.bin"
uboot_block_size=1024
uboot_seek_blocks=8
device="/dev/mmcblk0"
device="/dev/`$(findmnt --noheadings --canonicalize --output SOURCE /mnt/boot/ | xargs lsblk -no pkname)`"
update_files="uboot"

View file

@ -1,2 +1,4 @@
# Flash to internal eMMC - kernel always enumerates emmc as mmcblk2
INTERNAL_DEVICE_KERNEL_nanopi-neo-air = "mmcblk2"
INTERNAL_DEVICE_KERNEL_nanopi-neo-air = "mmcblk2"
INTERNAL_DEVICE_KERNEL_orangepi-plus2 = "mmcblk2"

35
orangepi-plus2.coffee Normal file
View file

@ -0,0 +1,35 @@
deviceTypesCommon = require '@resin.io/device-types/common'
{ networkOptions, commonImg, instructions } = deviceTypesCommon
module.exports =
version: 1
slug: 'orangepi-plus2'
name: 'Orange Pi Plus2'
arch: 'armv7hf'
state: 'experimental'
instructions: commonImg.instructions
gettingStartedLink:
windows: 'https://docs.resin.io/orangepi-plus2/nodejs/getting-started/#adding-your-first-device'
osx: 'https://docs.resin.io/orangepi-plus2/nodejs/getting-started/#adding-your-first-device'
linux: 'https://docs.resin.io/orangepi-plus2/nodejs/getting-started/#adding-your-first-device'
supportsBlink: true
options: [ networkOptions.group ]
yocto:
machine: 'orangepi-plus2'
image: 'resin-image-flasher'
fstype: 'resinos-img'
version: 'yocto-rocko'
deployArtifact: 'resin-image-flasher-orangepi-plus2.resinos-img'
compressed: true
configuration:
config:
partition:
primary: 1
path: '/config.json'
initialization: commonImg.initialization