Lines Matching +full:ls1b +full:- +full:gmac
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Loongson-1 DWMAC glue layer
5 * Copyright (C) 2011-2023 Keguang Zhang <keguang.zhang@gmail.com>
21 /* Loongson-1 SYSCON Registers */
25 /* Loongson-1B SYSCON Register Bits */
37 /* Loongson-1C SYSCON Register Bits */
52 struct plat_stmmacenet_data *plat = dwmac->plat_dat; in ls1b_dwmac_syscon_init()
53 struct regmap *regmap = dwmac->regmap; in ls1b_dwmac_syscon_init()
59 dev_err(&pdev->dev, "Could not get IO_MEM resources\n"); in ls1b_dwmac_syscon_init()
60 return -EINVAL; in ls1b_dwmac_syscon_init()
62 reg_base = (unsigned long)res->start; in ls1b_dwmac_syscon_init()
65 switch (plat->phy_interface) { in ls1b_dwmac_syscon_init()
77 dev_err(&pdev->dev, "Unsupported PHY mode %u\n", in ls1b_dwmac_syscon_init()
78 plat->phy_interface); in ls1b_dwmac_syscon_init()
79 return -EOPNOTSUPP; in ls1b_dwmac_syscon_init()
88 switch (plat->phy_interface) { in ls1b_dwmac_syscon_init()
101 dev_err(&pdev->dev, "Unsupported PHY mode %u\n", in ls1b_dwmac_syscon_init()
102 plat->phy_interface); in ls1b_dwmac_syscon_init()
103 return -EOPNOTSUPP; in ls1b_dwmac_syscon_init()
108 dev_err(&pdev->dev, "Invalid Ethernet MAC base address %lx", in ls1b_dwmac_syscon_init()
110 return -EINVAL; in ls1b_dwmac_syscon_init()
119 struct plat_stmmacenet_data *plat = dwmac->plat_dat; in ls1c_dwmac_syscon_init()
120 struct regmap *regmap = dwmac->regmap; in ls1c_dwmac_syscon_init()
122 switch (plat->phy_interface) { in ls1c_dwmac_syscon_init()
132 dev_err(&pdev->dev, "Unsupported PHY-mode %u\n", in ls1c_dwmac_syscon_init()
133 plat->phy_interface); in ls1c_dwmac_syscon_init()
134 return -EOPNOTSUPP; in ls1c_dwmac_syscon_init()
156 regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, in ls1x_dwmac_probe()
157 "loongson,ls1-syscon"); in ls1x_dwmac_probe()
159 return dev_err_probe(&pdev->dev, PTR_ERR(regmap), in ls1x_dwmac_probe()
162 init = of_device_get_match_data(&pdev->dev); in ls1x_dwmac_probe()
164 dev_err(&pdev->dev, "No of match data provided\n"); in ls1x_dwmac_probe()
165 return -EINVAL; in ls1x_dwmac_probe()
168 dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); in ls1x_dwmac_probe()
170 return -ENOMEM; in ls1x_dwmac_probe()
174 return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat), in ls1x_dwmac_probe()
177 plat_dat->bsp_priv = dwmac; in ls1x_dwmac_probe()
178 plat_dat->init = init; in ls1x_dwmac_probe()
179 dwmac->plat_dat = plat_dat; in ls1x_dwmac_probe()
180 dwmac->regmap = regmap; in ls1x_dwmac_probe()
187 .compatible = "loongson,ls1b-gmac",
191 .compatible = "loongson,ls1c-emac",
201 .name = "loongson1-dwmac",
208 MODULE_DESCRIPTION("Loongson-1 DWMAC glue layer");