• Home
  • Raw
  • Download

Lines Matching refs:dsaf_dev

33 static void dsaf_write_sub(struct dsaf_device *dsaf_dev, u32 reg, u32 val)  in dsaf_write_sub()  argument
35 if (dsaf_dev->sub_ctrl) in dsaf_write_sub()
36 dsaf_write_syscon(dsaf_dev->sub_ctrl, reg, val); in dsaf_write_sub()
38 dsaf_write_reg(dsaf_dev->sc_base, reg, val); in dsaf_write_sub()
41 static u32 dsaf_read_sub(struct dsaf_device *dsaf_dev, u32 reg) in dsaf_read_sub() argument
46 if (dsaf_dev->sub_ctrl) { in dsaf_read_sub()
47 err = dsaf_read_syscon(dsaf_dev->sub_ctrl, reg, &ret); in dsaf_read_sub()
49 dev_err(dsaf_dev->dev, "dsaf_read_syscon error %d!\n", in dsaf_read_sub()
52 ret = dsaf_read_reg(dsaf_dev->sc_base, reg); in dsaf_read_sub()
250 static void hns_dsaf_acpi_srst_by_port(struct dsaf_device *dsaf_dev, u8 op_type, in hns_dsaf_acpi_srst_by_port() argument
267 obj = acpi_evaluate_dsm(ACPI_HANDLE(dsaf_dev->dev), in hns_dsaf_acpi_srst_by_port()
270 dev_warn(dsaf_dev->dev, "reset port_type%d port%d fail!", in hns_dsaf_acpi_srst_by_port()
278 static void hns_dsaf_rst(struct dsaf_device *dsaf_dev, bool dereset) in hns_dsaf_rst() argument
291 dsaf_write_sub(dsaf_dev, xbar_reg_addr, RESET_REQ_OR_DREQ); in hns_dsaf_rst()
292 dsaf_write_sub(dsaf_dev, nt_reg_addr, RESET_REQ_OR_DREQ); in hns_dsaf_rst()
295 static void hns_dsaf_rst_acpi(struct dsaf_device *dsaf_dev, bool dereset) in hns_dsaf_rst_acpi() argument
297 hns_dsaf_acpi_srst_by_port(dsaf_dev, HNS_OP_RESET_FUNC, in hns_dsaf_rst_acpi()
302 static void hns_dsaf_xge_srst_by_port(struct dsaf_device *dsaf_dev, u32 port, in hns_dsaf_xge_srst_by_port() argument
312 reg_val |= 0x2082082 << dsaf_dev->mac_cb[port]->port_rst_off; in hns_dsaf_xge_srst_by_port()
319 dsaf_write_sub(dsaf_dev, reg_addr, reg_val); in hns_dsaf_xge_srst_by_port()
322 static void hns_dsaf_xge_srst_by_port_acpi(struct dsaf_device *dsaf_dev, in hns_dsaf_xge_srst_by_port_acpi() argument
325 hns_dsaf_acpi_srst_by_port(dsaf_dev, HNS_OP_RESET_FUNC, in hns_dsaf_xge_srst_by_port_acpi()
340 hns_dsaf_srst_chns(struct dsaf_device *dsaf_dev, u32 msk, bool dereset) in hns_dsaf_srst_chns() argument
349 dsaf_write_sub(dsaf_dev, reg_addr, msk); in hns_dsaf_srst_chns()
363 hns_dsaf_srst_chns_acpi(struct dsaf_device *dsaf_dev, u32 msk, bool dereset) in hns_dsaf_srst_chns_acpi() argument
365 hns_dsaf_acpi_srst_by_port(dsaf_dev, HNS_OP_RESET_FUNC, in hns_dsaf_srst_chns_acpi()
370 static void hns_dsaf_roce_srst(struct dsaf_device *dsaf_dev, bool dereset) in hns_dsaf_roce_srst() argument
373 dsaf_write_sub(dsaf_dev, DSAF_SUB_SC_ROCEE_RESET_REQ_REG, 1); in hns_dsaf_roce_srst()
375 dsaf_write_sub(dsaf_dev, in hns_dsaf_roce_srst()
377 dsaf_write_sub(dsaf_dev, in hns_dsaf_roce_srst()
380 dsaf_write_sub(dsaf_dev, DSAF_SUB_SC_ROCEE_CLK_EN_REG, 1); in hns_dsaf_roce_srst()
384 static void hns_dsaf_roce_srst_acpi(struct dsaf_device *dsaf_dev, bool dereset) in hns_dsaf_roce_srst_acpi() argument
386 hns_dsaf_acpi_srst_by_port(dsaf_dev, HNS_OP_RESET_FUNC, in hns_dsaf_roce_srst_acpi()
390 static void hns_dsaf_ge_srst_by_port(struct dsaf_device *dsaf_dev, u32 port, in hns_dsaf_ge_srst_by_port() argument
400 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) { in hns_dsaf_ge_srst_by_port()
402 port_rst_off = dsaf_dev->mac_cb[port]->port_rst_off; in hns_dsaf_ge_srst_by_port()
404 reg_val_2 = AE_IS_VER1(dsaf_dev->dsaf_ver) ? in hns_dsaf_ge_srst_by_port()
409 dsaf_write_sub(dsaf_dev, DSAF_SUB_SC_GE_RESET_REQ1_REG, in hns_dsaf_ge_srst_by_port()
412 dsaf_write_sub(dsaf_dev, DSAF_SUB_SC_GE_RESET_REQ0_REG, in hns_dsaf_ge_srst_by_port()
415 dsaf_write_sub(dsaf_dev, DSAF_SUB_SC_GE_RESET_DREQ0_REG, in hns_dsaf_ge_srst_by_port()
418 dsaf_write_sub(dsaf_dev, DSAF_SUB_SC_GE_RESET_DREQ1_REG, in hns_dsaf_ge_srst_by_port()
423 reg_val_2 = AE_IS_VER1(dsaf_dev->dsaf_ver) ? 0x100 : 0x40; in hns_dsaf_ge_srst_by_port()
425 reg_val_1 <<= dsaf_dev->reset_offset; in hns_dsaf_ge_srst_by_port()
426 reg_val_2 <<= dsaf_dev->reset_offset; in hns_dsaf_ge_srst_by_port()
429 dsaf_write_sub(dsaf_dev, DSAF_SUB_SC_GE_RESET_REQ1_REG, in hns_dsaf_ge_srst_by_port()
432 dsaf_write_sub(dsaf_dev, DSAF_SUB_SC_PPE_RESET_REQ_REG, in hns_dsaf_ge_srst_by_port()
435 dsaf_write_sub(dsaf_dev, DSAF_SUB_SC_GE_RESET_DREQ1_REG, in hns_dsaf_ge_srst_by_port()
438 dsaf_write_sub(dsaf_dev, DSAF_SUB_SC_PPE_RESET_DREQ_REG, in hns_dsaf_ge_srst_by_port()
444 static void hns_dsaf_ge_srst_by_port_acpi(struct dsaf_device *dsaf_dev, in hns_dsaf_ge_srst_by_port_acpi() argument
447 hns_dsaf_acpi_srst_by_port(dsaf_dev, HNS_OP_RESET_FUNC, in hns_dsaf_ge_srst_by_port_acpi()
451 static void hns_ppe_srst_by_port(struct dsaf_device *dsaf_dev, u32 port, in hns_ppe_srst_by_port() argument
457 reg_val |= RESET_REQ_OR_DREQ << dsaf_dev->mac_cb[port]->port_rst_off; in hns_ppe_srst_by_port()
464 dsaf_write_sub(dsaf_dev, reg_addr, reg_val); in hns_ppe_srst_by_port()
468 hns_ppe_srst_by_port_acpi(struct dsaf_device *dsaf_dev, u32 port, bool dereset) in hns_ppe_srst_by_port_acpi() argument
470 hns_dsaf_acpi_srst_by_port(dsaf_dev, HNS_OP_RESET_FUNC, in hns_ppe_srst_by_port_acpi()
474 static void hns_ppe_com_srst(struct dsaf_device *dsaf_dev, bool dereset) in hns_ppe_com_srst() argument
479 if (!(dev_of_node(dsaf_dev->dev))) in hns_ppe_com_srst()
482 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) { in hns_ppe_com_srst()
490 reg_val = 0x100 << dsaf_dev->reset_offset; in hns_ppe_com_srst()
498 dsaf_write_sub(dsaf_dev, reg_addr, reg_val); in hns_ppe_com_srst()
510 bool is_ver1 = AE_IS_VER1(mac_cb->dsaf_dev->dsaf_ver); in hns_mac_get_phy_if()
515 if (HNS_DSAF_IS_DEBUG(mac_cb->dsaf_dev)) in hns_mac_get_phy_if()
523 if (!HNS_DSAF_IS_DEBUG(mac_cb->dsaf_dev) && mac_id <= 3) in hns_mac_get_phy_if()
529 mode = dsaf_read_sub(mac_cb->dsaf_dev, reg); in hns_mac_get_phy_if()
646 if (!AE_IS_VER1(mac_cb->dsaf_dev->dsaf_ver)) { in hns_mac_config_sds_loopback()
652 if ((!HNS_DSAF_IS_DEBUG(mac_cb->dsaf_dev)) && in hns_mac_config_sds_loopback()
692 obj = acpi_evaluate_dsm(ACPI_HANDLE(mac_cb->dsaf_dev->dev), in hns_mac_config_sds_loopback_acpi()
696 dev_warn(mac_cb->dsaf_dev->dev, "set port%d serdes lp fail!", in hns_mac_config_sds_loopback_acpi()
707 struct dsaf_misc_op *hns_misc_op_get(struct dsaf_device *dsaf_dev) in hns_misc_op_get() argument
711 misc_op = devm_kzalloc(dsaf_dev->dev, sizeof(*misc_op), GFP_KERNEL); in hns_misc_op_get()
715 if (dev_of_node(dsaf_dev->dev)) { in hns_misc_op_get()
732 } else if (is_acpi_node(dsaf_dev->dev->fwnode)) { in hns_misc_op_get()
750 devm_kfree(dsaf_dev->dev, (void *)misc_op); in hns_misc_op_get()