Files
threeeye bc1d038eac REVVL 6 Pro kernel bring-up: full working tree snapshot (2026-09-12)
Squashed backup commit (no shallow-clone history issues) of
xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream
commit 9eece662e) plus all fixes applied to get everpal_defconfig building
clean against a modern (GCC 15.2.0) toolchain -- see the previous commit
message on the lineage-23.2 branch (also in this repo history is not
available here since this is a squashed snapshot; full incremental history
lives in the local DL380 checkout and the upstream GitHub remote).

Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
2026-09-12 13:36:46 +00:00

83 lines
2.2 KiB
C

/*
* Copyright (C) 2019 MediaTek Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See http://www.gnu.org/licenses/gpl-2.0.html for more details.
*/
#ifndef __ULTRA_HW_H__
#define __ULTRA_HW_H__
#include <linux/types.h>
/* if IPI expand, need to modify maximum data length(unit: int) */
#define ULTRA_IPI_HEADER_LENGTH 2 /* 2 * 4byte = 8 */
#define ULTRA_IPI_SEND_BUFFER_LENGTH 13 /* 13 * 4byte = 52 */
#define ULTRA_IPI_RECEIVE_LENGTH 2 /* 2 * 4byte = 8 */
#define ULTRA_IPI_ACK_LENGTH 2 /* 2 * 4byte = 8 */
#define ULTRA_IPI_WAIT_ACK_TIMEOUT 10
#define ULTRA_IPI_RESEND_TIMES 2
#define ULTRA_IPI_SEND_CNT_TIMEOUT 500 /* 500ms */
#define ULTRA_WAITCHECK_INTERVAL_MS 1
enum {
ULTRA_IPI_BYPASS_ACK = 0,
ULTRA_IPI_NEED_ACK,
ULTRA_IPI_ACK_BACK
};
/* AP -> SCP ipi structure */
struct ultra_ipi_send_info {
unsigned char msg_id;
unsigned char msg_need_ack;
unsigned char param1;
unsigned char param2;
unsigned int msg_length;
int payload[ULTRA_IPI_SEND_BUFFER_LENGTH];
};
/* SCP -> AP ipi structure */
struct ultra_ipi_receive_info {
unsigned char msg_id;
unsigned char msg_need_ack;
unsigned char param1;
unsigned char param2;
unsigned int msg_length;
unsigned int msg_data[ULTRA_IPI_RECEIVE_LENGTH];
};
/* SCP -> AP ipi ack structure */
struct ultra_ipi_ack_info {
unsigned char msg_id;
unsigned char msg_need_ack;
unsigned char param1;
unsigned char param2;
unsigned int msg_data;
};
/* function */
unsigned int ultra_check_scp_status(void);
void ultra_ipi_register(void (*ipi_rx_call)(unsigned int, void *),
bool (*ipi_tx_ack_call)(unsigned int, unsigned int));
bool ultra_ipi_send(unsigned int msg_id,
bool polling_mode,
unsigned int payload_len,
int *payload,
unsigned int need_ack);
bool ultra_GetScpRecoverStatus(void);
void ultra_SetScpRecoverStatus(bool recovering);
#endif /*__ULTRA_HW_H__ */