diff options
| author | Subhash Jadavani <subhashj@codeaurora.org> | 2015-01-22 21:26:44 -0800 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 10:58:34 -0700 |
| commit | 7ae3423485a7331debe766160c600d2ec58dffbc (patch) | |
| tree | 943d17c0107adfc5b665ad4b8ffde8c18b2b390a | |
| parent | 1008d1889dd4a802c79f7ff3a31ec6dda57dcb91 (diff) | |
scsi: ufs: fix UFS HCI 2.0 version register value
It seems UFS version register (offset 08h) fields position has changed in
UFS HCI 2.0 specification when compared to 1.0/1.0 specification.
According to 2.0 spec, UFS version register value should be 0000_0200h
(version 2.0). This change fixes the expected version register value and
also added the error message if host controller advertises invalid
version.
Change-Id: I2dd399fd7e47ce99b60591f7eac75e7305758bde
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
| -rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 12 | ||||
| -rw-r--r-- | drivers/scsi/ufs/ufshci.h | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index e2d639a03c78..a58d337d62bf 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -929,8 +929,9 @@ static const char *ufshcd_hibern8_on_idle_state_to_string( static u32 ufshcd_get_local_unipro_ver(struct ufs_hba *hba) { - /* HCI version < 2.0 supports UniPro 1.41 */ - if (hba->ufs_version < UFSHCI_VERSION_20) + /* HCI version 1.0 and 1.1 supports UniPro 1.41 */ + if ((hba->ufs_version == UFSHCI_VERSION_10) || + (hba->ufs_version == UFSHCI_VERSION_11)) return UFS_UNIPRO_VER_1_41; else return UFS_UNIPRO_VER_1_6; @@ -8262,6 +8263,13 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) /* Get UFS version supported by the controller */ hba->ufs_version = ufshcd_get_ufs_version(hba); + /* print error message if ufs_version is not valid */ + if ((hba->ufs_version != UFSHCI_VERSION_10) && + (hba->ufs_version != UFSHCI_VERSION_11) && + (hba->ufs_version != UFSHCI_VERSION_20)) + dev_err(hba->dev, "invalid UFS version 0x%x\n", + hba->ufs_version); + /* Get Interrupt bit mask per version */ hba->intr_mask = ufshcd_get_intr_mask(hba); diff --git a/drivers/scsi/ufs/ufshci.h b/drivers/scsi/ufs/ufshci.h index 6377765cf241..733b433ab3dd 100644 --- a/drivers/scsi/ufs/ufshci.h +++ b/drivers/scsi/ufs/ufshci.h @@ -91,7 +91,6 @@ enum { /* Controller UFSHCI version */ enum { -<<<<<<< HEAD UFSHCI_VERSION_10 = 0x00010000, /* 1.0 */ UFSHCI_VERSION_11 = 0x00010100, /* 1.1 */ UFSHCI_VERSION_20 = 0x00000200, /* 2.0 */ |
