mbox series

[0/8] Add support for Sony SDM630-based boards

Message ID 20200621213806.551879-1-konradybcio@gmail.com
Headers show
Series Add support for Sony SDM630-based boards | expand

Message

Konrad Dybcio June 21, 2020, 9:37 p.m. UTC
This series brings support for Snapdragon 630 and
a few smartphones based on this SoC, namely all
sdm630-based Xperias.

At the moment the things that the platform needs
the most are RPM regulator support (but that's in
the works already), MMCC/GPUCC drivers and perhaps
some USB stuff. Overall, lookin' pretty good, as we
can reuse many existing drivers.

Konrad Dybcio (7):
  pinctrl: qcom: spmi-gpio: Add pm660(l) compatibility
  Documentation: Document pm660(l) SPMI GPIOs compatible
  soc: qcom: socinfo: Add socinfo entry for SDM630
  clk: qcom: smd: Add support for SDM660 rpm clocks
  arm64: dts: qcom: pm660(l): Add base dts files
  arm64: dts: qcom: sdm630: Add sdm630 dts file
  arm64: dts: qcom: Add support for Sony Xperia XA2/Plus/Ultra (Nile
    platform)

Martin Botka (1):
  arm64: dts: qcom: Add support for Sony Xperia 10/10 Plus (Ganges
    platform)

 .../devicetree/bindings/clock/qcom,rpmcc.txt  |   1 +
 .../bindings/pinctrl/qcom,pmic-gpio.txt       |   2 +
 arch/arm64/boot/dts/qcom/Makefile             |   5 +
 arch/arm64/boot/dts/qcom/pm660.dtsi           |  60 ++
 arch/arm64/boot/dts/qcom/pm660l.dtsi          |  45 +
 arch/arm64/boot/dts/qcom/sdm630-pins.dtsi     | 268 +++++
 .../qcom/sdm630-sony-xperia-ganges-kirin.dts  |  13 +
 .../dts/qcom/sdm630-sony-xperia-ganges.dtsi   |  39 +
 .../sdm630-sony-xperia-nile-discovery.dts     |  13 +
 .../qcom/sdm630-sony-xperia-nile-pioneer.dts  |  13 +
 .../qcom/sdm630-sony-xperia-nile-voyager.dts  |  20 +
 .../dts/qcom/sdm630-sony-xperia-nile.dtsi     | 136 +++
 arch/arm64/boot/dts/qcom/sdm630.dtsi          | 991 ++++++++++++++++++
 .../sdm636-sony-xperia-ganges-mermaid.dts     |  19 +
 drivers/clk/qcom/clk-smd-rpm.c                |  77 ++
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c      |   4 +
 drivers/soc/qcom/socinfo.c                    |   1 +
 include/dt-bindings/clock/qcom,rpmcc.h        |  10 +
 18 files changed, 1717 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/pm660.dtsi
 create mode 100644 arch/arm64/boot/dts/qcom/pm660l.dtsi
 create mode 100644 arch/arm64/boot/dts/qcom/sdm630-pins.dtsi
 create mode 100644 arch/arm64/boot/dts/qcom/sdm630-sony-xperia-ganges-kirin.dts
 create mode 100644 arch/arm64/boot/dts/qcom/sdm630-sony-xperia-ganges.dtsi
 create mode 100644 arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile-discovery.dts
 create mode 100644 arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile-pioneer.dts
 create mode 100644 arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile-voyager.dts
 create mode 100644 arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi
 create mode 100644 arch/arm64/boot/dts/qcom/sdm630.dtsi
 create mode 100644 arch/arm64/boot/dts/qcom/sdm636-sony-xperia-ganges-mermaid.dts

Comments

Martin Botka June 21, 2020, 9:51 p.m. UTC | #1
Tested-by: Martin Botka <martin.botka.1@gmail.com>


ne 21. 6. 2020 o 23:38 Konrad Dybcio <konradybcio@gmail.com> napísal(a):
>
> From: Martin Botka <martin.botka1@gmail.com>
>
> Add device tree support for the Sony Xperia 10 and 10
> Plus smartphones. They are all based on the Sony Ganges
> platform (sdm630/636) and share a lot of common code.
> The differences are really minor, so a Ganges-common DTSI
> has been created to reduce clutter.
>
> 10 - Kirin
> 10 Plus - Mermaid
>
> This platform is based on SoMC Nile, but there are some
> major differences when it comes to pin configuration and
> panel setup (among others).
>
> The boards currently support:
> * Screen console
> * SDHCI
> * I2C
> * pstore log dump
> * GPIO keys
> * PSCI idle states
>
> Signed-off-by: Martin Botka <martin.botka1@gmail.com>
> Signed-off-by: Konrad Dybcio <konradybcio@gmail.com>
> ---
>  arch/arm64/boot/dts/qcom/Makefile             |  2 +
>  .../qcom/sdm630-sony-xperia-ganges-kirin.dts  | 13 +++++++
>  .../dts/qcom/sdm630-sony-xperia-ganges.dtsi   | 39 +++++++++++++++++++
>  .../sdm636-sony-xperia-ganges-mermaid.dts     | 19 +++++++++
>  4 files changed, 73 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/qcom/sdm630-sony-xperia-ganges-kirin.dts
>  create mode 100644 arch/arm64/boot/dts/qcom/sdm630-sony-xperia-ganges.dtsi
>  create mode 100644 arch/arm64/boot/dts/qcom/sdm636-sony-xperia-ganges-mermaid.dts
>
> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
> index 1cad7cb07574..c98bafe03a96 100644
> --- a/arch/arm64/boot/dts/qcom/Makefile
> +++ b/arch/arm64/boot/dts/qcom/Makefile
> @@ -16,9 +16,11 @@ dtb-$(CONFIG_ARCH_QCOM)      += msm8998-hp-envy-x2.dtb
>  dtb-$(CONFIG_ARCH_QCOM)        += msm8998-lenovo-miix-630.dtb
>  dtb-$(CONFIG_ARCH_QCOM)        += msm8998-mtp.dtb
>  dtb-$(CONFIG_ARCH_QCOM)        += sc7180-idp.dtb
> +dtb-$(CONFIG_ARCH_QCOM)        += sdm630-sony-xperia-ganges-kirin.dtb
>  dtb-$(CONFIG_ARCH_QCOM)        += sdm630-sony-xperia-nile-discovery.dtb
>  dtb-$(CONFIG_ARCH_QCOM)        += sdm630-sony-xperia-nile-pioneer.dtb
>  dtb-$(CONFIG_ARCH_QCOM)        += sdm630-sony-xperia-nile-voyager.dtb
> +dtb-$(CONFIG_ARCH_QCOM)        += sdm636-sony-xperia-ganges-mermaid.dtb
>  dtb-$(CONFIG_ARCH_QCOM)        += sdm660-xiaomi-lavender.dtb
>  dtb-$(CONFIG_ARCH_QCOM)        += sdm845-cheza-r1.dtb
>  dtb-$(CONFIG_ARCH_QCOM)        += sdm845-cheza-r2.dtb
> diff --git a/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-ganges-kirin.dts b/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-ganges-kirin.dts
> new file mode 100644
> index 000000000000..5326e019db20
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-ganges-kirin.dts
> @@ -0,0 +1,13 @@
> +// SPDX-License-Identifier: BSD-3-Clause
> +/*
> + * Copyright (c) 2020, Martin Botka
> + */
> +
> +/dts-v1/;
> +
> +#include "sdm630-sony-xperia-ganges.dtsi"
> +
> +/ {
> +    model = "SoMC Kirin-RoW";
> +    compatible = "sony,kirin-row", "qcom,sdm630", "qcom,sdm630-mtp";
> +};
> diff --git a/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-ganges.dtsi b/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-ganges.dtsi
> new file mode 100644
> index 000000000000..6c4c30e4cd9d
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-ganges.dtsi
> @@ -0,0 +1,39 @@
> +// SPDX-License-Identifier: BSD-3-Clause
> +/*
> + * Copyright (c) 2020, Martin Botka
> + */
> +
> +/dts-v1/;
> +
> +/* Ganges is very similar to Nile, but
> +there are some differences that will need
> +to be addresed when more peripherals are
> +enabled upstream. Hence the separate DTSI. */
> +#include "sdm630-sony-xperia-nile.dtsi"
> +
> +/ {
> +    chosen {
> +        framebuffer@9d400000 {
> +            reg = <0 0x9d400000 0 (2520 * 1080 * 4)>;
> +            height = <2520>;
> +        };
> +    };
> +
> +    soc {
> +
> +        i2c@c175000 {
> +            status = "okay";
> +
> +            /* Novatek touchscreen */
> +        };
> +
> +        /* Yes, this is intentional.
> +        Ganges devices only use gpio-keys for
> +        Volume Down, but currently there's an
> +        issue with it that has to be resolved.
> +        Until then, let's not make the kernel panic
> +        */
> +        /delete-node/ gpio-keys;
> +    };
> +
> +};
> diff --git a/arch/arm64/boot/dts/qcom/sdm636-sony-xperia-ganges-mermaid.dts b/arch/arm64/boot/dts/qcom/sdm636-sony-xperia-ganges-mermaid.dts
> new file mode 100644
> index 000000000000..97dce64d0185
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/sdm636-sony-xperia-ganges-mermaid.dts
> @@ -0,0 +1,19 @@
> +// SPDX-License-Identifier: BSD-3-Clause
> +/*
> + * Copyright (c) 2020, Martin Botka
> + */
> +
> +/dts-v1/;
> +
> +/* Mermaid uses sdm636, but it's different ever so slightly
> +that we can ignore it for the time being. Sony also commonizes
> +the Ganges platform as a whole in downstream kernels. */
> +#include "sdm630-sony-xperia-ganges.dtsi"
> +
> +/ {
> +    model = "SoMC Mermaid-RoW";
> +    compatible = "sony,mermaid-row", "qcom,sdm636", "qcom,sdm636-mtp";
> +
> +    qcom,msm-id = <345 0>;
> +    qcom,pmic-id = <0x1001b 0x101011a 0x00 0x00 0x1001b 0x201011a 0x00 0x00 0x1001b 0x102001a 0x00 0x00>;
> +};
> --
> 2.27.0
>
Martin Botka June 21, 2020, 10:04 p.m. UTC | #2
Sorry made a typo in mail.

