elog: Support logging S0ix sleep/wake info in elog
1. Add support for new GSMI commands to log S0ix entry/exit information in elog. 2. In case of resume, provide callbacks to allow platform and mainboard to log any wake source information. BUG=b:67874513 Change-Id: I593e8a9e31cad720ac1f77aab447a0dbdbe9a28b Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/22079 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
		
				
					committed by
					
						 Furquan Shaikh
						Furquan Shaikh
					
				
			
			
				
	
			
			
			
						parent
						
							f36ed21c57
						
					
				
				
					commit
					2dc5eadccc
				
			| @@ -25,6 +25,8 @@ | ||||
|  | ||||
| #define GSMI_CMD_SET_EVENT_LOG		0x08 | ||||
| #define GSMI_CMD_CLEAR_EVENT_LOG	0x09 | ||||
| #define GSMI_CMD_LOG_S0IX_SUSPEND	0x0a | ||||
| #define GSMI_CMD_LOG_S0IX_RESUME	0x0b | ||||
| #define GSMI_CMD_HANDSHAKE_TYPE		0xc1 | ||||
|  | ||||
| #define GSMI_HANDSHAKE_NONE		0x7f | ||||
| @@ -46,6 +48,16 @@ struct gsmi_clear_eventlog_param { | ||||
| 	u32 data_type; | ||||
| } __packed; | ||||
|  | ||||
| void __attribute__((weak)) elog_gsmi_cb_platform_log_wake_source(void) | ||||
| { | ||||
| 	/* Default weak implementation, does nothing. */ | ||||
| } | ||||
|  | ||||
| void __attribute__((weak)) elog_gsmi_cb_mainboard_log_wake_source(void) | ||||
| { | ||||
| 	/* Default weak implementation, does nothing. */ | ||||
| } | ||||
|  | ||||
| /* Param is usually EBX, ret in EAX */ | ||||
| u32 gsmi_exec(u8 command, u32 *param) | ||||
| { | ||||
| @@ -105,6 +117,19 @@ u32 gsmi_exec(u8 command, u32 *param) | ||||
| 			ret = GSMI_RET_SUCCESS; | ||||
| 		break; | ||||
|  | ||||
| 	case GSMI_CMD_LOG_S0IX_SUSPEND: | ||||
| 	case GSMI_CMD_LOG_S0IX_RESUME: | ||||
| 		ret = GSMI_RET_SUCCESS; | ||||
|  | ||||
| 		if (command == GSMI_CMD_LOG_S0IX_SUSPEND) | ||||
| 			elog_add_event(ELOG_TYPE_S0IX_ENTER); | ||||
| 		else { | ||||
| 			elog_add_event(ELOG_TYPE_S0IX_EXIT); | ||||
| 			elog_gsmi_cb_platform_log_wake_source(); | ||||
| 			elog_gsmi_cb_mainboard_log_wake_source(); | ||||
| 		} | ||||
| 		break; | ||||
|  | ||||
| 	default: | ||||
| 		printk(BIOS_DEBUG, "GSMI Unknown: 0x%02x\n", command); | ||||
| 		break; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user