Commit 23cb3b21 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

bcma: add place for flash memory support

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 124b979b
...@@ -46,6 +46,16 @@ config BCMA_DRIVER_MIPS ...@@ -46,6 +46,16 @@ config BCMA_DRIVER_MIPS
If unsure, say N If unsure, say N
config BCMA_SFLASH
bool
depends on BCMA_DRIVER_MIPS && BROKEN
default y
config BCMA_NFLASH
bool
depends on BCMA_DRIVER_MIPS && BROKEN
default y
config BCMA_DRIVER_GMAC_CMN config BCMA_DRIVER_GMAC_CMN
bool "BCMA Broadcom GBIT MAC COMMON core driver" bool "BCMA Broadcom GBIT MAC COMMON core driver"
depends on BCMA depends on BCMA
......
bcma-y += main.o scan.o core.o sprom.o bcma-y += main.o scan.o core.o sprom.o
bcma-y += driver_chipcommon.o driver_chipcommon_pmu.o bcma-y += driver_chipcommon.o driver_chipcommon_pmu.o
bcma-$(CONFIG_BCMA_SFLASH) += driver_chipcommon_sflash.o
bcma-$(CONFIG_BCMA_NFLASH) += driver_chipcommon_nflash.o
bcma-y += driver_pci.o bcma-y += driver_pci.o
bcma-$(CONFIG_BCMA_DRIVER_PCI_HOSTMODE) += driver_pci_host.o bcma-$(CONFIG_BCMA_DRIVER_PCI_HOSTMODE) += driver_pci_host.o
bcma-$(CONFIG_BCMA_DRIVER_MIPS) += driver_mips.o bcma-$(CONFIG_BCMA_DRIVER_MIPS) += driver_mips.o
......
...@@ -51,6 +51,28 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc); ...@@ -51,6 +51,28 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc); u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc);
u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc); u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc);
#ifdef CONFIG_BCMA_SFLASH
/* driver_chipcommon_sflash.c */
int bcma_sflash_init(struct bcma_drv_cc *cc);
#else
static inline int bcma_sflash_init(struct bcma_drv_cc *cc)
{
bcma_err(cc->core->bus, "Serial flash not supported\n");
return 0;
}
#endif /* CONFIG_BCMA_SFLASH */
#ifdef CONFIG_BCMA_NFLASH
/* driver_chipcommon_nflash.c */
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");
return 0;
}
#endif /* CONFIG_BCMA_NFLASH */
#ifdef CONFIG_BCMA_HOST_PCI #ifdef CONFIG_BCMA_HOST_PCI
/* host_pci.c */ /* host_pci.c */
extern int __init bcma_host_pci_init(void); extern int __init bcma_host_pci_init(void);
......
/*
* Broadcom specific AMBA
* ChipCommon NAND flash interface
*
* Licensed under the GNU/GPL. See COPYING for details.
*/
#include <linux/bcma/bcma.h>
#include <linux/bcma/bcma_driver_chipcommon.h>
#include <linux/delay.h>
#include "bcma_private.h"
/* Initialize NAND flash access */
int bcma_nflash_init(struct bcma_drv_cc *cc)
{
bcma_err(cc->core->bus, "NAND flash support is broken\n");
return 0;
}
/*
* Broadcom specific AMBA
* ChipCommon serial flash interface
*
* Licensed under the GNU/GPL. See COPYING for details.
*/
#include <linux/bcma/bcma.h>
#include <linux/bcma/bcma_driver_chipcommon.h>
#include <linux/delay.h>
#include "bcma_private.h"
/* Initialize serial flash access */
int bcma_sflash_init(struct bcma_drv_cc *cc)
{
bcma_err(cc->core->bus, "Serial flash support is broken\n");
return 0;
}
...@@ -185,10 +185,11 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore) ...@@ -185,10 +185,11 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
switch (bus->drv_cc.capabilities & BCMA_CC_CAP_FLASHT) { switch (bus->drv_cc.capabilities & BCMA_CC_CAP_FLASHT) {
case BCMA_CC_FLASHT_STSER: case BCMA_CC_FLASHT_STSER:
case BCMA_CC_FLASHT_ATSER: case BCMA_CC_FLASHT_ATSER:
bcma_err(bus, "Serial flash not supported.\n"); bcma_debug(bus, "Found serial flash\n");
bcma_sflash_init(&bus->drv_cc);
break; break;
case BCMA_CC_FLASHT_PARA: case BCMA_CC_FLASHT_PARA:
bcma_info(bus, "found parallel flash.\n"); bcma_debug(bus, "Found parallel flash\n");
bus->drv_cc.pflash.window = 0x1c000000; bus->drv_cc.pflash.window = 0x1c000000;
bus->drv_cc.pflash.window_size = 0x02000000; bus->drv_cc.pflash.window_size = 0x02000000;
...@@ -199,7 +200,15 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore) ...@@ -199,7 +200,15 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
bus->drv_cc.pflash.buswidth = 2; bus->drv_cc.pflash.buswidth = 2;
break; break;
default: default:
bcma_err(bus, "flash not supported.\n"); bcma_err(bus, "Flash type not supported\n");
}
if (bus->drv_cc.core->id.rev == 38 ||
bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) {
if (bus->drv_cc.capabilities & BCMA_CC_CAP_NFLASH) {
bcma_debug(bus, "Found NAND flash\n");
bcma_nflash_init(&bus->drv_cc);
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment