aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/ufs/ufs-qcom.c
AgeCommit message (Collapse)Author
2017-11-21scsi: ufs-qcom: Fix module autoloadJavier Martinez Canillas
[ Upstream commit ab3dabb3e8cf077850f20610f73a0def1fed10cb ] If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/scsi/ufs/ufs-qcom.ko | grep alias $ After this patch: $ modinfo drivers/scsi/ufs/ufs-qcom.ko | grep alias alias: of:N*T*Cqcom,ufshcC* alias: of:N*T*Cqcom,ufshc Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-12scsi: ufs: add quirk to increase host PA_SaveConfigTimeSubhash Jadavani
[ Upstream commit 56d4a1866d748732fd8d690b2c2156bbc9c9eb02 ] The maximum value PA_SaveConfigTime is 250 (10us) but this is not enough for some vendors. Gear switch from PWM to HS may fail even with this max. PA_SaveConfigTime. Gear switch can be issued by host controller as an error recovery and any software delay will not help on this case so we need to increase PA_SaveConfigTime to >32us as per vendor recommendation. This change adds a quirk to increase the PA_SaveConfigTime parameter. Reviewed-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-14scsi: ufs-qcom: add printouts of testbus debug registersYaniv Gardi
This change adds printouts of testbus and debug registers. Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-03-14scsi: ufs-qcom: enable/disable the device ref clockYaniv Gardi
This change enables the device ref clock before changing to HS mode and disables it if entered to PWM mode. Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-03-14scsi: ufs-qcom: set PA_Local_TX_LCC_Enable before link startupYaniv Gardi
Some UFS devices (and may be host) have issues if LCC is enabled. So we are setting PA_Local_TX_LCC_Enable to 0 before link startup which will make sure that both host and device TX LCC are disabled once link startup is completed. Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-03-14scsi: ufs-qcom: add number of lanes per directionYaniv Gardi
Different platform may have different number of lanes for the UFS link. Add parameter to device tree specifying how many lanes should be configured for the UFS link. Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-09scsi: ufs-qcom: add QUniPro hardware support and power optimizationsYaniv Gardi
New revisions of UFS host controller supports the new UniPro hardware controller (referred as QUniPro). This patch adds the support to enable this new UniPro controller hardware. This change also adds power optimization for bus scaling feature, as well as support for HS-G3 power mode. Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-09scsi: ufs-qcom: add debug prints for test busYaniv Gardi
Adds support for configuring and reading the test bus and debug registers. This change also adds another vops in order to print the debug registers. Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-09scsi: ufs: make the UFS variant a platform deviceYaniv Gardi
This change turns the UFS variant (SCSI_UFS_QCOM) into a UFS a platform device. In order to do so a few additional changes are required: 1. The ufshcd-pltfrm is no longer serves as a platform device. Now it only serves as a group of platform APIs such as PM APIs (runtime suspend/resume, system suspend/resume etc), parsers of clocks, regulators and pm_levels from DT. 2. What used to be the old platform "probe" is now "only" a pltfrm_init() routine, that does exactly the same, but only being called by the new probe function of the UFS variant. Reviewed-by: Rob Herring <robherring2@gmail.com> Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Tested-by: Alim Akhtar <alim.akhtar@samsung.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-09scsi: ufs: creates wrapper functions for vopsYaniv Gardi
In order to simplify the code a set of wrapper functions is created to test and call each of the variant operations. Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Tested-by: Alim Akhtar <alim.akhtar@samsung.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-09scsi: ufs: add ufshcd_get_variant ufshcd_set_variantYaniv Gardi
This patch adds ufshcd_get_variant() and ufshcd_set_variant() routines in order to get/set the variant specific data. Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Tested-by: Alim Akhtar <alim.akhtar@samsung.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-09scsi: ufs-qcom: fix compilation warning if compiled as a moduleYaniv Gardi
This change fixes a compilation warning that happens if SCSI_UFS_QCOM is compiled as a module. Also this patch fixes an error happens when insmod the module: "ufs_qcom: module license 'unspecified' taints kernel." Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-06-02scsi: ufs-qcom: enable UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSIONYaniv Gardi
Newer revisions of QUALCOMM Technologies UFS host controller may not advertise the correct version information in UFS HCI VER register. To handle this, enable UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION to let UFS standard host controller driver call into vendor specific operation to get right UFS HCI VER register value. Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-06-02scsi: ufs-qcom: enable UFSHCD_QUIRK_DME_PEER_ACCESS_AUTO_MODE quirkYaniv Gardi
Current version of host controller on QUALCOMM Technologies requires this quirk to be enabled, as DME commands to device must be sent only in AUTO mode (SLOW AUTO or FAST AUTO). Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-06-02scsi: ufs-qcom: enable quirk to fix gear change to HSYaniv Gardi
With the G3 UFS devices, changing gear into HS is failing in UFS host controllers of version 0x2. The quirk solves the problem of changing gear into HS by enabling the attribute that specifies whether or not the inbound Link supports unterminated line in HS mode. Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-06-02scsi: ufs-qcom: enable UFSHCD_QUIRK_BROKEN_LCCYaniv Gardi
LCC (Line Control Command) are being used for communication between UFS host and UFS device. But UFS host controller on QUALCOMM Technologies have an issue with issuing the LCC commands to UFS device and hence this quirk is enabled in order to to disable LCC from the host side. Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-06-02scsi: ufs-qcom: don't enable interrupt aggregationYaniv Gardi
Current versions of UFS host controllers on QUALCOMM Technologies have interrupt aggregation logic broken. Interrupt aggregation may not work if both threshold count and timeout is enabled. Hence disable interrupt aggregation by enabling UFSHCD_QUIRK_BROKEN_INTR_AGGR quirk until its fixed in the newer UFS host controller revisions. Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10ufs: add support to allow non standard behaviours (quirks)Yaniv Gardi
Some implementation of UFS host controller HW might have some non-standard behaviours (quirks) when compared to behaviour specified by UFSHCI specification. This patch add support to allow specifying all such quirks to standard UFS host controller driver so standard driver takes them into account. In this change a UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS is introduced, where a minimum delay of 1ms is required before DME commands for stability purposes. Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10ufs-qcom: save controller revision info in internal structureYaniv Gardi
Sometimes, specific information about the UFS controller revision is required in order to determine certain operations or execute controller dependent quirks. In order to avoid reading the controller revision multiple times, we simply read it once and save this information in internal structure. Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-01-20ufs-qcom: add support for Qualcomm Technologies Inc platformsYaniv Gardi
This change adds support for Qualcomm Technologies Inc platforms that use UFS driver. for example, it adds : - PM specific operations during hibern8, suspend, resume, clock setup - qcom-ufs generic phy driver initialization, calibration, power-on/off sequence, etc. - UFS Controller specific configuration - Rate, Gear, Mode negotiation between device and controller Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Dov Levenglick <dovl@codeaurora.org> Signed-off-by: Christoph Hellwig <hch@lst.de>