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

99 lines
2.7 KiB
C

/*
* Copyright (C) 2020 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 the
* GNU General Public License for more details.
*/
#ifndef __APUSYS_APU_CMD_H__
#define __APUSYS_APU_CMD_H__
#define APUSYS_MAGIC_NUMBER 0x3d2070ece309c231
#define APUSYS_CMD_VERSION 0x1
#define FLAG_SUBGRAPH_FD_MAP (1UL << 31)
#define HDR_FLAG_MASK_POWER_SAVE (1ULL << 0)
#define HDR_FLAG_MASK_FENCE_EXEC (1ULL << 1)
#define HDR_FLAG_MASK_MULTI (3ULL << 62)
#define HDR_FLAG_MASK_STATUS_OFS (2)
#define HDR_FlAG_MASK_STATUS_BMP (0xFULL << HDR_FLAG_MASK_STATUS_OFS)
enum {
HDR_FLAG_MULTI_SCHED = 0,
HDR_FLAG_MULTI_SINGLE = 1,
HDR_FLAG_MULTI_MULTI = 2,
};
enum {
HDR_FLAG_EXEC_STATUS_OK = 0,
HDR_FLAG_EXEC_STATUS_ABORT = 1,
HDR_FLAG_EXEC_STATUS_HWERROR = 2,
};
#define VALUE_SUBGRAPH_PACK_ID_NONE 0
#define VALUE_SUBGRAPH_CTX_ID_NONE 0
#define VALUE_SUBGRAPH_BOOST_NONE 0xFF
#define TYPE_SUBGRAPH_SCOFS_ELEMENT unsigned int
#define TYPE_CMD_SUCCESSOR_ELEMENT unsigned int
#define TYPE_CMD_PREDECCESSOR_CMNT_ELEMENT unsigned int
#define SIZE_SUBGRAPH_SCOFS_ELEMENT \
sizeof(TYPE_SUBGRAPH_SCOFS_ELEMENT)
#define SIZE_CMD_SUCCESSOR_ELEMENT \
sizeof(TYPE_CMD_SUCCESSOR_ELEMENT)
#define SIZE_CMD_PREDECCESSOR_CMNT_ELEMENT \
sizeof(TYPE_CMD_PREDECCESSOR_CMNT_ELEMENT)
struct apu_cmd_hdr {
unsigned long long magic;
unsigned long long uid;
unsigned char version;
unsigned char priority;
unsigned short hard_limit;
unsigned short soft_limit;
unsigned short pid;
unsigned long long flags;
unsigned int num_sc;
unsigned int ofs_scr_list; // successor list offset
unsigned int ofs_pdr_cnt_list; // predecessor count list offset
unsigned int scofs_list_entry; // subcmd offset's list offset
} __attribute__((__packed__));
struct apu_sc_hdr_cmn {
unsigned int type;
unsigned int driver_time;
unsigned int ip_time;
unsigned int suggest_time;
unsigned int bandwidth;
unsigned int tcm_usage;
unsigned char tcm_force;
unsigned char boost_val;
unsigned char pack_id;
unsigned char reserved;
unsigned int mem_ctx;
unsigned int cb_info_size; // codebuf info size
unsigned int ofs_cb_info; // codebuf info offset
} __attribute__((__packed__));
struct apu_fence_hdr {
unsigned long long fd;
unsigned int total_time;
unsigned int status;
} __attribute__((__packed__));
struct apu_mdla_hdr {
unsigned int ofs_codebuf_info_dual0;
unsigned int ofs_codebuf_info_dual1;
unsigned int ofs_pmu_info;
} __attribute__((__packed__));
#endif