From ca979845ccc58feb6ca04e913d24414fe90708c4 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 27 Jun 2011 21:28:40 +0000 Subject: kernel: update ssb and bcma to linux-next next-20110627 SVN-Revision: 27295 --- .../031-ssb-add-callback-for-sprom.patch | 146 --------------------- .../brcm47xx/patches-2.6.39/220-bcm5354.patch | 6 +- .../patches-2.6.39/240-ssb_no_sprom_on_pci.patch | 28 ++++ .../250-ssb_fix_ssb_clock_rate.patch | 25 ++++ .../976-ssb_increase_pci_delay.patch | 2 +- 5 files changed, 57 insertions(+), 150 deletions(-) delete mode 100644 target/linux/brcm47xx/patches-2.6.39/031-ssb-add-callback-for-sprom.patch create mode 100644 target/linux/brcm47xx/patches-2.6.39/240-ssb_no_sprom_on_pci.patch create mode 100644 target/linux/brcm47xx/patches-2.6.39/250-ssb_fix_ssb_clock_rate.patch (limited to 'target/linux/brcm47xx/patches-2.6.39') diff --git a/target/linux/brcm47xx/patches-2.6.39/031-ssb-add-callback-for-sprom.patch b/target/linux/brcm47xx/patches-2.6.39/031-ssb-add-callback-for-sprom.patch deleted file mode 100644 index bf19ae0b98..0000000000 --- a/target/linux/brcm47xx/patches-2.6.39/031-ssb-add-callback-for-sprom.patch +++ /dev/null @@ -1,146 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -643,6 +643,17 @@ static struct ssb_sprom bcm63xx_sprom = - .boardflags_lo = 0x2848, - .boardflags_hi = 0x0000, - }; -+ -+int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out) -+{ -+ if (bus->bustype == SSB_BUSTYPE_PCI) { -+ memcpy(out, &bcm63xx_sprom, sizeof(struct ssb_sprom)); -+ return 0; -+ } else { -+ printk(KERN_ERR PFX "unable to fill SPROM for given bustype.\n"); -+ return -EINVAL; -+ } -+} - #endif - - /* -@@ -793,8 +804,9 @@ void __init board_prom_init(void) - if (!board_get_mac_address(bcm63xx_sprom.il0mac)) { - memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN); - memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN); -- if (ssb_arch_set_fallback_sprom(&bcm63xx_sprom) < 0) -- printk(KERN_ERR "failed to register fallback SPROM\n"); -+ if (ssb_arch_register_fallback_sprom( -+ &bcm63xx_get_fallback_sprom) < 0) -+ printk(KERN_ERR PFX "failed to register fallback SPROM\n"); - } - #endif - } ---- a/drivers/ssb/pci.c -+++ b/drivers/ssb/pci.c -@@ -662,7 +662,6 @@ static int sprom_extract(struct ssb_bus - static int ssb_pci_sprom_get(struct ssb_bus *bus, - struct ssb_sprom *sprom) - { -- const struct ssb_sprom *fallback; - int err; - u16 *buf; - -@@ -707,10 +706,17 @@ static int ssb_pci_sprom_get(struct ssb_ - if (err) { - /* All CRC attempts failed. - * Maybe there is no SPROM on the device? -- * If we have a fallback, use that. */ -- fallback = ssb_get_fallback_sprom(); -- if (fallback) { -- memcpy(sprom, fallback, sizeof(*sprom)); -+ * Now we ask the arch code if there is some sprom -+ * avaliable for this device in some other storage */ -+ err = ssb_fill_sprom_with_fallback(bus, sprom); -+ if (err) { -+ ssb_printk(KERN_WARNING PFX "WARNING: Using" -+ " fallback SPROM failed (err %d)\n", -+ err); -+ } else { -+ ssb_dprintk(KERN_DEBUG PFX "Using SPROM" -+ " revision %d provided by" -+ " platform.\n", sprom->revision); - err = 0; - goto out_free; - } ---- a/drivers/ssb/sprom.c -+++ b/drivers/ssb/sprom.c -@@ -17,7 +17,7 @@ - #include - - --static const struct ssb_sprom *fallback_sprom; -+static int(*get_fallback_sprom)(struct ssb_bus *dev, struct ssb_sprom *out); - - - static int sprom2hex(const u16 *sprom, char *buf, size_t buf_len, -@@ -145,13 +145,14 @@ out: - } - - /** -- * ssb_arch_set_fallback_sprom - Set a fallback SPROM for use if no SPROM is found. -+ * ssb_arch_register_fallback_sprom - Registers a method providing a fallback -+ * SPROM if no SPROM is found. - * -- * @sprom: The SPROM data structure to register. -+ * @sprom_callback: The callbcak function. - * -- * With this function the architecture implementation may register a fallback -- * SPROM data structure. The fallback is only used for PCI based SSB devices, -- * where no valid SPROM can be found in the shadow registers. -+ * With this function the architecture implementation may register a callback -+ * handler which wills the SPROM data structure. The fallback is only used for -+ * PCI based SSB devices, where no valid SPROM can be found in the shadow registers. - * - * This function is useful for weird architectures that have a half-assed SSB device - * hardwired to their PCI bus. -@@ -163,18 +164,21 @@ out: - * - * This function is available for architecture code, only. So it is not exported. - */ --int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom) -+int ssb_arch_register_fallback_sprom(int (*sprom_callback)(struct ssb_bus *bus, struct ssb_sprom *out)) - { -- if (fallback_sprom) -+ if (get_fallback_sprom) - return -EEXIST; -- fallback_sprom = sprom; -+ get_fallback_sprom = sprom_callback; - - return 0; - } - --const struct ssb_sprom *ssb_get_fallback_sprom(void) -+int ssb_fill_sprom_with_fallback(struct ssb_bus *bus, struct ssb_sprom *out) - { -- return fallback_sprom; -+ if (!get_fallback_sprom) -+ return -ENOENT; -+ -+ return get_fallback_sprom(bus, out); - } - - /* http://bcm-v4.sipsolutions.net/802.11/IsSpromAvailable */ ---- a/drivers/ssb/ssb_private.h -+++ b/drivers/ssb/ssb_private.h -@@ -171,7 +171,7 @@ ssize_t ssb_attr_sprom_store(struct ssb_ - const char *buf, size_t count, - int (*sprom_check_crc)(const u16 *sprom, size_t size), - int (*sprom_write)(struct ssb_bus *bus, const u16 *sprom)); --extern const struct ssb_sprom *ssb_get_fallback_sprom(void); -+extern int ssb_fill_sprom_with_fallback(struct ssb_bus *bus, struct ssb_sprom *out); - - - /* core.c */ ---- a/include/linux/ssb/ssb.h -+++ b/include/linux/ssb/ssb.h -@@ -404,7 +404,9 @@ extern bool ssb_is_sprom_available(struc - - /* Set a fallback SPROM. - * See kdoc at the function definition for complete documentation. */ --extern int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom); -+extern int ssb_arch_register_fallback_sprom( -+ int (*sprom_callback)(struct ssb_bus *bus, -+ struct ssb_sprom *out)); - - /* Suspend a SSB bus. - * Call this from the parent bus suspend routine. */ diff --git a/target/linux/brcm47xx/patches-2.6.39/220-bcm5354.patch b/target/linux/brcm47xx/patches-2.6.39/220-bcm5354.patch index e1d5d90ebc..d68534fb65 100644 --- a/target/linux/brcm47xx/patches-2.6.39/220-bcm5354.patch +++ b/target/linux/brcm47xx/patches-2.6.39/220-bcm5354.patch @@ -1,6 +1,6 @@ --- a/drivers/ssb/driver_chipcommon.c +++ b/drivers/ssb/driver_chipcommon.c -@@ -285,6 +285,8 @@ void ssb_chipco_resume(struct ssb_chipco +@@ -317,6 +317,8 @@ void ssb_chipco_resume(struct ssb_chipco void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc, u32 *plltype, u32 *n, u32 *m) { @@ -9,7 +9,7 @@ *n = chipco_read32(cc, SSB_CHIPCO_CLOCK_N); *plltype = (cc->capabilities & SSB_CHIPCO_CAP_PLLT); switch (*plltype) { -@@ -308,6 +310,8 @@ void ssb_chipco_get_clockcpu(struct ssb_ +@@ -340,6 +342,8 @@ void ssb_chipco_get_clockcpu(struct ssb_ void ssb_chipco_get_clockcontrol(struct ssb_chipcommon *cc, u32 *plltype, u32 *n, u32 *m) { @@ -31,7 +31,7 @@ } --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c -@@ -1103,6 +1103,8 @@ u32 ssb_clockspeed(struct ssb_bus *bus) +@@ -1104,6 +1104,8 @@ u32 ssb_clockspeed(struct ssb_bus *bus) if (bus->chip_id == 0x5365) { rate = 100000000; diff --git a/target/linux/brcm47xx/patches-2.6.39/240-ssb_no_sprom_on_pci.patch b/target/linux/brcm47xx/patches-2.6.39/240-ssb_no_sprom_on_pci.patch new file mode 100644 index 0000000000..52c8fe95f3 --- /dev/null +++ b/target/linux/brcm47xx/patches-2.6.39/240-ssb_no_sprom_on_pci.patch @@ -0,0 +1,28 @@ +--- a/drivers/ssb/driver_pcicore.c ++++ b/drivers/ssb/driver_pcicore.c +@@ -412,16 +412,6 @@ static int __devinit pcicore_is_in_hostm + * Workarounds. + **************************************************/ + +-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) { +- tmp &= ~0xF000; +- tmp |= (pc->dev->core_index << 12); +- pcicore_write16(pc, SSB_PCICORE_SPROM(0), tmp); +- } +-} +- + static u8 ssb_pcicore_polarity_workaround(struct ssb_pcicore *pc) + { + return (ssb_pcie_read(pc, 0x204) & 0x10) ? 0xC0 : 0x80; +@@ -529,8 +519,6 @@ void __devinit ssb_pcicore_init(struct s + if (!ssb_device_is_enabled(dev)) + ssb_device_enable(dev, 0); + +- ssb_pcicore_fix_sprom_core_index(pc); +- + #ifdef CONFIG_SSB_PCICORE_HOSTMODE + pc->hostmode = pcicore_is_in_hostmode(pc); + if (pc->hostmode) diff --git a/target/linux/brcm47xx/patches-2.6.39/250-ssb_fix_ssb_clock_rate.patch b/target/linux/brcm47xx/patches-2.6.39/250-ssb_fix_ssb_clock_rate.patch new file mode 100644 index 0000000000..fe6507b8de --- /dev/null +++ b/target/linux/brcm47xx/patches-2.6.39/250-ssb_fix_ssb_clock_rate.patch @@ -0,0 +1,25 @@ +From 974353557959d8ec1c022511cd1b3eeaa7ed482a Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sat, 4 Jun 2011 15:55:24 +0200 +Subject: [PATCH 15/15] ssb: fix ssb clock rate according to broadcom source + +This fix was done according to si_clock_rate function in broadcom siutils.c + +Signed-off-by: Hauke Mehrtens +--- + drivers/ssb/main.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/ssb/main.c ++++ b/drivers/ssb/main.c +@@ -1002,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 */ diff --git a/target/linux/brcm47xx/patches-2.6.39/976-ssb_increase_pci_delay.patch b/target/linux/brcm47xx/patches-2.6.39/976-ssb_increase_pci_delay.patch index af67367b1d..0650c25683 100644 --- a/target/linux/brcm47xx/patches-2.6.39/976-ssb_increase_pci_delay.patch +++ b/target/linux/brcm47xx/patches-2.6.39/976-ssb_increase_pci_delay.patch @@ -1,6 +1,6 @@ --- a/drivers/ssb/driver_pcicore.c +++ b/drivers/ssb/driver_pcicore.c -@@ -370,7 +370,7 @@ static void ssb_pcicore_init_hostmode(st +@@ -375,7 +375,7 @@ static void __devinit ssb_pcicore_init_h set_io_port_base(ssb_pcicore_controller.io_map_base); /* Give some time to the PCI controller to configure itself with the new * values. Not waiting at this point causes crashes of the machine. */ -- cgit v1.2.3