Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
/*
|
|
* Broadcom specific AMBA
|
|
* ChipCommon parallel flash
|
|
*
|
|
* Licensed under the GNU/GPL. See COPYING for details.
|
|
*/
|
|
|
|
#include "bcma_private.h"
|
|
|
|
#include <linux/bcma/bcma.h>
|
|
#include <linux/mtd/physmap.h>
|
|
#include <linux/platform_device.h>
|
|
|
|
static const char * const part_probes[] = { "bcm47xxpart", NULL };
|
|
|
|
static struct physmap_flash_data bcma_pflash_data = {
|
|
.part_probe_types = part_probes,
|
|
};
|
|
|
|
static struct resource bcma_pflash_resource = {
|
|
.name = "bcma_pflash",
|
|
.flags = IORESOURCE_MEM,
|
|
};
|
|
|
|
struct platform_device bcma_pflash_dev = {
|
|
.name = "physmap-flash",
|
|
.dev = {
|
|
.platform_data = &bcma_pflash_data,
|
|
},
|
|
.resource = &bcma_pflash_resource,
|
|
.num_resources = 1,
|
|
};
|
|
|
|
int bcma_pflash_init(struct bcma_drv_cc *cc)
|
|
{
|
|
struct bcma_pflash *pflash = &cc->pflash;
|
|
|
|
pflash->present = true;
|
|
|
|
if (!(bcma_read32(cc->core, BCMA_CC_FLASH_CFG) & BCMA_CC_FLASH_CFG_DS))
|
|
bcma_pflash_data.width = 1;
|
|
else
|
|
bcma_pflash_data.width = 2;
|
|
|
|
bcma_pflash_resource.start = BCMA_SOC_FLASH2;
|
|
bcma_pflash_resource.end = BCMA_SOC_FLASH2 + BCMA_SOC_FLASH2_SZ;
|
|
|
|
return 0;
|
|
}
|