ssb: Add Gigabit Ethernet driver
Subsystems (3)
PATCH 1/1 ssb: Add Gigabit Ethernet driver
This adds the Gigabit Ethernet driver for the SSB Gigabit Ethernet core. This driver actually is a frontend to the Tigon3 driver. So the real work is done by tg3. This device is used in the Linksys WRT350N.
Signed-off-by Michael Buesch <[email protected]>
---
For 2.6.26
drivers/ssb/Kconfig +9 -0
@@ -125,4 +125,13 @@ config SSB_DRIVER_EXTIF If unsure, say N +config SSB_DRIVER_GIGE + bool "SSB Broadcom Gigabit Ethernet driver" + depends on SSB_PCIHOST_POSSIBLE && SSB_EMBEDDED && MIPS + help + Driver for the Sonics Silicon Backplane attached + Broadcom Gigabit Ethernet. + + If unsure, say N + endmenu
drivers/ssb/Makefile +1 -0
@@ -11,6 +11,7 @@ ssb-y += driver_chipcommon.o ssb-$(CONFIG_SSB_DRIVER_MIPS) += driver_mipscore.o ssb-$(CONFIG_SSB_DRIVER_EXTIF) += driver_extif.o ssb-$(CONFIG_SSB_DRIVER_PCICORE) += driver_pcicore.o +ssb-$(CONFIG_SSB_DRIVER_GIGE) += driver_gige.o # b43 pci-ssb-bridge driver # Not strictly a part of SSB, but kept here for convenience
drivers/ssb/driver_gige.c new file +294 -0
294 lines not on this page · raw message
include/linux/ssb/ssb_driver_gige.h new file +174 -0
174 lines not on this page · raw message
drivers/ssb/driver_pcicore.c +89 -71
172 lines not on this page · raw message
drivers/ssb/embedded.c +90 -0
99 lines not on this page · raw message
include/linux/ssb/ssb.h +7 -0
@@ -422,5 +422,12 @@ extern int ssb_bus_powerup(struct ssb_buextern u32 ssb_admatch_base (u32 adm);extern u32 ssb_admatch_size (u32 adm); +/* PCI device mapping and fixup routines. +* Called from the architecture pcibios init code. +* These are only available on SSB_EMBEDDED configurations. */ +#ifdef CONFIG_SSB_EMBEDDED +int ssb_pcibios_plat_dev_init (struct pci_dev *dev); +int ssb_pcibios_map_irq (const struct pci_dev *dev,u8 slot,u8 pin); +#endif /* CONFIG_SSB_EMBEDDED */ #endif /* LINUX_SSB_H_ */
include/linux/ssb/ssb_driver_pci.h +19 -0
@@ -1,6 +1,11 @@#ifndef LINUX_SSB_PCICORE_H_ #define LINUX_SSB_PCICORE_H_ +#include <linux/types.h> + +struct pci_dev ; + +#ifdef CONFIG_SSB_DRIVER_PCICORE /* PCI core registers. */
@@ -88,6 +93,9 @@ extern void ssb_pcicore_init(struct ssb_extern int ssb_pcicore_dev_irqvecs_enable (struct ssb_pcicore *pc,struct ssb_device *dev); +int ssb_pcicore_plat_dev_init (struct pci_dev *d); +int ssb_pcicore_pcibios_map_irq (const struct pci_dev *dev,u8 slot,u8 pin); +#else /* CONFIG_SSB_DRIVER_PCICORE */
@@ -107,5 +115,16 @@ int ssb_pcicore_dev_irqvecs_enable(strucreturn 0 ; } +static inline +int ssb_pcicore_plat_dev_init (struct pci_dev *d) +{ +return -ENODEV ; +} +static inline +int ssb_pcicore_pcibios_map_irq (const struct pci_dev *dev,u8 slot,u8 pin) +{ +return -ENODEV ; +} +#endif /* CONFIG_SSB_DRIVER_PCICORE */ #endif /* LINUX_SSB_PCICORE_H_ */
drivers/ssb/main.c +29 -1
@@ -14,6 +14,7 @@#include <linux/io.h> #include <linux/ssb/ssb.h> #include <linux/ssb/ssb_regs.h> +#include <linux/ssb/ssb_driver_gige.h> #include <linux/dma-mapping.h> #include <linux/pci.h>
@@ -68,6 +69,25 @@ found: }#endif /* CONFIG_SSB_PCIHOST */ +int ssb_for_each_bus_call (unsigned long data, +int (*func)(struct ssb_bus *bus,unsigned long data)) +{ +struct ssb_bus *bus; +int res; + +ssb_buses_lock (); +list_for_each_entry (bus, &buses, list) { + res =func (bus, data); +if (res >=0 ) { +ssb_buses_unlock (); +return res; + } + } +ssb_buses_unlock (); + +return -ENODEV ; +} +static struct ssb_device *ssb_device_get (struct ssb_device *dev) {if (dev)
@@ -1171,7 +1191,14 @@ static int __init ssb_modinit(void) err =b43_pci_ssb_bridge_init ();if (err) {ssb_printk (KERN_ERR "Broadcom 43xx PCI-SSB-bridge " -"initialization failed" ); +"initialization failed\n" ); +/* don't fail SSB init because of this */ + err =0 ; + } + err =ssb_gige_init (); +if (err) { +ssb_printk (KERN_ERR "SSB Broadcom Gigabit Ethernet " +"driver initialization failed\n" );/* don't fail SSB init because of this */ err =0 ; }
@@ -1185,6 +1212,7 @@ fs_initcall(ssb_modinit); static void __exit ssb_modexit(void) { +ssb_gige_exit ();b43_pci_ssb_bridge_exit ();bus_unregister (&ssb_bustype); }
drivers/ssb/ssb_private.h +2 -0
@@ -118,6 +118,8 @@ extern u32 ssb_calc_clock_rate(u32 plltyextern int ssb_devices_freeze (struct ssb_bus *bus);extern int ssb_devices_thaw (struct ssb_bus *bus);extern struct ssb_bus *ssb_pci_dev_to_bus (struct pci_dev *pdev); +int ssb_for_each_bus_call (unsigned long data, +int (*func)(struct ssb_bus *bus,unsigned long data));/* b43_pci_bridge.c */ #ifdef CONFIG_SSB_B43_PCI_BRIDGE
drivers/ssb/driver_mipscore.c +1 -0
@@ -209,6 +209,7 @@ void ssb_mipscore_init(struct ssb_mipsco/* fallthrough */ case SSB_DEV_PCI :case SSB_DEV_ETHERNET : +case SSB_DEV_ETHERNET_GBIT :case SSB_DEV_80211 :case SSB_DEV_USB20_HOST :/* These devices get their own IRQ line if available, the rest goes on IRQ0 */
Signature · 1 line
Greetings Michael.