mb/google/nissa/var/rull: add ssd timing and modify ssd GPIO pins of rtd3
[coreboot2.git] / src / northbridge / amd / agesa / state_machine.h
blob6c77d21cf20f308da9c25aa6018996242edb8e68
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef _STATE_MACHINE_H_
4 #define _STATE_MACHINE_H_
6 #include <stdint.h>
7 #include <AGESA.h>
8 #include <AMD.h>
10 /* eventlog */
11 void agesawrapper_trace(AGESA_STATUS ret, AMD_CONFIG_PARAMS *StdHeader, const char *func);
12 AGESA_STATUS agesawrapper_amdreadeventlog(UINT8 HeapStatus);
14 /* For suspend-to-ram support. */
16 #if !CONFIG(CPU_AMD_PI)
17 /* TODO: With binaryPI we need different interface. */
18 AGESA_STATUS OemInitResume(AMD_S3_PARAMS *dataBlock);
19 AGESA_STATUS OemS3LateRestore(AMD_S3_PARAMS *dataBlock);
20 AGESA_STATUS OemS3Save(AMD_S3_PARAMS *dataBlock);
21 #endif
23 /* For FCH */
24 AGESA_STATUS fchs3earlyrestore(AMD_CONFIG_PARAMS *StdHeader);
25 AGESA_STATUS fchs3laterestore(AMD_CONFIG_PARAMS *StdHeader);
27 struct sysinfo
29 AMD_CONFIG_PARAMS StdHeader;
31 int s3resume;
34 void board_BeforeAgesa(struct sysinfo *cb);
36 void agesa_set_interface(struct sysinfo *cb);
38 struct agesa_state {
39 u8 apic_id;
41 AGESA_STRUCT_NAME func;
42 const char *function_name;
43 uint32_t ts_entry_id;
44 uint32_t ts_exit_id;
47 void agesa_state_on_entry(struct agesa_state *task, AGESA_STRUCT_NAME func);
48 void agesa_state_on_exit(struct agesa_state *task,
49 AMD_CONFIG_PARAMS *StdHeader);
50 int agesa_execute_state(struct sysinfo *cb, AGESA_STRUCT_NAME func);
52 /* AGESA dispatchers */
54 AGESA_STATUS module_dispatch(AGESA_STRUCT_NAME func, AMD_CONFIG_PARAMS *StdHeader);
56 void platform_BeforeInitReset(struct sysinfo *cb, AMD_RESET_PARAMS *Reset);
57 void board_BeforeInitReset(struct sysinfo *cb, AMD_RESET_PARAMS *Reset);
59 void platform_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *Early);
60 void board_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *Early);
62 /* Normal boot */
63 void platform_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post);
64 void board_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post);
65 void platform_AfterInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post);
67 void platform_BeforeInitEnv(struct sysinfo *cb, AMD_ENV_PARAMS *Env);
68 void board_BeforeInitEnv(struct sysinfo *cb, AMD_ENV_PARAMS *Env);
69 void platform_AfterInitEnv(struct sysinfo *cb, AMD_ENV_PARAMS *Env);
71 void platform_BeforeInitMid(struct sysinfo *cb, AMD_MID_PARAMS *Mid);
72 void board_BeforeInitMid(struct sysinfo *cb, AMD_MID_PARAMS *Mid);
74 void platform_BeforeInitLate(struct sysinfo *cb, AMD_LATE_PARAMS *Late);
75 void board_BeforeInitLate(struct sysinfo *cb, AMD_LATE_PARAMS *Late);
76 void platform_AfterInitLate(struct sysinfo *cb, AMD_LATE_PARAMS *Late);
77 void completion_InitLate(struct sysinfo *cb, AMD_LATE_PARAMS *Late);
79 /* S3 Resume */
80 void platform_BeforeInitResume(struct sysinfo *cb, AMD_RESUME_PARAMS *Resume);
81 void platform_AfterInitResume(struct sysinfo *cb, AMD_RESUME_PARAMS *Resume);
83 void platform_BeforeS3LateRestore(struct sysinfo *cb, AMD_S3LATE_PARAMS *S3Late);
84 void platform_AfterS3LateRestore(struct sysinfo *cb, AMD_S3LATE_PARAMS *S3Late);
86 void platform_AfterS3Save(struct sysinfo *cb, AMD_S3SAVE_PARAMS *S3Save);
88 /* FCH callouts, not used with CIMx. */
89 #define HAS_AGESA_FCH_OEM_CALLOUT \
90 CONFIG(SOUTHBRIDGE_AMD_PI_AVALON) || \
91 CONFIG(SOUTHBRIDGE_AMD_PI_KERN)
93 #if HAS_AGESA_FCH_OEM_CALLOUT
94 /* FIXME: Structures included here were supposed to be private to AGESA. */
95 #include <FchCommonCfg.h>
96 void agesa_fch_oem_config(uintptr_t Data, AMD_CONFIG_PARAMS *StdHeader);
97 void board_FCH_InitReset(struct sysinfo *cb, FCH_RESET_DATA_BLOCK *FchReset);
98 void board_FCH_InitEnv(struct sysinfo *cb, FCH_DATA_BLOCK *FchEnv);
99 #endif
101 #endif /* _STATE_MACHINE_H_ */