scsi: ufs: Add UFS host PHY driver for MSM targets

Add MSM UFS host PHY driver which binds with UFSHCD platform
driver exposing vendor specific operations to initialize the
PHY. Since the controller and PHY are tightly coupled in the
system, some of the MSM specific controller register
configuration is also applied inline while initializing PHY.

Add a new compatible property "qcom,ufshc" which specifies the
UFS host controller on MSM platforms. The UFS controller driver
binds with UFS PHY driver using the phandle reference of PHY
devicetree node.

Change-Id: If695a844d03268151c6c846bdfa6cee8ff84491b
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
[subhashj@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
This commit is contained in:
Sujit Reddy Thumma 2013-07-08 19:22:10 +05:30 committed by David Keitel
parent c92fad3700
commit dee78049a3
4 changed files with 1490 additions and 2 deletions

View file

@ -0,0 +1,33 @@
* MSM Universal Flash Storage (UFS) PHY
UFSPHY nodes are defined to describe on-chip UFS PHY hardware macro.
Each UFS PHY node should have its own node.
To bind UFS PHY with UFS host controller, the controller node should
contain a phandle reference to UFS PHY node.
Required properties:
- compatible : compatible list, contains "qcom,ufsphy"
- reg : <registers mapping>
- vdda-phy-supply : phandle to main PHY supply for analog domain
- vdda-pll-supply : phandle to PHY PLL and Power-Gen block power supply
Optional properties:
- vdda-phy-max-microamp : specifies max. load that can be drawn from phy supply
- vdda-pll-max-microamp : specifies max. load that can be drawn from pll supply
Example:
ufsphy1: ufsphy@0xfc597000 {
compatible = "qcom,ufsphy";
reg = <0xfc597000 0x800>;
vdda-phy-supply = <&pma8084_l4>;
vdda-pll-supply = <&pma8084_l12>;
vdda-phy-max-microamp = <50000>;
vdda-pll-max-microamp = <1000>;
};
ufshc@0xfc598000 {
...
ufs-phy = <&ufsphy1>;
};

View file

@ -91,4 +91,4 @@ config SCSI_UFS_TEST
This adds UFS Host controller unit-test framework.
The UFS unit-tests register as a block device test utility to
the test-iosched and will be initiated when the test-iosched will
be chosen to be the active I/O scheduler.
be chosen to be the active I/O scheduler.

1446
drivers/scsi/ufs/ufs-msm.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -596,7 +596,7 @@ static inline bool ufshcd_is_intr_aggr_allowed(struct ufs_hba *hba)
*/
static inline void ufshcd_rmwl(struct ufs_hba *hba, u32 mask, u32 val, u32 reg)
{
u32 tmp;
u32 tmp;
tmp = ufshcd_readl(hba, reg);
tmp &= ~mask;
@ -702,6 +702,15 @@ static inline int ufshcd_dme_peer_get(struct ufs_hba *hba,
return ufshcd_dme_get_attr(hba, attr_sel, mib_val, DME_PEER);
}
/* variant specific ops structures */
#ifdef CONFIG_SCSI_UFS_MSM
extern const struct ufs_hba_variant_ops ufs_hba_msm_vops;
#else
static const struct ufs_hba_variant_ops ufs_hba_msm_vops = {
.name = "msm",
};
#endif
int ufshcd_hold(struct ufs_hba *hba, bool async);
void ufshcd_release(struct ufs_hba *hba);