From eb553bec071b58ee7c585a8d3b8df94285750467 Mon Sep 17 00:00:00 2001 From: Ryan Bray Date: Sun, 26 Aug 2018 14:09:49 -0600 Subject: [PATCH 01/37] Odroid-C2: updating kernel to 4.14.67 (#176) --- Documentation/kernel.md | 2 +- ...eson-gxm-Add-support-for-Khadas-VIM2.patch | 455 ------------------ ...n-add-USB3-PHY-support-for-Meson-GXL.patch | 260 ---------- ...-generic-platform-USB-roothub-driver.patch | 293 ----------- ...-plat-integrate-the-platform-roothub.patch | 146 ------ ...4-dts-meson-gxl-add-USB-host-support.patch | 99 ---- ...gxm-add-GXM-specific-USB-host-config.patch | 49 -- ...-gx-Enable-USB-on-GXL-and-GXM-boards.patch | 129 ----- ...gxl-add-sound-dai-cells-to-HDMI-node.patch | 26 - ...gxl-Take-eMMC-data-strobe-out-of-eMM.patch | 228 --------- ...gx-Add-HDMI_5V-regulator-on-selected.patch | 173 ------- ...activate-hdmi-audio-HDMI-enabled-boa.patch | 55 --- ...-phy-meson-gxl-detect-LPA-corruption.patch | 132 ----- ...37-drm-meson-fix-vsync-buffer-update.patch | 71 --- .../configs/odroid_c2_defconfig | 2 +- 15 files changed, 2 insertions(+), 2118 deletions(-) delete mode 100644 buildroot-external/board/hardkernel/odroid-c2/patches/linux/0001-ARM64-dts-meson-gxm-Add-support-for-Khadas-VIM2.patch delete mode 100644 buildroot-external/board/hardkernel/odroid-c2/patches/linux/0004-phy-meson-add-USB3-PHY-support-for-Meson-GXL.patch delete mode 100644 buildroot-external/board/hardkernel/odroid-c2/patches/linux/0005-usb-host-add-a-generic-platform-USB-roothub-driver.patch delete mode 100644 buildroot-external/board/hardkernel/odroid-c2/patches/linux/0006-usb-host-xhci-plat-integrate-the-platform-roothub.patch delete mode 100644 buildroot-external/board/hardkernel/odroid-c2/patches/linux/0007-ARM64-dts-meson-gxl-add-USB-host-support.patch delete mode 100644 buildroot-external/board/hardkernel/odroid-c2/patches/linux/0008-ARM64-dts-meson-gxm-add-GXM-specific-USB-host-config.patch delete mode 100644 buildroot-external/board/hardkernel/odroid-c2/patches/linux/0009-ARM64-dts-meson-gx-Enable-USB-on-GXL-and-GXM-boards.patch delete mode 100644 buildroot-external/board/hardkernel/odroid-c2/patches/linux/0029-ARM64-dts-meson-gxl-add-sound-dai-cells-to-HDMI-node.patch delete mode 100644 buildroot-external/board/hardkernel/odroid-c2/patches/linux/0030-ARM64-dts-meson-gxl-Take-eMMC-data-strobe-out-of-eMM.patch delete mode 100644 buildroot-external/board/hardkernel/odroid-c2/patches/linux/0032-ARM64-dts-meson-gx-Add-HDMI_5V-regulator-on-selected.patch delete mode 100644 buildroot-external/board/hardkernel/odroid-c2/patches/linux/0036-net-phy-meson-gxl-detect-LPA-corruption.patch delete mode 100644 buildroot-external/board/hardkernel/odroid-c2/patches/linux/0037-drm-meson-fix-vsync-buffer-update.patch diff --git a/Documentation/kernel.md b/Documentation/kernel.md index 24a78cb31..6ec230aa6 100644 --- a/Documentation/kernel.md +++ b/Documentation/kernel.md @@ -6,4 +6,4 @@ | Open Virtual Applicance | 4.14.67 | | Raspberry Pi | 4.14.66 | | Tinker Board | 4.14.67 | -| Odroid-C2 | 4.14.36 | +| Odroid-C2 | 4.14.67 | diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0001-ARM64-dts-meson-gxm-Add-support-for-Khadas-VIM2.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0001-ARM64-dts-meson-gxm-Add-support-for-Khadas-VIM2.patch deleted file mode 100644 index 243c10296..000000000 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0001-ARM64-dts-meson-gxm-Add-support-for-Khadas-VIM2.patch +++ /dev/null @@ -1,455 +0,0 @@ -From f802405c9aba2fb198d55fc010e7336f155c2713 Mon Sep 17 00:00:00 2001 -From: Neil Armstrong -Date: Wed, 2 Aug 2017 16:11:23 +0200 -Subject: [PATCH 01/39] ARM64: dts: meson-gxm: Add support for Khadas VIM2 - -The Khadas VIM2 is a Single Board Computer, respin of the origin -Khadas VIM board, using an Amlogic S912 SoC and more server oriented. - -It provides the same external connectors and header pinout, plus a SPI -NOR Flash, a reprogrammable STM8S003 MCU, FPC Connector, Cooling FAN header -and Pogo Pads Arrays. - -Cc: Gouwa -Acked-by: Martin Blumenstingl -Acked-by: Rob Herring -Signed-off-by: Neil Armstrong ---- - Documentation/devicetree/bindings/arm/amlogic.txt | 1 + - arch/arm64/boot/dts/amlogic/Makefile | 1 + - .../boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 399 +++++++++++++++++++++ - 3 files changed, 401 insertions(+) - create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts - -diff --git a/Documentation/devicetree/bindings/arm/amlogic.txt b/Documentation/devicetree/bindings/arm/amlogic.txt -index 4e4bc0b..a445997 100644 ---- a/Documentation/devicetree/bindings/arm/amlogic.txt -+++ b/Documentation/devicetree/bindings/arm/amlogic.txt -@@ -71,6 +71,7 @@ Board compatible values (alphabetically, grouped by SoC): - - - "amlogic,q200" (Meson gxm s912) - - "amlogic,q201" (Meson gxm s912) -+ - "khadas,vim2" (Meson gxm s912) - - "kingnovel,r-box-pro" (Meson gxm S912) - - "nexbox,a1" (Meson gxm s912) - -diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index 543416b..747bcc3 100644 ---- a/arch/arm64/boot/dts/amlogic/Makefile -+++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-nexbox-a95x.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-p212.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-p230.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-p231.dtb -+dtb-$(CONFIG_ARCH_MESON) += meson-gxm-khadas-vim2.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-nexbox-a1.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-q200.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-q201.dtb -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -new file mode 100644 -index 0000000..32c138e ---- /dev/null -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -@@ -0,0 +1,399 @@ -+/* -+ * Copyright (c) 2017 Martin Blumenstingl . -+ * Copyright (c) 2017 BayLibre, SAS -+ * Author: Neil Armstrong -+ * -+ * SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ */ -+ -+/dts-v1/; -+ -+#include -+#include -+ -+#include "meson-gxm.dtsi" -+ -+/ { -+ compatible = "khadas,vim2", "amlogic,s912", "amlogic,meson-gxm"; -+ model = "Khadas VIM2"; -+ -+ aliases { -+ serial0 = &uart_AO; -+ serial1 = &uart_A; -+ serial2 = &uart_AO_B; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ memory@0 { -+ device_type = "memory"; -+ reg = <0x0 0x0 0x0 0x80000000>; -+ }; -+ -+ adc-keys { -+ compatible = "adc-keys"; -+ io-channels = <&saradc 0>; -+ io-channel-names = "buttons"; -+ keyup-threshold-microvolt = <1710000>; -+ -+ button-function { -+ label = "Function"; -+ linux,code = ; -+ press-threshold-microvolt = <10000>; -+ }; -+ }; -+ -+ emmc_pwrseq: emmc-pwrseq { -+ compatible = "mmc-pwrseq-emmc"; -+ reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>; -+ }; -+ -+ gpio_fan: gpio-fan { -+ compatible = "gpio-fan"; -+ gpios = <&gpio GPIODV_14 GPIO_ACTIVE_HIGH -+ &gpio GPIODV_15 GPIO_ACTIVE_HIGH>; -+ /* Dummy RPM values since fan is optional */ -+ gpio-fan,speed-map = <0 0 -+ 1 1 -+ 2 2 -+ 3 3>; -+ cooling-min-level = <0>; -+ cooling-max-level = <3>; -+ #cooling-cells = <2>; -+ }; -+ -+ gpio-keys-polled { -+ compatible = "gpio-keys-polled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ poll-interval = <100>; -+ -+ button@0 { -+ label = "power"; -+ linux,code = ; -+ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ hdmi-connector { -+ compatible = "hdmi-connector"; -+ type = "a"; -+ -+ port { -+ hdmi_connector_in: endpoint { -+ remote-endpoint = <&hdmi_tx_tmds_out>; -+ }; -+ }; -+ }; -+ -+ pwmleds { -+ compatible = "pwm-leds"; -+ -+ power { -+ label = "vim:red:power"; -+ pwms = <&pwm_AO_ab 1 7812500 0>; -+ max-brightness = <255>; -+ linux,default-trigger = "default-on"; -+ }; -+ }; -+ -+ sdio_pwrseq: sdio-pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; -+ clocks = <&wifi32k>; -+ clock-names = "ext_clock"; -+ }; -+ -+ thermal-zones { -+ cpu-thermal { -+ polling-delay-passive = <250>; /* milliseconds */ -+ polling-delay = <1000>; /* milliseconds */ -+ -+ thermal-sensors = <&scpi_sensors 0>; -+ -+ trips { -+ cpu_alert0: cpu-alert0 { -+ temperature = <70000>; /* millicelsius */ -+ hysteresis = <2000>; /* millicelsius */ -+ type = "active"; -+ }; -+ -+ cpu_alert1: cpu-alert1 { -+ temperature = <80000>; /* millicelsius */ -+ hysteresis = <2000>; /* millicelsius */ -+ type = "passive"; -+ }; -+ }; -+ -+ cooling-maps { -+ map0 { -+ trip = <&cpu_alert0>; -+ cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; -+ }; -+ -+ map1 { -+ trip = <&cpu_alert1>; -+ cooling-device = <&gpio_fan 2 THERMAL_NO_LIMIT>; -+ }; -+ -+ map2 { -+ trip = <&cpu_alert1>; -+ cooling-device = -+ <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; -+ }; -+ -+ map3 { -+ trip = <&cpu_alert1>; -+ cooling-device = -+ <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; -+ }; -+ }; -+ }; -+ }; -+ -+ vcc_3v3: regulator-vcc_3v3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "VCC_3V3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ }; -+ -+ vddio_ao18: regulator-vddio_ao18 { -+ compatible = "regulator-fixed"; -+ regulator-name = "VDDIO_AO18"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ }; -+ -+ vddio_boot: regulator-vddio_boot { -+ compatible = "regulator-fixed"; -+ regulator-name = "VDDIO_BOOT"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ }; -+ -+ vddao_3v3: regulator-vddao_3v3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "VDDAO_3V3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ }; -+ -+ wifi32k: wifi32k { -+ compatible = "pwm-clock"; -+ #clock-cells = <0>; -+ clock-frequency = <32768>; -+ pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */ -+ }; -+}; -+ -+&cec_AO { -+ status = "okay"; -+ pinctrl-0 = <&ao_cec_pins>; -+ pinctrl-names = "default"; -+ hdmi-phandle = <&hdmi_tx>; -+}; -+ -+&cpu0 { -+ cooling-min-level = <0>; -+ cooling-max-level = <6>; -+ #cooling-cells = <2>; -+}; -+ -+&cpu4 { -+ cooling-min-level = <0>; -+ cooling-max-level = <4>; -+ #cooling-cells = <2>; -+}; -+ -+ðmac { -+ pinctrl-0 = <ð_pins>; -+ pinctrl-names = "default"; -+ -+ /* Select external PHY by default */ -+ phy-handle = <&external_phy>; -+ -+ amlogic,tx-delay-ns = <2>; -+ -+ /* External PHY reset is shared with internal PHY Led signals */ -+ snps,reset-gpio = <&gpio GPIOZ_14 0>; -+ snps,reset-delays-us = <0 10000 1000000>; -+ snps,reset-active-low; -+ -+ /* External PHY is in RGMII */ -+ phy-mode = "rgmii"; -+ -+ status = "okay"; -+}; -+ -+&external_mdio { -+ external_phy: ethernet-phy@0 { -+ /* Realtek RTL8211F (0x001cc916) */ -+ reg = <0>; -+ }; -+}; -+ -+&hdmi_tx { -+ status = "okay"; -+ pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; -+ pinctrl-names = "default"; -+}; -+ -+&hdmi_tx_tmds_port { -+ hdmi_tx_tmds_out: endpoint { -+ remote-endpoint = <&hdmi_connector_in>; -+ }; -+}; -+ -+&i2c_A { -+ status = "okay"; -+ pinctrl-0 = <&i2c_a_pins>; -+ pinctrl-names = "default"; -+}; -+ -+&i2c_B { -+ status = "okay"; -+ pinctrl-0 = <&i2c_b_pins>; -+ pinctrl-names = "default"; -+ -+ rtc: rtc@51 { -+ /* has to be enabled manually when a battery is connected: */ -+ status = "disabled"; -+ compatible = "haoyu,hym8563"; -+ reg = <0x51>; -+ #clock-cells = <0>; -+ clock-frequency = <32768>; -+ clock-output-names = "xin32k"; -+ }; -+}; -+ -+&ir { -+ status = "okay"; -+ pinctrl-0 = <&remote_input_ao_pins>; -+ pinctrl-names = "default"; -+ linux,rc-map-name = "rc-geekbox"; -+}; -+ -+&pwm_AO_ab { -+ status = "okay"; -+ pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>; -+ pinctrl-names = "default"; -+ clocks = <&clkc CLKID_FCLK_DIV4>; -+ clock-names = "clkin0"; -+}; -+ -+&pwm_ef { -+ status = "okay"; -+ pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>; -+ pinctrl-names = "default"; -+ clocks = <&clkc CLKID_FCLK_DIV4>; -+ clock-names = "clkin0"; -+}; -+ -+&sd_emmc_a { -+ status = "okay"; -+ pinctrl-0 = <&sdio_pins>; -+ pinctrl-names = "default"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ bus-width = <4>; -+ max-frequency = <100000000>; -+ -+ non-removable; -+ disable-wp; -+ -+ mmc-pwrseq = <&sdio_pwrseq>; -+ -+ vmmc-supply = <&vddao_3v3>; -+ vqmmc-supply = <&vddio_boot>; -+ -+ brcmf: wifi@1 { -+ reg = <1>; -+ compatible = "brcm,bcm4329-fmac"; -+ }; -+}; -+ -+/* SD card */ -+&sd_emmc_b { -+ status = "okay"; -+ pinctrl-0 = <&sdcard_pins>; -+ pinctrl-names = "default"; -+ -+ bus-width = <4>; -+ cap-sd-highspeed; -+ max-frequency = <100000000>; -+ disable-wp; -+ -+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>; -+ cd-inverted; -+ -+ vmmc-supply = <&vddao_3v3>; -+ vqmmc-supply = <&vddio_boot>; -+}; -+ -+/* eMMC */ -+&sd_emmc_c { -+ status = "okay"; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; -+ pinctrl-names = "default"; -+ -+ bus-width = <8>; -+ cap-sd-highspeed; -+ cap-mmc-highspeed; -+ max-frequency = <200000000>; -+ non-removable; -+ disable-wp; -+ mmc-ddr-1_8v; -+ mmc-hs200-1_8v; -+ -+ mmc-pwrseq = <&emmc_pwrseq>; -+ vmmc-supply = <&vcc_3v3>; -+ vqmmc-supply = <&vddio_boot>; -+}; -+ -+/* -+ * EMMC_DS pin is shared between SPI NOR CS and eMMC Data Strobe -+ * Remove emmc_ds_pins from sd_emmc_c pinctrl-0 then spifc can be enabled -+ */ -+&spifc { -+ status = "disabled"; -+ pinctrl-0 = <&nor_pins>; -+ pinctrl-names = "default"; -+ -+ w25q32: spi-flash@0 { -+ #address-cells = <1>; -+ #size-cells = <1>; -+ compatible = "winbond,w25q16", "jedec,spi-nor"; -+ reg = <0>; -+ spi-max-frequency = <3000000>; -+ }; -+}; -+ -+/* This one is connected to the Bluetooth module */ -+&uart_A { -+ status = "okay"; -+ pinctrl-0 = <&uart_a_pins>; -+ pinctrl-names = "default"; -+}; -+ -+/* This is brought out on the Linux_RX (18) and Linux_TX (19) pins: */ -+&uart_AO { -+ status = "okay"; -+ pinctrl-0 = <&uart_ao_a_pins>; -+ pinctrl-names = "default"; -+}; -+ -+/* This is brought out on the UART_RX_AO_B (15) and UART_TX_AO_B (16) pins: */ -+&uart_AO_B { -+ status = "okay"; -+ pinctrl-0 = <&uart_ao_b_pins>; -+ pinctrl-names = "default"; -+}; -+ -+&saradc { -+ status = "okay"; -+ vref-supply = <&vddio_ao18>; -+}; --- -2.7.4 - diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0004-phy-meson-add-USB3-PHY-support-for-Meson-GXL.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0004-phy-meson-add-USB3-PHY-support-for-Meson-GXL.patch deleted file mode 100644 index 527c72b66..000000000 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0004-phy-meson-add-USB3-PHY-support-for-Meson-GXL.patch +++ /dev/null @@ -1,260 +0,0 @@ -From 563fa3aaad2752079c8ee05819bf9923370f39aa Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Sat, 26 Nov 2016 15:56:32 +0100 -Subject: [PATCH 04/39] phy: meson: add USB3 PHY support for Meson GXL - -This adds USB3 PHY driver found on Meson GXL and GXM SoCs. - -Unfortunately there are no datasheets available for any of these PHYs. -Both drivers were written by reading the reference drivers provided by -Amlogic and analyzing the registers on the kernel that was shipped with -my board. - -Signed-off-by: Martin Blumenstingl -Signed-off-by: Neil Armstrong ---- - drivers/phy/amlogic/Kconfig | 13 ++ - drivers/phy/amlogic/Makefile | 1 + - drivers/phy/amlogic/phy-meson-gxl-usb3.c | 198 +++++++++++++++++++++++++++++++ - 3 files changed, 212 insertions(+) - create mode 100644 drivers/phy/amlogic/phy-meson-gxl-usb3.c - -diff --git a/drivers/phy/amlogic/Kconfig b/drivers/phy/amlogic/Kconfig -index cb8f450..5d11a3e 100644 ---- a/drivers/phy/amlogic/Kconfig -+++ b/drivers/phy/amlogic/Kconfig -@@ -13,6 +13,19 @@ config PHY_MESON8B_USB2 - Meson8b and GXBB SoCs. - If unsure, say N. - -+config PHY_MESON_GXL_USB3 -+ tristate "Meson GXL and GXM USB3 PHY drivers" -+ default ARCH_MESON -+ depends on OF && (ARCH_MESON || COMPILE_TEST) -+ depends on USB_SUPPORT -+ select USB_COMMON -+ select GENERIC_PHY -+ select REGMAP_MMIO -+ help -+ Enable this to support the Meson USB3 PHY found in Meson -+ GXL and GXM SoCs. -+ If unsure, say N. -+ - config PHY_MESON_GXL_USB2 - tristate "Meson GXL and GXM USB2 PHY drivers" - default ARCH_MESON -diff --git a/drivers/phy/amlogic/Makefile b/drivers/phy/amlogic/Makefile -index cfdc987..4fd8848 100644 ---- a/drivers/phy/amlogic/Makefile -+++ b/drivers/phy/amlogic/Makefile -@@ -1,2 +1,3 @@ - obj-$(CONFIG_PHY_MESON8B_USB2) += phy-meson8b-usb2.o - obj-$(CONFIG_PHY_MESON_GXL_USB2) += phy-meson-gxl-usb2.o -+obj-$(CONFIG_PHY_MESON_GXL_USB3) += phy-meson-gxl-usb3.o -diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb3.c b/drivers/phy/amlogic/phy-meson-gxl-usb3.c -new file mode 100644 -index 0000000..9af5222 ---- /dev/null -+++ b/drivers/phy/amlogic/phy-meson-gxl-usb3.c -@@ -0,0 +1,198 @@ -+/* -+ * Meson GXL USB3 PHY driver -+ * -+ * Copyright (C) 2016 Martin Blumenstingl -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see . -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define USB_R0 0x00 -+ #define USB_R0_P30_FSEL_SHIFT 0 -+ #define USB_R0_P30_FSEL_MASK GENMASK(5, 0) -+ #define USB_R0_P30_PHY_RESET BIT(6) -+ #define USB_R0_P30_TEST_POWERDOWN_HSP BIT(7) -+ #define USB_R0_P30_TEST_POWERDOWN_SSP BIT(8) -+ #define USB_R0_P30_ACJT_LEVEL_SHIFT 9 -+ #define USB_R0_P30_ACJT_LEVEL_MASK GENMASK(13, 9) -+ #define USB_R0_P30_TX_BOOST_LEVEL_SHIFT 14 -+ #define USB_R0_P30_TX_BOOST_LEVEL_MASK GENMASK(16, 14) -+ #define USB_R0_P30_LANE0_TX2RX_LOOPBACK BIT(17) -+ #define USB_R0_P30_LANE0_EXT_PCLK_REQ BIT(18) -+ #define USB_R0_P30_PCS_RX_LOS_MASK_VAL_SHIFT 19 -+ #define USB_R0_P30_PCS_RX_LOS_MASK_VAL_MASK GENMASK(28, 19) -+ #define USB_R0_U2D_SS_SCALEDOWN_MODE_SHIFT 29 -+ #define USB_R0_U2D_SS_SCALEDOWN_MODE_MASK GENMASK(30, 29) -+ #define USB_R0_U2D_ACT BIT(31) -+ -+#define USB_R1 0x04 -+ #define USB_R1_U3H_BIGENDIAN_GS BIT(0) -+ #define USB_R1_U3H_PME_ENABLE BIT(1) -+ #define USB_R1_U3H_HUB_PORT_OVERCURRENT_SHIFT 2 -+ #define USB_R1_U3H_HUB_PORT_OVERCURRENT_MASK GENMASK(6, 2) -+ #define USB_R1_U3H_HUB_PORT_PERM_ATTACH_SHIFT 7 -+ #define USB_R1_U3H_HUB_PORT_PERM_ATTACH_MASK GENMASK(11, 7) -+ #define USB_R1_U3H_HOST_U2_PORT_DISABLE_SHIFT 12 -+ #define USB_R1_U3H_HOST_U2_PORT_DISABLE_MASK GENMASK(15, 12) -+ #define USB_R1_U3H_HOST_U3_PORT_DISABLE BIT(16) -+ #define USB_R1_U3H_HOST_PORT_POWER_CONTROL_PRESENT BIT(17) -+ #define USB_R1_U3H_HOST_MSI_ENABLE BIT(18) -+ #define USB_R1_U3H_FLADJ_30MHZ_REG_SHIFT 19 -+ #define USB_R1_U3H_FLADJ_30MHZ_REG_MASK GENMASK(24, 19) -+ #define USB_R1_P30_PCS_TX_SWING_FULL_SHIFT 25 -+ #define USB_R1_P30_PCS_TX_SWING_FULL_MASK GENMASK(31, 25) -+ -+#define USB_R2 0x08 -+ #define USB_R2_P30_CR_DATA_IN_SHIFT 0 -+ #define USB_R2_P30_CR_DATA_IN_MASK GENMASK(15, 0) -+ #define USB_R2_P30_CR_READ BIT(16) -+ #define USB_R2_P30_CR_WRITE BIT(17) -+ #define USB_R2_P30_CR_CAP_ADDR BIT(18) -+ #define USB_R2_P30_CR_CAP_DATA BIT(19) -+ #define USB_R2_P30_PCS_TX_DEEMPH_3P5DB_SHIFT 20 -+ #define USB_R2_P30_PCS_TX_DEEMPH_3P5DB_MASK GENMASK(25, 20) -+ #define USB_R2_P30_PCS_TX_DEEMPH_6DB_SHIFT 26 -+ #define USB_R2_P30_PCS_TX_DEEMPH_6DB_MASK GENMASK(31, 26) -+ -+#define USB_R3 0x0c -+ #define USB_R3_P30_SSC_ENABLE BIT(0) -+ #define USB_R3_P30_SSC_RANGE_SHIFT 1 -+ #define USB_R3_P30_SSC_RANGE_MASK GENMASK(3, 1) -+ #define USB_R3_P30_SSC_REF_CLK_SEL_SHIFT 4 -+ #define USB_R3_P30_SSC_REF_CLK_SEL_MASK GENMASK(12, 4) -+ #define USB_R3_P30_REF_SSP_EN BIT(13) -+ #define USB_R3_P30_LOS_BIAS_SHIFT 16 -+ #define USB_R3_P30_LOS_BIAS_MASK GENMASK(18, 16) -+ #define USB_R3_P30_LOS_LEVEL_SHIFT 19 -+ #define USB_R3_P30_LOS_LEVEL_MASK GENMASK(23, 19) -+ #define USB_R3_P30_MPLL_MULTIPLIER_SHIFT 24 -+ #define USB_R3_P30_MPLL_MULTIPLIER_MASK GENMASK(30, 24) -+ -+#define USB_R4 0x10 -+ #define USB_R4_P21_PORT_RESET_0 BIT(0) -+ #define USB_R4_P21_SLEEP_M0 BIT(1) -+ #define USB_R4_MEM_PD_SHIFT 2 -+ #define USB_R4_MEM_PD_MASK GENMASK(3, 2) -+ #define USB_R4_P21_ONLY BIT(4) -+ -+#define USB_R5 0x14 -+ #define USB_R5_ID_DIG_SYNC BIT(0) -+ #define USB_R5_ID_DIG_REG BIT(1) -+ #define USB_R5_ID_DIG_CFG_SHIFT 2 -+ #define USB_R5_ID_DIG_CFG_MASK GENMASK(3, 2) -+ #define USB_R5_ID_DIG_EN_0 BIT(4) -+ #define USB_R5_ID_DIG_EN_1 BIT(5) -+ #define USB_R5_ID_DIG_CURR BIT(6) -+ #define USB_R5_ID_DIG_IRQ BIT(7) -+ #define USB_R5_ID_DIG_TH_SHIFT 8 -+ #define USB_R5_ID_DIG_TH_MASK GENMASK(15, 8) -+ #define USB_R5_ID_DIG_CNT_SHIFT 16 -+ #define USB_R5_ID_DIG_CNT_MASK GENMASK(23, 16) -+ -+/* read-only register */ -+#define USB_R6 0x18 -+ #define USB_R6_P30_CR_DATA_OUT_SHIFT 0 -+ #define USB_R6_P30_CR_DATA_OUT_MASK GENMASK(15, 0) -+ #define USB_R6_P30_CR_ACK BIT(16) -+ -+#define RESET_COMPLETE_TIME 500 -+ -+struct phy_meson_gxl_usb3_priv { -+ struct regmap *regmap; -+ struct phy *this_phy; -+}; -+ -+static const struct regmap_config phy_meson_gxl_usb3_regmap_conf = { -+ .reg_bits = 32, -+ .val_bits = 32, -+ .reg_stride = 4, -+ .max_register = USB_R6, -+}; -+ -+static int phy_meson_gxl_usb3_power_on(struct phy *phy) -+{ -+ struct phy_meson_gxl_usb3_priv *priv = phy_get_drvdata(phy); -+ -+ regmap_update_bits(priv->regmap, USB_R1, -+ USB_R1_U3H_FLADJ_30MHZ_REG_MASK, -+ 0x20 << USB_R1_U3H_FLADJ_30MHZ_REG_SHIFT); -+ -+ return 0; -+} -+ -+static const struct phy_ops phy_meson_gxl_usb3_ops = { -+ .power_on = phy_meson_gxl_usb3_power_on, -+ .owner = THIS_MODULE, -+}; -+ -+static int phy_meson_gxl_usb3_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct device_node *np = dev->of_node; -+ struct phy_meson_gxl_usb3_priv *priv; -+ struct resource *res; -+ struct phy *phy; -+ struct phy_provider *phy_provider; -+ void __iomem *base; -+ -+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); -+ if (!priv) -+ return -ENOMEM; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ base = devm_ioremap_resource(dev, res); -+ if (IS_ERR(base)) -+ return PTR_ERR(base); -+ -+ priv->regmap = devm_regmap_init_mmio(dev, base, -+ &phy_meson_gxl_usb3_regmap_conf); -+ if (IS_ERR(priv->regmap)) -+ return PTR_ERR(priv->regmap); -+ -+ phy = devm_phy_create(dev, np, &phy_meson_gxl_usb3_ops); -+ if (IS_ERR(phy)) { -+ dev_err(dev, "failed to create PHY\n"); -+ return PTR_ERR(phy); -+ } -+ -+ phy_set_drvdata(phy, priv); -+ -+ phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); -+ -+ return PTR_ERR_OR_ZERO(phy_provider); -+} -+ -+static const struct of_device_id phy_meson_gxl_usb3_of_match[] = { -+ { .compatible = "amlogic,meson-gxl-usb3-phy", }, -+ { }, -+}; -+MODULE_DEVICE_TABLE(of, phy_meson_gxl_usb3_of_match); -+ -+static struct platform_driver phy_meson_gxl_usb3_driver = { -+ .probe = phy_meson_gxl_usb3_probe, -+ .driver = { -+ .name = "phy-meson-gxl-usb3", -+ .of_match_table = phy_meson_gxl_usb3_of_match, -+ }, -+}; -+module_platform_driver(phy_meson_gxl_usb3_driver); -+ -+MODULE_AUTHOR("Martin Blumenstingl "); -+MODULE_DESCRIPTION("Meson GXL USB3 PHY driver"); -+MODULE_LICENSE("GPL"); --- -2.7.4 - diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0005-usb-host-add-a-generic-platform-USB-roothub-driver.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0005-usb-host-add-a-generic-platform-USB-roothub-driver.patch deleted file mode 100644 index 388241bc9..000000000 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0005-usb-host-add-a-generic-platform-USB-roothub-driver.patch +++ /dev/null @@ -1,293 +0,0 @@ -From 8dca632003156c7a4f2eb6238b6e299f3df03c55 Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Tue, 10 Jan 2017 18:59:43 +0100 -Subject: [PATCH 05/39] usb: host: add a generic platform USB roothub driver - -Many SoC platforms have separate devices for the USB PHY which are -registered through the generic PHY framework. These PHYs have to be -enabled to make the USB controller actually work. They also have to be -disabled again on shutdown/suspend. - -Currently (at least) the following HCI platform drivers are using custom -code to obtain all PHYs via devicetree for the roothub/controller and -disable/enable them when required: -- ehci-platform.c has ehci_platform_power_{on,off} -- xhci-mtk.c has xhci_mtk_phy_{init,exit,power_on,power_off} -- ohci-platform.c has ohci_platform_power_{on,off} - -These drivers are not using the generic devicetree USB device bindings -yet which were only introduced recently (documentation is available in -devicetree/bindings/usb/usb-device.txt). -With this new driver the usb2-phy and usb3-phy can be specified directly -in the child-node of the corresponding port of the roothub via -devicetree. This can be extended by not just parsing PHYs (some of the -other drivers listed above are for example also parsing a list of clocks -as well) when required. - -Signed-off-by: Martin Blumenstingl -Signed-off-by: Neil Armstrong ---- - .../devicetree/bindings/usb/usb-roothub.txt | 46 +++++++ - drivers/usb/host/Kconfig | 3 + - drivers/usb/host/Makefile | 2 + - drivers/usb/host/platform-roothub.c | 146 +++++++++++++++++++++ - drivers/usb/host/platform-roothub.h | 14 ++ - 5 files changed, 211 insertions(+) - create mode 100644 Documentation/devicetree/bindings/usb/usb-roothub.txt - create mode 100644 drivers/usb/host/platform-roothub.c - create mode 100644 drivers/usb/host/platform-roothub.h - -diff --git a/Documentation/devicetree/bindings/usb/usb-roothub.txt b/Documentation/devicetree/bindings/usb/usb-roothub.txt -new file mode 100644 -index 0000000..23b24b6 ---- /dev/null -+++ b/Documentation/devicetree/bindings/usb/usb-roothub.txt -@@ -0,0 +1,46 @@ -+Generic USB root-hub Properties -+ -+similar to the USB device bindings (documented in usb-device.txt from the -+current directory) this provides support for configuring the root-hub. -+ -+Required properties: -+- compatible: should be at least one of "usb1d6b,3", "usb1d6b,2" -+- reg: must be 0. -+- address-cells: must be 1 -+- size-cells: must be 0 -+ -+Required sub-nodes: -+a sub-node per actual USB port is required. each sub-node supports the -+following properties: -+ Required properties: -+ - reg: the port number on the root-hub (mandatory) -+ Optional properties: -+ - phys: optional, from the *Generic PHY* bindings (mandatory needed -+ when phy-names is given) -+ - phy-names: optional, from the *Generic PHY* bindings; supported names -+ are "usb2-phy" or "usb3-phy" -+ -+Example: -+ &usb1 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ roothub@0 { -+ compatible = "usb1d6b,3", "usb1d6b,2"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0>; -+ -+ port@1 { -+ reg = <1>; -+ usb-phy = <&usb2_phy1>, <&usb3_phy1>; -+ phy-names = "usb2-phy", "usb3-phy"; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ usb-phy = <&usb2_phy2>, <&usb3_phy2>; -+ phy-names = "usb2-phy", "usb3-phy"; -+ }; -+ }; -+ } -diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig -index 92b1972..598ca56 100644 ---- a/drivers/usb/host/Kconfig -+++ b/drivers/usb/host/Kconfig -@@ -797,6 +797,9 @@ config USB_HCD_SSB - - If unsure, say N. - -+config USB_PLATFORM_ROOTHUB -+ bool -+ - config USB_HCD_TEST_MODE - bool "HCD test mode support" - ---help--- -diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile -index 4ab2689..873ebd9 100644 ---- a/drivers/usb/host/Makefile -+++ b/drivers/usb/host/Makefile -@@ -30,6 +30,8 @@ obj-$(CONFIG_USB_WHCI_HCD) += whci/ - - obj-$(CONFIG_USB_PCI) += pci-quirks.o - -+obj-$(CONFIG_USB_PLATFORM_ROOTHUB) += platform-roothub.o -+ - obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o - obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o - obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o -diff --git a/drivers/usb/host/platform-roothub.c b/drivers/usb/host/platform-roothub.c -new file mode 100644 -index 0000000..84837e4 ---- /dev/null -+++ b/drivers/usb/host/platform-roothub.c -@@ -0,0 +1,146 @@ -+/* -+ * platform roothub driver - a virtual PHY device which passes all phy_* -+ * function calls to multiple (actual) PHY devices. This is comes handy when -+ * initializing all PHYs on a root-hub (to keep them all in the same state). -+ * -+ * Copyright (C) 2017 Martin Blumenstingl -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see . -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "platform-roothub.h" -+ -+#define ROOTHUB_PORTNUM 0 -+ -+struct platform_roothub { -+ struct phy *phy; -+ struct list_head list; -+}; -+ -+static struct platform_roothub *platform_roothub_alloc(struct device *dev) -+{ -+ struct platform_roothub *roothub_entry; -+ -+ roothub_entry = devm_kzalloc(dev, sizeof(*roothub_entry), GFP_KERNEL); -+ if (!roothub_entry) -+ return ERR_PTR(-ENOMEM); -+ -+ INIT_LIST_HEAD(&roothub_entry->list); -+ -+ return roothub_entry; -+} -+ -+static int platform_roothub_add_phy(struct device *dev, -+ struct device_node *port_np, -+ const char *con_id, struct list_head *list) -+{ -+ struct platform_roothub *roothub_entry; -+ struct phy *phy = devm_of_phy_get(dev, port_np, con_id); -+ -+ if (IS_ERR_OR_NULL(phy)) { -+ if (!phy || PTR_ERR(phy) == -ENODEV) -+ return 0; -+ else -+ return PTR_ERR(phy); -+ } -+ -+ roothub_entry = platform_roothub_alloc(dev); -+ if (IS_ERR(roothub_entry)) -+ return PTR_ERR(roothub_entry); -+ -+ roothub_entry->phy = phy; -+ -+ list_add_tail(&roothub_entry->list, list); -+ -+ return 0; -+} -+ -+struct platform_roothub *platform_roothub_init(struct device *dev) -+{ -+ struct device_node *roothub_np, *port_np; -+ struct platform_roothub *plat_roothub; -+ int err; -+ -+ roothub_np = usb_of_get_child_node(dev->of_node, ROOTHUB_PORTNUM); -+ if (!of_device_is_available(roothub_np)) -+ return NULL; -+ -+ plat_roothub = platform_roothub_alloc(dev); -+ if (IS_ERR(plat_roothub)) -+ return plat_roothub; -+ -+ for_each_available_child_of_node(roothub_np, port_np) { -+ err = platform_roothub_add_phy(dev, port_np, "usb2-phy", -+ &plat_roothub->list); -+ if (err) -+ return ERR_PTR(err); -+ -+ err = platform_roothub_add_phy(dev, port_np, "usb3-phy", -+ &plat_roothub->list); -+ if (err) -+ return ERR_PTR(err); -+ } -+ -+ return plat_roothub; -+} -+EXPORT_SYMBOL_GPL(platform_roothub_init); -+ -+int platform_roothub_power_on(struct platform_roothub *plat_roothub) -+{ -+ struct platform_roothub *roothub_entry; -+ struct list_head *head; -+ int err; -+ -+ if (!plat_roothub) -+ return 0; -+ -+ head = &plat_roothub->list; -+ -+ list_for_each_entry(roothub_entry, head, list) { -+ err = phy_init(roothub_entry->phy); -+ if (err) -+ goto err_out; -+ -+ err = phy_power_on(roothub_entry->phy); -+ if (err) { -+ phy_exit(roothub_entry->phy); -+ goto err_out; -+ } -+ } -+ -+ return 0; -+ -+err_out: -+ list_for_each_entry_continue_reverse(roothub_entry, head, list) { -+ phy_power_off(roothub_entry->phy); -+ phy_exit(roothub_entry->phy); -+ } -+ -+ return err; -+} -+EXPORT_SYMBOL_GPL(platform_roothub_power_on); -+ -+void platform_roothub_power_off(struct platform_roothub *plat_roothub) -+{ -+ struct platform_roothub *roothub_entry; -+ -+ if (!plat_roothub) -+ return; -+ -+ list_for_each_entry_reverse(roothub_entry, &plat_roothub->list, list) { -+ phy_power_off(roothub_entry->phy); -+ phy_exit(roothub_entry->phy); -+ } -+} -+EXPORT_SYMBOL_GPL(platform_roothub_power_off); -diff --git a/drivers/usb/host/platform-roothub.h b/drivers/usb/host/platform-roothub.h -new file mode 100644 -index 0000000..bde0bf2 ---- /dev/null -+++ b/drivers/usb/host/platform-roothub.h -@@ -0,0 +1,14 @@ -+#ifndef USB_HOST_PLATFORM_ROOTHUB_H -+#define USB_HOST_PLATFORM_ROOTHUB_H -+ -+struct phy; -+struct device_node; -+ -+struct platform_roothub; -+ -+struct platform_roothub *platform_roothub_init(struct device *dev); -+ -+int platform_roothub_power_on(struct platform_roothub *plat_roothub); -+void platform_roothub_power_off(struct platform_roothub *plat_roothub); -+ -+#endif /* USB_HOST_PLATFORM_ROOTHUB_H */ --- -2.7.4 - diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0006-usb-host-xhci-plat-integrate-the-platform-roothub.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0006-usb-host-xhci-plat-integrate-the-platform-roothub.patch deleted file mode 100644 index 33e9a620d..000000000 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0006-usb-host-xhci-plat-integrate-the-platform-roothub.patch +++ /dev/null @@ -1,146 +0,0 @@ -From 55ba20ef5868e2a1fc3cefe264539affe55ef6b7 Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Wed, 11 Jan 2017 11:34:59 +0100 -Subject: [PATCH 06/39] usb: host: xhci: plat: integrate the platform-roothub - -This enables the platform-roothub for the xhci-plat driver. This allows -specifying a PHY for each port via devicetree. All PHYs will then be -enabled/disabled by the platform-roothub driver. - -One example where this is required is the Amlogic GXL and GXM SoCs: -They are using a dwc3 USB controller with up to three ports enabled on -the internal roothub. Using only the top-level "phy" properties does not -work here since one can only specify one "usb2-phy" and one "usb3-phy", -while actually at least two "usb2-phy" have to be specified. - -Signed-off-by: Martin Blumenstingl -Signed-off-by: Neil Armstrong ---- - Documentation/devicetree/bindings/usb/usb-xhci.txt | 7 ++++++ - drivers/usb/host/Kconfig | 1 + - drivers/usb/host/xhci-plat.c | 26 +++++++++++++++++++++- - drivers/usb/host/xhci.h | 3 +++ - 4 files changed, 36 insertions(+), 1 deletion(-) - -diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.txt b/Documentation/devicetree/bindings/usb/usb-xhci.txt -index 7a69b8b..d0d8a67c 100644 ---- a/Documentation/devicetree/bindings/usb/usb-xhci.txt -+++ b/Documentation/devicetree/bindings/usb/usb-xhci.txt -@@ -30,6 +30,13 @@ Optional properties: - - usb3-lpm-capable: determines if platform is USB3 LPM capable - - quirk-broken-port-ped: set if the controller has broken port disable mechanism - -+sub-nodes: -+- optionally there can be a node for the root-hub, see usb-roothub.txt in the -+ current directory -+- one or more nodes with reg 1-31 for each port to which a device is connected. -+ See usb-device.txt in the current directory for more information. -+ -+ - Example: - usb@f0931000 { - compatible = "generic-xhci"; -diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig -index 598ca56..8c3b11f 100644 ---- a/drivers/usb/host/Kconfig -+++ b/drivers/usb/host/Kconfig -@@ -36,6 +36,7 @@ config USB_XHCI_PCI - config USB_XHCI_PLATFORM - tristate "Generic xHCI driver for a platform device" - select USB_XHCI_RCAR if ARCH_RENESAS -+ select USB_PLATFORM_ROOTHUB - ---help--- - Adds an xHCI host driver for a generic platform device, which - provides a memory space and an irq. -diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c -index 1cb6eae..a80d585 100644 ---- a/drivers/usb/host/xhci-plat.c -+++ b/drivers/usb/host/xhci-plat.c -@@ -281,10 +281,20 @@ static int xhci_plat_probe(struct platform_device *pdev) - goto put_usb3_hcd; - } - -- ret = usb_add_hcd(hcd, irq, IRQF_SHARED); -+ xhci->platform_roothub = platform_roothub_init(sysdev); -+ if (IS_ERR(xhci->platform_roothub)) { -+ ret = PTR_ERR(xhci->platform_roothub); -+ goto disable_clk; -+ } -+ -+ ret = platform_roothub_power_on(xhci->platform_roothub); - if (ret) - goto disable_usb_phy; - -+ ret = usb_add_hcd(hcd, irq, IRQF_SHARED); -+ if (ret) -+ goto disable_platform_roothub; -+ - if (HCC_MAX_PSA(xhci->hcc_params) >= 4) - xhci->shared_hcd->can_do_streams = 1; - -@@ -307,6 +317,9 @@ static int xhci_plat_probe(struct platform_device *pdev) - dealloc_usb2_hcd: - usb_remove_hcd(hcd); - -+disable_platform_roothub: -+ platform_roothub_power_off(xhci->platform_roothub); -+ - disable_usb_phy: - usb_phy_shutdown(hcd->usb_phy); - -@@ -338,6 +351,8 @@ static int xhci_plat_remove(struct platform_device *dev) - usb_remove_hcd(xhci->shared_hcd); - usb_phy_shutdown(hcd->usb_phy); - -+ platform_roothub_power_off(xhci->platform_roothub); -+ - usb_remove_hcd(hcd); - usb_put_hcd(xhci->shared_hcd); - -@@ -370,6 +385,11 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev) - if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk)) - clk_disable_unprepare(xhci->clk); - -+ if (ret) -+ return ret; -+ -+ platform_roothub_power_off(xhci->platform_roothub); -+ - return ret; - } - -@@ -382,6 +402,10 @@ static int __maybe_unused xhci_plat_resume(struct device *dev) - if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk)) - clk_prepare_enable(xhci->clk); - -+ ret = platform_roothub_power_on(xhci->platform_roothub); -+ if (ret) -+ return ret; -+ - ret = xhci_priv_resume_quirk(hcd); - if (ret) - return ret; -diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index 2eaf6e1..552834c 100644 ---- a/drivers/usb/host/xhci.h -+++ b/drivers/usb/host/xhci.h -@@ -34,6 +34,8 @@ - #include "xhci-ext-caps.h" - #include "pci-quirks.h" - -+#include "platform-roothub.h" -+ - /* xHCI PCI Configuration Registers */ - #define XHCI_SBRN_OFFSET (0x60) - -@@ -1735,6 +1737,7 @@ struct xhci_hcd { - int msix_count; - /* optional clock */ - struct clk *clk; -+ struct platform_roothub *platform_roothub; - /* data structures */ - struct xhci_device_context_array *dcbaa; - struct xhci_ring *cmd_ring; --- -2.7.4 - diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0007-ARM64-dts-meson-gxl-add-USB-host-support.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0007-ARM64-dts-meson-gxl-add-USB-host-support.patch deleted file mode 100644 index ee9531988..000000000 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0007-ARM64-dts-meson-gxl-add-USB-host-support.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 547f8ce14bfc3d315dc8b64d0e2eff0c7be897d2 Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Sun, 20 Nov 2016 00:23:52 +0100 -Subject: [PATCH 07/39] ARM64: dts: meson-gxl: add USB host support - -This adds USB host support to the Meson GXL SoC. A dwc3 controller is -used for host-mode, while a dwc2 controller is used for device-mode only. -The dwc3 controller's internal roothub has two USB2 ports enabled but no -USB3 port. Each of the ports is supplied by a separate PHY. The USB pins -are connected to the SoC's USBHOST_A and USBOTG_B pins. -Due to the way the roothub works internally the USB PHYs are left -enabled. When the dwc3 controller is disabled the PHY is never powered on -so it does not draw any extra power. However, when the dwc3 host -controller is enabled then all PHYs also have to be enabled, otherwise -USB devices will not be detected (regardless of whether they are plugged -into an enabled port or not). This means that only the dwc3 controller -has to be enabled on boards with USB support (instead of requiring all -boards to enable the PHYs additionally with the chance of forgetting to -enable one and breaking all other ports with that as well). - -Signed-off-by: Martin Blumenstingl -Signed-off-by: Neil Armstrong ---- - arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 59 ++++++++++++++++++++++++++++++ - 1 file changed, 59 insertions(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi -index fb8d76a..68ea67a 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi -@@ -57,6 +57,65 @@ - no-map; - }; - }; -+ -+ soc { -+ -+ usb0: usb@c9000000 { -+ compatible = "snps,dwc3"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0x0 0xc9000000 0x0 0x100000>; -+ interrupts = ; -+ dr_mode = "host"; -+ maximum-speed = "high-speed"; -+ snps,dis_u2_susphy_quirk; -+ phys = <&usb3_phy0>; -+ phy-names = "usb3-phy"; -+ status = "disabled"; -+ -+ dwc3_roothub: roothub@0 { -+ compatible = "usb1d6b,3", "usb1d6b,2"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0>; -+ -+ port@1 { -+ reg = <1>; -+ phys = <&usb2_phy0>; -+ phy-names = "usb2-phy"; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ phys = <&usb2_phy1>; -+ phy-names = "usb2-phy"; -+ }; -+ }; -+ }; -+ }; -+}; -+ -+&apb { -+ usb2_phy0: phy@78000 { -+ compatible = "amlogic,meson-gxl-usb2-phy"; -+ #phy-cells = <0>; -+ reg = <0x0 0x78000 0x0 0x20>; -+ status = "okay"; -+ }; -+ -+ usb2_phy1: phy@78020 { -+ compatible = "amlogic,meson-gxl-usb2-phy"; -+ #phy-cells = <0>; -+ reg = <0x0 0x78020 0x0 0x20>; -+ status = "okay"; -+ }; -+ -+ usb3_phy0: phy@78080 { -+ compatible = "amlogic,meson-gxl-usb3-phy"; -+ #phy-cells = <0>; -+ reg = <0x0 0x78080 0x0 0x20>; -+ status = "okay"; -+ }; - }; - - ðmac { --- -2.7.4 - diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0008-ARM64-dts-meson-gxm-add-GXM-specific-USB-host-config.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0008-ARM64-dts-meson-gxm-add-GXM-specific-USB-host-config.patch deleted file mode 100644 index c30cc8b65..000000000 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0008-ARM64-dts-meson-gxm-add-GXM-specific-USB-host-config.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 48d4988f2b3b93a6f17c0d1d5e6d932664bc0c74 Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Sat, 26 Nov 2016 00:17:22 +0100 -Subject: [PATCH 08/39] ARM64: dts: meson-gxm: add GXM specific USB host - configuration - -The USB configuration on GXM is slightly different than on GXL. The dwc3 -controller's internal hub has three USB2 ports (instead of 2 on GXL) -along with a dedicated USB2 PHY for this port. However, it seems that -there are no pins on GXM which would allow connecting the third port to -a physical USB port. - -Signed-off-by: Martin Blumenstingl -Signed-off-by: Neil Armstrong ---- - arch/arm64/boot/dts/amlogic/meson-gxm.dtsi | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi -index 19a798d..5e4cb90 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi -@@ -121,6 +121,23 @@ - compatible = "amlogic,meson-gxm-aoclkc", "amlogic,meson-gx-aoclkc"; - }; - -+&apb { -+ usb2_phy2: phy@78040 { -+ compatible = "amlogic,meson-gxl-usb2-phy"; -+ #phy-cells = <0>; -+ reg = <0x0 0x78040 0x0 0x20>; -+ status = "disabled"; -+ }; -+}; -+ -+&dwc3_roothub { -+ port@3 { -+ reg = <3>; -+ phys = <&usb2_phy2>; -+ phy-names = "usb2-phy"; -+ }; -+}; -+ - &saradc { - compatible = "amlogic,meson-gxm-saradc", "amlogic,meson-saradc"; - }; --- -2.7.4 - diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0009-ARM64-dts-meson-gx-Enable-USB-on-GXL-and-GXM-boards.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0009-ARM64-dts-meson-gx-Enable-USB-on-GXL-and-GXM-boards.patch deleted file mode 100644 index 2ed02a37f..000000000 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0009-ARM64-dts-meson-gx-Enable-USB-on-GXL-and-GXM-boards.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 1e5a4ee949281c47a03f5cee31226d803d396f48 Mon Sep 17 00:00:00 2001 -From: Neil Armstrong -Date: Thu, 13 Jul 2017 15:02:33 +0200 -Subject: [PATCH 09/39] ARM64: dts: meson-gx: Enable USB on GXL and GXM boards - -Signed-off-by: Neil Armstrong ---- - arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 4 ++++ - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts | 4 ++++ - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts | 4 ++++ - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts | 4 ++++ - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts | 4 ++++ - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi | 4 ++++ - arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 4 ++++ - arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts | 4 ++++ - arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts | 4 ++++ - 9 files changed, 36 insertions(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi -index 4157987..7ce9a62 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi -@@ -236,3 +236,7 @@ - pinctrl-0 = <&uart_ao_a_pins>; - pinctrl-names = "default"; - }; -+ -+&usb0 { -+ status = "okay"; -+}; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts -index 977b424..6f2cd8e 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts -@@ -163,3 +163,7 @@ - pinctrl-0 = <&uart_ao_a_pins>; - pinctrl-names = "default"; - }; -+ -+&usb0 { -+ status = "okay"; -+}; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -index edc512a..89a5fd9 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -@@ -198,3 +198,7 @@ - pinctrl-0 = <&uart_ao_b_pins>; - pinctrl-names = "default"; - }; -+ -+&usb0 { -+ status = "okay"; -+}; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts -index 64c54c9..4035891 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts -@@ -242,3 +242,7 @@ - pinctrl-0 = <&uart_ao_a_pins>; - pinctrl-names = "default"; - }; -+ -+&usb0 { -+ status = "okay"; -+}; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts -index 1b8f328..6338e6c 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts -@@ -251,3 +251,7 @@ - pinctrl-0 = <&uart_ao_a_pins>; - pinctrl-names = "default"; - }; -+ -+&usb0 { -+ status = "okay"; -+}; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi -index 129af90..7a1c20e 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi -@@ -173,3 +173,7 @@ - pinctrl-0 = <&uart_ao_a_pins>; - pinctrl-names = "default"; - }; -+ -+&usb0 { -+ status = "okay"; -+}; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -index 32c138e..103575a 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -@@ -397,3 +397,7 @@ - status = "okay"; - vref-supply = <&vddio_ao18>; - }; -+ -+&usb0 { -+ status = "okay"; -+}; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts -index 22c6977..cfde246 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts -@@ -215,3 +215,7 @@ - pinctrl-0 = <&uart_ao_a_pins>; - pinctrl-names = "default"; - }; -+ -+&usb0 { -+ status = "okay"; -+}; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts -index 470f72b..9837a48 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts -@@ -237,3 +237,7 @@ - pinctrl-0 = <&uart_ao_a_pins>; - pinctrl-names = "default"; - }; -+ -+&usb0 { -+ status = "okay"; -+}; --- -2.7.4 - diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0029-ARM64-dts-meson-gxl-add-sound-dai-cells-to-HDMI-node.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0029-ARM64-dts-meson-gxl-add-sound-dai-cells-to-HDMI-node.patch deleted file mode 100644 index 08e186083..000000000 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0029-ARM64-dts-meson-gxl-add-sound-dai-cells-to-HDMI-node.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 071f66d1e34243f37f52e09dca13b50e8215a7ce Mon Sep 17 00:00:00 2001 -From: Jerome Brunet -Date: Wed, 20 Sep 2017 18:01:26 +0200 -Subject: [PATCH 29/39] ARM64: dts: meson-gxl: add sound-dai-cells to HDMI node - -Signed-off-by: Jerome Brunet -Signed-off-by: Neil Armstrong ---- - arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi -index 9d2fb46..4a1bd89 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi -@@ -294,6 +294,7 @@ - <&clkc CLKID_CLK81>, - <&clkc CLKID_GCLK_VENCI_INT0>; - clock-names = "isfr", "iahb", "venci"; -+ #sound-dai-cells = <0>; - }; - - &hiubus { --- -2.7.4 - diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0030-ARM64-dts-meson-gxl-Take-eMMC-data-strobe-out-of-eMM.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0030-ARM64-dts-meson-gxl-Take-eMMC-data-strobe-out-of-eMM.patch deleted file mode 100644 index 45847eb7e..000000000 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0030-ARM64-dts-meson-gxl-Take-eMMC-data-strobe-out-of-eMM.patch +++ /dev/null @@ -1,228 +0,0 @@ -From 29e058408d62384dc3de4e0b63433d7dfdee068b Mon Sep 17 00:00:00 2001 -From: Neil Armstrong -Date: Mon, 28 Aug 2017 12:01:09 +0200 -Subject: [PATCH 30/39] ARM64: dts: meson-gxl: Take eMMC data strobe out of - eMMC pins - -Since the Data Strobe pin is optional, take it out of the default -eMMC pins and add a separate entry. - -Signed-off-by: Neil Armstrong ---- - arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 10 ++++++++-- - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 10 ++++++++-- - arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts | 2 +- - 14 files changed, 28 insertions(+), 16 deletions(-) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi -index 7ce9a62..7f59f30 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi -@@ -213,7 +213,7 @@ - /* eMMC */ - &sd_emmc_c { - status = "okay"; -- pinctrl-0 = <&emmc_pins>; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; - pinctrl-1 = <&emmc_clk_gate_pins>; - pinctrl-names = "default", "clk-gate"; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts -index 4b17a76..a42c8f4 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts -@@ -302,7 +302,7 @@ - /* eMMC */ - &sd_emmc_c { - status = "disabled"; -- pinctrl-0 = <&emmc_pins>; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; - pinctrl-1 = <&emmc_clk_gate_pins>; - pinctrl-names = "default", "clk-gate"; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts -index 38dfdde..9a77323 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts -@@ -272,7 +272,7 @@ - /* eMMC */ - &sd_emmc_c { - status = "okay"; -- pinctrl-0 = <&emmc_pins>; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; - pinctrl-1 = <&emmc_clk_gate_pins>; - pinctrl-names = "default", "clk-gate"; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts -index c3a7b7f..4221e1f 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts -@@ -271,7 +271,7 @@ - /* eMMC */ - &sd_emmc_c { - status = "okay"; -- pinctrl-0 = <&emmc_pins>; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; - pinctrl-1 = <&emmc_clk_gate_pins>; - pinctrl-names = "default", "clk-gate"; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi -index 23c08c3..932158a 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi -@@ -242,7 +242,7 @@ - /* eMMC */ - &sd_emmc_c { - status = "okay"; -- pinctrl-0 = <&emmc_pins>; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; - pinctrl-1 = <&emmc_clk_gate_pins>; - pinctrl-names = "default", "clk-gate"; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi -index f2bc6de..1fe8e24 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi -@@ -199,7 +199,7 @@ - /* eMMC */ - &sd_emmc_c { - status = "okay"; -- pinctrl-0 = <&emmc_pins>; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; - pinctrl-1 = <&emmc_clk_gate_pins>; - pinctrl-names = "default", "clk-gate"; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi -index 7d38d55..ef12d67 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi -@@ -390,8 +390,14 @@ - mux { - groups = "emmc_nand_d07", - "emmc_cmd", -- "emmc_clk", -- "emmc_ds"; -+ "emmc_clk"; -+ function = "emmc"; -+ }; -+ }; -+ -+ emmc_ds_pins: emmc-ds { -+ mux { -+ groups = "emmc_ds"; - function = "emmc"; - }; - }; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts -index 6f2cd8e..5eaafa1 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts -@@ -141,7 +141,7 @@ - /* eMMC */ - &sd_emmc_c { - status = "okay"; -- pinctrl-0 = <&emmc_pins>; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; - pinctrl-1 = <&emmc_clk_gate_pins>; - pinctrl-names = "default", "clk-gate"; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts -index 4035891..942fd70 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts -@@ -221,7 +221,7 @@ - /* eMMC */ - &sd_emmc_c { - status = "okay"; -- pinctrl-0 = <&emmc_pins>; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; - pinctrl-1 = <&emmc_clk_gate_pins>; - pinctrl-names = "default", "clk-gate"; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts -index 6338e6c..0fdebcc 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts -@@ -229,7 +229,7 @@ - /* eMMC */ - &sd_emmc_c { - status = "okay"; -- pinctrl-0 = <&emmc_pins>; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; - pinctrl-1 = <&emmc_clk_gate_pins>; - pinctrl-names = "default", "clk-gate"; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi -index 7a1c20e..0a2be82 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi -@@ -135,7 +135,7 @@ - /* eMMC */ - &sd_emmc_c { - status = "okay"; -- pinctrl-0 = <&emmc_pins>; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; - pinctrl-1 = <&emmc_clk_gate_pins>; - pinctrl-names = "default", "clk-gate"; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi -index 4a1bd89..02b52b6 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi -@@ -343,8 +343,14 @@ - mux { - groups = "emmc_nand_d07", - "emmc_cmd", -- "emmc_clk", -- "emmc_ds"; -+ "emmc_clk"; -+ function = "emmc"; -+ }; -+ }; -+ -+ emmc_ds_pins: emmc-ds { -+ mux { -+ groups = "emmc_ds"; - function = "emmc"; - }; - }; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts -index cfde246..e70b5e2 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts -@@ -193,7 +193,7 @@ - /* eMMC */ - &sd_emmc_c { - status = "okay"; -- pinctrl-0 = <&emmc_pins>; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; - pinctrl-1 = <&emmc_clk_gate_pins>; - pinctrl-names = "default", "clk-gate"; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts -index 9837a48..9593a28 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts -@@ -216,7 +216,7 @@ - /* eMMC */ - &sd_emmc_c { - status = "okay"; -- pinctrl-0 = <&emmc_pins>; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; - pinctrl-names = "default"; - - bus-width = <8>; --- -2.7.4 - diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0032-ARM64-dts-meson-gx-Add-HDMI_5V-regulator-on-selected.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0032-ARM64-dts-meson-gx-Add-HDMI_5V-regulator-on-selected.patch deleted file mode 100644 index c46a0b6e8..000000000 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0032-ARM64-dts-meson-gx-Add-HDMI_5V-regulator-on-selected.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 07b467abf6efad25e12ad4c09a008e9f1594e39d Mon Sep 17 00:00:00 2001 -From: Neil Armstrong -Date: Mon, 16 Oct 2017 15:33:30 +0200 -Subject: [PATCH 32/39] ARM64: dts: meson-gx: Add HDMI_5V regulator on selected - boards - -On reference boards and derivatives, the HDMI Logic is powered by an external -5V regulator. -This regulator was set by the Vendor U-Boot, add the regulator and phandle -property to the HDMI node. - -Signed-off-by: Neil Armstrong ---- - arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 12 ++++++++++++ - arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts | 1 + - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts | 1 + - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts | 12 ++++++++++++ - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts | 1 + - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi | 11 +++++++++++ - arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 12 ++++++++++++ - 7 files changed, 50 insertions(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi -index 7f59f30..979abaf 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi -@@ -59,6 +59,17 @@ - reg = <0x0 0x0 0x0 0x80000000>; - }; - -+ hdmi_5v: regulator-hdmi-5v { -+ compatible = "regulator-fixed"; -+ -+ regulator-name = "HDMI_5V"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ -+ gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ }; -+ - vddio_boot: regulator-vddio_boot { - compatible = "regulator-fixed"; - regulator-name = "VDDIO_BOOT"; -@@ -142,6 +153,7 @@ - status = "okay"; - pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; - pinctrl-names = "default"; -+ hdmi-supply = <&hdmi_5v>; - }; - - &hdmi_tx_tmds_port { -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts -index 6827f23..8bc540e 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts -@@ -135,6 +135,7 @@ - status = "okay"; - pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; - pinctrl-names = "default"; -+ hdmi-supply = <&hdmi_5v>; - }; - - &hdmi_tx_tmds_port { -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -index 89a5fd9..f7b37de 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -@@ -78,6 +78,7 @@ - status = "okay"; - pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; - pinctrl-names = "default"; -+ hdmi-supply = <&hdmi_5v>; - }; - - &hdmi_tx_tmds_port { -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts -index 942fd70..0c4ed4e 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts -@@ -72,6 +72,17 @@ - reg = <0x0 0x0 0x0 0x80000000>; - }; - -+ hdmi_5v: regulator-hdmi-5v { -+ compatible = "regulator-fixed"; -+ -+ regulator-name = "HDMI_5V"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ -+ gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ }; -+ - vcc_3v3: regulator-vcc_3v3 { - compatible = "regulator-fixed"; - regulator-name = "VCC_3V3"; -@@ -131,6 +142,7 @@ - status = "okay"; - pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; - pinctrl-names = "default"; -+ hdmi-supply = <&hdmi_5v>; - }; - - &hdmi_tx_tmds_port { -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts -index 6e2bf85..4f6b1c9 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts -@@ -88,6 +88,7 @@ - status = "okay"; - pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; - pinctrl-names = "default"; -+ hdmi-supply = <&hdmi_5v>; - }; - - &hdmi_tx_tmds_port { -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi -index 0a2be82..1a5136a 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi -@@ -28,6 +28,17 @@ - reg = <0x0 0x0 0x0 0x80000000>; - }; - -+ hdmi_5v: regulator-hdmi-5v { -+ compatible = "regulator-fixed"; -+ -+ regulator-name = "HDMI_5V"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ -+ gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ }; -+ - vddio_boot: regulator-vddio_boot { - compatible = "regulator-fixed"; - regulator-name = "VDDIO_BOOT"; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -index 103575a..4537a81 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -@@ -153,6 +153,17 @@ - }; - }; - -+ hdmi_5v: regulator-hdmi-5v { -+ compatible = "regulator-fixed"; -+ -+ regulator-name = "HDMI_5V"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ -+ gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ }; -+ - vcc_3v3: regulator-vcc_3v3 { - compatible = "regulator-fixed"; - regulator-name = "VCC_3V3"; -@@ -239,6 +250,7 @@ - status = "okay"; - pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; - pinctrl-names = "default"; -+ hdmi-supply = <&hdmi_5v>; - }; - - &hdmi_tx_tmds_port { --- -2.7.4 - diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0035-ARM64-dts-meson-activate-hdmi-audio-HDMI-enabled-boa.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0035-ARM64-dts-meson-activate-hdmi-audio-HDMI-enabled-boa.patch index 205e425b1..f06348b40 100644 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0035-ARM64-dts-meson-activate-hdmi-audio-HDMI-enabled-boa.patch +++ b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0035-ARM64-dts-meson-activate-hdmi-audio-HDMI-enabled-boa.patch @@ -522,61 +522,6 @@ index 4f6b1c9..f23f148 100644 &cvbs_vdac_port { cvbs_vdac_out: endpoint { remote-endpoint = <&cvbs_connector_in>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -index 4537a81..aed2a54 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -@@ -88,6 +88,31 @@ - }; - }; - -+ sound { -+ compatible = "simple-audio-card"; -+ simple-audio-card,name = "meson-gx-preview"; -+ status = "okay"; -+ -+ simple-audio-card,dai-link@0 { -+ /* HDMI Output */ -+ format = "i2s"; -+ mclk-fs = <256>; -+ bitclock-master = <&i2s_dai>; -+ frame-master = <&i2s_dai>; -+ plat { -+ sound-dai = <&aiu_i2s_dma>; -+ }; -+ -+ cpu { -+ sound-dai = <&i2s_dai>; -+ }; -+ -+ codec { -+ sound-dai = <&hdmi_tx>; -+ }; -+ }; -+ }; -+ - pwmleds { - compatible = "pwm-leds"; - -@@ -207,6 +232,18 @@ - hdmi-phandle = <&hdmi_tx>; - }; - -+&audio { -+ status = "okay"; -+}; -+ -+&aiu_i2s_dma { -+ status = "okay"; -+}; -+ -+&i2s_dai { -+ status = "okay"; -+}; -+ - &cpu0 { - cooling-min-level = <0>; - cooling-max-level = <6>; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts index e70b5e2..8444f79 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0036-net-phy-meson-gxl-detect-LPA-corruption.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0036-net-phy-meson-gxl-detect-LPA-corruption.patch deleted file mode 100644 index f08a85a7c..000000000 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0036-net-phy-meson-gxl-detect-LPA-corruption.patch +++ /dev/null @@ -1,132 +0,0 @@ -From 9afb9faf483008a1d16202818d895099e5c932bb Mon Sep 17 00:00:00 2001 -From: Jerome Brunet -Date: Fri, 8 Dec 2017 12:08:11 +0100 -Subject: [PATCH 36/39] net: phy: meson-gxl: detect LPA corruption - -The purpose of this change is to fix the incorrect detection of the link -partner (LP) advertised capabilities which sometimes happens with this PHY -(roughly 1 time in a dozen) - -This issue may cause the link to be negotiated at 10Mbps/Full or -10Mbps/Half when 100MBps/Full is actually possible. In some case, the link -is even completely broken and no communication is possible. - -To detect the corruption, we must look for a magic undocumented bit in the -WOL bank (hint given by the SoC vendor kernel) but this is not enough to -cover all cases. We also have to look at the LPA ack. If the LP supports -Aneg but did not ack our base code when aneg is completed, we assume -something went wrong. - -The detection of a corrupted LPA triggers a restart of the aneg process. -This solves the problem but may take up to 6 retries to complete. - -Fixes: 7334b3e47aee ("net: phy: Add Meson GXL Internal PHY driver") -Signed-off-by: Jerome Brunet -Signed-off-by: David S. Miller -Signed-off-by: Neil Armstrong ---- - drivers/net/phy/meson-gxl.c | 74 ++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 73 insertions(+), 1 deletion(-) - -diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c -index 7ddb709..b21f607 100644 ---- a/drivers/net/phy/meson-gxl.c -+++ b/drivers/net/phy/meson-gxl.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - - static int meson_gxl_config_init(struct phy_device *phydev) - { -@@ -76,6 +77,77 @@ static int meson_gxl_config_init(struct phy_device *phydev) - return 0; - } - -+/* This function is provided to cope with the possible failures of this phy -+ * during aneg process. When aneg fails, the PHY reports that aneg is done -+ * but the value found in MII_LPA is wrong: -+ * - Early failures: MII_LPA is just 0x0001. if MII_EXPANSION reports that -+ * the link partner (LP) supports aneg but the LP never acked our base -+ * code word, it is likely that we never sent it to begin with. -+ * - Late failures: MII_LPA is filled with a value which seems to make sense -+ * but it actually is not what the LP is advertising. It seems that we -+ * can detect this using a magic bit in the WOL bank (reg 12 - bit 12). -+ * If this particular bit is not set when aneg is reported being done, -+ * it means MII_LPA is likely to be wrong. -+ * -+ * In both case, forcing a restart of the aneg process solve the problem. -+ * When this failure happens, the first retry is usually successful but, -+ * in some cases, it may take up to 6 retries to get a decent result -+ */ -+int meson_gxl_read_status(struct phy_device *phydev) -+{ -+ int ret, wol, lpa, exp; -+ -+ if (phydev->autoneg == AUTONEG_ENABLE) { -+ ret = genphy_aneg_done(phydev); -+ if (ret < 0) -+ return ret; -+ else if (!ret) -+ goto read_status_continue; -+ -+ /* Need to access WOL bank, make sure the access is open */ -+ ret = phy_write(phydev, 0x14, 0x0000); -+ if (ret) -+ return ret; -+ ret = phy_write(phydev, 0x14, 0x0400); -+ if (ret) -+ return ret; -+ ret = phy_write(phydev, 0x14, 0x0000); -+ if (ret) -+ return ret; -+ ret = phy_write(phydev, 0x14, 0x0400); -+ if (ret) -+ return ret; -+ -+ /* Request LPI_STATUS WOL register */ -+ ret = phy_write(phydev, 0x14, 0x8D80); -+ if (ret) -+ return ret; -+ -+ /* Read LPI_STATUS value */ -+ wol = phy_read(phydev, 0x15); -+ if (wol < 0) -+ return wol; -+ -+ lpa = phy_read(phydev, MII_LPA); -+ if (lpa < 0) -+ return lpa; -+ -+ exp = phy_read(phydev, MII_EXPANSION); -+ if (exp < 0) -+ return exp; -+ -+ if (!(wol & BIT(12)) || -+ ((exp & EXPANSION_NWAY) && !(lpa & LPA_LPACK))) { -+ /* Looks like aneg failed after all */ -+ phydev_dbg(phydev, "LPA corruption - aneg restart\n"); -+ return genphy_restart_aneg(phydev); -+ } -+ } -+ -+read_status_continue: -+ return genphy_read_status(phydev); -+} -+ - static struct phy_driver meson_gxl_phy[] = { - { - .phy_id = 0x01814400, -@@ -86,7 +158,7 @@ static struct phy_driver meson_gxl_phy[] = { - .config_init = meson_gxl_config_init, - .config_aneg = genphy_config_aneg, - .aneg_done = genphy_aneg_done, -- .read_status = genphy_read_status, -+ .read_status = meson_gxl_read_status, - .suspend = genphy_suspend, - .resume = genphy_resume, - }, --- -2.7.4 - diff --git a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0037-drm-meson-fix-vsync-buffer-update.patch b/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0037-drm-meson-fix-vsync-buffer-update.patch deleted file mode 100644 index 0a23c1a7b..000000000 --- a/buildroot-external/board/hardkernel/odroid-c2/patches/linux/0037-drm-meson-fix-vsync-buffer-update.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 61ceaf782220a596ac845483d00d50752f7c6e14 Mon Sep 17 00:00:00 2001 -From: Neil Armstrong -Date: Thu, 15 Feb 2018 10:38:47 +0100 -Subject: [PATCH 37/39] drm/meson: fix vsync buffer update - -Signed-off-by: Neil Armstrong ---- - drivers/gpu/drm/meson/meson_crtc.c | 6 ++++++ - drivers/gpu/drm/meson/meson_drv.h | 3 +++ - drivers/gpu/drm/meson/meson_plane.c | 7 +++---- - 3 files changed, 12 insertions(+), 4 deletions(-) - -diff --git a/drivers/gpu/drm/meson/meson_crtc.c b/drivers/gpu/drm/meson/meson_crtc.c -index 5155f01..0552020 100644 ---- a/drivers/gpu/drm/meson/meson_crtc.c -+++ b/drivers/gpu/drm/meson/meson_crtc.c -@@ -36,6 +36,7 @@ - #include "meson_venc.h" - #include "meson_vpp.h" - #include "meson_viu.h" -+#include "meson_canvas.h" - #include "meson_registers.h" - - /* CRTC definition */ -@@ -192,6 +193,11 @@ void meson_crtc_irq(struct meson_drm *priv) - } else - meson_vpp_disable_interlace_vscaler_osd1(priv); - -+ meson_canvas_setup(priv, MESON_CANVAS_ID_OSD1, -+ priv->viu.osd1_addr, priv->viu.osd1_stride, -+ priv->viu.osd1_height, MESON_CANVAS_WRAP_NONE, -+ MESON_CANVAS_BLKMODE_LINEAR); -+ - /* Enable OSD1 */ - writel_bits_relaxed(VPP_OSD1_POSTBLEND, VPP_OSD1_POSTBLEND, - priv->io_base + _REG(VPP_MISC)); -diff --git a/drivers/gpu/drm/meson/meson_drv.h b/drivers/gpu/drm/meson/meson_drv.h -index 5e8b392..8450d6ac 100644 ---- a/drivers/gpu/drm/meson/meson_drv.h -+++ b/drivers/gpu/drm/meson/meson_drv.h -@@ -43,6 +43,9 @@ struct meson_drm { - bool osd1_commit; - uint32_t osd1_ctrl_stat; - uint32_t osd1_blk0_cfg[5]; -+ uint32_t osd1_addr; -+ uint32_t osd1_stride; -+ uint32_t osd1_height; - } viu; - - struct { -diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c -index 17e96fa..0b6011b 100644 ---- a/drivers/gpu/drm/meson/meson_plane.c -+++ b/drivers/gpu/drm/meson/meson_plane.c -@@ -164,10 +164,9 @@ static void meson_plane_atomic_update(struct drm_plane *plane, - /* Update Canvas with buffer address */ - gem = drm_fb_cma_get_gem_obj(fb, 0); - -- meson_canvas_setup(priv, MESON_CANVAS_ID_OSD1, -- gem->paddr, fb->pitches[0], -- fb->height, MESON_CANVAS_WRAP_NONE, -- MESON_CANVAS_BLKMODE_LINEAR); -+ priv->viu.osd1_addr = gem->paddr; -+ priv->viu.osd1_stride = fb->pitches[0]; -+ priv->viu.osd1_height = fb->height; - - spin_unlock_irqrestore(&priv->drm->event_lock, flags); - } --- -2.7.4 - diff --git a/buildroot-external/configs/odroid_c2_defconfig b/buildroot-external/configs/odroid_c2_defconfig index 8ec5031f9..4212056cd 100644 --- a/buildroot-external/configs/odroid_c2_defconfig +++ b/buildroot-external/configs/odroid_c2_defconfig @@ -18,7 +18,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-c2 $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-c2/hassos-hook.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.36" +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.67" BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-c2/kernel.config" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config" From 3733a07bac3bded24a4988f2875755edfeefbdc3 Mon Sep 17 00:00:00 2001 From: Johannes Truschnigg Date: Tue, 4 Sep 2018 21:30:32 +0200 Subject: [PATCH 02/37] Do not assume index 0 for boot medium (#188) When booting the HassOS VMDK appliance disk image on QEMU with OVMF UEFI firmware, barebox numbers devices differently from other environments. This patch makes the barebox `sh` implementation expand a pathname wildcard at runtime, so that assigned disk indices != 0 will also work. This fix introduces a potential (but most likely irrelevant) bug/problem: If there is more than one disk connected to the system with a matching name assigned, the wildcard will expand to two or more pathnames, breaking the resulting `mount` command. --- buildroot-external/bootloader/barebox/boot/system0 | 2 +- buildroot-external/bootloader/barebox/boot/system1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildroot-external/bootloader/barebox/boot/system0 b/buildroot-external/bootloader/barebox/boot/system0 index bb073c686..d1e57a8cb 100644 --- a/buildroot-external/bootloader/barebox/boot/system0 +++ b/buildroot-external/bootloader/barebox/boot/system0 @@ -3,6 +3,6 @@ global linux.bootargs.dyn.root="root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro" mkdir -p /mnt/system -mount -t ext4 /dev/disk0.hassos-kernel0 /mnt/system +mount -t ext4 /dev/disk*.hassos-kernel0 /mnt/system global bootm.image="/mnt/system/bzImage" diff --git a/buildroot-external/bootloader/barebox/boot/system1 b/buildroot-external/bootloader/barebox/boot/system1 index c60a2c512..73a8a73c6 100644 --- a/buildroot-external/bootloader/barebox/boot/system1 +++ b/buildroot-external/bootloader/barebox/boot/system1 @@ -3,6 +3,6 @@ global linux.bootargs.dyn.root="root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 rootfstype=squashfs ro" mkdir -p /mnt/system -mount -t ext4 /dev/disk0.hassos-kernel1 /mnt/system +mount -t ext4 /dev/disk*.hassos-kernel1 /mnt/system global bootm.image="/mnt/system/bzImage" From 075799aaa872752c491afa78b033025c19cfac37 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 10 Sep 2018 12:22:52 +0200 Subject: [PATCH 03/37] Raspberrypi: Performance on Raspberry Pi due to governor (#193) * Raspberrypi: Performance on Raspberry Pi due to governor * Update rpi0_w_defconfig * Update rpi2_defconfig * Update rpi3_defconfig * Update rpi_defconfig * Update rpi3_64_defconfig --- buildroot-external/board/raspberrypi/kernel.config | 1 + buildroot-external/configs/rpi0_w_defconfig | 2 +- buildroot-external/configs/rpi2_defconfig | 2 +- buildroot-external/configs/rpi3_64_defconfig | 2 +- buildroot-external/configs/rpi3_defconfig | 2 +- buildroot-external/configs/rpi_defconfig | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 buildroot-external/board/raspberrypi/kernel.config diff --git a/buildroot-external/board/raspberrypi/kernel.config b/buildroot-external/board/raspberrypi/kernel.config new file mode 100644 index 000000000..a1b9c1e08 --- /dev/null +++ b/buildroot-external/board/raspberrypi/kernel.config @@ -0,0 +1 @@ +CPU_FREQ_DEFAULT_GOV_ONDEMAND=y diff --git a/buildroot-external/configs/rpi0_w_defconfig b/buildroot-external/configs/rpi0_w_defconfig index 51395fb6a..8d8e748ab 100644 --- a/buildroot-external/configs/rpi0_w_defconfig +++ b/buildroot-external/configs/rpi0_w_defconfig @@ -23,7 +23,7 @@ BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6da082a790f857d5163ac99357beae6b59f1eb5" BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi" -BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-0-w" diff --git a/buildroot-external/configs/rpi2_defconfig b/buildroot-external/configs/rpi2_defconfig index 97c0f7f5a..56a397b1c 100644 --- a/buildroot-external/configs/rpi2_defconfig +++ b/buildroot-external/configs/rpi2_defconfig @@ -23,7 +23,7 @@ BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6da082a790f857d5163ac99357beae6b59f1eb5" BR2_LINUX_KERNEL_DEFCONFIG="bcm2709" -BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2709-rpi-2-b" diff --git a/buildroot-external/configs/rpi3_64_defconfig b/buildroot-external/configs/rpi3_64_defconfig index d2ef3ff88..ddcf8f1a7 100644 --- a/buildroot-external/configs/rpi3_64_defconfig +++ b/buildroot-external/configs/rpi3_64_defconfig @@ -23,7 +23,7 @@ BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6da082a790f857d5163ac99357beae6b59f1eb5" BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi3" -BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2710-rpi-3-b broadcom/bcm2837-rpi-3-b broadcom/bcm2710-rpi-3-b-plus" diff --git a/buildroot-external/configs/rpi3_defconfig b/buildroot-external/configs/rpi3_defconfig index 35427891f..25f287bd5 100644 --- a/buildroot-external/configs/rpi3_defconfig +++ b/buildroot-external/configs/rpi3_defconfig @@ -23,7 +23,7 @@ BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6da082a790f857d5163ac99357beae6b59f1eb5" BR2_LINUX_KERNEL_DEFCONFIG="bcm2709" -BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2710-rpi-3-b bcm2710-rpi-3-b-plus bcm2710-rpi-cm3" diff --git a/buildroot-external/configs/rpi_defconfig b/buildroot-external/configs/rpi_defconfig index c12de5c04..7afdddd8d 100644 --- a/buildroot-external/configs/rpi_defconfig +++ b/buildroot-external/configs/rpi_defconfig @@ -23,7 +23,7 @@ BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6da082a790f857d5163ac99357beae6b59f1eb5" BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi" -BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-b bcm2708-rpi-b-plus bcm2708-rpi-cm" From 55cc60fc8e676f5f2c38406753f68e9de0f81bb3 Mon Sep 17 00:00:00 2001 From: Ryan Kladar Date: Mon, 17 Sep 2018 14:07:08 -0700 Subject: [PATCH 04/37] MYLAN_SECRED_KEY should be MYLAN_SECRET_KEY, no? (#196) Changed the placeholder secret key name spelling mistake. --- Documentation/network.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/network.md b/Documentation/network.md index e2dfda359..75b1fd11c 100644 --- a/Documentation/network.md +++ b/Documentation/network.md @@ -55,7 +55,7 @@ ssid=MY_SSID [802-11-wireless-security] auth-alg=open key-mgmt=wpa-psk -psk=MY_WLAN_SECRED_KEY +psk=MY_WLAN_SECRET_KEY [ipv4] method=auto From ad9f21fdfbc32bfa7ee16fc5c266c458708c3dc2 Mon Sep 17 00:00:00 2001 From: borpin Date: Thu, 20 Sep 2018 10:48:57 +0100 Subject: [PATCH 05/37] Update documentation for a static IPV4 address via nmcli (#199) * Update documentation for a static IPV4 address via nmcli This update documents a method to change to a Static IPV4 address using the NetworkManager CLI (nmcli). Happy for the formatting to be modified to suit local convention. I cannot be more specific about how to get into the base OS as I don't know! * Additional nmcli commands for dns and gateway I found that there is a need to add in the dns and gateway IP addresses otherwise there was no route out. I note there are a number of issues alive re this routing problem e.g. https://github.com/home-assistant/home-assistant/issues/15221 * Update network.md --- Documentation/network.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Documentation/network.md b/Documentation/network.md index 75b1fd11c..c853231ef 100644 --- a/Documentation/network.md +++ b/Documentation/network.md @@ -97,6 +97,44 @@ If you have trouble with powersave you can do following: # Values are 0 (use default), 1 (ignore/don't touch), 2 (disable) or 3 (enable). powersave=0 ``` +## Using nmcli to set a static IPV4 address + +Log into the HASSOS base system via a console: + +``` +Welcome to HassOS +Hassio login: +``` +Login as `root` (no password needed) + +At the `hassio >` prompt, type `login` (as instructed). + +From here you will use the `nmcli` configuration tool. + +`# nmcli connection show` will list the “HassOS default” connection in use. + +`# nmcli con show "HassOS default"` will list all the properties of the connection. + +`# nmcli con edit “HassOS default”` will put you in a position to edit the connection. + +`nmcli> print ipv4` will show you the ipv4 properties of this connection. + +To add your static IP address (select 'yes' for manual method); +``` +nmcli> set ipv4.addresses 192.168.100.10/24 +Do you also want to set 'ipv4.method' to 'manual'? [yes]: +``` +In addition I have found it is wise to set the dns server and the local gateway. For most home routers these will be the same address. If you are using Pi-Hole you can set the dns to that. +``` +nmcli> set ipv4.dns 192.168.100.1 +nmcli> set ipv4.gateway 192.168.100.1 +nmcli> save +nmcli> exit +``` + +If you now view the default connection `cat /etc/NetworkManager/system_connections/default` you should see the method is manual and the address is set. + +Doing a `nmcli con reload` does not always work so restart the VM. [keyfile]: https://developer.gnome.org/NetworkManager/stable/nm-settings.html [configuration-usb]: configuration.md From 1112a10509fded6ac52ba39e2d64251890cc079d Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 24 Sep 2018 16:30:04 +0200 Subject: [PATCH 06/37] Raspberry: Fix power options --- buildroot-external/board/raspberrypi/kernel.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot-external/board/raspberrypi/kernel.config b/buildroot-external/board/raspberrypi/kernel.config index a1b9c1e08..2a186347d 100644 --- a/buildroot-external/board/raspberrypi/kernel.config +++ b/buildroot-external/board/raspberrypi/kernel.config @@ -1 +1 @@ -CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y From 8cde7f91929623fcda0c952d40d93e1cbbe683f2 Mon Sep 17 00:00:00 2001 From: Makrand Gupta Date: Wed, 10 Oct 2018 05:31:59 -0400 Subject: [PATCH 07/37] Fixed typo in 'address' property name for Static IP (#208) --- Documentation/network.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/network.md b/Documentation/network.md index c853231ef..58941cc5a 100644 --- a/Documentation/network.md +++ b/Documentation/network.md @@ -72,7 +72,7 @@ Replace follow configuration: ```ini [ipv4] method=manual -address1=192.168.1.111/24,192.168.1.1 +address=192.168.1.111/24,192.168.1.1 dns=8.8.8.8;8.8.4.4; ``` From faa371191fbeda003487b3134a4e28b0b84048c2 Mon Sep 17 00:00:00 2001 From: Johannes Truschnigg Date: Wed, 10 Oct 2018 11:34:06 +0200 Subject: [PATCH 08/37] Implement basic ACPI shutdown support via busybox acpid (#209) On systems where ACPI support is present as inidcated by the presence of /proc/acpi (e.g. on OVA compatible hypervisors), we want to properly shut down the system when the power button is pressed (or the hypervisor simulates this kind of event to the guest machine that executes hassos). This changeset provides the following basic infrastructure for this feature to work as expected: * a systemd service to start acpid, if ACPI support can be assumed * an acpid configuration directory * a trivial shutdown script to invoke when a PWR event is registered --- .../rootfs-overlay/etc/acpi/PWRF/00000080 | 7 +++++++ .../multi-user.target.wants/busybox-acpid.service | 1 + .../usr/lib/systemd/system/busybox-acpid.service | 12 ++++++++++++ 3 files changed, 20 insertions(+) create mode 100755 buildroot-external/rootfs-overlay/etc/acpi/PWRF/00000080 create mode 120000 buildroot-external/rootfs-overlay/etc/systemd/system/multi-user.target.wants/busybox-acpid.service create mode 100644 buildroot-external/rootfs-overlay/usr/lib/systemd/system/busybox-acpid.service diff --git a/buildroot-external/rootfs-overlay/etc/acpi/PWRF/00000080 b/buildroot-external/rootfs-overlay/etc/acpi/PWRF/00000080 new file mode 100755 index 000000000..08ef0f7ad --- /dev/null +++ b/buildroot-external/rootfs-overlay/etc/acpi/PWRF/00000080 @@ -0,0 +1,7 @@ +#!/bin/sh + +# This script is exec()d by acpid when an ACPI event signals the power button +# to have been pressed. + +echo "System power button was pressed - shutting down..." +exec /bin/systemctl poweroff diff --git a/buildroot-external/rootfs-overlay/etc/systemd/system/multi-user.target.wants/busybox-acpid.service b/buildroot-external/rootfs-overlay/etc/systemd/system/multi-user.target.wants/busybox-acpid.service new file mode 120000 index 000000000..58ebeea6d --- /dev/null +++ b/buildroot-external/rootfs-overlay/etc/systemd/system/multi-user.target.wants/busybox-acpid.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/busybox-acpid.service \ No newline at end of file diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/busybox-acpid.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/busybox-acpid.service new file mode 100644 index 000000000..77aa28f5e --- /dev/null +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/busybox-acpid.service @@ -0,0 +1,12 @@ +[Unit] +Description=acpid (busybox) +RefuseManualStop=true +ConditionPathIsDirectory=/proc/acpi + +[Service] +Type=simple +ExecStart=/sbin/acpid -d + +[Install] +After=local-fs.target +WantedBy=multi-user.target From dac76b1632371aa16a4bf8debe6150c805125fc0 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 11 Oct 2018 20:49:20 +0200 Subject: [PATCH 09/37] Allow udev rules & make it persistent (#210) * Install default to lib * Create hmip-rfusb.rules * Create etc-udev-rules.d.mount * Update hassos-config * Update configuration.md * Update rauc.sh * Add ln --- Documentation/configuration.md | 6 ++++++ .../package/bluetooth-bcm43xx/bluetooth-bcm43xx.mk | 4 ++-- .../etc-udev-rules.d.mount | 1 + .../usr/lib/systemd/system/etc-udev-rules.d.mount | 14 ++++++++++++++ .../usr/lib/udev/rules.d/hmip-rfusb.rules | 1 + .../rootfs-overlay/usr/sbin/hassos-config | 9 +++++++++ buildroot-external/scripts/rauc.sh | 4 ++-- 7 files changed, 35 insertions(+), 4 deletions(-) create mode 120000 buildroot-external/rootfs-overlay/etc/systemd/system/hassos-bind.target.wants/etc-udev-rules.d.mount create mode 100644 buildroot-external/rootfs-overlay/usr/lib/systemd/system/etc-udev-rules.d.mount create mode 100644 buildroot-external/rootfs-overlay/usr/lib/udev/rules.d/hmip-rfusb.rules diff --git a/Documentation/configuration.md b/Documentation/configuration.md index 330c0d77a..9d909c773 100644 --- a/Documentation/configuration.md +++ b/Documentation/configuration.md @@ -8,12 +8,14 @@ Format a USB stick with FAT32/EXT4/NTFS and name it `CONFIG`. Use the following ```text network/ modules/ +udev/ authorized_keys hassos-xy.raucb ``` - The `network` folder can contain any kind of NetworkManager connection files. For more information see [Network][network.md]. - The `modules` folder is for modules-load configuration files. +- The `udev` folder is for udev rules files. - The `authorized_keys` file activates debug SSH access on port `22222`. See [Debugging Hassio][debug-hassio]. - The `hassos-*.raucb` file is a firmware OTA update which will be installed. These can be found on on the [release][hassos-release] page. @@ -30,6 +32,10 @@ You can edit or create a `cmdline.txt` in your boot partition. That will be read The kernel module folder `/etc/modules-load.d` is persistent and you can add your configuration files there. See [Systemd modules load][systemd-modules]. +### Udev rules + +The udev rules folder `/etc/udev/rules.d` is persistent and you can add your configuration files there. + ### Network You can manual add, edit or remove connections configurations from `/etc/NetworkManager/system-connections`. diff --git a/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.mk b/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.mk index 37cfcf1fb..ce9829450 100644 --- a/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.mk +++ b/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.mk @@ -24,8 +24,8 @@ define BLUETOOTH_BCM43XX_INSTALL_TARGET_CMDS $(INSTALL) -d $(TARGET_DIR)/lib/firmware/brcm $(INSTALL) -m 0644 $(@D)/*.hcd $(TARGET_DIR)/lib/firmware/brcm/ - $(INSTALL) -d $(TARGET_DIR)/etc/udev/rules.d - $(INSTALL) -m 0644 $(@D)/bluetooth-bcm43xx.rules $(TARGET_DIR)/etc/udev/rules.d/ + $(INSTALL) -d $(TARGET_DIR)/usr/lib/udev/rules.d + $(INSTALL) -m 0644 $(@D)/bluetooth-bcm43xx.rules $(TARGET_DIR)/usr/lib/udev/rules.d/ endef $(eval $(generic-package)) diff --git a/buildroot-external/rootfs-overlay/etc/systemd/system/hassos-bind.target.wants/etc-udev-rules.d.mount b/buildroot-external/rootfs-overlay/etc/systemd/system/hassos-bind.target.wants/etc-udev-rules.d.mount new file mode 120000 index 000000000..c148f8000 --- /dev/null +++ b/buildroot-external/rootfs-overlay/etc/systemd/system/hassos-bind.target.wants/etc-udev-rules.d.mount @@ -0,0 +1 @@ +/usr/lib/systemd/system/etc-udev-rules.d.mount \ No newline at end of file diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/etc-udev-rules.d.mount b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/etc-udev-rules.d.mount new file mode 100644 index 000000000..5e6badb81 --- /dev/null +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/etc-udev-rules.d.mount @@ -0,0 +1,14 @@ +[Unit] +Description=Udev persistent rules.d +Requires=mnt-overlay.mount +After=mnt-overlay.mount +Before=systemd-udevd.service hassos-config.service + +[Mount] +What=/mnt/overlay/etc/udev/rules.d +Where=/etc/udev/rules.d +Type=None +Options=bind + +[Install] +WantedBy=hassos-bind.target diff --git a/buildroot-external/rootfs-overlay/usr/lib/udev/rules.d/hmip-rfusb.rules b/buildroot-external/rootfs-overlay/usr/lib/udev/rules.d/hmip-rfusb.rules new file mode 100644 index 000000000..8d43adc3d --- /dev/null +++ b/buildroot-external/rootfs-overlay/usr/lib/udev/rules.d/hmip-rfusb.rules @@ -0,0 +1 @@ +ACTION=="add", ATTRS{idVendor}=="1b1f", ATTRS{idProduct}=="c020", RUN+="/sbin/modprobe cp210x" RUN+="/bin/sh -c 'echo 1b1f c020 >/sys/bus/usb-serial/drivers/cp210x/new_id'" diff --git a/buildroot-external/rootfs-overlay/usr/sbin/hassos-config b/buildroot-external/rootfs-overlay/usr/sbin/hassos-config index 99c295520..f633c4cab 100755 --- a/buildroot-external/rootfs-overlay/usr/sbin/hassos-config +++ b/buildroot-external/rootfs-overlay/usr/sbin/hassos-config @@ -33,6 +33,15 @@ if [ -d /mnt/config/modules ]; then cp -f /mnt/config/modules/* /etc/modules-load.d/* fi +## +# Udev +if [ -d /mnt/config/udev ]; then + echo "[Info] Update Udev configuration!" + + rm -rf /etc/udev/rules.d/* + cp -f /mnt/config/udev/* /etc/udev/rules.d/* +fi + ## # SSH know hosts if [ -f /mnt/config/authorized_keys ]; then diff --git a/buildroot-external/scripts/rauc.sh b/buildroot-external/scripts/rauc.sh index b130564e0..ade1b9205 100755 --- a/buildroot-external/scripts/rauc.sh +++ b/buildroot-external/scripts/rauc.sh @@ -86,7 +86,7 @@ function install_bootloader_config() { # Fix MBR if [ "${BOOT_SYS}" == "mbr" ]; then - mkdir -p ${TARGET_DIR}/etc/udev/rules.d - cp -f ${BR2_EXTERNAL_HASSOS_PATH}/misc/mbr-part.rules ${TARGET_DIR}/etc/udev/rules.d/ + mkdir -p ${TARGET_DIR}/usr/lib/udev/rules.d + cp -f ${BR2_EXTERNAL_HASSOS_PATH}/misc/mbr-part.rules ${TARGET_DIR}/usr/lib/udev/rules.d/ fi } From c475daf889b020a2791f7490ab2bfd54a0e56942 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 11 Oct 2018 20:56:11 +0200 Subject: [PATCH 10/37] build: tuning dockerignore --- .dockerignore | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index e63620f87..31ddfc842 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,7 @@ -buildroot -buildroot-external -buildroot-patches +# We don't need this folder because we map the hole folder +buildroot/ +buildroot-external/ +buildroot-patches/ + +# Ignore too +release/ From b83bfc59106a38f5138877ef2f32d943528cf62b Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sat, 13 Oct 2018 17:57:22 +0200 Subject: [PATCH 11/37] Bump version --- buildroot-external/meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot-external/meta b/buildroot-external/meta index 0a4d30355..773ae8c33 100644 --- a/buildroot-external/meta +++ b/buildroot-external/meta @@ -1,5 +1,5 @@ VERSION_MAJOR=2 -VERSION_BUILD=2 +VERSION_BUILD=3 HASSOS_NAME="HassOS" HASSOS_ID="hassos" From 482e6f7a7b4832f8aeac4f9b1f54bfa44a9f4692 Mon Sep 17 00:00:00 2001 From: Robert Schindler Date: Sat, 13 Oct 2018 17:58:13 +0200 Subject: [PATCH 12/37] Added 8021q kernel module for VLAN support (#216) --- buildroot-external/kernel/hassos-4_14.config | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildroot-external/kernel/hassos-4_14.config b/buildroot-external/kernel/hassos-4_14.config index ba4551719..36f330a9d 100644 --- a/buildroot-external/kernel/hassos-4_14.config +++ b/buildroot-external/kernel/hassos-4_14.config @@ -41,6 +41,10 @@ CONFIG_MACVLAN=y CONFIG_IPVLAN=y CONFIG_VXLAN=y +CONFIG_VLAN_8021Q=m +CONFIG_VLAN_8021Q_GVRP=y +CONFIG_VLAN_8021Q_MVRP=y + CONFIG_INET=y CONFIG_IPV6=y CONFIG_INET_ESP=y From 005cbc0b89405e210a0b8451c3006ced54e67f1b Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 16 Oct 2018 16:32:00 +0200 Subject: [PATCH 13/37] OS: use newer docker run command (#217) * OS: use newer docker run command * Update hassos-supervisor --- buildroot-external/rootfs-overlay/usr/sbin/hassos-cli | 2 +- .../rootfs-overlay/usr/sbin/hassos-supervisor | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/buildroot-external/rootfs-overlay/usr/sbin/hassos-cli b/buildroot-external/rootfs-overlay/usr/sbin/hassos-cli index aecb62d08..e6f5914c7 100755 --- a/buildroot-external/rootfs-overlay/usr/sbin/hassos-cli +++ b/buildroot-external/rootfs-overlay/usr/sbin/hassos-cli @@ -11,7 +11,7 @@ CLI_DATA=/mnt/data/cli mkdir -p ${CLI_DATA} # Run CLI -docker run \ +docker container run \ --rm -ti --init \ --security-opt apparmor="${APPARMOR}" \ -v ${CLI_DATA}:/data \ diff --git a/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor b/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor index e614a1454..eef027765 100755 --- a/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor +++ b/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor @@ -19,8 +19,8 @@ if ! grep ${APPARMOR} /sys/kernel/security/apparmor/profiles > /dev/null; then fi runSupervisor() { - docker rm --force hassos_supervisor || true - docker run --name hassos_supervisor \ + docker container rm --force hassos_supervisor || true + docker container run --name hassos_supervisor \ --security-opt apparmor="${APPARMOR}" \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /var/run/dbus:/var/run/dbus \ @@ -34,4 +34,4 @@ runSupervisor() { # Run supervisor mkdir -p ${HASSOS_DATA} -([ "${HASSOS_IMAGE_ID}" = "${HASSOS_CONTAINER_ID}" ] && docker start --attach hassos_supervisor) || runSupervisor +([ "${HASSOS_IMAGE_ID}" = "${HASSOS_CONTAINER_ID}" ] && docker container start --attach hassos_supervisor) || runSupervisor From 921dd693dd3b785784ce8058299e4faed9bd84d5 Mon Sep 17 00:00:00 2001 From: Johannes Truschnigg <5927519+jtru@users.noreply.github.com> Date: Wed, 24 Oct 2018 15:52:45 +0200 Subject: [PATCH 14/37] Add informal "getting started with development" document (#220) --- Documentation/getting_started_development.md | 106 +++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 Documentation/getting_started_development.md diff --git a/Documentation/getting_started_development.md b/Documentation/getting_started_development.md new file mode 100644 index 000000000..053aa807d --- /dev/null +++ b/Documentation/getting_started_development.md @@ -0,0 +1,106 @@ +Getting started with Hassos development using Docker on GNU/Linux +================================================================= + +First, install **docker** for your distribution - I'd advise to use your distro's provided packages, since that will make sure permissions et al. are sanely set up for what you are about to run. You're also expected to have your current user properly set up in in your sudoers policy, so that this account may elevate to root and execute arbitrary commands as UID 0 (this is required, since at some point during the build process, a new loopback device-backed filesystem image will be mounted inside a docker container - which requires a "privileged" container to run, which can only be done as root). + +Next, make sure the docker daemon is running: + +``` +$ sudo systemctl status docker +● docker.service - Docker Application Container Engine + Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled) + Active: inactive (dead) + Docs: https://docs.docker.com +``` + +My desktop distro doesn't start newly installed services by default, which means I'll have to manually fire up the `docker` service: + +``` +$ sudo systemctl start docker +$ sudo systemctl --no-pager status docker -n0 +● docker.service - Docker Application Container Engine + Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled) + Active: active (running) since Wed 2018-10-10 21:08:23 CEST; 25s ago + Docs: https://docs.docker.com + Main PID: 1531 (dockerd) + Tasks: 27 (limit: 4915) + Memory: 163.4M + CGroup: /system.slice/docker.service + ├─1531 /usr/bin/dockerd -H fd:// + └─1539 docker-containerd --config /var/run/docker/containerd/containerd.toml +``` + +Now, change your working directory to your hassos repo checkout (please adapt pathnames as needed), make sure your intended changes to the source tree are applied (and committed, ideally :)), and execute the `enter.sh` helper script: + +``` +$ cd ~/codebase/hassos/ +$ sudo scripts/enter.sh +Sending build context to Docker daemon 30.48MB +Step 1/6 : FROM ubuntu:18.04 +[...] + ---> 4dc25a21556b +Successfully built 4dc25a21556b +Successfully tagged hassbuildroot:latest +``` + +Note that the current iteration of `enter.sh` will try to load the **overlayfs** kernel module, which is not strictly required for docker's operation, as far as I can tell. It's OK if loading that module fails; the shell script will continue executing. If everything works out, you will find yourself in an interactive login shell inside your docker container/build environment, where you can peek around: + +``` +root@somehashinhex:/build# +root@somehashinhex:/build# cat scripts/build-all.sh +[...] +``` + +The _hassos_ developers provides another convenience script that will build hassos images for a (rather long!) list of targets - if you're not interested in building artifacts for all supported platforms, make sure to take a peek inside and monkeypatch away... After you're done making changes, start it, and go make a cup of tea. Or fifteen. + +``` +root@0db6f7079872:/build# scripts/build-all.sh +[...] +``` + +Personally, I removed all advertised build targets from the `all_platforms` array variable, expect for the _ova_ variant. That will result in a single VMDK image file at the very end of the build process. This image file is a compressed block device dump with a proper GPT partition table, prepared to ship into any OVA-compatible hypervisor's innards. For me, the end of the **ova** build steps looks like this: + +``` +[...] +2097152+0 records out +1073741824 bytes (1.1 GB, 1.0 GiB) copied, 12.2145 s, 87.9 MB/s +make: Leaving directory '/build/buildroot' +make: Entering directory '/build/buildroot' +rm -rf /build/buildroot/output/target /build/buildroot/output/images /build/buildroot/output/host \ + /build/buildroot/output/build /build/buildroot/output/staging \ + /build/buildroot/output/legal-info /build/buildroot/output/graphs +make: Leaving directory '/build/buildroot' +``` + +The artifacts you just built are placed in the `target/` subdirectory: + +``` +root@fd292c061896:/build# ls -lh release/ +total 141M +-rw-r--r-- 1 root root 141M Oct 10 20:22 hassos_ova-2.2.vmdk.gz +``` + +In order to be able to use this image file with the **qemu** hypervisor, you'll need to unpack it, and convert it to an image format that qemu can work with. Conveniently, the _hassos_ buildenv already provides all the tools we need for this conversion: + +``` +root@fd292c061896:/build# gunzip release/hassos_ova-2.2.vmdk.gz +root@fd292c061896:/build# qemu-img convert -O qcow2 release/hassos_ova-2.2.vmdk release/hassos_ova-2.2.qcow2 +root@fd292c061896:/build# ls -lh release/ +total 673M +-rw-r--r-- 1 root root 337M Oct 10 20:25 hassos_ova-2.2.qcow2 +-rw-r--r-- 1 root root 337M Oct 10 20:22 hassos_ova-2.2.vmdk +``` + +Now, exit the docker container's environment, and find the build artifacts in the `releases/` directory beneath your repository checkout dir. (The generated files will be owned by _root_; make sure to `chown` them to your user account, if needed.) + +From there, qemu can try to boot it. Since the generated image assumes UEFI support in the host/hypervisor, this is slightly more tricky than with "classic"(/legacy) MBR-based images. On the *Debian* host I use to run my qemu virtual machine on, you'll need to install the **ovmf** package, which is described as providing "UEFI firmware for 64-bit x86 virtual machines". That package will install a _TianoCore_-derived qemu UEFI image build at `/usr/share/OVMF/OVMF_CODE.fd`, which we'll use with qemu to boot the generated qcow2 image. (Please adapt pathnames as necessary, for example if you have installed the ovmf firmware image at another location.) + +``` +$ /usr/bin/qemu-system-x86_64 -enable-kvm -name hassos_ova -smp 2 -m 1024 -drive file=release/hassos_ova-2.2.qcow2,index=0,media=disk,if=ide,cache=none,format=qcow2 -drive file=/usr/share/ovmf/x64/OVMF_CODE.fd,if=pflash,format=raw,readonly=on +``` + +This should pop up qemu's SDL frontend, displaying _hassos_' VT/CLI environment. Specifying addtional options and flags to qemu for network access, keyboard layout et al. are left as an exercise for the reader. + +After the boot process has finished, you can log in to _hassos_ without a password, providing *root* as the username. From there, executing `login` on the *hassio>* shell prompt will yield a root shell in the host OS. + +Happy hacking! :) From b827a90a35184f3d76c9989128c3084dc3a7d3ae Mon Sep 17 00:00:00 2001 From: Johannes Truschnigg <5927519+jtru@users.noreply.github.com> Date: Wed, 24 Oct 2018 15:54:26 +0200 Subject: [PATCH 15/37] Enable XHCI (USB3) support in ova kernel config (#221) With this change, hassos can have USB devices passed into a guest VM with the hypervisor emulating an XHCI controller. QEMU recommends using XHCI whenever possible, as it offers a much more virtualization-friendly architecture than its [EO]HCI predecessors (which are already support by the hassos kernel). --- buildroot-external/board/ova/kernel.config | 1 + 1 file changed, 1 insertion(+) diff --git a/buildroot-external/board/ova/kernel.config b/buildroot-external/board/ova/kernel.config index e00621bf8..8c2187160 100644 --- a/buildroot-external/board/ova/kernel.config +++ b/buildroot-external/board/ova/kernel.config @@ -7,3 +7,4 @@ CONFIG_VIRTIO_BALLOON=m CONFIG_VIRTIO_INPUT=m CONFIG_VIRTIO_BLK=m +CONFIG_USB_XHCI_HCD=y From bcb9c3fa1f4832fabd09e3879aacabe03778bc68 Mon Sep 17 00:00:00 2001 From: Dave Date: Wed, 24 Oct 2018 06:55:09 -0700 Subject: [PATCH 16/37] Remove smart quotes and fix typo (#222) Both of these create errors when copy pasting to follow the instructions: - Remove smart quotes from around "HassOS default" - Changing typo of 'system_connections' to 'system-connections' --- Documentation/network.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/network.md b/Documentation/network.md index 58941cc5a..d77cb4abf 100644 --- a/Documentation/network.md +++ b/Documentation/network.md @@ -115,7 +115,7 @@ From here you will use the `nmcli` configuration tool. `# nmcli con show "HassOS default"` will list all the properties of the connection. -`# nmcli con edit “HassOS default”` will put you in a position to edit the connection. +`# nmcli con edit "HassOS default"` will put you in a position to edit the connection. `nmcli> print ipv4` will show you the ipv4 properties of this connection. @@ -132,7 +132,7 @@ nmcli> save nmcli> exit ``` -If you now view the default connection `cat /etc/NetworkManager/system_connections/default` you should see the method is manual and the address is set. +If you now view the default connection `cat /etc/NetworkManager/system-connections/default` you should see the method is manual and the address is set. Doing a `nmcli con reload` does not always work so restart the VM. From 2291e8599e0278dc7bbed57071c558b1b2d074ae Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 25 Oct 2018 21:59:58 +0200 Subject: [PATCH 17/37] OS: Config importer support now also boot partition (#212) * OS: Config importer support now also boot partition * Update configuration.md * Cleanup config after import * Update hassos-config --- Documentation/configuration.md | 2 +- .../rootfs-overlay/usr/sbin/hassos-config | 69 ++++++++++++------- 2 files changed, 47 insertions(+), 24 deletions(-) diff --git a/Documentation/configuration.md b/Documentation/configuration.md index 9d909c773..e12a71353 100644 --- a/Documentation/configuration.md +++ b/Documentation/configuration.md @@ -3,7 +3,7 @@ ## Automatic You can use an USB drive with HassOS to configure network options, SSH access to the host and to install updates. -Format a USB stick with FAT32/EXT4/NTFS and name it `CONFIG`. Use the following directory structure within the USB drive: +Format a USB stick with FAT32/EXT4/NTFS and name it `CONFIG`. Alternative you can create a `CONFIG` folder inside boot partition. Use the following directory structure within the USB drive: ```text network/ diff --git a/buildroot-external/rootfs-overlay/usr/sbin/hassos-config b/buildroot-external/rootfs-overlay/usr/sbin/hassos-config index f633c4cab..998ba18ec 100755 --- a/buildroot-external/rootfs-overlay/usr/sbin/hassos-config +++ b/buildroot-external/rootfs-overlay/usr/sbin/hassos-config @@ -1,69 +1,88 @@ #!/bin/sh -if ! findfs LABEL="CONFIG" > /dev/null; then +BOOT_CONFIG="/mnt/boot/CONFIG" +USB_CONFIG="/mnt/config" +CONFIG_DIR="" +USE_USB=0 + +# Check and mount usb CONFIG to folder +if findfs LABEL="CONFIG" > /dev/null 2>&1; then + echo "[Info] Use USB stick for import CONFIG" + + systemctl start mnt-config.mount + if ! systemctl -q is-active mnt-config.mount; then + echo "[Error] Can't mount config partition" + exit 1 + fi + + USE_USB=1 + CONFIG_DIR=${USB_CONFIG} +fi + +# Use boot CONFIG folder +if [ ${USE_USB} = 0 ] && [ -d ${BOOT_CONFIG} ]; then + echo "[Info] Use boot partition for import CONFIG" + CONFIG_DIR=${BOOT_CONFIG} +elif [ ${USE_USB} = 0 ]; then echo "[Warning] No config partition found" exit 0 fi -# Mount config folder -systemctl start mnt-config.mount -if ! systemctl -q is-active mnt-config.mount; then - echo "[Error] Can't mount config partition" - exit 1 -fi ## # NetworkManager -if [ -d /mnt/config/network ]; then +if [ -d "${CONFIG_DIR}/network" ]; then echo "[Info] Update NetworkManager connections!" rm -rf /etc/NetworkManager/system-connections/* - cp -f /mnt/config/network/* /etc/NetworkManager/system-connections/ + cp -f ${CONFIG_DIR}/network/* /etc/NetworkManager/system-connections/ chmod 600 /etc/NetworkManager/system-connections/* - nmcli con reload + nmcli con reload > /dev/null 2>&1 fi ## # Modules -if [ -d /mnt/config/modules ]; then +if [ -d "${CONFIG_DIR}/modules" ]; then echo "[Info] Update Modules configuration!" rm -rf /etc/modules-load.d/* - cp -f /mnt/config/modules/* /etc/modules-load.d/* + cp -f ${CONFIG_DIR}/modules/* /etc/modules-load.d/* fi ## # Udev -if [ -d /mnt/config/udev ]; then +if [ -d "${CONFIG_DIR}/udev" ]; then echo "[Info] Update Udev configuration!" rm -rf /etc/udev/rules.d/* - cp -f /mnt/config/udev/* /etc/udev/rules.d/* + cp -f ${CONFIG_DIR}/udev/* /etc/udev/rules.d/* fi ## # SSH know hosts -if [ -f /mnt/config/authorized_keys ]; then +if [ -f "${CONFIG_DIR}/authorized_keys" ]; then echo "[Info] Update SSH authorized_keys!" - cp -f /mnt/config/authorized_keys /root/.ssh/authorized_keys + cp -f ${CONFIG_DIR}/authorized_keys /root/.ssh/authorized_keys chmod 600 /root/.ssh/authorized_keys - systemctl start dropbear + systemctl start dropbear > /dev/null 2>&1 else + echo "[Info] Stop SSH debug access" + rm -f /root/.ssh/authorized_keys - systemctl stop dropbear + systemctl stop dropbear > /dev/null 2>&1 fi ## -# Firmware update +# Firmware update / Only USB UPTIME=$(awk '{printf "%0.f", $1}' /proc/uptime) -if ls /mnt/config/*.raucb > /dev/null && [ ${UPTIME} -ge 180 ]; then +if ls ${USB_CONFIG}/*.raucb > /dev/null 2>&1 && [ ${UPTIME} -ge 180 ]; then echo "[Info] Performe a firmware update" - rauc_filename=$(ls /mnt/config/*.raucb | head -n 1) - if rauc install ${rauc_filename}; then + rauc_filename=$(ls ${USB_CONFIG}/*.raucb | head -n 1) + if rauc install "${rauc_filename}"; then echo "[Info] Firmware update success" systemctl reboot else @@ -72,4 +91,8 @@ if ls /mnt/config/*.raucb > /dev/null && [ ${UPTIME} -ge 180 ]; then fi # Cleanup config partition -systemctl stop mnt-config.mount +if [ ${USE_USB} = 1 ]; then + systemctl stop mnt-config.mount +else + rm -rf ${BOOT_CONFIG} +fi From 960e11dc4f7f32fa3c4937a432ee79d0fe8f1686 Mon Sep 17 00:00:00 2001 From: Ryan Bray Date: Fri, 26 Oct 2018 02:36:29 -0700 Subject: [PATCH 18/37] Uboot bootstate (#215) * Uboot: cleaning up bootstate env import/export. * Tinker: Add potential eMMC boot support. --- ...1-Support-HassOS-bootstate-partition.patch | 29 ------------------- .../board/asus/tinker/uboot-boot.sh | 26 +++++++++++++---- .../board/asus/tinker/uboot.config | 3 +- .../board/hardkernel/odroid-c2/uboot-boot.sh | 16 +++++----- ...1-Support-HassOS-bootstate-partition.patch | 29 ------------------- .../board/raspberrypi/rpi3-64/uboot-boot.sh | 18 ++++++++++-- .../board/raspberrypi/uboot-boot.sh | 18 ++++++++++-- .../board/raspberrypi/uboot.config | 3 +- 8 files changed, 63 insertions(+), 79 deletions(-) delete mode 100644 buildroot-external/board/asus/tinker/patches/uboot/0001-Support-HassOS-bootstate-partition.patch delete mode 100644 buildroot-external/board/raspberrypi/patches/uboot/0001-Support-HassOS-bootstate-partition.patch diff --git a/buildroot-external/board/asus/tinker/patches/uboot/0001-Support-HassOS-bootstate-partition.patch b/buildroot-external/board/asus/tinker/patches/uboot/0001-Support-HassOS-bootstate-partition.patch deleted file mode 100644 index 29b0f47cb..000000000 --- a/buildroot-external/board/asus/tinker/patches/uboot/0001-Support-HassOS-bootstate-partition.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 8458beb24f2540fff3c3faed4fa068553b9e474e Mon Sep 17 00:00:00 2001 -From: Pascal Vizeli -Date: Wed, 8 Aug 2018 09:45:07 +0000 -Subject: [PATCH 1/1] Support HassOS bootstate partition - -Signed-off-by: Pascal Vizeli ---- - env/mmc.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/env/mmc.c b/env/mmc.c -index 5e3da6dca75..353f58a12c9 100644 ---- a/env/mmc.c -+++ b/env/mmc.c -@@ -18,6 +18,11 @@ - #include - #include - -+#undef CONFIG_SYS_MMC_ENV_DEV -+#define CONFIG_SYS_MMC_ENV_DEV 1 -+#undef CONFIG_ENV_OFFSET -+#define CONFIG_ENV_OFFSET 0x25100000 -+ - #define __STR(X) #X - #define STR(X) __STR(X) - --- -2.17.1 - diff --git a/buildroot-external/board/asus/tinker/uboot-boot.sh b/buildroot-external/board/asus/tinker/uboot-boot.sh index dc8b0d179..e882f60ff 100644 --- a/buildroot-external/board/asus/tinker/uboot-boot.sh +++ b/buildroot-external/board/asus/tinker/uboot-boot.sh @@ -1,3 +1,17 @@ + +part start mmc ${devnum} 6 mmc_env +mmc dev ${devnum} +setenv loadbootstate " \ + echo 'loading env...'; \ + mmc read ${ramdisk_addr_r} ${mmc_env} 0x40; \ + env import -c ${ramdisk_addr_r} 0x8000;" + +setenv storebootstate " \ + echo 'storing env...'; \ + env export -c -s 0x8000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT; \ + mmc write ${ramdisk_addr_r} ${mmc_env} 0x40;" + +run loadbootstate test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 @@ -10,10 +24,10 @@ setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 rootfstype=squashfs ro" # Load extraargs -fileenv mmc 1:1 ${ramdisk_addr_r} cmdline.txt cmdline +fileenv mmc ${devnum}:1 ${ramdisk_addr_r} cmdline.txt cmdline # Load device tree -fatload mmc 1:1 ${fdt_addr_r} rk3288-tinker.dtb +fatload mmc ${devnum}:1 ${fdt_addr_r} rk3288-tinker.dtb setenv bootargs for BOOT_SLOT in "${BOOT_ORDER}"; do @@ -23,26 +37,26 @@ for BOOT_SLOT in "${BOOT_ORDER}"; do if test ${BOOT_A_LEFT} -gt 0; then setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1 echo "Found valid slot A, ${BOOT_A_LEFT} attempts remaining" - setenv load_kernel "ext4load mmc 1:2 ${kernel_addr_r} zImage" + setenv load_kernel "ext4load mmc ${devnum}:2 ${kernel_addr_r} zImage" setenv bootargs "${bootargs_hassos} ${bootargs_a} rauc.slot=A ${cmdline}" fi elif test "x${BOOT_SLOT}" = "xB"; then if test ${BOOT_B_LEFT} -gt 0; then setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1 echo "Found valid slot B, ${BOOT_B_LEFT} attempts remaining" - setenv load_kernel "ext4load mmc 1:4 ${kernel_addr_r} zImage" + setenv load_kernel "ext4load mmc ${devnum}:4 ${kernel_addr_r} zImage" setenv bootargs "${bootargs_hassos} ${bootargs_b} rauc.slot=B ${cmdline}" fi fi done if test -n "${bootargs}"; then - saveenv + run storebootstate else echo "No valid slot found, resetting tries to 3" setenv BOOT_A_LEFT 3 setenv BOOT_B_LEFT 3 - saveenv + run storebootstate reset fi diff --git a/buildroot-external/board/asus/tinker/uboot.config b/buildroot-external/board/asus/tinker/uboot.config index e2e1ea464..97cc22fbf 100644 --- a/buildroot-external/board/asus/tinker/uboot.config +++ b/buildroot-external/board/asus/tinker/uboot.config @@ -2,5 +2,4 @@ # CONFIG_DOS_PARTITION is not set CONFIG_DM_VIDEO=y CONFIG_CMD_FILEENV=y -CONFIG_ENV_IS_IN_MMC=y -CONFIG_ENV_OFFSET=0x25100000 +CONFIG_ENV_IS_NOWHERE=Y diff --git a/buildroot-external/board/hardkernel/odroid-c2/uboot-boot.sh b/buildroot-external/board/hardkernel/odroid-c2/uboot-boot.sh index 226faca9b..9f00e3b5c 100644 --- a/buildroot-external/board/hardkernel/odroid-c2/uboot-boot.sh +++ b/buildroot-external/board/hardkernel/odroid-c2/uboot-boot.sh @@ -3,15 +3,15 @@ part start mmc ${devnum} 9 mmc_env mmc dev ${devnum} -setenv loadbootstate "\ -echo 'loading env...';\ -mmc read ${ramdisk_addr_r} ${mmc_env} 0x10;\ -env import -c ${ramdisk_addr_r} 0x2000;" +setenv loadbootstate " \ + echo 'loading env...'; \ + mmc read ${ramdisk_addr_r} ${mmc_env} 0x10; \ + env import -c ${ramdisk_addr_r} 0x2000;" -setenv storebootstate "\ -echo 'storing env...';\ -env export -c -s 0x2000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT;\ -mmc write ${ramdisk_addr_r} ${mmc_env} 0x10;" +setenv storebootstate " \ + echo 'storing env...'; \ + env export -c -s 0x2000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT; \ + mmc write ${ramdisk_addr_r} ${mmc_env} 0x10;" run loadbootstate test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" diff --git a/buildroot-external/board/raspberrypi/patches/uboot/0001-Support-HassOS-bootstate-partition.patch b/buildroot-external/board/raspberrypi/patches/uboot/0001-Support-HassOS-bootstate-partition.patch deleted file mode 100644 index 0061130fe..000000000 --- a/buildroot-external/board/raspberrypi/patches/uboot/0001-Support-HassOS-bootstate-partition.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 8458beb24f2540fff3c3faed4fa068553b9e474e Mon Sep 17 00:00:00 2001 -From: Pascal Vizeli -Date: Wed, 8 Aug 2018 09:45:07 +0000 -Subject: [PATCH 1/1] Support HassOS bootstate partition - -Signed-off-by: Pascal Vizeli ---- - env/mmc.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/env/mmc.c b/env/mmc.c -index 5e3da6dca75..353f58a12c9 100644 ---- a/env/mmc.c -+++ b/env/mmc.c -@@ -18,6 +18,11 @@ - #include - #include - -+#undef CONFIG_SYS_MMC_ENV_DEV -+#define CONFIG_SYS_MMC_ENV_DEV 0 -+#undef CONFIG_ENV_OFFSET -+#define CONFIG_ENV_OFFSET 0x25100000 -+ - #define __STR(X) #X - #define STR(X) __STR(X) - --- -2.17.1 - diff --git a/buildroot-external/board/raspberrypi/rpi3-64/uboot-boot.sh b/buildroot-external/board/raspberrypi/rpi3-64/uboot-boot.sh index a04666cc6..0d6595cd7 100644 --- a/buildroot-external/board/raspberrypi/rpi3-64/uboot-boot.sh +++ b/buildroot-external/board/raspberrypi/rpi3-64/uboot-boot.sh @@ -1,3 +1,17 @@ + +part start mmc ${devnum} 6 mmc_env +mmc dev ${devnum} +setenv loadbootstate " \ + echo 'loading env...'; \ + mmc read ${ramdisk_addr_r} ${mmc_env} 0x20; \ + env import -c ${ramdisk_addr_r} 0x4000;" + +setenv storebootstate " \ + echo 'storing env...'; \ + env export -c -s 0x4000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT; \ + mmc write ${ramdisk_addr_r} ${mmc_env} 0x20;" + +run loadbootstate test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 @@ -38,12 +52,12 @@ done setenv fdt_addr if test -n "${bootargs}"; then - saveenv + run storebootstate else echo "No valid slot found, resetting tries to 3" setenv BOOT_A_LEFT 3 setenv BOOT_B_LEFT 3 - saveenv + run storebootstate reset fi diff --git a/buildroot-external/board/raspberrypi/uboot-boot.sh b/buildroot-external/board/raspberrypi/uboot-boot.sh index 7355334ce..fa84eb39f 100644 --- a/buildroot-external/board/raspberrypi/uboot-boot.sh +++ b/buildroot-external/board/raspberrypi/uboot-boot.sh @@ -1,3 +1,17 @@ + +part start mmc ${devnum} 6 mmc_env +mmc dev ${devnum} +setenv loadbootstate " \ + echo 'loading env...'; \ + mmc read ${ramdisk_addr_r} ${mmc_env} 0x20; \ + env import -c ${ramdisk_addr_r} 0x4000;" + +setenv storebootstate " \ + echo 'storing env...'; \ + env export -c -s 0x4000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT; \ + mmc write ${ramdisk_addr_r} ${mmc_env} 0x20;" + +run loadbootstate test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 @@ -38,12 +52,12 @@ done setenv fdt_addr if test -n "${bootargs}"; then - saveenv + run storebootstate else echo "No valid slot found, resetting tries to 3" setenv BOOT_A_LEFT 3 setenv BOOT_B_LEFT 3 - saveenv + run storebootstate reset fi diff --git a/buildroot-external/board/raspberrypi/uboot.config b/buildroot-external/board/raspberrypi/uboot.config index 68813977d..b028a6259 100644 --- a/buildroot-external/board/raspberrypi/uboot.config +++ b/buildroot-external/board/raspberrypi/uboot.config @@ -1,3 +1,4 @@ # CONFIG_USB_STORAGE is not set # CONFIG_DOS_PARTITION is not set -CONFIG_ENV_IS_IN_MMC=y +CONFIG_CMD_FILEENV=y +CONFIG_ENV_IS_NOWHERE=Y From 976e9b0bcedded30ab29a132c95ce1c04f5f83bf Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sat, 27 Oct 2018 12:07:46 +0000 Subject: [PATCH 19/37] OVA: update kernel 4.14.78 --- Documentation/kernel.md | 2 +- buildroot-external/configs/ova_defconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/kernel.md b/Documentation/kernel.md index 6ec230aa6..3698f3ace 100644 --- a/Documentation/kernel.md +++ b/Documentation/kernel.md @@ -3,7 +3,7 @@ | Board | Version | |-------|---------| -| Open Virtual Applicance | 4.14.67 | +| Open Virtual Applicance | 4.14.78 | | Raspberry Pi | 4.14.66 | | Tinker Board | 4.14.67 | | Odroid-C2 | 4.14.67 | diff --git a/buildroot-external/configs/ova_defconfig b/buildroot-external/configs/ova_defconfig index 9f9854eee..dd52ee301 100644 --- a/buildroot-external/configs/ova_defconfig +++ b/buildroot-external/configs/ova_defconfig @@ -18,7 +18,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/ova $(BR2_EXTERNAL_HASSOS_PATH)/board/ova/hassos-hook.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.67" +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.78" BR2_LINUX_KERNEL_DEFCONFIG="x86_64" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/ova/kernel.config" BR2_LINUX_KERNEL_LZ4=y From a7fa7efbf957ce6dd6cb4c973cb074a2ff63f619 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sat, 27 Oct 2018 13:07:12 +0000 Subject: [PATCH 20/37] Raspberry: update kernel 4.14.78 --- Documentation/kernel.md | 2 +- buildroot-external/configs/rpi0_w_defconfig | 2 +- buildroot-external/configs/rpi2_defconfig | 2 +- buildroot-external/configs/rpi3_64_defconfig | 2 +- buildroot-external/configs/rpi3_defconfig | 2 +- buildroot-external/configs/rpi_defconfig | 2 +- .../0006-Pump-raspberry-pi-firmware-for-kernel-4.14.patch | 4 ++-- buildroot/package/rpi-firmware/rpi-firmware.hash | 2 +- buildroot/package/rpi-firmware/rpi-firmware.mk | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Documentation/kernel.md b/Documentation/kernel.md index 3698f3ace..b65b8cf3c 100644 --- a/Documentation/kernel.md +++ b/Documentation/kernel.md @@ -4,6 +4,6 @@ | Board | Version | |-------|---------| | Open Virtual Applicance | 4.14.78 | -| Raspberry Pi | 4.14.66 | +| Raspberry Pi | 4.14.78 | | Tinker Board | 4.14.67 | | Odroid-C2 | 4.14.67 | diff --git a/buildroot-external/configs/rpi0_w_defconfig b/buildroot-external/configs/rpi0_w_defconfig index 8d8e748ab..89111f44f 100644 --- a/buildroot-external/configs/rpi0_w_defconfig +++ b/buildroot-external/configs/rpi0_w_defconfig @@ -21,7 +21,7 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi0- BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6da082a790f857d5163ac99357beae6b59f1eb5" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="961aa2356a25ad04528e91761e7081a25dc983dc" BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y diff --git a/buildroot-external/configs/rpi2_defconfig b/buildroot-external/configs/rpi2_defconfig index 56a397b1c..a9e31b649 100644 --- a/buildroot-external/configs/rpi2_defconfig +++ b/buildroot-external/configs/rpi2_defconfig @@ -21,7 +21,7 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi2 BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6da082a790f857d5163ac99357beae6b59f1eb5" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="961aa2356a25ad04528e91761e7081a25dc983dc" BR2_LINUX_KERNEL_DEFCONFIG="bcm2709" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y diff --git a/buildroot-external/configs/rpi3_64_defconfig b/buildroot-external/configs/rpi3_64_defconfig index ddcf8f1a7..7ccc0f441 100644 --- a/buildroot-external/configs/rpi3_64_defconfig +++ b/buildroot-external/configs/rpi3_64_defconfig @@ -21,7 +21,7 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi3- BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6da082a790f857d5163ac99357beae6b59f1eb5" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="961aa2356a25ad04528e91761e7081a25dc983dc" BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi3" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y diff --git a/buildroot-external/configs/rpi3_defconfig b/buildroot-external/configs/rpi3_defconfig index 25f287bd5..26bba5c84 100644 --- a/buildroot-external/configs/rpi3_defconfig +++ b/buildroot-external/configs/rpi3_defconfig @@ -21,7 +21,7 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi3 BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6da082a790f857d5163ac99357beae6b59f1eb5" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="961aa2356a25ad04528e91761e7081a25dc983dc" BR2_LINUX_KERNEL_DEFCONFIG="bcm2709" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y diff --git a/buildroot-external/configs/rpi_defconfig b/buildroot-external/configs/rpi_defconfig index 7afdddd8d..22375e9e5 100644 --- a/buildroot-external/configs/rpi_defconfig +++ b/buildroot-external/configs/rpi_defconfig @@ -21,7 +21,7 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi $ BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6da082a790f857d5163ac99357beae6b59f1eb5" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="961aa2356a25ad04528e91761e7081a25dc983dc" BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y diff --git a/buildroot-patches/0006-Pump-raspberry-pi-firmware-for-kernel-4.14.patch b/buildroot-patches/0006-Pump-raspberry-pi-firmware-for-kernel-4.14.patch index e6f080a3c..6859f2305 100644 --- a/buildroot-patches/0006-Pump-raspberry-pi-firmware-for-kernel-4.14.patch +++ b/buildroot-patches/0006-Pump-raspberry-pi-firmware-for-kernel-4.14.patch @@ -16,7 +16,7 @@ index 4854deae03..3a9f21e877 100644 @@ -1,2 +1,2 @@ # Locally computed -sha256 ea451834e20136d249661e0ed7d1fdfa309249d233a387f44dd6c3b746a454c6 rpi-firmware-36f991382326907419f64917624427e59fd8e4a0.tar.gz -+sha256 a72ddbd1a4e96ca508fc14d0c31784ec119b68edcab2929c9779ae618db15388 rpi-firmware-200c2f4dd54b2048b5dcb8661ea3f232beb7d81e.tar.gz ++sha256 d9295b794e8a93a9bb8b5fe8cf612fea7f4a22f4a8abbbd3f56a20c96e63428a rpi-firmware-45c6ee3cd7f36a2376b691affbc02dfc689b8056.tar.gz diff --git a/package/rpi-firmware/rpi-firmware.mk b/package/rpi-firmware/rpi-firmware.mk index eab4c5d307..cb2e9d6cd8 100644 --- a/package/rpi-firmware/rpi-firmware.mk @@ -26,7 +26,7 @@ index eab4c5d307..cb2e9d6cd8 100644 ################################################################################ -RPI_FIRMWARE_VERSION = 36f991382326907419f64917624427e59fd8e4a0 -+RPI_FIRMWARE_VERSION = 200c2f4dd54b2048b5dcb8661ea3f232beb7d81e ++RPI_FIRMWARE_VERSION = 45c6ee3cd7f36a2376b691affbc02dfc689b8056 RPI_FIRMWARE_SITE = $(call github,raspberrypi,firmware,$(RPI_FIRMWARE_VERSION)) RPI_FIRMWARE_LICENSE = BSD-3-Clause RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom diff --git a/buildroot/package/rpi-firmware/rpi-firmware.hash b/buildroot/package/rpi-firmware/rpi-firmware.hash index 61ada8d95..b7d6194f2 100644 --- a/buildroot/package/rpi-firmware/rpi-firmware.hash +++ b/buildroot/package/rpi-firmware/rpi-firmware.hash @@ -1,2 +1,2 @@ # Locally computed -sha256 a72ddbd1a4e96ca508fc14d0c31784ec119b68edcab2929c9779ae618db15388 rpi-firmware-200c2f4dd54b2048b5dcb8661ea3f232beb7d81e.tar.gz +sha256 d9295b794e8a93a9bb8b5fe8cf612fea7f4a22f4a8abbbd3f56a20c96e63428a rpi-firmware-45c6ee3cd7f36a2376b691affbc02dfc689b8056.tar.gz diff --git a/buildroot/package/rpi-firmware/rpi-firmware.mk b/buildroot/package/rpi-firmware/rpi-firmware.mk index b1524e730..218799024 100644 --- a/buildroot/package/rpi-firmware/rpi-firmware.mk +++ b/buildroot/package/rpi-firmware/rpi-firmware.mk @@ -4,7 +4,7 @@ # ################################################################################ -RPI_FIRMWARE_VERSION = 200c2f4dd54b2048b5dcb8661ea3f232beb7d81e +RPI_FIRMWARE_VERSION = 45c6ee3cd7f36a2376b691affbc02dfc689b8056 RPI_FIRMWARE_SITE = $(call github,raspberrypi,firmware,$(RPI_FIRMWARE_VERSION)) RPI_FIRMWARE_LICENSE = BSD-3-Clause RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom From 5cdf66c2c821dd3281ee900c9568ed52367d8328 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Sat, 27 Oct 2018 23:04:59 +0100 Subject: [PATCH 21/37] Typo fix (#228) * typo fix stands instead of stays * typo fix 2 --- Documentation/boards/ova.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/boards/ova.md b/Documentation/boards/ova.md index 0a625dde7..2f737ff6c 100644 --- a/Documentation/boards/ova.md +++ b/Documentation/boards/ova.md @@ -1,7 +1,7 @@ # OVA -The OVA stay for open virtual appliance. Currently we had remove the ova files and publish a vmdk virtual disk, -until we have better OVF template to generate our OVA. This vmdk work with (maybe you need convert the disk): +OVA stands for Open Virtual Appliance. Currently we had remove the ova files and publish a vmdk virtual disk, +until we have better OVF template to generate our OVA. This VMDK work with (maybe you need convert the disk): - HyperV - VirtualBox - VMware From a2363d9a27a9363f227cf1ab9c68382d0fe20e65 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 29 Oct 2018 16:00:20 +0100 Subject: [PATCH 22/37] OS: bugfix acpid service file (#229) * OS: bugfix acpid service file * Update busybox-acpid.service --- .../rootfs-overlay/usr/lib/systemd/system/busybox-acpid.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/busybox-acpid.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/busybox-acpid.service index 77aa28f5e..4624c9249 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/busybox-acpid.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/busybox-acpid.service @@ -1,6 +1,7 @@ [Unit] Description=acpid (busybox) RefuseManualStop=true +After=sysinit.target ConditionPathIsDirectory=/proc/acpi [Service] @@ -8,5 +9,4 @@ Type=simple ExecStart=/sbin/acpid -d [Install] -After=local-fs.target WantedBy=multi-user.target From 809abbfde237e80d1d38735b056ee1212f3fbda4 Mon Sep 17 00:00:00 2001 From: Simon Holzmayer Date: Mon, 29 Oct 2018 16:01:29 +0100 Subject: [PATCH 23/37] Fixed keeping name of udev rules after usb import (#232) Closes #231 --- buildroot-external/rootfs-overlay/usr/sbin/hassos-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot-external/rootfs-overlay/usr/sbin/hassos-config b/buildroot-external/rootfs-overlay/usr/sbin/hassos-config index 998ba18ec..1c2a9f587 100755 --- a/buildroot-external/rootfs-overlay/usr/sbin/hassos-config +++ b/buildroot-external/rootfs-overlay/usr/sbin/hassos-config @@ -56,7 +56,7 @@ if [ -d "${CONFIG_DIR}/udev" ]; then echo "[Info] Update Udev configuration!" rm -rf /etc/udev/rules.d/* - cp -f ${CONFIG_DIR}/udev/* /etc/udev/rules.d/* + cp -f ${CONFIG_DIR}/udev/* /etc/udev/rules.d/ fi ## From caf708e14af9c32cefa427bdd04832fb5a6c8d58 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 29 Oct 2018 22:42:47 +0100 Subject: [PATCH 24/37] Raspberry: Bugfix not try to load Bluetooth (#235) --- .../package/bluetooth-bcm43xx/bluetooth-bcm43xx.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.service b/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.service index d902f97e5..0fc39375f 100644 --- a/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.service +++ b/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.service @@ -2,7 +2,7 @@ Description=Bluetooth for BCM43xx Before=bluetooth.service After=dev-ttyAMA0.device -ConditionPathIsDirectory=/proc/device-tree/soc/gpio@7e200000/bt_pins +ConditionFileNotEmpty=/proc/device-tree/soc/gpio@7e200000/bt_pins/brcm,pins [Service] Type=forking From 47bb76acec2a757a00c83af1eabd75e732683e6d Mon Sep 17 00:00:00 2001 From: thomasvs Date: Thu, 1 Nov 2018 08:45:41 -0400 Subject: [PATCH 25/37] Clarify the format of the address field to avoid people accidentally swapping IP address of hassio vs. gateway. (#237) --- Documentation/network.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/network.md b/Documentation/network.md index d77cb4abf..22d42e3ac 100644 --- a/Documentation/network.md +++ b/Documentation/network.md @@ -67,7 +67,7 @@ method=auto ### Static IP -Replace follow configuration: +Replace the following configuration: ```ini [ipv4] @@ -75,6 +75,7 @@ method=manual address=192.168.1.111/24,192.168.1.1 dns=8.8.8.8;8.8.4.4; ``` +For address, the value before the comma is the IP address and subnet prefix bitlength; the second value is the IP address of the gateway. ## Tips From 56992c6a77a55d0194f9cb70c302b369f6cbabf3 Mon Sep 17 00:00:00 2001 From: seanodell Date: Mon, 5 Nov 2018 11:45:24 -0800 Subject: [PATCH 26/37] Documentation: Add hidden=true comment for Wifi routers not broadcasting SSID (#241) --- Documentation/network.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/network.md b/Documentation/network.md index 22d42e3ac..e0ee527c2 100644 --- a/Documentation/network.md +++ b/Documentation/network.md @@ -51,6 +51,8 @@ type=802-11-wireless [802-11-wireless] mode=infrastructure ssid=MY_SSID +# Uncomment below if your SSID is not broadcasted +#hidden=true [802-11-wireless-security] auth-alg=open From cbd9b45adc6e268dbd2f030cc02a06f48cbe6ea7 Mon Sep 17 00:00:00 2001 From: Joeboyc2 Date: Wed, 14 Nov 2018 20:26:07 +0000 Subject: [PATCH 27/37] Updated the fine nmcli command (#243) --- Documentation/network.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/network.md b/Documentation/network.md index e0ee527c2..5bb5b73ba 100644 --- a/Documentation/network.md +++ b/Documentation/network.md @@ -132,7 +132,7 @@ In addition I have found it is wise to set the dns server and the local gateway. nmcli> set ipv4.dns 192.168.100.1 nmcli> set ipv4.gateway 192.168.100.1 nmcli> save -nmcli> exit +nmcli> quit ``` If you now view the default connection `cat /etc/NetworkManager/system-connections/default` you should see the method is manual and the address is set. From 404efdee5264134c85e9a74ab2fcfe5fcda10bab Mon Sep 17 00:00:00 2001 From: cogneato Date: Fri, 16 Nov 2018 08:34:13 -0700 Subject: [PATCH 28/37] clarity and grammar fixes (#248) --- Documentation/network.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/network.md b/Documentation/network.md index 5bb5b73ba..d180307a9 100644 --- a/Documentation/network.md +++ b/Documentation/network.md @@ -1,10 +1,10 @@ # Network -HassOS uses NetworkManager to control the host network. In future releases, you will be able to set up the configuration using the API/UI. Currently only a manual configuration using NetworkManager connection files is supported. Without a configuration file, the device will use DHCP by default. These network connection files can be placed on a USB drive as described in [Configuration][configuration-usb]. +HassOS uses NetworkManager to control the host network. In future releases, you will be able to set up the configuration using the API/UI. Currently only a manual configuration using NetworkManager connection files is supported. Without a configuration file, the device will use DHCP by default. These network connection files can be placed on a USB drive and imported to the host as described in [Configuration][configuration-usb]. ## Configuration Examples -You can also read the [Official Manual][keyfile] or there are a lot of examples accross internet. The system is read-only, if you don't want the IP address to change every boot, you should set the UUID property with a generic [UUID4][uuid]. Inside the `network` folder create the file `my-network` and add the appropriate contents below: +You can read the [Official Manual][keyfile] or find many configuration examples across the internet. The system is read-only, if you don't want the IP address to change on every boot, you should set the UUID property with a generic [UUID4][uuid]. Inside `\CONFIG\network\` on the USB or SD, create a file called `my-network` and add the appropriate contents below: ### Default @@ -83,7 +83,7 @@ For address, the value before the comma is the IP address and subnet prefix bitl ### Reset network -If you want reset the network configuration to default, use follow commands on the host: +If you want to reset the network configuration back to the default DHCP settings, use the following commands on the host: ```bash $ rm /etc/NetworkManager/system-connections/* From 2435ca9065a0ce80ac5091c8c24363cdbff048e0 Mon Sep 17 00:00:00 2001 From: Simon Holzmayer Date: Tue, 20 Nov 2018 15:57:58 +0100 Subject: [PATCH 29/37] provide a message when the OTA is skipped (#255) Closes #249 --- buildroot-external/scripts/ota.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildroot-external/scripts/ota.sh b/buildroot-external/scripts/ota.sh index c33aeb414..93fdba02a 100755 --- a/buildroot-external/scripts/ota.sh +++ b/buildroot-external/scripts/ota.sh @@ -10,8 +10,9 @@ function create_ota_update() { local key="/build/key.pem" local cert="/build/cert.pem" - # Skeep if no dev key is arround + # Skip if no dev key is arround if [ ! -f "${key}" ]; then + echo "Skip creating OTA update because of missing key ${key}" return 0 fi From dc35208efe5534146ec462bd0a0afc65fe1aca06 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 21 Nov 2018 00:28:40 +0100 Subject: [PATCH 30/37] OS: allow set NTP (#252) * OS: allow set NTP * Create etc-systemd-timesyncd.conf.mount * Update hassos-config * Update configuration.md * add link * Update Documentation/configuration.md Co-Authored-By: pvizeli --- Documentation/configuration.md | 2 ++ .../etc-systemd-timesyncd.conf.mount | 1 + .../rootfs-overlay/etc/tmpfiles.d/timesyncd.conf | 1 + .../system/etc-systemd-timesyncd.conf.mount | 14 ++++++++++++++ .../rootfs-overlay/usr/sbin/hassos-config | 9 +++++++++ 5 files changed, 27 insertions(+) create mode 120000 buildroot-external/rootfs-overlay/etc/systemd/system/hassos-bind.target.wants/etc-systemd-timesyncd.conf.mount create mode 100644 buildroot-external/rootfs-overlay/etc/tmpfiles.d/timesyncd.conf create mode 100644 buildroot-external/rootfs-overlay/usr/lib/systemd/system/etc-systemd-timesyncd.conf.mount diff --git a/Documentation/configuration.md b/Documentation/configuration.md index e12a71353..ffbab623b 100644 --- a/Documentation/configuration.md +++ b/Documentation/configuration.md @@ -10,6 +10,7 @@ network/ modules/ udev/ authorized_keys +timesyncd.conf hassos-xy.raucb ``` @@ -17,6 +18,7 @@ hassos-xy.raucb - The `modules` folder is for modules-load configuration files. - The `udev` folder is for udev rules files. - The `authorized_keys` file activates debug SSH access on port `22222`. See [Debugging Hassio][debug-hassio]. +- The `timesyncd.conf` file allow you to set different NTP servers. HassOS won't boot without correct working time servers! - The `hassos-*.raucb` file is a firmware OTA update which will be installed. These can be found on on the [release][hassos-release] page. You can put this USB stick into the device and it will be read on startup. You can also trigger this process later over the diff --git a/buildroot-external/rootfs-overlay/etc/systemd/system/hassos-bind.target.wants/etc-systemd-timesyncd.conf.mount b/buildroot-external/rootfs-overlay/etc/systemd/system/hassos-bind.target.wants/etc-systemd-timesyncd.conf.mount new file mode 120000 index 000000000..29053b7fc --- /dev/null +++ b/buildroot-external/rootfs-overlay/etc/systemd/system/hassos-bind.target.wants/etc-systemd-timesyncd.conf.mount @@ -0,0 +1 @@ +/usr/lib/systemd/system/etc-systemd-timesyncd.conf.mount \ No newline at end of file diff --git a/buildroot-external/rootfs-overlay/etc/tmpfiles.d/timesyncd.conf b/buildroot-external/rootfs-overlay/etc/tmpfiles.d/timesyncd.conf new file mode 100644 index 000000000..b4d8dc217 --- /dev/null +++ b/buildroot-external/rootfs-overlay/etc/tmpfiles.d/timesyncd.conf @@ -0,0 +1 @@ +C /mnt/overlay/etc/systemd/timesyncd.conf - - - - /etc/systemd/timesyncd.conf diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/etc-systemd-timesyncd.conf.mount b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/etc-systemd-timesyncd.conf.mount new file mode 100644 index 000000000..a26658c2a --- /dev/null +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/etc-systemd-timesyncd.conf.mount @@ -0,0 +1,14 @@ +[Unit] +Description=Timesyncd persistent configuration +Requires=mnt-overlay.mount +After=mnt-overlay.mount systemd-tmpfiles-setup.service +Before=systemd-timesyncd.service + +[Mount] +What=/mnt/overlay/etc/systemd/timesyncd.conf +Where=/etc/systemd/timesyncd.conf +Type=none +Options=bind + +[Install] +WantedBy=hassos-bind.target diff --git a/buildroot-external/rootfs-overlay/usr/sbin/hassos-config b/buildroot-external/rootfs-overlay/usr/sbin/hassos-config index 1c2a9f587..5338eb830 100755 --- a/buildroot-external/rootfs-overlay/usr/sbin/hassos-config +++ b/buildroot-external/rootfs-overlay/usr/sbin/hassos-config @@ -75,6 +75,15 @@ else systemctl stop dropbear > /dev/null 2>&1 fi +## +# timesyncd +if [ -f "${CONFIG_DIR}/timesyncd.conf" ]; then + echo "[Info] Update timesyncd config" + + cat "${CONFIG_DIR}/timesyncd.conf" > /etc/systemd/timesyncd.conf + systemctl restart systemd-timesyncd.service > /dev/null 2>&1 +fi + ## # Firmware update / Only USB UPTIME=$(awk '{printf "%0.f", $1}' /proc/uptime) From 19488834e4da38b1175b47cd356c368010383677 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 21 Nov 2018 10:13:28 +0000 Subject: [PATCH 31/37] Raspberry: update kernel 4.14.81 --- Documentation/kernel.md | 2 +- buildroot-external/configs/rpi0_w_defconfig | 2 +- buildroot-external/configs/rpi2_defconfig | 2 +- buildroot-external/configs/rpi3_64_defconfig | 2 +- buildroot-external/configs/rpi3_defconfig | 2 +- buildroot-external/configs/rpi_defconfig | 2 +- .../0006-Pump-raspberry-pi-firmware-for-kernel-4.14.patch | 4 ++-- buildroot/package/rpi-firmware/rpi-firmware.hash | 2 +- buildroot/package/rpi-firmware/rpi-firmware.mk | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Documentation/kernel.md b/Documentation/kernel.md index b65b8cf3c..426ec56ac 100644 --- a/Documentation/kernel.md +++ b/Documentation/kernel.md @@ -4,6 +4,6 @@ | Board | Version | |-------|---------| | Open Virtual Applicance | 4.14.78 | -| Raspberry Pi | 4.14.78 | +| Raspberry Pi | 4.14.81 | | Tinker Board | 4.14.67 | | Odroid-C2 | 4.14.67 | diff --git a/buildroot-external/configs/rpi0_w_defconfig b/buildroot-external/configs/rpi0_w_defconfig index 89111f44f..ddfd056c2 100644 --- a/buildroot-external/configs/rpi0_w_defconfig +++ b/buildroot-external/configs/rpi0_w_defconfig @@ -21,7 +21,7 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi0- BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="961aa2356a25ad04528e91761e7081a25dc983dc" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6878de4d2818c2256b2a340eaeeabfb0b24c71b" BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y diff --git a/buildroot-external/configs/rpi2_defconfig b/buildroot-external/configs/rpi2_defconfig index a9e31b649..a31e25fb8 100644 --- a/buildroot-external/configs/rpi2_defconfig +++ b/buildroot-external/configs/rpi2_defconfig @@ -21,7 +21,7 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi2 BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="961aa2356a25ad04528e91761e7081a25dc983dc" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6878de4d2818c2256b2a340eaeeabfb0b24c71b" BR2_LINUX_KERNEL_DEFCONFIG="bcm2709" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y diff --git a/buildroot-external/configs/rpi3_64_defconfig b/buildroot-external/configs/rpi3_64_defconfig index 7ccc0f441..574fcaca7 100644 --- a/buildroot-external/configs/rpi3_64_defconfig +++ b/buildroot-external/configs/rpi3_64_defconfig @@ -21,7 +21,7 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi3- BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="961aa2356a25ad04528e91761e7081a25dc983dc" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6878de4d2818c2256b2a340eaeeabfb0b24c71b" BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi3" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y diff --git a/buildroot-external/configs/rpi3_defconfig b/buildroot-external/configs/rpi3_defconfig index 26bba5c84..725222e03 100644 --- a/buildroot-external/configs/rpi3_defconfig +++ b/buildroot-external/configs/rpi3_defconfig @@ -21,7 +21,7 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi3 BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="961aa2356a25ad04528e91761e7081a25dc983dc" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6878de4d2818c2256b2a340eaeeabfb0b24c71b" BR2_LINUX_KERNEL_DEFCONFIG="bcm2709" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y diff --git a/buildroot-external/configs/rpi_defconfig b/buildroot-external/configs/rpi_defconfig index 22375e9e5..a243400d7 100644 --- a/buildroot-external/configs/rpi_defconfig +++ b/buildroot-external/configs/rpi_defconfig @@ -21,7 +21,7 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi $ BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="961aa2356a25ad04528e91761e7081a25dc983dc" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6878de4d2818c2256b2a340eaeeabfb0b24c71b" BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/kernel.config" BR2_LINUX_KERNEL_LZ4=y diff --git a/buildroot-patches/0006-Pump-raspberry-pi-firmware-for-kernel-4.14.patch b/buildroot-patches/0006-Pump-raspberry-pi-firmware-for-kernel-4.14.patch index 6859f2305..c1db729cc 100644 --- a/buildroot-patches/0006-Pump-raspberry-pi-firmware-for-kernel-4.14.patch +++ b/buildroot-patches/0006-Pump-raspberry-pi-firmware-for-kernel-4.14.patch @@ -16,7 +16,7 @@ index 4854deae03..3a9f21e877 100644 @@ -1,2 +1,2 @@ # Locally computed -sha256 ea451834e20136d249661e0ed7d1fdfa309249d233a387f44dd6c3b746a454c6 rpi-firmware-36f991382326907419f64917624427e59fd8e4a0.tar.gz -+sha256 d9295b794e8a93a9bb8b5fe8cf612fea7f4a22f4a8abbbd3f56a20c96e63428a rpi-firmware-45c6ee3cd7f36a2376b691affbc02dfc689b8056.tar.gz ++sha256 8939476badeb1d28adc60b46315f1511cd83c1942fbde5ef2e04c4f1b9591da6 rpi-firmware-91e955e3786a807f4af8ae7e4a4bbf9ec470b843.tar.gz diff --git a/package/rpi-firmware/rpi-firmware.mk b/package/rpi-firmware/rpi-firmware.mk index eab4c5d307..cb2e9d6cd8 100644 --- a/package/rpi-firmware/rpi-firmware.mk @@ -26,7 +26,7 @@ index eab4c5d307..cb2e9d6cd8 100644 ################################################################################ -RPI_FIRMWARE_VERSION = 36f991382326907419f64917624427e59fd8e4a0 -+RPI_FIRMWARE_VERSION = 45c6ee3cd7f36a2376b691affbc02dfc689b8056 ++RPI_FIRMWARE_VERSION = 91e955e3786a807f4af8ae7e4a4bbf9ec470b843 RPI_FIRMWARE_SITE = $(call github,raspberrypi,firmware,$(RPI_FIRMWARE_VERSION)) RPI_FIRMWARE_LICENSE = BSD-3-Clause RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom diff --git a/buildroot/package/rpi-firmware/rpi-firmware.hash b/buildroot/package/rpi-firmware/rpi-firmware.hash index b7d6194f2..12105c96d 100644 --- a/buildroot/package/rpi-firmware/rpi-firmware.hash +++ b/buildroot/package/rpi-firmware/rpi-firmware.hash @@ -1,2 +1,2 @@ # Locally computed -sha256 d9295b794e8a93a9bb8b5fe8cf612fea7f4a22f4a8abbbd3f56a20c96e63428a rpi-firmware-45c6ee3cd7f36a2376b691affbc02dfc689b8056.tar.gz +sha256 8939476badeb1d28adc60b46315f1511cd83c1942fbde5ef2e04c4f1b9591da6 rpi-firmware-91e955e3786a807f4af8ae7e4a4bbf9ec470b843.tar.gz diff --git a/buildroot/package/rpi-firmware/rpi-firmware.mk b/buildroot/package/rpi-firmware/rpi-firmware.mk index 218799024..5419bcab0 100644 --- a/buildroot/package/rpi-firmware/rpi-firmware.mk +++ b/buildroot/package/rpi-firmware/rpi-firmware.mk @@ -4,7 +4,7 @@ # ################################################################################ -RPI_FIRMWARE_VERSION = 45c6ee3cd7f36a2376b691affbc02dfc689b8056 +RPI_FIRMWARE_VERSION = 91e955e3786a807f4af8ae7e4a4bbf9ec470b843 RPI_FIRMWARE_SITE = $(call github,raspberrypi,firmware,$(RPI_FIRMWARE_VERSION)) RPI_FIRMWARE_LICENSE = BSD-3-Clause RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom From 43c423243a49679a7ee5be3c6067f231ab4c096c Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 21 Nov 2018 10:14:58 +0000 Subject: [PATCH 32/37] OVA: update kernel 4.14.82 --- Documentation/kernel.md | 2 +- buildroot-external/configs/ova_defconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/kernel.md b/Documentation/kernel.md index 426ec56ac..b68ff6776 100644 --- a/Documentation/kernel.md +++ b/Documentation/kernel.md @@ -3,7 +3,7 @@ | Board | Version | |-------|---------| -| Open Virtual Applicance | 4.14.78 | +| Open Virtual Applicance | 4.14.82 | | Raspberry Pi | 4.14.81 | | Tinker Board | 4.14.67 | | Odroid-C2 | 4.14.67 | diff --git a/buildroot-external/configs/ova_defconfig b/buildroot-external/configs/ova_defconfig index dd52ee301..af462a638 100644 --- a/buildroot-external/configs/ova_defconfig +++ b/buildroot-external/configs/ova_defconfig @@ -18,7 +18,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/ova $(BR2_EXTERNAL_HASSOS_PATH)/board/ova/hassos-hook.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.78" +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.82" BR2_LINUX_KERNEL_DEFCONFIG="x86_64" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/board/ova/kernel.config" BR2_LINUX_KERNEL_LZ4=y From 0ab78a97c7fc1e959cf90b21ff5eb1399dfc2b22 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 21 Nov 2018 14:57:01 +0000 Subject: [PATCH 33/37] Tinker: update kernel 4.14.82 --- Documentation/kernel.md | 2 +- buildroot-external/configs/tinker_defconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/kernel.md b/Documentation/kernel.md index b68ff6776..1ccfe2d69 100644 --- a/Documentation/kernel.md +++ b/Documentation/kernel.md @@ -5,5 +5,5 @@ |-------|---------| | Open Virtual Applicance | 4.14.82 | | Raspberry Pi | 4.14.81 | -| Tinker Board | 4.14.67 | +| Tinker Board | 4.14.82 | | Odroid-C2 | 4.14.67 | diff --git a/buildroot-external/configs/tinker_defconfig b/buildroot-external/configs/tinker_defconfig index ff921fa88..775c77c5d 100644 --- a/buildroot-external/configs/tinker_defconfig +++ b/buildroot-external/configs/tinker_defconfig @@ -20,7 +20,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/asus/tinker $(BR2_EXTERNAL_HASSOS_PATH)/board/asus/hassos-hook.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.67" +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.82" BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSOS_PATH)/board/asus/tinker/kernel.config" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_14.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/device-support.config" From 9e29a12f950ecf9b5705f1c9eed5b08a9ae69152 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 22 Nov 2018 12:24:13 +0000 Subject: [PATCH 34/37] Raspberry: fix wrong patch folder in config --- buildroot-external/configs/rpi2_defconfig | 2 +- buildroot-external/configs/rpi3_64_defconfig | 2 +- buildroot-external/configs/rpi3_defconfig | 2 +- buildroot-external/configs/rpi_defconfig | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/buildroot-external/configs/rpi2_defconfig b/buildroot-external/configs/rpi2_defconfig index a31e25fb8..3dfae0a89 100644 --- a/buildroot-external/configs/rpi2_defconfig +++ b/buildroot-external/configs/rpi2_defconfig @@ -4,7 +4,7 @@ BR2_ARM_FPU_VFPV4=y BR2_DL_DIR="/cache/dl" BR2_CCACHE=y BR2_CCACHE_DIR="/cache/cc" -BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/patches" +BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches" BR2_TOOLCHAIN_BUILDROOT_GLIBC=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_14=y BR2_GCC_VERSION_7_X=y diff --git a/buildroot-external/configs/rpi3_64_defconfig b/buildroot-external/configs/rpi3_64_defconfig index 574fcaca7..5c7840597 100644 --- a/buildroot-external/configs/rpi3_64_defconfig +++ b/buildroot-external/configs/rpi3_64_defconfig @@ -4,7 +4,7 @@ BR2_ARM_FPU_VFPV4=y BR2_DL_DIR="/cache/dl" BR2_CCACHE=y BR2_CCACHE_DIR="/cache/cc" -BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/patches" +BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches" BR2_TOOLCHAIN_BUILDROOT_GLIBC=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_14=y BR2_GCC_VERSION_7_X=y diff --git a/buildroot-external/configs/rpi3_defconfig b/buildroot-external/configs/rpi3_defconfig index 725222e03..323d63e18 100644 --- a/buildroot-external/configs/rpi3_defconfig +++ b/buildroot-external/configs/rpi3_defconfig @@ -4,7 +4,7 @@ BR2_ARM_FPU_VFPV4=y BR2_DL_DIR="/cache/dl" BR2_CCACHE=y BR2_CCACHE_DIR="/cache/cc" -BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/patches" +BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches" BR2_TOOLCHAIN_BUILDROOT_GLIBC=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_14=y BR2_GCC_VERSION_7_X=y diff --git a/buildroot-external/configs/rpi_defconfig b/buildroot-external/configs/rpi_defconfig index a243400d7..0bbffcbb7 100644 --- a/buildroot-external/configs/rpi_defconfig +++ b/buildroot-external/configs/rpi_defconfig @@ -4,7 +4,7 @@ BR2_ARM_EABIHF=y BR2_DL_DIR="/cache/dl" BR2_CCACHE=y BR2_CCACHE_DIR="/cache/cc" -BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/patches" +BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches" BR2_TOOLCHAIN_BUILDROOT_GLIBC=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_14=y BR2_GCC_VERSION_7_X=y From ad898040acb30cf52c1aa1e48314f33c4176db89 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 22 Nov 2018 14:48:09 +0100 Subject: [PATCH 35/37] Create release-drafter.yml --- .github/release-drafter.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 000000000..f90f4ad8e --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,4 @@ +template: | + ## What's Changed + + $CHANGES From 033e153d4950b92128521ecbb7b371ad534dbda0 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 22 Nov 2018 14:48:18 +0100 Subject: [PATCH 36/37] Delete move.yml --- .github/move.yml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .github/move.yml diff --git a/.github/move.yml b/.github/move.yml deleted file mode 100644 index e041083c9..000000000 --- a/.github/move.yml +++ /dev/null @@ -1,13 +0,0 @@ -# Configuration for move-issues - https://github.com/dessant/move-issues - -# Delete the command comment. Ignored when the comment also contains other content -deleteCommand: true -# Close the source issue after moving -closeSourceIssue: true -# Lock the source issue after moving -lockSourceIssue: false -# Set custom aliases for targets -# aliases: -# r: repo -# or: owner/repo - From 5351b542ff950c97290e32456415b73f48e96f5a Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 22 Nov 2018 14:44:54 +0000 Subject: [PATCH 37/37] Raspberry: fix wrong patch folder in config p2 --- buildroot-external/configs/rpi0_w_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot-external/configs/rpi0_w_defconfig b/buildroot-external/configs/rpi0_w_defconfig index ddfd056c2..620655885 100644 --- a/buildroot-external/configs/rpi0_w_defconfig +++ b/buildroot-external/configs/rpi0_w_defconfig @@ -4,7 +4,7 @@ BR2_ARM_EABIHF=y BR2_DL_DIR="/cache/dl" BR2_CCACHE=y BR2_CCACHE_DIR="/cache/cc" -BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/patches" +BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches" BR2_TOOLCHAIN_BUILDROOT_GLIBC=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_14=y BR2_GCC_VERSION_7_X=y