Path: blob/master/drivers/bcma/driver_chipcommon_pflash.c
26278 views
/*1* Broadcom specific AMBA2* ChipCommon parallel flash3*4* Licensed under the GNU/GPL. See COPYING for details.5*/67#include "bcma_private.h"89#include <linux/bcma/bcma.h>10#include <linux/mtd/physmap.h>11#include <linux/platform_device.h>1213static const char * const part_probes[] = { "bcm47xxpart", NULL };1415static struct physmap_flash_data bcma_pflash_data = {16.part_probe_types = part_probes,17};1819static struct resource bcma_pflash_resource = {20.name = "bcma_pflash",21.flags = IORESOURCE_MEM,22};2324struct platform_device bcma_pflash_dev = {25.name = "physmap-flash",26.dev = {27.platform_data = &bcma_pflash_data,28},29.resource = &bcma_pflash_resource,30.num_resources = 1,31};3233int bcma_pflash_init(struct bcma_drv_cc *cc)34{35struct bcma_pflash *pflash = &cc->pflash;3637pflash->present = true;3839if (!(bcma_read32(cc->core, BCMA_CC_FLASH_CFG) & BCMA_CC_FLASH_CFG_DS))40bcma_pflash_data.width = 1;41else42bcma_pflash_data.width = 2;4344bcma_pflash_resource.start = BCMA_SOC_FLASH2;45bcma_pflash_resource.end = BCMA_SOC_FLASH2 + BCMA_SOC_FLASH2_SZ;4647return 0;48}495051