linux/include/linux/rtsx_pci.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/* Driver for Realtek PCI-Express card reader
 *
 * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
 *
 * Author:
 *   Wei WANG <[email protected]>
 */

#ifndef __RTSX_PCI_H
#define __RTSX_PCI_H

#include <linux/sched.h>
#include <linux/pci.h>
#include <linux/rtsx_common.h>

#define MAX_RW_REG_CNT

#define RTSX_HCBAR
#define RTSX_HCBCTLR
#define STOP_CMD
#define READ_REG_CMD
#define WRITE_REG_CMD
#define CHECK_REG_CMD

#define RTSX_HDBAR
#define RTSX_SG_INT
#define RTSX_SG_END
#define RTSX_SG_VALID
#define RTSX_SG_NO_OP
#define RTSX_SG_TRANS_DATA
#define RTSX_SG_LINK_DESC
#define RTSX_HDBCTLR
#define SDMA_MODE
#define ADMA_MODE
#define STOP_DMA
#define TRIG_DMA

#define RTSX_HAIMR
#define HAIMR_TRANS_START
#define HAIMR_READ
#define HAIMR_WRITE
#define HAIMR_READ_START
#define HAIMR_WRITE_START
#define HAIMR_TRANS_END

#define RTSX_BIPR
#define CMD_DONE_INT
#define DATA_DONE_INT
#define TRANS_OK_INT
#define TRANS_FAIL_INT
#define XD_INT
#define MS_INT
#define SD_INT
#define GPIO0_INT
#define OC_INT
#define SD_WRITE_PROTECT
#define XD_EXIST
#define MS_EXIST
#define SD_EXIST
#define DELINK_INT
#define MS_OC_INT
#define SD_OVP_INT
#define SD_OC_INT

#define CARD_INT
#define NEED_COMPLETE_INT
#define RTSX_INT
#define CARD_EXIST

#define RTSX_BIER
#define CMD_DONE_INT_EN
#define DATA_DONE_INT_EN
#define TRANS_OK_INT_EN
#define TRANS_FAIL_INT_EN
#define XD_INT_EN
#define MS_INT_EN
#define SD_INT_EN
#define GPIO0_INT_EN
#define OC_INT_EN
#define DELINK_INT_EN
#define MS_OC_INT_EN
#define SD_OVP_INT_EN
#define SD_OC_INT_EN

#define RTSX_DUM_REG

/*
 * macros for easy use
 */
#define rtsx_pci_writel(pcr, reg, value)
#define rtsx_pci_readl(pcr, reg)
#define rtsx_pci_writew(pcr, reg, value)
#define rtsx_pci_readw(pcr, reg)
#define rtsx_pci_writeb(pcr, reg, value)
#define rtsx_pci_readb(pcr, reg)

#define STATE_TRANS_NONE
#define STATE_TRANS_CMD
#define STATE_TRANS_BUF
#define STATE_TRANS_SG

#define TRANS_NOT_READY
#define TRANS_RESULT_OK
#define TRANS_RESULT_FAIL
#define TRANS_NO_DEVICE

#define RTSX_RESV_BUF_LEN
#define HOST_CMDS_BUF_LEN
#define HOST_SG_TBL_BUF_LEN
#define HOST_SG_TBL_ITEMS
#define MAX_SG_ITEM_LEN
#define HOST_TO_DEVICE
#define DEVICE_TO_HOST

#define OUTPUT_3V3
#define OUTPUT_1V8

#define RTSX_PHASE_MAX
#define RX_TUNING_CNT

#define MS_CFG
#define SAMPLE_TIME_RISING
#define SAMPLE_TIME_FALLING
#define PUSH_TIME_DEFAULT
#define PUSH_TIME_ODD
#define NO_EXTEND_TOGGLE
#define EXTEND_TOGGLE_CHK
#define MS_BUS_WIDTH_1
#define MS_BUS_WIDTH_4
#define MS_BUS_WIDTH_8
#define MS_2K_SECTOR_MODE
#define MS_512_SECTOR_MODE
#define MS_TOGGLE_TIMEOUT_EN
#define MS_TOGGLE_TIMEOUT_DISEN
#define MS_NO_CHECK_INT
#define MS_TPC
#define MS_TRANS_CFG
#define WAIT_INT
#define NO_WAIT_INT
#define NO_AUTO_READ_INT_REG
#define AUTO_READ_INT_REG
#define MS_CRC16_ERR
#define MS_RDY_TIMEOUT
#define MS_INT_CMDNK
#define MS_INT_BREQ
#define MS_INT_ERR
#define MS_INT_CED
#define MS_TRANSFER
#define MS_TRANSFER_START
#define MS_TRANSFER_END
#define MS_TRANSFER_ERR
#define MS_BS_STATE
#define MS_TM_READ_BYTES
#define MS_TM_NORMAL_READ
#define MS_TM_WRITE_BYTES
#define MS_TM_NORMAL_WRITE
#define MS_TM_AUTO_READ
#define MS_TM_AUTO_WRITE
#define MS_INT_REG
#define MS_BYTE_CNT
#define MS_SECTOR_CNT_L
#define MS_SECTOR_CNT_H
#define MS_DBUS_H

#define SD_CFG1
#define SD_CLK_DIVIDE_0
#define SD_CLK_DIVIDE_256
#define SD_CLK_DIVIDE_128
#define SD_BUS_WIDTH_1BIT
#define SD_BUS_WIDTH_4BIT
#define SD_BUS_WIDTH_8BIT
#define SD_ASYNC_FIFO_NOT_RST
#define SD_20_MODE
#define SD_DDR_MODE
#define SD_30_MODE
#define SD_CLK_DIVIDE_MASK
#define SD_MODE_SELECT_MASK
#define SD_CFG2
#define SD_CALCULATE_CRC7
#define SD_NO_CALCULATE_CRC7
#define SD_CHECK_CRC16
#define SD_NO_CHECK_CRC16
#define SD_NO_CHECK_WAIT_CRC_TO
#define SD_WAIT_BUSY_END
#define SD_NO_WAIT_BUSY_END
#define SD_CHECK_CRC7
#define SD_NO_CHECK_CRC7
#define SD_RSP_LEN_0
#define SD_RSP_LEN_6
#define SD_RSP_LEN_17
#define SD_RSP_TYPE_R0
#define SD_RSP_TYPE_R1
#define SD_RSP_TYPE_R1b
#define SD_RSP_TYPE_R2
#define SD_RSP_TYPE_R3
#define SD_RSP_TYPE_R4
#define SD_RSP_TYPE_R5
#define SD_RSP_TYPE_R6
#define SD_RSP_TYPE_R7
#define SD_CFG3
#define SD30_CLK_END_EN
#define SD_RSP_80CLK_TIMEOUT_EN

#define SD_STAT1
#define SD_CRC7_ERR
#define SD_CRC16_ERR
#define SD_CRC_WRITE_ERR
#define SD_CRC_WRITE_ERR_MASK
#define GET_CRC_TIME_OUT
#define SD_TUNING_COMPARE_ERR
#define SD_STAT2
#define SD_RSP_80CLK_TIMEOUT

#define SD_BUS_STAT
#define SD_CLK_TOGGLE_EN
#define SD_CLK_FORCE_STOP
#define SD_DAT3_STATUS
#define SD_DAT2_STATUS
#define SD_DAT1_STATUS
#define SD_DAT0_STATUS
#define SD_CMD_STATUS
#define SD_PAD_CTL
#define SD_IO_USING_1V8
#define SD_IO_USING_3V3
#define TYPE_A_DRIVING
#define TYPE_B_DRIVING
#define TYPE_C_DRIVING
#define TYPE_D_DRIVING
#define SD_SAMPLE_POINT_CTL
#define DDR_FIX_RX_DAT
#define DDR_VAR_RX_DAT
#define DDR_FIX_RX_DAT_EDGE
#define DDR_FIX_RX_DAT_14_DELAY
#define DDR_FIX_RX_CMD
#define DDR_VAR_RX_CMD
#define DDR_FIX_RX_CMD_POS_EDGE
#define DDR_FIX_RX_CMD_14_DELAY
#define SD20_RX_POS_EDGE
#define SD20_RX_14_DELAY
#define SD20_RX_SEL_MASK
#define SD_PUSH_POINT_CTL
#define DDR_FIX_TX_CMD_DAT
#define DDR_VAR_TX_CMD_DAT
#define DDR_FIX_TX_DAT_14_TSU
#define DDR_FIX_TX_DAT_12_TSU
#define DDR_FIX_TX_CMD_NEG_EDGE
#define DDR_FIX_TX_CMD_14_AHEAD
#define SD20_TX_NEG_EDGE
#define SD20_TX_14_AHEAD
#define SD20_TX_SEL_MASK
#define DDR_VAR_SDCLK_POL_SWAP
#define SD_CMD0
#define SD_CMD_START
#define SD_CMD1
#define SD_CMD2
#define SD_CMD3
#define SD_CMD4
#define SD_CMD5
#define SD_BYTE_CNT_L
#define SD_BYTE_CNT_H
#define SD_BLOCK_CNT_L
#define SD_BLOCK_CNT_H
#define SD_TRANSFER
#define SD_TRANSFER_START
#define SD_TRANSFER_END
#define SD_STAT_IDLE
#define SD_TRANSFER_ERR
#define SD_TM_NORMAL_WRITE
#define SD_TM_AUTO_WRITE_3
#define SD_TM_AUTO_WRITE_4
#define SD_TM_AUTO_READ_3
#define SD_TM_AUTO_READ_4
#define SD_TM_CMD_RSP
#define SD_TM_AUTO_WRITE_1
#define SD_TM_AUTO_WRITE_2
#define SD_TM_NORMAL_READ
#define SD_TM_AUTO_READ_1
#define SD_TM_AUTO_READ_2
#define SD_TM_AUTO_TUNING
#define SD_CMD_STATE
#define SD_CMD_IDLE

#define SD_DATA_STATE
#define SD_DATA_IDLE
#define REG_SD_STOP_SDCLK_CFG
#define SD30_CLK_STOP_CFG_EN
#define SD30_CLK_STOP_CFG1
#define SD30_CLK_STOP_CFG0
#define REG_PRE_RW_MODE
#define EN_INFINITE_MODE
#define REG_CRC_DUMMY_0
#define CFG_SD_POW_AUTO_PD

#define SRCTL

#define DCM_DRP_CTL
#define DCM_RESET
#define DCM_LOCKED
#define DCM_208M
#define DCM_TX
#define DCM_RX
#define DCM_DRP_TRIG
#define DRP_START
#define DRP_DONE
#define DCM_DRP_CFG
#define DRP_WRITE
#define DRP_READ
#define DCM_WRITE_ADDRESS_50
#define DCM_WRITE_ADDRESS_51
#define DCM_READ_ADDRESS_00
#define DCM_READ_ADDRESS_51
#define DCM_DRP_WR_DATA_L
#define DCM_DRP_WR_DATA_H
#define DCM_DRP_RD_DATA_L
#define DCM_DRP_RD_DATA_H
#define SD_VPCLK0_CTL
#define SD_VPCLK1_CTL
#define PHASE_SELECT_MASK
#define SD_DCMPS0_CTL
#define SD_DCMPS1_CTL
#define SD_VPTX_CTL
#define SD_VPRX_CTL
#define PHASE_CHANGE
#define PHASE_NOT_RESET
#define SD_DCMPS_TX_CTL
#define SD_DCMPS_RX_CTL
#define DCMPS_CHANGE
#define DCMPS_CHANGE_DONE
#define DCMPS_ERROR
#define DCMPS_CURRENT_PHASE
#define CARD_CLK_SOURCE
#define CRC_FIX_CLK
#define CRC_VAR_CLK0
#define CRC_VAR_CLK1
#define SD30_FIX_CLK
#define SD30_VAR_CLK0
#define SD30_VAR_CLK1
#define SAMPLE_FIX_CLK
#define SAMPLE_VAR_CLK0
#define SAMPLE_VAR_CLK1
#define CARD_PWR_CTL
#define PMOS_STRG_MASK
#define PMOS_STRG_800mA
#define PMOS_STRG_400mA
#define SD_POWER_OFF
#define SD_PARTIAL_POWER_ON
#define SD_POWER_ON
#define SD_POWER_MASK
#define MS_POWER_OFF
#define MS_PARTIAL_POWER_ON
#define MS_POWER_ON
#define MS_POWER_MASK
#define BPP_POWER_OFF
#define BPP_POWER_5_PERCENT_ON
#define BPP_POWER_10_PERCENT_ON
#define BPP_POWER_15_PERCENT_ON
#define BPP_POWER_ON
#define BPP_POWER_MASK
#define SD_VCC_PARTIAL_POWER_ON
#define SD_VCC_POWER_ON
#define CARD_CLK_SWITCH
#define RTL8411B_PACKAGE_MODE
#define CARD_SHARE_MODE
#define CARD_SHARE_MASK
#define CARD_SHARE_MULTI_LUN
#define CARD_SHARE_NORMAL
#define CARD_SHARE_48_SD
#define CARD_SHARE_48_MS
#define CARD_SHARE_BAROSSA_SD
#define CARD_SHARE_BAROSSA_MS
#define CARD_DRIVE_SEL
#define MS_DRIVE_8mA
#define MMC_DRIVE_8mA
#define XD_DRIVE_8mA
#define GPIO_DRIVE_8mA
#define RTS5209_CARD_DRIVE_DEFAULT
#define RTL8411_CARD_DRIVE_DEFAULT
#define RTSX_CARD_DRIVE_DEFAULT

#define CARD_STOP
#define SPI_STOP
#define XD_STOP
#define SD_STOP
#define MS_STOP
#define SPI_CLR_ERR
#define XD_CLR_ERR
#define SD_CLR_ERR
#define MS_CLR_ERR
#define CARD_OE
#define SD_OUTPUT_EN
#define MS_OUTPUT_EN
#define CARD_AUTO_BLINK
#define CARD_GPIO_DIR
#define CARD_GPIO
#define CARD_DATA_SOURCE
#define PINGPONG_BUFFER
#define RING_BUFFER
#define SD30_CLK_DRIVE_SEL
#define DRIVER_TYPE_A
#define DRIVER_TYPE_B
#define DRIVER_TYPE_C
#define DRIVER_TYPE_D
#define CARD_SELECT
#define SD_MOD_SEL
#define MS_MOD_SEL
#define SD30_DRIVE_SEL
#define CFG_DRIVER_TYPE_A
#define CFG_DRIVER_TYPE_B
#define CFG_DRIVER_TYPE_C
#define CFG_DRIVER_TYPE_D
#define SD30_CMD_DRIVE_SEL
#define SD30_DAT_DRIVE_SEL
#define CARD_CLK_EN
#define SD_CLK_EN
#define MS_CLK_EN
#define SD40_CLK_EN
#define SDIO_CTRL
#define CD_PAD_CTL
#define CD_DISABLE_MASK
#define MS_CD_DISABLE
#define SD_CD_DISABLE
#define XD_CD_DISABLE
#define CD_DISABLE
#define CD_ENABLE
#define MS_CD_EN_ONLY
#define SD_CD_EN_ONLY
#define XD_CD_EN_ONLY
#define FORCE_CD_LOW_MASK
#define FORCE_CD_XD_LOW
#define FORCE_CD_SD_LOW
#define FORCE_CD_MS_LOW
#define CD_AUTO_DISABLE
#define FPDCTL
#define SSC_POWER_DOWN
#define SD_OC_POWER_DOWN
#define ALL_POWER_DOWN
#define OC_POWER_DOWN
#define PDINFO

#define CLK_CTL
#define CHANGE_CLK
#define CLK_LOW_FREQ

#define CLK_DIV
#define CLK_DIV_1
#define CLK_DIV_2
#define CLK_DIV_4
#define CLK_DIV_8
#define CLK_SEL

#define SSC_DIV_N_0
#define SSC_DIV_N_1
#define SSC_CTL1
#define SSC_RSTB
#define SSC_8X_EN
#define SSC_FIX_FRAC
#define SSC_SEL_1M
#define SSC_SEL_2M
#define SSC_SEL_4M
#define SSC_SEL_8M
#define SSC_CTL2
#define SSC_DEPTH_MASK
#define SSC_DEPTH_DISALBE
#define SSC_DEPTH_4M
#define SSC_DEPTH_2M
#define SSC_DEPTH_1M
#define SSC_DEPTH_500K
#define SSC_DEPTH_250K
#define RCCTL

#define FPGA_PULL_CTL
#define OLT_LED_CTL
#define LED_SHINE_MASK
#define LED_SHINE_EN
#define LED_SHINE_DISABLE
#define GPIO_CTL

#define LDO_CTL
#define BPP_ASIC_1V7
#define BPP_ASIC_1V8
#define BPP_ASIC_1V9
#define BPP_ASIC_2V0
#define BPP_ASIC_2V7
#define BPP_ASIC_2V8
#define BPP_ASIC_3V2
#define BPP_ASIC_3V3
#define BPP_REG_TUNED18
#define BPP_TUNED18_SHIFT_8402
#define BPP_TUNED18_SHIFT_8411
#define BPP_PAD_MASK
#define BPP_PAD_3V3
#define BPP_PAD_1V8
#define BPP_LDO_POWB
#define BPP_LDO_ON
#define BPP_LDO_SUSPEND
#define BPP_LDO_OFF
#define EFUSE_CTL
#define EFUSE_ADD
#define SYS_VER
#define EFUSE_DATAL
#define EFUSE_DATAH

#define CARD_PULL_CTL1
#define CARD_PULL_CTL2
#define CARD_PULL_CTL3
#define CARD_PULL_CTL4
#define CARD_PULL_CTL5
#define CARD_PULL_CTL6

/* PCI Express Related Registers */
#define IRQEN0
#define IRQSTAT0
#define DMA_DONE_INT
#define SUSPEND_INT
#define LINK_RDY_INT
#define LINK_DOWN_INT
#define IRQEN1
#define IRQSTAT1
#define TLPRIEN
#define TLPRISTAT
#define TLPTIEN
#define TLPTISTAT
#define DMATC0
#define DMATC1
#define DMATC2
#define DMATC3
#define DMACTL
#define DMA_RST
#define DMA_BUSY
#define DMA_DIR_TO_CARD
#define DMA_DIR_FROM_CARD
#define DMA_EN
#define DMA_128
#define DMA_256
#define DMA_512
#define DMA_1024
#define DMA_PACK_SIZE_MASK
#define BCTL
#define RBBC0
#define RBBC1
#define RBDAT
#define RBCTL
#define U_AUTO_DMA_EN_MASK
#define U_AUTO_DMA_DISABLE
#define RB_FLUSH
#define CFGADDR0
#define CFGADDR1
#define CFGDATA0
#define CFGDATA1
#define CFGDATA2
#define CFGDATA3
#define CFGRWCTL
#define PHYRWCTL
#define PHYDATA0
#define PHYDATA1
#define PHYADDR
#define MSGRXDATA0
#define MSGRXDATA1
#define MSGRXDATA2
#define MSGRXDATA3
#define MSGTXDATA0
#define MSGTXDATA1
#define MSGTXDATA2
#define MSGTXDATA3
#define MSGTXCTL
#define LTR_CTL
#define LTR_TX_EN_MASK
#define LTR_TX_EN_1
#define LTR_TX_EN_0
#define LTR_LATENCY_MODE_MASK
#define LTR_LATENCY_MODE_HW
#define LTR_LATENCY_MODE_SW
#define OBFF_CFG
#define OBFF_EN_MASK
#define OBFF_DISABLE

#define CDRESUMECTL
#define CDGW
#define WAKE_SEL_CTL
#define PCLK_CTL
#define PCLK_MODE_SEL
#define PME_FORCE_CTL

#define ASPM_FORCE_CTL
#define FORCE_ASPM_CTL0
#define FORCE_ASPM_CTL1
#define FORCE_ASPM_VAL_MASK
#define FORCE_ASPM_L1_EN
#define FORCE_ASPM_L0_EN
#define FORCE_ASPM_NO_ASPM
#define PM_CLK_FORCE_CTL
#define CLK_PM_EN
#define FUNC_FORCE_CTL
#define FUNC_FORCE_UPME_XMT_DBG
#define PERST_GLITCH_WIDTH
#define CHANGE_LINK_STATE
#define RESET_LOAD_REG
#define EFUSE_CONTENT
#define HOST_SLEEP_STATE
#define HOST_ENTER_S1
#define HOST_ENTER_S3

#define SDIO_CFG
#define PM_EVENT_DEBUG
#define PME_DEBUG_0
#define NFTS_TX_CTRL

#define PWR_GATE_CTRL
#define PWR_GATE_EN
#define LDO3318_PWR_MASK
#define LDO_ON
#define LDO_SUSPEND
#define LDO_OFF
#define PWD_SUSPEND_EN
#define LDO_PWR_SEL

#define L1SUB_CONFIG1
#define AUX_CLK_ACTIVE_SEL_MASK
#define MAC_CKSW_DONE
#define L1SUB_CONFIG2
#define L1SUB_AUTO_CFG
#define L1SUB_CONFIG3
#define L1OFF_MBIAS2_EN_5250

#define DUMMY_REG_RESET_0
#define IC_VERSION_MASK

#define REG_VREF
#define PWD_SUSPND_EN
#define RTS5260_DMA_RST_CTL_0
#define RTS5260_DMA_RST
#define RTS5260_ADMA3_RST
#define AUTOLOAD_CFG_BASE
#define RELINK_TIME_MASK
#define PETXCFG
#define FORCE_CLKREQ_DELINK_MASK
#define FORCE_CLKREQ_LOW
#define FORCE_CLKREQ_HIGH

#define PM_CTRL1
#define CD_RESUME_EN_MASK

#define PM_CTRL2
#define PM_CTRL3
#define SDIO_SEND_PME_EN
#define FORCE_RC_MODE_ON
#define FORCE_RX50_LINK_ON
#define D3_DELINK_MODE_EN
#define USE_PESRTB_CTL_DELINK
#define DELAY_PIN_WAKE
#define RESET_PIN_WAKE
#define PM_WAKE_EN
#define PM_CTRL4

/* FW config info register */
#define RTS5261_FW_CFG_INFO0
#define RTS5261_FW_EXPRESS_TEST_MASK
#define RTS5261_FW_EA_MODE_MASK
#define RTS5261_FW_CFG0
#define RTS5261_FW_ENTER_EXPRESS

#define RTS5261_FW_CFG1
#define RTS5261_SYS_CLK_SEL_MCU_CLK
#define RTS5261_CRC_CLK_SEL_MCU_CLK
#define RTS5261_FAKE_MCU_CLOCK_GATING
#define RTS5261_MCU_BUS_SEL_MASK
#define RTS5261_MCU_CLOCK_SEL_MASK
#define RTS5261_MCU_CLOCK_SEL_16M
#define RTS5261_MCU_CLOCK_GATING
#define RTS5261_DRIVER_ENABLE_FW

#define REG_CFG_OOBS_OFF_TIMER
#define REG_CFG_OOBS_ON_TIMER
#define REG_CFG_VCM_ON_TIMER
#define REG_CFG_OOBS_POLLING

/* Memory mapping */
#define SRAM_BASE
#define RBUF_BASE
#define PPBUF_BASE1
#define PPBUF_BASE2
#define IMAGE_FLAG_ADDR0
#define IMAGE_FLAG_ADDR1

#define RREF_CFG
#define RREF_VBGSEL_MASK
#define RREF_VBGSEL_1V25

#define OOBS_CONFIG
#define OOBS_AUTOK_DIS
#define OOBS_VAL_MASK

#define LDO_DV18_CFG
#define LDO_DV18_SR_MASK
#define LDO_DV18_SR_DF
#define DV331812_MASK
#define DV331812_33
#define DV331812_17

#define LDO_CONFIG2
#define LDO_D3318_MASK
#define LDO_D3318_33V
#define LDO_D3318_18V
#define DV331812_VDD1
#define DV331812_POWERON
#define DV331812_POWEROFF

#define LDO_VCC_CFG0
#define LDO_VCC_LMTVTH_MASK
#define LDO_VCC_LMTVTH_2A
/*RTS5260*/
#define RTS5260_DVCC_TUNE_MASK
#define RTS5260_DVCC_33

/*RTS5261*/
#define RTS5261_LDO1_CFG0
#define RTS5261_LDO1_OCP_THD_MASK
#define RTS5261_LDO1_OCP_EN
#define RTS5261_LDO1_OCP_LMT_THD_MASK
#define RTS5261_LDO1_OCP_LMT_EN

#define LDO_VCC_CFG1
#define LDO_VCC_REF_TUNE_MASK
#define LDO_VCC_REF_1V2
#define LDO_VCC_TUNE_MASK
#define LDO_VCC_1V8
#define LDO_VCC_3V3
#define LDO_VCC_LMT_EN
/*RTS5260*/
#define LDO_POW_SDVDD1_MASK
#define LDO_POW_SDVDD1_ON
#define LDO_POW_SDVDD1_OFF

#define LDO_VIO_CFG
#define LDO_VIO_SR_MASK
#define LDO_VIO_SR_DF
#define LDO_VIO_REF_TUNE_MASK
#define LDO_VIO_REF_1V2
#define LDO_VIO_TUNE_MASK
#define LDO_VIO_1V7
#define LDO_VIO_1V8
#define LDO_VIO_3V3

#define LDO_DV12S_CFG
#define LDO_REF12_TUNE_MASK
#define LDO_REF12_TUNE_DF
#define LDO_D12_TUNE_MASK
#define LDO_D12_TUNE_DF

#define LDO_AV12S_CFG
#define LDO_AV12S_TUNE_MASK
#define LDO_AV12S_TUNE_DF

#define SD40_LDO_CTL1
#define SD40_VIO_TUNE_MASK
#define SD40_VIO_TUNE_1V7
#define SD_VIO_LDO_1V8
#define SD_VIO_LDO_3V3

#define RTS5264_AUTOLOAD_CFG2
#define RTS5264_CHIP_RST_N_SEL

#define RTS5260_AUTOLOAD_CFG4
#define RTS5260_MIMO_DISABLE
/*RTS5261*/
#define RTS5261_AUX_CLK_16M_EN

#define RTS5260_REG_GPIO_CTL0
#define RTS5260_REG_GPIO_MASK
#define RTS5260_REG_GPIO_ON
#define RTS5260_REG_GPIO_OFF

#define PWR_GLOBAL_CTRL
#define PCIE_L1_2_EN
#define PCIE_L1_1_EN
#define PCIE_L1_0_EN
#define PWR_FE_CTL
#define PCIE_L1_2_PD_FE_EN
#define PCIE_L1_1_PD_FE_EN
#define PCIE_L1_0_PD_FE_EN
#define CFG_PCIE_APHY_OFF_0
#define CFG_PCIE_APHY_OFF_0_DEFAULT
#define CFG_PCIE_APHY_OFF_1
#define CFG_PCIE_APHY_OFF_1_DEFAULT
#define CFG_PCIE_APHY_OFF_2
#define CFG_PCIE_APHY_OFF_2_DEFAULT
#define CFG_PCIE_APHY_OFF_3
#define CFG_PCIE_APHY_OFF_3_DEFAULT
#define CFG_L1_0_PCIE_MAC_RET_VALUE
#define CFG_L1_0_PCIE_DPHY_RET_VALUE
#define CFG_L1_0_SYS_RET_VALUE
#define CFG_L1_0_CRC_MISC_RET_VALUE
#define CFG_L1_0_CRC_SD30_RET_VALUE
#define CFG_L1_0_CRC_SD40_RET_VALUE
#define CFG_LP_FPWM_VALUE
#define CFG_LP_FPWM_VALUE_DEFAULT
#define PWC_CDR
#define PWC_CDR_DEFAULT
#define CFG_L1_0_RET_VALUE_DEFAULT
#define CFG_L1_0_CRC_MISC_RET_VALUE_DEFAULT

/* OCPCTL */
#define SD_DETECT_EN
#define SD_OCP_INT_EN
#define SD_OCP_INT_CLR
#define SD_OC_CLR

#define SDVIO_DETECT_EN
#define SDVIO_OCP_INT_EN
#define SDVIO_OCP_INT_CLR
#define SDVIO_OC_CLR

/* OCPSTAT */
#define SD_OCP_DETECT
#define SD_OC_NOW
#define SD_OC_EVER

#define SDVIO_OC_NOW
#define SDVIO_OC_EVER

#define REG_OCPCTL
#define REG_OCPSTAT
#define REG_OCPGLITCH
#define REG_OCPPARA1
#define REG_OCPPARA2

/* rts5260 DV3318 OCP-related registers */
#define REG_DV3318_OCPCTL
#define DV3318_OCP_TIME_MASK
#define DV3318_DETECT_EN
#define DV3318_OCP_INT_EN
#define DV3318_OCP_INT_CLR
#define DV3318_OCP_CLR

#define REG_DV3318_OCPSTAT
#define DV3318_OCP_GlITCH_TIME_MASK
#define DV3318_OCP_DETECT
#define DV3318_OCP_NOW
#define DV3318_OCP_EVER

#define SD_OCP_GLITCH_MASK

/* OCPPARA1 */
#define SDVIO_OCP_TIME_60
#define SDVIO_OCP_TIME_100
#define SDVIO_OCP_TIME_200
#define SDVIO_OCP_TIME_400
#define SDVIO_OCP_TIME_600
#define SDVIO_OCP_TIME_800
#define SDVIO_OCP_TIME_1100
#define SDVIO_OCP_TIME_MASK

#define SD_OCP_TIME_60
#define SD_OCP_TIME_100
#define SD_OCP_TIME_200
#define SD_OCP_TIME_400
#define SD_OCP_TIME_600
#define SD_OCP_TIME_800
#define SD_OCP_TIME_1100
#define SD_OCP_TIME_MASK

/* OCPPARA2 */
#define SDVIO_OCP_THD_190
#define SDVIO_OCP_THD_250
#define SDVIO_OCP_THD_320
#define SDVIO_OCP_THD_380
#define SDVIO_OCP_THD_440
#define SDVIO_OCP_THD_500
#define SDVIO_OCP_THD_570
#define SDVIO_OCP_THD_630
#define SDVIO_OCP_THD_MASK

#define SD_OCP_THD_450
#define SD_OCP_THD_550
#define SD_OCP_THD_650
#define SD_OCP_THD_750
#define SD_OCP_THD_850
#define SD_OCP_THD_950
#define SD_OCP_THD_1050
#define SD_OCP_THD_1150
#define SD_OCP_THD_MASK

#define SDVIO_OCP_GLITCH_MASK
#define SDVIO_OCP_GLITCH_NONE
#define SDVIO_OCP_GLITCH_50U
#define SDVIO_OCP_GLITCH_100U
#define SDVIO_OCP_GLITCH_200U
#define SDVIO_OCP_GLITCH_600U
#define SDVIO_OCP_GLITCH_800U
#define SDVIO_OCP_GLITCH_1M
#define SDVIO_OCP_GLITCH_2M
#define SDVIO_OCP_GLITCH_3M
#define SDVIO_OCP_GLITCH_4M
#define SDVIO_OCP_GLIVCH_5M
#define SDVIO_OCP_GLITCH_6M
#define SDVIO_OCP_GLITCH_7M
#define SDVIO_OCP_GLITCH_8M
#define SDVIO_OCP_GLITCH_9M
#define SDVIO_OCP_GLITCH_10M

#define SD_OCP_GLITCH_MASK
#define SD_OCP_GLITCH_NONE
#define SD_OCP_GLITCH_50U
#define SD_OCP_GLITCH_100U
#define SD_OCP_GLITCH_200U
#define SD_OCP_GLITCH_600U
#define SD_OCP_GLITCH_800U
#define SD_OCP_GLITCH_1M
#define SD_OCP_GLITCH_2M
#define SD_OCP_GLITCH_3M
#define SD_OCP_GLITCH_4M
#define SD_OCP_GLIVCH_5M
#define SD_OCP_GLITCH_6M
#define SD_OCP_GLITCH_7M
#define SD_OCP_GLITCH_8M
#define SD_OCP_GLITCH_9M
#define SD_OCP_GLITCH_10M

/* Phy register */
#define PHY_PCR
#define PHY_PCR_FORCE_CODE
#define PHY_PCR_OOBS_CALI_50
#define PHY_PCR_OOBS_VCM_08
#define PHY_PCR_OOBS_SEN_90
#define PHY_PCR_RSSI_EN
#define PHY_PCR_RX10K

#define PHY_RCR0
#define PHY_RCR1
#define PHY_RCR1_ADP_TIME_4
#define PHY_RCR1_VCO_COARSE
#define PHY_RCR1_INIT_27S
#define PHY_SSCCR2
#define PHY_SSCCR2_PLL_NCODE
#define PHY_SSCCR2_TIME0
#define PHY_SSCCR2_TIME2_WIDTH

#define PHY_RCR2
#define PHY_RCR2_EMPHASE_EN
#define PHY_RCR2_NADJR
#define PHY_RCR2_CDR_SR_2
#define PHY_RCR2_FREQSEL_12
#define PHY_RCR2_CDR_SC_12P
#define PHY_RCR2_CALIB_LATE
#define PHY_RCR2_INIT_27S
#define PHY_SSCCR3
#define PHY_SSCCR3_STEP_IN
#define PHY_SSCCR3_CHECK_DELAY
#define _PHY_ANA03
#define _PHY_ANA03_TIMER_MAX
#define _PHY_ANA03_OOBS_DEB_EN
#define _PHY_CMU_DEBUG_EN

#define PHY_RTCR
#define PHY_RDR
#define PHY_RDR_RXDSEL_1_9
#define PHY_SSC_AUTO_PWD
#define PHY_TCR0
#define PHY_TCR1
#define PHY_TUNE
#define PHY_TUNE_TUNEREF_1_0
#define PHY_TUNE_VBGSEL_1252
#define PHY_TUNE_SDBUS_33
#define PHY_TUNE_TUNED18
#define PHY_TUNE_TUNED12
#define PHY_TUNE_TUNEA12
#define PHY_TUNE_VOLTAGE_MASK
#define PHY_TUNE_VOLTAGE_3V3
#define PHY_TUNE_D18_1V8
#define PHY_TUNE_D18_1V7
#define PHY_ANA08
#define PHY_ANA08_RX_EQ_DCGAIN
#define PHY_ANA08_SEL_RX_EN
#define PHY_ANA08_RX_EQ_VAL
#define PHY_ANA08_SCP
#define PHY_ANA08_SEL_IPI

#define PHY_IMR
#define PHY_BPCR
#define PHY_BPCR_IBRXSEL
#define PHY_BPCR_IBTXSEL
#define PHY_BPCR_IB_FILTER
#define PHY_BPCR_CMIRROR_EN

#define PHY_BIST
#define PHY_RAW_L
#define PHY_RAW_H
#define PHY_RAW_DATA
#define PHY_HOST_CLK_CTRL
#define PHY_DMR
#define PHY_BACR
#define PHY_BACR_BASIC_MASK
#define PHY_IER
#define PHY_BCSR
#define PHY_BPR
#define PHY_BPNR2
#define PHY_BPNR
#define PHY_BRNR2
#define PHY_BENR
#define PHY_REV
#define PHY_REV_RESV
#define PHY_REV_RXIDLE_LATCHED
#define PHY_REV_P1_EN
#define PHY_REV_RXIDLE_EN
#define PHY_REV_CLKREQ_TX_EN
#define PHY_REV_CLKREQ_RX_EN
#define PHY_REV_CLKREQ_DT_1_0
#define PHY_REV_STOP_CLKRD
#define PHY_REV_RX_PWST
#define PHY_REV_STOP_CLKWR
#define _PHY_REV0
#define _PHY_REV0_FILTER_OUT
#define _PHY_REV0_CDR_BYPASS_PFD
#define _PHY_REV0_CDR_RX_IDLE_BYPASS

#define PHY_FLD0
#define PHY_ANA1A
#define PHY_ANA1A_TXR_LOOPBACK
#define PHY_ANA1A_RXT_BIST
#define PHY_ANA1A_TXR_BIST
#define PHY_ANA1A_REV
#define PHY_FLD0_INIT_27S
#define PHY_FLD1
#define PHY_FLD2
#define PHY_FLD3
#define PHY_FLD3_TIMER_4
#define PHY_FLD3_TIMER_6
#define PHY_FLD3_RXDELINK
#define PHY_FLD3_INIT_27S
#define PHY_ANA1D
#define PHY_ANA1D_DEBUG_ADDR
#define _PHY_FLD0
#define _PHY_FLD0_CLK_REQ_20C
#define _PHY_FLD0_RX_IDLE_EN
#define _PHY_FLD0_BIT_ERR_RSTN
#define _PHY_FLD0_BER_COUNT
#define _PHY_FLD0_BER_TIMER
#define _PHY_FLD0_CHECK_EN

#define PHY_FLD4
#define PHY_FLD4_FLDEN_SEL
#define PHY_FLD4_REQ_REF
#define PHY_FLD4_RXAMP_OFF
#define PHY_FLD4_REQ_ADDA
#define PHY_FLD4_BER_COUNT
#define PHY_FLD4_BER_TIMER
#define PHY_FLD4_BER_CHK_EN
#define PHY_FLD4_INIT_27S
#define PHY_DIG1E
#define PHY_DIG1E_REV
#define PHY_DIG1E_D0_X_D1
#define PHY_DIG1E_RX_ON_HOST
#define PHY_DIG1E_RCLK_REF_HOST
#define PHY_DIG1E_RCLK_TX_EN_KEEP
#define PHY_DIG1E_RCLK_TX_TERM_KEEP
#define PHY_DIG1E_RCLK_RX_EIDLE_ON
#define PHY_DIG1E_TX_TERM_KEEP
#define PHY_DIG1E_RX_TERM_KEEP
#define PHY_DIG1E_TX_EN_KEEP
#define PHY_DIG1E_RX_EN_KEEP
#define PHY_DUM_REG

