1 /*
2  * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
3  * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2
7  * as published by the Free Software Foundation
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  */
14 
15 #ifndef __MT76X0U_MCU_H
16 #define __MT76X0U_MCU_H
17 
18 #include "../mt76x02_mcu.h"
19 
20 struct mt76x0_dev;
21 
22 #define MT_MCU_IVB_SIZE			0x40
23 #define MT_MCU_DLM_OFFSET		0x80000
24 
25 /* We use same space for BBP as for MAC regs
26  * #define MT_MCU_MEMMAP_BBP		0x40000000
27  */
28 #define MT_MCU_MEMMAP_RF		0x80000000
29 
30 enum mcu_calibrate {
31 	MCU_CAL_R = 1,
32 	MCU_CAL_RXDCOC,
33 	MCU_CAL_LC,
34 	MCU_CAL_LOFT,
35 	MCU_CAL_TXIQ,
36 	MCU_CAL_BW,
37 	MCU_CAL_DPD,
38 	MCU_CAL_RXIQ,
39 	MCU_CAL_TXDCOC,
40 	MCU_CAL_RX_GROUP_DELAY,
41 	MCU_CAL_TX_GROUP_DELAY,
42 };
43 
44 int mt76x0_mcu_init(struct mt76x0_dev *dev);
45 int mt76x0_mcu_cmd_init(struct mt76x0_dev *dev);
46 
47 int
48 mt76x0_mcu_calibrate(struct mt76x0_dev *dev, enum mcu_calibrate cal, u32 val);
49 
50 int
51 mt76x0_mcu_function_select(struct mt76x0_dev *dev, enum mcu_function func, u32 val);
52 
53 #endif
54