Commit 63fb11b8 authored by John Garry's avatar John Garry Committed by Martin K. Petersen

hisi_sas: add v2 tmf functions

Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e8fed0e9
...@@ -847,6 +847,14 @@ static void enable_phy_v2_hw(struct hisi_hba *hisi_hba, int phy_no) ...@@ -847,6 +847,14 @@ static void enable_phy_v2_hw(struct hisi_hba *hisi_hba, int phy_no)
hisi_sas_phy_write32(hisi_hba, phy_no, PHY_CFG, cfg); hisi_sas_phy_write32(hisi_hba, phy_no, PHY_CFG, cfg);
} }
static void disable_phy_v2_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_v2_hw(struct hisi_hba *hisi_hba, int phy_no) static void start_phy_v2_hw(struct hisi_hba *hisi_hba, int phy_no)
{ {
config_id_frame_v2_hw(hisi_hba, phy_no); config_id_frame_v2_hw(hisi_hba, phy_no);
...@@ -854,6 +862,18 @@ static void start_phy_v2_hw(struct hisi_hba *hisi_hba, int phy_no) ...@@ -854,6 +862,18 @@ static void start_phy_v2_hw(struct hisi_hba *hisi_hba, int phy_no)
enable_phy_v2_hw(hisi_hba, phy_no); enable_phy_v2_hw(hisi_hba, phy_no);
} }
static void stop_phy_v2_hw(struct hisi_hba *hisi_hba, int phy_no)
{
disable_phy_v2_hw(hisi_hba, phy_no);
}
static void phy_hard_reset_v2_hw(struct hisi_hba *hisi_hba, int phy_no)
{
stop_phy_v2_hw(hisi_hba, phy_no);
msleep(100);
start_phy_v2_hw(hisi_hba, phy_no);
}
static void start_phys_v2_hw(unsigned long data) static void start_phys_v2_hw(unsigned long data)
{ {
struct hisi_hba *hisi_hba = (struct hisi_hba *)data; struct hisi_hba *hisi_hba = (struct hisi_hba *)data;
...@@ -2145,6 +2165,9 @@ static const struct hisi_sas_hw hisi_sas_v2_hw = { ...@@ -2145,6 +2165,9 @@ static const struct hisi_sas_hw hisi_sas_v2_hw = {
.get_free_slot = get_free_slot_v2_hw, .get_free_slot = get_free_slot_v2_hw,
.start_delivery = start_delivery_v2_hw, .start_delivery = start_delivery_v2_hw,
.slot_complete = slot_complete_v2_hw, .slot_complete = slot_complete_v2_hw,
.phy_enable = enable_phy_v2_hw,
.phy_disable = disable_phy_v2_hw,
.phy_hard_reset = phy_hard_reset_v2_hw,
.max_command_entries = HISI_SAS_COMMAND_ENTRIES_V2_HW, .max_command_entries = HISI_SAS_COMMAND_ENTRIES_V2_HW,
.complete_hdr_size = sizeof(struct hisi_sas_complete_v2_hdr), .complete_hdr_size = sizeof(struct hisi_sas_complete_v2_hdr),
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment