1 #ifndef BCM63XX_DEV_ENET_H_
2 #define BCM63XX_DEV_ENET_H_
4 #include <linux/if_ether.h>
5 #include <linux/init.h>
7 #include <bcm63xx_regs.h>
10 * on board ethernet platform data
12 struct bcm63xx_enet_platform_data {
13 char mac_addr[ETH_ALEN];
17 /* if has_phy, then set use_internal_phy */
20 /* or fill phy info to use an external one */
22 int has_phy_interrupt;
25 /* if has_phy, use autonegociated pause parameters or force
31 /* if !has_phy, set desired forced speed/duplex */
33 int force_duplex_full;
35 /* if !has_phy, set callback to perform mii device
37 int (*mii_config)(struct net_device *dev, int probe,
38 int (*mii_read)(struct net_device *dev,
40 void (*mii_write)(struct net_device *dev,
41 int phy_id, int reg, int val));
43 /* DMA channel enable mask */
46 /* DMA channel interrupt mask */
47 u32 dma_chan_int_mask;
49 /* DMA engine has internal SRAM */
52 /* DMA channel register width */
53 unsigned int dma_chan_width;
55 /* DMA descriptor shift */
56 unsigned int dma_desc_shift;
60 * on board ethernet switch platform data
62 #define ENETSW_MAX_PORT 8
63 #define ENETSW_PORTS_6328 5 /* 4 FE PHY + 1 RGMII */
64 #define ENETSW_PORTS_6368 6 /* 4 FE PHY + 2 RGMII */
66 #define ENETSW_RGMII_PORT0 4
68 struct bcm63xx_enetsw_port {
74 int force_duplex_full;
79 struct bcm63xx_enetsw_platform_data {
80 char mac_addr[ETH_ALEN];
82 struct bcm63xx_enetsw_port used_ports[ENETSW_MAX_PORT];
84 /* DMA channel enable mask */
87 /* DMA channel interrupt mask */
88 u32 dma_chan_int_mask;
90 /* DMA channel register width */
91 unsigned int dma_chan_width;
93 /* DMA engine has internal SRAM */
97 int __init bcm63xx_enet_register(int unit,
98 const struct bcm63xx_enet_platform_data *pd);
100 int bcm63xx_enetsw_register(const struct bcm63xx_enetsw_platform_data *pd);
102 enum bcm63xx_regs_enetdmac {
113 static inline unsigned long bcm63xx_enetdmacreg(enum bcm63xx_regs_enetdmac reg)
115 extern const unsigned long *bcm63xx_regs_enetdmac;
117 return bcm63xx_regs_enetdmac[reg];
121 #endif /* ! BCM63XX_DEV_ENET_H_ */