Lines Matching refs:gmac
27 static uint32_t gmac_read_reg(struct anarion_gmac *gmac, uint8_t reg) in gmac_read_reg() argument
29 return readl((void *)(gmac->ctl_block + reg)); in gmac_read_reg()
32 static void gmac_write_reg(struct anarion_gmac *gmac, uint8_t reg, uint32_t val) in gmac_write_reg() argument
34 writel(val, (void *)(gmac->ctl_block + reg)); in gmac_write_reg()
40 struct anarion_gmac *gmac = priv; in anarion_gmac_init() local
43 gmac_write_reg(gmac, GMAC_RESET_CONTROL_REG, 1); in anarion_gmac_init()
45 sw_config = gmac_read_reg(gmac, GMAC_SW_CONFIG_REG); in anarion_gmac_init()
47 sw_config |= (gmac->phy_intf_sel & GMAC_CONFIG_INTF_SEL_MASK); in anarion_gmac_init()
48 gmac_write_reg(gmac, GMAC_SW_CONFIG_REG, sw_config); in anarion_gmac_init()
50 gmac_write_reg(gmac, GMAC_RESET_CONTROL_REG, 0); in anarion_gmac_init()
57 struct anarion_gmac *gmac = priv; in anarion_gmac_exit() local
59 gmac_write_reg(gmac, GMAC_RESET_CONTROL_REG, 1); in anarion_gmac_exit()
64 struct anarion_gmac *gmac; in anarion_config_dt() local
76 gmac = devm_kzalloc(&pdev->dev, sizeof(*gmac), GFP_KERNEL); in anarion_config_dt()
77 if (!gmac) in anarion_config_dt()
80 gmac->ctl_block = (uintptr_t)ctl_block; in anarion_config_dt()
92 gmac->phy_intf_sel = GMAC_CONFIG_INTF_RGMII; in anarion_config_dt()
100 return gmac; in anarion_config_dt()
106 struct anarion_gmac *gmac; in anarion_dwmac_probe() local
114 gmac = anarion_config_dt(pdev); in anarion_dwmac_probe()
115 if (IS_ERR(gmac)) in anarion_dwmac_probe()
116 return PTR_ERR(gmac); in anarion_dwmac_probe()
124 anarion_gmac_init(pdev, gmac); in anarion_dwmac_probe()
125 plat_dat->bsp_priv = gmac; in anarion_dwmac_probe()