Tested-by: Martin Botka <martin.botka1@gmail.com>
Alexey Minnekhanov June 22, 2020, 12:07 a.m. UTC | #3
Parts of this are similar or identical to sdm660.dtsi. SoCs should be
very similar.
Maybe this can be reorganized, so that we have some common base between
sdm630/660. I'd like to avoid copying such large amounts of code to sdm660
.dtsi file..

пн, 22 июн. 2020 г. в 00:39, Konrad Dybcio <konradybcio@gmail.com>:
>
> Add devicetree files for SDM630 SoC and its pin configuration.
> This commit adds basic nodes like cpu, psci and other required
> configuration for booting up from eMMC to the serial console.
>
> Signed-off-by: Konrad Dybcio <konradybcio@gmail.com>
Konrad Dybcio June 22, 2020, 6:38 a.m. UTC | #4
Qualcomm keeps them separate, so there's probably a good reason to,
and I would prefer to do so as well. But if you guys really want it
merged, then it's doable I guess..

Regards
Konrad
Pavel Machek June 29, 2020, 12:09 p.m. UTC | #5
Hi!

> +    soc {
> +        gpio_keys {
> +            status = "okay";
> +            compatible = "gpio-keys";
> +            input-name = "gpio-keys";
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +            autorepeat;

Do you really want autorepeat on keys like camera focus?

> +            vol_down {
> +                label = "Volume Down";
> +                gpios = <&pm660l_gpios 7 GPIO_ACTIVE_LOW>;
> +                linux,input-type = <1>;
> +                linux,code = <KEY_VOLUMEDOWN>;
> +                gpio-key,wakeup;
> +                debounce-interval = <15>;
> +            };

No volume up?
									Pavel
Pavel Machek June 29, 2020, 12:09 p.m. UTC | #6
Hi!

> +/dts-v1/;
> +
> +/* Ganges is very similar to Nile, but
> +there are some differences that will need
> +to be addresed when more peripherals are
> +enabled upstream. Hence the separate DTSI. */

This is not usual comment style.

Best regards,
									Pavel
Konrad Dybcio June 29, 2020, 12:13 p.m. UTC | #7
> This is not usual comment style.

This was fixed in a later revision and is currently applied to
qcom/linux in the correct form. [1]

[1] https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/commit/?h=for-next&id=234d7d6b4cbfab0e900f12658053689bb3376141

Regards
Konrad
Konrad Dybcio June 29, 2020, 12:15 p.m. UTC | #8
> Do you really want autorepeat on keys like camera focus?

I miiiight want to reconsider that when it will actually be in use :)

> No volume up?

On this board, vol up is managed by pm660 resin.

Regards
Konrad
Pavel Machek June 29, 2020, 10:01 p.m. UTC | #9
On Mon 2020-06-29 14:15:32, Konrad Dybcio wrote:
> > Do you really want autorepeat on keys like camera focus?
> 
> I miiiight want to reconsider that when it will actually be in use
> :)

Heh.

Okay, so... I want a Linux phone. I have N900 and Droid 4 at the
moment. I'll have something useful real soon now --
https://maemo-leste.github.io/maemo-leste-thirteenth-update-april-may-june-2020.html
.

OTOH... if you get useful mainline support for XA2 (or any other
modern Sony)... be sure to let me know. Droid 4 has only 1GB RAM :-(.

Best regards,

									Pavel