mbox series

[00/10] SM6375/PDX225 GPI DMA, QUPs & PMIC peripherals

Message ID 20221109111236.46003-1-konrad.dybcio@linaro.org
Headers show
Series SM6375/PDX225 GPI DMA, QUPs & PMIC peripherals | expand

Message

Konrad Dybcio Nov. 9, 2022, 11:12 a.m. UTC
This series adds support for:

- GPI DMA for 6375
- QUP hosts & I2C / SPI controllers for 6375
- pinctrl for SOME (check commit message of 05/10) of ^
- pmk8350 on sid6 (rather sad implementation, check 03/10 commit msg)
- touchscreen & SMD regulators on PDX225 (depends on [1])
- pmic peripherals on PDX225

As well as some necessary binding changes with it.

Patches 1-8 can be applied right away, 9 and 10 depend on:

[1] https://lore.kernel.org/linux-arm-msm/20221109110846.45789-1-konrad.dybcio@linaro.org/T/#t

Konrad Dybcio (10):
  dt-bindings: arm-smmu: Allow up to 3 power-domains
  dt-bindings: dmaengine: qcom: gpi: add compatible for SM6375
  arm64: dts: qcom: Add a device tree for PMK8350 on SID6
  arm64: dts: qcom: sm6375: Add GPI DMA nodes
  arm64: dts: qcom: sm6375: Add pin configs for some QUP configurations
  arm64: dts: qcom: sm6375: Add QUPs and corresponding SPI/I2C hosts
  arm64: dts: qcom: sm6375-pdx225: Enable QUPs & GPI DMA
  arm64: dts: qcom: sm6375-pdx225: Add PMIC peripherals
  arm64: dts: qcom: sm6375-pdx225: Configure SMD RPM regulators
  arm64: dts: qcom: sm6375-pdx225: Configure Samsung touchscreen

 .../devicetree/bindings/dma/qcom,gpi.yaml     |   1 +
 .../devicetree/bindings/iommu/arm,smmu.yaml   |   2 +-
 arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi    |  73 ++++
 .../qcom/sm6375-sony-xperia-murray-pdx225.dts | 251 +++++++++++
 arch/arm64/boot/dts/qcom/sm6375.dtsi          | 389 ++++++++++++++++++
 5 files changed, 715 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi

Comments

Rob Herring (Arm) Nov. 9, 2022, 9:09 p.m. UTC | #1
On Wed, 09 Nov 2022 12:12:26 +0100, Konrad Dybcio wrote:
> Some SMMUs require that a vote is held on as much as 3 separate PDs
> (hello Qualcomm). Allow it in bindings.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iommu/arm,smmu.example.dtb: iommu@d00000: power-domains: [[4294967295, 0]] is too short
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iommu/arm,smmu.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Bjorn Andersson Nov. 10, 2022, 3:52 a.m. UTC | #2
On Wed, Nov 09, 2022 at 12:12:28PM +0100, Konrad Dybcio wrote:
> PMK8350 is shipped on SID6 with some SoCs, for example with SM6375.
> Add a DT with the SID changed to allow it to work.
> 
> Unfortunately, the entire DT needs to be copied even if the diff is
> very little, as the node names are not unique. Including pm6125 and
> pmk8350 together for example, would make pmk8350 overwrite the pm6125
> node, as both are defined as 'pmic@0'.
> 

This seems to work in this case, but we have the same situation in other
places where the labels just don't add up with the schematics.

That's why I ended up just defining all the pmics in sc8280xp-pmics.dtsi
and then the separate set in sa8295p-adp.dts.

Regards,
Bjorn

> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi | 73 ++++++++++++++++++++++
>  1 file changed, 73 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi
> 
> diff --git a/arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi b/arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi
> new file mode 100644
> index 000000000000..00390f8b9c97
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi
> @@ -0,0 +1,73 @@
> +// SPDX-License-Identifier: BSD-3-Clause
> +/*
> + * Copyright (c) 2022, Linaro Limited
> + */
> +
> +#include <dt-bindings/input/input.h>
> +#include <dt-bindings/input/linux-event-codes.h>
> +#include <dt-bindings/interrupt-controller/irq.h>
> +#include <dt-bindings/spmi/spmi.h>
> +
> +&spmi_bus {
> +	pmk8350: pmic@6 {
> +		compatible = "qcom,pmk8350", "qcom,spmi-pmic";
> +		reg = <0x6 SPMI_USID>;
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		pmk8350_pon: pon@1300 {
> +			compatible = "qcom,pm8998-pon";
> +			reg = <0x1300>;
> +
> +			pon_pwrkey: pwrkey {
> +				compatible = "qcom,pmk8350-pwrkey";
> +				interrupts = <0x6 0x13 0x7 IRQ_TYPE_EDGE_BOTH>;
> +				linux,code = <KEY_POWER>;
> +				status = "disabled";
> +			};
> +
> +			pon_resin: resin {
> +				compatible = "qcom,pmk8350-resin";
> +				interrupts = <0x6 0x13 0x6 IRQ_TYPE_EDGE_BOTH>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		pmk8350_vadc: adc@3100 {
> +			compatible = "qcom,spmi-adc7";
> +			reg = <0x3100>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			interrupts = <0x6 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
> +			#io-channel-cells = <1>;
> +		};
> +
> +		pmk8350_adc_tm: adc-tm@3400 {
> +			compatible = "qcom,adc-tm7";
> +			reg = <0x3400>;
> +			interrupts = <0x6 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			#thermal-sensor-cells = <1>;
> +			status = "disabled";
> +		};
> +
> +		pmk8350_rtc: rtc@6100 {
> +			compatible = "qcom,pmk8350-rtc";
> +			reg = <0x6100>, <0x6200>;
> +			reg-names = "rtc", "alarm";
> +			interrupts = <0x6 0x62 0x1 IRQ_TYPE_EDGE_RISING>;
> +			status = "disabled";
> +		};
> +
> +		pmk8350_gpios: gpio@b000 {
> +			compatible = "qcom,pmk8350-gpio", "qcom,spmi-gpio";
> +			reg = <0xb000>;
> +			gpio-controller;
> +			gpio-ranges = <&pmk8350_gpios 0 0 4>;
> +			#gpio-cells = <2>;
> +			interrupt-controller;
> +			#interrupt-cells = <2>;
> +		};
> +	};
> +};
> -- 
> 2.38.1
>
Dmitry Baryshkov Nov. 10, 2022, 9:12 a.m. UTC | #3
On Wed, 9 Nov 2022 at 14:12, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>
> PMK8350 is shipped on SID6 with some SoCs, for example with SM6375.
> Add a DT with the SID changed to allow it to work.
>
> Unfortunately, the entire DT needs to be copied even if the diff is
> very little, as the node names are not unique. Including pm6125 and
> pmk8350 together for example, would make pmk8350 overwrite the pm6125
> node, as both are defined as 'pmic@0'.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi | 73 ++++++++++++++++++++++
>  1 file changed, 73 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi

Just to throw my 2c. If I was doing this myself, I'd allow pmk8350 to
receive external SID using the cpp #define (And to default to 0 if one
didn't use it).
Konrad Dybcio Nov. 10, 2022, 12:07 p.m. UTC | #4
On 10/11/2022 10:12, Dmitry Baryshkov wrote:
> On Wed, 9 Nov 2022 at 14:12, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>>
>> PMK8350 is shipped on SID6 with some SoCs, for example with SM6375.
>> Add a DT with the SID changed to allow it to work.
>>
>> Unfortunately, the entire DT needs to be copied even if the diff is
>> very little, as the node names are not unique. Including pm6125 and
>> pmk8350 together for example, would make pmk8350 overwrite the pm6125
>> node, as both are defined as 'pmic@0'.
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>>   arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi | 73 ++++++++++++++++++++++
>>   1 file changed, 73 insertions(+)
>>   create mode 100644 arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi
> 
> Just to throw my 2c. If I was doing this myself, I'd allow pmk8350 to
> receive external SID using the cpp #define (And to default to 0 if one
> didn't use it).
Hmm.. that's probably the least duplicative approach, but I'm not sure I
want to see #ifdefs in DTs..

Konrad
> 
> 
> 
>
Krzysztof Kozlowski Nov. 11, 2022, 3:04 p.m. UTC | #5
On 09/11/2022 12:12, Konrad Dybcio wrote:
> Add the pin setup for SPI/I2C configurations that are supported
> downstream. I can guesstimate the correct settings for other buses,
> but:
> 
> - I have no hardware to test it on
> - Some QUPs are straight up missing pin funcs in TLMM
> - Vendors probably didn't really care and used whatever was there in
> the reference design and BSP - should any other be used, they can be
> configured at a later time
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/sm6375.dtsi | 43 ++++++++


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Bjorn Andersson Nov. 11, 2022, 8:37 p.m. UTC | #6
On Thu, Nov 10, 2022 at 12:12:19PM +0300, Dmitry Baryshkov wrote:
> On Wed, 9 Nov 2022 at 14:12, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
> >
> > PMK8350 is shipped on SID6 with some SoCs, for example with SM6375.
> > Add a DT with the SID changed to allow it to work.
> >
> > Unfortunately, the entire DT needs to be copied even if the diff is
> > very little, as the node names are not unique. Including pm6125 and
> > pmk8350 together for example, would make pmk8350 overwrite the pm6125
> > node, as both are defined as 'pmic@0'.
> >
> > Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> > ---
> >  arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi | 73 ++++++++++++++++++++++
> >  1 file changed, 73 insertions(+)
> >  create mode 100644 arch/arm64/boot/dts/qcom/pmk8350_sid6.dtsi
> 
> Just to throw my 2c. If I was doing this myself, I'd allow pmk8350 to
> receive external SID using the cpp #define (And to default to 0 if one
> didn't use it).
> 

I attempted this, for my four PM8150s in the SA8295P ADP.

Unfortunately it became quite messy due to the multiple SIDs, the fact
that all interrupts specifiers contains the SID, that the labels became
unreadable and the fact that there are label-based references within
each pmic.

But I like the idea!

Regards,
Bjorn