Commit 25bad1d3c9f5616aaa50849300248d03141574a0

Authored by Hauke Mehrtens
Committed by Artem Bityutskiy
1 parent a7bf6543e8

mtd: bcm47xxpart: add support for other erase sizes

To make the partitions writable they should aligned to erase sizes of
the flash. If the erase size is small use 0x10000.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

drivers/mtd/bcm47xxpart.c
... ... @@ -59,10 +59,13 @@
59 59 uint32_t *buf;
60 60 size_t bytes_read;
61 61 uint32_t offset;
62   - uint32_t blocksize = 0x10000;
  62 + uint32_t blocksize = master->erasesize;
63 63 struct trx_header *trx;
64 64 int trx_part = -1;
65 65 int last_trx_part = -1;
  66 +
  67 + if (blocksize <= 0x10000)
  68 + blocksize = 0x10000;
66 69  
67 70 /* Alloc */
68 71 parts = kzalloc(sizeof(struct mtd_partition) * BCM47XXPART_MAX_PARTS,