aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2015-03-04 10:22:03 +0800
committerJeremy Kerr <jk@ozlabs.org>2015-03-04 16:01:23 +0800
commitf51aeaa4fa5074f747684643bf6ebff3e0884f67 (patch)
tree32c1de7db5b57ce9781ce0ab678377a00b7dfdca /external
parentdd57098db9df493881b37811d070835b679b9a2c (diff)
downloadskiboot-f51aeaa4fa5074f747684643bf6ebff3e0884f67.zip
skiboot-f51aeaa4fa5074f747684643bf6ebff3e0884f67.tar.gz
skiboot-f51aeaa4fa5074f747684643bf6ebff3e0884f67.tar.bz2
external/opal-prd: NULL-out FSP-only callbacks
The HBRT code will check for NULL callbacks, so don't provide them in the hinterface table. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'external')
-rw-r--r--external/opal-prd/opal-prd.c30
-rw-r--r--external/opal-prd/thunk.S12
2 files changed, 9 insertions, 33 deletions
diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index 5681f19..a209e82 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -58,7 +58,6 @@ struct opal_prd_ctx {
void *code_addr;
size_t code_size;
bool debug;
- bool allow_fsp_calls;
struct pnor pnor;
char *hbrt_file_name;
};
@@ -150,23 +149,6 @@ extern int call_enable_attns(void);
extern int call_enable_occ_actuation(bool i_occActivation);
extern void call_process_occ_reset(uint64_t i_chipId);
-/* Dummy calls for hservices */
-static inline int __fsp_only_assert(const char *name)
-{
- printf("error: %s is only implemented for FSP\n", name);
- if (!ctx->allow_fsp_calls)
- exit(EXIT_FAILURE);
- return 0;
-}
-#define fsp_stub(name) \
- int hservice_ ##name(void) { return __fsp_only_assert(#name); }
-
-fsp_stub(send_error_log);
-fsp_stub(lid_load);
-fsp_stub(lid_unload);
-fsp_stub(wakeup);
-fsp_stub(report_occ_failure);
-
void hservice_puts(const char *str)
{
printf("%s\n", str);
@@ -1095,8 +1077,7 @@ out_close:
static void usage(const char *progname)
{
printf("Usage:\n");
- printf("\t%s [--debug] [--file <hbrt-image>] [--pnor <device>]\n"
- "\t\t[--allow-fsp-calls]\n",
+ printf("\t%s [--debug] [--file <hbrt-image>] [--pnor <device>]\n",
progname);
printf("\t%s occ <enable|disable>\n", progname);
printf("\n");
@@ -1104,17 +1085,13 @@ static void usage(const char *progname)
"\t--debug verbose logging for debug information\n"
"\t--pnor DEVICE use PNOR MTD device\n"
"\t--file FILE use FILE for hostboot runtime code (instead of code\n"
-"\t exported by firmware)\n"
-"\t--allow-fsp-calls don't exit on FSP-only callbacks from HBRT code, but\n"
-"\t return success instead. Intended for workarounds\n"
-"\t during PRD testing only.\n");
+"\t exported by firmware)\n");
}
static struct option opal_diag_options[] = {
{"file", required_argument, NULL, 'f'},
{"pnor", required_argument, NULL, 'p'},
{"debug", no_argument, NULL, 'd'},
- {"allow-fsp-calls", no_argument, NULL, 'a'},
{"help", no_argument, NULL, 'h'},
{ 0 },
};
@@ -1167,9 +1144,6 @@ int main(int argc, char *argv[])
case 'p':
ctx->pnor.path = strndup(optarg, PATH_MAX);
break;
- case 'a':
- ctx->allow_fsp_calls = true;
- break;
case 'h':
usage(argv[0]);
return EXIT_SUCCESS;
diff --git a/external/opal-prd/thunk.S b/external/opal-prd/thunk.S
index 064138c..9d97183 100644
--- a/external/opal-prd/thunk.S
+++ b/external/opal-prd/thunk.S
@@ -139,6 +139,8 @@ name##_thunk: ;\
.llong name
#endif
+#define DISABLED_THUNK(name) .llong 0x0
+
/* Here's the callback table generation. It creates the table and
* all the thunks for all the callbacks from HBRT to us
*/
@@ -155,15 +157,15 @@ hinterface:
CALLBACK_THUNK(hservice_malloc)
CALLBACK_THUNK(hservice_free)
CALLBACK_THUNK(hservice_realloc)
- CALLBACK_THUNK(hservice_send_error_log)
+ DISABLED_THUNK(hservice_send_error_log)
CALLBACK_THUNK(hservice_scom_read)
CALLBACK_THUNK(hservice_scom_write)
- CALLBACK_THUNK(hservice_lid_load)
- CALLBACK_THUNK(hservice_lid_unload)
+ DISABLED_THUNK(hservice_lid_load)
+ DISABLED_THUNK(hservice_lid_unload)
CALLBACK_THUNK(hservice_get_reserved_mem)
- CALLBACK_THUNK(hservice_wakeup)
+ DISABLED_THUNK(hservice_wakeup)
CALLBACK_THUNK(hservice_nanosleep)
- CALLBACK_THUNK(hservice_report_occ_failure)
+ DISABLED_THUNK(hservice_report_occ_failure)
CALLBACK_THUNK(hservice_clock_gettime)
CALLBACK_THUNK(hservice_pnor_read)
CALLBACK_THUNK(hservice_pnor_write)