From f1cf0cd51fbd5aefd6a8c666e46c8a660b840dec Mon Sep 17 00:00:00 2001 From: Patrick Yavitz Date: Wed, 11 Oct 2023 10:42:26 -0400 Subject: [PATCH] v2: arch: arm64: dts: amlogic: meson-g12b-waveshare-cm4-io-base-b https://www.waveshare.com/wiki/CM4-IO-BASE-B Fan, RTC and USB support RTC requires rtc pcf85063 driver Fan requires hwmon emc2305 driver Signed-off-by: Patrick Yavitz --- .../add-board-waveshare-cm4-io-base-b.patch | 58 ++++++++++++++++--- .../dt/meson-g12b-waveshare-cm4-io-base-b.dts | 37 +++++++++++- .../dt/meson-g12b-waveshare-cm4-io-base-b.dts | 37 +++++++++++- 3 files changed, 121 insertions(+), 11 deletions(-) diff --git a/patch/kernel/archive/meson64-6.1/add-board-waveshare-cm4-io-base-b.patch b/patch/kernel/archive/meson64-6.1/add-board-waveshare-cm4-io-base-b.patch index ff8b3ac664..9f6519cb4e 100644 --- a/patch/kernel/archive/meson64-6.1/add-board-waveshare-cm4-io-base-b.patch +++ b/patch/kernel/archive/meson64-6.1/add-board-waveshare-cm4-io-base-b.patch @@ -1,22 +1,26 @@ -From ae66ecb93473ab39aff1d838bf9a24dcc2da9157 Mon Sep 17 00:00:00 2001 +From 220f0e430938ad10a7c54372a9b44b2baa6dabda Mon Sep 17 00:00:00 2001 From: Patrick Yavitz -Date: Thu, 21 Sep 2023 07:19:43 -0400 -Subject: [PATCH] arch: arm64: dts: amlogic: meson-g12b-waveshare-cm4-io-base-b +Date: Wed, 11 Oct 2023 09:04:11 -0400 +Subject: [PATCH] v2: arch: arm64: dts: amlogic: meson-g12b-waveshare-cm4-io-base-b https://www.waveshare.com/wiki/CM4-IO-BASE-B +Fan, RTC and USB support +RTC requires rtc pcf85063 driver +Fan requires hwmon emc2305 driver + Signed-off-by: Patrick Yavitz --- arch/arm64/boot/dts/amlogic/Makefile | 1 + - .../meson-g12b-waveshare-cm4-io-base-b.dts | 29 +++++++++++++++++++ - 2 files changed, 30 insertions(+) + .../meson-g12b-waveshare-cm4-io-base-b.dts | 65 +++++++++++++++++++ + 2 files changed, 66 insertions(+) create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12b-waveshare-cm4-io-base-b.dts diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index ba9d7292f4a3..8a90b7869878 100644 +index 1e83933a11ab..f9e43e0d0464 100644 --- a/arch/arm64/boot/dts/amlogic/Makefile +++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -20,6 +20,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-g12b-radxa-zero2.dtb +@@ -20,6 +20,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-g12b-odroid-n2l.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12b-s922x-bananapi-m2s.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12b-s922x-khadas-vim3.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12b-ugoos-am6.dtb @@ -26,10 +30,10 @@ index ba9d7292f4a3..8a90b7869878 100644 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-nexbox-a95x.dtb diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-waveshare-cm4-io-base-b.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-waveshare-cm4-io-base-b.dts new file mode 100644 -index 000000000000..3a65d7c9c1dc +index 000000000000..5739e480df82 --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-waveshare-cm4-io-base-b.dts -@@ -0,0 +1,29 @@ +@@ -0,0 +1,65 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2023 Patrick Yavitz @@ -54,6 +58,42 @@ index 000000000000..3a65d7c9c1dc + reg = <0x51>; + wakeup-source; + }; ++ ++ fanctrl: emc2305@2f { ++ reg = <0x2f>; ++ compatible = "smsc,emc2305"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ #cooling-cells = <0x02>; ++ }; ++}; ++ ++&cpu_thermal { ++ trips { ++ fanmid0: fanmid0 { ++ temperature = <60000>; ++ hysteresis = <2000>; ++ type = "active"; ++ }; ++ ++ fanmax0: fanmax0 { ++ temperature = <70000>; ++ hysteresis = <2000>; ++ type = "active"; ++ }; ++ }; ++ ++ cooling-maps { ++ map0 { ++ trip = <&fanmid0>; ++ cooling-device = <&fanctrl 2 6>; ++ }; ++ ++ map1 { ++ trip = <&fanmax0>; ++ cooling-device = <&fanctrl 7 THERMAL_NO_LIMIT>; ++ }; ++ }; +}; + +&usb { diff --git a/patch/kernel/archive/meson64-6.5/dt/meson-g12b-waveshare-cm4-io-base-b.dts b/patch/kernel/archive/meson64-6.5/dt/meson-g12b-waveshare-cm4-io-base-b.dts index 8a00a6185e..5739e480df 100644 --- a/patch/kernel/archive/meson64-6.5/dt/meson-g12b-waveshare-cm4-io-base-b.dts +++ b/patch/kernel/archive/meson64-6.5/dt/meson-g12b-waveshare-cm4-io-base-b.dts @@ -1,7 +1,6 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) /* * Copyright (c) 2023 Patrick Yavitz - * See https://www.waveshare.com/wiki/CM4-IO-BASE-B */ /dts-v1/; @@ -23,6 +22,42 @@ reg = <0x51>; wakeup-source; }; + + fanctrl: emc2305@2f { + reg = <0x2f>; + compatible = "smsc,emc2305"; + #address-cells = <1>; + #size-cells = <0>; + #cooling-cells = <0x02>; + }; +}; + +&cpu_thermal { + trips { + fanmid0: fanmid0 { + temperature = <60000>; + hysteresis = <2000>; + type = "active"; + }; + + fanmax0: fanmax0 { + temperature = <70000>; + hysteresis = <2000>; + type = "active"; + }; + }; + + cooling-maps { + map0 { + trip = <&fanmid0>; + cooling-device = <&fanctrl 2 6>; + }; + + map1 { + trip = <&fanmax0>; + cooling-device = <&fanctrl 7 THERMAL_NO_LIMIT>; + }; + }; }; &usb { diff --git a/patch/kernel/archive/meson64-6.6/dt/meson-g12b-waveshare-cm4-io-base-b.dts b/patch/kernel/archive/meson64-6.6/dt/meson-g12b-waveshare-cm4-io-base-b.dts index 8a00a6185e..5739e480df 100644 --- a/patch/kernel/archive/meson64-6.6/dt/meson-g12b-waveshare-cm4-io-base-b.dts +++ b/patch/kernel/archive/meson64-6.6/dt/meson-g12b-waveshare-cm4-io-base-b.dts @@ -1,7 +1,6 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) /* * Copyright (c) 2023 Patrick Yavitz - * See https://www.waveshare.com/wiki/CM4-IO-BASE-B */ /dts-v1/; @@ -23,6 +22,42 @@ reg = <0x51>; wakeup-source; }; + + fanctrl: emc2305@2f { + reg = <0x2f>; + compatible = "smsc,emc2305"; + #address-cells = <1>; + #size-cells = <0>; + #cooling-cells = <0x02>; + }; +}; + +&cpu_thermal { + trips { + fanmid0: fanmid0 { + temperature = <60000>; + hysteresis = <2000>; + type = "active"; + }; + + fanmax0: fanmax0 { + temperature = <70000>; + hysteresis = <2000>; + type = "active"; + }; + }; + + cooling-maps { + map0 { + trip = <&fanmid0>; + cooling-device = <&fanctrl 2 6>; + }; + + map1 { + trip = <&fanmax0>; + cooling-device = <&fanctrl 7 THERMAL_NO_LIMIT>; + }; + }; }; &usb {