Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2016 Kyösti Mälkki |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | #include "Porting.h" |
| 17 | #include "AGESA.h" |
| 18 | |
| 19 | #include <cbmem.h> |
| 20 | #include <northbridge/amd/agesa/state_machine.h> |
| 21 | #include <northbridge/amd/agesa/agesa_helper.h> |
| 22 | |
| 23 | #include <sb_cimx.h> |
| 24 | |
| 25 | void platform_BeforeInitReset(struct sysinfo *cb, AMD_RESET_PARAMS *Reset) |
| 26 | { |
| 27 | } |
| 28 | |
| 29 | void platform_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *Early) |
| 30 | { |
| 31 | } |
| 32 | |
| 33 | void platform_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post) |
| 34 | { |
| 35 | } |
| 36 | |
| 37 | void platform_AfterInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post) |
| 38 | { |
| 39 | backup_top_of_low_cacheable(Post->MemConfig.Sub4GCacheTop); |
| 40 | } |
| 41 | |
| 42 | void platform_BeforeInitResume(struct sysinfo *cb, AMD_RESUME_PARAMS *Resume) |
| 43 | { |
| 44 | OemInitResume(&Resume->S3DataBlock); |
| 45 | } |
| 46 | |
| 47 | void platform_AfterInitResume(struct sysinfo *cb, AMD_RESUME_PARAMS *Resume) |
| 48 | { |
| 49 | } |
| 50 | |
| 51 | void platform_BeforeInitEnv(struct sysinfo *cb, AMD_ENV_PARAMS *Env) |
| 52 | { |
| 53 | EmptyHeap(); |
| 54 | } |
| 55 | |
| 56 | void platform_AfterInitEnv(struct sysinfo *cb, AMD_ENV_PARAMS *Env) |
| 57 | { |
| 58 | amd_initenv(); |
| 59 | #if 0 |
| 60 | /* FIXME: It's only in ramstage. */ |
| 61 | sb_Before_Pci_Init(); |
| 62 | #endif |
| 63 | } |
| 64 | |
| 65 | void platform_BeforeS3LateRestore(struct sysinfo *cb, AMD_S3LATE_PARAMS *S3Late) |
| 66 | { |
| 67 | OemS3LateRestore(&S3Late->S3DataBlock); |
| 68 | } |
| 69 | |
| 70 | void platform_AfterS3LateRestore(struct sysinfo *cb, AMD_S3LATE_PARAMS *S3Late) |
| 71 | { |
| 72 | #if 0 |
| 73 | /* FIXME: It's only in ramstage. */ |
| 74 | sb_Before_Pci_Restore_Init(); |
| 75 | #endif |
| 76 | } |
| 77 | |
| 78 | void platform_BeforeInitMid(struct sysinfo *cb, AMD_MID_PARAMS *Mid) |
| 79 | { |
| 80 | sb_After_Pci_Init(); |
| 81 | sb_Mid_Post_Init(); |
| 82 | |
| 83 | amd_initcpuio(); |
| 84 | } |
| 85 | |
| 86 | void platform_AfterInitLate(struct sysinfo *cb, AMD_LATE_PARAMS *Late) |
| 87 | { |
| 88 | sb_Late_Post(); |
| 89 | } |
| 90 | |
| 91 | void platform_AfterS3Save(struct sysinfo *cb, AMD_S3SAVE_PARAMS *S3Save) |
| 92 | { |
| 93 | OemS3Save(&S3Save->S3DataBlock); |
| 94 | } |