[xt-q8l-v10] fixed act8846 regulator against kernel 5.4, enabled eMMC DDR mode (#1778)

* Added ALSA configuration bits for rk3288 HDMI and SPDIF to allow
pulseaudio show proper sound device/profile/mapping names instead of
just "Built-in Audio" for all of them

* Added ALSA device description in asound.conf to provide correct labels for PulseAudio for RK3288 devices when SPDIF and DW-I2S-HDMI simple audio cards are exposed
Removed unnecessary ALSA configuration files previously added from rockchip.conf

* Fixed cpu operating points tables and raised a bit (+5°C) cooling for non-critical temperatures for xt-q8l-v10 in dev and next kernel flavours

* Fixed again cpu opp table

* Removed whole cpu opp table and retouch only necessary operating points

* Enabled gpiomem driver for xt-q8l-v10 in next kernel flavour

* Added debounce delay and card detect gpio pins for sdmmc card holder for xt-q8l-v10 board

* Added card-detect and debounce delay for sdmmc for xt-q8l-v10 board in next kernel flavour too

* Fixed missing comment in xt-q8l-v10 device tree patch

* Added gpiomem to xt-q8l-v10 board for dev kernel

* Fixed FAN53555/Silergy patches to accomodate changes in u-boot v2019.04

* Changed property property flags for USB regulators in u-boot and kernel: kernel is now informed that bootloader is going to turn the USB power on

* Fixed indentation in rk3288-xt-q8l-v10.dts, raised debounce delay to sdmmc, added vbus-supply to USB host, removed some unneeded properties

* Added working DDR52 mode for eMMC on xt-q8l-v10

* Removed regulator-off-in-suspend for some xt-q8l-v10 regulators due to changed in act8865.c driver which causes the regulators to be misconfigured

* Adjusted targets for xt-q8l-v10 (provides bionic desktop + buster server)

* Removed all regular-state-mem nodes in xt-q8l-v10 device tree because the change in act8865.c affects also non-off entries

* Brought xt-q8l-v10 device tree from rockchip-current to rockchip-dev
This commit is contained in:
Paolo 2020-02-05 00:37:02 +01:00 committed by GitHub
parent a186fd4984
commit 008f3fd47c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 416 additions and 254 deletions

View file

@ -620,10 +620,8 @@ tritium-h5 current bionic cli stable yes
# xt-q8l-v10
xt-q8l-v10 legacy buster cli stable yes
xt-q8l-v10 legacy bionic desktop stable yes
xt-q8l-v10 current bionic minimal stable yes
xt-q8l-v10 current bullseye minimal stable yes
xt-q8l-v10 current bionic desktop stable yes
xt-q8l-v10 current buster minimal stable yes
# Z28 pro

View file

@ -1,6 +1,9 @@
diff --git a/arch/arm/boot/dts/rk3288-xt-q8l-v10.dts b/arch/arm/boot/dts/rk3288-xt-q8l-v10.dts
new file mode 100644
index 000000000..539e445b4
--- /dev/null
+++ b/arch/arm/boot/dts/rk3288-xt-q8l-v10.dts 2019-08-03 13:55:48.719992666 +0000
@@ -0,0 +1,982 @@
+++ b/arch/arm/boot/dts/rk3288-xt-q8l-v10.dts
@@ -0,0 +1,1061 @@
+/*
+ * Copyright (c) 2014, 2015 FUKAUMI Naoki <naobsd@gmail.com>
+ * 2018 Paolo Sabatino <paolo.sabatino@gm**l.com>
@ -53,7 +56,7 @@
+ model = "XT-Q8L-V10-RK3288";
+ compatible = "generic,xt-q8l-v10-rk3288", "rockchip,rk3288";
+
+ memory {
+ memory@0 {
+ reg = <0x0 0x0 0x0 0x80000000>;
+ device_type = "memory";
+ };
@ -162,7 +165,12 @@
+ regulator-name = "vcc_flash";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ /*gpios = <&gpio3 RK_PC3 GPIO_ACTIVE_LOW>;
+ states = <1800000 0>,
+ <3300000 1>;
+ */
+ vin-supply = <&vcc_io>;
+ startup-delay-us = <100000>;
+ };
+
+ vcc_host_5v: usb-host-regulator {
@ -171,8 +179,8 @@
+ regulator-name = "vcc_host_5v";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ enable-active-high;
+ regulator-boot-on;
+ enable-active-high;
+ vin-supply = <&vcc_sys>;
+ };
+
@ -200,6 +208,13 @@
+ post-power-on-delay-ms = <100>;
+ };
+
+ emmc_pwrseq: emmc-pwrseq {
+ compatible = "mmc-pwrseq-emmc";
+ pinctrl-0 = <&emmc_reset>;
+ pinctrl-names = "default";
+ reset-gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_LOW>;
+ };
+
+ /*
+ * Sound taken from tinkerboard device tree, adapted to q8.
+ */
@ -219,25 +234,25 @@
+ };
+
+ soundcard-spdif {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "SPDIF";
+ simple-audio-card,dai-link@1 {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "SPDIF";
+ simple-audio-card,dai-link@1 {
+
+ cpu {
+ cpu {
+ sound-dai = <&spdif>;
+ };
+
+ codec {
+ codec {
+ sound-dai = <&spdif_out>;
+ };
+
+ };
+ };
+ };
+ };
+
+ spdif_out: spdif-out {
+ compatible = "linux,spdif-dit";
+ #sound-dai-cells = <0>;
+ };
+ spdif_out: spdif-out {
+ compatible = "linux,spdif-dit";
+ #sound-dai-cells = <0>;
+ };
+
+};
+
@ -303,8 +318,8 @@
+ regulator-boot-on;
+ vin-supply = <&vcc_sys>;
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdd_gpu: syr828@41 {
@ -318,8 +333,8 @@
+ regulator-always-on;
+ vin-supply = <&vcc_sys>;
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ regulator-off-in-suspend;
+ };
+ };
+
+ hym8563: hym8563@51 {
@ -360,9 +375,12 @@
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -374,9 +392,12 @@
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -390,9 +411,12 @@
+ regulator-min-microvolt = <1100000>;
+ regulator-max-microvolt = <1100000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -405,9 +429,12 @@
+ regulator-min-microvolt = <2000000>;
+ regulator-max-microvolt = <2000000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -419,10 +446,13 @@
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ regulator-on-in-suspend;
+ regulator-suspend-microvolt = <3300000>;
+ };
+ };
+ */
+ };
+
+ /*
@ -434,9 +464,12 @@
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1000000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -449,9 +482,14 @@
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+
+ /*
+ The regulator can be set off in suspend, but kernel 5.4 modifications
+ to enable suspend for ACT8865 device break the ACT8846
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ regulator-off-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -463,9 +501,14 @@
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on; // Turn this on to get SPDIF!
+
+ /*
+ The regulator can be set off in suspend, but kernel 5.4 modifications
+ to enable suspend for ACT8865 device break the ACT8846
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ regulator-off-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -475,9 +518,13 @@
+ regulator-name = "vcc_lan";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -489,9 +536,13 @@
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1000000>;
+ regulator-always-on;
+
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -503,9 +554,13 @@
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -518,9 +573,14 @@
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+
+ /*
+ The regulator can be set off in suspend, but kernel 5.4 modifications
+ to enable suspend for ACT8865 device break the ACT8846
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ regulator-off-in-suspend;
+ };
+ */
+ };
+ };
+ };
@ -709,6 +769,14 @@
+ };
+ };
+
+ emmc {
+
+ emmc_reset: emmc-reset {
+ rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+
+ };
+
+};
+
+&saradc {
@ -719,22 +787,32 @@
+&emmc {
+
+ /*
+ * eMMC seems to be 52Mhz device on q8 devices, so set it here
+ * vmmc-supply and vqmmc-supply are removed because they hang
+ * u-boot >= v2018.03
+ * From the original q8l firmware and eMMC datasheet it also should
+ * support DDR highspeed mode, but using mmc-ddr-3_3v or mmc-ddr-1_8v
+ * properties are not working
+ * eMMC is a 52Mhz DDR device on q8 devices, so set it here.
+ * Setting default-sample-rate to 180 degrees is very important,
+ * otherwise the eMMC is not stable and may not be able to negotiate
+ * the right clock.
+ * Despite the code already seems to use 180 degree phase when
+ * MMC + 8bit bus is set, we need to set default phase here too.
+ *
+ * Huge hint came from this patch:
+ * https://patchwork.kernel.org/patch/11129183/
+ *
+ */
+ clock-frequency = <50000000>;
+
+ broken-cd;
+ bus-width = <8>;
+ cap-mmc-highspeed;
+
+ disable-wp;
+ non-removable;
+ pinctrl-names = "default";
+ pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_pwr>, <&emmc_bus8>;
+ pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>;
+
+ vmmc-supply = <&vcc_io>;
+ vqmmc-supply = <&vcc_flash>;
+
+ mmc-pwrseq = <&emmc_pwrseq>;
+ mmc-ddr-1_8v;
+ rockchip,default-sample-phase = <180>;
+
+ status = "okay";
+};
@ -746,9 +824,7 @@
+ cap-mmc-highspeed;
+ cap-sd-highspeed;
+ cd-gpios = <&gpio6 RK_PC6 GPIO_ACTIVE_LOW>;
+ cd-debounce-delay-ms = <200>;
+ post-power-on-delay-ms = <50>;
+ supports-cqe;
+ cd-debounce-delay-ms = <500>;
+ disable-wp;
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>;
@ -771,14 +847,14 @@
+ mmc-pwrseq = <&sdio0_pwrseq>;
+
+ vmmc-supply = <&vcc_io>;
+ vqmmc-supply = <&vcc_18>; // This must be the same as in io_domains,
+ vqmmc-supply = <&vcc_18>; // This must be the same as in io_domains,
+ // otherwise the mmc1 device won't be detected properly
+
+// clock-frequency = <50000000>;
+// max-frequency = <50000000>;
+ // clock-frequency = <50000000>;
+ // max-frequency = <50000000>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>;
+ pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>;
+
+ cap-sdio-irq;
+ no-mmc;
@ -879,25 +955,19 @@
+ status = "okay";
+};
+
+&usbphy0 {
+ vbus-supply = <&vcc_otg_5v>;
+};
+
+&usbphy2 {
+ vbus-supply = <&vcc_host_5v>;
+};
+
+&usb_host0_ehci {
+ dr_mode = "host";
+ reg = <0x0 0xff500000 0x0 0x20000>;
+ status = "disable";
+ dr_mode = "host";
+ reg = <0x0 0xff500000 0x0 0x20000>;
+ status = "disable";
+};
+
+&usb_host1 {
+ vbus-supply = <&vcc_host_5v>;
+ status = "okay";
+};
+
+&usb_otg {
+ vbus-supply = <&vcc_otg_5v>;
+ status = "okay";
+};
+
@ -924,18 +994,10 @@
+ status = "okay";
+};
+
+//&vpu_service {
+// status = "okay";
+//};
+
+&hevc_mmu {
+ status = "okay";
+};
+
+//&hevc_service {
+// status = "okay";
+//};
+
+&wdt {
+ status = "okay";
+};
@ -978,8 +1040,28 @@
+ opp-1608000000 {
+ opp-microvolt = <1300000>;
+ };
+
+ /*
+ Remove the overclocking/turbo frequencies
+ */
+ /delete-node/ opp@1704000000;
+ /delete-node/ opp@1800000000;
+ /delete-node/ opp@1896000000;
+ /delete-node/ opp@1920000000;
+ /delete-node/ opp@1992000000;
+ /delete-node/ opp@2016000000;
+ /delete-node/ opp@2040000000;
+ /delete-node/ opp@2064000000;
+ /delete-node/ opp@2088000000;
+ /delete-node/ opp@2112000000;
+ /delete-node/ opp@2136000000;
+ /delete-node/ opp@2160000000;
+ /delete-node/ opp@2184000000;
+ /delete-node/ opp@2208000000;
+
+
+};
+
+&gpiomem {
+ status = "okay";
+ status = "okay";
+};

