diff options
author | Joel Stanley <joel@jms.id.au> | 2015-02-27 17:11:06 +0800 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-03-04 13:06:11 +1100 |
commit | f31e13f7ef822b6a41001109f6b64bf499086f35 (patch) | |
tree | ef91bea7dc4e83932187369602434c332c9d103a /core/flash.c | |
parent | 22af0b68fb2890c3d74eca06661d131bf94cce55 (diff) | |
download | blackbird-skiboot-f31e13f7ef822b6a41001109f6b64bf499086f35.tar.gz blackbird-skiboot-f31e13f7ef822b6a41001109f6b64bf499086f35.zip |
core/flash: Remove alignment and size restrictions
libflash is able to perform reads and writes across page boundaries, so
this restriction is not required.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/flash.c')
-rw-r--r-- | core/flash.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/core/flash.c b/core/flash.c index 2bb04f57..cef34d99 100644 --- a/core/flash.c +++ b/core/flash.c @@ -186,6 +186,8 @@ static struct dt_node *flash_add_dt_node(struct flash *flash, int id, static void setup_system_flash(struct flash *flash, struct dt_node *node, const char *name, struct ffs_handle *ffs) { + char *path; + if (system_flash) { prlog(PR_WARNING, "FLASH: attempted to register a second " "system flash device %s\n", name); @@ -199,7 +201,9 @@ static void setup_system_flash(struct flash *flash, struct dt_node *node, } system_flash = flash; - dt_add_property_string(dt_chosen, "ibm,system-flash", node->name); + path = dt_get_path(node); + dt_add_property_string(dt_chosen, "ibm,system-flash", path); + free(path); prlog(PR_INFO, "FLASH: registered system flash device %s\n", name); @@ -273,7 +277,6 @@ static int64_t opal_flash_op(enum flash_op op, uint64_t id, uint64_t offset, uint64_t buf, uint64_t size, uint64_t token) { struct flash *flash; - uint32_t mask; int rc; if (id >= ARRAY_SIZE(flashes)) @@ -294,12 +297,6 @@ static int64_t opal_flash_op(enum flash_op op, uint64_t id, uint64_t offset, goto err; } - mask = flash->block_size - 1; - if (size & mask || offset & mask) { - rc = OPAL_PARAMETER; - goto err; - } - switch (op) { case FLASH_OP_READ: rc = flash_read(flash->chip, offset, (void *)buf, size); |