mbox series

[v4,0/6] support oneplus-lemonade(p) devices

Message ID 20231111-nia-sm8350-for-upstream-v4-0-3a638b02eea5@igalia.com
Headers show
Series support oneplus-lemonade(p) devices | expand

Message

Nia Espera Nov. 11, 2023, 10:07 p.m. UTC
Patch series adding support for oneplus-lemonade and oneplus-lemonadep
devices (OnePlus 9 & 9 Pro), along with a few needed fixups. Currently
working as of this series:

- USB OTG
- UFS
- Framebuffer display
- Touchscreen (for lemonade)
- Power & volume down keys
- Battery reading
- Modem, IPA, and remoteproc bringup

Signed-off-by: Nia Espera <nespera@igalia.com>
---
Changes in v4:
- Fixed up some small naming-related nits.
- Link to v3: https://lore.kernel.org/r/20231108-nia-sm8350-for-upstream-v3-0-18a024b5c74c@igalia.com

Changes in v3:
- Fixed up more incorrect devicetree properties.
- Properly enabled the fsa type-C mux.
- Added node for sm8350 PMIC glink.
- Patch name fixes.
- Link to v2: https://lore.kernel.org/r/20231018-nia-sm8350-for-upstream-v2-0-7b243126cb77@igalia.com

Changes in v2:
- Fixed up formatting/style.
- Removed unused pinctrl nodes.
- Removed unused properties.
- Moved ADC7 defines to vadc header.
- Edited copyright on lemonade dts and license on spmi header.
- Fixed up therm channels.
- Removed unnecessary hack w.r.t. timer node.
- Link to v1: https://lore.kernel.org/r/20231016-nia-sm8350-for-upstream-v1-0-bb557a0af2e9@igalia.com

---
Nia Espera (6):
      dt-bindings: iio: adc: qcom: Add Qualcomm smb139x
      arm64: dts: qcom: sm8350: Fix DMA0 address
      arm64: dts: qcom: pm8350k: Remove hanging whitespace
      arm64: dts: qcom: sm8350: Fix remoteproc interrupt type
      dt-bindings: arm: qcom: Add oneplus-lemonade(p)
      arm64: dts: qcom: sm8350-lemonade(p): New devices

 Documentation/devicetree/bindings/arm/qcom.yaml    |    2 +
 arch/arm64/boot/dts/qcom/Makefile                  |    2 +
 arch/arm64/boot/dts/qcom/pmk8350.dtsi              |    2 +-
 .../arm64/boot/dts/qcom/sm8350-oneplus-common.dtsi | 1086 ++++++++++++++++++++
 .../boot/dts/qcom/sm8350-oneplus-lemonade.dts      |   85 ++
 .../boot/dts/qcom/sm8350-oneplus-lemonadep.dts     |   20 +
 arch/arm64/boot/dts/qcom/sm8350.dtsi               |   12 +-
 include/dt-bindings/iio/qcom,spmi-adc7-smb139x.h   |   19 +
 include/dt-bindings/iio/qcom,spmi-vadc.h           |    3 +
 9 files changed, 1224 insertions(+), 7 deletions(-)
---
base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa
change-id: 20231016-nia-sm8350-for-upstream-2f452366e421

Best regards,

Comments

