mbox series

[0/5] Bring up internal eMMC on Samsung Galaxy A8 (2018)

Message ID 20220601233743.56317-1-virag.david003@gmail.com
Headers show
Series Bring up internal eMMC on Samsung Galaxy A8 (2018) | expand

Message

David Virag June 1, 2022, 11:37 p.m. UTC
This set adds support to the internal eMMC storage found on the Samsung
Galaxy A8 (2018) (jackpotlte). It seems to work reliably for reads and
writes. postmarketOS is able to boot off of it.

The original kernel from samsung sets pinctrl options at runtime
changing pin-drv levels automatically. Without this code, mmc seems to
work the best with the lv3 setting on jackpotlte.

David Virag (5):
  dt-bindings: clock: Add bindings for Exynos7885 CMU_FSYS
  dt-bindings: clock: Add indices for Exynos7885 TREX clocks
  clk: samsung: exynos7885: Implement CMU_FSYS domain
  clk: samsung: exynos7885: Add TREX clocks
  arm64: dts: exynos: Add internal eMMC support to jackpotlte

 .../clock/samsung,exynos7885-clock.yaml       |  27 +++
 .../boot/dts/exynos/exynos7885-jackpotlte.dts |  20 ++
 arch/arm64/boot/dts/exynos/exynos7885.dtsi    |  32 +++
 drivers/clk/samsung/clk-exynos7885.c          | 207 +++++++++++++++++-
 include/dt-bindings/clock/exynos7885.h        |  54 ++++-
 5 files changed, 324 insertions(+), 16 deletions(-)

Comments

Krzysztof Kozlowski June 2, 2022, 11:56 a.m. UTC | #1
On 02/06/2022 01:37, David Virag wrote:
> TREX D Core and P core clocks seem to be related to the BTS (Bus Traffic
> Shaper) inside the Exynos7885 SoC, and are needed for the SoC to
> function correctly.
> 
> When clocks are cut from TREX D Core, the eMMC and the framebuffer stops
> working properly. Other unknown things may stop working as well.
> 
> When clocks are cut from TREX P Core, the system locks up needing a hard
> reset.
> 
> Add these clocks and mark them critical so that they are always on.


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof
David Virag June 2, 2022, 10:18 p.m. UTC | #2
On Thu, 2022-06-02 at 14:01 +0200, Krzysztof Kozlowski wrote:
> On 02/06/2022 01:37, David Virag wrote:
> > Add the nodes relevant to provide clocks for Exynos7885 eMMC and to
> > support eMMC. eMMC is the internal storage used in the Samsung
> > Galaxy A8
> > (2018) (jackpotlte), and all other known devices using the
> > Exynos7885
> > SoC.
> > 
> > Signed-off-by: David Virag <virag.david003@gmail.com>
> > ---
> >  .../boot/dts/exynos/exynos7885-jackpotlte.dts | 20 ++++++++++++
> >  arch/arm64/boot/dts/exynos/exynos7885.dtsi    | 32
> > +++++++++++++++++++
> >  2 files changed, 52 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/exynos/exynos7885-jackpotlte.dts
> > b/arch/arm64/boot/dts/exynos/exynos7885-jackpotlte.dts
> > index 4cf9aa25f618..5db9a81ac7bb 100644
> > --- a/arch/arm64/boot/dts/exynos/exynos7885-jackpotlte.dts
> > +++ b/arch/arm64/boot/dts/exynos/exynos7885-jackpotlte.dts
> > @@ -60,6 +60,26 @@ power-key {
> >         };
> >  };
> >  
> > +&mmc_0 {
> > +       status = "okay";
> > +       mmc-hs200-1_8v;
> > +       mmc-hs400-1_8v;
> > +       cap-mmc-highspeed;
> > +       non-removable;
> > +       mmc-hs400-enhanced-strobe;
> > +       card-detect-delay = <200>;
> > +       clock-frequency = <800000000>;
> 
> Is this real property for MMC? Neither mmc nor DW MSHC bindings
> mention it.

It is, but I don't remember trying without it. Seems like it is not
documented then. It is used in dw_mmc.c in the following places:

https://github.com/torvalds/linux/blob/master/drivers/mmc/host/dw_mmc.c#L3242-L3243

https://github.com/torvalds/linux/blob/master/drivers/mmc/host/dw_mmc.c#L3306-L3325

The Exynos850 device tree has the same property in it's mmc node. 

> 
> Best regards,
> Krzysztof

Best regards,
David