On 12/11/2012 05:48 AM, Nathan Hintz wrote:
> Adjust the IRQ Flag value from 8 to 7 for I2S Core for BCM4716 and
> BCM4748 (per the Broadcom SDK). IRQ Flag values greater than 7 are
> ignored when setting the IRQ Mask.
>
> Signed-off-by: Nathan Hintz <[email protected]>
>
> --- /dev/null
> +++
> target/linux/brcm47xx/patches-3.6/237-bcma-bcm4716-bcm4748-i2s-irqflag.patch
> @@ -0,0 +1,57 @@
> +--- a/include/linux/bcma/bcma_driver_mips.h
> ++++ b/include/linux/bcma/bcma_driver_mips.h
> +@@ -28,6 +28,7 @@
> + #define BCMA_MIPS_MIPS74K_GPIOEN 0x0048
> + #define BCMA_MIPS_MIPS74K_CLKCTLST 0x01E0
> +
> ++#define BCMA_MIPS_OOBSELINA74 0x004
> + #define BCMA_MIPS_OOBSELOUTA30 0x100
> +
> + struct bcma_device;
> +--- a/drivers/bcma/driver_mips.c
> ++++ b/drivers/bcma/driver_mips.c
> +@@ -79,7 +79,7 @@ static u32 bcma_core_mips_irqflag(struct
> + return dev->core_index;
> + flag = bcma_aread32(dev, BCMA_MIPS_OOBSELOUTA30);
> +
> +- if (flag)
> ++ if (flag && (flag & IRQ_FLAG_MASK) <= 7)
Handling something > 6 as invalid makes scene, but I think just adding a
pr_err() in that case is enough.
> + return flag & IRQ_FLAG_MASK;
> + else
> + return INVALID_IRQ_FLAG;
> +@@ -262,6 +262,26 @@ static void bcma_core_mips_flash_detect(
> + mcore->early_setup_done = true;
> + }
> +
> ++static void bcma_fix_i2s_irqflag(struct bcma_bus *bus)
> ++{
> ++ struct bcma_device *cpu, *pcie, *i2s;
> ++
> ++ /* IRQ flags >= 8 are not honored in the IRQ masks (2010 Broadcom SDK)
> */
> ++ if (bus->chipinfo.id != 0x4716 && bus->chipinfo.id != 0x4748)
There are constants for 0x4716 and 0x4748 in include/linux/bcma/bcma.h
> ++ return;
> ++
> ++ if ((cpu = bcma_find_core(bus, BCMA_CORE_MIPS_74K)) &&
> ++ (pcie = bcma_find_core(bus, BCMA_CORE_PCIE)) &&
> ++ (i2s = bcma_find_core(bus, BCMA_CORE_I2S)))
Do not do assignments in the if condition.
> ++ if (bcma_aread32(cpu, BCMA_MIPS_OOBSELINA74) == 0x08060504 &&
> ++ bcma_aread32(pcie, BCMA_MIPS_OOBSELINA74) == 0x08060504 &&
> ++ bcma_aread32(i2s, BCMA_MIPS_OOBSELOUTA30) == 0x88) {
> ++ bcma_awrite32(cpu, BCMA_MIPS_OOBSELINA74, 0x07060504);
> ++ bcma_awrite32(pcie, BCMA_MIPS_OOBSELINA74, 0x07060504);
> ++ bcma_awrite32(i2s, BCMA_MIPS_OOBSELOUTA30, 0x87);
> ++ }
> ++}
> ++
> + void bcma_core_mips_init(struct bcma_drv_mips *mcore)
> + {
> + struct bcma_bus *bus;
> +@@ -275,6 +295,8 @@ void bcma_core_mips_init(struct bcma_drv
> +
> + bcma_core_mips_early_init(mcore);
> +
> ++ bcma_fix_i2s_irqflag(bus);
> ++
> + mcore->assigned_irqs = 1;
> +
> + /* Assign IRQs to all cores on the bus */
>
> _______________________________________________
> openwrt-devel mailing list
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel