Commit Graph

48 Commits

Author SHA1 Message Date
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
Mallikarjun Kasoju
644f308d71 scsi: ufs: Enable PA to VA enable control
Enable UFSHC_PA_VA_CTRL bit for ISC Fabric to consider
virtual memory when SMMU is enabled.

If UFSHC_PA_VA_CTRL is not set, ISC Fabric considers ufs
allocated memory as physical address.

Bug 4243018
Bug 4199052
Bug 4334121

Change-Id: Ia557ea510673f19f59d23ac704b068050f5e355e
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3000988
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-24 23:50:46 -07:00
Jon Hunter
a4334a5009 scsi: ufs: Add missing headers
When compiling the Tegra UFS driver on certain kernels the various clk
and udelay functions are not found. Add the corresponding headers to fix
the build.

Bug 4221847

Change-Id: Ief2f20abf3704ab7c61c5c802e9eb2ec201179c7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996210
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 15:47:12 -07:00
Manish Bhardwaj
3d4d545d18 nvidia-oot: ufs: add support for ufs driver for thor
Bug 4199271

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: If8f0270e7d1141e218d031ff8faca1274ec42c96
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2974347
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-20 18:55:44 -07:00
Mallikarjun Kasoju
c9dae14cce scsi: ufs: Fix CBB errors for K6.1
Made below changes to hba structure to make it
symmetric as core hba structure for K6.1.

1. Remove unused members in hbs structure.
2. Added write booster mutex.

Bug 4161857

Change-Id: I1fdb5e7da11e51edb9f072f8fde25795b38bdc30
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2973021
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-04 08:25:48 -07:00
Mallikarjun Kasoju
7939750e65 scsi: ufs: Fix CBB errors
UFS virtualization registers are accessed
without taking controller out of reset.

Bug 4161857

Change-Id: I6860eb2011fc6be5ffe9dba91ed94a8a749a4add
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2970936
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-01 13:08:08 -07:00
Jian-Min Liu
6f90c6d858 Fix unused function errors for ack user build
In Android's user-build, debugfs is not configured. This has led to
multiple warning errors related to Debugfs usage in the nvidia-oot
build. Add CONFIG_DEBUG_FS conditional compilation around the
functions that use it.

drivers/scsi/ufs/ufs-tegra-common.c:39:13: error: unused function
'ufs_tegra_init_debugfs' [-Werror,-Wunused-function]
static void ufs_tegra_init_debugfs(struct ufs_hba *hba)
            ^
 1 error generated.

drivers/platform/tegra/aon/tegra-aon-debug.c:732:13:
error: unused function 'tegra_aondbg_recv_msg'
[-Werror,-Wunused-function]
static void tegra_aondbg_recv_msg(struct mbox_client *cl, void *rx_msg)
            ^

drivers/platform/tegra/aon/tegra-aon-debug.c:749:12:
error: unused function 'aon_dbg_init' [-Werror,-Wunused-function]
static int aon_dbg_init(struct tegra_aondbg *aon)
           ^
 2 errors generated.

Bug 4230728

Change-Id: I4210c3574b4d76205fdca45990e9ccc02c18620a
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2964635
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-08-23 11:19:18 -07:00
Abhilash G
2797b7499d scsi: ufs: Remove hardcoded programming to enable HS mode
Remove hardcoded programming to enable HS mode since we
need to support PWM mode for UFS for provisioning.

Bug 3866554

Change-Id: I8b3ef6ca61b51009129f6b42fa169eaa5101c347
Signed-off-by: Abhilash G <abhilashg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938538
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-21 12:11:05 -07:00
Abhilash G
e3e15a3cb1 scsi: ufs: Fix UFS CBB errors
Fix UFS CBB errors by using the vendor register for
T234 instead of T194.

Bug 4089453

Change-Id: Ic54b2eea6822d459a6103d15eb60ff2d595fc256
Signed-off-by: Abhilash G <abhilashg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2906058
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-05 14:27:39 -07:00
Bharat Nihalani
1f9587aca3 drivers: Fix build errors with DEBUGFS_FS disabled
When CONFIG_DEBUG_FS is disabled, build errors are seen in the
following 2 drivers:

1. bpmpfw - The build error was seen because bpmp-debugfs.c was
getting compiled even when CONFIG_DEBUG_FS was disabled.

2. ufs - The build error was seen due to a couple of reasons:
- Function debugfs_provision_init is defined in a file that is
protected with CONFIG_DEBUG_FS, but is called from another file
unconditionally.
- In ufs-tegra-common.c, there are calls to debugfs_* functions, but
inclusion of the standard header debugfs.h is protected under
CONFIG_DEBUG_FS.

Fix these issues with this change.

Bug 4164776

Change-Id: Iae6384fd2352e55aed2a0ea85e778be6c26a4d54
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2926891
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-28 08:27:28 -07:00
Laxman Dewangan
b275ffc1ef ufs: tegra: Create provisioned and normal version of module
Create the two loadable module for ufs tegra, one without
provisioning and other with provisioning.

This will help to avoid need of the CONFIG variable and
usecase to use the module per their requirements.

Change-Id: I2c9d6e9680b9b2007fcccfa91002154ed29a6928
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2869279
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-13 05:01:24 -07:00
Abhilash G
d4d822ee06 scsi: ufs: Add support for UFS provisioning
Add support for UFS provisioning and changing
reference clock frequency using sysfs nodes
for automotive flashing kernel.

Bug 3978622

Change-Id: I236c3d9de3d7ea89c631aec6f11ef20d11656549
Signed-off-by: Abhilash G <abhilashg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2859426
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-08 06:20:31 -08:00
Abhilash G
60153c77c1 scsi: ufs: Make functions static and remove unused functions
Sparse is reporting following warnings:
warning: symbol 'ufs_tegra_disable_mphy_slcg' was not declared.
warning: symbol 'ufs_tegra_mphy_tx_advgran' was not declared.
warning: symbol 'ufs_tegra_mphy_rx_advgran' was not declared.
warning: symbol 'ufs_tegra_ufs_aux_ref_clk_enable' was not declared.
warning: symbol 'ufs_tegra_ufs_aux_ref_clk_disable' was not declared.
warning: symbol 'ufs_tegra_aux_reset_enable' was not declared
warning: symbol 'ufs_tegra_ufs_aux_prog' was not declared.

Resolve these issues by making them static and remove functions
that are not getting called.

Bug 3954363

Change-Id: I59b2feeb45c93d8e51dca4fb0d3c752043c15ecd
Signed-off-by: Abhilash G <abhilashg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2855754
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-02-16 00:04:24 -08:00
Jon Hunter
c9981b9ac9 scsi: ufs: Fix build for Linux v6.2
Building the Tegra UFS driver with Linux v6.2 fails with the following
error ...

 drivers/scsi/ufs/ufs-tegra.c:1004:10: error: implicit declaration of
 function ‘pinctrl_select_state’ [-Werror=implicit-function-declaration]
    ret = pinctrl_select_state(ufs_tegra->ufs_pinctrl,
          ^~~~~~~~~~~~~~~~~~~~

Fix this by including the "pinctrl/consumer.h" header file that defines
this function.

Bug 3936429

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I91fdbcb39d8d458021661e2103aa2dc236001066
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2841035
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-01-11 11:26:56 -08:00
Abhilash G
7fb44152e2 scsi: ufs: Add MPHY war for boot failure
Added two wars for boot failure:

1. Added MPHY reset after link startup and set
2. Override control of mux select of MPHY2UPHY RX interface signals

Bug 3677354
Bug 3621817

Change-Id: Ia412d328561905faad4df8982fa86f754f028943
Signed-off-by: Abhilash G <abhilashg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2794834
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-13 06:16:25 -08:00
Abhilash G
6f8cb66166 scsi: ufs: Add Stream ID support
Add stream-id programming and Configure
stream-id in resume.

Bug 3441520
Bug 3621817

Change-Id: I16b01ef37e4549a5263d8e232d78805c8f84a5f6
Signed-off-by: Abhilash G <abhilashg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2794804
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-12 15:01:00 -08:00
Jon Hunter
fc8041ed6a scsi: ufs: Fix build for Linux v5.16
When building the UFS driver for Linux v5.16 some header files such as
keyslot-manager.h are not found and the build fails. Update the UFS
driver and reorganise the header files to fix the build for Linux v5.16.

Bug 3820317

Change-Id: I10eea40411369e4c5d6809086bb1c35628c0bbad
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2791963
Reviewed-by: Kartik . <kkartik@nvidia.com>
Reviewed-by: Abhilash G <abhilashg@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-10-20 02:19:39 -07:00
Kartik
1ba41d5ee2 scsi: ufs: add ufs-tegra driver as oot module
Add ufs-tegra driver.

Bug 3621817

Change-Id: I4bf56d02ad627af84d516262edd93e1b593f4e50
Signed-off-by: Kartik <kkartik@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2734906
Reviewed-by: Abhilash G <abhilashg@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Abhilash G <abhilashg@nvidia.com>
2022-09-07 12:19:47 -07:00