On Fri, 2012-03-02 at 19:23 -0800, Nathan Hintz wrote: > Hi Hauke, > > On Sat, 2012-03-03 at 00:06 +0100, Hauke Mehrtens wrote: > > On 03/02/2012 06:36 AM, Nathan Hintz wrote: > > > > > > Signed-off-by: Nathan Hintz <nlhi...@hotmail.com> > > > > > > --- /dev/null 2012-02-21 01:00:44.969496803 -0800 > > > +++ target/linux/brcm47xx/patches-3.2/0051-bcma-enable-irq6.patch > > > 2011-07-25 11:20:35.030008484 -0700 > > > @@ -0,0 +1,29 @@ > > > +--- a/drivers/bcma/driver_mips.c > > > ++++ b/drivers/bcma/driver_mips.c > > > +@@ -74,7 +74,7 @@ > > > + return dev->core_index; > > > + flag = bcma_aread32(dev, BCMA_MIPS_OOBSELOUTA30); > > > + > > > +- return flag & 0x1F; > > > ++ return (flag ? (flag & 0x1F) : 0x3F); > > > + } > > > + > > > + /* Get the MIPS IRQ assignment for a specified device. > > > +@@ -87,6 +87,8 @@ > > > + unsigned int irq; > > > + > > > + irqflag = bcma_core_mips_irqflag(dev); > > > ++ if (irqflag == 0x3F) > > > ++ return 6; > > > + > > > + for (irq = 1; irq <= 4; irq++) > > > + if (bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq)) & > > > +@@ -232,7 +234,7 @@ > > > + core->irq = 0; > > > + else > > > + core->irq = mips_irq + 2; > > > +- if (core->irq > 5) > > > ++ if (core->irq > 6) > > > + continue; > > > + switch (core->id.id) { > > > + case BCMA_CORE_PCI: > > > > > > > Why do you need the IRQ 6? The current code will not assign it to any > > core on the devices I know of. On what device did you test your code? As > > the Broadcom SDK doe not use this IRQ I am a little bit scared if it > > will work on every device. > > > > Hauke > > > This is on a Linksys E3000. I reflashed back to the stock firmware, and > dumped the interrupt assignments (eth1 is wl0, eth2 is wl1). I haven't > actually tried it without the patch. In general, everything seems to be > working; although it will consistently produce a kernel oops if I try to > enable "option wmm 1" for wl1 ("Bus error"), which I haven't been able > to track down. > > Stock Linksys E3000: > # more /proc/interrupts > CPU0 > 3: 18693 MIPS eth1 > 4: 350 MIPS eth0 > 5: 0 MIPS ehci-hcd, usb-ohci > 6: 10353 MIPS eth2 > 7: 51445 MIPS timer > 8: 3382 IRQ2 serial > > ERR: 0 > > OpenWRT Linksys E3000 (using the patch): > root@OpenWrt:/# cat /proc/interrupts > CPU0 > 2: 904 MIPS serial, gpio > 3: 0 MIPS wl0 > 4: 228 MIPS eth0 > 5: 0 MIPS ehci_hcd:usb1, ohci_hcd:usb2 > 6: 0 MIPS wl1 > 7: 87428 MIPS timer > ERR: 0 > > Let me know if there is any other info you would like, I can easily > flash back to stock. > > Nathan > > > Attached is the dmesg output both with and without the patch installed (Linksys E3000). Note that without the patch, IRQ6 (MIPS IRQ4) was assigned to Core 5 (PCIE) core; however, "bcma_core_mips_set_irq" was never called to set the interrupt mask as evidenced by the missing "bcma: set_irq: core 0x0820, irq 6 => 6" log statement. Also, without the patch, Cores 3 and 7 show they are assigned to IRQ2 (MIPS IRQ0), when I think they should be zero (Internal).
In both cases, notice there are no calls to "bcma_core_mips_set_irq" to set the interrupt mask for cores that were assigned IRQ2 (MIPS IRQ0); so I guess we're just lucky that the default masks are adequate. Nathan ********************************************************************************** w/o patch [ 0.000000] Linux version 3.2.9 (openwrt@hintzn1linux) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 Fri 2 [ 0.000000] CPU revision is: 00019740 (MIPS 74Kc) [ 0.000000] bcm47xx: using bcma bus [ 0.000000] bcma: Found chip with id 0x4716, rev 0x01 and package 0x0A [ 0.000000] bcma: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x1F, class 0x0) [ 0.000000] bcma: Core 3 found: MIPS 74K (manuf 0x4A7, id 0x82C, rev 0x01, class 0x0) [ 0.000000] bcma: PLL init unknown for device 0x4716 [ 0.000000] bcma: PMU resource config unknown for device 0x4716 [ 0.000000] bcma: PMU switch/regulators init unknown for device 0x4716 [ 0.000000] bcma: Workarounds unknown for device 0x4716 [ 0.000000] bcma: Initializing MIPS core... [ 0.000000] bcma: IRQ reconfiguration done [ 0.000000] bcma: core 0x0800, irq : 2(S)* 3 4 5 6 D I [ 0.000000] bcma: core 0x082c, irq : 2(S)* 3 4 5 6 D I [ 0.000000] bcma: found parallel flash. [ 0.000000] bcma: Early bus registered [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 04000000 @ 00000000 (usable) [ 0.000000] Initrd not found or empty - disabling initrd [ 0.000000] Zone PFN ranges: [ 0.000000] Normal 0x00000000 -> 0x00004000 [ 0.000000] Movable zone start PFN for each node [ 0.000000] early_node_map[1] active PFN ranges [ 0.000000] 0: 0x00000000 -> 0x00004000 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 [ 0.000000] Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200 [ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes) [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes. [ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes [ 0.000000] Writing ErrCtl register=00000000 [ 0.000000] Readback ErrCtl register=00000000 [ 0.000000] Memory: 61928k/65536k available (2208k kernel code, 3608k reserved, 496k data, 156k init, 0k highmem) [ 0.000000] NR_IRQS:128 [ 0.000000] Calibrating delay loop... 239.10 BogoMIPS (lpj=478208) [ 0.032000] pid_max: default: 32768 minimum: 301 [ 0.032000] Mount-cache hash table entries: 512 [ 0.032000] NET: Registered protocol family 16 [ 0.044000] bio: create slab <bio-0> at 0 [ 0.048000] Switching to clocksource MIPS [ 0.056000] NET: Registered protocol family 2 [ 0.056000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.056000] TCP established hash table entries: 2048 (order: 2, 16384 bytes) [ 0.056000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes) [ 0.056000] TCP: Hash tables configured (established 2048 bind 2048) [ 0.056000] TCP reno registered [ 0.056000] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.056000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.056000] NET: Registered protocol family 1 [ 0.060000] bcma: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x11, class 0x0) [ 0.060000] bcma: Core 2 found: GBit MAC (manuf 0x4BF, id 0x82D, rev 0x00, class 0x0) [ 0.060000] bcma: Core 4 found: USB 2.0 Host (manuf 0x4BF, id 0x819, rev 0x04, class 0x0) [ 0.060000] bcma: Core 5 found: PCIe (manuf 0x4BF, id 0x820, rev 0x0E, class 0x0) [ 0.060000] bcma: Core 6 found: DDR1/DDR2 Memory Controller (manuf 0x4BF, id 0x82E, rev 0x01, class 0x0) [ 0.060000] bcma: Core 7 found: Internal Memory (manuf 0x4BF, id 0x80E, rev 0x07, class 0x0) [ 0.060000] bcma: Core 8 found: I2S (manuf 0x4BF, id 0x834, rev 0x00, class 0x0) [ 0.060000] bcma: Initializing MIPS core... [ 0.060000] bcma: set_irq: core 0x0812, irq 3 => 3 [ 0.060000] bcma: set_irq: core 0x082d, irq 4 => 4 [ 0.060000] bcma: set_irq: core 0x0819, irq 5 => 5 [ 0.060000] bcma: IRQ reconfiguration done [ 0.060000] bcma: core 0x0800, irq : 2(S)* 3 4 5 6 D I [ 0.060000] bcma: core 0x082c, irq : 2(S)* 3 4 5 6 D I [ 0.060000] bcma: core 0x0812, irq : 2(S) 3* 4 5 6 D I [ 0.060000] bcma: core 0x082d, irq : 2(S) 3 4* 5 6 D I [ 0.060000] bcma: core 0x0819, irq : 2(S) 3 4 5* 6 D I [ 0.060000] bcma: core 0x0820, irq : 2(S) 3 4 5 6* D I [ 0.060000] bcma: core 0x082e, irq : 2(S)* 3 4 5 6 D I [ 0.060000] bcma: core 0x080e, irq : 2(S)* 3 4 5 6 D I [ 0.060000] bcma: core 0x0834, irq : 2(S)* 3 4 5 6 D I [ 0.060000] bcma: PCIEcore in host mode found ********************************************************************************** w/ patch [ 0.000000] Linux version 3.2.9 (openwrt@hintzn1linux) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #2 Fri 2 [ 0.000000] CPU revision is: 00019740 (MIPS 74Kc) [ 0.000000] bcm47xx: using bcma bus [ 0.000000] bcma: Found chip with id 0x4716, rev 0x01 and package 0x0A [ 0.000000] bcma: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x1F, class 0x0) [ 0.000000] bcma: Core 3 found: MIPS 74K (manuf 0x4A7, id 0x82C, rev 0x01, class 0x0) [ 0.000000] bcma: PLL init unknown for device 0x4716 [ 0.000000] bcma: PMU resource config unknown for device 0x4716 [ 0.000000] bcma: PMU switch/regulators init unknown for device 0x4716 [ 0.000000] bcma: Workarounds unknown for device 0x4716 [ 0.000000] bcma: Initializing MIPS core... [ 0.000000] bcma: IRQ reconfiguration done [ 0.000000] bcma: core 0x0800, irq : 2(S)* 3 4 5 6 D I [ 0.000000] bcma: core 0x082c, irq : 2(S) 3 4 5 6 D I* [ 0.000000] bcma: found parallel flash. [ 0.000000] bcma: Early bus registered [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 04000000 @ 00000000 (usable) [ 0.000000] Initrd not found or empty - disabling initrd [ 0.000000] Zone PFN ranges: [ 0.000000] Normal 0x00000000 -> 0x00004000 [ 0.000000] Movable zone start PFN for each node [ 0.000000] early_node_map[1] active PFN ranges [ 0.000000] 0: 0x00000000 -> 0x00004000 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 [ 0.000000] Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200 [ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes) [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes. [ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes [ 0.000000] Writing ErrCtl register=00000000 [ 0.000000] Readback ErrCtl register=00000000 [ 0.000000] Memory: 61928k/65536k available (2208k kernel code, 3608k reserved, 496k data, 156k init, 0k highmem) [ 0.000000] NR_IRQS:128 [ 0.000000] Calibrating delay loop... 239.10 BogoMIPS (lpj=478208) [ 0.032000] pid_max: default: 32768 minimum: 301 [ 0.032000] Mount-cache hash table entries: 512 [ 0.032000] NET: Registered protocol family 16 [ 0.044000] bio: create slab <bio-0> at 0 [ 0.048000] Switching to clocksource MIPS [ 0.056000] NET: Registered protocol family 2 [ 0.056000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.056000] TCP established hash table entries: 2048 (order: 2, 16384 bytes) [ 0.056000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes) [ 0.056000] TCP: Hash tables configured (established 2048 bind 2048) [ 0.056000] TCP reno registered [ 0.056000] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.056000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.056000] NET: Registered protocol family 1 [ 0.060000] bcma: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x11, class 0x0) [ 0.060000] bcma: Core 2 found: GBit MAC (manuf 0x4BF, id 0x82D, rev 0x00, class 0x0) [ 0.060000] bcma: Core 4 found: USB 2.0 Host (manuf 0x4BF, id 0x819, rev 0x04, class 0x0) [ 0.060000] bcma: Core 5 found: PCIe (manuf 0x4BF, id 0x820, rev 0x0E, class 0x0) [ 0.060000] bcma: Core 6 found: DDR1/DDR2 Memory Controller (manuf 0x4BF, id 0x82E, rev 0x01, class 0x0) [ 0.060000] bcma: Core 7 found: Internal Memory (manuf 0x4BF, id 0x80E, rev 0x07, class 0x0) [ 0.060000] bcma: Core 8 found: I2S (manuf 0x4BF, id 0x834, rev 0x00, class 0x0) [ 0.060000] bcma: Initializing MIPS core... [ 0.060000] bcma: set_irq: core 0x0812, irq 3 => 3 [ 0.060000] bcma: set_irq: core 0x082d, irq 4 => 4 [ 0.060000] bcma: set_irq: core 0x0819, irq 5 => 5 [ 0.060000] bcma: set_irq: core 0x0820, irq 6 => 6 [ 0.060000] bcma: IRQ reconfiguration done [ 0.060000] bcma: core 0x0800, irq : 2(S)* 3 4 5 6 D I [ 0.060000] bcma: core 0x082c, irq : 2(S) 3 4 5 6 D I* [ 0.060000] bcma: core 0x0812, irq : 2(S) 3* 4 5 6 D I [ 0.060000] bcma: core 0x082d, irq : 2(S) 3 4* 5 6 D I [ 0.060000] bcma: core 0x0819, irq : 2(S) 3 4 5* 6 D I [ 0.060000] bcma: core 0x0820, irq : 2(S) 3 4 5 6* D I [ 0.060000] bcma: core 0x082e, irq : 2(S)* 3 4 5 6 D I [ 0.060000] bcma: core 0x080e, irq : 2(S) 3 4 5 6 D I* [ 0.060000] bcma: core 0x0834, irq : 2(S)* 3 4 5 6 D I [ 0.060000] bcma: PCIEcore in host mode found _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel