diff options
author | Giuseppe CAVALLARO <peppe.cavallaro@st.com> | 2011-07-19 20:05:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-21 18:29:16 -0400 |
commit | 36bcfe7d74782c07f601edc4831f6b1ef40e9e43 (patch) | |
tree | 381a9fdcc936309a7198b608f61e6b9b1e45bf01 /include/linux/stmmac.h | |
parent | f3240e2811f05f11126b0947ff9bb411b692b2aa (diff) |
stmmac: unify MAC and PHY configuration parameters (V2)
Prior to this change, most PHY configuration parameters were passed
into the STMMAC device as a separate PHY device. As well as being
unusual, this made it difficult to make changes to the MAC/PHY
relationship.
This patch moves all the PHY parameters into the MAC configuration
structure, mainly as a separate structure. This allows us to completely
ignore the MDIO bus attached to a stmmac if desired, and not create
the PHY bus. It also allows the stmmac driver to use a different PHY
from the one it is connected to, for example a fixed PHY or bit banging
PHY.
Also derive the stmmac/PHY connection type (MII/RMII etc) from the
mode can be passed into <platf>_configure_ethernet.
STLinux kernel at git://git.stlinux.com/stm/linux-sh4-2.6.32.y.git
provides several examples how to use this new infrastructure (that
actually is easier to maintain and clearer).
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/stmmac.h')
-rw-r--r-- | include/linux/stmmac.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 05d775690b72..0dddc9e42b6b 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -28,11 +28,21 @@ | |||
28 | 28 | ||
29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
30 | 30 | ||
31 | /* platform data for platform device structure's platform_data field */ | 31 | /* Platfrom data for platform device structure's platform_data field */ |
32 | |||
33 | struct stmmac_mdio_bus_data { | ||
34 | int bus_id; | ||
35 | int (*phy_reset)(void *priv); | ||
36 | unsigned int phy_mask; | ||
37 | int *irqs; | ||
38 | int probed_phy_irq; | ||
39 | }; | ||
32 | 40 | ||
33 | /* Private data for the STM on-board ethernet driver */ | ||
34 | struct plat_stmmacenet_data { | 41 | struct plat_stmmacenet_data { |
35 | int bus_id; | 42 | int bus_id; |
43 | int phy_addr; | ||
44 | int interface; | ||
45 | struct stmmac_mdio_bus_data *mdio_bus_data; | ||
36 | int pbl; | 46 | int pbl; |
37 | int clk_csr; | 47 | int clk_csr; |
38 | int has_gmac; | 48 | int has_gmac; |
@@ -48,14 +58,4 @@ struct plat_stmmacenet_data { | |||
48 | void *custom_cfg; | 58 | void *custom_cfg; |
49 | void *bsp_priv; | 59 | void *bsp_priv; |
50 | }; | 60 | }; |
51 | |||
52 | struct plat_stmmacphy_data { | ||
53 | int bus_id; | ||
54 | int phy_addr; | ||
55 | unsigned int phy_mask; | ||
56 | int interface; | ||
57 | int (*phy_reset)(void *priv); | ||
58 | void *priv; | ||
59 | }; | ||
60 | #endif | 61 | #endif |
61 | |||