// SPDX-License-Identifier: GPL-2.0
/******************************************************************************
*
* Copyright(c) 2009-2012 Realtek Corporation.
*
* Contact Information:
* wlanfae <wlanfae@realtek.com>
* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
* Hsinchu 300, Taiwan.
*
* Larry Finger <Larry.Finger@lwfinger.net>
*
*****************************************************************************/
#include "wifi.h"
#include "efuse.h"
#include "pci.h"
#include <linux/export.h>
static const u8 MAX_PGPKT_SIZE = 9;
static const u8 PGPKT_DATA_SIZE = 8;
static const int EFUSE_MAX_SIZE = 512;
#define START_ADDRESS 0x1000
#define REG_MCUFWDL 0x0080
static const struct efuse_map RTL8712_SDIO_EFUSE_TABLE[] = {
{0, 0, 0, 2},
{0, 1, 0, 2},
{0, 2, 0, 2},
{1, 0, 0, 1},
{1, 0, 1, 1},
{1, 1, 0, 1},
{1, 1, 1, 3},
{1, 3, 0, 17},
{3, 3, 1, 48},
{10, 0, 0, 6},
{10, 3, 0, 1},
{10, 3, 1, 1},
{11, 0, 0, 28}
};
static void efuse_shadow_read_1byte(struct ieee80211_hw *hw, u16 offset,
u8 *value);
static void efuse_shadow_read_2byte(struct ieee80211_hw *hw, u16 offset,
u16 *value);
static void efuse_shadow_read_4byte(struct ieee80211_hw *hw, u16 offset,
u32 *value);
static void efuse_shadow_write_1byte(struct ieee80211_hw *hw, u16 offset,
u8 value);
static void efuse_shadow_write_2byte(struct ieee80211_hw *hw, u16 offset,
u16 value);
static void efuse_shadow_write_4byte(struct ieee80211_hw *hw, u16 offset,
u32 value);