aboutsummaryrefslogtreecommitdiff
path: root/core/flash.c
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2016-11-02 16:43:28 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-11-02 17:25:50 +1100
commit36c2f299f51e67c720a86dc5f717eb3eddb4fa42 (patch)
tree5930863964b327d7f86bf560cf5c9de257896fb1 /core/flash.c
parent635537dba33dfb78f4383d9271d52def17b31a95 (diff)
downloadskiboot-36c2f299f51e67c720a86dc5f717eb3eddb4fa42.zip
skiboot-36c2f299f51e67c720a86dc5f717eb3eddb4fa42.tar.gz
skiboot-36c2f299f51e67c720a86dc5f717eb3eddb4fa42.tar.bz2
core/flash: Use blocklevel accessors to load resources
Resource loading uses the flash calls directly which works on hardware as the blocklevel abstraction was initialised with a flash structure. On platforms such as mambo the blocklevel abstraction was initialised with the bogusdisk structure so calling the flash calls directly results in following uninitialised function pointers off into lala land. Functionality is preserved as the blocklevel is told if a flash partition is ECC protected during the call to ffs_init(). Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/flash.c')
-rw-r--r--core/flash.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/flash.c b/core/flash.c
index 5ab7fc8..55fd668 100644
--- a/core/flash.c
+++ b/core/flash.c
@@ -540,8 +540,8 @@ static int flash_load_resource(enum resource_id id, uint32_t subid,
goto out_free_ffs;
}
- rc = flash_read_corrected(flash->bl, ffs_part_start, bufp,
- SECURE_BOOT_HEADERS_SIZE, ecc);
+ rc = blocklevel_read(flash->bl, ffs_part_start, bufp,
+ SECURE_BOOT_HEADERS_SIZE);
if (rc) {
prerror("FLASH: failed to read the first 0x%x from "
"%s partition, rc %d\n", SECURE_BOOT_HEADERS_SIZE,
@@ -574,8 +574,8 @@ static int flash_load_resource(enum resource_id id, uint32_t subid,
if (ecc)
ffs_part_start += ecc_size(SECURE_BOOT_HEADERS_SIZE);
- rc = flash_read_corrected(flash->bl, ffs_part_start, bufp,
- content_size, ecc);
+ rc = blocklevel_read(flash->bl, ffs_part_start, bufp,
+ content_size);
if (rc) {
prerror("FLASH: failed to read content size %d"
" %s partition, rc %d\n",
@@ -613,8 +613,8 @@ static int flash_load_resource(enum resource_id id, uint32_t subid,
}
prlog(PR_DEBUG, "FLASH: computed %s size %u\n",
name, content_size);
- rc = flash_read_corrected(flash->bl, ffs_part_start,
- buf, content_size, ecc);
+ rc = blocklevel_read(flash->bl, ffs_part_start,
+ buf, content_size);
if (rc) {
prerror("FLASH: failed to read content size %d"
" %s partition, rc %d\n",
@@ -644,8 +644,8 @@ static int flash_load_resource(enum resource_id id, uint32_t subid,
* Afterwards, we memmove() things back into place for
* the caller.
*/
- rc = flash_read_corrected(flash->bl, ffs_part_start,
- buf, ffs_part_size, ecc);
+ rc = blocklevel_read(flash->bl, ffs_part_start,
+ buf, ffs_part_size);
bufp += offset;
}