From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4D65C54EBD for ; Mon, 9 Jan 2023 12:21:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234159AbjAIMVM (ORCPT ); Mon, 9 Jan 2023 07:21:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237004AbjAIMVJ (ORCPT ); Mon, 9 Jan 2023 07:21:09 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C0351B9F9 for ; Mon, 9 Jan 2023 04:21:05 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id m6so12630049lfj.11 for ; Mon, 09 Jan 2023 04:21:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=w17QSa1ARYLt0H4+l17Tri9UL9700QafW8CiMlQZ0uM=; b=TdYMmxQXzKHh1BjRxuzDNgzgDfl51r4VwvA6AksxTgEUHLBraxCNyZhoLfclQcSFT2 nTj5Te2Iv2r7IzjwuHj7kRPeSipmrANcuJfep6eiOAe4pI9zn+PAkBvio/HSk3GOUqpu aC89R/Cq3UdvZyYVyKWH650Oe/jXAdxJhPZl+EoAoEWUPJjdA+AVGvZ2E6n+wjA/SBj6 PCZ0kXAGGiCbkCgGJDQ9KGWKqx6zEIwbW8e2kPB2JF0FJVsVybhzPjdzw7dmwaComqYx SzhEF1MApuLvCC8a6Jm3bqPXiKGibozrttBu7UBohaOQ17sZHg7Aa+EfpX1SVWrcUfI2 ftnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w17QSa1ARYLt0H4+l17Tri9UL9700QafW8CiMlQZ0uM=; b=0PxVZJYsLxKk7I03r0y35mUf+4i2U0OWVU2x+TwzjelKltDqjDaY73x2od8jVLSCG2 Tb0z/Cy5MDOYOGhPsSHonS/3whK5hprJAml5W9RE+nNeyk7wb8d9D63IIVvEohxARKLK eBfdBzl5aqt5Jk4iiKS2GAoBak/Cc3Zkb6vNZp1nv6jHfq934cn93k+T1uNe1F/UyBzi p8AKkCXmN068bmuqMKiBA2/PtKT/8QWWeZzJqFkzA/QlKgec8mWruhsGcCvmn8U1r9+V TGfly8flCIfUYfplan7hHElPlE6yRVku/7yI5YZdbInbD1i4xx7zIoaEc0lm4RBDc8Aw hqbw== X-Gm-Message-State: AFqh2kpu9bcWmcLJ5zF7MEMjq1FtaIXUaNeTxKWnhgoZmOs4Ijw8UFba kR/tczv7Vp749cKmAXnBdvJ9jw== X-Google-Smtp-Source: AMrXdXtPQON1Ss/DWTegUWU0BoVgOaMkJeldz0jQ6A8VM3F2Mgy+/T77nl9C71ZH1M+OlDNBPw75Tg== X-Received: by 2002:a05:6512:31d1:b0:4b5:7925:8707 with SMTP id j17-20020a05651231d100b004b579258707mr22533225lfe.26.1673266863572; Mon, 09 Jan 2023 04:21:03 -0800 (PST) Received: from [192.168.1.101] (abxi45.neoplus.adsl.tpnet.pl. [83.9.2.45]) by smtp.gmail.com with ESMTPSA id s6-20020ac25fe6000000b004b6efcb7bb5sm1599179lfg.169.2023.01.09.04.21.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Jan 2023 04:21:03 -0800 (PST) Message-ID: Date: Mon, 9 Jan 2023 13:21:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v6 6/6] arm64: dts: qcom: sm6125: Initial support for xiaomi-laurel-sprout Content-Language: en-US To: Lux Aliaga , agross@kernel.org, andersson@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, vkoul@kernel.org, kishon@kernel.org, alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com Cc: ~postmarketos/upstreaming@lists.sr.ht, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-scsi@vger.kernel.org, linux-hardening@vger.kernel.org, phone-devel@vger.kernel.org, martin.botka@somainline.org, marijn.suijten@somainline.org References: <20230108195336.388349-1-they@mint.lgbt> <20230108195336.388349-7-they@mint.lgbt> From: Konrad Dybcio In-Reply-To: <20230108195336.388349-7-they@mint.lgbt> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 8.01.2023 20:53, Lux Aliaga wrote: > Add support for the Xiaomi Mi A3 (xiaomi-laurel-sprout). Here's a > summary on what's defined. > > - dmesg output to bootloader preconfigured display > - USB > - UFS > - SD card > - SMD RPM regulators > - Volume Up, Down and Power buttons > - Thermistors > > Signed-off-by: Lux Aliaga > --- > arch/arm64/boot/dts/qcom/Makefile | 1 + > .../dts/qcom/sm6125-xiaomi-laurel-sprout.dts | 424 ++++++++++++++++++ > 2 files changed, 425 insertions(+) > create mode 100644 arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts > > diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile > index 3e79496292e7..2b2a0170db14 100644 > --- a/arch/arm64/boot/dts/qcom/Makefile > +++ b/arch/arm64/boot/dts/qcom/Makefile > @@ -157,6 +157,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sdm850-lenovo-yoga-c630.dtb > dtb-$(CONFIG_ARCH_QCOM) += sdm850-samsung-w737.dtb > dtb-$(CONFIG_ARCH_QCOM) += sm4250-oneplus-billie2.dtb > dtb-$(CONFIG_ARCH_QCOM) += sm6125-sony-xperia-seine-pdx201.dtb > +dtb-$(CONFIG_ARCH_QCOM) += sm6125-xiaomi-laurel-sprout.dtb > dtb-$(CONFIG_ARCH_QCOM) += sm6350-sony-xperia-lena-pdx213.dtb > dtb-$(CONFIG_ARCH_QCOM) += sm6375-sony-xperia-murray-pdx225.dtb > dtb-$(CONFIG_ARCH_QCOM) += sm7225-fairphone-fp4.dtb > diff --git a/arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts b/arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts > new file mode 100644 > index 000000000000..7ff18f481060 > --- /dev/null > +++ b/arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts > @@ -0,0 +1,424 @@ > +// SPDX-License-Identifier: BSD-3-Clause > +/* > + * Copyright (c) 2022, Lux Aliaga > + */ > + > +/dts-v1/; > + > +#include > +#include > +#include > +#include > +#include "sm6125.dtsi" > +#include "pm6125.dtsi" > + > +/ { > + model = "Xiaomi Mi A3"; > + compatible = "xiaomi,laurel-sprout", "qcom,sm6125"; > + chassis-type = "handset"; > + > + /* required for bootloader to select correct board */ > + qcom,msm-id = <394 0>; /* sm6125 v1 */ > + qcom,board-id = <11 0>; > + > + chosen { > + #address-cells = <2>; > + #size-cells = <2>; > + ranges; > + > + framebuffer0: framebuffer@5c000000 { > + compatible = "simple-framebuffer"; > + reg = <0 0x5c000000 0 (1560 * 720 * 4)>; > + width = <720>; > + height = <1560>; > + stride = <(720 * 4)>; > + format = "a8r8g8b8"; > + }; > + }; > + > + reserved-memory { > + #address-cells = <2>; > + #size-cells = <2>; These two properties are already set in the SoC dtsi, you can drop them. > + > + debug_mem: debug@ffb00000 { > + reg = <0x0 0xffb00000 0x0 0xc0000>; > + no-map; > + }; > + > + last_log_mem: lastlog@ffbc0000 { > + reg = <0x0 0xffbc0000 0x0 0x80000>; > + no-map; > + }; > + > + pstore_mem: ramoops@ffc00000 { > + compatible = "ramoops"; > + reg = <0x0 0xffc40000 0x0 0xc0000>; > + record-size = <0x1000>; > + console-size = <0x40000>; > + msg-size = <0x20000 0x20000>; > + }; > + > + cmdline_mem: memory@ffd00000 { > + reg = <0x0 0xffd40000 0x0 0x1000>; > + no-map; > + }; > + }; > + > + extcon_usb: usb-id { > + compatible = "linux,extcon-usb-gpio"; > + id-gpio = <&tlmm 102 GPIO_ACTIVE_HIGH>; > + }; > + > + gpio-keys { > + compatible = "gpio-keys"; > + > + pinctrl-0 = <&vol_up_n>; > + pinctrl-names = "default"; > + > + key-volume-up { > + label = "Volume Up"; > + gpios = <&pm6125_gpio 5 GPIO_ACTIVE_LOW>; > + linux,code = ; > + debounce-interval = <15>; > + linux,can-disable; > + wakeup-source; > + }; > + }; > + > + thermal-zones { > + rf-pa0-thermal { > + polling-delay-passive = <0>; > + polling-delay = <0>; > + thermal-sensors = <&pm6125_adc_tm 0>; > + > + trips { > + active-config0 { > + temperature = <125000>; > + hysteresis = <1000>; > + type = "critical"; > + }; > + }; > + }; > + > + quiet-thermal { > + polling-delay-passive = <0>; > + polling-delay = <5000>; > + thermal-sensors = <&pm6125_adc_tm 1>; > + > + trips { > + active-config0 { > + temperature = <125000>; > + hysteresis = <1000>; > + type = "critical"; > + }; > + }; > + }; > + > + xo-thermal { > + polling-delay-passive = <0>; > + polling-delay = <0>; > + thermal-sensors = <&pm6125_adc_tm 2>; > + > + trips { > + active-config0 { > + temperature = <125000>; > + hysteresis = <1000>; > + type = "critical"; > + }; > + }; > + }; > + }; > +}; > + > +&hsusb_phy1 { > + vdd-supply = <&vreg_l7a>; > + vdda-pll-supply = <&vreg_l10a>; > + vdda-phy-dpdm-supply = <&vreg_l15a>; > + status = "okay"; > +}; > + > +&pm6125_adc { > + pinctrl-names = "default"; > + pinctrl-0 = <&camera_flash_therm &emmc_ufs_therm>; > + > + adc-chan@4d { > + reg = ; > + qcom,ratiometric; > + qcom,hw-settle-time = <200>; > + qcom,pre-scaling = <1 1>; > + label = "rf_pa0_therm"; > + }; > + > + adc-chan@4e { > + reg = ; > + qcom,ratiometric; > + qcom,hw-settle-time = <200>; > + qcom,pre-scaling = <1 1>; > + label = "quiet_therm"; > + }; > + > + adc-chan@52 { > + reg = ; > + qcom,ratiometric; > + qcom,hw-settle-time = <200>; > + qcom,pre-scaling = <1 1>; > + label = "camera_flash_therm"; > + }; > + > + adc-chan@54 { > + reg = ; > + qcom,ratiometric; > + qcom,hw-settle-time = <200>; > + qcom,pre-scaling = <1 1>; > + label = "emmc_ufs_therm"; > + }; > +}; > + > +&pm6125_adc_tm { > + status = "okay"; > + > + rf-pa0-therm@0 { > + reg = <0>; > + io-channels = <&pm6125_adc ADC5_AMUX_THM1_100K_PU>; > + qcom,ratiometric; > + qcom,hw-settle-time-us = <200>; > + }; > + > + quiet-therm@1 { > + reg = <1>; > + io-channels = <&pm6125_adc ADC5_AMUX_THM2_100K_PU>; > + qcom,ratiometric; > + qcom,hw-settle-time-us = <200>; > + }; > + > + xo-therm@2 { > + reg = <2>; > + io-channels = <&pm6125_adc ADC5_XO_THERM_100K_PU>; > + qcom,ratiometric; > + qcom,hw-settle-time-us = <200>; > + }; > +}; > + > +&pm6125_gpio { > + camera_flash_therm: camera-flash-therm-state { > + pins = "gpio3"; > + function = PMIC_GPIO_FUNC_NORMAL; > + bias-high-impedance; > + }; > + > + emmc_ufs_therm: emmc-ufs-therm-state { > + pins = "gpio6"; > + function = PMIC_GPIO_FUNC_NORMAL; > + bias-high-impedance; > + }; > + > + vol_up_n: vol-up-n-state { > + pins = "gpio5"; > + function = PMIC_GPIO_FUNC_NORMAL; > + input-enable; > + bias-pull-up; > + }; > +}; > + > +&pon_pwrkey { > + status = "okay"; > +}; > + > +&pon_resin { > + status = "okay"; > + linux,code = ; Status should go last. With these two addressed: Reviewed-by: Konrad Dybcio Konrad > +}; > + > +&rpm_requests { > + regulators-0 { > + compatible = "qcom,rpm-pm6125-regulators"; > + > + vreg_s6a: s6 { > + regulator-min-microvolt = <936000>; > + regulator-max-microvolt = <1422000>; > + }; > + > + vreg_l1a: l1 { > + regulator-min-microvolt = <1200000>; > + regulator-max-microvolt = <1256000>; > + }; > + > + vreg_l2a: l2 { > + regulator-min-microvolt = <1000000>; > + regulator-max-microvolt = <1056000>; > + }; > + > + vreg_l3a: l3 { > + regulator-min-microvolt = <1000000>; > + regulator-max-microvolt = <1064000>; > + }; > + > + vreg_l4a: l4 { > + regulator-min-microvolt = <872000>; > + regulator-max-microvolt = <976000>; > + regulator-allow-set-load; > + }; > + > + vreg_l5a: l5 { > + regulator-min-microvolt = <1648000>; > + regulator-max-microvolt = <2950000>; > + regulator-allow-set-load; > + }; > + > + vreg_l6a: l6 { > + regulator-min-microvolt = <576000>; > + regulator-max-microvolt = <656000>; > + }; > + > + vreg_l7a: l7 { > + regulator-min-microvolt = <872000>; > + regulator-max-microvolt = <976000>; > + }; > + > + vreg_l8a: l8 { > + regulator-min-microvolt = <400000>; > + regulator-max-microvolt = <728000>; > + }; > + > + vreg_l9a: l9 { > + regulator-min-microvolt = <1800000>; > + regulator-max-microvolt = <1896000>; > + }; > + > + vreg_l10a: l10 { > + regulator-min-microvolt = <1800000>; > + regulator-max-microvolt = <1896000>; > + regulator-allow-set-load; > + }; > + > + vreg_l11a: l11 { > + regulator-min-microvolt = <1800000>; > + regulator-max-microvolt = <1952000>; > + regulator-allow-set-load; > + }; > + > + vreg_l12a: l12 { > + regulator-min-microvolt = <1800000>; > + regulator-max-microvolt = <1996000>; > + }; > + > + vreg_l13a: l13 { > + regulator-min-microvolt = <1800000>; > + regulator-max-microvolt = <1832000>; > + }; > + > + vreg_l14a: l14 { > + regulator-min-microvolt = <1800000>; > + regulator-max-microvolt = <1904000>; > + }; > + > + vreg_l15a: l15 { > + regulator-min-microvolt = <3104000>; > + regulator-max-microvolt = <3232000>; > + }; > + > + vreg_l16a: l16 { > + regulator-min-microvolt = <1800000>; > + regulator-max-microvolt = <1904000>; > + }; > + > + vreg_l17a: l17 { > + regulator-min-microvolt = <1248000>; > + regulator-max-microvolt = <1304000>; > + }; > + > + vreg_l18a: l18 { > + regulator-min-microvolt = <1200000>; > + regulator-max-microvolt = <1264000>; > + regulator-allow-set-load; > + }; > + > + vreg_l19a: l19 { > + regulator-min-microvolt = <1648000>; > + regulator-max-microvolt = <2952000>; > + }; > + > + vreg_l20a: l20 { > + regulator-min-microvolt = <1648000>; > + regulator-max-microvolt = <2952000>; > + }; > + > + vreg_l21a: l21 { > + regulator-min-microvolt = <2600000>; > + regulator-max-microvolt = <2856000>; > + }; > + > + vreg_l22a: l22 { > + regulator-min-microvolt = <2944000>; > + regulator-max-microvolt = <2950000>; > + regulator-allow-set-load; > + }; > + > + vreg_l23a: l23 { > + regulator-min-microvolt = <3000000>; > + regulator-max-microvolt = <3400000>; > + }; > + > + vreg_l24a: l24 { > + regulator-min-microvolt = <2944000>; > + regulator-max-microvolt = <2950000>; > + regulator-allow-set-load; > + }; > + }; > +}; > + > +&sdc2_off_state { > + sd-cd-pins { > + pins = "gpio98"; > + function = "gpio"; > + drive-strength = <2>; > + bias-disable; > + }; > +}; > + > +&sdc2_on_state { > + sd-cd-pins { > + pins = "gpio98"; > + function = "gpio"; > + drive-strength = <2>; > + bias-pull-up; > + }; > +}; > + > +&sdhc_2 { > + cd-gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>; > + vmmc-supply = <&vreg_l22a>; > + vqmmc-supply = <&vreg_l5a>; > + no-sdio; > + no-mmc; > + status = "okay"; > +}; > + > +&tlmm { > + gpio-reserved-ranges = <22 2>, <28 6>; > +}; > + > +&ufs_mem_hc { > + vcc-supply = <&vreg_l24a>; > + vccq2-supply = <&vreg_l11a>; > + vcc-max-microamp = <600000>; > + vccq2-max-microamp = <600000>; > + status = "okay"; > +}; > + > +&ufs_mem_phy { > + vdda-phy-supply = <&vreg_l4a>; > + vdda-pll-supply = <&vreg_l10a>; > + vdda-phy-max-microamp = <51400>; > + vdda-pll-max-microamp = <14200>; > + vddp-ref-clk-supply = <&vreg_l18a>; > + status = "okay"; > +}; > + > +&usb3 { > + status = "okay"; > +}; > + > +&usb3_dwc3 { > + extcon = <&extcon_usb>; > +};