aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/hisi_sas/hisi_sas.h2
-rw-r--r--drivers/scsi/hisi_sas/hisi_sas_v2_hw.c11
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h
index 60bd652534fe..9400824f23ad 100644
--- a/drivers/scsi/hisi_sas/hisi_sas.h
+++ b/drivers/scsi/hisi_sas/hisi_sas.h
@@ -180,6 +180,8 @@ struct hisi_sas_device {
180}; 180};
181 181
182struct hisi_sas_tmf_task { 182struct hisi_sas_tmf_task {
183 int force_phy;
184 int phy_id;
183 u8 tmf; 185 u8 tmf;
184 u16 tag_of_task_to_be_managed; 186 u16 tag_of_task_to_be_managed;
185}; 187};
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index fafb3f1835be..369ef7ebb1e0 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -296,6 +296,10 @@
296#define CMD_HDR_RESP_REPORT_MSK (0x1 << CMD_HDR_RESP_REPORT_OFF) 296#define CMD_HDR_RESP_REPORT_MSK (0x1 << CMD_HDR_RESP_REPORT_OFF)
297#define CMD_HDR_TLR_CTRL_OFF 6 297#define CMD_HDR_TLR_CTRL_OFF 6
298#define CMD_HDR_TLR_CTRL_MSK (0x3 << CMD_HDR_TLR_CTRL_OFF) 298#define CMD_HDR_TLR_CTRL_MSK (0x3 << CMD_HDR_TLR_CTRL_OFF)
299#define CMD_HDR_PHY_ID_OFF 8
300#define CMD_HDR_PHY_ID_MSK (0x1ff << CMD_HDR_PHY_ID_OFF)
301#define CMD_HDR_FORCE_PHY_OFF 17
302#define CMD_HDR_FORCE_PHY_MSK (0x1 << CMD_HDR_FORCE_PHY_OFF)
299#define CMD_HDR_PORT_OFF 18 303#define CMD_HDR_PORT_OFF 18
300#define CMD_HDR_PORT_MSK (0xf << CMD_HDR_PORT_OFF) 304#define CMD_HDR_PORT_MSK (0xf << CMD_HDR_PORT_OFF)
301#define CMD_HDR_PRIORITY_OFF 27 305#define CMD_HDR_PRIORITY_OFF 27
@@ -2512,6 +2516,7 @@ static void prep_ata_v2_hw(struct hisi_hba *hisi_hba,
2512 struct hisi_sas_cmd_hdr *hdr = slot->cmd_hdr; 2516 struct hisi_sas_cmd_hdr *hdr = slot->cmd_hdr;
2513 struct asd_sas_port *sas_port = device->port; 2517 struct asd_sas_port *sas_port = device->port;
2514 struct hisi_sas_port *port = to_hisi_sas_port(sas_port); 2518 struct hisi_sas_port *port = to_hisi_sas_port(sas_port);
2519 struct hisi_sas_tmf_task *tmf = slot->tmf;
2515 u8 *buf_cmd; 2520 u8 *buf_cmd;
2516 int has_data = 0, hdr_tag = 0; 2521 int has_data = 0, hdr_tag = 0;
2517 u32 dw1 = 0, dw2 = 0; 2522 u32 dw1 = 0, dw2 = 0;
@@ -2524,6 +2529,12 @@ static void prep_ata_v2_hw(struct hisi_hba *hisi_hba,
2524 else 2529 else
2525 hdr->dw0 |= cpu_to_le32(4 << CMD_HDR_CMD_OFF); 2530 hdr->dw0 |= cpu_to_le32(4 << CMD_HDR_CMD_OFF);
2526 2531
2532 if (tmf && tmf->force_phy) {
2533 hdr->dw0 |= CMD_HDR_FORCE_PHY_MSK;
2534 hdr->dw0 |= cpu_to_le32((1 << tmf->phy_id)
2535 << CMD_HDR_PHY_ID_OFF);
2536 }
2537
2527 /* dw1 */ 2538 /* dw1 */
2528 switch (task->data_dir) { 2539 switch (task->data_dir) {
2529 case DMA_TO_DEVICE: 2540 case DMA_TO_DEVICE: