2 * Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef __MT76x2_MCU_H
18 #define __MT76x2_MCU_H
20 #include "../mt76x02_mcu.h"
22 /* Register definitions */
23 #define MT_MCU_CPU_CTL 0x0704
24 #define MT_MCU_CLOCK_CTL 0x0708
25 #define MT_MCU_PCIE_REMAP_BASE1 0x0740
26 #define MT_MCU_PCIE_REMAP_BASE2 0x0744
27 #define MT_MCU_PCIE_REMAP_BASE3 0x0748
29 #define MT_MCU_ROM_PATCH_OFFSET 0x80000
30 #define MT_MCU_ROM_PATCH_ADDR 0x90000
32 #define MT_MCU_ILM_OFFSET 0x80000
34 #define MT_MCU_DLM_OFFSET 0x100000
35 #define MT_MCU_DLM_ADDR 0x90000
36 #define MT_MCU_DLM_ADDR_E3 0x90800
38 enum mcu_calibration
{
56 enum mt76x2_mcu_cr_mode
{
63 struct mt76x2_tssi_comp
{
72 } __packed
__aligned(4);
74 int mt76x2_mcu_tssi_comp(struct mt76x02_dev
*dev
, struct mt76x2_tssi_comp
*tssi_data
);
75 int mt76x2_mcu_init_gain(struct mt76x02_dev
*dev
, u8 channel
, u32 gain
,