On 24/10/2022 13:42, Dzmitry Sankouski wrote: > New device support - Xiaomi Mi6 phone > > What works: > - storage > - usb > - power regulators > > Signed-off-by: Dzmitry Sankouski <dsankouski@xxxxxxxxx> > --- > Changes for v2: > - remove memory nodes before redefining > - add board compatible to schema > - remove board msm-id, add chassis type > - remove common dtsi > - move resin to pm8998 dtsi file > - dts formatting > - unsupported properties removed > - add copyright > - rebase on latest master(6.0.0-rc6) > Changes for v3: > - regulators nodes renamed to match pattern 'regulators-[01]' > - duplicate cci1-default node deleted > - add state suffix to '.*(active|suspend|default)' pinctrl > - rebase on latest master(6.0.0) > Changes for v4: > - fix dts compilation errors(rename pinctrl label usages) > Changes for v5: > - use pm8005_regulators label > Changes for v6: > - add state suffix to all pinctrl > - move status nodes to last position > - disable resin node by default > - move the debounce param to pm8998.dtsi file > - place this patch after dt-binding patch > Changes for v7: > - fix Properties must precede subnodes dts compilation error > Changes for v8: > - enable resin node > - rename nodes in reserved memory to comply with 'memory@.*' pattern > Changes for v9: none > Changes for v10: > - reorder resin node content > - reorder reserved memory nodes > - increase reserved memory for adsp to comply with vendor kernel > - new line in blsp1_uart3 node > > arch/arm64/boot/dts/qcom/Makefile | 1 + > .../boot/dts/qcom/msm8998-xiaomi-sagit.dts | 710 ++++++++++++++++++ > arch/arm64/boot/dts/qcom/pm8998.dtsi | 8 + > 3 files changed, 719 insertions(+) > create mode 100644 arch/arm64/boot/dts/qcom/msm8998-xiaomi-sagit.dts > > diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile > index 1d86a33de528..0460aabf1b59 100644 > --- a/arch/arm64/boot/dts/qcom/Makefile > +++ b/arch/arm64/boot/dts/qcom/Makefile > @@ -46,6 +46,7 @@ dtb-$(CONFIG_ARCH_QCOM) += msm8998-oneplus-dumpling.dtb > dtb-$(CONFIG_ARCH_QCOM) += msm8998-sony-xperia-yoshino-lilac.dtb > dtb-$(CONFIG_ARCH_QCOM) += msm8998-sony-xperia-yoshino-maple.dtb > dtb-$(CONFIG_ARCH_QCOM) += msm8998-sony-xperia-yoshino-poplar.dtb > +dtb-$(CONFIG_ARCH_QCOM) += msm8998-xiaomi-sagit.dtb > dtb-$(CONFIG_ARCH_QCOM) += qcs404-evb-1000.dtb > dtb-$(CONFIG_ARCH_QCOM) += qcs404-evb-4000.dtb > dtb-$(CONFIG_ARCH_QCOM) += qrb5165-rb5.dtb > diff --git a/arch/arm64/boot/dts/qcom/msm8998-xiaomi-sagit.dts b/arch/arm64/boot/dts/qcom/msm8998-xiaomi-sagit.dts > new file mode 100644 > index 000000000000..ea66583fe74d > --- /dev/null > +++ b/arch/arm64/boot/dts/qcom/msm8998-xiaomi-sagit.dts > @@ -0,0 +1,710 @@ > +// SPDX-License-Identifier: BSD-3-Clause > +/* > + * Xiaomi Mi 6 (sagit) device tree source based on msm8998-mtp.dtsi > + * > + * Copyright (c) 2022, The Linux Foundation. All rights reserved. > + * Copyright (c) 2022, Degdag Mohamed <degdagmohamed@xxxxxxxxx> > + * Copyright (c) 2022, Dzmitry Sankouski <dsankouski@xxxxxxxxx> > + */ > + > +/dts-v1/; > + > +#include "msm8998.dtsi" > +#include "pm8005.dtsi" > +#include "pm8998.dtsi" > +#include "pmi8998.dtsi" > +#include <dt-bindings/input/input.h> > +#include <dt-bindings/leds/common.h> > +#include <dt-bindings/pinctrl/qcom,pmic-gpio.h> > + > +/* > + * Delete following upstream (msm8998.dtsi) reserved > + * memory mappings which are different in this device. > + */ > +/delete-node/ &adsp_mem; > +/delete-node/ &mpss_mem; > +/delete-node/ &venus_mem; > +/delete-node/ &mba_mem; > +/delete-node/ &slpi_mem; > +/delete-node/ &ipa_fw_mem; > +/delete-node/ &ipa_gsi_mem; > +/delete-node/ &gpu_mem; > +/delete-node/ &wlan_msa_mem; > + > +/ { > + model = "Xiaomi Mi 6"; > + compatible = "xiaomi,sagit", "qcom,msm8998"; > + chassis-type = "handset"; > + /* Required for bootloader to select correct board */ > + qcom,board-id = <30 0>; > + > + reserved-memory { > + /* > + * Xiaomi's ADSP firmware requires 30 MiB in total, so increase the adsp_mem > + * region by 4 MiB to account for this while relocating the other now > + * conflicting memory nodes accordingly. > + */ > + adsp_mem: memory@8b200000 { > + reg = <0x0 0x8b200000 0x0 0x1e00000>; > + no-map; > + }; > + > + mpss_mem: memory@8d000000 { > + reg = <0x0 0x8d000000 0x0 0x7000000>; > + no-map; > + }; > + > + venus_mem: memory@94000000 { > + reg = <0x0 0x94000000 0x0 0x500000>; > + no-map; > + }; > + > + mba_mem: memory@94500000 { > + reg = <0x0 0x94500000 0x0 0x200000>; > + no-map; > + }; > + > + slpi_mem: memory@94700000 { > + reg = <0x0 0x94700000 0x0 0xf00000>; > + no-map; > + }; > + > + ipa_fw_mem: memory@95600000 { > + reg = <0x0 0x95600000 0x0 0x10000>; > + no-map; > + }; > + > + ipa_gsi_mem: memory@95610000 { > + reg = <0x0 0x95610000 0x0 0x5000>; > + no-map; > + }; > + > + gpu_mem: memory@95615000 { > + reg = <0x0 0x95615000 0x0 0x100000>; > + no-map; > + }; > + > + wlan_msa_mem: memory@95715000 { > + reg = <0x0 0x95715000 0x0 0x100000>; > + no-map; > + }; > + > + /* Bootloader display framebuffer region */ > + cont_splash_mem: memory@9d400000 { > + reg = <0x0 0x9d400000 0x0 0x2400000>; > + no-map; > + }; > + > + /* For getting crash logs using Android downstream kernels */ > + ramoops@ac000000 { > + compatible = "ramoops"; > + reg = <0x0 0xac000000 0x0 0x200000>; > + console-size = <0x80000>; > + pmsg-size = <0x40000>; > + record-size = <0x8000>; > + ftrace-size = <0x20000>; > + }; > + > + /* > + * The following memory regions on downstream are "dynamically allocated" > + * but given the same addresses every time. Hard code them as these addresses > + * are where the Xiaomi signed firmware expects them to be. > + */ > + ipa_fws_region: memory@f7800000 { > + compatible = "shared-dma-pool"; > + reg = <0x0 0xf7800000 0x0 0x5000>; > + no-map; > + }; > + > + zap_shader_region: memory@f7900000 { > + compatible = "shared-dma-pool"; > + reg = <0x0 0xf7900000 0x0 0x2000>; > + no-map; > + }; > + }; > + > + gpio-keys { > + compatible = "gpio-keys"; > + label = "Volume buttons"; > + autorepeat; > + > + pinctrl-names = "default"; > + pinctrl-0 = <&vol_up_key_default>; > + > + key-vol-up { > + label = "Volume up"; > + gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>; > + linux,code = <KEY_VOLUMEUP>; > + debounce-interval = <15>; > + wakeup-source; > + }; > + }; > + > + gpio-hall-sensor { > + compatible = "gpio-keys"; > + label = "Hall effect sensor"; > + > + pinctrl-names = "default"; > + pinctrl-0 = <&hall_sensor_default_state>; > + > + event-hall-sensor { > + label = "Hall Effect Sensor"; > + gpios = <&tlmm 124 GPIO_ACTIVE_LOW>; > + linux,input-type = <EV_SW>; > + linux,code = <SW_LID>; > + linux,can-disable; > + wakeup-source; > + }; > + }; > + > + vph_pwr: vph-pwr-regulator { > + compatible = "regulator-fixed"; > + regulator-name = "vph_pwr"; > + regulator-min-microvolt = <3700000>; > + regulator-max-microvolt = <3700000>; > + regulator-always-on; > + regulator-boot-on; > + }; > + > + disp_vddts_vreg: disp-vddts-regulator { > + compatible = "regulator-fixed"; > + regulator-name = "disp-vddts-regulator"; > + gpio = <&tlmm 50 GPIO_ACTIVE_HIGH>; > + enable-active-high; > + regulator-boot-on; > + }; > +}; > + > +&blsp1_i2c5 { > + pinctrl-names = "default", "sleep"; > + status = "okay"; > + > + touchscreen@20 { > + compatible = "syna,rmi4-i2c"; > + reg = <0x20>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + interrupt-parent = <&tlmm>; > + interrupts = <125 IRQ_TYPE_EDGE_FALLING>; > + > + pinctrl-names = "default", "sleep"; > + pinctrl-0 = <&ts_active_state>; > + pinctrl-1 = <&ts_int_suspend_state &ts_reset_suspend_state>; > + > + vdd-supply = <&disp_vddts_vreg>; > + vio-supply = <&vreg_l6a_1p8>; > + > + syna,reset-delay-ms = <20>; > + syna,startup-delay-ms = <20>; > + > + rmi4-f01@1 { > + reg = <0x01>; > + syna,nosleep-mode = <1>; > + }; > + > + rmi4-f12@12 { > + reg = <0x12>; > + touchscreen-x-mm = <64>; > + touchscreen-y-mm = <114>; > + syna,sensor-type = <1>; > + syna,rezero-wait-ms = <20>; > + }; > + > + rmi4-f1a@1a { > + reg = <0x1a>; > + syna,codes = <KEY_BACK KEY_APPSELECT>; > + }; > + }; > +}; > + > +&blsp1_i2c5_sleep { > + /delete-property/ bias-pull-up; > + bias-disable; > +}; > + > +&blsp1_uart3 { > + status = "okay"; > + > + bluetooth { > + compatible = "qcom,wcn3990-bt"; > + > + vddio-supply = <&vreg_s4a_1p8>; > + vddxo-supply = <&vreg_l7a_1p8>; > + vddrf-supply = <&vreg_l17a_1p3>; > + vddch0-supply = <&vreg_l25a_3p3>; > + max-speed = <3200000>; > + }; > +}; > + > +&blsp1_uart3_on { > + rx { You need to rebase your changes. This won't work. If you test your DTS with dtbs_check, you will see the warnings. Best regards, Krzysztof