diff --git a/patch/kernel/rockchip-current/xt-q8l-v10-add-device-tree.patch b/patch/kernel/rockchip-current/xt-q8l-v10-add-device-tree.patch index 7a63ee3259..31f1b786bf 100644 --- a/patch/kernel/rockchip-current/xt-q8l-v10-add-device-tree.patch +++ b/patch/kernel/rockchip-current/xt-q8l-v10-add-device-tree.patch @@ -1,9 +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..784528f6d +index 000000000..90d0594af --- /dev/null +++ b/arch/arm/boot/dts/rk3288-xt-q8l-v10.dts -@@ -0,0 +1,1075 @@ +@@ -0,0 +1,1077 @@ +/* + * Copyright (c) 2014, 2015 FUKAUMI Naoki + * 2018 Paolo Sabatino @@ -208,12 +208,15 @@ index 000000000..784528f6d + post-power-on-delay-ms = <100>; + }; + ++ /* ++ * Not really needed, and also break some eMMC configuraions + 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. @@ -289,22 +292,22 @@ index 000000000..784528f6d + snps,reset-gpio = <&gpio4 8 GPIO_ACTIVE_LOW>; + tx_delay = <0x30>; + rx_delay = <0x10>; -+ status = "okay"; ++ status = "ok"; +}; + +&hdmi { + ddc-i2c-bus = <&i2c5>; -+ status = "okay"; ++ status = "ok"; +}; + +&gpu { + mali-supply = <&vdd_gpu>; -+ status = "okay"; ++ status = "ok"; +}; + +&i2c0 { + clock-frequency = <400000>; -+ status = "okay"; ++ status = "ok"; + + vdd_cpu: syr827@40 { + compatible = "silergy,syr827"; @@ -587,11 +590,11 @@ index 000000000..784528f6d +}; + +&i2c1 { -+ status = "okay"; ++ status = "disabled"; +}; + +&i2c2 { -+ status = "okay"; ++ status = "disabled"; +}; + +&i2c4 { @@ -604,7 +607,7 @@ index 000000000..784528f6d + * Datasheet is available here: + * http://dl.radxa.com/rock/docs/hw/ds/RK1000-S%20DATASHEET%20V14.pdf + */ -+ status = "okay"; ++ status = "disabled"; + +}; + @@ -810,7 +813,6 @@ index 000000000..784528f6d + vmmc-supply = <&vcc_io>; + vqmmc-supply = <&vcc_flash>; + -+ mmc-pwrseq = <&emmc_pwrseq>; + mmc-ddr-1_8v; + rockchip,default-sample-phase = <180>; + @@ -890,6 +892,7 @@ index 000000000..784528f6d +}; + +&tsadc { ++ rockchip,grf = <&grf>; + rockchip,hw-tshut-mode = <0>; + rockchip,hw-tshut-polarity = <0>; + status = "okay"; @@ -956,7 +959,6 @@ index 000000000..784528f6d +}; + +&usb_host0_ehci { -+ dr_mode = "host"; + reg = <0x0 0xff500000 0x0 0x20000>; + status = "disable"; +}; @@ -1074,7 +1076,7 @@ index 000000000..784528f6d + }; + +}; -+ ++ + +&gpiomem { + status = "okay"; diff --git a/patch/kernel/rockchip-dev/xt-q8l-v10-add-device-tree.patch b/patch/kernel/rockchip-dev/xt-q8l-v10-add-device-tree.patch index 7a63ee3259..31f1b786bf 100644 --- a/patch/kernel/rockchip-dev/xt-q8l-v10-add-device-tree.patch +++ b/patch/kernel/rockchip-dev/xt-q8l-v10-add-device-tree.patch @@ -1,9 +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..784528f6d +index 000000000..90d0594af --- /dev/null +++ b/arch/arm/boot/dts/rk3288-xt-q8l-v10.dts -@@ -0,0 +1,1075 @@ +@@ -0,0 +1,1077 @@ +/* + * Copyright (c) 2014, 2015 FUKAUMI Naoki + * 2018 Paolo Sabatino @@ -208,12 +208,15 @@ index 000000000..784528f6d + post-power-on-delay-ms = <100>; + }; + ++ /* ++ * Not really needed, and also break some eMMC configuraions + 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. @@ -289,22 +292,22 @@ index 000000000..784528f6d + snps,reset-gpio = <&gpio4 8 GPIO_ACTIVE_LOW>; + tx_delay = <0x30>; + rx_delay = <0x10>; -+ status = "okay"; ++ status = "ok"; +}; + +&hdmi { + ddc-i2c-bus = <&i2c5>; -+ status = "okay"; ++ status = "ok"; +}; + +&gpu { + mali-supply = <&vdd_gpu>; -+ status = "okay"; ++ status = "ok"; +}; + +&i2c0 { + clock-frequency = <400000>; -+ status = "okay"; ++ status = "ok"; + + vdd_cpu: syr827@40 { + compatible = "silergy,syr827"; @@ -587,11 +590,11 @@ index 000000000..784528f6d +}; + +&i2c1 { -+ status = "okay"; ++ status = "disabled"; +}; + +&i2c2 { -+ status = "okay"; ++ status = "disabled"; +}; + +&i2c4 { @@ -604,7 +607,7 @@ index 000000000..784528f6d + * Datasheet is available here: + * http://dl.radxa.com/rock/docs/hw/ds/RK1000-S%20DATASHEET%20V14.pdf + */ -+ status = "okay"; ++ status = "disabled"; + +}; + @@ -810,7 +813,6 @@ index 000000000..784528f6d + vmmc-supply = <&vcc_io>; + vqmmc-supply = <&vcc_flash>; + -+ mmc-pwrseq = <&emmc_pwrseq>; + mmc-ddr-1_8v; + rockchip,default-sample-phase = <180>; + @@ -890,6 +892,7 @@ index 000000000..784528f6d +}; + +&tsadc { ++ rockchip,grf = <&grf>; + rockchip,hw-tshut-mode = <0>; + rockchip,hw-tshut-polarity = <0>; + status = "okay"; @@ -956,7 +959,6 @@ index 000000000..784528f6d +}; + +&usb_host0_ehci { -+ dr_mode = "host"; + reg = <0x0 0xff500000 0x0 0x20000>; + status = "disable"; +}; @@ -1074,7 +1076,7 @@ index 000000000..784528f6d + }; + +}; -+ ++ + +&gpiomem { + status = "okay"; diff --git a/patch/kernel/rockchip-legacy/patch-4.4.199-200.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.199-200.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.199-200.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.199-200.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.200-201.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.200-201.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.200-201.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.200-201.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.201-202.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.201-202.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.201-202.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.201-202.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.202-203.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.202-203.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.202-203.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.202-203.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.203-204.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.203-204.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.203-204.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.203-204.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.204-205.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.204-205.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.204-205.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.204-205.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.205-206.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.205-206.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.205-206.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.205-206.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.206-207.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.206-207.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.206-207.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.206-207.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.207-208.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.207-208.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.207-208.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.207-208.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.208-209.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.208-209.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.208-209.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.208-209.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.209-210.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.209-210.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.209-210.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.209-210.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.210-211.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.210-211.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.210-211.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.210-211.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.211-212.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.211-212.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.211-212.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.211-212.patch diff --git a/patch/kernel/rockchip-legacy/patch-4.4.212-213.patch b/patch/kernel/rockchip-legacy/04-patch-4.4.212-213.patch similarity index 100% rename from patch/kernel/rockchip-legacy/patch-4.4.212-213.patch rename to patch/kernel/rockchip-legacy/04-patch-4.4.212-213.patch diff --git a/patch/kernel/rockchip-legacy/1-2-regulator-act8865-add-restart-handler-for-act8846.patch.disabled b/patch/kernel/rockchip-legacy/1-2-regulator-act8865-add-restart-handler-for-act8846.patch similarity index 64% rename from patch/kernel/rockchip-legacy/1-2-regulator-act8865-add-restart-handler-for-act8846.patch.disabled rename to patch/kernel/rockchip-legacy/1-2-regulator-act8865-add-restart-handler-for-act8846.patch index 6d4982176b..1662ebdba3 100644 --- a/patch/kernel/rockchip-legacy/1-2-regulator-act8865-add-restart-handler-for-act8846.patch.disabled +++ b/patch/kernel/rockchip-legacy/1-2-regulator-act8865-add-restart-handler-for-act8846.patch @@ -1,11 +1,5 @@ -Patches act8846 regulator providing the proper reset handle and exploit -the SIPC bit in GLB_POWER_OFF register. Mainly used to reset some rockchip -boards. - -Origin: - diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c -index 2ff73d7..836d10b 100644 +index 6e9592c2..0121a819 100644 --- a/drivers/regulator/act8865-regulator.c +++ b/drivers/regulator/act8865-regulator.c @@ -27,6 +27,7 @@ @@ -25,15 +19,14 @@ index 2ff73d7..836d10b 100644 struct act8865 { struct regmap *regmap; int off_reg; -@@ -402,6 +405,22 @@ static void act8865_power_off(void) +@@ -412,6 +415,21 @@ static void act8865_power_off(void) while (1); } +static int act8846_power_cycle(struct notifier_block *this, -+ unsigned long code, void *unused) ++ unsigned long code, void *unused) +{ + struct act8865 *act8846; -+ + act8846 = i2c_get_clientdata(act8865_i2c_client); + regmap_write(act8846->regmap, ACT8846_GLB_OFF_CTRL, ACT8846_SIPC_MASK); + @@ -48,18 +41,9 @@ index 2ff73d7..836d10b 100644 static int act8865_pmic_probe(struct i2c_client *client, const struct i2c_device_id *i2c_id) { -@@ -484,6 +503,8 @@ static int act8865_pmic_probe(struct i2c_client *client, - } - - if (of_device_is_system_power_controller(dev->of_node)) { -+ int ret; -+ - if (!pm_power_off && (off_reg > 0)) { - act8865_i2c_client = client; - act8865->off_reg = off_reg; -@@ -492,6 +513,14 @@ static int act8865_pmic_probe(struct i2c_client *client, +@@ -512,6 +530,14 @@ static int act8865_pmic_probe(struct i2c_client *client, } else { - dev_err(dev, "Failed to set poweroff capability, already defined\n"); + dev_err(dev, "Failed to set poweroff capability\n"); } + + if (type == ACT8846) { diff --git a/patch/kernel/rockchip-legacy/xt-q8l-v10-add-device-tree.patch b/patch/kernel/rockchip-legacy/xt-q8l-v10-add-device-tree.patch index 70d41a6c6d..ed113cf92d 100644 --- a/patch/kernel/rockchip-legacy/xt-q8l-v10-add-device-tree.patch +++ b/patch/kernel/rockchip-legacy/xt-q8l-v10-add-device-tree.patch @@ -1,9 +1,12 @@ +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 00000000..42c18901 --- /dev/null -+++ b/arch/arm/boot/dts/rk3288-xt-q8l-v10.dts 2018-09-23 13:07:34.000000000 +0000 -@@ -0,0 +1,1120 @@ ++++ b/arch/arm/boot/dts/rk3288-xt-q8l-v10.dts +@@ -0,0 +1,1125 @@ +/* + * Copyright (c) 2014, 2015 FUKAUMI Naoki -+ * 2018 Paolo Sabatino ++ * 2018 Paolo Sabatino + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual @@ -47,18 +50,17 @@ +/dts-v1/; + +#include "rk3288.dtsi" -+#include "rk3288-linux.dtsi" +#include + +/ { -+ ++ + model = "XT-Q8L-V10-RK3288"; + compatible = "generic,xt-q8l-v10-rk3288", "rockchip,rk3288"; + + memory { + reg = <0x0 0x0 0x0 0x80000000>; + }; -+ ++ + /* + * Peripheral from original q8 device tree, currently no references + * for drivers in linux kernel. @@ -89,7 +91,7 @@ + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; -+ ++ + pinctrl-names = "default"; + pinctrl-0 = <&pwr_key>; + @@ -101,7 +103,13 @@ + wakeup-source; + debounce-interval = <100>; + }; -+ ++ ++ }; ++ ++ rk3288-gpiomem { ++ compatible = "rockchip,rk3288-gpiomem"; ++ reg = <0x0 0xff750000 0x0 0x1000>; ++ status = "okay"; + }; + + leds { @@ -113,7 +121,7 @@ + so while there is mass storage access it turns red and + when it is idle is blue + */ -+ gpios = <&gpio7 2 GPIO_ACTIVE_LOW>; ++ gpios = <&gpio7 2 GPIO_ACTIVE_LOW>; + label = "power"; + linux,default-trigger = "mmc0"; + pinctrl-names = "default"; @@ -124,9 +132,11 @@ + + /* + * Legacy platform data for wireless-wlan. -+ * Is this still used or required? ++ * This is used in case rockchip_wlan is in use, ++ * but we prefer the native brcmfmac driver. + * Taken from original q8 firmware device tree + */ ++ /* + wireless-wlan { + compatible = "wlan-platdata"; + wifi_chip_type = "bcmwifi"; @@ -136,6 +146,7 @@ + WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; ++ */ + + /* + * Legacy platform data for wireless-bluetooth. @@ -187,17 +198,6 @@ + vin-supply = <&vcc_io>; + }; + -+ vcc_5v: usb-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_5v"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ regulator-always-on; -+// regulator-boot-on; -+ vin-supply = <&vcc_sys>; -+ }; -+ -+ + vcc_host_5v: usb-host-regulator { + compatible = "regulator-fixed"; + gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>; @@ -206,10 +206,9 @@ + regulator-name = "vcc_host_5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; -+ regulator-always-on; -+ enable-active-high; -+// startup-delay-us = <1000>; -+ vin-supply = <&vcc_5v>; ++ regulator-always-on; ++ enable-active-high; ++ vin-supply = <&vcc_sys>; + }; + + @@ -222,9 +221,8 @@ + regulator-name = "vcc_otg_5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; -+// startup-delay-us = <1000>; + regulator-always-on; -+ vin-supply = <&vcc_5v>; ++ vin-supply = <&vcc_sys>; + }; + + /* @@ -238,7 +236,7 @@ + reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>, <&gpio4 29 GPIO_ACTIVE_LOW>; + post-power-on-delay-ms = <100>; + }; -+ ++ + /* + * Sound taken from tinkerboard device tree, adapted to q8. + * Should be updated to include at least spdif controller, but the @@ -247,7 +245,7 @@ + soundcard-hdmi { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; -+ simple-audio-card,name = "rockchip,q8-codec"; ++ simple-audio-card,name = "DW-I2S-HDMI"; + simple-audio-card,mclk-fs = <512>; + + simple-audio-card,codec { @@ -258,20 +256,20 @@ + sound-dai = <&i2s>; + }; + }; -+ ++ + soundcard-spdif { + compatible = "simple-audio-card"; + simple-audio-card,name = "SPDIF"; + simple-audio-card,dai-link@1 { -+ -+ cpu { -+ sound-dai = <&spdif>; ++ ++ cpu { ++ sound-dai = <&spdif>; + }; -+ -+ codec { -+ sound-dai = <&spdif_out>; ++ ++ codec { ++ sound-dai = <&spdif_out>; + }; -+ ++ + }; + }; + @@ -279,7 +277,7 @@ + compatible = "linux,spdif-dit"; + #sound-dai-cells = <0>; + }; -+ ++ +}; + +/* q8 device tree specifies that pwm0 is enabled on the device and @@ -287,7 +285,7 @@ + * it here. + */ +&pwm0 { -+ ++ + compatible = "rockchip,remotectl-pwm"; + reg = <0x0 0xff680000 0x0 0x10>; + #pwm-cells = <0x3>; @@ -301,8 +299,8 @@ + + ir_key1 { + rockchip,usercode = <0x1dcc>; -+ rockchip,key_table = -+ <0xff KEY_POWER>, ++ rockchip,key_table = ++ <0xff KEY_POWER>, + <0xea KEY_PLAYPAUSE>, + <0xe9 KEY_STOP>, + <0xf9 KEY_PREVIOUSSONG>, @@ -336,7 +334,7 @@ + <0xf6 KEY_F3>, + <0xf2 KEY_F4>; + }; -+ ++ +}; + +&io_domains { @@ -344,7 +342,7 @@ + + audio-supply = <&vcca_33>; + bb-supply = <&vcc_io>; -+ //dvp-supply = <&dovdd_1v8>; ++ dvp-supply = <&vcc_18>; + flash0-supply = <&vcc_flash>; + flash1-supply = <&vcc_lan>; + gpio30-supply = <&vcc_io>; @@ -375,31 +373,43 @@ +}; + +&hdmi { -+ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ #sound-dai-cells = <0>; + /* + * Delete pinctrl-names and pinctrl-* to avoid the configurations + * which clashes with i2c.ff170000 (i2c5) which houses also the HDMI -+ * ddc display configuration. They clash because hdmi_ddc uses FUNC2, -+ * hdmi_gpio (the "sleep" configuration, see rk3288.dtsi) uses FUNC1 ++ * ddc display configuration. They clash because hdmi_ddc uses FUNC2, ++ * hdmi_gpio (the "sleep" configuration, see rk3288.dtsi) uses FUNC1 + * and i2c5 xfer pin group uses FUNC_GPIO + */ + /delete-property/pinctrl-names; + /delete-property/pinctrl-0; + /delete-property/pinctrl-1; -+ ++ + ddc-i2c-bus = <&i2c5>; -+ #sound-dai-cells = <0>; ++ rockchip,phy-table = ++ <74250000 0x8009 0x0004 0x0272>, ++ <165000000 0x802b 0x0004 0x0209>, ++ <371250000 0x802d 0x0001 0x0149>, ++ <0 0x0000 0x0000 0x0000>; + status = "okay"; ++ /* Don't use vopl for HDMI */ ++ ports { ++ hdmi_in: port { ++ /delete-node/ endpoint@1; ++ }; ++ }; +}; + +&gpu { + mali-supply = <&vdd_gpu>; -+ status = "okay"; ++ status = "ok"; +}; + +&i2c0 { + clock-frequency = <400000>; -+ status = "okay"; ++ status = "ok"; + + vdd_cpu: syr827@40 { + compatible = "silergy,syr827"; @@ -442,7 +452,7 @@ + compatible = "active-semi,act8846"; + reg = <0x5a>; + pinctrl-names = "default"; -+ pinctrl-0 = <&pwr_hold>; ++ pinctrl-0 = <&pmic_vsel>; + system-power-controller; + + vp1-supply = <&vcc_sys>; @@ -454,7 +464,7 @@ + inl3-supply = <&vcc_20>; + + regulators { -+ ++ + /* + * Regulator controlling DDR memory - always on + */ @@ -507,7 +517,7 @@ + */ + vccio_sd: REG5 { + regulator-name = "vccio_sd"; -+ regulator-min-microvolt = <1800000>; ++ regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; @@ -593,8 +603,8 @@ +}; + +&i2c1 { -+ status = "okay"; -+ ++ status = "disabled"; ++ + /* + * Apparently the original q8 device tree described an RTC controller + * at this point. Probing the i2c bus at this point does not provide @@ -606,22 +616,23 @@ + reg = <0x51>; + }; + */ -+ ++ + /* + * Firefly board and EVB board have an accelerometer on this bus. + * I don't know if we got something on our tv box, but I guess not + */ -+ ++ +}; + +&i2c2 { -+ status = "okay"; ++ status = "disabled"; +}; + +&i2c4 { -+ -+ status = "okay"; + ++ status = "disabled"; ++ ++ /* + rk1000_ctl: rk1000-ctl@40 { + compatible = "rockchip,rk1000-ctl"; + reg = <0x40>; @@ -651,7 +662,8 @@ + rockchip,ctl = <&rk1000_ctl>; + status = "okay"; + }; -+ ++ */ ++ +}; + +&i2c5 { @@ -681,12 +693,12 @@ + bias-pull-up; + drive-strength = <8>; + }; -+ ++ + pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma { + bias-pull-up; + drive-strength = <8>; + }; -+ ++ + pcfg_pull_none_8ma: pcfg-pull-none-8ma { + bias-disable; + drive-strength = <8>; @@ -700,18 +712,18 @@ + pcfg_wl_int: pcfg-wl-int { + bias-pull-up; + }; -+ ++ + act8846 { -+ ++ + /* + * Original q8 device tree says: + * - gpio0 11 HIGH -> power hold -+ * - gpio7 1 LOW -> possiblt pmic-vsel, we don't care -+ */ -+ /*pmic_vsel: pmic-vsel { ++ * - gpio7 1 LOW -> possibly pmic-vsel, we don't care ++ */ ++ pmic_vsel: pmic-vsel { + rockchip,pins = <7 1 RK_FUNC_GPIO &pcfg_output_low>; -+ };*/ -+ ++ }; ++ + pwr_hold: pwr-hold { + rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_up>; + }; @@ -739,7 +751,7 @@ + + keys { + pwr_key: pwr-key { -+ rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>; ++ rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + @@ -758,7 +770,7 @@ + */ + + sdmmc { -+ ++ + /* + * Copied from firefly board definition to give more drive to + * the sdmmc pins. The Q8 seems to be quite able to drive @@ -809,14 +821,22 @@ + }; + + }; -+ -+ ++ ++ + wireless-bluetooth { + uart0_gpios: uart0-gpios { + rockchip,pins = <4 19 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + ++ emmc { ++ ++ emmc_reset: emmc-reset { ++ rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ }; ++ +}; + +&saradc { @@ -825,29 +845,25 @@ +}; + +&emmc { -+ ++ + /* + * Coming from the original q8 device tree + */ + 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>; -+ -+ /* -+ * Apparently these are not supported on legacy kernel, we don't -+ * declare them here -+ sd-uhs-sdr12; -+ sd-uhs-sdr25; -+ sd-uhs-sdr50; -+ sd-uhs-sdr104; -+ sd-uhs-ddr50; -+ * */ ++ pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>; ++ + vmmc-supply = <&vcc_io>; + vqmmc-supply = <&vcc_flash>; ++ ++ mmc-ddr-1_8v; ++ rockchip,default-sample-phase = <180>; ++ + status = "okay"; +}; + @@ -857,68 +873,66 @@ + bus-width = <4>; + cap-mmc-highspeed; + cap-sd-highspeed; -+ card-detect-delay = <200>; ++ cd-gpios = <&gpio6 RK_PC6 GPIO_ACTIVE_LOW>; ++ cd-debounce-delay-ms = <500>; + disable-wp; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>; -+ vmmc-supply = <&vcc_sd>; + -+ /* -+ * Apparently these are not supported in legacy kernel, we don't declare -+ * them here ++ vmmc-supply = <&vcc_sd>; ++ vqmmc-supply = <&vccio_sd>; + + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + sd-uhs-ddr50; -+ */ ++ + status = "okay"; +}; + +&sdio0 { -+ ++ + #address-cells = <1>; + #size-cells = <0>; -+ ++ + bus-width = <4>; + 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>; + + 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; + no-sd; + cap-sd-highspeed; // required, otherwise does not work! -+ supports-sdio; ++ supports-sdio; + non-removable; -+ ++ + keep-power-in-suspend; + disable-wp; -+ -+ ++ + status = "okay"; -+ ++ + brcmf: bcrmf@1 { -+ ++ + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + interrupt-parent = <&gpio4>; + interrupts = <30 IRQ_TYPE_LEVEL_LOW>; + interrupt-names = "host-wake"; + status = "okay"; -+ }; -+ ++ }; ++ + //sd-uhs-sdr104; // required to be disabled, otherwise the device get -+ // detected, but there is no communication ++ // detected, but there is no communication + +}; + @@ -939,10 +953,10 @@ + * These dmas described here for uarts are present in original q8 board + * dts, so I replicate them here because documentation says that serial + * ports can have dmas. -+ * note: ++ * note: + * - uart0 is the serial port connected to the bluetooth module -+ * - uart2 is the onboard serial port -+ * ++ * - uart2 is the onboard serial port ++ * + */ +&uart0 { + pinctrl-names = "default"; @@ -950,7 +964,7 @@ + dmas = <&dmac_peri 1 &dmac_peri 2>; + dma-names = "tx", "rx"; + status = "okay"; -+// uart-has-rtscts; ++// uart-has-rtscts; +}; + +&uart1 { @@ -990,38 +1004,35 @@ + * The reference patch which works in conjuction with the reset lines: + * https://patchwork.kernel.org/patch/9469811/ + */ -+ &usbphy { ++&usbphy { + status = "okay"; +}; -+ ++ +&usbphy0 { -+ vbus-drv = <&vcc_otg_5v>; -+ vbus_drv-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; ++ vbus-drv = <&vcc_otg_5v>; ++ vbus_drv-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; +}; + +&usbphy1 { -+ resets = <&cru SRST_USBHOST0_PHY>; -+ reset-names = "phy-reset"; ++ resets = <&cru SRST_USBHOST0_PHY>; ++ reset-names = "phy-reset"; +}; + +&usbphy2 { -+ vbus-drv = <&vcc_host_5v>; -+ vbus_drv-gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>; ++ vbus-drv = <&vcc_host_5v>; ++ vbus_drv-gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>; +}; + +&usb_host0_ehci { -+ dr_mode = "host"; -+ status = "okay"; ++ status = "disabled"; +}; + +/* + * Prevents the kernel moaning about the missing regulators + */ +&usb_host1 { -+ dr_mode = "host"; -+ vusb_d-supply = <&vcc_host_5v>; -+ vusb_a-supply = <&vcc_host_5v>; -+ ++ vusb_d-supply = <&vcc_host_5v>; ++ vusb_a-supply = <&vcc_host_5v>; + status = "okay"; +}; + @@ -1030,8 +1041,8 @@ + */ +&usb_otg { + dr_mode = "host"; -+ vusb_d-supply = <&vcc_otg_5v>; -+ vusb_a-supply = <&vcc_otg_5v>; ++ vusb_d-supply = <&vcc_otg_5v>; ++ vusb_a-supply = <&vcc_otg_5v>; + status = "okay"; +}; + @@ -1045,6 +1056,10 @@ + +&vopl { + status = "okay"; ++ /* Don't use vopl for HDMI */ ++ vopl_out: port { ++ /delete-node/ endpoint@0; ++ }; +}; + +&vopl_mmu { @@ -1092,6 +1107,7 @@ + * avoid kernel warning about fractional divisors (didn't investigate too + * much, but uart0 was complaining about) + */ ++/* +&cru { + assigned-clocks = <&cru PLL_GPLL>, <&cru PLL_CPLL>, + <&cru PLL_NPLL>, <&cru ACLK_CPU>, @@ -1104,20 +1120,12 @@ + <300000000>, <150000000>, + <75000000>; +}; ++*/ + -+/* -+ * For an unknown cause, in rk3288-linux.dtsi there is a string switching -+ * the ffb20000 dmac to ff600000. This causes a total wreakage, so we fix -+ * it here -+ */ -+ &dmac_bus_s { -+ /* Revert change in rk3288-linux.dtsi */ -+ reg = <0x0 0xffb20000 0x0 0x4000>; ++&gpu_opp_table { ++ opp-600000000 { ++ opp-hz = /bits/ 64 <600000000>; ++ opp-microvolt = <1250000>; ++ }; +}; + -+/* -+ * Fix typo (diasbled) in rk3288-linux.dtsi -+ */ -+&dmc { -+ status = "disabled"; -+};