diff options
author | John Garry <john.garry@huawei.com> | 2015-11-18 00:50:57 +0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2015-11-25 22:13:07 -0500 |
commit | e4189d539f78f335f57266d2c3a848cadbd3a00f (patch) | |
tree | 6ee9d34d595352f57b875bc9f25a571161f8a058 /drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | |
parent | 0efff300c72df76476d5d48d13a069ee04974ab3 (diff) |
hisi_sas: Add control phy handler
Add method for lldd_control_phy. Currently link rate control and spinup
hold is unsupported.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/hisi_sas/hisi_sas_v1_hw.c')
-rw-r--r-- | drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index 64b17a183090..a95259cdc2bf 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -764,6 +764,14 @@ static void enable_phy_v1_hw(struct hisi_hba *hisi_hba, int phy_no) hisi_sas_phy_write32(hisi_hba, phy_no, PHY_CFG, cfg); } +static void disable_phy_v1_hw(struct hisi_hba *hisi_hba, int phy_no) +{ + u32 cfg = hisi_sas_phy_read32(hisi_hba, phy_no, PHY_CFG); + + cfg &= ~PHY_CFG_ENA_MSK; + hisi_sas_phy_write32(hisi_hba, phy_no, PHY_CFG, cfg); +} + static void start_phy_v1_hw(struct hisi_hba *hisi_hba, int phy_no) { config_id_frame_v1_hw(hisi_hba, phy_no); @@ -772,6 +780,18 @@ static void start_phy_v1_hw(struct hisi_hba *hisi_hba, int phy_no) enable_phy_v1_hw(hisi_hba, phy_no); } +static void stop_phy_v1_hw(struct hisi_hba *hisi_hba, int phy_no) +{ + disable_phy_v1_hw(hisi_hba, phy_no); +} + +static void phy_hard_reset_v1_hw(struct hisi_hba *hisi_hba, int phy_no) +{ + stop_phy_v1_hw(hisi_hba, phy_no); + msleep(100); + start_phy_v1_hw(hisi_hba, phy_no); +} + static void start_phys_v1_hw(unsigned long data) { struct hisi_hba *hisi_hba = (struct hisi_hba *)data; @@ -1687,6 +1707,9 @@ static const struct hisi_sas_hw hisi_sas_v1_hw = { .get_free_slot = get_free_slot_v1_hw, .start_delivery = start_delivery_v1_hw, .slot_complete = slot_complete_v1_hw, + .phy_enable = enable_phy_v1_hw, + .phy_disable = disable_phy_v1_hw, + .phy_hard_reset = phy_hard_reset_v1_hw, .get_wideport_bitmap = get_wideport_bitmap_v1_hw, .complete_hdr_size = sizeof(struct hisi_sas_complete_v1_hdr), }; |