Angel Pons | 4b42983 | 2020-04-02 23:48:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 2 | |
Kyösti Mälkki | 2446c1e | 2020-07-09 07:13:37 +0300 | [diff] [blame] | 3 | #include <amdblocks/biosram.h> |
| 4 | |
Elyes HAOUAS | 19f5ba8 | 2018-10-14 14:52:06 +0200 | [diff] [blame] | 5 | #include <Porting.h> |
| 6 | #include <AGESA.h> |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 7 | #include <northbridge/amd/agesa/state_machine.h> |
| 8 | #include <northbridge/amd/agesa/agesa_helper.h> |
| 9 | |
| 10 | void platform_BeforeInitReset(struct sysinfo *cb, AMD_RESET_PARAMS *Reset) |
| 11 | { |
| 12 | } |
| 13 | |
| 14 | void platform_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *Early) |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | void platform_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post) |
| 19 | { |
Mike Banon | e7f176c | 2020-01-19 21:42:09 +0300 | [diff] [blame] | 20 | Post->MemConfig.BottomIo = (UINT16)(MIN(0xE0000000, |
| 21 | MAX(0x28000000, CONFIG_BOTTOMIO_POSITION)) >> 24) & 0xF8; |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | void platform_AfterInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post) |
| 25 | { |
| 26 | backup_top_of_low_cacheable(Post->MemConfig.Sub4GCacheTop); |
| 27 | } |
| 28 | |
| 29 | void platform_BeforeInitResume(struct sysinfo *cb, AMD_RESUME_PARAMS *Resume) |
| 30 | { |
| 31 | OemInitResume(&Resume->S3DataBlock); |
| 32 | } |
| 33 | |
| 34 | void platform_AfterInitResume(struct sysinfo *cb, AMD_RESUME_PARAMS *Resume) |
| 35 | { |
| 36 | } |
| 37 | |
| 38 | void platform_BeforeInitEnv(struct sysinfo *cb, AMD_ENV_PARAMS *Env) |
| 39 | { |
| 40 | EmptyHeap(); |
| 41 | } |
| 42 | |
| 43 | void platform_AfterInitEnv(struct sysinfo *cb, AMD_ENV_PARAMS *Env) |
| 44 | { |
| 45 | } |
| 46 | |
| 47 | void platform_BeforeS3LateRestore(struct sysinfo *cb, AMD_S3LATE_PARAMS *S3Late) |
| 48 | { |
| 49 | OemS3LateRestore(&S3Late->S3DataBlock); |
| 50 | } |
| 51 | |
| 52 | void platform_AfterS3LateRestore(struct sysinfo *cb, AMD_S3LATE_PARAMS *S3Late) |
| 53 | { |
| 54 | amd_initcpuio(); |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | void platform_BeforeInitMid(struct sysinfo *cb, AMD_MID_PARAMS *Mid) |
| 58 | { |
| 59 | amd_initcpuio(); |
| 60 | } |
| 61 | |
Michał Żygowski | 506b9c1 | 2019-12-20 16:57:13 +0100 | [diff] [blame] | 62 | void platform_BeforeInitLate(struct sysinfo *cb, AMD_LATE_PARAMS *Late) |
| 63 | { |
| 64 | } |
| 65 | |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 66 | void platform_AfterInitLate(struct sysinfo *cb, AMD_LATE_PARAMS *Late) |
| 67 | { |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | void platform_AfterS3Save(struct sysinfo *cb, AMD_S3SAVE_PARAMS *S3Save) |
| 71 | { |
| 72 | OemS3Save(&S3Save->S3DataBlock); |
| 73 | } |