From d1e20fbe84dc3cdbffeec6c9b3d086a282770866 Mon Sep 17 00:00:00 2001 From: Sergey Matyukevich Date: Wed, 31 Oct 2018 08:54:01 +0300 Subject: [PATCH 1/5] linux: specify explicit dependencies to configme task This change is an adaptation of commit 81e8a52e8e40e47 from poky/master. Linux kernel build dependencies include bison since v4.16. There were two different commits in poky adding those dependencies: - poky/master: 81e8a52e8e40e47 - poky/sumo: 20e4d309e12bf10 However just adding bison-native to DEPENDS in linux or linux-yocto class (as in poky/sumo) appears to be insufficient. The reason has been clarified in 81e8a52e8e40e47 commit message: "For linux-yocto, we also need to specify the compiler/tools dependencies for the configme task since it executes before configure and hence the main kernel build DEPENDS will not always be in the sysroot before it executes. Without those dependencies the kernel will be incorrectly configured (i.e. bison is missing) or the configuration will fail the mitigation tests." Layer meta-sunxi is compatible with multiple Yocto releases. Some of those releases have been developed and tested with earlier kernels. So they may not include new bison kernel build dependencies. That is why it makes sense to specify new kernel build dependencies explicitely in meta-sunxi kernel recipes rather than rely upon upper layers. Signed-off-by: Sergey Matyukevich --- recipes-kernel/linux/linux.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes-kernel/linux/linux.inc b/recipes-kernel/linux/linux.inc index bef63e2..3a8a155 100644 --- a/recipes-kernel/linux/linux.inc +++ b/recipes-kernel/linux/linux.inc @@ -35,6 +35,10 @@ kernel_conf_variable() { fi } +do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}binutils:do_populate_sysroot" +do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}gcc:do_populate_sysroot" +do_kernel_configme[depends] += "bc-native:do_populate_sysroot bison-native:do_populate_sysroot" + do_configure_prepend() { CONF_SED_SCRIPT="" From 15ad39d0e179679bb74ddc091b3f0939fd76df2c Mon Sep 17 00:00:00 2001 From: Marek Belisko Date: Tue, 30 Oct 2018 20:37:49 +0100 Subject: [PATCH 2/5] recipes-kernel: xradio: Added wifi driver for orange-pi-zero wifi Driver taken from: https://github.com/Halolo/orange-pi-distro.git Signed-off-by: Marek Belisko --- recipes-kernel/xradio/xradio.bb | 22 +++++++++++++++++++ .../xradio/Add_Targets_To_Makefile.patch | 19 ++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 recipes-kernel/xradio/xradio.bb create mode 100644 recipes-kernel/xradio/xradio/Add_Targets_To_Makefile.patch diff --git a/recipes-kernel/xradio/xradio.bb b/recipes-kernel/xradio/xradio.bb new file mode 100644 index 0000000..b7a6240 --- /dev/null +++ b/recipes-kernel/xradio/xradio.bb @@ -0,0 +1,22 @@ +SUMMARY = "Xradio WiFi driver for orangepi-zero" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=a23a74b3f4caf9616230789d94217acb" + +inherit module + +PV = "0.1" +PR = "r0" + +RDEPENDS_${PN} += "xradio-firmware" + +COMPATIBLE_MACHINE = "orange-pi-zero" + +SRCREV = "d649e5a78efdc56ecd0951e35ca60db175650232" + +SRC_URI = "git://github.com/fifteenhex/xradio.git;protocol=https \ + file://Add_Targets_To_Makefile.patch \ + " + +S = "${WORKDIR}/git" + +KERNEL_MODULE_AUTOLOAD += "xradio_wlan" diff --git a/recipes-kernel/xradio/xradio/Add_Targets_To_Makefile.patch b/recipes-kernel/xradio/xradio/Add_Targets_To_Makefile.patch new file mode 100644 index 0000000..8edfff0 --- /dev/null +++ b/recipes-kernel/xradio/xradio/Add_Targets_To_Makefile.patch @@ -0,0 +1,19 @@ +diff --git a/Makefile b/Makefile +index fd15d31..078a2ad 100644 +--- a/Makefile ++++ b/Makefile +@@ -50,3 +50,14 @@ ccflags-y += -DXRADIO_USE_LONG_KEEP_ALIVE_PERIOD + ldflags-y += --strip-debug + + obj-$(CONFIG_XRADIO) += xradio_wlan.o ++ ++SRC := $(shell pwd) ++ ++all: ++ $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules ++ ++modules_install: ++ $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install ++ ++clean: ++ $(MAKE) -C $(KERNEL_SRC) M=$(SRC) clean From 89714be7698dff3bbb8864e2708fd26780078e71 Mon Sep 17 00:00:00 2001 From: Marek Belisko Date: Tue, 30 Oct 2018 20:40:07 +0100 Subject: [PATCH 3/5] recipes-kernel: xradio-firmware: Added wifi firmware for orange-pi-zero Taken from: https://github.com/Halolo/orange-pi-distro.git Signed-off-by: Marek Belisko --- .../xradio-firmware/xradio-firmware.bb | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 recipes-kernel/xradio-firmware/xradio-firmware.bb diff --git a/recipes-kernel/xradio-firmware/xradio-firmware.bb b/recipes-kernel/xradio-firmware/xradio-firmware.bb new file mode 100644 index 0000000..368073b --- /dev/null +++ b/recipes-kernel/xradio-firmware/xradio-firmware.bb @@ -0,0 +1,25 @@ +DESCRIPTION = "Xradio xr819 WiFi firmware" +LICENSE = "CC0-1.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/${LICENSE};md5=0ceb3372c9595f0a8067e55da801e4a1" + +PV = "1.0" +PR = "r0" + +SRCREV = "8b4a4ed16f7f9d12e59ff2f9ceba3cc335374dbe" + +COMPATIBLE_MACHINE = "orange-pi-zero" + +SRC_URI = "git://github.com/armbian/build.git;protocol=https" + +S = "${WORKDIR}/git" + +do_install() { + install -d ${D}${base_libdir}/firmware/xr819 + install -m 0644 ${S}/bin/firmware-overlay/xr819/boot_xr819.bin ${D}${base_libdir}/firmware/xr819/ + install -m 0644 ${S}/bin/firmware-overlay/xr819/sdd_xr819.bin ${D}${base_libdir}/firmware/xr819/ + install -m 0644 ${S}/bin/firmware-overlay/xr819/fw_xr819.bin ${D}${base_libdir}/firmware/xr819/ +} + +FILES_${PN} = "${base_libdir}/*" + +PACKAGES = "${PN}" From 76a5f2b367810049e1bb914e2caff6dd2423131c Mon Sep 17 00:00:00 2001 From: Marek Belisko Date: Tue, 30 Oct 2018 20:40:36 +0100 Subject: [PATCH 4/5] linux-mainline: Added wifi dts changes for orange-pi-zero wifi Signed-off-by: Marek Belisko --- .../0001-add-wifi-support.patch | 79 +++++++++++++++++++ .../linux/linux-mainline_4.16.13.bb | 4 + 2 files changed, 83 insertions(+) create mode 100644 recipes-kernel/linux/linux-mainline/orange-pi-zero/0001-add-wifi-support.patch diff --git a/recipes-kernel/linux/linux-mainline/orange-pi-zero/0001-add-wifi-support.patch b/recipes-kernel/linux/linux-mainline/orange-pi-zero/0001-add-wifi-support.patch new file mode 100644 index 0000000..9487681 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline/orange-pi-zero/0001-add-wifi-support.patch @@ -0,0 +1,79 @@ +diff --git a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +index 6713d0f2b3f4..ad0829e8f716 100644 +--- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts ++++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +@@ -80,19 +80,22 @@ + }; + }; + +- reg_vcc_wifi: reg_vcc_wifi { ++ vdd_wifi: vdd_wifi { + compatible = "regulator-fixed"; +- regulator-min-microvolt = <3300000>; +- regulator-max-microvolt = <3300000>; +- regulator-name = "vcc-wifi"; +- enable-active-high; ++ regulator-name = "wifi"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; + gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>; ++ startup-delay-us = <70000>; ++ enable-active-high; + }; + +- wifi_pwrseq: wifi_pwrseq { ++ pwrseq_wifi: pwrseq_wifi@0 { + compatible = "mmc-pwrseq-simple"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&wifi_rst>; + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; +- post-power-on-delay-ms = <200>; ++ post-power-on-delay-ms = <50>; + }; + }; + +@@ -124,9 +127,11 @@ + &mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins_a>; +- vmmc-supply = <®_vcc_wifi>; +- mmc-pwrseq = <&wifi_pwrseq>; ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <&vdd_wifi>; ++ mmc-pwrseq = <&pwrseq_wifi>; + bus-width = <4>; ++ max-frequency = <16000000>; + non-removable; + status = "okay"; + +@@ -136,9 +141,30 @@ + */ + xr819: sdio_wifi@1 { + reg = <1>; ++ compatible = "xradio,xr819"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&wifi_wake>; ++ interrupt-parent = <&pio>; ++ interrupts = <6 10 IRQ_TYPE_EDGE_RISING>; ++ interrupt-names = "host-wake"; ++ local-mac-address = [dc 44 6d c0 ff ee]; + }; + }; + ++&pio { ++ wifi_wake: wifi_wake { ++ pins = "PG10"; ++ function = "gpio_in"; ++ }; ++}; ++ ++&r_pio { ++ wifi_rst: wifi_rst { ++ pins = "PL7"; ++ function = "gpio_out"; ++ }; ++}; ++ + &mmc1_pins_a { + bias-pull-up; + }; diff --git a/recipes-kernel/linux/linux-mainline_4.16.13.bb b/recipes-kernel/linux/linux-mainline_4.16.13.bb index 03d337c..bfb36e4 100644 --- a/recipes-kernel/linux/linux-mainline_4.16.13.bb +++ b/recipes-kernel/linux/linux-mainline_4.16.13.bb @@ -26,3 +26,7 @@ SRC_URI = "https://www.kernel.org/pub/linux/kernel/v4.x/linux-${PV}.tar.xz \ file://0003-ARM-dts-nanopi-neo-air-Add-WiFi-eMMC.patch \ file://defconfig \ " + +SRC_URI_append_orange-pi-zero += "\ + file://0001-add-wifi-support.patch \ + " From 6408de735cfb590ff84c176de14f9a64baf6352f Mon Sep 17 00:00:00 2001 From: Marek Belisko Date: Sat, 3 Nov 2018 22:43:29 +0100 Subject: [PATCH 5/5] xradio: Drop unnecessary patch when fix module compilation Signed-off-by: Marek Belisko --- recipes-kernel/xradio/xradio.bb | 3 ++- .../xradio/Add_Targets_To_Makefile.patch | 19 ------------------- 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 recipes-kernel/xradio/xradio/Add_Targets_To_Makefile.patch diff --git a/recipes-kernel/xradio/xradio.bb b/recipes-kernel/xradio/xradio.bb index b7a6240..32a516a 100644 --- a/recipes-kernel/xradio/xradio.bb +++ b/recipes-kernel/xradio/xradio.bb @@ -14,9 +14,10 @@ COMPATIBLE_MACHINE = "orange-pi-zero" SRCREV = "d649e5a78efdc56ecd0951e35ca60db175650232" SRC_URI = "git://github.com/fifteenhex/xradio.git;protocol=https \ - file://Add_Targets_To_Makefile.patch \ " S = "${WORKDIR}/git" +EXTRA_OEMAKE += "-C ${STAGING_KERNEL_DIR} M=${S}" + KERNEL_MODULE_AUTOLOAD += "xradio_wlan" diff --git a/recipes-kernel/xradio/xradio/Add_Targets_To_Makefile.patch b/recipes-kernel/xradio/xradio/Add_Targets_To_Makefile.patch deleted file mode 100644 index 8edfff0..0000000 --- a/recipes-kernel/xradio/xradio/Add_Targets_To_Makefile.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/Makefile b/Makefile -index fd15d31..078a2ad 100644 ---- a/Makefile -+++ b/Makefile -@@ -50,3 +50,14 @@ ccflags-y += -DXRADIO_USE_LONG_KEEP_ALIVE_PERIOD - ldflags-y += --strip-debug - - obj-$(CONFIG_XRADIO) += xradio_wlan.o -+ -+SRC := $(shell pwd) -+ -+all: -+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules -+ -+modules_install: -+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install -+ -+clean: -+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC) clean