mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-11 21:12:28 +02:00
31a40f97ef
* add new patches for bcm4716 SoC * add support for serial flash on bcma bus git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27723 3c298f89-4303-0410-b956-a3cf2f4a3e73
266 lines
8.4 KiB
Diff
266 lines
8.4 KiB
Diff
--- a/drivers/ssb/driver_chipcommon_pmu.c
|
|
+++ b/drivers/ssb/driver_chipcommon_pmu.c
|
|
@@ -417,9 +417,9 @@ static void ssb_pmu_resources_init(struc
|
|
u32 min_msk = 0, max_msk = 0;
|
|
unsigned int i;
|
|
const struct pmu_res_updown_tab_entry *updown_tab = NULL;
|
|
- unsigned int updown_tab_size;
|
|
+ unsigned int updown_tab_size = 0;
|
|
const struct pmu_res_depend_tab_entry *depend_tab = NULL;
|
|
- unsigned int depend_tab_size;
|
|
+ unsigned int depend_tab_size = 0;
|
|
|
|
switch (bus->chip_id) {
|
|
case 0x4312:
|
|
--- a/drivers/ssb/driver_gige.c
|
|
+++ b/drivers/ssb/driver_gige.c
|
|
@@ -106,8 +106,9 @@ void gige_pcicfg_write32(struct ssb_gige
|
|
gige_write32(dev, SSB_GIGE_PCICFG + offset, value);
|
|
}
|
|
|
|
-static int ssb_gige_pci_read_config(struct pci_bus *bus, unsigned int devfn,
|
|
- int reg, int size, u32 *val)
|
|
+static int __devinit ssb_gige_pci_read_config(struct pci_bus *bus,
|
|
+ unsigned int devfn, int reg,
|
|
+ int size, u32 *val)
|
|
{
|
|
struct ssb_gige *dev = container_of(bus->ops, struct ssb_gige, pci_ops);
|
|
unsigned long flags;
|
|
@@ -136,8 +137,9 @@ static int ssb_gige_pci_read_config(stru
|
|
return PCIBIOS_SUCCESSFUL;
|
|
}
|
|
|
|
-static int ssb_gige_pci_write_config(struct pci_bus *bus, unsigned int devfn,
|
|
- int reg, int size, u32 val)
|
|
+static int __devinit ssb_gige_pci_write_config(struct pci_bus *bus,
|
|
+ unsigned int devfn, int reg,
|
|
+ int size, u32 val)
|
|
{
|
|
struct ssb_gige *dev = container_of(bus->ops, struct ssb_gige, pci_ops);
|
|
unsigned long flags;
|
|
@@ -166,7 +168,8 @@ static int ssb_gige_pci_write_config(str
|
|
return PCIBIOS_SUCCESSFUL;
|
|
}
|
|
|
|
-static int ssb_gige_probe(struct ssb_device *sdev, const struct ssb_device_id *id)
|
|
+static int __devinit ssb_gige_probe(struct ssb_device *sdev,
|
|
+ const struct ssb_device_id *id)
|
|
{
|
|
struct ssb_gige *dev;
|
|
u32 base, tmslow, tmshigh;
|
|
--- a/drivers/ssb/driver_pcicore.c
|
|
+++ b/drivers/ssb/driver_pcicore.c
|
|
@@ -314,7 +314,7 @@ int ssb_pcicore_pcibios_map_irq(const st
|
|
return ssb_mips_irq(extpci_core->dev) + 2;
|
|
}
|
|
|
|
-static void ssb_pcicore_init_hostmode(struct ssb_pcicore *pc)
|
|
+static void __devinit ssb_pcicore_init_hostmode(struct ssb_pcicore *pc)
|
|
{
|
|
u32 val;
|
|
|
|
@@ -379,7 +379,7 @@ static void ssb_pcicore_init_hostmode(st
|
|
register_pci_controller(&ssb_pcicore_controller);
|
|
}
|
|
|
|
-static int pcicore_is_in_hostmode(struct ssb_pcicore *pc)
|
|
+static int __devinit pcicore_is_in_hostmode(struct ssb_pcicore *pc)
|
|
{
|
|
struct ssb_bus *bus = pc->dev->bus;
|
|
u16 chipid_top;
|
|
@@ -412,7 +412,7 @@ static int pcicore_is_in_hostmode(struct
|
|
* Workarounds.
|
|
**************************************************/
|
|
|
|
-static void ssb_pcicore_fix_sprom_core_index(struct ssb_pcicore *pc)
|
|
+static void __devinit ssb_pcicore_fix_sprom_core_index(struct ssb_pcicore *pc)
|
|
{
|
|
u16 tmp = pcicore_read16(pc, SSB_PCICORE_SPROM(0));
|
|
if (((tmp & 0xF000) >> 12) != pc->dev->core_index) {
|
|
@@ -514,7 +514,7 @@ static void ssb_pcicore_pcie_setup_worka
|
|
* Generic and Clientmode operation code.
|
|
**************************************************/
|
|
|
|
-static void ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
|
|
+static void __devinit ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
|
|
{
|
|
ssb_pcicore_fix_sprom_core_index(pc);
|
|
|
|
@@ -529,7 +529,7 @@ static void ssb_pcicore_init_clientmode(
|
|
}
|
|
}
|
|
|
|
-void ssb_pcicore_init(struct ssb_pcicore *pc)
|
|
+void __devinit ssb_pcicore_init(struct ssb_pcicore *pc)
|
|
{
|
|
struct ssb_device *dev = pc->dev;
|
|
|
|
--- a/drivers/ssb/main.c
|
|
+++ b/drivers/ssb/main.c
|
|
@@ -557,7 +557,7 @@ error:
|
|
}
|
|
|
|
/* Needs ssb_buses_lock() */
|
|
-static int ssb_attach_queued_buses(void)
|
|
+static int __devinit ssb_attach_queued_buses(void)
|
|
{
|
|
struct ssb_bus *bus, *n;
|
|
int err = 0;
|
|
@@ -768,9 +768,9 @@ out:
|
|
return err;
|
|
}
|
|
|
|
-static int ssb_bus_register(struct ssb_bus *bus,
|
|
- ssb_invariants_func_t get_invariants,
|
|
- unsigned long baseaddr)
|
|
+static int __devinit ssb_bus_register(struct ssb_bus *bus,
|
|
+ ssb_invariants_func_t get_invariants,
|
|
+ unsigned long baseaddr)
|
|
{
|
|
int err;
|
|
|
|
@@ -851,8 +851,8 @@ err_disable_xtal:
|
|
}
|
|
|
|
#ifdef CONFIG_SSB_PCIHOST
|
|
-int ssb_bus_pcibus_register(struct ssb_bus *bus,
|
|
- struct pci_dev *host_pci)
|
|
+int __devinit ssb_bus_pcibus_register(struct ssb_bus *bus,
|
|
+ struct pci_dev *host_pci)
|
|
{
|
|
int err;
|
|
|
|
@@ -875,9 +875,9 @@ EXPORT_SYMBOL(ssb_bus_pcibus_register);
|
|
#endif /* CONFIG_SSB_PCIHOST */
|
|
|
|
#ifdef CONFIG_SSB_PCMCIAHOST
|
|
-int ssb_bus_pcmciabus_register(struct ssb_bus *bus,
|
|
- struct pcmcia_device *pcmcia_dev,
|
|
- unsigned long baseaddr)
|
|
+int __devinit ssb_bus_pcmciabus_register(struct ssb_bus *bus,
|
|
+ struct pcmcia_device *pcmcia_dev,
|
|
+ unsigned long baseaddr)
|
|
{
|
|
int err;
|
|
|
|
@@ -897,8 +897,9 @@ EXPORT_SYMBOL(ssb_bus_pcmciabus_register
|
|
#endif /* CONFIG_SSB_PCMCIAHOST */
|
|
|
|
#ifdef CONFIG_SSB_SDIOHOST
|
|
-int ssb_bus_sdiobus_register(struct ssb_bus *bus, struct sdio_func *func,
|
|
- unsigned int quirks)
|
|
+int __devinit ssb_bus_sdiobus_register(struct ssb_bus *bus,
|
|
+ struct sdio_func *func,
|
|
+ unsigned int quirks)
|
|
{
|
|
int err;
|
|
|
|
@@ -918,9 +919,9 @@ int ssb_bus_sdiobus_register(struct ssb_
|
|
EXPORT_SYMBOL(ssb_bus_sdiobus_register);
|
|
#endif /* CONFIG_SSB_PCMCIAHOST */
|
|
|
|
-int ssb_bus_ssbbus_register(struct ssb_bus *bus,
|
|
- unsigned long baseaddr,
|
|
- ssb_invariants_func_t get_invariants)
|
|
+int __devinit ssb_bus_ssbbus_register(struct ssb_bus *bus,
|
|
+ unsigned long baseaddr,
|
|
+ ssb_invariants_func_t get_invariants)
|
|
{
|
|
int err;
|
|
|
|
@@ -1001,8 +1002,8 @@ u32 ssb_calc_clock_rate(u32 plltype, u32
|
|
switch (plltype) {
|
|
case SSB_PLLTYPE_6: /* 100/200 or 120/240 only */
|
|
if (m & SSB_CHIPCO_CLK_T6_MMASK)
|
|
- return SSB_CHIPCO_CLK_T6_M0;
|
|
- return SSB_CHIPCO_CLK_T6_M1;
|
|
+ return SSB_CHIPCO_CLK_T6_M1;
|
|
+ return SSB_CHIPCO_CLK_T6_M0;
|
|
case SSB_PLLTYPE_1: /* 48Mhz base, 3 dividers */
|
|
case SSB_PLLTYPE_3: /* 25Mhz, 2 dividers */
|
|
case SSB_PLLTYPE_4: /* 48Mhz, 4 dividers */
|
|
@@ -1265,7 +1266,10 @@ u32 ssb_dma_translation(struct ssb_devic
|
|
case SSB_BUSTYPE_SSB:
|
|
return 0;
|
|
case SSB_BUSTYPE_PCI:
|
|
- return SSB_PCI_DMA;
|
|
+ if (ssb_read32(dev, SSB_TMSHIGH) & SSB_TMSHIGH_DMA64)
|
|
+ return SSB_PCIE_DMA_H32;
|
|
+ else
|
|
+ return SSB_PCI_DMA;
|
|
default:
|
|
__ssb_dma_not_implemented(dev);
|
|
}
|
|
--- a/drivers/ssb/pci.c
|
|
+++ b/drivers/ssb/pci.c
|
|
@@ -734,12 +734,9 @@ out_free:
|
|
static void ssb_pci_get_boardinfo(struct ssb_bus *bus,
|
|
struct ssb_boardinfo *bi)
|
|
{
|
|
- pci_read_config_word(bus->host_pci, PCI_SUBSYSTEM_VENDOR_ID,
|
|
- &bi->vendor);
|
|
- pci_read_config_word(bus->host_pci, PCI_SUBSYSTEM_ID,
|
|
- &bi->type);
|
|
- pci_read_config_word(bus->host_pci, PCI_REVISION_ID,
|
|
- &bi->rev);
|
|
+ bi->vendor = bus->host_pci->subsystem_vendor;
|
|
+ bi->type = bus->host_pci->subsystem_device;
|
|
+ bi->rev = bus->host_pci->revision;
|
|
}
|
|
|
|
int ssb_pci_get_invariants(struct ssb_bus *bus,
|
|
--- a/drivers/ssb/pcihost_wrapper.c
|
|
+++ b/drivers/ssb/pcihost_wrapper.c
|
|
@@ -53,8 +53,8 @@ static int ssb_pcihost_resume(struct pci
|
|
# define ssb_pcihost_resume NULL
|
|
#endif /* CONFIG_PM */
|
|
|
|
-static int ssb_pcihost_probe(struct pci_dev *dev,
|
|
- const struct pci_device_id *id)
|
|
+static int __devinit ssb_pcihost_probe(struct pci_dev *dev,
|
|
+ const struct pci_device_id *id)
|
|
{
|
|
struct ssb_bus *ssb;
|
|
int err = -ENOMEM;
|
|
@@ -110,7 +110,7 @@ static void ssb_pcihost_remove(struct pc
|
|
pci_set_drvdata(dev, NULL);
|
|
}
|
|
|
|
-int ssb_pcihost_register(struct pci_driver *driver)
|
|
+int __devinit ssb_pcihost_register(struct pci_driver *driver)
|
|
{
|
|
driver->probe = ssb_pcihost_probe;
|
|
driver->remove = ssb_pcihost_remove;
|
|
--- a/drivers/ssb/scan.c
|
|
+++ b/drivers/ssb/scan.c
|
|
@@ -310,8 +310,7 @@ int ssb_bus_scan(struct ssb_bus *bus,
|
|
} else {
|
|
if (bus->bustype == SSB_BUSTYPE_PCI) {
|
|
bus->chip_id = pcidev_to_chipid(bus->host_pci);
|
|
- pci_read_config_byte(bus->host_pci, PCI_REVISION_ID,
|
|
- &bus->chip_rev);
|
|
+ bus->chip_rev = bus->host_pci->revision;
|
|
bus->chip_package = 0;
|
|
} else {
|
|
bus->chip_id = 0x4710;
|
|
--- a/include/linux/ssb/ssb.h
|
|
+++ b/include/linux/ssb/ssb.h
|
|
@@ -27,6 +27,8 @@ struct ssb_sprom {
|
|
u8 et1mdcport; /* MDIO for enet1 */
|
|
u8 board_rev; /* Board revision number from SPROM. */
|
|
u8 country_code; /* Country Code */
|
|
+ u16 leddc_on_time; /* LED Powersave Duty Cycle On Count */
|
|
+ u16 leddc_off_time; /* LED Powersave Duty Cycle Off Count */
|
|
u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */
|
|
u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */
|
|
u16 pa0b0;
|
|
@@ -99,7 +101,7 @@ struct ssb_sprom {
|
|
struct ssb_boardinfo {
|
|
u16 vendor;
|
|
u16 type;
|
|
- u16 rev;
|
|
+ u8 rev;
|
|
};
|
|
|
|
|