Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 3 | * Copyright (C) 2024, Marek Vasut <marex@denx.de> |
| 4 | * |
| 5 | * This is code moved from drivers/net/dwc_eth_qos.c , which is: |
| 6 | * Copyright (c) 2016, NVIDIA CORPORATION. |
| 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <asm/cache.h> |
| 11 | #include <asm/gpio.h> |
| 12 | #include <asm/io.h> |
| 13 | #include <clk.h> |
| 14 | #include <cpu_func.h> |
| 15 | #include <dm.h> |
| 16 | #include <dm/device_compat.h> |
| 17 | #include <errno.h> |
| 18 | #include <eth_phy.h> |
| 19 | #include <log.h> |
| 20 | #include <malloc.h> |
| 21 | #include <memalign.h> |
| 22 | #include <miiphy.h> |
| 23 | #include <net.h> |
| 24 | #include <netdev.h> |
| 25 | #include <phy.h> |
Christophe Roullier | 033dc76 | 2024-03-26 13:07:30 +0100 | [diff] [blame] | 26 | #include <regmap.h> |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 27 | #include <reset.h> |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 28 | #include <syscon.h> |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 29 | #include <wait_bit.h> |
Marek Vasut | 577f46b | 2024-03-26 13:07:26 +0100 | [diff] [blame] | 30 | #include <linux/bitfield.h> |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 31 | #include <linux/delay.h> |
| 32 | |
| 33 | #include "dwc_eth_qos.h" |
| 34 | |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 35 | /* SYSCFG registers */ |
| 36 | #define SYSCFG_PMCSETR 0x04 |
Christophe Roullier | 033dc76 | 2024-03-26 13:07:30 +0100 | [diff] [blame] | 37 | #define SYSCFG_PMCCLRR_MP13 0x08 |
| 38 | #define SYSCFG_PMCCLRR_MP15 0x44 |
| 39 | |
| 40 | #define SYSCFG_PMCSETR_ETH1_MASK GENMASK(23, 16) |
| 41 | #define SYSCFG_PMCSETR_ETH2_MASK GENMASK(31, 24) |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 42 | |
| 43 | #define SYSCFG_PMCSETR_ETH_CLK_SEL BIT(16) |
| 44 | #define SYSCFG_PMCSETR_ETH_REF_CLK_SEL BIT(17) |
| 45 | |
Christophe Roullier | 033dc76 | 2024-03-26 13:07:30 +0100 | [diff] [blame] | 46 | /* STM32MP15xx specific bit */ |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 47 | #define SYSCFG_PMCSETR_ETH_SELMII BIT(20) |
| 48 | |
| 49 | #define SYSCFG_PMCSETR_ETH_SEL_MASK GENMASK(23, 21) |
Marek Vasut | 577f46b | 2024-03-26 13:07:26 +0100 | [diff] [blame] | 50 | #define SYSCFG_PMCSETR_ETH_SEL_GMII_MII 0x0 |
| 51 | #define SYSCFG_PMCSETR_ETH_SEL_RGMII 0x1 |
| 52 | #define SYSCFG_PMCSETR_ETH_SEL_RMII 0x4 |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 53 | |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 54 | static ulong eqos_get_tick_clk_rate_stm32(struct udevice *dev) |
| 55 | { |
Marek Vasut | b14101c | 2024-03-26 13:07:25 +0100 | [diff] [blame] | 56 | struct eqos_priv __maybe_unused *eqos = dev_get_priv(dev); |
| 57 | |
| 58 | if (!CONFIG_IS_ENABLED(CLK)) |
| 59 | return 0; |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 60 | |
| 61 | return clk_get_rate(&eqos->clk_master_bus); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | static int eqos_start_clks_stm32(struct udevice *dev) |
| 65 | { |
Marek Vasut | b14101c | 2024-03-26 13:07:25 +0100 | [diff] [blame] | 66 | struct eqos_priv __maybe_unused *eqos = dev_get_priv(dev); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 67 | int ret; |
| 68 | |
Marek Vasut | b14101c | 2024-03-26 13:07:25 +0100 | [diff] [blame] | 69 | if (!CONFIG_IS_ENABLED(CLK)) |
| 70 | return 0; |
| 71 | |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 72 | dev_dbg(dev, "%s:\n", __func__); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 73 | |
| 74 | ret = clk_enable(&eqos->clk_master_bus); |
| 75 | if (ret < 0) { |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 76 | dev_err(dev, "clk_enable(clk_master_bus) failed: %d\n", ret); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 77 | goto err; |
| 78 | } |
| 79 | |
| 80 | ret = clk_enable(&eqos->clk_rx); |
| 81 | if (ret < 0) { |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 82 | dev_err(dev, "clk_enable(clk_rx) failed: %d\n", ret); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 83 | goto err_disable_clk_master_bus; |
| 84 | } |
| 85 | |
| 86 | ret = clk_enable(&eqos->clk_tx); |
| 87 | if (ret < 0) { |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 88 | dev_err(dev, "clk_enable(clk_tx) failed: %d\n", ret); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 89 | goto err_disable_clk_rx; |
| 90 | } |
| 91 | |
| 92 | if (clk_valid(&eqos->clk_ck) && !eqos->clk_ck_enabled) { |
| 93 | ret = clk_enable(&eqos->clk_ck); |
| 94 | if (ret < 0) { |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 95 | dev_err(dev, "clk_enable(clk_ck) failed: %d\n", ret); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 96 | goto err_disable_clk_tx; |
| 97 | } |
| 98 | eqos->clk_ck_enabled = true; |
| 99 | } |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 100 | |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 101 | dev_dbg(dev, "%s: OK\n", __func__); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 102 | return 0; |
| 103 | |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 104 | err_disable_clk_tx: |
| 105 | clk_disable(&eqos->clk_tx); |
| 106 | err_disable_clk_rx: |
| 107 | clk_disable(&eqos->clk_rx); |
| 108 | err_disable_clk_master_bus: |
| 109 | clk_disable(&eqos->clk_master_bus); |
| 110 | err: |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 111 | dev_dbg(dev, "%s: FAILED: %d\n", __func__, ret); |
| 112 | |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 113 | return ret; |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 114 | } |
| 115 | |
| 116 | static int eqos_stop_clks_stm32(struct udevice *dev) |
| 117 | { |
Marek Vasut | b14101c | 2024-03-26 13:07:25 +0100 | [diff] [blame] | 118 | struct eqos_priv __maybe_unused *eqos = dev_get_priv(dev); |
| 119 | |
| 120 | if (!CONFIG_IS_ENABLED(CLK)) |
| 121 | return 0; |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 122 | |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 123 | dev_dbg(dev, "%s:\n", __func__); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 124 | |
| 125 | clk_disable(&eqos->clk_tx); |
| 126 | clk_disable(&eqos->clk_rx); |
| 127 | clk_disable(&eqos->clk_master_bus); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 128 | |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 129 | dev_dbg(dev, "%s: OK\n", __func__); |
| 130 | |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 131 | return 0; |
| 132 | } |
| 133 | |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 134 | static int eqos_probe_syscfg_stm32(struct udevice *dev, |
| 135 | phy_interface_t interface_type) |
| 136 | { |
Marek Vasut | e77fa87 | 2024-03-26 13:07:29 +0100 | [diff] [blame] | 137 | /* Ethernet 50MHz RMII clock selection. */ |
| 138 | const bool eth_ref_clk_sel = dev_read_bool(dev, "st,eth-ref-clk-sel"); |
Christophe Roullier | 033dc76 | 2024-03-26 13:07:30 +0100 | [diff] [blame] | 139 | /* SoC is STM32MP13xx with two ethernet MACs */ |
| 140 | const bool is_mp13 = device_is_compatible(dev, "st,stm32mp13-dwmac"); |
Marek Vasut | e77fa87 | 2024-03-26 13:07:29 +0100 | [diff] [blame] | 141 | /* Gigabit Ethernet 125MHz clock selection. */ |
| 142 | const bool eth_clk_sel = dev_read_bool(dev, "st,eth-clk-sel"); |
Christophe Roullier | 033dc76 | 2024-03-26 13:07:30 +0100 | [diff] [blame] | 143 | struct regmap *regmap; |
| 144 | u32 regmap_mask; |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 145 | u32 value; |
| 146 | |
Christophe Roullier | 033dc76 | 2024-03-26 13:07:30 +0100 | [diff] [blame] | 147 | regmap = syscon_regmap_lookup_by_phandle(dev, "st,syscon"); |
| 148 | if (IS_ERR(regmap)) |
| 149 | return PTR_ERR(regmap); |
| 150 | |
| 151 | regmap_mask = dev_read_u32_index_default(dev, "st,syscon", 2, |
| 152 | SYSCFG_PMCSETR_ETH1_MASK); |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 153 | |
| 154 | switch (interface_type) { |
| 155 | case PHY_INTERFACE_MODE_MII: |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 156 | dev_dbg(dev, "PHY_INTERFACE_MODE_MII\n"); |
Marek Vasut | 577f46b | 2024-03-26 13:07:26 +0100 | [diff] [blame] | 157 | value = FIELD_PREP(SYSCFG_PMCSETR_ETH_SEL_MASK, |
| 158 | SYSCFG_PMCSETR_ETH_SEL_GMII_MII); |
Christophe Roullier | 033dc76 | 2024-03-26 13:07:30 +0100 | [diff] [blame] | 159 | if (!is_mp13) /* Select MII mode on STM32MP15xx */ |
| 160 | value |= SYSCFG_PMCSETR_ETH_SELMII; |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 161 | break; |
Christophe Roullier | 033dc76 | 2024-03-26 13:07:30 +0100 | [diff] [blame] | 162 | case PHY_INTERFACE_MODE_GMII: /* STM32MP15xx only */ |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 163 | dev_dbg(dev, "PHY_INTERFACE_MODE_GMII\n"); |
Marek Vasut | 577f46b | 2024-03-26 13:07:26 +0100 | [diff] [blame] | 164 | value = FIELD_PREP(SYSCFG_PMCSETR_ETH_SEL_MASK, |
| 165 | SYSCFG_PMCSETR_ETH_SEL_GMII_MII); |
Marek Vasut | e77fa87 | 2024-03-26 13:07:29 +0100 | [diff] [blame] | 166 | if (eth_clk_sel) |
Marek Vasut | 577f46b | 2024-03-26 13:07:26 +0100 | [diff] [blame] | 167 | value |= SYSCFG_PMCSETR_ETH_CLK_SEL; |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 168 | break; |
| 169 | case PHY_INTERFACE_MODE_RMII: |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 170 | dev_dbg(dev, "PHY_INTERFACE_MODE_RMII\n"); |
Marek Vasut | 577f46b | 2024-03-26 13:07:26 +0100 | [diff] [blame] | 171 | value = FIELD_PREP(SYSCFG_PMCSETR_ETH_SEL_MASK, |
| 172 | SYSCFG_PMCSETR_ETH_SEL_RMII); |
Marek Vasut | e77fa87 | 2024-03-26 13:07:29 +0100 | [diff] [blame] | 173 | if (eth_ref_clk_sel) |
Marek Vasut | 577f46b | 2024-03-26 13:07:26 +0100 | [diff] [blame] | 174 | value |= SYSCFG_PMCSETR_ETH_REF_CLK_SEL; |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 175 | break; |
| 176 | case PHY_INTERFACE_MODE_RGMII: |
| 177 | case PHY_INTERFACE_MODE_RGMII_ID: |
| 178 | case PHY_INTERFACE_MODE_RGMII_RXID: |
| 179 | case PHY_INTERFACE_MODE_RGMII_TXID: |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 180 | dev_dbg(dev, "PHY_INTERFACE_MODE_RGMII\n"); |
Marek Vasut | 577f46b | 2024-03-26 13:07:26 +0100 | [diff] [blame] | 181 | value = FIELD_PREP(SYSCFG_PMCSETR_ETH_SEL_MASK, |
| 182 | SYSCFG_PMCSETR_ETH_SEL_RGMII); |
Marek Vasut | e77fa87 | 2024-03-26 13:07:29 +0100 | [diff] [blame] | 183 | if (eth_clk_sel) |
Marek Vasut | 577f46b | 2024-03-26 13:07:26 +0100 | [diff] [blame] | 184 | value |= SYSCFG_PMCSETR_ETH_CLK_SEL; |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 185 | break; |
| 186 | default: |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 187 | dev_dbg(dev, "Do not manage %d interface\n", |
| 188 | interface_type); |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 189 | /* Do not manage others interfaces */ |
| 190 | return -EINVAL; |
| 191 | } |
| 192 | |
Christophe Roullier | 033dc76 | 2024-03-26 13:07:30 +0100 | [diff] [blame] | 193 | /* Shift value at correct ethernet MAC offset in SYSCFG_PMCSETR */ |
| 194 | value <<= ffs(regmap_mask) - ffs(SYSCFG_PMCSETR_ETH1_MASK); |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 195 | |
Christophe Roullier | 033dc76 | 2024-03-26 13:07:30 +0100 | [diff] [blame] | 196 | /* Update PMCCLRR (clear register) */ |
| 197 | regmap_write(regmap, is_mp13 ? |
| 198 | SYSCFG_PMCCLRR_MP13 : SYSCFG_PMCCLRR_MP15, |
| 199 | regmap_mask); |
| 200 | |
| 201 | return regmap_update_bits(regmap, SYSCFG_PMCSETR, regmap_mask, value); |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 202 | } |
| 203 | |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 204 | static int eqos_probe_resources_stm32(struct udevice *dev) |
| 205 | { |
| 206 | struct eqos_priv *eqos = dev_get_priv(dev); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 207 | phy_interface_t interface; |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 208 | int ret; |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 209 | |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 210 | dev_dbg(dev, "%s:\n", __func__); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 211 | |
| 212 | interface = eqos->config->interface(dev); |
| 213 | |
| 214 | if (interface == PHY_INTERFACE_MODE_NA) { |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 215 | dev_err(dev, "Invalid PHY interface\n"); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 216 | return -EINVAL; |
| 217 | } |
| 218 | |
Marek Vasut | 7595bfc | 2024-03-26 13:07:24 +0100 | [diff] [blame] | 219 | ret = eqos_probe_syscfg_stm32(dev, interface); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 220 | if (ret) |
| 221 | return -EINVAL; |
| 222 | |
| 223 | ret = clk_get_by_name(dev, "stmmaceth", &eqos->clk_master_bus); |
| 224 | if (ret) { |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 225 | dev_err(dev, "clk_get_by_name(master_bus) failed: %d\n", ret); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 226 | goto err_probe; |
| 227 | } |
| 228 | |
| 229 | ret = clk_get_by_name(dev, "mac-clk-rx", &eqos->clk_rx); |
| 230 | if (ret) { |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 231 | dev_err(dev, "clk_get_by_name(rx) failed: %d\n", ret); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 232 | goto err_probe; |
| 233 | } |
| 234 | |
| 235 | ret = clk_get_by_name(dev, "mac-clk-tx", &eqos->clk_tx); |
| 236 | if (ret) { |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 237 | dev_err(dev, "clk_get_by_name(tx) failed: %d\n", ret); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 238 | goto err_probe; |
| 239 | } |
| 240 | |
| 241 | /* Get ETH_CLK clocks (optional) */ |
| 242 | ret = clk_get_by_name(dev, "eth-ck", &eqos->clk_ck); |
| 243 | if (ret) |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 244 | dev_warn(dev, "No phy clock provided %d\n", ret); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 245 | |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 246 | dev_dbg(dev, "%s: OK\n", __func__); |
| 247 | |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 248 | return 0; |
| 249 | |
| 250 | err_probe: |
| 251 | |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 252 | dev_dbg(dev, "%s: returns %d\n", __func__, ret); |
| 253 | |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 254 | return ret; |
| 255 | } |
| 256 | |
| 257 | static int eqos_remove_resources_stm32(struct udevice *dev) |
| 258 | { |
Marek Vasut | 5a1640e | 2024-03-26 13:07:28 +0100 | [diff] [blame] | 259 | dev_dbg(dev, "%s:\n", __func__); |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 260 | |
| 261 | return 0; |
| 262 | } |
| 263 | |
| 264 | static struct eqos_ops eqos_stm32_ops = { |
| 265 | .eqos_inval_desc = eqos_inval_desc_generic, |
| 266 | .eqos_flush_desc = eqos_flush_desc_generic, |
| 267 | .eqos_inval_buffer = eqos_inval_buffer_generic, |
| 268 | .eqos_flush_buffer = eqos_flush_buffer_generic, |
| 269 | .eqos_probe_resources = eqos_probe_resources_stm32, |
| 270 | .eqos_remove_resources = eqos_remove_resources_stm32, |
| 271 | .eqos_stop_resets = eqos_null_ops, |
| 272 | .eqos_start_resets = eqos_null_ops, |
| 273 | .eqos_stop_clks = eqos_stop_clks_stm32, |
| 274 | .eqos_start_clks = eqos_start_clks_stm32, |
| 275 | .eqos_calibrate_pads = eqos_null_ops, |
| 276 | .eqos_disable_calibration = eqos_null_ops, |
| 277 | .eqos_set_tx_clk_speed = eqos_null_ops, |
| 278 | .eqos_get_enetaddr = eqos_null_ops, |
| 279 | .eqos_get_tick_clk_rate = eqos_get_tick_clk_rate_stm32 |
| 280 | }; |
| 281 | |
Christophe Roullier | 25a1686 | 2024-03-26 13:07:31 +0100 | [diff] [blame^] | 282 | struct eqos_config __maybe_unused eqos_stm32mp13_config = { |
| 283 | .reg_access_always_ok = false, |
| 284 | .mdio_wait = 10000, |
| 285 | .swr_wait = 50, |
| 286 | .config_mac = EQOS_MAC_RXQ_CTRL0_RXQ0EN_ENABLED_DCB, |
| 287 | .config_mac_mdio = EQOS_MAC_MDIO_ADDRESS_CR_250_300, |
| 288 | .axi_bus_width = EQOS_AXI_WIDTH_32, |
| 289 | .interface = dev_read_phy_mode, |
| 290 | .ops = &eqos_stm32_ops |
| 291 | }; |
| 292 | |
Marek Vasut | 944ba37 | 2024-03-26 13:07:23 +0100 | [diff] [blame] | 293 | struct eqos_config __maybe_unused eqos_stm32mp15_config = { |
Marek Vasut | 426ca62 | 2024-03-26 13:07:22 +0100 | [diff] [blame] | 294 | .reg_access_always_ok = false, |
| 295 | .mdio_wait = 10000, |
| 296 | .swr_wait = 50, |
| 297 | .config_mac = EQOS_MAC_RXQ_CTRL0_RXQ0EN_ENABLED_AV, |
| 298 | .config_mac_mdio = EQOS_MAC_MDIO_ADDRESS_CR_250_300, |
| 299 | .axi_bus_width = EQOS_AXI_WIDTH_64, |
| 300 | .interface = dev_read_phy_mode, |
| 301 | .ops = &eqos_stm32_ops |
| 302 | }; |