Skip to content

Commit

Permalink
arm64: dts: qcom: msm8916-samsung-e2015: Add initial common dtsi
Browse files Browse the repository at this point in the history
Samsung Galaxy E5, E7 and Grand Max are smartphones using the MSM8916 SoC
released in 2015.

e2015 and a2015 are similar, with some differences in accelerometer,
MUIC and Vibrator. The common parts are shared in
msm8916-samsung-a2015-common.dtsi to reduce duplication.

Add a common device tree for with initial support for:

- GPIO keys and vibrator
- GPIO LEDs for Grand Max
- Hall sensor (except Grand Max)
- SDHCI (internal and external storage)
- USB Device Mode
- UART (on USB connector via the SM5504 MUIC)
- WCNSS (WiFi/BT)
- Regulators
- S3FWRN5 NFC (except Grand Max)

The three devices (and all other variants of E5/E7/Grand Max released in
2015) are very similar, with some differences in display, touchscreen,
sensors and NFC. The common parts are shared in
msm8916-samsung-e2015-common.dtsi to reduce duplication.

Unfortunately, some E5/E7/Grand Max were released with outdated 32-bit
only firmware and never received any update from Samsung. Since the 32-bit
TrustZone firmware is signed there seems to be no way currently to
actually boot this device tree on arm64 Linux on those variants at the
moment.

However, it is possible to use this device tree by compiling an ARM32
kernel instead. The device tree can be easily built on ARM32 with
an #include and it works really well there. To avoid confusion for others
it is still better to add this device tree on arm64. Otherwise it's easy
to forget to update this one when making some changes that affect all
MSM8916 devices.

Maybe someone finds a way to boot ARM64 Linux on those device at some
point. In this case I expect that this device tree can be simply used
as-is.

Co-developed-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
  • Loading branch information
bolilingmeng89006 authored and intel-lab-lkp committed Jul 21, 2022
1 parent 4ccfc44 commit 00d1983
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm64/boot/dts/qcom/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ dtb-$(CONFIG_ARCH_QCOM) += msm8916-longcheer-l8910.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-mtp.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-a3u-eur.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-a5u-eur.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-e5.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-e7.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-grandmax.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-j5.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-serranove.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-wingtech-wt88047.dtb
Expand Down
47 changes: 47 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8916-samsung-a2015-common.dtsi"

/ {
i2c-muic {
/* SM5504 MUIC instead of SM5502 */
/delete-node/ extcon@25;

muic: extcon@14 {
compatible = "siliconmitus,sm5504-muic";
reg = <0x14>;

interrupt-parent = <&msmgpio>;
interrupts = <12 IRQ_TYPE_EDGE_FALLING>;

pinctrl-names = "default";
pinctrl-0 = <&muic_int_default>;
};
};

vibrator: vibrator {
compatible = "gpio-vibrator";
enable-gpios = <&msmgpio 76 GPIO_ACTIVE_HIGH>;

pinctrl-names = "default";
pinctrl-0 = <&motor_en_default>;
};
};

&blsp_i2c2 {
/* lis2hh12 accelerometer instead of BMC150 */
/delete-node/ accelerometer@10;
/delete-node/ magnetometer@12;

status = "disabled";
};

&msmgpio {
motor_en_default: motor-en-default {
pins = "gpio76";
function = "gpio";

drive-strength = <2>;
bias-disable;
};
};
24 changes: 24 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8916-samsung-e5.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-samsung-e2015-common.dtsi"

/*
* NOTE: The original firmware from Samsung can only boot ARM32 kernels on some
* variants.
* Unfortunately, the firmware is signed and cannot be replaced easily.
* There seems to be no way to boot ARM64 kernels on 32-bit devices at the
* moment, even though the hardware would support it.
*
* However, it is possible to use this device tree by compiling an ARM32 kernel
* instead. For clarity and build testing this device tree is maintained next
* to the other MSM8916 device trees. However, it is actually used through
* arch/arm/boot/dts/qcom-msm8916-samsung-e5.dts
*/

/ {
model = "Samsung Galaxy E5";
compatible = "samsung,e5", "qcom,msm8916";
chassis-type = "handset";
};
29 changes: 29 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8916-samsung-e7.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-samsung-e2015-common.dtsi"

/*
* NOTE: The original firmware from Samsung can only boot ARM32 kernels on some
* variants.
* Unfortunately, the firmware is signed and cannot be replaced easily.
* There seems to be no way to boot ARM64 kernels on 32-bit devices at the
* moment, even though the hardware would support it.
*
* However, it is possible to use this device tree by compiling an ARM32 kernel
* instead. For clarity and build testing this device tree is maintained next
* to the other MSM8916 device trees. However, it is actually used through
* arch/arm/boot/dts/qcom-msm8916-samsung-e7.dts
*/

/ {
model = "Samsung Galaxy E7";
compatible = "samsung,e7", "qcom,msm8916";
chassis-type = "handset";
};

&pm8916_l17 {
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
};
56 changes: 56 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-samsung-e2015-common.dtsi"
#include <dt-bindings/leds/common.h>

/*
* NOTE: The original firmware from Samsung can only boot ARM32 kernels on some
* variants.
* Unfortunately, the firmware is signed and cannot be replaced easily.
* There seems to be no way to boot ARM64 kernels on 32-bit devices at the
* moment, even though the hardware would support it.
*
* However, it is possible to use this device tree by compiling an ARM32 kernel
* instead. For clarity and build testing this device tree is maintained next
* to the other MSM8916 device trees. However, it is actually used through
* arch/arm/boot/dts/qcom-msm8916-samsung-grandmax.dts
*/

/ {
model = "Samsung Galaxy Grand Max";
compatible = "samsung,grandmax", "qcom,msm8916";
chassis-type = "handset";

/delete-node/ gpio-hall-sensor;
/delete-node/ i2c-nfc;
/delete-node/ i2c-tkey;

gpio-leds {
compatible = "gpio-leds";
keyled {
gpios = <&msmgpio 60 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&gpio_leds_default>;
};
};
};

&vibrator {
enable-gpios = <&msmgpio 72 GPIO_ACTIVE_HIGH>;
};

&msmgpio {
gpio_leds_default: gpio-led-default {
pins = "gpio60";
function = "gpio";

drive-strength = <2>;
bias-disable;
};
};

&motor_en_default {
pins = "gpio72";
};

0 comments on commit 00d1983

Please sign in to comment.