Nia Espera Nov. 23, 2023, 5:05 p.m. UTC | #1
On 11/22/23 21:17, Konrad Dybcio wrote:
> 
> 
> On 11/11/23 23:07, Nia Espera wrote:
>> Device tree files for OnePlus 9 and 9 Pro. Details of supported features
>> mentioned in the cover letter for this patch series, but for
>> accessibility also repeated here:
>>
>> - USB OTG
>> - UFS
>> - Framebuffer display
>> - Touchscreen (for lemonade)
>> - Power & volume down keys
>> - Battery reading
>> - Modem, IPA, and remoteproc bringup
>>
>> Steps to get booting:
>>
>> - Wipe dtbo partition
>> - Flash vbmeta with disabled verity bit
>> - Flash kernel and initfs to boot partition with CLI args 
>> pd_ignore_unused
>> and clk_ignore_unused as v1 bootimg
>> - Flash rootfs to some other partition (probably super or userdata)
> Thanks for including this info here
> 
>> +&pmk8350_vadc {
>> +    pinctrl-names = "default";
>> +    pinctrl-0 = <&gpio1_adc_default>, <&gpio3_adc_default>;
>> +
>> +    /* pmk8350-ref-gnd */
> I fail to see the benefit in having this both here and in the label

Oops, removed.

>> +    channel@0 {
>> +        reg = <0x00>;
>> +        qcom,pre-scaling = <1 1>;
>> +        label = "pmk8350_ref_gnd";
>> +    };
>> +
> [...]
> 
>> +&tlmm {
>> +    gpio-reserved-ranges = <52 8>;
> Would you know what these are connected to?
> 

Judging from the line names on the hdk dtsi, 4 seem to be connected to 
the fingerprint (FP_SPI_*) and the other 4 are NFC-related 
(NFC_ESE_SPI_*). I can clarify this with a comment if necessary.

> [...]
> 
>> +&mpss {
>> +    pinctrl-names = "default";
>> +    pinctrl-0 = <&rf_cable_ant0_active>;
> patch-wide:
> 
> property-n
> property-names
> 
> Konrad

Many thanks!
Jonathan Cameron Nov. 25, 2023, 8:42 p.m. UTC | #2
On Sat, 11 Nov 2023 23:07:39 +0100
Nia Espera <nespera@igalia.com> wrote:

> Bindings for a charger controller chip found on sm8350
> 
> Signed-off-by: Nia Espera <nespera@igalia.com>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Hmm. this is going to clash badly with the header moves. I'll assume they
will both eventually go through the qcom tree unless someone tells me otherwise.

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  include/dt-bindings/iio/qcom,spmi-adc7-smb139x.h | 19 +++++++++++++++++++
>  include/dt-bindings/iio/qcom,spmi-vadc.h         |  3 +++
>  2 files changed, 22 insertions(+)
> 
> diff --git a/include/dt-bindings/iio/qcom,spmi-adc7-smb139x.h b/include/dt-bindings/iio/qcom,spmi-adc7-smb139x.h
> new file mode 100644
> index 000000000000..c0680d1285cf
> --- /dev/null
> +++ b/include/dt-bindings/iio/qcom,spmi-adc7-smb139x.h
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */
> +/*
> + * Copyright (c) 2020 The Linux Foundation. All rights reserved.
> + */
> +
> +#ifndef _DT_BINDINGS_QCOM_SPMI_VADC_SMB139X_H
> +#define _DT_BINDINGS_QCOM_SPMI_VADC_SMB139X_H
> +
> +#include <dt-bindings/iio/qcom,spmi-vadc.h>
> +
> +#define SMB139x_1_ADC7_SMB_TEMP			(SMB139x_1_SID << 8 | ADC7_SMB_TEMP)
> +#define SMB139x_1_ADC7_ICHG_SMB			(SMB139x_1_SID << 8 | ADC7_ICHG_SMB)
> +#define SMB139x_1_ADC7_IIN_SMB			(SMB139x_1_SID << 8 | ADC7_IIN_SMB)
> +
> +#define SMB139x_2_ADC7_SMB_TEMP			(SMB139x_2_SID << 8 | ADC7_SMB_TEMP)
> +#define SMB139x_2_ADC7_ICHG_SMB			(SMB139x_2_SID << 8 | ADC7_ICHG_SMB)
> +#define SMB139x_2_ADC7_IIN_SMB			(SMB139x_2_SID << 8 | ADC7_IIN_SMB)
> +
> +#endif
> diff --git a/include/dt-bindings/iio/qcom,spmi-vadc.h b/include/dt-bindings/iio/qcom,spmi-vadc.h
> index 08adfe25964c..ef07ecd4d585 100644
> --- a/include/dt-bindings/iio/qcom,spmi-vadc.h
> +++ b/include/dt-bindings/iio/qcom,spmi-vadc.h
> @@ -239,12 +239,15 @@
>  #define ADC7_GPIO3				0x0c
>  #define ADC7_GPIO4				0x0d
>  
> +#define ADC7_SMB_TEMP				0x06
>  #define ADC7_CHG_TEMP				0x10
>  #define ADC7_USB_IN_V_16			0x11
>  #define ADC7_VDC_16				0x12
>  #define ADC7_CC1_ID				0x13
>  #define ADC7_VREF_BAT_THERM			0x15
>  #define ADC7_IIN_FB				0x17
> +#define ADC7_ICHG_SMB				0x18
> +#define ADC7_IIN_SMB				0x19
>  
>  /* 30k pull-up1 */
>  #define ADC7_AMUX_THM1_30K_PU			0x24
>
Jonathan Cameron Nov. 25, 2023, 8:48 p.m. UTC | #3
On Sat, 11 Nov 2023 23:07:39 +0100
Nia Espera <nespera@igalia.com> wrote:

> Bindings for a charger controller chip found on sm8350
> 
> Signed-off-by: Nia Espera <nespera@igalia.com>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  include/dt-bindings/iio/qcom,spmi-adc7-smb139x.h | 19 +++++++++++++++++++
>  include/dt-bindings/iio/qcom,spmi-vadc.h         |  3 +++
>  2 files changed, 22 insertions(+)
> 
> diff --git a/include/dt-bindings/iio/qcom,spmi-adc7-smb139x.h b/include/dt-bindings/iio/qcom,spmi-adc7-smb139x.h
> new file mode 100644
> index 000000000000..c0680d1285cf
> --- /dev/null
> +++ b/include/dt-bindings/iio/qcom,spmi-adc7-smb139x.h
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */
> +/*
> + * Copyright (c) 2020 The Linux Foundation. All rights reserved.
> + */
> +
> +#ifndef _DT_BINDINGS_QCOM_SPMI_VADC_SMB139X_H
> +#define _DT_BINDINGS_QCOM_SPMI_VADC_SMB139X_H
> +
> +#include <dt-bindings/iio/qcom,spmi-vadc.h>
> +
> +#define SMB139x_1_ADC7_SMB_TEMP			(SMB139x_1_SID << 8 | ADC7_SMB_TEMP)
> +#define SMB139x_1_ADC7_ICHG_SMB			(SMB139x_1_SID << 8 | ADC7_ICHG_SMB)
> +#define SMB139x_1_ADC7_IIN_SMB			(SMB139x_1_SID << 8 | ADC7_IIN_SMB)
> +
> +#define SMB139x_2_ADC7_SMB_TEMP			(SMB139x_2_SID << 8 | ADC7_SMB_TEMP)
> +#define SMB139x_2_ADC7_ICHG_SMB			(SMB139x_2_SID << 8 | ADC7_ICHG_SMB)
> +#define SMB139x_2_ADC7_IIN_SMB			(SMB139x_2_SID << 8 | ADC7_IIN_SMB)
> +
> +#endif
> diff --git a/include/dt-bindings/iio/qcom,spmi-vadc.h b/include/dt-bindings/iio/qcom,spmi-vadc.h
> index 08adfe25964c..ef07ecd4d585 100644
> --- a/include/dt-bindings/iio/qcom,spmi-vadc.h
> +++ b/include/dt-bindings/iio/qcom,spmi-vadc.h
> @@ -239,12 +239,15 @@
>  #define ADC7_GPIO3				0x0c
>  #define ADC7_GPIO4				0x0d
>  
> +#define ADC7_SMB_TEMP				0x06
>  #define ADC7_CHG_TEMP				0x10
>  #define ADC7_USB_IN_V_16			0x11
>  #define ADC7_VDC_16				0x12
>  #define ADC7_CC1_ID				0x13
>  #define ADC7_VREF_BAT_THERM			0x15
>  #define ADC7_IIN_FB				0x17
> +#define ADC7_ICHG_SMB				0x18
> +#define ADC7_IIN_SMB				0x19
>  
>  /* 30k pull-up1 */
>  #define ADC7_AMUX_THM1_30K_PU			0x24
>