summaryrefslogtreecommitdiffstats
path: root/core/flash.c
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2016-07-04 17:46:41 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-07-05 19:02:47 +1000
commit74ba83462c64d6a987ed4785aee55309daf9ffb6 (patch)
tree8576dc9f4fc8d6ca6da8adde2cd1d5eae70e24e0 /core/flash.c
parent6af4e9ec66f102e4a46ae6e44d5b8399f592453b (diff)
downloadblackbird-skiboot-74ba83462c64d6a987ed4785aee55309daf9ffb6.tar.gz
blackbird-skiboot-74ba83462c64d6a987ed4785aee55309daf9ffb6.zip
flash: Use blocklevel to do ECC reads
flash_read_corrected() assumes the passed blocklevel device is an actual flash device. However the blocklevel flash abstraction supports automatically reading ECC protected data so use that instead. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Michael Neuling <mikey@neuling.org> Reviewed-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/flash.c')
-rw-r--r--core/flash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/flash.c b/core/flash.c
index 50367070..81bb59bd 100644
--- a/core/flash.c
+++ b/core/flash.c
@@ -573,7 +573,7 @@ static int flash_load_resource(enum resource_id id, uint32_t subid,
goto out_unlock;
}
- rc = ffs_init(0, flash->size, flash->bl, &ffs, 0);
+ rc = ffs_init(0, flash->size, flash->bl, &ffs, 1);
if (rc) {
prerror("FLASH: Can't open ffs handle\n");
goto out_unlock;
@@ -623,7 +623,7 @@ static int flash_load_resource(enum resource_id id, uint32_t subid,
goto out_free_ffs;
}
- rc = flash_read_corrected(flash->bl, part_start, buf, size, ecc);
+ rc = blocklevel_read(flash->bl, part_start, buf, size);
if (rc) {
prerror("FLASH: failed to read %s partition\n", name);
goto out_free_ffs;
OpenPOWER on IntegriCloud