| From af793eb0cf8e035760bdb595ae96e7d7534df60f Mon Sep 17 00:00:00 2001 |
| From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| Date: Fri, 21 Jul 2023 10:41:28 +0800 |
| Subject: [PATCH 62/98] wifi: mt76: mt7996: add kite fw & default bin for |
| different sku variants |
| |
| Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| --- |
| mt7996/eeprom.c | 10 ++++++++-- |
| mt7996/mcu.c | 7 ++++++- |
| mt7996/mt7996.h | 25 ++++++++++++++++++++++++- |
| mt7996/regs.h | 2 ++ |
| 4 files changed, 40 insertions(+), 4 deletions(-) |
| |
| diff --git a/mt7996/eeprom.c b/mt7996/eeprom.c |
| index 6605853..6eebbb3 100644 |
| --- a/mt7996/eeprom.c |
| +++ b/mt7996/eeprom.c |
| @@ -78,8 +78,14 @@ const char *mt7996_eeprom_name(struct mt7996_dev *dev) |
| else |
| return MT7996_EEPROM_DEFAULT; |
| case 0x7992: |
| - return dev->testmode_enable ? |
| - MT7992_EEPROM_DEFAULT_TM : MT7992_EEPROM_DEFAULT; |
| + if (dev->testmode_enable) |
| + return MT7992_EEPROM_DEFAULT_TM; |
| + else if (dev->chip_sku == MT7992_SKU_23) |
| + return MT7992_EEPROM_DEFAULT_23; |
| + else if (dev->chip_sku == MT7992_SKU_24) |
| + return MT7992_EEPROM_DEFAULT_24; |
| + else |
| + return MT7992_EEPROM_DEFAULT; |
| default: |
| return MT7996_EEPROM_DEFAULT; |
| } |
| diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
| index e9088ba..b8d26ec 100644 |
| --- a/mt7996/mcu.c |
| +++ b/mt7996/mcu.c |
| @@ -18,7 +18,12 @@ |
| _fw = MT7996_##name; \ |
| break; \ |
| case 0x7992: \ |
| - _fw = MT7992_##name; \ |
| + if ((_dev)->chip_sku == MT7992_SKU_23) \ |
| + _fw = MT7992_##name##_23; \ |
| + else if ((_dev)->chip_sku == MT7992_SKU_24) \ |
| + _fw = MT7992_##name##_24; \ |
| + else \ |
| + _fw = MT7992_##name; \ |
| break; \ |
| default: \ |
| _fw = MT7996_##name; \ |
| diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h |
| index 433d886..6775360 100644 |
| --- a/mt7996/mt7996.h |
| +++ b/mt7996/mt7996.h |
| @@ -41,11 +41,25 @@ |
| #define MT7992_FIRMWARE_WM_TM "mediatek/mt7996/mt7992_wm_tm.bin" |
| #define MT7992_ROM_PATCH "mediatek/mt7996/mt7992_rom_patch.bin" |
| |
| +#define MT7992_FIRMWARE_WA_24 "mediatek/mt7996/mt7992_wa_24.bin" |
| +#define MT7992_FIRMWARE_WM_24 "mediatek/mt7996/mt7992_wm_24.bin" |
| +#define MT7992_FIRMWARE_DSP_24 "mediatek/mt7996/mt7992_dsp_24.bin" |
| +#define MT7992_FIRMWARE_WM_TM_24 "mediatek/mt7996/mt7992_wm_tm_24.bin" |
| +#define MT7992_ROM_PATCH_24 "mediatek/mt7996/mt7992_rom_patch_24.bin" |
| + |
| +#define MT7992_FIRMWARE_WA_23 "mediatek/mt7996/mt7992_wa_23.bin" |
| +#define MT7992_FIRMWARE_WM_23 "mediatek/mt7996/mt7992_wm_23.bin" |
| +#define MT7992_FIRMWARE_DSP_23 "mediatek/mt7996/mt7992_dsp_23.bin" |
| +#define MT7992_FIRMWARE_WM_TM_23 "mediatek/mt7996/mt7992_wm_tm_23.bin" |
| +#define MT7992_ROM_PATCH_23 "mediatek/mt7996/mt7992_rom_patch_23.bin" |
| + |
| #define MT7996_EEPROM_DEFAULT "mediatek/mt7996/mt7996_eeprom.bin" |
| #define MT7996_EEPROM_DEFAULT_404 "mediatek/mt7996/mt7996_eeprom_dual_404.bin" |
| #define MT7996_EEPROM_DEFAULT_TM "mediatek/mt7996/mt7996_eeprom_tm.bin" |
| #define MT7992_EEPROM_DEFAULT "mediatek/mt7996/mt7992_eeprom.bin" |
| #define MT7992_EEPROM_DEFAULT_TM "mediatek/mt7996/mt7992_eeprom_tm.bin" |
| +#define MT7992_EEPROM_DEFAULT_24 "mediatek/mt7996/mt7992_eeprom_24.bin" |
| +#define MT7992_EEPROM_DEFAULT_23 "mediatek/mt7996/mt7992_eeprom_23.bin" |
| |
| #define MT7996_EEPROM_SIZE 7680 |
| #define MT7992_EEPROM_SIZE 7680 |
| @@ -103,6 +117,12 @@ enum mt7996_sku_type { |
| MT7996_SKU_444, |
| }; |
| |
| +enum mt7992_sku_type { |
| + MT7992_SKU_23, |
| + MT7992_SKU_24, |
| + MT7992_SKU_44, |
| +}; |
| + |
| enum mt7996_ram_type { |
| MT7996_RAM_TYPE_WM, |
| MT7996_RAM_TYPE_WM_TM = MT7996_RAM_TYPE_WM, |
| @@ -510,11 +530,14 @@ mt7996_get_chip_sku(struct mt7996_dev *dev) |
| { |
| u32 val = mt76_rr(dev, MT_PAD_GPIO); |
| |
| - /* reserve for future variants */ |
| switch (mt76_chip(&dev->mt76)) { |
| case 0x7990: |
| dev->chip_sku = FIELD_GET(MT_PAD_GPIO_ADIE_COMB, val) <= 1; |
| break; |
| + case 0x7992: |
| + dev->chip_sku = !!FIELD_GET(MT_PAD_GPIO_ADIE_COMB_7992, val) + |
| + !FIELD_GET(MT_PAD_GPIO_ADIE_NUM_7992, val); |
| + break; |
| default: |
| return -EINVAL; |
| } |
| diff --git a/mt7996/regs.h b/mt7996/regs.h |
| index 565022a..d305c25 100644 |
| --- a/mt7996/regs.h |
| +++ b/mt7996/regs.h |
| @@ -651,6 +651,8 @@ enum offs_rev { |
| |
| #define MT_PAD_GPIO 0x700056f0 |
| #define MT_PAD_GPIO_ADIE_COMB GENMASK(16, 15) |
| +#define MT_PAD_GPIO_ADIE_COMB_7992 GENMASK(17, 16) |
| +#define MT_PAD_GPIO_ADIE_NUM_7992 BIT(15) |
| |
| #define MT_HW_REV 0x70010204 |
| #define MT_WF_SUBSYS_RST 0x70028600 |
| -- |
| 2.18.0 |
| |