diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-12-16 07:34:58 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-12-20 07:26:01 +0100 |
commit | 6e74b2cbacac19443c62cffa53ca5636e7ab248b (patch) | |
tree | 226aff94c58b6b28a22f2ad9b2bc98449c10af8d /src/northbridge | |
parent | 1ef67e166a7e560db4652923cdaf2d55af2f2a0e (diff) |
AGESA: Add OemCustomize hooks structure
We should potentially provide an OEM platform hook to manipulate parameters
around any entry point to AGESA. Use structure for such ops to avoid weak
functions and lots of empty function stubs.
Change-Id: I99bf7de8a1e2f183399d2216520a45d0c24fd64c
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/7824
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'src/northbridge')
-rw-r--r-- | src/northbridge/amd/agesa/agesawrapper.h | 22 | ||||
-rw-r--r-- | src/northbridge/amd/agesa/family15/agesawrapper.c | 14 |
2 files changed, 20 insertions, 16 deletions
diff --git a/src/northbridge/amd/agesa/agesawrapper.h b/src/northbridge/amd/agesa/agesawrapper.h index dfb8c740bc..8147f85546 100644 --- a/src/northbridge/amd/agesa/agesawrapper.h +++ b/src/northbridge/amd/agesa/agesawrapper.h @@ -59,7 +59,25 @@ void *agesawrapper_getlateinitptr (int pick); AGESA_STATUS agesawrapper_fchs3earlyrestore(void); AGESA_STATUS agesawrapper_fchs3laterestore(void); -void OemCustomizeInitEarly(AMD_EARLY_PARAMS *InitEarly); -void OemCustomizeInitPost(AMD_POST_PARAMS *InitPost); +struct OEM_HOOK +{ + /* romstage */ + AGESA_STATUS (*InitEarly)(AMD_EARLY_PARAMS *); + AGESA_STATUS (*InitPost)(AMD_POST_PARAMS *); +}; + +extern const struct OEM_HOOK OemCustomize; + +static inline void OemCustomizeInitEarly(AMD_EARLY_PARAMS *EarlyParams) +{ + if (OemCustomize.InitEarly) + OemCustomize.InitEarly(EarlyParams); +} + +static inline void OemCustomizeInitPost(AMD_POST_PARAMS *PostParams) +{ + if (OemCustomize.InitPost) + OemCustomize.InitPost(PostParams); +} #endif /* _AGESAWRAPPER_H_ */ diff --git a/src/northbridge/amd/agesa/family15/agesawrapper.c b/src/northbridge/amd/agesa/family15/agesawrapper.c index 9b62d3fac8..e7ce838e4b 100644 --- a/src/northbridge/amd/agesa/family15/agesawrapper.c +++ b/src/northbridge/amd/agesa/family15/agesawrapper.c @@ -35,20 +35,6 @@ #define FILECODE UNASSIGNED_FILE_FILECODE -/* TODO: Function body should be in mainboard directory. */ -void OemCustomizeInitEarly(AMD_EARLY_PARAMS *InitEarly) -{ -} - -void OemCustomizeInitPost(AMD_POST_PARAMS *InitPost) -{ -#if IS_ENABLED(CONFIG_BOARD_AMD_DINAR) - InitPost->MemConfig.UmaMode = UMA_AUTO; - InitPost->MemConfig.BottomIo = 0xE0; - InitPost->MemConfig.UmaSize = 0xE0-0xC0; -#endif -} - AGESA_STATUS agesawrapper_amdinitreset(void) { AGESA_STATUS status = AGESA_SUCCESS; |