From 16c80346ddf9ec6baf583b610cf1449f25962d34 Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Thu, 5 Feb 2015 17:49:50 +1100 Subject: Add OPAL_INVALID_CALL explicitly in opal.h and docs Was mentioned in linux as possibly being used by some external test modules. It's harmless to make this official behaviour. Signed-off-by: Stewart Smith --- platforms/astbmc/astbmc.h | 1 - platforms/astbmc/habanero.c | 1 - platforms/astbmc/palmetto.c | 1 - platforms/astbmc/pnor.c | 56 +-------------------------------------------- 4 files changed, 1 insertion(+), 58 deletions(-) (limited to 'platforms') diff --git a/platforms/astbmc/astbmc.h b/platforms/astbmc/astbmc.h index 7e33f61..cee475a 100644 --- a/platforms/astbmc/astbmc.h +++ b/platforms/astbmc/astbmc.h @@ -24,6 +24,5 @@ extern int64_t astbmc_ipmi_power_down(uint64_t request); extern void astbmc_init(void); extern void astbmc_ext_irq(unsigned int chip_id); extern int pnor_init(void); -extern bool pnor_load_resource(enum resource_id id, void *buf, size_t *len); #endif /* __ASTBMC_H */ diff --git a/platforms/astbmc/habanero.c b/platforms/astbmc/habanero.c index a19aafd..d442d1f 100644 --- a/platforms/astbmc/habanero.c +++ b/platforms/astbmc/habanero.c @@ -49,5 +49,4 @@ DECLARE_PLATFORM(habanero) = { .external_irq = astbmc_ext_irq, .cec_power_down = astbmc_ipmi_power_down, .cec_reboot = astbmc_ipmi_reboot, - .load_resource = pnor_load_resource, }; diff --git a/platforms/astbmc/palmetto.c b/platforms/astbmc/palmetto.c index cfa7236..a0030e8 100644 --- a/platforms/astbmc/palmetto.c +++ b/platforms/astbmc/palmetto.c @@ -51,5 +51,4 @@ DECLARE_PLATFORM(palmetto) = { .cec_power_down = astbmc_ipmi_power_down, .cec_reboot = astbmc_ipmi_reboot, .elog_commit = ipmi_elog_commit, - .load_resource = pnor_load_resource, }; diff --git a/platforms/astbmc/pnor.c b/platforms/astbmc/pnor.c index 2cdb29b..f6e7a5d 100644 --- a/platforms/astbmc/pnor.c +++ b/platforms/astbmc/pnor.c @@ -14,6 +14,7 @@ * limitations under the License. */ + #include #include #include @@ -84,58 +85,3 @@ int pnor_init(void) return rc; } -static const struct { - enum resource_id id; - char name[PART_NAME_MAX+1]; -} part_name_map[] = { - { RESOURCE_ID_KERNEL, "KERNEL" }, - { RESOURCE_ID_INITRAMFS, "ROOTFS" }, -}; - -bool pnor_load_resource(enum resource_id id, void *buf, size_t *len) -{ - int i, rc, part_num, part_size, part_start; - const char *name; - - if (!pnor_ffs || !pnor_chip) - return false; - - for (i = 0, name = NULL; i < ARRAY_SIZE(part_name_map); i++) { - if (part_name_map[i].id == id) { - name = part_name_map[i].name; - break; - } - } - if (!name) { - prerror("PLAT: Couldn't find partition for id %d\n", id); - return false; - } - - rc = ffs_lookup_part(pnor_ffs, name, &part_num); - if (rc) { - prerror("PLAT: No %s partition in PNOR\n", name); - return false; - } - rc = ffs_part_info(pnor_ffs, part_num, NULL, - &part_start, &part_size, NULL); - if (rc) { - prerror("PLAT: Failed to get %s partition info\n", name); - return false; - } - - if (part_size > *len) { - prerror("PLAT: %s image too large (%d > %zd)\n", name, - part_size, *len); - return false; - } - - rc = flash_read(pnor_chip, part_start, buf, part_size); - if (rc) { - prerror("PLAT: failed to read %s partition\n", name); - return false; - } - - *len = part_size; - - return true; -} -- cgit v1.1