bcma: add basic NAND flash driver
Rafał Miłecki
maintainerPATCH 1/1 bcma: add basic NAND flash driver
This is basic driver for NAND flash memory that allows reading it's content. It was succesfully tested on Netgear WNDR4500 which is BCM4706 based router.
This driver has been written using specs at:
http://bcm-v4.sipsolutions.net/NAND_Flash
---
John: I think I've heard somewhere that new drivers can go into currently developed release, skipping -next. Not sure if this is correct [at all/still]. Please grab this patch to the tree you find the best for it.
I've tested this patch by reading SQUASHFS header MAGIC from NAND flash with the following code:
u8 tmpbuf[512];
int ret = bcma_nflash_read(cc, 0x141400, 512, tmpbuf); if (ret != 512)
pr_err("[ERR] NFLASH read failed. Function returned: %d\n", ret);
for (i = 0x120; i < 0x124; i++)
pr_info("tmpbuf[%02d]: 0x%X\n", i, tmpbuf[i]);(yeah, I had to figure out 0x141400 offset first).
--- drivers/bcma/Kconfig | 4 +- drivers/bcma/bcma_private.h | 2 +- drivers/bcma/driver_chipcommon_nflash.c | 377 ++++++++++++++++++++++++++- drivers/bcma/driver_chipcommon_pmu.c | 2 +- include/linux/bcma/bcma_driver_chipcommon.h | 88 +++++++ 5 files changed, 466 insertions(+), 7 deletions(-)
drivers/bcma/Kconfig +2 -2
@@ -53,8 +53,8 @@ config BCMA_SFLASH default y config BCMA_NFLASH - bool - depends on BCMA_DRIVER_MIPS && BROKEN + bool "Support for NAND flash" + depends on BCMA_DRIVER_MIPS default y config BCMA_DRIVER_GMAC_CMN
drivers/bcma/bcma_private.h +1 -1
@@ -68,7 +68,7 @@ int bcma_nflash_init(struct bcma_drv_cc *cc);#else static inline int bcma_nflash_init (struct bcma_drv_cc *cc) { -bcma_err (cc->core->bus,"NAND flash not supported\n" ); +bcma_err (cc->core->bus,"NAND flash support not enabled\n" );return 0 ; }#endif /* CONFIG_BCMA_NFLASH */
drivers/bcma/driver_chipcommon_nflash.c +374 -3
383 lines not on this page · raw message
drivers/bcma/driver_chipcommon_pmu.c +1 -1
@@ -13,7 +13,7 @@#include <linux/export.h> #include <linux/bcma/bcma.h> -static u32 bcma_chipco_pll_read (struct bcma_drv_cc *cc,u32 offset) +u32 bcma_chipco_pll_read (struct bcma_drv_cc *cc,u32 offset) {bcma_cc_write32 (cc,BCMA_CC_PLLCTL_ADDR , offset);bcma_cc_read32 (cc,BCMA_CC_PLLCTL_ADDR );
include/linux/bcma/bcma_driver_chipcommon.h +88 -0
126 lines not on this page · raw message
Signature · 1 line
1.7.7