[Skiboot] [PATCH 6/6] flash: Use blocklevel to do ECC reads

Cyril Bur cyril.bur at au1.ibm.com
Tue Jul 26 13:49:35 AEST 2016


From: Alistair Popple <alistair at popple.id.au>

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 at popple.id.au>
[Cyril added true to last param to ffs_init() in flash_register()]
[Cyril rebased onto 46c006f core/console: use char literals instead of
numeric]
Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
This is v2 of the patch initially merged as 74ba834 (flash: Use
blocklevel to do ECC reads) and subsequently reverted.

 core/flash.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/flash.c b/core/flash.c
index c0fba88..05daeb9 100644
--- a/core/flash.c
+++ b/core/flash.c
@@ -289,7 +289,7 @@ int flash_register(struct blocklevel_device *bl, bool is_system_flash)
 
 	list_add(&flashes, &flash->list);
 
-	rc = ffs_init(0, flash->size, bl, &ffs, 0);
+	rc = ffs_init(0, flash->size, bl, &ffs, 1);
 	if (rc) {
 		/**
 		 * @fwts-label NoFFS
@@ -575,7 +575,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;
@@ -625,7 +625,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;
-- 
2.9.0



More information about the Skiboot mailing list