RE: [PATCH v3 0/5] exynos-ufs: Add support for UFS HCI

From: Alim Akhtar
Date: Fri Mar 20 2020 - 10:10:20 EST


Hello Pawel
Thanks for helping in testing.

> -----Original Message-----
> From: PaweÅ Chmiel <pawel.mikolaj.chmiel@xxxxxxxxx>
> Sent: 20 March 2020 01:12
> To: Alim Akhtar <alim.akhtar@xxxxxxxxxxx>
> Cc: krzk@xxxxxxxxxx; avri.altman@xxxxxxx; martin.petersen@xxxxxxxxxx;
> kwmad.kim@xxxxxxxxxxx; stanley.chu@xxxxxxxxxxxx;
> cang@xxxxxxxxxxxxxx; linux-samsung-soc@xxxxxxxxxxxxxxx; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; robh+dt@xxxxxxxxxx;
> devicetree@xxxxxxxxxxxxxxx; linux-scsi@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v3 0/5] exynos-ufs: Add support for UFS HCI
>
> On Thu, 2020-03-19 at 20:30 +0530, Alim Akhtar wrote:
> > This patch-set introduces UFS (Universal Flash Storage) host
> > controller support for Samsung family SoC. Mostly, it consists of UFS PHY and
> host specific driver.
> >
> > - Changes since v2:
> > * fixed build warning by kbuild test robot
> > * Added Reported-by tags
> >
> > - Changes since v1:
> > * fixed make dt_binding_check error as pointed by Rob
> > * Addressed Krzysztof's review comments
> > * Added Reviewed-by tags
> >
> >
> > patch 1/5: define devicetree bindings for UFS PHY patch 2/5: Adds UFS
> > PHY driver patch 3/5: define devicetree bindings for UFS HCI patch
> > 4/5: Adds Samsung UFS HCI driver patch 5/5: Enabled UFS on exynos7
> > platform
> Hi
> Is this compatible with Exynos7420? Looking at u-boot source code, there is
> Espresso7420 - isn't it the same device? Also this driver looks very similar to the
> one from vendor kernel sources (for my device).
>
Exynos7 and Exynos7420 are compatible and belong to same Exynos SoC series (but there are some fine differences)

> I did tried to run this on my Exynos7420 based device (Samsung S6 Edge
> phone) with 5.6-rc6, to get any storage working (since it doesn't have sdcard
> slot).
>
I think this should work on S6 Edge, but not entirely sure, as I am not aware of the S6 H/W schematic, specially PMIC connection.

