Lines Matching refs:phy_no
428 int phy_no, u32 off, u32 val) in hisi_sas_phy_write32() argument
430 void __iomem *regs = hisi_hba->regs + (0x400 * phy_no) + off; in hisi_sas_phy_write32()
436 int phy_no, u32 off) in hisi_sas_phy_read32() argument
438 void __iomem *regs = hisi_hba->regs + (0x400 * phy_no) + off; in hisi_sas_phy_read32()
443 static void config_phy_opt_mode_v1_hw(struct hisi_hba *hisi_hba, int phy_no) in config_phy_opt_mode_v1_hw() argument
445 u32 cfg = hisi_sas_phy_read32(hisi_hba, phy_no, PHY_CFG); in config_phy_opt_mode_v1_hw()
449 hisi_sas_phy_write32(hisi_hba, phy_no, PHY_CFG, cfg); in config_phy_opt_mode_v1_hw()
452 static void config_tx_tfe_autoneg_v1_hw(struct hisi_hba *hisi_hba, int phy_no) in config_tx_tfe_autoneg_v1_hw() argument
454 u32 cfg = hisi_sas_phy_read32(hisi_hba, phy_no, PHY_CONFIG2); in config_tx_tfe_autoneg_v1_hw()
457 hisi_sas_phy_write32(hisi_hba, phy_no, PHY_CONFIG2, cfg); in config_tx_tfe_autoneg_v1_hw()
460 static void config_id_frame_v1_hw(struct hisi_hba *hisi_hba, int phy_no) in config_id_frame_v1_hw() argument
473 identify_frame.phy_id = phy_no; in config_id_frame_v1_hw()
476 hisi_sas_phy_write32(hisi_hba, phy_no, TX_ID_DWORD0, in config_id_frame_v1_hw()
478 hisi_sas_phy_write32(hisi_hba, phy_no, TX_ID_DWORD1, in config_id_frame_v1_hw()
480 hisi_sas_phy_write32(hisi_hba, phy_no, TX_ID_DWORD2, in config_id_frame_v1_hw()
482 hisi_sas_phy_write32(hisi_hba, phy_no, TX_ID_DWORD3, in config_id_frame_v1_hw()
484 hisi_sas_phy_write32(hisi_hba, phy_no, TX_ID_DWORD4, in config_id_frame_v1_hw()
486 hisi_sas_phy_write32(hisi_hba, phy_no, TX_ID_DWORD5, in config_id_frame_v1_hw()
765 static void enable_phy_v1_hw(struct hisi_hba *hisi_hba, int phy_no) in enable_phy_v1_hw() argument
767 u32 cfg = hisi_sas_phy_read32(hisi_hba, phy_no, PHY_CFG); in enable_phy_v1_hw()
770 hisi_sas_phy_write32(hisi_hba, phy_no, PHY_CFG, cfg); in enable_phy_v1_hw()
773 static void disable_phy_v1_hw(struct hisi_hba *hisi_hba, int phy_no) in disable_phy_v1_hw() argument
775 u32 cfg = hisi_sas_phy_read32(hisi_hba, phy_no, PHY_CFG); in disable_phy_v1_hw()
778 hisi_sas_phy_write32(hisi_hba, phy_no, PHY_CFG, cfg); in disable_phy_v1_hw()
781 static void start_phy_v1_hw(struct hisi_hba *hisi_hba, int phy_no) in start_phy_v1_hw() argument
783 config_id_frame_v1_hw(hisi_hba, phy_no); in start_phy_v1_hw()
784 config_phy_opt_mode_v1_hw(hisi_hba, phy_no); in start_phy_v1_hw()
785 config_tx_tfe_autoneg_v1_hw(hisi_hba, phy_no); in start_phy_v1_hw()
786 enable_phy_v1_hw(hisi_hba, phy_no); in start_phy_v1_hw()
789 static void phy_hard_reset_v1_hw(struct hisi_hba *hisi_hba, int phy_no) in phy_hard_reset_v1_hw() argument
791 hisi_sas_phy_enable(hisi_hba, phy_no, 0); in phy_hard_reset_v1_hw()
793 hisi_sas_phy_enable(hisi_hba, phy_no, 1); in phy_hard_reset_v1_hw()
821 static void sl_notify_ssp_v1_hw(struct hisi_hba *hisi_hba, int phy_no) in sl_notify_ssp_v1_hw() argument
825 sl_control = hisi_sas_phy_read32(hisi_hba, phy_no, SL_CONTROL); in sl_notify_ssp_v1_hw()
827 hisi_sas_phy_write32(hisi_hba, phy_no, SL_CONTROL, sl_control); in sl_notify_ssp_v1_hw()
829 sl_control = hisi_sas_phy_read32(hisi_hba, phy_no, SL_CONTROL); in sl_notify_ssp_v1_hw()
831 hisi_sas_phy_write32(hisi_hba, phy_no, SL_CONTROL, sl_control); in sl_notify_ssp_v1_hw()
839 static void phy_set_linkrate_v1_hw(struct hisi_hba *hisi_hba, int phy_no, in phy_set_linkrate_v1_hw() argument
846 hisi_sas_phy_write32(hisi_hba, phy_no, PROG_PHY_LINK_RATE, in phy_set_linkrate_v1_hw()
1325 int i, phy_no = sas_phy->id; in int_phyup_v1_hw() local
1332 irq_value = hisi_sas_phy_read32(hisi_hba, phy_no, CHL_INT2); in int_phyup_v1_hw()
1341 if (context & 1 << phy_no) { in int_phyup_v1_hw()
1343 phy_no); in int_phyup_v1_hw()
1347 port_id = (hisi_sas_read32(hisi_hba, PHY_PORT_NUM_MA) >> (4 * phy_no)) in int_phyup_v1_hw()
1350 dev_err(dev, "phyup: phy%d invalid portid\n", phy_no); in int_phyup_v1_hw()
1356 u32 idaf = hisi_sas_phy_read32(hisi_hba, phy_no, in int_phyup_v1_hw()
1363 link_rate = (link_rate >> (phy_no * 4)) & 0xf; in int_phyup_v1_hw()
1369 phy_no, link_rate); in int_phyup_v1_hw()
1392 hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT2, in int_phyup_v1_hw()
1396 u32 chl_int0 = hisi_sas_phy_read32(hisi_hba, phy_no, CHL_INT0); in int_phyup_v1_hw()
1399 hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0, chl_int0); in int_phyup_v1_hw()
1400 hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0_MSK, 0x3ce3ee); in int_phyup_v1_hw()
1412 int phy_no = sas_phy->id; in int_bcast_v1_hw() local
1416 irq_value = hisi_sas_phy_read32(hisi_hba, phy_no, CHL_INT2); in int_bcast_v1_hw()
1430 hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT2, in int_bcast_v1_hw()
1443 int phy_no = sas_phy->id; in int_abnormal_v1_hw() local
1446 irq_mask_old = hisi_sas_phy_read32(hisi_hba, phy_no, CHL_INT0_MSK); in int_abnormal_v1_hw()
1447 hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0_MSK, 0x3fffff); in int_abnormal_v1_hw()
1450 irq_value = hisi_sas_phy_read32(hisi_hba, phy_no, CHL_INT0); in int_abnormal_v1_hw()
1455 hisi_sas_phy_down(hisi_hba, phy_no, in int_abnormal_v1_hw()
1456 (phy_state & 1 << phy_no) ? 1 : 0, in int_abnormal_v1_hw()
1462 phy_no); in int_abnormal_v1_hw()
1465 dev_dbg(dev, "abnormal: DWS_LOST phy%d dws lost\n", phy_no); in int_abnormal_v1_hw()
1469 phy_no); in int_abnormal_v1_hw()
1474 phy_no); in int_abnormal_v1_hw()
1477 dev_dbg(dev, "abnormal: SL_PS_FAIL phy%d fail\n", phy_no); in int_abnormal_v1_hw()
1480 hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0, irq_value); in int_abnormal_v1_hw()
1483 hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0_MSK, in int_abnormal_v1_hw()
1486 hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0_MSK, in int_abnormal_v1_hw()