From 1ee66cbba1ce67edfba21bde3c9f9ae794634ab4 Mon Sep 17 00:00:00 2001 From: Lian Chen Date: Mon, 7 Nov 2022 14:47:44 +0800 Subject: [PATCH 3010/3013] mt76: mt7915: wed: HW ATF support for mt7986 Signed-off-by: Lian Chen --- mt76_connac_mcu.h | 2 + mt7915/debugfs.c | 405 +++++++++++++++++++++++++++++++++++++++++++ mt7915/init.c | 39 +++++ mt7915/main.c | 15 ++ mt7915/mcu.c | 165 ++++++++++++++++++ mt7915/mt7915.h | 68 ++++++++ mt7915/mtk_debugfs.c | 133 +++++++++++++- 7 files changed, 826 insertions(+), 1 deletion(-) mode change 100644 => 100755 mt7915/init.c diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h index 98b0074..239643b 100644 --- a/mt76_connac_mcu.h +++ b/mt76_connac_mcu.h @@ -1159,6 +1159,7 @@ enum { MCU_EXT_CMD_THERMAL_CTRL = 0x2c, MCU_EXT_CMD_WTBL_UPDATE = 0x32, MCU_EXT_CMD_SET_DRR_CTRL = 0x36, + MCU_EXT_CMD_SET_FEATURE_CTRL = 0x38, MCU_EXT_CMD_SET_RDD_CTRL = 0x3a, MCU_EXT_CMD_ATE_CTRL = 0x3d, MCU_EXT_CMD_PROTECT_CTRL = 0x3e, @@ -1168,6 +1169,7 @@ enum { MCU_EXT_CMD_MUAR_UPDATE = 0x48, MCU_EXT_CMD_BCN_OFFLOAD = 0x49, MCU_EXT_CMD_RX_AIRTIME_CTRL = 0x4a, + MCU_EXT_CMD_AT_PROC_MODULE = 0x4b, MCU_EXT_CMD_SET_RX_PATH = 0x4e, MCU_EXT_CMD_EFUSE_FREE_BLOCK = 0x4f, MCU_EXT_CMD_TX_POWER_FEATURE_CTRL = 0x58, diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c index 3ef2148..b178036 100644 --- a/mt7915/debugfs.c +++ b/mt7915/debugfs.c @@ -12,6 +12,10 @@ #define FW_BIN_LOG_MAGIC_V2 0x44d9c99a #endif +#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] +#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" + + /** global debugfs **/ struct hw_queue_map { @@ -211,6 +215,406 @@ static const struct file_operations mt7915_sys_recovery_ops = { .llseek = default_llseek, }; +static ssize_t mt7915_vow_get(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) +{ + char *buff; + int desc = 0; + ssize_t ret; + static const size_t bufsz = 1000; + + buff = kmalloc(bufsz, GFP_KERNEL); + if (!buff) + return -ENOMEM; + + desc += scnprintf(buff + desc, bufsz - desc, + "======== Control =============\n" + "vow_atf_en=<0/1> 0:disable, 1:enable\n" + "vow_watf_en=<0/1> 0:disable, 1:enable\n" + "vow_watf_quantum=- unit 256us\n" + "======== Station table =============\n" + "vow_sta_dwrr_quantum_id=--\n" + "vow_dwrr_max_wait_time=