Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm64: dts: qcom: msm8916-samsung-fortuna/rossa: Add initial device trees #273

Draft
wants to merge 21 commits into
base: wip/msm8916/6.9
Choose a base branch
from

Conversation

wonderfulShrineMaidenOfParadise
Copy link

Discussion thread before upstreaming.

Todo

  • Rename the device trees like downstream does (fortuna-*)
  • Or use the codenames in build.prop
  • Drop Redo samsung,fortuna
  • Squash commits (Sensors, NFC...)
  • Enable NFC for grandprimelte if there is anyone interested
  • Add coreprimeltespr if there is anyone interested
  • Add cprimeltetmo if there is anyone interested
  • Add fortuna3gdtv if there is anyone interested. Cc @TotallyNotChloe
  • Add fortunaltedx if there is anyone interested. Cc @BaranSenkul
  • Add fortunalteub if there is anyone interested. Cc @pachof
Model Current DTS Codename Downstream DTS
SM-G530BT None fortuna3gdtv fortunadtv
SM-G530F None fortunaltedx fortuna-sea
SM-G530FZ gprimeltecan -> grandprimelte grandprimelte fortuna-eur
SM-G530H fortuna3g fortuna(ve)3g fortuna-r11/fortuna-ve3g
SM-G530M None fortunalteub fortuna-r11
SM-G530MU/Y fortunaltezt fortunaltezt fortuna-r11 (another variant)
SM-G530W gprimeltecan gprimeltecan fortuna-tmo
SM-G360G cprime -> rossa rossaltexsa rossa-eur
SM-G360P None coreprimeltespr rossaspr
SM-G360T None cprimeltetmo rossatmo
SM-G357FZ heatqlte heatqlte heat

Current conclusions

@wonderfulShrineMaidenOfParadise wonderfulShrineMaidenOfParadise changed the base branch from wip/msm8916/6.9-rc2 to wip/msm8916/6.9 May 28, 2024 14:37
@TravMurav TravMurav force-pushed the wip/msm8916/6.9 branch 2 times, most recently from 98939cb to c4d3662 Compare June 5, 2024 14:09
Imagis IST3038 is a variant of Imagis touchscreen IC. Document it in
imagis,ist3038c bindings.

Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Note this could be confusing, unlike the model name implies, IST30XXC
series is using protocol B, while IST3038 series is using protocol A.
Add protocol to imagis_properties.

Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Imagis IST3038 is another variant of Imagis IST3038 IC, which has
a different register interface from IST3038C (possibly firmware defined).

Unlike IST3038C/IST3032C, which uses protocol B, IST3038 uses protocol A,
and it has different registers for commands.
Similar to IST3032C and maybe the other variants, IST3038 has touch keys
support, which provides KEY_APPSELECT and KEY_BACK.

Add support for IST3038 with touch keys.

Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
The Samsung Galaxy Grand Prime CAN has a Samsung S3FWRN5 NFC chip that
works quite well with the s3fwrn5 driver in the Linux NFC subsystem.

The clock setup for the NFC chip is a bit special (although this
seems to be a common approach used for Qualcomm devices with NFC):

The NFC chip has an output GPIO that is asserted whenever the clock
is needed to function properly. On the A3/A5 this is wired up to
PM8916 GPIO2, which is then configured with a special function
(NFC_CLK_REQ or BB_CLK2_REQ).

Enabling the rpmcc RPM_SMD_BB_CLK2_PIN clock will then instruct
PM8916 to automatically enable the clock whenever the NFC chip
requests it. The advantage is that the clock is only enabled when
needed and we don't need to manage it ourselves from the NFC driver.

Signed-off-by: Joe Mason <buddyjojo06@outlook.com>
[Stephan: Put NFC pinctrl into common dtsi to share it with other variants]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
[Raymond: Use interrupts-extended. Keep &blsp_i2c6 enabled by default]
Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Link: https://lore.kernel.org/lkml/20240601115321.25314-2-raymondhackley@protonmail.com
…5 NFC

Some variants of Samsung Galaxy Core Prime LTE / Grand Prime LTE have a
Samsung S3FWRN5 NFC chip that works quite well with the s3fwrn5 driver
in the Linux NFC subsystem.

The clock setup for the NFC chip is a bit special (although this
seems to be a common approach used for Qualcomm devices with NFC):