View file

@ -1,6 +1,9 @@
diff --git a/arch/arm/boot/dts/rk3288-xt-q8l-v10.dts b/arch/arm/boot/dts/rk3288-xt-q8l-v10.dts
new file mode 100644
index 000000000..539e445b4
--- /dev/null
+++ b/arch/arm/boot/dts/rk3288-xt-q8l-v10.dts 2019-08-03 13:55:48.719992666 +0000
@@ -0,0 +1,982 @@
+++ b/arch/arm/boot/dts/rk3288-xt-q8l-v10.dts
@@ -0,0 +1,1061 @@
+/*
+ * Copyright (c) 2014, 2015 FUKAUMI Naoki <naobsd@gmail.com>
+ * 2018 Paolo Sabatino <paolo.sabatino@gm**l.com>
@ -53,7 +56,7 @@
+ model = "XT-Q8L-V10-RK3288";
+ compatible = "generic,xt-q8l-v10-rk3288", "rockchip,rk3288";
+
+ memory {
+ memory@0 {
+ reg = <0x0 0x0 0x0 0x80000000>;
+ device_type = "memory";
+ };
@ -162,7 +165,12 @@
+ regulator-name = "vcc_flash";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ /*gpios = <&gpio3 RK_PC3 GPIO_ACTIVE_LOW>;
+ states = <1800000 0>,
+ <3300000 1>;
+ */
+ vin-supply = <&vcc_io>;
+ startup-delay-us = <100000>;
+ };
+
+ vcc_host_5v: usb-host-regulator {
@ -171,8 +179,8 @@
+ regulator-name = "vcc_host_5v";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ enable-active-high;
+ regulator-boot-on;
+ enable-active-high;
+ vin-supply = <&vcc_sys>;
+ };
+
@ -200,6 +208,13 @@
+ post-power-on-delay-ms = <100>;
+ };
+
+ emmc_pwrseq: emmc-pwrseq {
+ compatible = "mmc-pwrseq-emmc";
+ pinctrl-0 = <&emmc_reset>;
+ pinctrl-names = "default";
+ reset-gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_LOW>;
+ };
+
+ /*
+ * Sound taken from tinkerboard device tree, adapted to q8.
+ */
@ -219,25 +234,25 @@
+ };
+
+ soundcard-spdif {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "SPDIF";
+ simple-audio-card,dai-link@1 {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "SPDIF";
+ simple-audio-card,dai-link@1 {
+
+ cpu {
+ cpu {
+ sound-dai = <&spdif>;
+ };
+
+ codec {
+ codec {
+ sound-dai = <&spdif_out>;
+ };
+
+ };
+ };
+ };
+ };
+
+ spdif_out: spdif-out {
+ compatible = "linux,spdif-dit";
+ #sound-dai-cells = <0>;
+ };
+ spdif_out: spdif-out {
+ compatible = "linux,spdif-dit";
+ #sound-dai-cells = <0>;
+ };
+
+};
+
@ -303,8 +318,8 @@
+ regulator-boot-on;
+ vin-supply = <&vcc_sys>;
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdd_gpu: syr828@41 {
@ -318,8 +333,8 @@
+ regulator-always-on;
+ vin-supply = <&vcc_sys>;
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ regulator-off-in-suspend;
+ };
+ };
+
+ hym8563: hym8563@51 {
@ -360,9 +375,12 @@
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -374,9 +392,12 @@
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -390,9 +411,12 @@
+ regulator-min-microvolt = <1100000>;
+ regulator-max-microvolt = <1100000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -405,9 +429,12 @@
+ regulator-min-microvolt = <2000000>;
+ regulator-max-microvolt = <2000000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -419,10 +446,13 @@
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ regulator-on-in-suspend;
+ regulator-suspend-microvolt = <3300000>;
+ };
+ };
+ */
+ };
+
+ /*
@ -434,9 +464,12 @@
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1000000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -449,9 +482,14 @@
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+
+ /*
+ The regulator can be set off in suspend, but kernel 5.4 modifications
+ to enable suspend for ACT8865 device break the ACT8846
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ regulator-off-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -463,9 +501,14 @@
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on; // Turn this on to get SPDIF!
+
+ /*
+ The regulator can be set off in suspend, but kernel 5.4 modifications
+ to enable suspend for ACT8865 device break the ACT8846
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ regulator-off-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -475,9 +518,13 @@
+ regulator-name = "vcc_lan";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -489,9 +536,13 @@
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1000000>;
+ regulator-always-on;
+
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -503,9 +554,13 @@
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ regulator-on-in-suspend;
+ };
+ */
+ };
+
+ /*
@ -518,9 +573,14 @@
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+
+ /*
+ The regulator can be set off in suspend, but kernel 5.4 modifications
+ to enable suspend for ACT8865 device break the ACT8846
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ regulator-off-in-suspend;
+ };
+ */
+ };
+ };
+ };
@ -709,6 +769,14 @@
+ };
+ };
+
+ emmc {
+
+ emmc_reset: emmc-reset {
+ rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+
+ };
+
+};
+
+&saradc {
@ -719,22 +787,32 @@
+&emmc {
+
+ /*
+ * eMMC seems to be 52Mhz device on q8 devices, so set it here
+ * vmmc-supply and vqmmc-supply are removed because they hang
+ * u-boot >= v2018.03
+ * From the original q8l firmware and eMMC datasheet it also should
+ * support DDR highspeed mode, but using mmc-ddr-3_3v or mmc-ddr-1_8v
+ * properties are not working
+ * eMMC is a 52Mhz DDR device on q8 devices, so set it here.
+ * Setting default-sample-rate to 180 degrees is very important,
+ * otherwise the eMMC is not stable and may not be able to negotiate
+ * the right clock.
+ * Despite the code already seems to use 180 degree phase when
+ * MMC + 8bit bus is set, we need to set default phase here too.
+ *
+ * Huge hint came from this patch:
+ * https://patchwork.kernel.org/patch/11129183/
+ *
+ */
+ clock-frequency = <50000000>;
+
+ broken-cd;
+ bus-width = <8>;
+ cap-mmc-highspeed;
+
+ disable-wp;
+ non-removable;
+ pinctrl-names = "default";
+ pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_pwr>, <&emmc_bus8>;
+ pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>;
+
+ vmmc-supply = <&vcc_io>;
+ vqmmc-supply = <&vcc_flash>;
+
+ mmc-pwrseq = <&emmc_pwrseq>;
+ mmc-ddr-1_8v;
+ rockchip,default-sample-phase = <180>;
+
+ status = "okay";
+};
@ -746,9 +824,7 @@
+ cap-mmc-highspeed;
+ cap-sd-highspeed;
+ cd-gpios = <&gpio6 RK_PC6 GPIO_ACTIVE_LOW>;
+ cd-debounce-delay-ms = <200>;
+ post-power-on-delay-ms = <50>;
+ supports-cqe;
+ cd-debounce-delay-ms = <500>;
+ disable-wp;
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>;
@ -771,14 +847,14 @@
+ mmc-pwrseq = <&sdio0_pwrseq>;
+
+ vmmc-supply = <&vcc_io>;
+ vqmmc-supply = <&vcc_18>; // This must be the same as in io_domains,
+ vqmmc-supply = <&vcc_18>; // This must be the same as in io_domains,
+ // otherwise the mmc1 device won't be detected properly
+
+// clock-frequency = <50000000>;
+// max-frequency = <50000000>;
+ // clock-frequency = <50000000>;
+ // max-frequency = <50000000>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>;
+ pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>;
+
+ cap-sdio-irq;
+ no-mmc;
@ -879,25 +955,19 @@
+ status = "okay";
+};
+
+&usbphy0 {
+ vbus-supply = <&vcc_otg_5v>;
+};
+
+&usbphy2 {
+ vbus-supply = <&vcc_host_5v>;
+};
+
+&usb_host0_ehci {
+ dr_mode = "host";
+ reg = <0x0 0xff500000 0x0 0x20000>;
+ status = "disable";
+ dr_mode = "host";
+ reg = <0x0 0xff500000 0x0 0x20000>;
+ status = "disable";
+};
+
+&usb_host1 {
+ vbus-supply = <&vcc_host_5v>;
+ status = "okay";
+};
+
+&usb_otg {
+ vbus-supply = <&vcc_otg_5v>;
+ status = "okay";
+};
+
@ -924,18 +994,10 @@
+ status = "okay";
+};
+
+//&vpu_service {
+// status = "okay";
+//};
+
+&hevc_mmu {
+ status = "okay";
+};
+
+//&hevc_service {
+// status = "okay";
+//};
+
+&wdt {
+ status = "okay";
+};
@ -978,8 +1040,28 @@
+ opp-1608000000 {
+ opp-microvolt = <1300000>;
+ };
+
+ /*
+ Remove the overclocking/turbo frequencies
+ */
+ /delete-node/ opp@1704000000;
+ /delete-node/ opp@1800000000;
+ /delete-node/ opp@1896000000;
+ /delete-node/ opp@1920000000;
+ /delete-node/ opp@1992000000;
+ /delete-node/ opp@2016000000;
+ /delete-node/ opp@2040000000;
+ /delete-node/ opp@2064000000;
+ /delete-node/ opp@2088000000;
+ /delete-node/ opp@2112000000;
+ /delete-node/ opp@2136000000;
+ /delete-node/ opp@2160000000;
+ /delete-node/ opp@2184000000;
+ /delete-node/ opp@2208000000;
+
+
+};
+
+&gpiomem {
+ status = "okay";
+ status = "okay";
+};