Re: [PATCH 2/3] arm64: dts: qcom: sm8250-lenovo-j716f: Add initial device tree
From: Krzysztof Kozlowski
Date: Sun Nov 27 2022 - 14:04:02 EST
On 27/11/2022 18:08, David Wronek wrote:
> Add the initial device tree for Lenovo Xiaoxin Pad Pro 2021 based on
> Qualcomm SM8250 with the following features:
>
> - SimpleFB
> - GPIO keys
> - Regulators
> - I2C
> - UFS
> - USB
>
> Signed-off-by: David Wronek <davidwronek@xxxxxxxxx>
> ---
> arch/arm64/boot/dts/qcom/Makefile | 1 +
> .../boot/dts/qcom/sm8250-lenovo-j716f.dts | 561 ++++++++++++++++++
> 2 files changed, 562 insertions(+)
> create mode 100644 arch/arm64/boot/dts/qcom/sm8250-lenovo-j716f.dts
>
> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
> index afe496a93f94..c002f78144b6 100644
> --- a/arch/arm64/boot/dts/qcom/Makefile
> +++ b/arch/arm64/boot/dts/qcom/Makefile
> @@ -158,6 +158,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sm8150-mtp.dtb
> dtb-$(CONFIG_ARCH_QCOM) += sm8150-sony-xperia-kumano-bahamut.dtb
> dtb-$(CONFIG_ARCH_QCOM) += sm8150-sony-xperia-kumano-griffin.dtb
> dtb-$(CONFIG_ARCH_QCOM) += sm8250-hdk.dtb
> +dtb-$(CONFIG_ARCH_QCOM) += sm8250-lenovo-j716f.dtb
Thank you for your patch. There is something to discuss/improve.
> +/ {
> + model = "Lenovo Xiaoxin Pad Pro 2021";
> + compatible = "lenovo,j716f", "qcom,sm8250";
> + classis-type = "tablet";
> +
> + qcom,msm-id = <0x164 0x20001>;
> + qcom,board-id = <0x2010008 0>;
> +
> + chosen {
> + #address-cells = <2>;
> + #size-cells = <2>;
> + ranges;
> +
> + bootargs = "fw_devlink=permissive clk_ignore_unused pd_ignore_unused";
These do not belong to mainlined DTS.
> + stdout-path = "framebuffer0";
> +
> + framebuffer0: framebuffer@9c000000 {
> + compatible = "simple-framebuffer";
> + reg = <0 0x9c000000 0 0x2300000>;
> + width = <2560>;
> + height = <1600>;
> + stride = <(2560 * 4)>;
> + format = "a8r8g8b8";
> + };
> + };
> +
> + gpio-keys {
> + compatible = "gpio-keys";
> +
> + key-vol-up {
> + label = "Volume Up";
> + linux,code = <KEY_VOLUMEUP>;
> + gpios = <&pm8150_gpios 6 GPIO_ACTIVE_LOW>;
> + debounce-interval = <15>;
> + };
> + };
> +
> + reserved-memory {
> + cont_splash_mem: memory@9c000000 {
> + reg = <0x0 0x9c000000 0x0 0x2300000>;
> + no-map;
> + };
> + };
> +
> + vph_pwr: vph-pwr-regulator {
> + compatible = "regulator-fixed";
> + regulator-name = "vph_pwr";
> + regulator-min-microvolt = <3700000>;
> + regulator-max-microvolt = <3700000>;
> + };
> +
> + /* S6c is really ebi.lvl but it's there for supply map completeness sake. */
> + vreg_s6c_0p88: smpc6-regulator {
> + compatible = "regulator-fixed";
> + regulator-name = "vreg_s6c_0p88";
> +
> + regulator-min-microvolt = <880000>;
> + regulator-max-microvolt = <880000>;
> + regulator-always-on;
> + vin-supply = <&vph_pwr>;
> + };
> +};
> +
> +&apps_rsc {
> + pm8150-rpmh-regulators {
Node name: regulators-0
(this should already complain with dtbs_check)
> + compatible = "qcom,pm8150-rpmh-regulators";
> + qcom,pmic-id = "a";
> +
> + vdd-s1-supply = <&vph_pwr>;
> + vdd-s2-supply = <&vph_pwr>;
> + vdd-s3-supply = <&vph_pwr>;
> + vdd-s4-supply = <&vph_pwr>;
> + vdd-s5-supply = <&vph_pwr>;
> + vdd-s6-supply = <&vph_pwr>;
> + vdd-s7-supply = <&vph_pwr>;
> + vdd-s8-supply = <&vph_pwr>;
> + vdd-s9-supply = <&vph_pwr>;
> + vdd-s10-supply = <&vph_pwr>;
> + vdd-l1-l8-l11-supply = <&vreg_s6c_0p88>;
> + vdd-l2-l10-supply = <&vreg_bob>;
> + vdd-l3-l4-l5-l18-supply = <&vreg_s6a_0p95>;
> + vdd-l6-l9-supply = <&vreg_s8c_1p35>;
> + vdd-l7-l12-l14-l15-supply = <&vreg_s5a_1p9>;
> + vdd-l13-l16-l17-supply = <&vreg_bob>;
> +
> + /* (S1+S2+S3) - cx.lvl (ARC) */
> +
> + vreg_s4a_1p8: smps4 {
> + regulator-name = "vreg_s4a_1p8";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1920000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_s5a_1p9: smps5 {
> + regulator-name = "vreg_s5a_1p9";
> + regulator-min-microvolt = <1900000>;
> + regulator-max-microvolt = <2040000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_s6a_0p95: smps6 {
> + regulator-name = "vreg_s6a_0p95";
> + regulator-min-microvolt = <950000>;
> + regulator-max-microvolt = <1128000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l2a_3p1: ldo2 {
> + regulator-name = "vreg_l2a_3p1";
> + regulator-min-microvolt = <3072000>;
> + regulator-max-microvolt = <3072000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l3a_0p93: ldo3 {
> + regulator-name = "vreg_l3a_0p93";
> + regulator-min-microvolt = <928000>;
> + regulator-max-microvolt = <932000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + /* L4 - lmx.lvl (ARC) */
> +
> + vreg_l5a_0p88: ldo5 {
> + regulator-name = "vreg_l5a_0p88";
> + regulator-min-microvolt = <880000>;
> + regulator-max-microvolt = <880000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l6a_1p2: ldo6 {
> + regulator-name = "vreg_l6a_1p2";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <1200000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l7a_1p7: ldo7 {
> + regulator-name = "vreg_l7a_1p7";
> + regulator-min-microvolt = <1704000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l9a_1p2: ldo9 {
> + regulator-name = "vreg_l9a_1p2";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <1200000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l10a_1p8: ldo10 {
> + regulator-name = "vreg_l10a_1p8";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <2960000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + /* L11 - lcx.lvl (ARC) */
> +
> + vreg_l12a_1p8: ldo12 {
> + regulator-name = "vreg_l12a_1p8";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l13a_3p0: ldo13 {
> + regulator-name = "vreg_l13a_3p0";
> + regulator-min-microvolt = <3008000>;
> + regulator-max-microvolt = <3008000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l14a_1p8: ldo14 {
> + regulator-name = "vreg_l14a_1p8";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1880000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l15a_1p8: ldo15 {
> + regulator-name = "vreg_l15a_1p8";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l16a_3p0: ldo16 {
> + regulator-name = "vreg_l16a_3p0";
> + regulator-min-microvolt = <3024000>;
> + regulator-max-microvolt = <3304000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l17a_2p5: ldo17 {
> + regulator-name = "vreg_l17a_2p5";
> + regulator-min-microvolt = <2496000>;
> + regulator-max-microvolt = <3008000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l18a_0p8: ldo18 {
> + regulator-name = "vreg_l18a_0p8";
> + regulator-min-microvolt = <800000>;
> + regulator-max-microvolt = <920000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> + };
> +
> + /*
> + * Remaining regulators that are not yet supported:
> + * OLEDB: 4925000-8100000
> + * ab: 4600000-6100000
> + * ibb: 800000-5400000
> + */
> +
> + pm8150l-rpmh-regulators {
Node name: regulators-1
> + compatible = "qcom,pm8150l-rpmh-regulators";
> + qcom,pmic-id = "c";
> +
> + vdd-s1-supply = <&vph_pwr>;
> + vdd-s2-supply = <&vph_pwr>;
> + vdd-s3-supply = <&vph_pwr>;
> + vdd-s4-supply = <&vph_pwr>;
> + vdd-s5-supply = <&vph_pwr>;
> + vdd-s6-supply = <&vph_pwr>;
> + vdd-s7-supply = <&vph_pwr>;
> + vdd-s8-supply = <&vph_pwr>;
> + vdd-l1-l8-supply = <&vreg_s4a_1p8>;
> + vdd-l2-l3-supply = <&vreg_s8c_1p35>;
> + vdd-l4-l5-l6-supply = <&vreg_bob>;
> + vdd-l7-l11-supply = <&vreg_bob>;
> + vdd-l9-l10-supply = <&vreg_bob>;
> + vdd-bob-supply = <&vph_pwr>;
> +
> + vreg_bob: bob {
> + regulator-name = "vreg_bob";
> + regulator-min-microvolt = <3008000>;
> + regulator-max-microvolt = <3960000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
> + };
> +
> + /*
> + * S1-S6 are ARCs:
> + * (S1+S2) - gfx.lvl,
> + * S3 - mx.lvl,
> + * (S4+S5) - mmcx.lvl,
> + * S6 - ebi.lvl
> + */
> +
> + vreg_s7c_0p35: smps7 {
> + regulator-name = "vreg_s7c_0p35";
> + regulator-min-microvolt = <348000>;
> + regulator-max-microvolt = <1000000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_s8c_1p35: smps8 {
> + regulator-name = "vreg_s8c_1p4";
> + regulator-min-microvolt = <1350000>;
> + regulator-max-microvolt = <1400000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l1c_1p8: ldo1 {
> + regulator-name = "vreg_l1c_1p8";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l2c_1p2: ldo2 {
> + regulator-name = "vreg_l2c_1p2";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <1304000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l3c_0p8: ldo3 {
> + regulator-name = "vreg_l3c_0p8";
> + regulator-min-microvolt = <800000>;
> + regulator-max-microvolt = <1200000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l4c_1p8: ldo4 {
> + regulator-name = "vreg_l4c_1p8";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l5c_1p8: ldo5 {
> + regulator-name = "vreg_l5c_1p8";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l6c_2p9: ldo6 {
> + regulator-name = "vreg_l6c_2p9";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <2960000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l7c_2p9: ldo7 {
> + regulator-name = "vreg_l7c_2p9";
> + regulator-min-microvolt = <2856000>;
> + regulator-max-microvolt = <3104000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l8c_1p8: ldo8 {
> + regulator-name = "vreg_l8c_1p8";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l9c_2p7: ldo9 {
> + regulator-name = "vreg_l9c_2p7";
> + regulator-min-microvolt = <2704000>;
> + regulator-max-microvolt = <2960000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l10c_3p0: ldo10 {
> + regulator-name = "vreg_l10c_3p0";
> + regulator-min-microvolt = <3000000>;
> + regulator-max-microvolt = <3312000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l11c_3p1: ldo11 {
> + regulator-name = "vreg_l11c_3p1";
> + regulator-min-microvolt = <3104000>;
> + regulator-max-microvolt = <3304000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> + };
> +
> + pm8009-rpmh-regulators {
Node name: regulators-2
> + compatible = "qcom,pm8009-rpmh-regulators";
> + qcom,pmic-id = "f";
> +
> + vdd-s1-supply = <&vph_pwr>;
> + vdd-s2-supply = <&vreg_bob>;
> + vdd-l2-supply = <&vreg_s8c_1p35>;
> + vdd-l5-l6-supply = <&vreg_bob>;
> + vdd-l7-supply = <&vreg_s4a_1p8>;
> +
> + vreg_s1f_1p2: smps1 {
> + regulator-name = "vreg_s1f_1p2";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <1200000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_s2f_0p5: smps2 {
> + regulator-name = "vreg_s2f_0p5";
> + regulator-min-microvolt = <512000>;
> + regulator-max-microvolt = <1100000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l1f_1p1: ldo1 {
> + regulator-name = "vreg_l1f_1p1";
> + regulator-min-microvolt = <1104000>;
> + regulator-max-microvolt = <1200000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l2f_1p2: ldo2 {
> + regulator-name = "vreg_l2f_1p2";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <1200000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l3f_1p1: ldo3 {
> + regulator-name = "vreg_l3f_1p1";
> + regulator-min-microvolt = <1056000>;
> + regulator-max-microvolt = <1200000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l4f_1p1: ldo4 {
> + regulator-name = "vreg_l4f_1p1";
> + regulator-min-microvolt = <1096000>;
> + regulator-max-microvolt = <1304000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l5f_2p8: ldo5 {
> + regulator-name = "vreg_l5f_2p8";
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <3000000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l6f_2p8: ldo6 {
> + regulator-name = "vreg_l6f_2p8";
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <3000000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> + vreg_l7f_1p8: ldo7 {
> + regulator-name = "vreg_l7f_1p8";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> + };
> +};
> +
> +&gpi_dma0 {
> + status = "okay";
> +};
> +
> +&gpi_dma1 {
> + status = "okay";
> +};
> +
> +&gpi_dma2 {
> + status = "okay";
> +};
> +
> +&i2c1 {
> + status = "okay";
> + clock-frequency = <1000000>;
> +
> + /* hid-over-i2c ptp @ 60 */
> +};
> +
> +&i2c3 {
> + status = "okay";
> + clock-frequency = <400000>;
> +
> + bq27541@55 {
Node names should be generic.
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
> + compatible = "ti,bq27541";
> + reg = <0x55>;
> + };
> +};
Best regards,
Krzysztof