diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 482475dcf8f..0df359d51b3 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -74,7 +74,7 @@ jobs: docker run --rm --privileged -v "${GITHUB_WORKSPACE}:/build" \ -e BUILDER_UID="${BUILDER_UID}" -e BUILDER_GID="${BUILDER_GID}" \ -v "${{ matrix.board.runner }}-build-cache:/cache" \ - haos-builder make VERSION_DEV=${{ needs.version.outputs.version_dev }} ${{ matrix.board.name }} + haos-builder make BUILDDIR=/build VERSION_DEV=${{ needs.version.outputs.version_dev }} ${{ matrix.board.name }} - name: Upload images uses: appleboy/scp-action@master diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d769b49294a..7375f9ed037 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,7 +69,7 @@ jobs: docker run --rm --privileged -v "${GITHUB_WORKSPACE}:/build" \ -e BUILDER_UID="${BUILDER_UID}" -e BUILDER_GID="${BUILDER_GID}" \ -v "${{ matrix.board.runner }}-build-cache:/cache" \ - haos-builder make VERSION_DEV="" ${{ matrix.board.name }} + haos-builder make BUILDDIR=/build VERSION_DEV="" ${{ matrix.board.name }} - name: Upload disk image if: ${{ matrix.board.name != 'ova' }} diff --git a/Documentation/boards/hardkernel/odroid-n2.md b/Documentation/boards/hardkernel/odroid-n2.md index 16316d8a053..bdb6551a10e 100644 --- a/Documentation/boards/hardkernel/odroid-n2.md +++ b/Documentation/boards/hardkernel/odroid-n2.md @@ -12,3 +12,7 @@ eg. `console=ttyAML0,115200n8 console=tty0` ## GPIO Refer to [the odroid wiki](https://wiki.odroid.com/odroid-n2/hardware/expansion_connectors). +At this point not all functionality is supported by the upstream kernel used +by Home Assistant OS. + +The GPIO on pin 11 is used as a low active power button input. diff --git a/Makefile b/Makefile index 94256c9abc9..d2404658c91 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ -RELEASE_DIR = /build/release +BUILDDIR:=$(shell pwd) +RELEASE_DIR = $(BUILDDIR)/release -BUILDROOT=/build/buildroot -BUILDROOT_EXTERNAL=/build/buildroot-external +BUILDROOT=$(BUILDDIR)/buildroot +BUILDROOT_EXTERNAL=$(BUILDDIR)/buildroot-external DEFCONFIG_DIR = $(BUILDROOT_EXTERNAL)/configs VERSION_DATE := $(shell date --utc +'%Y%m%d') VERSION_DEV := "dev$(VERSION_DATE)" diff --git a/buildroot-external/board/hardkernel/odroid-n2/kernel.config b/buildroot-external/board/hardkernel/odroid-n2/kernel.config index f99021fe213..718ca6df963 100644 --- a/buildroot-external/board/hardkernel/odroid-n2/kernel.config +++ b/buildroot-external/board/hardkernel/odroid-n2/kernel.config @@ -1 +1,7 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y + +CONFIG_THERMAL_GOV_BANG_BANG=y +CONFIG_SENSORS_GPIO_FAN=y + +CONFIG_KEYBOARD_GPIO=y +CONFIG_KEYBOARD_GPIO_POLLED=y diff --git a/buildroot-external/board/hardkernel/patches/linux/0008-arm64-dts-meson-g12b-add-power-button-support.patch b/buildroot-external/board/hardkernel/patches/linux/0008-arm64-dts-meson-g12b-add-power-button-support.patch new file mode 100644 index 00000000000..dfefe71696b --- /dev/null +++ b/buildroot-external/board/hardkernel/patches/linux/0008-arm64-dts-meson-g12b-add-power-button-support.patch @@ -0,0 +1,42 @@ +From 83ec133319bc8b04fad2bec65ffe95246c600520 Mon Sep 17 00:00:00 2001 +Message-Id: <83ec133319bc8b04fad2bec65ffe95246c600520.1610380198.git.stefan@agner.ch> +In-Reply-To: <9d2a2b44e67b0ef49e534c097e8b5e3e1173b033.1610380198.git.stefan@agner.ch> +References: <9d2a2b44e67b0ef49e534c097e8b5e3e1173b033.1610380198.git.stefan@agner.ch> +From: Stefan Agner +Date: Mon, 11 Jan 2021 11:20:48 +0100 +Subject: [PATCH 08/10] arm64: dts: meson: g12b: add power button support + +Add power button support on J2 pin 11 (GPIOX_3 on the SoC side). The +GPIO is low active, e.g. when connecting with pin 9 (GND) a power +button press is triggered. + +Signed-off-by: Stefan Agner +--- + arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +index 445d90d25aa3..ddc7ad9a7d8d 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +@@ -39,6 +39,17 @@ emmc_pwrseq: emmc-pwrseq { + reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; + }; + ++ gpio-keys-polled { ++ compatible = "gpio-keys-polled"; ++ poll-interval = <100>; ++ ++ power-button { ++ label = "power"; ++ linux,code = ; ++ gpios = <&gpio GPIOX_3 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ + leds { + compatible = "gpio-leds"; + +-- +2.30.0 + diff --git a/buildroot-external/board/hardkernel/patches/linux/0009-arm64-dts-meson-g12b-add-GPIO-fan-support.patch b/buildroot-external/board/hardkernel/patches/linux/0009-arm64-dts-meson-g12b-add-GPIO-fan-support.patch new file mode 100644 index 00000000000..66d4ba0a995 --- /dev/null +++ b/buildroot-external/board/hardkernel/patches/linux/0009-arm64-dts-meson-g12b-add-GPIO-fan-support.patch @@ -0,0 +1,42 @@ +From beb4dcdf3cd73f243563228528bc62e3caa881e8 Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <9d2a2b44e67b0ef49e534c097e8b5e3e1173b033.1610380198.git.stefan@agner.ch> +References: <9d2a2b44e67b0ef49e534c097e8b5e3e1173b033.1610380198.git.stefan@agner.ch> +From: Stefan Agner +Date: Mon, 11 Jan 2021 11:38:54 +0100 +Subject: [PATCH 09/10] arm64: dts: meson: g12b: add GPIO fan support + +Add simple GPIO fan node to support a fan on GPIO J8. Unfortunately the +pad used to control the fan does not support real PWM, hence the RPM +cannot be modulated. + +Signed-off-by: Stefan Agner +--- + arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +index ddc7ad9a7d8d..4d96732d0613 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +@@ -39,6 +39,17 @@ emmc_pwrseq: emmc-pwrseq { + reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; + }; + ++ /* ++ * 5V 80x80x10.8mm cooling fan from Hardkernel shop. ++ */ ++ fan0: gpio-fan { ++ #cooling-cells = <2>; ++ compatible = "gpio-fan"; ++ gpio-fan,speed-map = <0 0 1600 1>; ++ gpios = <&gpio_ao GPIOAO_10 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++ }; ++ + gpio-keys-polled { + compatible = "gpio-keys-polled"; + poll-interval = <100>; +-- +2.30.0 + diff --git a/buildroot-external/board/hardkernel/patches/linux/0010-arm64-dts-meson-g12b-odroid-n2-add-fan-as-cooling-de.patch b/buildroot-external/board/hardkernel/patches/linux/0010-arm64-dts-meson-g12b-odroid-n2-add-fan-as-cooling-de.patch new file mode 100644 index 00000000000..d7e9e5bb5c5 --- /dev/null +++ b/buildroot-external/board/hardkernel/patches/linux/0010-arm64-dts-meson-g12b-odroid-n2-add-fan-as-cooling-de.patch @@ -0,0 +1,74 @@ +From 8ff3ba007f500ec4f21361fcac4ec7a5b67bcf7e Mon Sep 17 00:00:00 2001 +Message-Id: <8ff3ba007f500ec4f21361fcac4ec7a5b67bcf7e.1610382778.git.stefan@agner.ch> +In-Reply-To: <9d2a2b44e67b0ef49e534c097e8b5e3e1173b033.1610382778.git.stefan@agner.ch> +References: <9d2a2b44e67b0ef49e534c097e8b5e3e1173b033.1610382778.git.stefan@agner.ch> +From: Stefan Agner +Date: Mon, 11 Jan 2021 15:53:55 +0100 +Subject: [PATCH 10/10] arm64: dts: meson: g12b: odroid-n2: add fan as cooling + device +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add the GPIO fan as a cooling device for the CPU thermal zone. Since we +have only full fan speed available with this, set the tripping point to +65°C which is the highest tripping point which Hardkernel used in their +downstream kernel. + +Signed-off-by: Stefan Agner +--- + .../dts/amlogic/meson-g12b-odroid-n2.dtsi | 38 +++++++++++++++++++ + 1 file changed, 38 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +index 4d96732d0613..30d79175fa3e 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +@@ -388,6 +388,44 @@ &clkc_audio { + status = "okay"; + }; + ++&cpu_thermal { ++ trips { ++ cpu_warm: cpu_warm { ++ hysteresis = <5000>; ++ temperature = <65000>; ++ type = "active"; ++ }; ++ }; ++ ++ cooling-maps { ++ map0 { ++ cooling-device = ++ <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; ++ trip = <&cpu_warm>; ++ }; ++ map1 { ++ trip = <&cpu_passive>; ++ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, ++ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, ++ <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, ++ <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, ++ <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, ++ <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, ++ <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; ++ }; ++ map2 { ++ trip = <&cpu_hot>; ++ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, ++ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, ++ <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, ++ <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, ++ <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, ++ <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, ++ <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; ++ }; ++ }; ++}; ++ + &cpu0 { + cpu-supply = <&vddcpu_b>; + operating-points-v2 = <&cpu_opp_table_0>; +-- +2.30.0 + diff --git a/buildroot-external/board/jethome/jethub-d1/rootfs-overlay/usr/lib/jethome/init_j100 b/buildroot-external/board/jethome/jethub-d1/rootfs-overlay/usr/lib/jethome/init_j100 index 1e2de2e1d99..80effd41ddb 100755 --- a/buildroot-external/board/jethome/jethub-d1/rootfs-overlay/usr/lib/jethome/init_j100 +++ b/buildroot-external/board/jethome/jethub-d1/rootfs-overlay/usr/lib/jethome/init_j100 @@ -48,6 +48,7 @@ configure_gpio "453" "${GPIO_DIRECTION_OUTPUT}" "${GPIO_ACTIVE_LOW}" # Button configure_gpio "436" "${GPIO_DIRECTION_INPUT}" "${GPIO_ACTIVE_LOW}" + echo "${0}: Turn off LEDs ..." echo 0 > /sys/class/gpio/gpio452/value echo 0 > /sys/class/gpio/gpio453/value diff --git a/buildroot-external/configs/intel_nuc_defconfig b/buildroot-external/configs/intel_nuc_defconfig index ac46e7da753..8667990dfec 100644 --- a/buildroot-external/configs/intel_nuc_defconfig +++ b/buildroot-external/configs/intel_nuc_defconfig @@ -47,6 +47,7 @@ BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_8000=y BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_8265=y BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_9XXX=y BR2_PACKAGE_LINUX_FIRMWARE_I915=y +BR2_PACKAGE_LINUX_FIRMWARE_RTL_8169=y BR2_PACKAGE_LINUX_FIRMWARE_USB_SERIAL_TI=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DT_UTILS=y