Skip to content

Commit

Permalink
Merge branch 'jethome_5.7' into jethome_5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
adeepn authored Jan 12, 2021
2 parents 85d8ef9 + da83543 commit 546d53e
Show file tree
Hide file tree
Showing 10 changed files with 176 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
4 changes: 4 additions & 0 deletions Documentation/boards/hardkernel/odroid-n2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)"
Expand Down
6 changes: 6 additions & 0 deletions buildroot-external/board/hardkernel/odroid-n2/kernel.config
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
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 <[email protected]>
---
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 = <KEY_POWER>;
+ gpios = <&gpio GPIOX_3 GPIO_ACTIVE_LOW>;
+ };
+ };
+
leds {
compatible = "gpio-leds";

--
2.30.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From beb4dcdf3cd73f243563228528bc62e3caa881e8 Mon Sep 17 00:00:00 2001
Message-Id: <beb4dcdf3cd73f243563228528bc62e3caa881e8.1610380198.git.stefan@agner.ch>
In-Reply-To: <9d2a2b44e67b0ef49e534c097e8b5e3e1173b033.1610380198.git.stefan@agner.ch>
References: <9d2a2b44e67b0ef49e534c097e8b5e3e1173b033.1610380198.git.stefan@agner.ch>
From: Stefan Agner <[email protected]>
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 <[email protected]>
---
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

Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
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 <[email protected]>
---
.../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

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions buildroot-external/configs/intel_nuc_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 546d53e

Please sign in to comment.