On 12/14/2011 05:51 AM, Tathagata Das wrote: > Hi, > Attached is the updated kernel patch to support brcm47xx BCMA NAND > flash. I have removed SSB related code from this patch and I have used > latest trunk source code to create this patch. > > Regards, > Tathagata<tathag...@alumnux.com> Hi Tathagata,
--- a/drivers/bcma/driver_mips.c 2011-12-12 10:48:59.651424561 +0530 +++ b/drivers/bcma/driver_mips.c 2011-12-12 12:41:58.806423452 +0530 @@ -186,9 +186,15 @@ case BCMA_CC_FLASHT_STSER: case BCMA_CC_FLASHT_ATSER: #ifdef CONFIG_BCMA_SFLASH +#ifdef CONFIG_BCMA_NFLASH + printk("found nand flash.\n"); + bus->drv_cc.flash_type = BCMA_NFLASH; + bcma_nflash_init(&bus->drv_cc); +#else pr_info("found serial flash.\n"); bus->drv_cc.flash_type = BCMA_SFLASH; bcma_sflash_init(&bus->drv_cc); +#endif This is not nice, with this we could only build images supporting sflash or nflash. This could finds your nflash chip? It is strage because this should just find sflash chips. Could you instaed try this and report what condition found your nflash chip: --- a/drivers/bcma/driver_mips.c +++ b/drivers/bcma/driver_mips.c @@ -182,6 +182,15 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore) { struct bcma_bus *bus = mcore->core->bus; +#ifdef CONFIG_BCMA_NFLASH + if (bus->drv_cc.capabilities & BCMA_CC_CAP_NFLASH) { + printk("found nand flash.\n"); + bus->drv_cc.flash_type = BCMA_NFLASH; + bcma_nflash_init(&bus->drv_cc); + return; + } +#endif /* CONFIG_BCMA_NFLASH */ + switch (bus->drv_cc.capabilities & BCMA_CC_CAP_FLASHT) { case BCMA_CC_FLASHT_STSER: case BCMA_CC_FLASHT_ATSER: @@ -193,6 +202,15 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore) pr_info("serial flash not supported.\n"); #endif /* CONFIG_BCMA_SFLASH */ break; + case BCMA_CC_FLASHT_NFLASH: +#ifdef CONFIG_BCMA_NFLASH + printk("found nand flash.\n"); + bus->drv_cc.flash_type = BCMA_NFLASH; + bcma_nflash_init(&bus->drv_cc); +#else + pr_info("nand flash not supported.\n"); +#endif /* CONFIG_BCMA_NFLASH */ + break; case BCMA_CC_FLASHT_PARA: pr_info("found parallel flash.\n"); bus->drv_cc.flash_type = BCMA_PFLASH; --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h @@ -24,7 +24,7 @@ #define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ #define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ #define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ -#define BCMA_CC_FLASHT_NFLASH 0x00000200 +#define BCMA_CC_FLASHT_NFLASH 0x00000300 /* NAND flash */ #define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ #define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ #define BCMA_PLLTYPE_NONE 0x00000000 @@ -44,7 +44,8 @@ #define BCMA_CC_CAP_64BIT 0x08000000 /* 64-bit Backplane */ #define BCMA_CC_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */ #define BCMA_CC_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */ -#define BCMA_CC_CAP_SPROM 0x40000000 /* SPROM present */ +#define BCMA_CC_CAP_SROM 0x40000000 /* Srom Present (rev >= 32) */ +#define BCMA_CC_CAP_NFLASH 0x80000000 /* Nand flash present (rev >= 35) */ #define BCMA_CC_CORECTL 0x0008 #define BCMA_CC_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */ #define BCMA_CC_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */ The bus abstraction in arch/mips/bcm47xx/bus.c is not needed. I made it for sflash devices to use one code for bcma and ssb based devices but sflash is just available on very recent bcma devices. Hauke _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel