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

[Tama][XZ3] SDM845 PostmarketOS on mailine kernel Dreaded UFS support #802

Open
phodina opened this issue Jul 31, 2023 · 5 comments
Open

Comments

@phodina
Copy link

phodina commented Jul 31, 2023

Hi,
since the display panel is working on the SDM845 akatsuki device it's time to start investigating the possibility of testing the UFS patches.

#799

Any ideas for checklist what to do before attempting that?
Also what logs might be of interest for the test?
How to get/store them? SD card or Ethernet over USB?

@phodina
Copy link
Author

phodina commented Aug 7, 2023

CC: @bartcubbins @kholk

@phodina
Copy link
Author

phodina commented Aug 7, 2023

Btw is this issue also present on the MediaTek devices? I know it's highlighted on devices running Qualcomm chipsets.

@phodina
Copy link
Author

phodina commented Aug 28, 2023

So I managed to get my hands on akari phone and working PostmarketOS build there - mainline kernel.

Are there any ideas what to do next?

@bartcubbins
Copy link
Contributor

The issue is present on all OEMs with similar memory chips. You can look at the quirks in the SODP kernel, but as it is, it will never lands on the mainline.
Also you have to be extremely careful, because only one write cycle and your memory will be purged (sort of).
UFS_DEVICE_QUIRK_NO_PURGE and UFS_DEVICE_QUIRK_EXTEND_SYNC_LENGTH are the first places to look.

But I will warn you again, if you don’t know what you are doing, then you should keep away from flashing the kernel with the UFS driver enabled, otherwise it will simply turn your device into garbage

@phodina
Copy link
Author

phodina commented Sep 5, 2023

@bartcubbins thanks, I've started to look at the UFS driver and went over the patch made by @kholk.

I don't intend to flash the mainline to the device yet just gather enough so it might be worth trying.

Would it be of any use to trace the Android driver or is it enough to just stick with the source code and check for any deviations?

In order to use the UFS I'll have to use similar code, right?

--- a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi
@@ -785,9 +785,20 @@ &uart9 {
        status = "okay";
 };

-/* BIG WARNING! DO NOT TOUCH UFS, YOUR DEVICE WILL DIE! */
-&ufs_mem_hc { status = "disabled"; };
-&ufs_mem_phy { status = "disabled"; };
+&ufs_mem_hc {
+       status = "okay";
+
+       reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
+
+       vcc-supply = <&vreg_l20a_2p95>;
+       vcc-max-microamp = <600000>;
+};
+
+&ufs_mem_phy {
+       status = "okay";
+       vdda-phy-supply = <&vreg_l1a_0p875>;
+       vdda-pll-supply = <&vreg_l26a_1p2>;
+};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants