cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

rtl8712_efuse.h (1618B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2#ifndef __RTL8712_EFUSE_H__
      3#define __RTL8712_EFUSE_H__
      4
      5#include "osdep_service.h"
      6
      7#define _REPEAT_THRESHOLD_	3
      8
      9#define EFUSE_MAX_SIZE		512
     10#define EFUSE_MAP_MAX_SIZE	128
     11
     12#define PGPKG_MAX_WORDS	4
     13#define PGPKT_DATA_SIZE	8 /* PGPKG_MAX_WORDS*2; BYTES sizeof(u8)*8*/
     14#define MAX_PGPKT_SIZE	9 /* 1 + PGPKT_DATA_SIZE; header + 2 * 4 words (BYTES)*/
     15
     16#define GET_EFUSE_OFFSET(header)	((header & 0xF0) >> 4)
     17#define GET_EFUSE_WORD_EN(header)	(header & 0x0F)
     18#define MAKE_EFUSE_HEADER(offset, word_en)	((((offset) & 0x0F) << 4) | \
     19						((word_en) & 0x0F))
     20/*--------------------------------------------------------------------------*/
     21struct PGPKT_STRUCT {
     22	u8 offset;
     23	u8 word_en;
     24	u8 data[PGPKT_DATA_SIZE];
     25};
     26/*--------------------------------------------------------------------------*/
     27u8 r8712_efuse_reg_init(struct _adapter *padapter);
     28void r8712_efuse_reg_uninit(struct _adapter *padapter);
     29u16 r8712_efuse_get_current_size(struct _adapter *padapter);
     30int r8712_efuse_get_max_size(struct _adapter *padapter);
     31void r8712_efuse_change_max_size(struct _adapter *padapter);
     32u8 r8712_efuse_pg_packet_read(struct _adapter *padapter,
     33			      u8 offset, u8 *data);
     34u8 r8712_efuse_pg_packet_write(struct _adapter *padapter,
     35			       const u8 offset, const u8 word_en,
     36			       const u8 *data);
     37u8 r8712_efuse_access(struct _adapter *padapter, u8 bRead,
     38		      u16 start_addr, u16 cnts, u8 *data);
     39u8 r8712_efuse_map_read(struct _adapter *padapter, u16 addr,
     40			u16 cnts, u8 *data);
     41u8 r8712_efuse_map_write(struct _adapter *padapter, u16 addr,
     42			 u16 cnts, u8 *data);
     43#endif