2 * Broadcom specific AMBA
3 * ChipCommon parallel flash
5 * Licensed under the GNU/GPL. See COPYING for details.
8 #include "bcma_private.h"
10 #include <linux/bcma/bcma.h>
11 #include <linux/mtd/physmap.h>
12 #include <linux/platform_device.h>
14 static const char * const part_probes
[] = { "bcm47xxpart", NULL
};
16 static struct physmap_flash_data bcma_pflash_data
= {
17 .part_probe_types
= part_probes
,
20 static struct resource bcma_pflash_resource
= {
21 .name
= "bcma_pflash",
22 .flags
= IORESOURCE_MEM
,
25 struct platform_device bcma_pflash_dev
= {
26 .name
= "physmap-flash",
28 .platform_data
= &bcma_pflash_data
,
30 .resource
= &bcma_pflash_resource
,
34 int bcma_pflash_init(struct bcma_drv_cc
*cc
)
36 struct bcma_pflash
*pflash
= &cc
->pflash
;
38 pflash
->present
= true;
40 if (!(bcma_read32(cc
->core
, BCMA_CC_FLASH_CFG
) & BCMA_CC_FLASH_CFG_DS
))
41 bcma_pflash_data
.width
= 1;
43 bcma_pflash_data
.width
= 2;
45 bcma_pflash_resource
.start
= BCMA_SOC_FLASH2
;
46 bcma_pflash_resource
.end
= BCMA_SOC_FLASH2
+ BCMA_SOC_FLASH2_SZ
;