#define PCR_SETTING_REG1
#define PCR_SETTING_REG2
#define PCR_SETTING_REG3
#define PCR_SETTING_REG4
#define PCR_SETTING_REG5


#define rtsx_pci_init_cmd(pcr)

#define RTS5227_DEVICE_ID
#define RTS_MAX_TIMES_FREQ_REDUCTION

struct rtsx_pcr;

struct pcr_handle {};

struct pcr_ops {};

enum PDEV_STAT  {};
enum ASPM_MODE  {};

#define ASPM_L1_1_EN
#define ASPM_L1_2_EN
#define PM_L1_1_EN
#define PM_L1_2_EN
#define LTR_L1SS_PWR_GATE_EN
#define L1_SNOOZE_TEST_EN
#define LTR_L1SS_PWR_GATE_CHECK_CARD_EN

/*
 * struct rtsx_cr_option  - card reader option
 * @dev_flags: device flags
 * @force_clkreq_0: force clock request
 * @ltr_en: enable ltr mode flag
 * @ltr_enabled: ltr mode in configure space flag
 * @ltr_active: ltr mode status
 * @ltr_active_latency: ltr mode active latency
 * @ltr_idle_latency: ltr mode idle latency
 * @ltr_l1off_latency: ltr mode l1off latency
 * @l1_snooze_delay: l1 snooze delay
 * @ltr_l1off_sspwrgate: ltr l1off sspwrgate
 * @ltr_l1off_snooze_sspwrgate: ltr l1off snooze sspwrgate
 * @ocp_en: enable ocp flag
 * @sd_400mA_ocp_thd: 400mA ocp thd
 * @sd_800mA_ocp_thd: 800mA ocp thd
 */
struct rtsx_cr_option {};

/*
 * struct rtsx_hw_param  - card reader hardware param
 * @interrupt_en: indicate which interrutp enable
 * @ocp_glitch: ocp glitch time
 */
struct rtsx_hw_param {};

#define rtsx_set_dev_flag(cr, flag)
#define rtsx_clear_dev_flag(cr, flag)
#define rtsx_check_dev_flag(cr, flag)

struct rtsx_pcr {};

#define PID_524A
#define PID_5249
#define PID_5250
#define PID_525A
#define PID_5260
#define PID_5261
#define PID_5228
#define PID_5264

#define CHK_PCI_PID(pcr, pid)
#define PCI_VID(pcr)
#define PCI_PID(pcr)
#define is_version(pcr, pid, ver)
#define is_version_higher_than(pcr, pid, ver)
#define pcr_dbg(pcr, fmt, arg...)

#define SDR104_PHASE(val)
#define SDR50_PHASE(val)
#define DDR50_PHASE(val)
#define SDR104_TX_PHASE(pcr)
#define SDR50_TX_PHASE(pcr)
#define DDR50_TX_PHASE(pcr)
#define SDR104_RX_PHASE(pcr)
#define SDR50_RX_PHASE(pcr)
#define DDR50_RX_PHASE(pcr)
#define SET_CLOCK_PHASE(sdr104, sdr50, ddr50)

void rtsx_pci_start_run(struct rtsx_pcr *pcr);
int rtsx_pci_write_register(struct rtsx_pcr *pcr, u16 addr, u8 mask, u8 data);
int rtsx_pci_read_register(struct rtsx_pcr *pcr, u16 addr, u8 *data);
int rtsx_pci_write_phy_register(struct rtsx_pcr *pcr, u8 addr, u16 val);
int rtsx_pci_read_phy_register(struct rtsx_pcr *pcr, u8 addr, u16 *val);
void rtsx_pci_stop_cmd(struct rtsx_pcr *pcr);
void rtsx_pci_add_cmd(struct rtsx_pcr *pcr,
		u8 cmd_type, u16 reg_addr, u8 mask, u8 data);
void rtsx_pci_send_cmd_no_wait(struct rtsx_pcr *pcr);
int rtsx_pci_send_cmd(struct rtsx_pcr *pcr, int timeout);
int rtsx_pci_transfer_data(struct rtsx_pcr *pcr, struct scatterlist *sglist,
		int num_sg, bool read, int timeout);
int rtsx_pci_dma_map_sg(struct rtsx_pcr *pcr, struct scatterlist *sglist,
		int num_sg, bool read);
void rtsx_pci_dma_unmap_sg(struct rtsx_pcr *pcr, struct scatterlist *sglist,
		int num_sg, bool read);
int rtsx_pci_dma_transfer(struct rtsx_pcr *pcr, struct scatterlist *sglist,
		int count, bool read, int timeout);
int rtsx_pci_read_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len);
int rtsx_pci_write_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len);
int rtsx_pci_card_pull_ctl_enable(struct rtsx_pcr *pcr, int card);
int rtsx_pci_card_pull_ctl_disable(struct rtsx_pcr *pcr, int card);
int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
		u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk);
int rtsx_pci_card_power_on(struct rtsx_pcr *pcr, int card);
int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card);
int rtsx_pci_card_exclusive_check(struct rtsx_pcr *pcr, int card);
int rtsx_pci_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage);
unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr);
void rtsx_pci_complete_unfinished_transfer(struct rtsx_pcr *pcr);

static inline u8 *rtsx_pci_get_cmd_data(struct rtsx_pcr *pcr)
{}

static inline void rtsx_pci_write_be32(struct rtsx_pcr *pcr, u16 reg, u32 val)
{}

static inline int rtsx_pci_update_phy(struct rtsx_pcr *pcr, u8 addr,
	u16 mask, u16 append)
{}

#endif