> At first i got error in exynos_ufs_config_smu. Looking at vendor sources, on my
> device only secureos is able to write to those registers so i fixed it by using smc
> calls and driver probes fine. Will this be also supported by driver (maybe in
> future)?
>
> But now got another error
> [ 1.610464] exynos-ufshc 15570000.ufs: ufshcd_intr: Unhandled
> interrupt 0x00000000
> [ 1.610629] host_regs: 00000000: 0383ff0f 00000000 00000200 00000000
> [ 1.610747] host_regs: 00000010: 00000101 00007fce 00000000 00000000
> [ 1.610863] host_regs: 00000020: 00000000 00030e75 00000000 00000000
> [ 1.614727] host_regs: 00000030: 0000000f 00000000 00000000 00000000
> [ 1.621061] host_regs: 00000040: 00000000 00000000 00000000 00000000
> [ 1.627396] host_regs: 00000050: f8c37000 00000000 00000001 00000000
> [ 1.633730] host_regs: 00000060: 00000001 00000000 00000000 00000000
> [ 1.640065] host_regs: 00000070: f9644000 00000000 00000000 00000000
> [ 1.646400] host_regs: 00000080: 00000001 00000000 00000000 00000000
> [ 1.652734] host_regs: 00000090: 00000002 95290000 00000000 00000000
> [ 1.747649] exynos-ufshc 15570000.ufs: ufshcd_intr: Unhandled
> interrupt 0x00000000
> [ 1.747807] host_regs: 00000000: 0383ff0f 00000000 00000200 00000000
> [ 1.747924] host_regs: 00000010: 00000101 00007fce 00000000 00000000
> [ 1.748041] host_regs: 00000020: 00000000 00030e75 00000000 00000000
> [ 1.751909] host_regs: 00000030: 0000000f 00000000 00000000 00000000
> [ 1.758244] host_regs: 00000040: 00000000 00000000 00000000 00000000
> [ 1.764578] host_regs: 00000050: f8c37000 00000000 00000001 00000000
> [ 1.770913] host_regs: 00000060: 00000001 00000000 00000000 00000000
> [ 1.777248] host_regs: 00000070: f9644000 00000000 00000000 00000000
> [ 1.783582] host_regs: 00000080: 00000001 00000000 00000000 00000000
> [ 1.789917] host_regs: 00000090: 00000002 95290000 00000000 00000000
> [ 1.884841] exynos-ufshc 15570000.ufs: ufshcd_intr: Unhandled
> interrupt 0x00000000
> [ 1.884999] host_regs: 00000000: 0383ff0f 00000000 00000200 00000000
> [ 1.885116] host_regs: 00000010: 00000101 00007fce 00000000 00000000
> [ 1.885233] host_regs: 00000020: 00000000 00030e75 00000000 00000000
> [ 1.889100] host_regs: 00000030: 0000000f 00000000 00000000 00000000
> [ 1.895435] host_regs: 00000040: 00000000 00000000 00000000 00000000
> [ 1.901770] host_regs: 00000050: f8c37000 00000000 00000001 00000000
> [ 1.908104] host_regs: 00000060: 00000001 00000000 00000000 00000000
> [ 1.914439] host_regs: 00000070: f9644000 00000000 00000000 00000000
> [ 1.920773] host_regs: 00000080: 00000001 00000000 00000000 00000000
> [ 1.927108] host_regs: 00000090: 00000002 95290000 00000000 00000000
> [ 2.998155] exynos-ufshc 15570000.ufs: ufshcd_query_flag: Sending
> flag query for idn 1 failed, err = -11
> [ 4.502138] exynos-ufshc 15570000.ufs: ufshcd_query_flag: Sending
> flag query for idn 1 failed, err = -11
> [ 6.006137] exynos-ufshc 15570000.ufs: ufshcd_query_flag: Sending
> flag query for idn 1 failed, err = -11
> [ 6.006311] exynos-ufshc 15570000.ufs: ufshcd_query_flag_retry:
> query attribute, opcode 5, idn 1, failed with error -11 after 3 retires
> [ 6.006545] exynos-ufshc 15570000.ufs: ufshcd_complete_dev_init
> reading fDeviceInit flag failed with error -11
>
> Do You have any idea what could be wrong?
>
To me, It looks like UFS device is not powered ON or properly Reseted, I have seen this kind of issues in past and
AFAIR, fix was to keep the PMIC rail which was hook to device RESET_N always-on.

> Thanks
> >
> > Note: This series is based on Linux-5.6-rc6 (commit: fb33c6510d55)
> >
> >
> > Alim Akhtar (5):
> > dt-bindings: phy: Document Samsung UFS PHY bindings
> > phy: samsung-ufs: add UFS PHY driver for samsung SoC
> > Documentation: devicetree: ufs: Add DT bindings for exynos UFS host
> > controller
> > scsi: ufs-exynos: add UFS host support for Exynos SoCs
> > arm64: dts: Add node for ufs exynos7
> >
> > .../bindings/phy/samsung,ufs-phy.yaml | 62 +
> > .../devicetree/bindings/ufs/ufs-exynos.txt | 104 ++
> > .../boot/dts/exynos/exynos7-espresso.dts | 16 +
> > arch/arm64/boot/dts/exynos/exynos7.dtsi | 44 +-
> > drivers/phy/samsung/Kconfig | 9 +
> > drivers/phy/samsung/Makefile | 1 +
> > drivers/phy/samsung/phy-exynos7-ufs.h | 85 +
> > drivers/phy/samsung/phy-samsung-ufs.c | 311 ++++
> > drivers/phy/samsung/phy-samsung-ufs.h | 100 ++
> > drivers/scsi/ufs/Kconfig | 12 +
> > drivers/scsi/ufs/Makefile | 1 +
> > drivers/scsi/ufs/ufs-exynos.c | 1399 +++++++++++++++++
> > drivers/scsi/ufs/ufs-exynos.h | 268 ++++
> > drivers/scsi/ufs/unipro.h | 41 +
> > include/linux/phy/phy-samsung-ufs.h | 70 +
> > 15 files changed, 2521 insertions(+), 2 deletions(-) create mode
> > 100644 Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
> > create mode 100644
> > Documentation/devicetree/bindings/ufs/ufs-exynos.txt
> > create mode 100644 drivers/phy/samsung/phy-exynos7-ufs.h
> > create mode 100644 drivers/phy/samsung/phy-samsung-ufs.c
> > create mode 100644 drivers/phy/samsung/phy-samsung-ufs.h
> > create mode 100644 drivers/scsi/ufs/ufs-exynos.c create mode 100644
> > drivers/scsi/ufs/ufs-exynos.h create mode 100644
> > include/linux/phy/phy-samsung-ufs.h
> >