blob: ff063194f816f95a2775905d11ec11e93392b069 [file] [log] [blame]
Googler40bc9d02023-12-15 16:42:49 +08001/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
2/*
3 * arch/arm/include/asm/arch-axg/mailbox.h
4 *
5 * Copyright (C) 2020 Amlogic, Inc. All rights reserved.
6 *
7 */
8
9
10#ifndef __GXBB_MAILBOX_H_
11#define __GXBB_MAILBOX_H_
12
13#define SCPI_CMD_SENSOR_VALUE 0x1C
14#define SCPI_CMD_SET_USR_DATA 0x20
15#define SCPI_CMD_OPEN_SCP_LOG 0xC4
16#define SCPI_CMD_THERMAL_CALIB 0xC5
17
18#define LOW_PRIORITY 0
19#define HIGH_PRIORITY 1
20
21#define P_SHARE_SRAM_BASE 0xfffc0000
22#define MHU_HIGH_SCP_TO_AP_PAYLOAD 0x13400
23#define MHU_HIGH_AP_TO_SCP_PAYLOAD 0x13600
24#define MHU_LOW_SCP_TO_AP_PAYLOAD 0x13000
25#define MHU_LOW_AP_TO_SCP_PAYLOAD 0x13200
26
27enum scpi_client_id {
28 SCPI_CL_NONE,
29 SCPI_CL_CLOCKS,
30 SCPI_CL_DVFS,
31 SCPI_CL_POWER,
32 SCPI_CL_THERMAL,
33 SCPI_CL_REMOTE,
34 SCPI_CL_LED_TIMER,
35 SCPI_MAX = 0xff,
36};
37
38enum scpi_error_codes {
39 SCPI_SUCCESS = 0, /* Success */
40 SCPI_ERR_PARAM = 1, /* Invalid parameter(s) */
41 SCPI_ERR_ALIGN = 2, /* Invalid alignment */
42 SCPI_ERR_SIZE = 3, /* Invalid size */
43 SCPI_ERR_HANDLER = 4, /* Invalid handler/callback */
44 SCPI_ERR_ACCESS = 5, /* Invalid access/permission denied */
45 SCPI_ERR_RANGE = 6, /* Value out of range */
46 SCPI_ERR_TIMEOUT = 7, /* Timeout has occurred */
47 SCPI_ERR_NOMEM = 8, /* Invalid memory area or pointer */
48 SCPI_ERR_PWRSTATE = 9, /* Invalid power state */
49 SCPI_ERR_SUPPORT = 10, /* Not supported or disabled */
50 SCPI_ERR_DEVICE = 11, /* Device error */
51 SCPI_ERR_MAX
52};
53
54void open_scp_log(unsigned int channel);
55int thermal_calibration(unsigned int type, unsigned int data);
56int thermal_get_value(unsigned int sensor_id, unsigned int *value);
57int send_usr_data(unsigned int clinet_id, unsigned int *val, unsigned int size);
58
59 #endif