1 From 597715c61ae75a05ab3310a34ff3857a006f0f63 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Thu, 20 Nov 2014 21:32:42 +0100
4 Subject: [PATCH] bcma: add table of serial flashes with smaller blocks
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 drivers/bcma/driver_chipcommon_sflash.c | 29 +++++++++++++++++++++++++++++
12 1 file changed, 29 insertions(+)
14 --- a/drivers/bcma/driver_chipcommon_sflash.c
15 +++ b/drivers/bcma/driver_chipcommon_sflash.c
18 #include <linux/platform_device.h>
19 #include <linux/bcma/bcma.h>
20 +#include <bcm47xx_board.h>
22 static struct resource bcma_sflash_resource = {
23 .name = "bcma_sflash",
24 @@ -42,6 +43,13 @@ static const struct bcma_sflash_tbl_e bc
28 +/* Some devices use smaller blocks (and have more of them) */
29 +static const struct bcma_sflash_tbl_e bcma_sflash_st_shrink_tbl[] = {
30 + { "M25P16", 0x14, 0x1000, 512, },
31 + { "M25P32", 0x15, 0x1000, 1024, },
35 static const struct bcma_sflash_tbl_e bcma_sflash_sst_tbl[] = {
36 { "SST25WF512", 1, 0x1000, 16, },
37 { "SST25VF512", 0x48, 0x1000, 16, },
38 @@ -85,6 +93,24 @@ static void bcma_sflash_cmd(struct bcma_
39 bcma_err(cc->core->bus, "SFLASH control command failed (timeout)!\n");
42 +const struct bcma_sflash_tbl_e *bcma_sflash_shrink_flash(u32 id)
44 + enum bcm47xx_board board = bcm47xx_board_get();
45 + const struct bcma_sflash_tbl_e *e;
48 + case BCM47XX_BOARD_NETGEAR_WGR614_V10:
49 + case BCM47XX_BOARD_NETGEAR_WNR1000_V3:
50 + for (e = bcma_sflash_st_shrink_tbl; e->name; e++) {
60 /* Initialize serial flash access */
61 int bcma_sflash_init(struct bcma_drv_cc *cc)
63 @@ -115,6 +141,10 @@ int bcma_sflash_init(struct bcma_drv_cc
67 + e = bcma_sflash_shrink_flash(id);
71 for (e = bcma_sflash_st_tbl; e->name; e++) {