The NFC chip has an output GPIO that is asserted whenever the clock
is needed to function properly. On the A3/A5 this is wired up to
PM8916 GPIO2, which is then configured with a special function
(NFC_CLK_REQ or BB_CLK2_REQ).

Enabling the rpmcc RPM_SMD_BB_CLK2_PIN clock will then instruct
PM8916 to automatically enable the clock whenever the NFC chip
requests it. The advantage is that the clock is only enabled when
needed and we don't need to manage it ourselves from the NFC driver.

Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Link: https://lore.kernel.org/lkml/20240601115321.25314-3-raymondhackley@protonmail.com
…nd charger

The phones listed below have Richtek RT5033 PMIC and charger.
Add them to the device trees.
- Samsung Galaxy Core Prime LTE
- Samsung Galaxy Grand Prime

Cc: Jakob Hauser <jahau@rocketmail.com>
Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Link: https://lore.kernel.org/lkml/20240601115321.25314-4-raymondhackley@protonmail.com
…,fortuna binding

Add common binding samsung,fortuna used by the following
Samsung Galaxy Grand Prime devices:
- SM-G530FZ (msm8916-samsung-grandprimelte)
- SM-G530H  (msm8216-samsung-fortuna3g)
- SM-G530W  (msm8916-gprimeltecan)

Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Link: https://lore.kernel.org/lkml/20240326141222.200452-2-raymondhackley@protonmail.com
Core Prime uses an Imagis IST3038 touchscreen that is connected to
blsp_i2c5. Add it to the device tree.

v2: Use interrupts-extended
v3: Drop status = "okay" on i2c5 since it's enabled by default
v4: Add touch keys
Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
The phone needs the touchkeys to be enabled so the sense lines of the
touch controller are mapped properly. Otherwise the touchscreen is not
mapped to the display properly.

Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
…ction

Signed-off-by: Joe Mason <buddyjojo06@outlook.com>
[Raymond: Split from the audio patch]
Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Samsung Galaxy Grand Prime (SM-G530Y) is a smartphone using the MSM8916
SoC released in 2014.

The Grand Prime variants are very similar, with some differences in
accelerometer and NFC. The common parts are shared in
msm8916-samsung-fortuna-common.dtsi to reduce duplication.

Unfortunately, SM-G530Y was 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 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 this device at some
point.
In this case we expect that this device tree can be simply used as-is.

Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
Samsung Galaxy Ace 4 is a phone based on MSM8916. It is similar
to the other Samsung devices based on MSM8916 with only a few minor
differences.

Ace 4 and Core Prime are similar, with some differences in panel and
touchscreen. The common parts are shared in
msm8916-samsung-rossa-common.dtsi to reduce duplication.

Unfortunately, SM-G357FZ was 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 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 this device at some
point.
In this case we expect that this device tree can be simply used as-is.

Signed-off-by: Gareth Peoples <mail@gpeopl.es>
[Raymond: Use msm8916-samsung-rossa-common.dtsi and reword the commit]
Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
…m arm64

After adding all necessary support for MSM8916 SMP/cpuidle without PSCI
on ARM32, build fortunaltezt and heatqlte device trees from the arm64
tree together with the ARM32 include to allow booting this device on ARM32.

The approach to include device tree files from other architectures is
inspired from e.g. the Raspberry Pi (bcm2711-rpi-4-b.dts) where this is
used to build the device tree for both ARM32 and ARM64.

[Stephan: Add workaround to TSENS problem]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
[Gareth: Add heatqlte]
Signed-off-by: Gareth Peoples <mail@gpeopl.es>
Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
…ocked to workaround TSENS problem

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Gareth Peoples <mail@gpeopl.es>
Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
The phones listed below have Richtek RT5033 PMIC and charger.
Add them to the device trees.
- Samsung Galaxy Ace 4 (SM-G357FZ)
- Samsung Galaxy Grand Prime (SM-G530Y)

Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
This device has ST LIS2HH12 accelerometer.
Add support for it.

Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
Grand Prime SM-G530Y (fortunaltezt) has a NXP PN547, which is supported
by the nxp-nci-i2c driver in mainline. It seems to detect NFC tags
using "nfctool" just fine, although more testing is difficult given
there seem to be very few useful applications making use of the
Linux NFC subsystem. :(

[Stephan: Move i2c-nfc to common dtsi to share it with other variants]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
v2: Reword and add label pn547_nfc
v3: Use interrupts-extended
Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
Signed-off-by: Gareth Peoples <mail@gpeopl.es>
[Raymond: Split from the init commit]
Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

7 participants