2023-03-25 12:28:01

by Vinod Koul

[permalink] [raw]
Subject: [PATCH v2 00/12] Introduce the SC8180x devices

This introduces Qualcomm SC8180x SoC which features in Lenovo Flex 5G
laptop. This also adds support for Primus platform as well as Lenovo Flex 5G
laptop.

I would be great if submaintainers can ack the binding patch so that
everything can go thru qcom tree

Changes in v2:
- Fix the ufs pcie and phy bindings
- Lots of error fixes for dtbs_check
- Add few more missing compatiables

Bjorn Andersson (3):
arm64: dts: qcom: Introduce the SC8180x platform
arm64: dts: qcom: sc8180x: Introduce Primus
arm64: dts: qcom: sc8180x: Introduce Lenovo Flex 5G

Vinod Koul (9):
dt-bindings: firmware: document Qualcomm SC8180X SCM
dt-bindings: PCI: qcom: Document sc8180x properties
dt-bindings: phy: qcom,qmp-pcie: fix the sc8180x regs
dt-bindings: usb: qcom,dwc3: Add SC8180x binding
dt-bindings: interconnect: split SC8180x to own schema
scsi: ufs: dt-bindings: Add SC8180x binding
dt-bindings: phy: qcom,qmp-ufs: fix the sc8180x regs
regulator: dt-bindings: qcom,rpmh: Add compatible for PMC8180
dt-bindings: qcom,pdc: Add SC8180x compatible

.../bindings/firmware/qcom,scm.yaml | 1 +
.../bindings/interconnect/qcom,rpmh.yaml | 11 -
.../interconnect/qcom,sc8180x-rpmh.yaml | 76 +
.../interrupt-controller/qcom,pdc.yaml | 1 +
.../devicetree/bindings/pci/qcom,pcie.yaml | 49 +-
.../phy/qcom,ipq8074-qmp-pcie-phy.yaml | 2 +-
.../phy/qcom,msm8996-qmp-ufs-phy.yaml | 18 +-
.../regulator/qcom,rpmh-regulator.yaml | 4 +
.../devicetree/bindings/ufs/qcom,ufs.yaml | 2 +
.../devicetree/bindings/usb/qcom,dwc3.yaml | 2 +
arch/arm64/boot/dts/qcom/Makefile | 2 +
.../boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 590 +++
arch/arm64/boot/dts/qcom/sc8180x-pmics.dtsi | 326 ++
arch/arm64/boot/dts/qcom/sc8180x-primus.dts | 706 +++
arch/arm64/boot/dts/qcom/sc8180x.dtsi | 3950 +++++++++++++++++
15 files changed, 5709 insertions(+), 31 deletions(-)
create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sc8180x-rpmh.yaml
create mode 100644 arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
create mode 100644 arch/arm64/boot/dts/qcom/sc8180x-pmics.dtsi
create mode 100644 arch/arm64/boot/dts/qcom/sc8180x-primus.dts
create mode 100644 arch/arm64/boot/dts/qcom/sc8180x.dtsi

--
2.39.2


2023-03-25 12:28:15

by Vinod Koul

[permalink] [raw]
Subject: [PATCH v2 12/12] arm64: dts: qcom: sc8180x: Introduce Lenovo Flex 5G

From: Bjorn Andersson <[email protected]>

Introduce support for the Lenovo Flex 5G laptop, built on the Qualcomm
SC8180X platform. Supported peripherals includes keyboard, touchpad,
UFS storage, external USB and WiFi.

Signed-off-by: Bjorn Andersson <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
---
arch/arm64/boot/dts/qcom/Makefile | 1 +
.../boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 590 ++++++++++++++++++
2 files changed, 591 insertions(+)
create mode 100644 arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts

diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index fdce44a7a902..f096561f711e 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -141,6 +141,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sc7280-herobrine-zombie-nvme-lte.dtb
dtb-$(CONFIG_ARCH_QCOM) += sc7280-idp.dtb
dtb-$(CONFIG_ARCH_QCOM) += sc7280-idp2.dtb
dtb-$(CONFIG_ARCH_QCOM) += sc7280-crd-r3.dtb
+dtb-$(CONFIG_ARCH_QCOM) += sc8180x-lenovo-flex-5g.dtb
dtb-$(CONFIG_ARCH_QCOM) += sc8180x-primus.dtb
dtb-$(CONFIG_ARCH_QCOM) += sc8280xp-crd.dtb
dtb-$(CONFIG_ARCH_QCOM) += sc8280xp-lenovo-thinkpad-x13s.dtb
diff --git a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
new file mode 100644
index 000000000000..76dad608fb85
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
@@ -0,0 +1,590 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2020-2023, Linaro Limited
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/gpio-keys.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include "sc8180x.dtsi"
+#include "sc8180x-pmics.dtsi"
+
+/ {
+ model = "Lenovo Flex 5G";
+ compatible = "lenovo,flex-5g", "qcom,sc8180x";
+
+ aliases {
+ serial0 = &uart13;
+ };
+
+ backlight: backlight {
+ compatible = "pwm-backlight";
+ pwms = <&pmc8180c_lpg 4 1000000>;
+ enable-gpios = <&pmc8180c_gpios 8 GPIO_ACTIVE_HIGH>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&bl_pwm_default>;
+ };
+
+ chosen {
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&hall_int_active_state>;
+
+ lid {
+ gpios = <&tlmm 121 GPIO_ACTIVE_LOW>;
+ linux,input-type = <EV_SW>;
+ linux,code = <SW_LID>;
+ wakeup-source;
+ wakeup-event-action = <EV_ACT_DEASSERTED>;
+ };
+ };
+
+ reserved-memory {
+ rmtfs_mem: rmtfs-region@85500000 {
+ compatible = "qcom,rmtfs-mem";
+ reg = <0x0 0x85500000 0x0 0x200000>;
+ no-map;
+
+ qcom,client-id = <1>;
+ qcom,vmid = <15>;
+ };
+
+ wlan_mem: wlan-region@8bc00000 {
+ reg = <0x0 0x8bc00000 0x0 0x180000>;
+ no-map;
+ };
+
+ mpss_mem: mpss-region@8d800000 {
+ reg = <0x0 0x8d800000 0x0 0x3000000>;
+ no-map;
+ };
+
+ adsp_mem: adsp-region@90800000 {
+ reg = <0x0 0x90800000 0x0 0x1c00000>;
+ no-map;
+ };
+
+ gpu_mem: gpu-region@98715000 {
+ reg = <0x0 0x98715000 0x0 0x2000>;
+ no-map;
+ };
+
+ cdsp_mem: cdsp-region@98900000 {
+ reg = <0x0 0x98900000 0x0 0x1400000>;
+ no-map;
+ };
+ };
+
+ vph_pwr: vph-pwr-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vph_pwr";
+ regulator-min-microvolt = <3700000>;
+ regulator-max-microvolt = <3700000>;
+ };
+
+ vreg_s4a_1p8: pm8150-s4-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vreg_s4a_1p8";
+
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+
+ regulator-always-on;
+ regulator-boot-on;
+
+ vin-supply = <&vph_pwr>;
+ };
+};
+
+&apps_rsc {
+ pmc8180-a-rpmh-regulators {
+ compatible = "qcom,pmc8180-rpmh-regulators";
+ qcom,pmic-id = "a";
+
+ vdd-s5-supply = <&vph_pwr>;
+ vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p0>;
+
+ vreg_s5a_2p0: smps5 {
+ regulator-min-microvolt = <2040000>;
+ regulator-max-microvolt = <2100000>;
+ };
+
+ vreg_l7a_1p8: ldo7 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l9a_1p3: ldo9 {
+ regulator-min-microvolt = <1296000>;
+ regulator-max-microvolt = <1304000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l12a_1p8: ldo12 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+ };
+
+ pmc8180c-rpmh-regulators {
+ compatible = "qcom,pmc8180c-rpmh-regulators";
+ qcom,pmic-id = "c";
+
+ vdd-s6-supply = <&vph_pwr>;
+ vdd-l2-l3-supply = <&vreg_s6c_1p35>;
+ vdd-bob-supply = <&vph_pwr>;
+
+ vreg_s6c_1p35: smps6 {
+ regulator-min-microvolt = <1350000>;
+ regulator-max-microvolt = <1372000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l3c_1p2: ldo3 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l10c_3p3: ldo10 {
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3312000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l11c_3p3: ldo11 {
+ regulator-min-microvolt = <3296000>;
+ regulator-max-microvolt = <3304000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_bob: bob {
+ regulator-min-microvolt = <3296000>;
+ regulator-max-microvolt = <3350000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+ };
+
+ pmc8180-e-rpmh-regulators {
+ compatible = "qcom,pmc8180-rpmh-regulators";
+ qcom,pmic-id = "e";
+
+ vdd-s4-supply = <&vph_pwr>;
+ vdd-s5-supply = <&vph_pwr>;
+ vdd-l2-l10-supply = <&vreg_bob>;
+ vdd-l3-l4-l5-l18-supply = <&vreg_s4e_0p98>;
+ vdd-l7-l12-l14-l15-supply = <&vreg_s5e_2p05>;
+ vdd-l13-l16-l17-supply = <&vreg_bob>;
+
+ vreg_s4e_0p98: smps4 {
+ regulator-min-microvolt = <992000>;
+ regulator-max-microvolt = <992000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_s5e_2p05: smps5 {
+ regulator-min-microvolt = <2040000>;
+ regulator-max-microvolt = <2040000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l1e_0p75: ldo1 {
+ regulator-min-microvolt = <752000>;
+ regulator-max-microvolt = <752000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l5e_0p88: ldo5 {
+ regulator-min-microvolt = <880000>;
+ regulator-max-microvolt = <880000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l7e_1p8: ldo7 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l10e_2p9: ldo10 {
+ regulator-min-microvolt = <2904000>;
+ regulator-max-microvolt = <2904000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l16e_3p0: ldo16 {
+ regulator-min-microvolt = <3072000>;
+ regulator-max-microvolt = <3072000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+ };
+};
+
+&dispcc {
+ status = "okay";
+};
+
+&gpu {
+ status = "okay";
+
+ zap-shader {
+ memory-region = <&gpu_mem>;
+ firmware-name = "qcom/sc8180x/qcdxkmsuc8180.mbn";
+ };
+};
+
+&i2c1 {
+ clock-frequency = <100000>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c1_active>, <&i2c1_hid_active>;
+
+ status = "okay";
+
+ hid@10 {
+ compatible = "hid-over-i2c";
+ reg = <0x10>;
+ hid-descr-addr = <0x1>;
+
+ interrupts-extended = <&tlmm 122 IRQ_TYPE_LEVEL_LOW>;
+ };
+};
+
+&i2c7 {
+ clock-frequency = <100000>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c7_active>, <&i2c7_hid_active>;
+
+ status = "okay";
+
+ hid@5 {
+ compatible = "hid-over-i2c";
+ reg = <0x5>;
+ hid-descr-addr = <0x20>;
+
+ interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_LOW>;
+ };
+
+ hid@2c {
+ compatible = "hid-over-i2c";
+ reg = <0x2c>;
+ hid-descr-addr = <0x20>;
+
+ interrupts-extended = <&tlmm 24 IRQ_TYPE_LEVEL_LOW>;
+ };
+};
+
+&mdss {
+ status = "okay";
+};
+
+&mdss_edp {
+ data-lanes = <0 1 2 3>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&edp_hpd_active>;
+
+ status = "okay";
+
+ aux-bus {
+ panel {
+ compatible = "edp-panel";
+ no-hpd;
+
+ backlight = <&backlight>;
+
+ ports {
+ port {
+ auo_b140han06_in: endpoint {
+ remote-endpoint = <&mdss_edp_out>;
+ };
+ };
+ };
+ };
+ };
+
+ ports {
+ port@1 {
+ reg = <1>;
+ mdss_edp_out: endpoint {
+ remote-endpoint = <&auo_b140han06_in>;
+ };
+ };
+ };
+};
+
+&pcie3 {
+ perst-gpio = <&tlmm 178 GPIO_ACTIVE_LOW>;
+ wake-gpio = <&tlmm 180 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pcie3_default_state>;
+
+ status = "okay";
+};
+
+&pcie3_phy {
+ vdda-phy-supply = <&vreg_l5e_0p88>;
+ vdda-pll-supply = <&vreg_l3c_1p2>;
+
+ status = "okay";
+};
+
+&pmc8180c_lpg {
+ status = "okay";
+};
+
+&qupv3_id_0 {
+ status = "okay";
+};
+
+&qupv3_id_1 {
+ status = "okay";
+};
+
+&qupv3_id_2 {
+ status = "okay";
+};
+
+&remoteproc_adsp {
+ memory-region = <&adsp_mem>;
+ firmware-name = "qcom/sc8180x/LENOVO/82AK/qcadsp8180.mbn";
+
+ status = "okay";
+};
+
+&remoteproc_cdsp {
+ memory-region = <&cdsp_mem>;
+ firmware-name = "qcom/sc8180x/LENOVO/82AK/qccdsp8180.mbn";
+
+ status = "okay";
+};
+
+&remoteproc_mpss {
+ memory-region = <&mpss_mem>;
+ firmware-name = "qcom/sc8180x/LENOVO/82AK/qcmpss8180_nm.mbn";
+
+ status = "okay";
+};
+
+&uart13 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart13_state>;
+
+ status = "okay";
+
+ bluetooth {
+ compatible = "qcom,wcn3998-bt";
+
+ vddio-supply = <&vreg_s4a_1p8>;
+ vddxo-supply = <&vreg_l7a_1p8>;
+ vddrf-supply = <&vreg_l9a_1p3>;
+ vddch0-supply = <&vreg_l11c_3p3>;
+ max-speed = <3200000>;
+ };
+};
+
+&ufs_mem_hc {
+ reset-gpios = <&tlmm 190 GPIO_ACTIVE_LOW>;
+
+ vcc-supply = <&vreg_l10e_2p9>;
+ vcc-max-microamp = <155000>;
+
+ vccq2-supply = <&vreg_l7e_1p8>;
+ vccq2-max-microamp = <425000>;
+
+ status = "okay";
+};
+
+&ufs_mem_phy {
+ vdda-phy-supply = <&vreg_l5e_0p88>;
+ vdda-pll-supply = <&vreg_l3c_1p2>;
+
+ status = "okay";
+};
+
+&usb_prim_hsphy {
+ vdda-pll-supply = <&vreg_l5e_0p88>;
+ vdda18-supply = <&vreg_l12a_1p8>;
+ vdda33-supply = <&vreg_l16e_3p0>;
+
+ status = "okay";
+};
+
+&usb_prim_qmpphy {
+ vdda-phy-supply = <&vreg_l3c_1p2>;
+ vdda-pll-supply = <&vreg_l5e_0p88>;
+
+ status = "okay";
+};
+
+&usb_prim {
+ status = "okay";
+};
+
+&usb_prim_dwc3 {
+ dr_mode = "host";
+};
+
+&usb_sec_hsphy {
+ vdda-pll-supply = <&vreg_l5e_0p88>;
+ vdda18-supply = <&vreg_l12a_1p8>;
+ vdda33-supply = <&vreg_l16e_3p0>;
+
+ status = "okay";
+};
+
+&usb_sec_qmpphy {
+ vdda-phy-supply = <&vreg_l3c_1p2>;
+ vdda-pll-supply = <&vreg_l5e_0p88>;
+
+ status = "okay";
+};
+
+&usb_sec {
+ status = "okay";
+};
+
+&usb_sec_dwc3 {
+ dr_mode = "host";
+};
+
+&wifi {
+ memory-region = <&wlan_mem>;
+
+ vdd-0.8-cx-mx-supply = <&vreg_l1e_0p75>;
+ vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
+ vdd-1.3-rfa-supply = <&vreg_l9a_1p3>;
+ vdd-3.3-ch0-supply = <&vreg_l11c_3p3>;
+ vdd-3.3-ch1-supply = <&vreg_l10c_3p3>;
+
+ status = "okay";
+};
+
+&xo_board_clk {
+ clock-frequency = <38400000>;
+};
+
+/* PINCTRL */
+
+&pmc8180c_gpios {
+ bl_pwm_default: bl-pwm-default-state {
+ en-pins {
+ pins = "gpio8";
+ function = "normal";
+ };
+
+ pwm-pins {
+ pins = "gpio10";
+ function = "func1";
+ };
+ };
+};
+
+&tlmm {
+ gpio-reserved-ranges = <0 4>, <47 4>, <126 4>;
+
+ edp_hpd_active: epd-hpd-active-state {
+ pins = "gpio10";
+ function = "edp_hot";
+ };
+
+ hall_int_active_state: hall-int-active-state {
+ pins = "gpio121";
+ function = "gpio";
+
+ input-enable;
+ bias-disable;
+ };
+
+ i2c1_active: i2c1-active-state {
+ pins = "gpio114", "gpio115";
+ function = "qup1";
+
+ bias-pull-up = <1>;
+ drive-strength = <2>;
+ };
+
+ i2c1_hid_active: i2c1-hid-active-state {
+ pins = "gpio122";
+ function = "gpio";
+
+ input-enable;
+ bias-pull-up;
+ drive-strength = <2>;
+ };
+
+ i2c7_active: i2c7-active-state {
+ pins = "gpio98", "gpio99";
+ function = "qup7";
+
+ bias-pull-up;
+ drive-strength = <2>;
+ };
+
+ i2c7_hid_active: i2c7-hid-active-state {
+ pins = "gpio37", "gpio24";
+ function = "gpio";
+
+ input-enable;
+ bias-pull-up;
+ drive-strength = <2>;
+ };
+
+ pcie3_default_state: pcie3-default-state {
+ clkreq-pins {
+ pins = "gpio179";
+ function = "pci_e3";
+ bias-pull-up;
+ };
+
+ reset-n-pins {
+ pins = "gpio178";
+ function = "gpio";
+
+ drive-strength = <2>;
+ output-low;
+ bias-pull-down;
+ };
+
+ wake-n-pins {
+ pins = "gpio180";
+ function = "gpio";
+
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+ };
+
+ uart13_state: uart13-state {
+ cts-pins {
+ pins = "gpio43";
+ function = "qup13";
+ bias-pull-down;
+ };
+
+ rts-tx-pins {
+ pins = "gpio44", "gpio45";
+ function = "qup13";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ rx-pins {
+ pins = "gpio46";
+ function = "qup13";
+ bias-pull-up;
+ };
+ };
+};
--
2.39.2

2023-03-25 12:41:40

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v2 12/12] arm64: dts: qcom: sc8180x: Introduce Lenovo Flex 5G



On 25.03.2023 13:24, Vinod Koul wrote:
> From: Bjorn Andersson <[email protected]>
>
> Introduce support for the Lenovo Flex 5G laptop, built on the Qualcomm
> SC8180X platform. Supported peripherals includes keyboard, touchpad,
> UFS storage, external USB and WiFi.
>
> Signed-off-by: Bjorn Andersson <[email protected]>
> Signed-off-by: Vinod Koul <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/Makefile | 1 +
> .../boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 590 ++++++++++++++++++
> 2 files changed, 591 insertions(+)
> create mode 100644 arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
>
> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
> index fdce44a7a902..f096561f711e 100644
> --- a/arch/arm64/boot/dts/qcom/Makefile
> +++ b/arch/arm64/boot/dts/qcom/Makefile
> @@ -141,6 +141,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sc7280-herobrine-zombie-nvme-lte.dtb
> dtb-$(CONFIG_ARCH_QCOM) += sc7280-idp.dtb
> dtb-$(CONFIG_ARCH_QCOM) += sc7280-idp2.dtb
> dtb-$(CONFIG_ARCH_QCOM) += sc7280-crd-r3.dtb
> +dtb-$(CONFIG_ARCH_QCOM) += sc8180x-lenovo-flex-5g.dtb
> dtb-$(CONFIG_ARCH_QCOM) += sc8180x-primus.dtb
> dtb-$(CONFIG_ARCH_QCOM) += sc8280xp-crd.dtb
> dtb-$(CONFIG_ARCH_QCOM) += sc8280xp-lenovo-thinkpad-x13s.dtb
> diff --git a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
> new file mode 100644
> index 000000000000..76dad608fb85
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
> @@ -0,0 +1,590 @@
> +// SPDX-License-Identifier: BSD-3-Clause
> +/*
> + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
> + * Copyright (c) 2020-2023, Linaro Limited
> + */
> +
> +/dts-v1/;
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/gpio-keys.h>
> +#include <dt-bindings/input/input.h>
> +#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
> +#include "sc8180x.dtsi"
> +#include "sc8180x-pmics.dtsi"
> +
> +/ {
> + model = "Lenovo Flex 5G";
> + compatible = "lenovo,flex-5g", "qcom,sc8180x";
> +
> + aliases {
> + serial0 = &uart13;
> + };
> +
> + backlight: backlight {
> + compatible = "pwm-backlight";
> + pwms = <&pmc8180c_lpg 4 1000000>;
> + enable-gpios = <&pmc8180c_gpios 8 GPIO_ACTIVE_HIGH>;
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&bl_pwm_default>;
> + };
> +
> + chosen {
> + };
Unused, remove.

> +
> + gpio-keys {
> + compatible = "gpio-keys";
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&hall_int_active_state>;
property
property-names

> +
> + lid {
> + gpios = <&tlmm 121 GPIO_ACTIVE_LOW>;
> + linux,input-type = <EV_SW>;
> + linux,code = <SW_LID>;
> + wakeup-source;
> + wakeup-event-action = <EV_ACT_DEASSERTED>;
> + };
> + };
> +
> + reserved-memory {
> + rmtfs_mem: rmtfs-region@85500000 {
> + compatible = "qcom,rmtfs-mem";
> + reg = <0x0 0x85500000 0x0 0x200000>;
You're using 0 and 0x0 in a mixed fashion. Please stick with one,
preferably 0x0 everywhere.

> + no-map;
> +
> + qcom,client-id = <1>;
> + qcom,vmid = <15>;
> + };
> +
[...]

> +
> +&dispcc {
> + status = "okay";
Any reason for disabling dispcc by default?

> +};
> +
> +&gpu {
> + status = "okay";
> +
> + zap-shader {
> + memory-region = <&gpu_mem>;
> + firmware-name = "qcom/sc8180x/qcdxkmsuc8180.mbn";
> + };
> +};
> +
> +&i2c1 {
> + clock-frequency = <100000>;
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&i2c1_active>, <&i2c1_hid_active>;
property
property-names

> +
> + status = "okay";
> +
> + hid@10 {
> + compatible = "hid-over-i2c";
> + reg = <0x10>;
> + hid-descr-addr = <0x1>;
> +
> + interrupts-extended = <&tlmm 122 IRQ_TYPE_LEVEL_LOW>;
> + };
> +};
> +
> +&i2c7 {
> + clock-frequency = <100000>;
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&i2c7_active>, <&i2c7_hid_active>;
> +
> + status = "okay";
> +
> + hid@5 {
> + compatible = "hid-over-i2c";
> + reg = <0x5>;
> + hid-descr-addr = <0x20>;
> +
> + interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_LOW>;
> + };
> +
> + hid@2c {
> + compatible = "hid-over-i2c";
> + reg = <0x2c>;
> + hid-descr-addr = <0x20>;
> +
> + interrupts-extended = <&tlmm 24 IRQ_TYPE_LEVEL_LOW>;
> + };
> +};
> +
> +&mdss {
> + status = "okay";
> +};
> +
> +&mdss_edp {
> + data-lanes = <0 1 2 3>;
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&edp_hpd_active>;
> +
> + status = "okay";
> +
> + aux-bus {
> + panel {
> + compatible = "edp-panel";
> + no-hpd;
> +
> + backlight = <&backlight>;
> +
> + ports {
> + port {
> + auo_b140han06_in: endpoint {
> + remote-endpoint = <&mdss_edp_out>;
> + };
> + };
> + };
> + };
> + };
> +
> + ports {
> + port@1 {
> + reg = <1>;
> + mdss_edp_out: endpoint {
> + remote-endpoint = <&auo_b140han06_in>;
> + };
> + };
> + };
> +};
> +
> +&pcie3 {
> + perst-gpio = <&tlmm 178 GPIO_ACTIVE_LOW>;
> + wake-gpio = <&tlmm 180 GPIO_ACTIVE_HIGH>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&pcie3_default_state>;
> +
> + status = "okay";
> +};
> +
> +&pcie3_phy {
> + vdda-phy-supply = <&vreg_l5e_0p88>;
> + vdda-pll-supply = <&vreg_l3c_1p2>;
> +
> + status = "okay";
> +};
> +
> +&pmc8180c_lpg {
> + status = "okay";
> +};
> +
> +&qupv3_id_0 {
> + status = "okay";
> +};
> +
> +&qupv3_id_1 {
> + status = "okay";
> +};
> +
> +&qupv3_id_2 {
> + status = "okay";
> +};
> +
> +&remoteproc_adsp {
> + memory-region = <&adsp_mem>;
> + firmware-name = "qcom/sc8180x/LENOVO/82AK/qcadsp8180.mbn";
> +
> + status = "okay";
> +};
> +
> +&remoteproc_cdsp {
> + memory-region = <&cdsp_mem>;
> + firmware-name = "qcom/sc8180x/LENOVO/82AK/qccdsp8180.mbn";
> +
> + status = "okay";
> +};
> +
> +&remoteproc_mpss {
> + memory-region = <&mpss_mem>;
> + firmware-name = "qcom/sc8180x/LENOVO/82AK/qcmpss8180_nm.mbn";
> +
> + status = "okay";
> +};
> +
> +&uart13 {
> + pinctrl-names = "default";
> + pinctrl-0 = <&uart13_state>;
> +
> + status = "okay";
> +
> + bluetooth {
> + compatible = "qcom,wcn3998-bt";
> +
> + vddio-supply = <&vreg_s4a_1p8>;
> + vddxo-supply = <&vreg_l7a_1p8>;
> + vddrf-supply = <&vreg_l9a_1p3>;
> + vddch0-supply = <&vreg_l11c_3p3>;
> + max-speed = <3200000>;
> + };
> +};
> +
> +&ufs_mem_hc {
> + reset-gpios = <&tlmm 190 GPIO_ACTIVE_LOW>;
> +
> + vcc-supply = <&vreg_l10e_2p9>;
> + vcc-max-microamp = <155000>;
> +
> + vccq2-supply = <&vreg_l7e_1p8>;
> + vccq2-max-microamp = <425000>;
Missing regulator-allow-set-load for regulators that have current
ops assigned to them.

> +
> + status = "okay";
> +};
> +
> +&ufs_mem_phy {
> + vdda-phy-supply = <&vreg_l5e_0p88>;
> + vdda-pll-supply = <&vreg_l3c_1p2>;
> +
> + status = "okay";
> +};
> +
> +&usb_prim_hsphy {
> + vdda-pll-supply = <&vreg_l5e_0p88>;
> + vdda18-supply = <&vreg_l12a_1p8>;
> + vdda33-supply = <&vreg_l16e_3p0>;
> +
> + status = "okay";
> +};
> +
> +&usb_prim_qmpphy {
> + vdda-phy-supply = <&vreg_l3c_1p2>;
> + vdda-pll-supply = <&vreg_l5e_0p88>;
> +
> + status = "okay";
> +};
> +
> +&usb_prim {
We mostly use usb_1 / usb_2 for this

> + status = "okay";
> +};
> +
> +&usb_prim_dwc3 {
> + dr_mode = "host";
> +};
> +
> +&usb_sec_hsphy {
> + vdda-pll-supply = <&vreg_l5e_0p88>;
> + vdda18-supply = <&vreg_l12a_1p8>;
> + vdda33-supply = <&vreg_l16e_3p0>;
> +
> + status = "okay";
> +};
> +
> +&usb_sec_qmpphy {
> + vdda-phy-supply = <&vreg_l3c_1p2>;
> + vdda-pll-supply = <&vreg_l5e_0p88>;
> +
> + status = "okay";
> +};
> +
> +&usb_sec {
> + status = "okay";
> +};
> +
> +&usb_sec_dwc3 {
> + dr_mode = "host";
No roleswitching?

> +};
> +
> +&wifi {
> + memory-region = <&wlan_mem>;
It comes from the common dt file, so this may as well stay there.

Konrad
> +
> + vdd-0.8-cx-mx-supply = <&vreg_l1e_0p75>;
> + vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
> + vdd-1.3-rfa-supply = <&vreg_l9a_1p3>;
> + vdd-3.3-ch0-supply = <&vreg_l11c_3p3>;
> + vdd-3.3-ch1-supply = <&vreg_l10c_3p3>;
> +
> + status = "okay";
> +};
> +
> +&xo_board_clk {
> + clock-frequency = <38400000>;
> +};
> +
> +/* PINCTRL */
> +
> +&pmc8180c_gpios {
> + bl_pwm_default: bl-pwm-default-state {
> + en-pins {
> + pins = "gpio8";
> + function = "normal";
> + };
> +
> + pwm-pins {
> + pins = "gpio10";
> + function = "func1";
> + };
> + };
> +};
> +
> +&tlmm {
> + gpio-reserved-ranges = <0 4>, <47 4>, <126 4>;
> +
> + edp_hpd_active: epd-hpd-active-state {
> + pins = "gpio10";
> + function = "edp_hot";
> + };
> +
> + hall_int_active_state: hall-int-active-state {
> + pins = "gpio121";
> + function = "gpio";
> +
> + input-enable;
> + bias-disable;
> + };
> +
> + i2c1_active: i2c1-active-state {
> + pins = "gpio114", "gpio115";
> + function = "qup1";
> +
> + bias-pull-up = <1>;
> + drive-strength = <2>;
> + };
> +
> + i2c1_hid_active: i2c1-hid-active-state {
> + pins = "gpio122";
> + function = "gpio";
> +
> + input-enable;
> + bias-pull-up;
> + drive-strength = <2>;
> + };
> +
> + i2c7_active: i2c7-active-state {
> + pins = "gpio98", "gpio99";
> + function = "qup7";
> +
> + bias-pull-up;
> + drive-strength = <2>;
> + };
> +
> + i2c7_hid_active: i2c7-hid-active-state {
> + pins = "gpio37", "gpio24";
> + function = "gpio";
> +
> + input-enable;
> + bias-pull-up;
> + drive-strength = <2>;
> + };
> +
> + pcie3_default_state: pcie3-default-state {
> + clkreq-pins {
> + pins = "gpio179";
> + function = "pci_e3";
> + bias-pull-up;
> + };
> +
> + reset-n-pins {
> + pins = "gpio178";
> + function = "gpio";
> +
> + drive-strength = <2>;
> + output-low;
> + bias-pull-down;
> + };
> +
> + wake-n-pins {
> + pins = "gpio180";
> + function = "gpio";
> +
> + drive-strength = <2>;
> + bias-pull-up;
> + };
> + };
> +
> + uart13_state: uart13-state {
> + cts-pins {
> + pins = "gpio43";
> + function = "qup13";
> + bias-pull-down;
> + };
> +
> + rts-tx-pins {
> + pins = "gpio44", "gpio45";
> + function = "qup13";
> + drive-strength = <2>;
> + bias-disable;
> + };
> +
> + rx-pins {
> + pins = "gpio46";
> + function = "qup13";
> + bias-pull-up;
> + };
> + };
> +};

2023-03-27 05:44:52

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH v2 12/12] arm64: dts: qcom: sc8180x: Introduce Lenovo Flex 5G

On 25-03-23, 13:40, Konrad Dybcio wrote:
>
>
> On 25.03.2023 13:24, Vinod Koul wrote:
> > From: Bjorn Andersson <[email protected]>
> >
> > Introduce support for the Lenovo Flex 5G laptop, built on the Qualcomm
> > SC8180X platform. Supported peripherals includes keyboard, touchpad,
> > UFS storage, external USB and WiFi.
> >
> > Signed-off-by: Bjorn Andersson <[email protected]>
> > Signed-off-by: Vinod Koul <[email protected]>
> > ---
> > arch/arm64/boot/dts/qcom/Makefile | 1 +
> > .../boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 590 ++++++++++++++++++
> > 2 files changed, 591 insertions(+)
> > create mode 100644 arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
> >
> > diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
> > index fdce44a7a902..f096561f711e 100644
> > --- a/arch/arm64/boot/dts/qcom/Makefile
> > +++ b/arch/arm64/boot/dts/qcom/Makefile
> > @@ -141,6 +141,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sc7280-herobrine-zombie-nvme-lte.dtb
> > dtb-$(CONFIG_ARCH_QCOM) += sc7280-idp.dtb
> > dtb-$(CONFIG_ARCH_QCOM) += sc7280-idp2.dtb
> > dtb-$(CONFIG_ARCH_QCOM) += sc7280-crd-r3.dtb
> > +dtb-$(CONFIG_ARCH_QCOM) += sc8180x-lenovo-flex-5g.dtb
> > dtb-$(CONFIG_ARCH_QCOM) += sc8180x-primus.dtb
> > dtb-$(CONFIG_ARCH_QCOM) += sc8280xp-crd.dtb
> > dtb-$(CONFIG_ARCH_QCOM) += sc8280xp-lenovo-thinkpad-x13s.dtb
> > diff --git a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
> > new file mode 100644
> > index 000000000000..76dad608fb85
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
> > @@ -0,0 +1,590 @@
> > +// SPDX-License-Identifier: BSD-3-Clause
> > +/*
> > + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
> > + * Copyright (c) 2020-2023, Linaro Limited
> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include <dt-bindings/gpio/gpio.h>
> > +#include <dt-bindings/input/gpio-keys.h>
> > +#include <dt-bindings/input/input.h>
> > +#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
> > +#include "sc8180x.dtsi"
> > +#include "sc8180x-pmics.dtsi"
> > +
> > +/ {
> > + model = "Lenovo Flex 5G";
> > + compatible = "lenovo,flex-5g", "qcom,sc8180x";
> > +
> > + aliases {
> > + serial0 = &uart13;
> > + };
> > +
> > + backlight: backlight {
> > + compatible = "pwm-backlight";
> > + pwms = <&pmc8180c_lpg 4 1000000>;
> > + enable-gpios = <&pmc8180c_gpios 8 GPIO_ACTIVE_HIGH>;
> > +
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&bl_pwm_default>;
> > + };
> > +
> > + chosen {
> > + };
> Unused, remove.

ok

>
> > +
> > + gpio-keys {
> > + compatible = "gpio-keys";
> > +
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&hall_int_active_state>;
> property
> property-names

ack here and everwhere else

>
> > +
> > + lid {
> > + gpios = <&tlmm 121 GPIO_ACTIVE_LOW>;
> > + linux,input-type = <EV_SW>;
> > + linux,code = <SW_LID>;
> > + wakeup-source;
> > + wakeup-event-action = <EV_ACT_DEASSERTED>;
> > + };
> > + };
> > +
> > + reserved-memory {
> > + rmtfs_mem: rmtfs-region@85500000 {
> > + compatible = "qcom,rmtfs-mem";
> > + reg = <0x0 0x85500000 0x0 0x200000>;
> You're using 0 and 0x0 in a mixed fashion. Please stick with one,
> preferably 0x0 everywhere.

yep

>
> > + no-map;
> > +
> > + qcom,client-id = <1>;
> > + qcom,vmid = <15>;
> > + };
> > +
> [...]
>
> > +
> > +&dispcc {
> > + status = "okay";
> Any reason for disabling dispcc by default?

I think that is a good question. I would prefer disabling and enabling
in places it is required, we might have a headless system or a dev board
where we dont have display..?

>
> > +};
> > +
> > +&gpu {
> > + status = "okay";
> > +
> > + zap-shader {
> > + memory-region = <&gpu_mem>;
> > + firmware-name = "qcom/sc8180x/qcdxkmsuc8180.mbn";
> > + };
> > +};
> > +
> > +&i2c1 {
> > + clock-frequency = <100000>;
> > +
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&i2c1_active>, <&i2c1_hid_active>;
> property
> property-names
>
> > +
> > + status = "okay";
> > +
> > + hid@10 {
> > + compatible = "hid-over-i2c";
> > + reg = <0x10>;
> > + hid-descr-addr = <0x1>;
> > +
> > + interrupts-extended = <&tlmm 122 IRQ_TYPE_LEVEL_LOW>;
> > + };
> > +};
> > +
> > +&i2c7 {
> > + clock-frequency = <100000>;
> > +
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&i2c7_active>, <&i2c7_hid_active>;
> > +
> > + status = "okay";
> > +
> > + hid@5 {
> > + compatible = "hid-over-i2c";
> > + reg = <0x5>;
> > + hid-descr-addr = <0x20>;
> > +
> > + interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_LOW>;
> > + };
> > +
> > + hid@2c {
> > + compatible = "hid-over-i2c";
> > + reg = <0x2c>;
> > + hid-descr-addr = <0x20>;
> > +
> > + interrupts-extended = <&tlmm 24 IRQ_TYPE_LEVEL_LOW>;
> > + };
> > +};
> > +
> > +&mdss {
> > + status = "okay";
> > +};
> > +
> > +&mdss_edp {
> > + data-lanes = <0 1 2 3>;
> > +
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&edp_hpd_active>;
> > +
> > + status = "okay";
> > +
> > + aux-bus {
> > + panel {
> > + compatible = "edp-panel";
> > + no-hpd;
> > +
> > + backlight = <&backlight>;
> > +
> > + ports {
> > + port {
> > + auo_b140han06_in: endpoint {
> > + remote-endpoint = <&mdss_edp_out>;
> > + };
> > + };
> > + };
> > + };
> > + };
> > +
> > + ports {
> > + port@1 {
> > + reg = <1>;
> > + mdss_edp_out: endpoint {
> > + remote-endpoint = <&auo_b140han06_in>;
> > + };
> > + };
> > + };
> > +};
> > +
> > +&pcie3 {
> > + perst-gpio = <&tlmm 178 GPIO_ACTIVE_LOW>;
> > + wake-gpio = <&tlmm 180 GPIO_ACTIVE_HIGH>;
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&pcie3_default_state>;
> > +
> > + status = "okay";
> > +};
> > +
> > +&pcie3_phy {
> > + vdda-phy-supply = <&vreg_l5e_0p88>;
> > + vdda-pll-supply = <&vreg_l3c_1p2>;
> > +
> > + status = "okay";
> > +};
> > +
> > +&pmc8180c_lpg {
> > + status = "okay";
> > +};
> > +
> > +&qupv3_id_0 {
> > + status = "okay";
> > +};
> > +
> > +&qupv3_id_1 {
> > + status = "okay";
> > +};
> > +
> > +&qupv3_id_2 {
> > + status = "okay";
> > +};
> > +
> > +&remoteproc_adsp {
> > + memory-region = <&adsp_mem>;
> > + firmware-name = "qcom/sc8180x/LENOVO/82AK/qcadsp8180.mbn";
> > +
> > + status = "okay";
> > +};
> > +
> > +&remoteproc_cdsp {
> > + memory-region = <&cdsp_mem>;
> > + firmware-name = "qcom/sc8180x/LENOVO/82AK/qccdsp8180.mbn";
> > +
> > + status = "okay";
> > +};
> > +
> > +&remoteproc_mpss {
> > + memory-region = <&mpss_mem>;
> > + firmware-name = "qcom/sc8180x/LENOVO/82AK/qcmpss8180_nm.mbn";
> > +
> > + status = "okay";
> > +};
> > +
> > +&uart13 {
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&uart13_state>;
> > +
> > + status = "okay";
> > +
> > + bluetooth {
> > + compatible = "qcom,wcn3998-bt";
> > +
> > + vddio-supply = <&vreg_s4a_1p8>;
> > + vddxo-supply = <&vreg_l7a_1p8>;
> > + vddrf-supply = <&vreg_l9a_1p3>;
> > + vddch0-supply = <&vreg_l11c_3p3>;
> > + max-speed = <3200000>;
> > + };
> > +};
> > +
> > +&ufs_mem_hc {
> > + reset-gpios = <&tlmm 190 GPIO_ACTIVE_LOW>;
> > +
> > + vcc-supply = <&vreg_l10e_2p9>;
> > + vcc-max-microamp = <155000>;
> > +
> > + vccq2-supply = <&vreg_l7e_1p8>;
> > + vccq2-max-microamp = <425000>;
> Missing regulator-allow-set-load for regulators that have current
> ops assigned to them.
>
> > +
> > + status = "okay";
> > +};
> > +
> > +&ufs_mem_phy {
> > + vdda-phy-supply = <&vreg_l5e_0p88>;
> > + vdda-pll-supply = <&vreg_l3c_1p2>;
> > +
> > + status = "okay";
> > +};
> > +
> > +&usb_prim_hsphy {
> > + vdda-pll-supply = <&vreg_l5e_0p88>;
> > + vdda18-supply = <&vreg_l12a_1p8>;
> > + vdda33-supply = <&vreg_l16e_3p0>;
> > +
> > + status = "okay";
> > +};
> > +
> > +&usb_prim_qmpphy {
> > + vdda-phy-supply = <&vreg_l3c_1p2>;
> > + vdda-pll-supply = <&vreg_l5e_0p88>;
> > +
> > + status = "okay";
> > +};
> > +
> > +&usb_prim {
> We mostly use usb_1 / usb_2 for this

Isnt this better from readablity pov? esp since this is board dts

>
> > + status = "okay";
> > +};
> > +
> > +&usb_prim_dwc3 {
> > + dr_mode = "host";
> > +};
> > +
> > +&usb_sec_hsphy {
> > + vdda-pll-supply = <&vreg_l5e_0p88>;
> > + vdda18-supply = <&vreg_l12a_1p8>;
> > + vdda33-supply = <&vreg_l16e_3p0>;
> > +
> > + status = "okay";
> > +};
> > +
> > +&usb_sec_qmpphy {
> > + vdda-phy-supply = <&vreg_l3c_1p2>;
> > + vdda-pll-supply = <&vreg_l5e_0p88>;
> > +
> > + status = "okay";
> > +};
> > +
> > +&usb_sec {
> > + status = "okay";
> > +};
> > +
> > +&usb_sec_dwc3 {
> > + dr_mode = "host";
> No roleswitching?

Laptop :-) Always in host mode

>
> > +};
> > +
> > +&wifi {
> > + memory-region = <&wlan_mem>;
> It comes from the common dt file, so this may as well stay there.

I can do that

--
~Vinod

2023-03-27 07:52:20

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 00/12] Introduce the SC8180x devices

On 25/03/2023 13:24, Vinod Koul wrote:
> This introduces Qualcomm SC8180x SoC which features in Lenovo Flex 5G
> laptop. This also adds support for Primus platform as well as Lenovo Flex 5G
> laptop.
>
> I would be great if submaintainers can ack the binding patch so that
> everything can go thru qcom tree

I think Bjorn recently was rejecting taking bindings patches, so what
changed?

Best regards,
Krzysztof

2023-03-27 08:56:28

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v2 12/12] arm64: dts: qcom: sc8180x: Introduce Lenovo Flex 5G



On 27.03.2023 07:43, Vinod Koul wrote:
> On 25-03-23, 13:40, Konrad Dybcio wrote:
>>
>>
>> On 25.03.2023 13:24, Vinod Koul wrote:
>>> From: Bjorn Andersson <[email protected]>
>>>
>>> Introduce support for the Lenovo Flex 5G laptop, built on the Qualcomm
>>> SC8180X platform. Supported peripherals includes keyboard, touchpad,
>>> UFS storage, external USB and WiFi.
>>>
>>> Signed-off-by: Bjorn Andersson <[email protected]>
>>> Signed-off-by: Vinod Koul <[email protected]>
>>> ---
>>> arch/arm64/boot/dts/qcom/Makefile | 1 +
>>> .../boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 590 ++++++++++++++++++
>>> 2 files changed, 591 insertions(+)
>>> create mode 100644 arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
>>> index fdce44a7a902..f096561f711e 100644
>>> --- a/arch/arm64/boot/dts/qcom/Makefile
>>> +++ b/arch/arm64/boot/dts/qcom/Makefile
>>> @@ -141,6 +141,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sc7280-herobrine-zombie-nvme-lte.dtb
>>> dtb-$(CONFIG_ARCH_QCOM) += sc7280-idp.dtb
>>> dtb-$(CONFIG_ARCH_QCOM) += sc7280-idp2.dtb
>>> dtb-$(CONFIG_ARCH_QCOM) += sc7280-crd-r3.dtb
>>> +dtb-$(CONFIG_ARCH_QCOM) += sc8180x-lenovo-flex-5g.dtb
>>> dtb-$(CONFIG_ARCH_QCOM) += sc8180x-primus.dtb
>>> dtb-$(CONFIG_ARCH_QCOM) += sc8280xp-crd.dtb
>>> dtb-$(CONFIG_ARCH_QCOM) += sc8280xp-lenovo-thinkpad-x13s.dtb
>>> diff --git a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
>>> new file mode 100644
>>> index 000000000000..76dad608fb85
>>> --- /dev/null
>>> +++ b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
>>> @@ -0,0 +1,590 @@
>>> +// SPDX-License-Identifier: BSD-3-Clause
>>> +/*
>>> + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
>>> + * Copyright (c) 2020-2023, Linaro Limited
>>> + */
>>> +
>>> +/dts-v1/;
>>> +
>>> +#include <dt-bindings/gpio/gpio.h>
>>> +#include <dt-bindings/input/gpio-keys.h>
>>> +#include <dt-bindings/input/input.h>
>>> +#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
>>> +#include "sc8180x.dtsi"
>>> +#include "sc8180x-pmics.dtsi"
>>> +
>>> +/ {
>>> + model = "Lenovo Flex 5G";
>>> + compatible = "lenovo,flex-5g", "qcom,sc8180x";
>>> +
>>> + aliases {
>>> + serial0 = &uart13;
>>> + };
>>> +
>>> + backlight: backlight {
>>> + compatible = "pwm-backlight";
>>> + pwms = <&pmc8180c_lpg 4 1000000>;
>>> + enable-gpios = <&pmc8180c_gpios 8 GPIO_ACTIVE_HIGH>;
>>> +
>>> + pinctrl-names = "default";
>>> + pinctrl-0 = <&bl_pwm_default>;
>>> + };
>>> +
>>> + chosen {
>>> + };
>> Unused, remove.
>
> ok
>
>>
>>> +
>>> + gpio-keys {
>>> + compatible = "gpio-keys";
>>> +
>>> + pinctrl-names = "default";
>>> + pinctrl-0 = <&hall_int_active_state>;
>> property
>> property-names
>
> ack here and everwhere else
>
>>
>>> +
>>> + lid {
>>> + gpios = <&tlmm 121 GPIO_ACTIVE_LOW>;
>>> + linux,input-type = <EV_SW>;
>>> + linux,code = <SW_LID>;
>>> + wakeup-source;
>>> + wakeup-event-action = <EV_ACT_DEASSERTED>;
>>> + };
>>> + };
>>> +
>>> + reserved-memory {
>>> + rmtfs_mem: rmtfs-region@85500000 {
>>> + compatible = "qcom,rmtfs-mem";
>>> + reg = <0x0 0x85500000 0x0 0x200000>;
>> You're using 0 and 0x0 in a mixed fashion. Please stick with one,
>> preferably 0x0 everywhere.
>
> yep
>
>>
>>> + no-map;
>>> +
>>> + qcom,client-id = <1>;
>>> + qcom,vmid = <15>;
>>> + };
>>> +
>> [...]
>>
>>> +
>>> +&dispcc {
>>> + status = "okay";
>> Any reason for disabling dispcc by default?
>
> I think that is a good question. I would prefer disabling and enabling
> in places it is required, we might have a headless system or a dev board
> where we dont have display..?
It's a double-edged sword: on one side we could disable clocks that were
mistakenly enabled, but on the other hand we do keep some some clocks
always-on within that driver..

Perhaps leave it on by default and shut it off per-board if need be.

>
>>
>>> +};
>>> +
>>> +&gpu {
>>> + status = "okay";
>>> +
>>> + zap-shader {
>>> + memory-region = <&gpu_mem>;
>>> + firmware-name = "qcom/sc8180x/qcdxkmsuc8180.mbn";
>>> + };
>>> +};
>>> +
>>> +&i2c1 {
>>> + clock-frequency = <100000>;
>>> +
>>> + pinctrl-names = "default";
>>> + pinctrl-0 = <&i2c1_active>, <&i2c1_hid_active>;
>> property
>> property-names
>>
>>> +
>>> + status = "okay";
>>> +
>>> + hid@10 {
>>> + compatible = "hid-over-i2c";
>>> + reg = <0x10>;
>>> + hid-descr-addr = <0x1>;
>>> +
>>> + interrupts-extended = <&tlmm 122 IRQ_TYPE_LEVEL_LOW>;
>>> + };
>>> +};
>>> +
>>> +&i2c7 {
>>> + clock-frequency = <100000>;
>>> +
>>> + pinctrl-names = "default";
>>> + pinctrl-0 = <&i2c7_active>, <&i2c7_hid_active>;
>>> +
>>> + status = "okay";
>>> +
>>> + hid@5 {
>>> + compatible = "hid-over-i2c";
>>> + reg = <0x5>;
>>> + hid-descr-addr = <0x20>;
>>> +
>>> + interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_LOW>;
>>> + };
>>> +
>>> + hid@2c {
>>> + compatible = "hid-over-i2c";
>>> + reg = <0x2c>;
>>> + hid-descr-addr = <0x20>;
>>> +
>>> + interrupts-extended = <&tlmm 24 IRQ_TYPE_LEVEL_LOW>;
>>> + };
>>> +};
>>> +
>>> +&mdss {
>>> + status = "okay";
>>> +};
>>> +
>>> +&mdss_edp {
>>> + data-lanes = <0 1 2 3>;
>>> +
>>> + pinctrl-names = "default";
>>> + pinctrl-0 = <&edp_hpd_active>;
>>> +
>>> + status = "okay";
>>> +
>>> + aux-bus {
>>> + panel {
>>> + compatible = "edp-panel";
>>> + no-hpd;
>>> +
>>> + backlight = <&backlight>;
>>> +
>>> + ports {
>>> + port {
>>> + auo_b140han06_in: endpoint {
>>> + remote-endpoint = <&mdss_edp_out>;
>>> + };
>>> + };
>>> + };
>>> + };
>>> + };
>>> +
>>> + ports {
>>> + port@1 {
>>> + reg = <1>;
>>> + mdss_edp_out: endpoint {
>>> + remote-endpoint = <&auo_b140han06_in>;
>>> + };
>>> + };
>>> + };
>>> +};
>>> +
>>> +&pcie3 {
>>> + perst-gpio = <&tlmm 178 GPIO_ACTIVE_LOW>;
>>> + wake-gpio = <&tlmm 180 GPIO_ACTIVE_HIGH>;
>>> + pinctrl-names = "default";
>>> + pinctrl-0 = <&pcie3_default_state>;
>>> +
>>> + status = "okay";
>>> +};
>>> +
>>> +&pcie3_phy {
>>> + vdda-phy-supply = <&vreg_l5e_0p88>;
>>> + vdda-pll-supply = <&vreg_l3c_1p2>;
>>> +
>>> + status = "okay";
>>> +};
>>> +
>>> +&pmc8180c_lpg {
>>> + status = "okay";
>>> +};
>>> +
>>> +&qupv3_id_0 {
>>> + status = "okay";
>>> +};
>>> +
>>> +&qupv3_id_1 {
>>> + status = "okay";
>>> +};
>>> +
>>> +&qupv3_id_2 {
>>> + status = "okay";
>>> +};
>>> +
>>> +&remoteproc_adsp {
>>> + memory-region = <&adsp_mem>;
>>> + firmware-name = "qcom/sc8180x/LENOVO/82AK/qcadsp8180.mbn";
>>> +
>>> + status = "okay";
>>> +};
>>> +
>>> +&remoteproc_cdsp {
>>> + memory-region = <&cdsp_mem>;
>>> + firmware-name = "qcom/sc8180x/LENOVO/82AK/qccdsp8180.mbn";
>>> +
>>> + status = "okay";
>>> +};
>>> +
>>> +&remoteproc_mpss {
>>> + memory-region = <&mpss_mem>;
>>> + firmware-name = "qcom/sc8180x/LENOVO/82AK/qcmpss8180_nm.mbn";
>>> +
>>> + status = "okay";
>>> +};
>>> +
>>> +&uart13 {
>>> + pinctrl-names = "default";
>>> + pinctrl-0 = <&uart13_state>;
>>> +
>>> + status = "okay";
>>> +
>>> + bluetooth {
>>> + compatible = "qcom,wcn3998-bt";
>>> +
>>> + vddio-supply = <&vreg_s4a_1p8>;
>>> + vddxo-supply = <&vreg_l7a_1p8>;
>>> + vddrf-supply = <&vreg_l9a_1p3>;
>>> + vddch0-supply = <&vreg_l11c_3p3>;
>>> + max-speed = <3200000>;
>>> + };
>>> +};
>>> +
>>> +&ufs_mem_hc {
>>> + reset-gpios = <&tlmm 190 GPIO_ACTIVE_LOW>;
>>> +
>>> + vcc-supply = <&vreg_l10e_2p9>;
>>> + vcc-max-microamp = <155000>;
>>> +
>>> + vccq2-supply = <&vreg_l7e_1p8>;
>>> + vccq2-max-microamp = <425000>;
>> Missing regulator-allow-set-load for regulators that have current
>> ops assigned to them.
>>
>>> +
>>> + status = "okay";
>>> +};
>>> +
>>> +&ufs_mem_phy {
>>> + vdda-phy-supply = <&vreg_l5e_0p88>;
>>> + vdda-pll-supply = <&vreg_l3c_1p2>;
>>> +
>>> + status = "okay";
>>> +};
>>> +
>>> +&usb_prim_hsphy {
>>> + vdda-pll-supply = <&vreg_l5e_0p88>;
>>> + vdda18-supply = <&vreg_l12a_1p8>;
>>> + vdda33-supply = <&vreg_l16e_3p0>;
>>> +
>>> + status = "okay";
>>> +};
>>> +
>>> +&usb_prim_qmpphy {
>>> + vdda-phy-supply = <&vreg_l3c_1p2>;
>>> + vdda-pll-supply = <&vreg_l5e_0p88>;
>>> +
>>> + status = "okay";
>>> +};
>>> +
>>> +&usb_prim {
>> We mostly use usb_1 / usb_2 for this
>
> Isnt this better from readablity pov? esp since this is board dts
Generally both sound pretty reasonable but I'm just saying that
all other trees name this differently..

Konrad
>
>>
>>> + status = "okay";
>>> +};
>>> +
>>> +&usb_prim_dwc3 {
>>> + dr_mode = "host";
>>> +};
>>> +
>>> +&usb_sec_hsphy {
>>> + vdda-pll-supply = <&vreg_l5e_0p88>;
>>> + vdda18-supply = <&vreg_l12a_1p8>;
>>> + vdda33-supply = <&vreg_l16e_3p0>;
>>> +
>>> + status = "okay";
>>> +};
>>> +
>>> +&usb_sec_qmpphy {
>>> + vdda-phy-supply = <&vreg_l3c_1p2>;
>>> + vdda-pll-supply = <&vreg_l5e_0p88>;
>>> +
>>> + status = "okay";
>>> +};
>>> +
>>> +&usb_sec {
>>> + status = "okay";
>>> +};
>>> +
>>> +&usb_sec_dwc3 {
>>> + dr_mode = "host";
>> No roleswitching?
>
> Laptop :-) Always in host mode
>
>>
>>> +};
>>> +
>>> +&wifi {
>>> + memory-region = <&wlan_mem>;
>> It comes from the common dt file, so this may as well stay there.
>
> I can do that
>

2023-03-27 14:11:37

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v2 00/12] Introduce the SC8180x devices

On Mon, Mar 27, 2023 at 09:46:31AM +0200, Krzysztof Kozlowski wrote:
> On 25/03/2023 13:24, Vinod Koul wrote:
> > This introduces Qualcomm SC8180x SoC which features in Lenovo Flex 5G
> > laptop. This also adds support for Primus platform as well as Lenovo Flex 5G
> > laptop.
> >
> > I would be great if submaintainers can ack the binding patch so that
> > everything can go thru qcom tree
>
> I think Bjorn recently was rejecting taking bindings patches, so what
> changed?
>

Nothing changed. In the interest of reducing the risk for merge
conflicts I still think it's best if bindings goes via respective
maintainer trees; so patch 1 is for me...

Regards,
Bjorn

2023-03-27 14:26:16

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v2 12/12] arm64: dts: qcom: sc8180x: Introduce Lenovo Flex 5G

On Mon, Mar 27, 2023 at 10:51:38AM +0200, Konrad Dybcio wrote:
> On 27.03.2023 07:43, Vinod Koul wrote:
> > On 25-03-23, 13:40, Konrad Dybcio wrote:
> >> On 25.03.2023 13:24, Vinod Koul wrote:
> >>> From: Bjorn Andersson <[email protected]>
[..]
> >>> +&dispcc {
> >>> + status = "okay";
> >> Any reason for disabling dispcc by default?
> >
> > I think that is a good question. I would prefer disabling and enabling
> > in places it is required, we might have a headless system or a dev board
> > where we dont have display..?
> It's a double-edged sword: on one side we could disable clocks that were
> mistakenly enabled, but on the other hand we do keep some some clocks
> always-on within that driver..
>
> Perhaps leave it on by default and shut it off per-board if need be.
>

There is a little bit of overhead in keeping the clock controllers
enabled at all times, but I expect it to benefit us in that it would
ensure that any clocks that the bootloader might have left on will be
disabled.

So, I think we should go with enable by default and leave enabled.

Regards,
Bjorn

2023-04-03 15:29:39

by Mark Brown

[permalink] [raw]
Subject: Re: (subset) [PATCH v2 00/12] Introduce the SC8180x devices

On Sat, 25 Mar 2023 17:54:32 +0530, Vinod Koul wrote:
> This introduces Qualcomm SC8180x SoC which features in Lenovo Flex 5G
> laptop. This also adds support for Primus platform as well as Lenovo Flex 5G
> laptop.
>
> I would be great if submaintainers can ack the binding patch so that
> everything can go thru qcom tree
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[08/12] regulator: dt-bindings: qcom,rpmh: Add compatible for PMC8180
commit: fc4fef625decc80cf3a72e884a4e37288bfa0f9b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

2023-04-05 04:50:34

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH v2 00/12] Introduce the SC8180x devices

On Sat, 25 Mar 2023 17:54:32 +0530, Vinod Koul wrote:
> This introduces Qualcomm SC8180x SoC which features in Lenovo Flex 5G
> laptop. This also adds support for Primus platform as well as Lenovo Flex 5G
> laptop.
>
> I would be great if submaintainers can ack the binding patch so that
> everything can go thru qcom tree
>
> [...]

Applied, thanks!

[01/12] dt-bindings: firmware: document Qualcomm SC8180X SCM
commit: c78ad8597ed961e822bf86ce7f1916dbfba255ef

Best regards,
--
Bjorn Andersson <[email protected]>