Commit Graph

67 Commits

Author SHA1 Message Date
Aniruddha Rao
49ebbfc3ed ufs: tegra: Set MPHY EQ timeout
Set MPHY EQ timeout as per the HW recommendations

Bug 5136701

Change-Id: Icf8012044f13006b76921e8f783c246d2953b858
Signed-off-by: Aniruddha Rao <anrao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3373643
(cherry picked from commit b918e90ad2c7dfb649fd98a9c65d35ff70a47d0f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3407950
Tested-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
2025-07-24 10:20:36 +00:00
Mallikarjun Kasoju
56756a4ee7 ufs: Auto-hibernate in cold boot
Enabled auto-hibernate in cold boot.

Bug 5247388

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: Ia000697ba0fce514a392f42236ad5c5342f1ff6c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3363799
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:20:35 +00:00
Jon Hunter
c9abbd16c0 ufs: tegra: Simplify headers
Depending on kernel version the Tegra UFS driver includes different
headers to build the driver. Now that Linux v5.x kernels are no longer
supported, we can simplify this. Simplify the headers for the Tegra UFS
driver as follows ...

1. For Linux v6.x kernels only the ufshcd-priv.h and ufshcd-pltfrm.h
   headers are required. These headers are copied from the Linux kernel.
   However, only the prototypes for the functions 'ufshcd_query_attr',
   'ufshcd_query_descriptor_retry' and 'ufshcd_pltfrm_init' are needed.
   The functions 'ufshcd_query_attr' and 'ufshcd_query_descriptor_retry'
   have not been change since they were introduced in Linux v4.17 and
   the function 'ufshcd_pltfrm_init' was last updated in Linux v6.1
   (making the ufs_hba_variant_ops argument const). Although redefining
   the prototypes outside the kernel is fragile and does not protect the
   Tegra UFS driver from updates to these functions, this problem
   already exists.
2. Move the files ufshcd-pltfrm.h and ufshcd-priv.h into the Tegra UFS
   driver directory because these are not needed outside of the driver.

JIRA LINQPJ14-47

Change-Id: I3891bf756723f730f036637891c55090b5d2a384
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3349825
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-07-24 10:19:19 +00:00
Jon Hunter
b8e8f99bbd ufs: tegra: Remove legacy headers
Linux v5.x kernels are no longer supported and so remove all the legacy
UFS related headers for these kernels.

Bug 3978622
JIRA LINQPJ14-47

Change-Id: I6e514305d30f93d74bd75fc335db69ced79b3866
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3349975
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-07-24 10:19:18 +00:00
Mallikarjun Kasoju
ae290b601b ufs: Add conftest to check is_ufs_already_enabled
Add conftest to check is_ufs_already_enabled

Change-Id: Ia830afb2a72586f4da2323a4ab7df8e7eb9cc321
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3312149
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:17 +00:00
Mallikarjun Kasoju
9a4387e137 ufs: skip ufs initialize if already done
Skip ufs initialize if already done by
earlier firmware

Bug 4757621

Change-Id: I4efdca7e879d5d568d7749abcdebc05fe019fde1
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3293005
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +00:00
Mallikarjun Kasoju
0587b30451 scsi: ufs: Clean-up ufs driver
Done below changes:
1. Removed FPGA specific changes
2. Removed T194 specific changes.
3. Fixed issues reported by check-patch

Change-Id: I8ea07a57add151ccd2e2fdac4e3bd9d9456cc765
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3274557
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +00:00
Jon Hunter
9672874453 ufs: Fix Tegra UFS for Linux v6.15
In Linux v6.15, the pwr_change_notify() function was updated making the
3rd argument of type const. Add a conftest to detect this and update the
Tegra UFS driver accordingly.

JIRA LINQPJ14-47

Change-Id: I83f22bf0961200d9078fb35d408dac9149d786d2
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330680
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Kartik Rajput <kkartik@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +00:00
Jon Hunter
ee357025ee ufs: Fix Tegra UFS for Linux v6.13
In Linux v6.13, the quirk definition 'UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS'
was removed and replaced with a function pointer than can be used to set
the DMA mask as needed for a given device. Update the Tegra UFS driver
to fix support for Linux v6.13. Note that prior to Linux v6.13, the flag
'UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS' would set the DMA mask to 32-bits
and so this change is equivalent to the configuration of prior kernels.

Bug 4991705

Change-Id: I859331e9eea918d2438d68b871642fee5e4148e0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3283447
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
2025-07-24 10:19:13 +00:00
Mallikarjun Kasoju
15244dd468 ufs: Enable mphy power change clock boost for T264
Enable mphy power change clock boost for T264.

Bug 4757621

Change-Id: I714b10f40026296dfd769a066e1413eec933361f
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3262100
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:11 +00:00
Mallikarjun Kasoju
8f7e9f5ec8 ufs: Program Auto-hibernate
Added Auto-hibernate for better power
consumption in idle state.

Bug 4812738

Change-Id: I5ef80b8de7d94f8a2bad3adf546061520fb38958
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3239657
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
238299ffb5 scsi: ufs: Enable Writebooster
Enable writebooster capabilities.

Bug 4782274

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: Ib7e98daa935b7c3922c6050dba64e45c50c82228
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3248799
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:10 +00:00
Laxman Dewangan
267eedc25d ufs: Add conftest to check UFSHCD_QUIRK_BROKEN_PWR_SEQUENCE
Not all kernel define the enum UFSHCD_QUIRK_BROKEN_PWR_SEQUENCE

Add conftest to find out whether kernel has define the enum
UFSHCD_QUIRK_BROKEN_PWR_SEQUENCE or not and then check for macro
before using it.

Bug 4911768

Change-Id: I4eba6f02ab79c1d4a5bdefb3ec831cc4ae34d527
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
ac4e44ec34 scsi: ufs: Assert before de-assert
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: I8c11d202b20fd90320dae510e3da2193a1d8dfdf
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
24e024444b scsi: ufs: check for go bit status
GO bit will be cleared after driver
writing it to 1. Need to check the
clear status. Added check for the same.

Bug 4782274

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: I71f035a27fb95de3e37d515a34c48c493f827a44
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
e86ab401cc add delay after hdiv
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: I357dd071ad76dc81d16810f8b5f0e44cf42fa8a3
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
f66b44645e scsi: ufs: Set pll3 rate_b
Set PLL3 RATEB rate as 582400000.

Bug 4757621

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: I18652261b7224d162a502de3d30e5eb354fd6675
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
fb95615c17 ufs: Remove rx calibration
Removed rx calibration in resume.

Change-Id: Ib7eb0c306cb1f424b4dca707e39e70f2a42fe4e0
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
701657e6f7 ufs: Set utmi_pll1 as parent for cpu_isc clocks
Set utmi_pll1 as parent for cpu_isc clocks

Bug 4782274

Change-Id: Iab71527dc6de3f46d4b7880c3dd00eadc130c5ba
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
711b5110fc scsi: ufs: Enable quirks for power sequence change
Change-Id: I658e6b56cd05cb366a6ae3d277d05fb97a663f6a
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
179dc474f7 ufs: scsi: enable lane1 rx calibration first
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: I549a15b2853c1b890aec7e66c5296d56b8616f25
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
0b489f8588 ufs: Do not disable clocks in suspend
Do not disable clocks in suepend.

Bug 4732470

Change-Id: Iabf05c1d80e3339c10f7824edcc333cef065bc33
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
14d246d8a3 scsi: ufs: Remove dev_err for information prints
dev_err is used for information prints.
Changed them to dev_info and dev_dbg.

Bug 4736849

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: I990edef75566ca718fab611b36385f6ec5f12c44
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
c3d33b827c ufs: Enable ufs for RDL fix parts only
Read fuse to check if chip has RDL fix or not.
Return error for non-RDL chips.

Bug 4243018

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: Ibe441ca136c18e03cebbc1cd5d0cc529d45005c6
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
347e5727ac ufs: Fix ufs crash
Change-Id: I4d266fa940ce3428cc57805ada917f7f42d0ed32
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
66e8bf380a ufs: ufs clock change to use ufs_cg_sys_div
Change-Id: I3d79d442fb10cbfc3d2e4e8d8803190dce839c93
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
e318d3196c scsi: ufs: Do not enable pllrefe clk in T264
pllrefe is not used in T264 ufs. Do not enable it.

Bug 4199271

Change-Id: I0d940b66e1a30ac2b097c07a1ba470ddc2f41de4
2025-07-24 10:19:10 +00:00
Mallikarjun Kasoju
5ed0a15b2d scsi: ufs: Corrected ufs parent clock name
Corrected ufs parent clock name.

Bug 4199271

Change-Id: I528d32f246ec6f6167e7895b8bec30b1f6c959b1
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
2025-07-24 10:19:09 +00:00
Mallikarjun Kasoju
f869389dfc ufs: Corrected ufs parent clock
UFS parent clock in T264 is pllrefufs_clkout624
and the rate is to 208 MHz.

Bug 4199271

Change-Id: I5b86e199f93fc1c81506cb29391b96efdc7de3a4
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
2025-07-24 10:19:09 +00:00
Mallikarjun Kasoju
728681aa60 ufs: Set ufs HCLKDIV clock to 0xD0
Set HCLKDIV to 0xD0 as per IAS.

Bug 4199271

Change-Id: I4779c74c657d8723a27a167096dfac9d22128436
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
2025-07-24 10:19:09 +00:00
Mallikarjun Kasoju
e850611327 ufs: Enable mphy_l0_uphy_tx_fifo clock
Enable mphy_l0_uphy_tx_fifo clock.

Bug 4199271

Change-Id: Idabbf61851446ae3f3f405ffe4fdb0a514eed01d
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
2025-07-24 10:19:09 +00:00
Mallikarjun Kasoju
248a85dbbc ufs: Add mphy TX calibration support
Added mphy TX calibration support.

Bug 4199271

Change-Id: Ia48945b026ac9d264d24937f9737484de8f203cd
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
2025-07-24 10:19:09 +00:00
Jon Hunter
f01227d4ea drivers: Drop inline from driver remove wrapper
The driver remove function is a function pointer and therefore, it does
not make sense to define the function as an 'inline'. Update the
coccinelle script and drivers to remove the inline statement.

Bug 4749580

Change-Id: Ia03691b75c4edffe609f27468b911a92a5ddbd68
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233980
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:08 +00:00
Krishna Yarlagadda
9dc14f1027 tegra: prod: use legacy prod settings
Remove references to upstream prod settings and use legacy prod.

Bug 4765671

Change-Id: Iafe36bdeab027ae121a99bfda665cc28089907c6
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3186209
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-08-13 10:46:51 -07:00
Jon Hunter
951b2423a8 drivers: Fix platform_driver remove for Linux v6.11
In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. Update all the impacted drivers
as necessary to fix this.

Bug 4749580

Change-Id: I3bb5c549777f7ccad0e3f870373fdd25726ad7ed
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3182878
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-08-11 17:20:34 -07:00
Mallikarjun Kasoju
3049af901c ufs: Do not use clk_m clock
clk_m clock is only T23x chips.
Kept condition accordingly to use clk_m
clocks in T23x chips only.

Bug 4199271

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: I12259bddfec91b54504bb70356e0fc29a72f067d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3145425
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-05-28 10:33:29 -07:00
Mallikarjun Kasoju
d260c69c83 ufs: Do not use mphy_force_ls_mode clock
mphy_force_ls_mode clock is only T23x chips.
Kept condition accordingly to use mphy_force_ls_mode
clocks in T23x chips only.

Bug 4199271

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: I9b176ec6b1a9fd0ea0d52e857eb011197ef9234e
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3145424
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-05-28 10:33:19 -07:00
Mallikarjun Kasoju
0475230ef4 ufs: Do not use mphy_l0_tx_2x_symb clock
mphy_l0_tx_2x_symb clock is only for T23x chips.
Kept condition accordingly to use mphy_l0_tx_2x_symb
clocks in T23x chips only.

Bug 4199271

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: Ice48db41a45da763cfe4af18cc1440c59fb20b38
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3145422
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
2024-05-28 10:33:09 -07:00
Mallikarjun Kasoju
fee74728d3 ufs: Do not use TX_MUX_SYMB_DIV and TX_MUX_SYMB_DIV
TEGRA234_CLK_MPHY_L0_TX_MUX_SYMB_DIV and TEGRA234_CLK_MPHY_L0_RX_MUX_SYMB_DIV clock are
only for T23x chips. Kept condition accordingly to use them in T23x chips only.

Bug 4199271

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: I228b9da7c92628e3dfce82f571b5aaf0f73427a5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3143258
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Andy Sobczyk <asobczyk@nvidia.com>
2024-05-23 08:49:05 -07:00
Mallikarjun Kasoju
099f295391 ufs: Enable prod settings
Enable prod settings for ufs.

Bug 4283554

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: Icb4eaa753060e690e4524779b4bdee670498f468
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3137606
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-05-20 08:27:12 -07:00
Mallikarjun Kasoju
d7611d6efc ufs: RX Calibration change
Fixed RX Calibration sequence.

Bug 4465134

Change-Id: I7f89d58c081511b067134bf86f81720b13af9abc
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3074579
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-04-26 02:27:35 -07:00
Mallikarjun Kasoju
3c36bb896e ufs: Add support for VSP
Added support for VSP

Bug 3977186

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: If59dc2e0512b08f40a8b6dd3eef02c1bcf2004cb
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3078740
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-03-01 12:42:25 -08:00
Jon Hunter
85692c2c64 scsi: ufs: Use conftest for Tegra264
The chip ID for Tegra264 was added in Linux v6.5 and not Linux v6.1 as
indicated in the Tegra UFS driver. Hence, the Tegra UFS driver does not
build against any generic Linux v6.1 to v6.4 kernel. Fix this by using
conftest to determine if the chip ID definition is present in the
kernel.

Bug 4221847

Change-Id: If2ca1202b2a69bf7de36fc327406f1579d2f4969
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3054870
(cherry picked from commit abeacc3534)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3054827
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-20 19:34:18 -08:00
Jon Hunter
ce916e3f13 ufs: Remove UFSHCD_QUIRK_ENABLE_STREAM_ID
Remove the legacy downstream quirk 'UFSHCD_QUIRK_ENABLE_STREAM_ID' and
always use the supported upstream quirk from now on. The legacy quirk
will never be upstreamed and so to support 3rd Party Linux distributions
that will not have this quirk, we should only support the official
upstream quirk.

Bug 4346767
Bug 4450187

Change-Id: Iabec6beb63b99ada7e8893cfa2acc0ed5e7ee92f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3045039
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: svc-bootloader-acv <svc-bootloader-acv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-16 21:20:54 -08:00
Laxman Dewangan
b2dcbdbc93 ufs: Use UFS headers directly if it is public header in core kernel
The UFS headers are moved to include as public headers from
Linux 5.19. Use the headers directly from the core kernel
instead of making the copy in drivers-private for nvidia-oot.

Keep copy of only those drivers which are still in the
drivers folder in core kernel.

This will help to align all definition which driver needs to
sync with core driver available in the core kernel.

Bug 4346767

Change-Id: I1e59e32bee0f89591e50fff2f61e35d468f4207c
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3039312
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-24 11:51:51 -08:00
Laxman Dewangan
dfff2311c3 ufs: Port UFS driver to use headers from core kernel for Linux 6.7
Some of the drivers-private headers are now available in public
header path in core kernel. Use such headers directly from the
core kernel for Linux 6.7 and later instead of copying it in the
nvidia-oot/include/driver-private.

Also match the quirks definition with core kernel for Linux 6.0 and
later.

Bug 4346767

Change-Id: If994466a3cabc6df8eeb0e97018f48d48a8306dc
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3038489
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Tested-by: Vishwaroop A <va@nvidia.com>
2023-12-20 16:41:16 -08:00
Jon Hunter
f748f0ef72 scsi: ufs: Use conftest for suspend differences
In Linux v5.19, the arguments to the 'suspend' function pointer defined
in the structure 'ufs_hba_variant_ops' was updated to add a 'status'
argument. Add a new test to the conftest script that checks if the
'suspend' function has a 'status' argument and use the definition
created by conftest to select which structure member is used.

This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.

Bug 4221847

Change-Id: I05011a4a1aff7c54cd258147d6519b696904a2de
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996214
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-11 01:17:26 -08:00
Jon Hunter
54e01347ea scsi: ufs: Clean-up headers
Clean-up the UFS headers by adding a new top-level header for ufshcd.h,
ufshci.h and unipro.h that will include the appropriate header
depending on kernel version. This saves replicating the kernel version
check for every source file that includes these headers.

Note that the ufshcd-pltfrm.h header is identical between v5.15, v5.16
and 6.1 kernels and so remove the duplicated versions of this header and
just use a common header for all kernel versions.

Bug 4221847

Change-Id: I0e0ba2f4389af7e34ab62e3131141405d87aeeb1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996211
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-11 01:17:15 -08:00
Mallikarjun Kasoju
88e674112a ufs: Fix issues seen ufs sc7
Asynchronous errors are seen during
SC7 suspend. These are caused by
mphy clock programming which is not present
on FPGA.

Bug 4373698
Bug 4373689

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Change-Id: I0a56e77cc99f5e2015904fa69ba1cac52753f8f5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3027611
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-07 08:09:40 -08:00
Mallikarjun Kasoju
63486a422c ufs: mphy programming change for fpga
mphy is not available in fpga.
Updated driver accordingly.

Bug 4306006

Change-Id: I179678e51c3a0bb4607bf91d39c7e1f44641752f
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3002056
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-25 12:05:12 -07:00