112 lines
5.6 KiB
C
112 lines
5.6 KiB
C
/*
|
|
* Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#ifndef __MAILBOX_CMD_H__
|
|
#define __MAILBOX_CMD_H__
|
|
|
|
/*only support max num cmd*/
|
|
#define MAX_ENTRY_NUM 128
|
|
/*Define Message Type Here*/
|
|
/*******************************************************************************
|
|
* Message composition
|
|
******************************************************************************/
|
|
|
|
/* ...Message composition with module(6bits), function(10bits) */
|
|
#define __MBX_COMPOSE_MSG(mod, func) (((mod) << 10) | ((func)&0x3FF))
|
|
|
|
/* ...accessors */
|
|
#define MBX_MSG_MOD(msgcode) (((msgcode) & 0x3F) >> 10)
|
|
#define MBX_MSG_FUNC(msgcode) ((msgcode) & (0x3FF))
|
|
|
|
/*******************************************************************************
|
|
* Define module type here, 6bits valid
|
|
******************************************************************************/
|
|
#define MBX_SYSTEM 0x0
|
|
|
|
/*******************************************************************************
|
|
* Define function here, 10bits valid
|
|
******************************************************************************/
|
|
/*SYSTEM*/
|
|
#define CMD_UNDEFINE 0x0
|
|
#define CMD_SUSPEND 0x4
|
|
#define CMD_RPCUINTREE_TEST 0x6
|
|
#define CMD_RPCUINTTEE_TEST 0x7
|
|
#define CMD_SYSTEM_POWER_STATE 0x8
|
|
#define CMD_CPU_FSM_IDLE 0x9
|
|
#define CMD_SET_RTC 0x11
|
|
#define CMD_GET_RTC 0x12
|
|
#define CMD_GET_WAKEUP_REASON 0x30
|
|
#define CMD_CLR_WAKEUP_REASON 0x31
|
|
#define CMD_SET_ETHERNET_WOL 0x35
|
|
#define CMD_RTC_ENABLE_ALARM 0x3d
|
|
#define CMD_GET_STICK_REBOOT_FLAG 0x40
|
|
#define CMD_WATCHKEY_CTRL 0x52
|
|
#define CMD_VAD_AWE_WAKEUP 0x62
|
|
#define CMD_SUSPEND_WITH_DSP 0x66
|
|
#define CMD_GET_FD650_INFO 0x68
|
|
#define CMD_GET_SPINLOCK 0x69
|
|
#define CMD_SET_BL30_PRINT 0x6A
|
|
#define CMD_SAVE_BL30_VERSION 0x6B
|
|
#define CMD_TRIGGER_AO2AP_SEND 0x6C
|
|
#define CMD_SEND_AO2AP_TEST 0x6D
|
|
#define CMD_REFRESH_BL30_LOG 0x73
|
|
#define CMD_ARM_ALIVE_CHECK 0X75
|
|
#define CMD_SEND_AO2AP_CLOCK_SYNC 0x76
|
|
#define CMD_GET_CLOCK_SYNC_PARAM 0x77
|
|
#define CMD_GET_CEC_INFO1 0xB4
|
|
#define CMD_GET_CEC_INFO2 0xB5
|
|
#define CMD_SET_CEC_DATA 0xB6
|
|
#define SCPI_CMD_GET_CEC_OTP_MSG 0xBB
|
|
#define SCPI_CMD_GET_CEC_AS_MSG 0xBC
|
|
#define CMD_SET_KEYPAD 0xF6
|
|
#define CMD_GET_LED_INFO 0xF7
|
|
#define CMD_GET_IR_INFO 0xF8
|
|
#define CMD_PM_FREEZE 0xF9
|
|
#define CMD_SPI_DEV 0xFA
|
|
#define CMD_SPI_XFER 0xFB
|
|
#define CMD_SET_MID 0xFC
|
|
|
|
/*******************************************************************************
|
|
* Mssage Composition
|
|
******************************************************************************/
|
|
#define MBX_CMD_RPCUINTREE_TEST __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_RPCUINTREE_TEST)
|
|
#define MBX_CMD_RPCUINTTEE_TEST __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_RPCUINTTEE_TEST)
|
|
#define MBX_CMD_SUSPEND __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SUSPEND)
|
|
#define MBX_CMD_SET_RTC __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SET_RTC)
|
|
#define MBX_CMD_GET_RTC __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_GET_RTC)
|
|
#define MBX_CMD_RTC_ENABLE_ALARM __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_RTC_ENABLE_ALARM)
|
|
#define MBX_CMD_GET_CEC_INFO1 __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_GET_CEC_INFO1)
|
|
#define MBX_CMD_GET_CEC_INFO2 __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_GET_CEC_INFO2)
|
|
#define MBX_CMD_SET_CEC_DATA __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SET_CEC_DATA)
|
|
#define MBX_CMD_GET_WAKEUP_OTP_MSG __MBX_COMPOSE_MSG(MBX_SYSTEM, SCPI_CMD_GET_CEC_OTP_MSG)
|
|
#define MBX_CMD_CLR_WAKEUP_AS_MSG __MBX_COMPOSE_MSG(MBX_SYSTEM, SCPI_CMD_GET_CEC_AS_MSG)
|
|
#define MBX_CMD_GET_WAKEUP_REASON __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_GET_WAKEUP_REASON)
|
|
#define MBX_CMD_CLR_WAKEUP_REASON __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_CLR_WAKEUP_REASON)
|
|
#define MBX_CMD_CPU_FSM_IDLE __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_CPU_FSM_IDLE)
|
|
#define MBX_CMD_GET_LED_INFO __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_GET_LED_INFO)
|
|
#define MBX_CMD_VAD_AWE_WAKEUP __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_VAD_AWE_WAKEUP)
|
|
#define MBX_CMD_PM_FREEZE __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_PM_FREEZE)
|
|
#define MBX_CMD_SPI_DEV __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SPI_DEV)
|
|
#define MBX_CMD_SPI_XFER __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SPI_XFER)
|
|
#define MBX_CMD_SET_MID __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SET_MID)
|
|
#define MBX_CMD_SET_KEYPAD __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SET_KEYPAD)
|
|
#define MBX_CMD_GET_IR_INFO __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_GET_IR_INFO)
|
|
#define MBX_CMD_GET_STICK_REBOOT_FLAG __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_GET_STICK_REBOOT_FLAG)
|
|
#define MBX_CMD_SUSPEND_WITH_DSP __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SUSPEND_WITH_DSP)
|
|
#define MBX_CMD_SET_ETHERNET_WOL __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SET_ETHERNET_WOL)
|
|
#define MBX_CMD_GET_SPINLOCK __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_GET_SPINLOCK)
|
|
#define MBX_CMD_GET_FD650_INFO __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_GET_FD650_INFO)
|
|
#define MBX_CMD_SET_BL30_PRINT __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SET_BL30_PRINT)
|
|
#define MBX_CMD_SAVE_BL30_VERSION __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SAVE_BL30_VERSION)
|
|
#define MBX_CMD_TRIGGER_AO2AP_SEND __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_TRIGGER_AO2AP_SEND)
|
|
#define MBX_CMD_SEND_AO2AP_TEST __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SEND_AO2AP_TEST)
|
|
#define MBX_CMD_WATCHKEY_CTRL __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_WATCHKEY_CTRL)
|
|
#define MBX_CMD_REFRESH_BL30_LOG __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_REFRESH_BL30_LOG)
|
|
#define MBX_CMD_ARM_ALIVE_CHECK __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_ARM_ALIVE_CHECK)
|
|
#define MBX_CMD_SEND_AO2AP_CLOCK_SYNC __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_SEND_AO2AP_CLOCK_SYNC)
|
|
#define MBX_CMD_GET_CLOCK_SYNC_PARAM __MBX_COMPOSE_MSG(MBX_SYSTEM, CMD_GET_CLOCK_SYNC_PARAM)
|
|
#endif
|