Tinker linux5.4 (#632)

* Migrate Tinker to linux 5.4

* Update bootloader
This commit is contained in:
Pascal Vizeli
2020-04-24 15:12:57 +02:00
committed by GitHub
parent 98f13d9282
commit c017b43456
89 changed files with 1490 additions and 402404 deletions

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 2018-12-06 21:46:51.493688015 +0000
@@ -0,0 +1,969 @@
+++ 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,55 +56,11 @@
+ model = "XT-Q8L-V10-RK3288";
+ compatible = "generic,xt-q8l-v10-rk3288", "rockchip,rk3288";
+
+ memory {
+ memory@0 {
+ reg = <0x0 0x0 0x0 0x80000000>;
+ device_type = "memory";
+ };
+
+ cpu0_opp_table: opp_table {
+ compatible = "operating-points-v2";
+ opp-shared;
+
+ opp@600000000 {
+ opp-hz = /bits/ 64 <600000000>;
+ opp-microvolt = <900000>;
+ };
+ opp@816000000 {
+ opp-hz = /bits/ 64 <816000000>;
+ opp-microvolt = <1000000>;
+ };
+ opp@1008000000 {
+ opp-hz = /bits/ 64 <1008000000>;
+ opp-microvolt = <1050000>;
+ };
+ opp@1200000000 {
+ opp-hz = /bits/ 64 <1200000000>;
+ opp-microvolt = <1100000>;
+ };
+ opp@1416000000 {
+ opp-hz = /bits/ 64 <1416000000>;
+ opp-microvolt = <1200000>;
+ };
+ opp@1512000000 {
+ opp-hz = /bits/ 64 <1512000000>;
+ opp-microvolt = <1250000>;
+ };
+ opp@1608000000 {
+ opp-hz = /bits/ 64 <1608000000>;
+ opp-microvolt = <1300000>;
+ };
+ /*
+ opp@1704000000 {
+ opp-hz = /bits/ 64 <1704000000>;
+ opp-microvolt = <1350000>;
+ };
+ opp@1800000000 {
+ opp-hz = /bits/ 64 <1800000000>;
+ opp-microvolt = <1400000>;
+ };
+ */
+ };
+
+ /*
+ * Peripheral from original q8 device tree, currently no references
+ * for drivers in linux kernel.
@@ -127,7 +86,7 @@
+ clock-frequency = <125000000>;
+ clock-output-names = "ext_gmac";
+ };
+
+
+ /*
+ * Handle the IR receiver using the gpio-ir-receiver kernel module.
+ * This works flawlessy, the original xt-q8l-v10 remote uses a NEC
@@ -141,13 +100,13 @@
+ pinctrl-0 = <&ir_int>;
+ linux,rc-map-name = "rc-xt-q8l-v10";
+ wakeup-source;
+ };
+ };
+
+ keys: gpio-keys {
+ compatible = "gpio-keys";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwr_key>;
+
@@ -159,7 +118,7 @@
+ wakeup-source;
+ debounce-interval = <100>;
+ };
+
+
+ };
+
+ leds {
@@ -171,7 +130,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";
@@ -206,35 +165,34 @@
+ 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 {
+ compatible = "regulator-fixed";
+ gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&host_vbus_drv>;
+ regulator-name = "vcc_host_5v";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ enable-active-high;
+// startup-delay-us = <1000>;
+ regulator-boot-on;
+ enable-active-high;
+ vin-supply = <&vcc_sys>;
+ };
+
+
+ vcc_otg_5v: usb-otg-regulator {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&otg_vbus_drv>;
+ regulator-name = "vcc_otg_5v";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+// startup-delay-us = <1000>;
+ regulator-always-on;
+ regulator-boot-on;
+ enable-active-high;
+ vin-supply = <&vcc_sys>;
+ };
+
@@ -249,7 +207,14 @@
+ reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>, <&gpio4 29 GPIO_ACTIVE_LOW>;
+ 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.
+ */
@@ -267,27 +232,27 @@
+ sound-dai = <&i2s>;
+ };
+ };
+
+ soundcard-spdif {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "SPDIF";
+ simple-audio-card,dai-link@1 {
+
+ cpu {
+ sound-dai = <&spdif>;
+ };
+
+ codec {
+ sound-dai = <&spdif_out>;
+ };
+
+ };
+ };
+
+ spdif_out: spdif-out {
+ compatible = "linux,spdif-dit";
+ #sound-dai-cells = <0>;
+ };
+ soundcard-spdif {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "SPDIF";
+ simple-audio-card,dai-link@1 {
+
+ cpu {
+ sound-dai = <&spdif>;
+ };
+
+ codec {
+ sound-dai = <&spdif_out>;
+ };
+
+ };
+ };
+
+ spdif_out: spdif-out {
+ compatible = "linux,spdif-dit";
+ #sound-dai-cells = <0>;
+ };
+
+};
+
@@ -309,23 +274,6 @@
+
+&cpu0 {
+ cpu0-supply = <&vdd_cpu>;
+ operating-points-v2 = <&cpu0_opp_table>;
+ /delete-node/operating-points;
+};
+
+&cpu1 {
+ operating-points-v2 = <&cpu0_opp_table>;
+ /delete-node/operating-points;
+};
+
+&cpu2 {
+ operating-points-v2 = <&cpu0_opp_table>;
+ /delete-node/operating-points;
+};
+
+&cpu3 {
+ operating-points-v2 = <&cpu0_opp_table>;
+ /delete-node/operating-points;
+};
+
+&gmac {
@@ -369,6 +317,9 @@
+ regulator-always-on;
+ regulator-boot-on;
+ vin-supply = <&vcc_sys>;
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdd_gpu: syr828@41 {
@@ -381,6 +332,9 @@
+ regulator-ramp-delay = <8000>;
+ regulator-always-on;
+ vin-supply = <&vcc_sys>;
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ hym8563: hym8563@51 {
@@ -412,7 +366,7 @@
+ wakeup-source;
+
+ regulators {
+
+
+ /*
+ * Regulator controlling DDR memory - always on
+ */
@@ -421,6 +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;
+ };
+ */
+ };
+
+ /*
@@ -432,6 +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;
+ };
+ */
+ };
+
+ /*
@@ -445,6 +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;
+ };
+ */
+ };
+
+ /*
@@ -457,6 +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;
+ };
+ */
+ };
+
+ /*
@@ -465,9 +443,16 @@
+ */
+ vccio_sd: REG5 {
+ regulator-name = "vccio_sd";
+ regulator-min-microvolt = <1800000>;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ /*
+ * Broken in kernel 5.4
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ regulator-suspend-microvolt = <3300000>;
+ };
+ */
+ };
+
+ /*
@@ -479,6 +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;
+ };
+ */
+ };
+
+ /*
@@ -491,6 +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;
+ };
+ */
+ };
+
+ /*
@@ -502,6 +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;
+ };
+ */
+ };
+
+ /*
@@ -511,6 +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;
+ };
+ */
+ };
+
+ /*
@@ -522,6 +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;
+ };
+ */
+ };
+
+ /*
@@ -533,6 +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;
+ };
+ */
+ };
+
+ /*
@@ -545,6 +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;
+ };
+ */
+ };
+ };
+ };
@@ -559,7 +595,7 @@
+};
+
+&i2c4 {
+
+
+ /*
+ * Here should go the RK1000 audio codec parts, but seems that
+ * there is no driver in linux kernel at the moment, so we can't
@@ -569,7 +605,7 @@
+ * http://dl.radxa.com/rock/docs/hw/ds/RK1000-S%20DATASHEET%20V14.pdf
+ */
+ status = "okay";
+
+
+};
+
+&i2c5 {
@@ -599,12 +635,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>;
@@ -618,18 +654,18 @@
+ pcfg_wl_int: pcfg-wl-int {
+ bias-pull-up;
+ };
+
+
+ act8846 {
+
+
+ /*
+ * Original q8 device tree says:
+ * - gpio0 11 HIGH -> power hold
+ * - gpio7 1 LOW -> possibly pmic-vsel, we don't care
+ */
+ * - 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>;
+ };
@@ -674,7 +710,7 @@
+ };
+
+ sdmmc {
+
+
+ /*
+ * Copied from firefly board definition to give more drive to
+ * the sdmmc pins. The Q8 seems to be quite able to drive
@@ -725,14 +761,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 {
@@ -741,24 +785,34 @@
+};
+
+&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";
+};
@@ -769,7 +823,8 @@
+ 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>;
@@ -780,39 +835,40 @@
+ 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>;
+
+ // 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";
@@ -820,8 +876,8 @@
+ 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
+
@@ -843,13 +899,13 @@
+ * 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
+ *
+ * As ok kernel 4.19 DMA for serial ports is disabled because it makes
+ * the ports unusable
+ *
+ *
+ */
+&uart0 {
+ pinctrl-names = "default";
@@ -893,31 +949,25 @@
+ * specify the proper resources for all the phys though.
+ * The reference patch which works in conjuction with the reset lines:
+ * https://patchwork.kernel.org/patch/9469811/
+ *
+ *
+ */
+&usbphy {
+ 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";
+};
+
@@ -944,18 +994,10 @@
+ status = "okay";
+};
+
+&vpu_service {
+ status = "okay";
+};
+
+&hevc_mmu {
+ status = "okay";
+};
+
+&hevc_service {
+ status = "okay";
+};
+
+&wdt {
+ status = "okay";
+};
@@ -970,3 +1012,56 @@
+&spdif {
+ status = "okay";
+};
+
+/*
+ * Redefine some thermals to give a bit more headroom (+5°C)
+ */
+&cpu_alert0 {
+ temperature = <75000>;
+};
+
+&cpu_alert1 {
+ temperature = <80000>;
+};
+
+&gpu_alert0 {
+ temperature = <75000>;
+};
+
+/*
+ * Retouch the operating points for higher frequencies to reduce
+ * the voltage required
+ */
+&cpu_opp_table {
+ opp-1512000000 {
+ opp-microvolt = <1250000>;
+ };
+
+ 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";
+};