Skip to content

Commit

Permalink
arm64: dts: qcom: msm8916-samsung-e7: Add initial dts (v2)
Browse files Browse the repository at this point in the history
Samsung Galaxy E7 is a smartphone using the MSM8916 SoC released in 2015.

The E7 and A3/A5 are similar, with some differences in accelerometer,
MUIC, Vibator, WCNSS and touch key. The common parts are shared in
msm8916-samsung-a2015-common.dtsi to reduce duplication.

Motor is powered by VPH_PWR (aka Vbat) and controlled by GPIO.

The difference of accelerometer between E7/A3/A5 is the sensor chip.
ST LIS2HH12 is used instead.

On E7 the touch key is supplied by a single fixed regulator (enabled via
GPIO 97) that supplies both MCU and LED.

Unfortunately, some E7 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.

Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
v2: Make lis2hh12 interrupt IRQ_TYPE_LEVEL_HIGH
Co-developed-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
  • Loading branch information
bolilingmeng89006 authored and TravMurav committed May 23, 2022
1 parent 2b4365a commit d985faf
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/qcom/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dtb-$(CONFIG_ARCH_QCOM) += msm8916-mtp.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-a3u-eur.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-a5-zt.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-a5u-eur.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-e7.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-fortuna3g.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-fortunaltezt.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-gprimeltecan.dtb
Expand Down
133 changes: 133 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,133 @@
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-samsung-a2015-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";

reserved-memory {
/* Firmware for E7 needs more space */
/delete-node/ mpss@86800000;
/delete-node/ gps@8bc00000;

mpss_mem: mpss@86800000 {
reg = <0x0 0x86800000 0x0 0x5a00000>;
no-map;
};

gps_mem: gps@8c200000 {
reg = <0x0 0x8c200000 0x0 0x200000>;
no-map;
};
};

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>;
};
};

reg_touch_key: regulator-touch-key {
compatible = "regulator-fixed";
regulator-name = "touch_key";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;

gpio = <&msmgpio 97 GPIO_ACTIVE_HIGH>;
enable-active-high;

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

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;

accelerometer@1d {
compatible = "st,lis2hh12";
reg = <0x1d>;

interrupt-parent = <&msmgpio>;
interrupts = <115 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "INT1";

pinctrl-names = "default";
pinctrl-0 = <&accel_int_default>;

vdd-supply = <&pm8916_l5>;
vddio-supply = <&pm8916_l5>;

st,drdy-int-pin = <1>;
mount-matrix = "1", "0", "0",
"0", "-1", "0",
"0", "0", "1";
};
};

&touchkey {
vcc-supply = <&reg_touch_key>;
vdd-supply = <&reg_touch_key>;
};

&smd_rpm_regulators {
l17 {
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
};
};

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

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

tkey_en_default: tkey-en-default {
pins = "gpio97";
function = "gpio";

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

0 comments on commit d985faf

Please sign in to comment.