summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/common/agesawrapper.c22
-rw-r--r--src/soc/amd/common/agesawrapper.h3
2 files changed, 25 insertions, 0 deletions
diff --git a/src/soc/amd/common/agesawrapper.c b/src/soc/amd/common/agesawrapper.c
index b9391836ce..ec76b4d35c 100644
--- a/src/soc/amd/common/agesawrapper.c
+++ b/src/soc/amd/common/agesawrapper.c
@@ -14,6 +14,7 @@
*/
#include "agesawrapper.h"
+#include <arch/early_variables.h>
#include <cbfs.h>
#include <cbmem.h>
#include <delay.h>
@@ -378,3 +379,24 @@ const void *agesawrapper_locate_module (const CHAR8 name[8])
return module;
}
+
+static MODULE_ENTRY agesa_dispatcher CAR_GLOBAL;
+
+MODULE_ENTRY agesa_get_dispatcher(void)
+{
+ const AMD_MODULE_HEADER *module;
+ static const CHAR8 id[8] = AGESA_ID;
+ MODULE_ENTRY val = car_get_var(agesa_dispatcher);
+
+ if (val != NULL)
+ return val;
+
+ module = agesawrapper_locate_module(id);
+ if (!module)
+ return NULL;
+
+ val = module->ModuleDispatcher;
+ car_set_var(agesa_dispatcher, val);
+
+ return val;
+}
diff --git a/src/soc/amd/common/agesawrapper.h b/src/soc/amd/common/agesawrapper.h
index 6ddc658981..08ac5968ca 100644
--- a/src/soc/amd/common/agesawrapper.h
+++ b/src/soc/amd/common/agesawrapper.h
@@ -31,6 +31,9 @@ enum {
PICK_CRAT,
};
+/* Return current dispatcher or NULL on error. */
+MODULE_ENTRY agesa_get_dispatcher(void);
+
AGESA_STATUS agesawrapper_amdinitreset(void);
AGESA_STATUS agesawrapper_amdinitearly(void);
AGESA_STATUS agesawrapper_amdinitenv(void);