diff options
author | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-05-03 20:18:41 +0000 |
---|---|---|
committer | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-05-03 20:18:41 +0000 |
commit | 14f0acdc28029cf1766e115ab73231adcdbe1923 (patch) | |
tree | 5244cf8b56b2b405ee9d319ad684fbd3343ba54d /target/linux/brcm47xx/patches-3.3/200-MIPS-BCM47XX-provide-sprom-to-bcma-bus.patch | |
parent | d0f3681e1e384dd7f11bc8ce8cd43c4fdff897d9 (diff) |
brcm47xx: add support for kernel 3.3
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31573 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/patches-3.3/200-MIPS-BCM47XX-provide-sprom-to-bcma-bus.patch')
-rw-r--r-- | target/linux/brcm47xx/patches-3.3/200-MIPS-BCM47XX-provide-sprom-to-bcma-bus.patch | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.3/200-MIPS-BCM47XX-provide-sprom-to-bcma-bus.patch b/target/linux/brcm47xx/patches-3.3/200-MIPS-BCM47XX-provide-sprom-to-bcma-bus.patch new file mode 100644 index 0000000000..07586c2d15 --- /dev/null +++ b/target/linux/brcm47xx/patches-3.3/200-MIPS-BCM47XX-provide-sprom-to-bcma-bus.patch @@ -0,0 +1,80 @@ +--- a/arch/mips/bcm47xx/setup.c ++++ b/arch/mips/bcm47xx/setup.c +@@ -3,7 +3,7 @@ + * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> + * Copyright (C) 2006 Michael Buesch <m@bues.ch> + * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org> +- * Copyright (C) 2010-2011 Hauke Mehrtens <hauke@hauke-m.de> ++ * Copyright (C) 2010-2012 Hauke Mehrtens <hauke@hauke-m.de> + * Copyright (C) 2011-2012 Tathagata Das <tathagata@alumnux.com> + * + * This program is free software; you can redistribute it and/or modify it +@@ -132,7 +132,7 @@ static void bcm47xx_machine_halt(void) + } + + #ifdef CONFIG_BCM47XX_SSB +-static int bcm47xx_get_sprom(struct ssb_bus *bus, struct ssb_sprom *out) ++static int bcm47xx_get_sprom_ssb(struct ssb_bus *bus, struct ssb_sprom *out) + { + char prefix[10]; + +@@ -149,7 +149,7 @@ static int bcm47xx_get_sprom(struct ssb_ + } + + static int bcm47xx_get_invariants(struct ssb_bus *bus, +- struct ssb_init_invariants *iv) ++ struct ssb_init_invariants *iv) + { + char buf[20]; + +@@ -204,7 +204,7 @@ static void __init bcm47xx_register_ssb( + char buf[100]; + struct ssb_mipscore *mcore; + +- err = ssb_arch_register_fallback_sprom(&bcm47xx_get_sprom); ++ err = ssb_arch_register_fallback_sprom(&bcm47xx_get_sprom_ssb); + if (err) + printk(KERN_WARNING "bcm47xx: someone else already registered" + " a ssb SPROM callback handler (err %d)\n", err); +@@ -256,10 +256,41 @@ static int __init bcm47xx_register_flash + #endif + + #ifdef CONFIG_BCM47XX_BCMA ++static int bcm47xx_get_sprom_bcma(struct bcma_bus *bus, struct ssb_sprom *out) ++{ ++ char prefix[10]; ++ struct bcma_device *core; ++ ++ switch (bus->hosttype) { ++ case BCMA_HOSTTYPE_PCI: ++ snprintf(prefix, sizeof(prefix), "pci/%u/%u/", ++ bus->host_pci->bus->number + 1, ++ PCI_SLOT(bus->host_pci->devfn)); ++ bcm47xx_fill_sprom(out, prefix); ++ return 0; ++ case BCMA_HOSTTYPE_SOC: ++ bcm47xx_fill_sprom_ethernet(out, NULL); ++ core = bcma_find_core(bus, BCMA_CORE_80211); ++ if (core) { ++ snprintf(prefix, sizeof(prefix), "sb/%u/", ++ core->core_index); ++ bcm47xx_fill_sprom(out, prefix); ++ } ++ return 0; ++ default: ++ pr_warn("bcm47xx: unable to fill SPROM for given bustype.\n"); ++ return -EINVAL; ++ } ++} ++ + static void __init bcm47xx_register_bcma(void) + { + int err; + ++ err = bcma_arch_register_fallback_sprom(&bcm47xx_get_sprom_bcma); ++ if (err) ++ pr_warn("bcm47xx: someone else already registered a bcma SPROM callback handler (err %d)\n", err); ++ + err = bcma_host_soc_register(&bcm47xx_bus.bcma); + if (err) + panic("Failed to initialize BCMA bus (err %d)", err); |