1 #ifndef LINUX_SSB_DRIVER_GIGE_H_
2 #define LINUX_SSB_DRIVER_GIGE_H_
10 #ifdef CONFIG_SSB_DRIVER_GIGE
13 #define SSB_GIGE_PCIIO 0x0000
14 #define SSB_GIGE_RESERVED 0x0400
15 #define SSB_GIGE_PCICFG 0x0800
16 #define SSB_GIGE_SHIM_FLUSHSTAT 0x0C00
17 #define SSB_GIGE_SHIM_FLUSHRDA 0x0C04
18 #define SSB_GIGE_SHIM_FLUSHTO 0x0C08
19 #define SSB_GIGE_SHIM_BARRIER 0x0C0C
20 #define SSB_GIGE_SHIM_MAOCPSI 0x0C10
21 #define SSB_GIGE_SHIM_SIOCPMA 0x0C14
24 #define SSB_GIGE_TMSHIGH_RGMII 0x00010000
26 #define SSB_GIGE_TMSLOW_TXBYPASS 0x00080000
27 #define SSB_GIGE_TMSLOW_RXBYPASS 0x00100000
28 #define SSB_GIGE_TMSLOW_DLLEN 0x01000000
31 #define SSB_GIGE_BFL_ROBOSWITCH 0x0010
34 #define SSB_GIGE_MEM_RES_NAME "SSB Broadcom 47xx GigE memory"
35 #define SSB_GIGE_IO_RES_NAME "SSB Broadcom 47xx GigE I/O"
57 static inline struct ssb_gige * pdev_to_ssb_gige(
struct pci_dev *pdev)
65 static inline bool ssb_gige_is_rgmii(
struct pci_dev *pdev)
67 struct ssb_gige *
dev = pdev_to_ssb_gige(pdev);
68 return (dev ? dev->has_rgmii : 0);
72 static inline bool ssb_gige_have_roboswitch(
struct pci_dev *pdev)
74 struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
76 return !!(dev->dev->bus->sprom.boardflags_lo &
77 SSB_GIGE_BFL_ROBOSWITCH);
82 static inline bool ssb_gige_one_dma_at_once(
struct pci_dev *pdev)
84 struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
86 return ((dev->dev->bus->chip_id == 0x4785) &&
87 (dev->dev->bus->chip_rev < 2));
92 static inline bool ssb_gige_must_flush_posted_writes(
struct pci_dev *pdev)
94 struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
96 return (dev->dev->bus->chip_id == 0x4785);
100 #ifdef CONFIG_BCM47XX
108 nvram_parse_macaddr(buf, macaddr);
111 static inline void ssb_gige_get_macaddr(
struct pci_dev *pdev,
u8 *macaddr)
124 static inline void ssb_gige_exit(
void)
150 static inline void ssb_gige_exit(
void)
158 static inline struct ssb_gige * pdev_to_ssb_gige(
struct pci_dev *pdev)
162 static inline bool ssb_gige_is_rgmii(
struct pci_dev *pdev)
166 static inline bool ssb_gige_have_roboswitch(
struct pci_dev *pdev)
170 static inline bool ssb_gige_one_dma_at_once(
struct pci_dev *pdev)
174 static inline bool ssb_gige_must_flush_posted_writes(
struct pci_dev *pdev)