122 lines · c
1/* SPDX-License-Identifier: GPL-2.0+ */2/* Copyright (c) 2015 Quantenna Communications */3 4#ifndef __PEARL_PCIE_H5#define __PEARL_PCIE_H6 7/* Pearl PCIe HDP registers */8#define PCIE_HDP_CTRL(base) ((base) + 0x2c00)9#define PCIE_HDP_AXI_CTRL(base) ((base) + 0x2c04)10#define PCIE_HDP_HOST_WR_DESC0(base) ((base) + 0x2c10)11#define PCIE_HDP_HOST_WR_DESC0_H(base) ((base) + 0x2c14)12#define PCIE_HDP_HOST_WR_DESC1(base) ((base) + 0x2c18)13#define PCIE_HDP_HOST_WR_DESC1_H(base) ((base) + 0x2c1c)14#define PCIE_HDP_HOST_WR_DESC2(base) ((base) + 0x2c20)15#define PCIE_HDP_HOST_WR_DESC2_H(base) ((base) + 0x2c24)16#define PCIE_HDP_HOST_WR_DESC3(base) ((base) + 0x2c28)17#define PCIE_HDP_HOST_WR_DESC4_H(base) ((base) + 0x2c2c)18#define PCIE_HDP_RX_INT_CTRL(base) ((base) + 0x2c30)19#define PCIE_HDP_TX_INT_CTRL(base) ((base) + 0x2c34)20#define PCIE_HDP_INT_STATUS(base) ((base) + 0x2c38)21#define PCIE_HDP_INT_EN(base) ((base) + 0x2c3c)22#define PCIE_HDP_RX_DESC0_PTR(base) ((base) + 0x2c40)23#define PCIE_HDP_RX_DESC0_NOE(base) ((base) + 0x2c44)24#define PCIE_HDP_RX_DESC1_PTR(base) ((base) + 0x2c48)25#define PCIE_HDP_RX_DESC1_NOE(base) ((base) + 0x2c4c)26#define PCIE_HDP_RX_DESC2_PTR(base) ((base) + 0x2c50)27#define PCIE_HDP_RX_DESC2_NOE(base) ((base) + 0x2c54)28#define PCIE_HDP_RX_DESC3_PTR(base) ((base) + 0x2c58)29#define PCIE_HDP_RX_DESC3_NOE(base) ((base) + 0x2c5c)30 31#define PCIE_HDP_TX0_BASE_ADDR(base) ((base) + 0x2c60)32#define PCIE_HDP_TX1_BASE_ADDR(base) ((base) + 0x2c64)33#define PCIE_HDP_TX0_Q_CTRL(base) ((base) + 0x2c70)34#define PCIE_HDP_TX1_Q_CTRL(base) ((base) + 0x2c74)35#define PCIE_HDP_CFG0(base) ((base) + 0x2c80)36#define PCIE_HDP_CFG1(base) ((base) + 0x2c84)37#define PCIE_HDP_CFG2(base) ((base) + 0x2c88)38#define PCIE_HDP_CFG3(base) ((base) + 0x2c8c)39#define PCIE_HDP_CFG4(base) ((base) + 0x2c90)40#define PCIE_HDP_CFG5(base) ((base) + 0x2c94)41#define PCIE_HDP_CFG6(base) ((base) + 0x2c98)42#define PCIE_HDP_CFG7(base) ((base) + 0x2c9c)43#define PCIE_HDP_CFG8(base) ((base) + 0x2ca0)44#define PCIE_HDP_CFG9(base) ((base) + 0x2ca4)45#define PCIE_HDP_CFG10(base) ((base) + 0x2ca8)46#define PCIE_HDP_CFG11(base) ((base) + 0x2cac)47#define PCIE_INT(base) ((base) + 0x2cb0)48#define PCIE_INT_MASK(base) ((base) + 0x2cb4)49#define PCIE_MSI_MASK(base) ((base) + 0x2cb8)50#define PCIE_MSI_PNDG(base) ((base) + 0x2cbc)51#define PCIE_PRI_CFG(base) ((base) + 0x2cc0)52#define PCIE_PHY_CR(base) ((base) + 0x2cc4)53#define PCIE_HDP_CTAG_CTRL(base) ((base) + 0x2cf4)54#define PCIE_HDP_HHBM_BUF_PTR(base) ((base) + 0x2d00)55#define PCIE_HDP_HHBM_BUF_PTR_H(base) ((base) + 0x2d04)56#define PCIE_HDP_HHBM_BUF_FIFO_NOE(base) ((base) + 0x2d04)57#define PCIE_HDP_RX0DMA_CNT(base) ((base) + 0x2d10)58#define PCIE_HDP_RX1DMA_CNT(base) ((base) + 0x2d14)59#define PCIE_HDP_RX2DMA_CNT(base) ((base) + 0x2d18)60#define PCIE_HDP_RX3DMA_CNT(base) ((base) + 0x2d1c)61#define PCIE_HDP_TX0DMA_CNT(base) ((base) + 0x2d20)62#define PCIE_HDP_TX1DMA_CNT(base) ((base) + 0x2d24)63#define PCIE_HDP_RXDMA_CTRL(base) ((base) + 0x2d28)64#define PCIE_HDP_TX_HOST_Q_SZ_CTRL(base) ((base) + 0x2d2c)65#define PCIE_HDP_TX_HOST_Q_BASE_L(base) ((base) + 0x2d30)66#define PCIE_HDP_TX_HOST_Q_BASE_H(base) ((base) + 0x2d34)67#define PCIE_HDP_TX_HOST_Q_WR_PTR(base) ((base) + 0x2d38)68#define PCIE_HDP_TX_HOST_Q_RD_PTR(base) ((base) + 0x2d3c)69#define PCIE_HDP_TX_HOST_Q_STS(base) ((base) + 0x2d40)70 71/* Pearl PCIe HBM pool registers */72#define PCIE_HHBM_CSR_REG(base) ((base) + 0x2e00)73#define PCIE_HHBM_Q_BASE_REG(base) ((base) + 0x2e04)74#define PCIE_HHBM_Q_LIMIT_REG(base) ((base) + 0x2e08)75#define PCIE_HHBM_Q_WR_REG(base) ((base) + 0x2e0c)76#define PCIE_HHBM_Q_RD_REG(base) ((base) + 0x2e10)77#define PCIE_HHBM_POOL_DATA_0_H(base) ((base) + 0x2e90)78#define PCIE_HHBM_CONFIG(base) ((base) + 0x2f9c)79#define PCIE_HHBM_POOL_REQ_0(base) ((base) + 0x2f10)80#define PCIE_HHBM_POOL_DATA_0(base) ((base) + 0x2f40)81#define PCIE_HHBM_WATERMARK_MASKED_INT(base) ((base) + 0x2f68)82#define PCIE_HHBM_WATERMARK_INT(base) ((base) + 0x2f6c)83#define PCIE_HHBM_POOL_WATERMARK(base) ((base) + 0x2f70)84#define PCIE_HHBM_POOL_OVERFLOW_CNT(base) ((base) + 0x2f90)85#define PCIE_HHBM_POOL_UNDERFLOW_CNT(base) ((base) + 0x2f94)86#define HBM_INT_STATUS(base) ((base) + 0x2f9c)87#define PCIE_HHBM_POOL_CNFIG(base) ((base) + 0x2f9c)88 89/* Pearl PCIe HBM bit field definitions */90#define HHBM_CONFIG_SOFT_RESET (BIT(8))91#define HHBM_WR_REQ (BIT(0))92#define HHBM_RD_REQ (BIT(1))93#define HHBM_DONE (BIT(31))94#define HHBM_64BIT (BIT(10))95 96/* PCIe HDP interrupt status definition */97#define PCIE_HDP_INT_EP_RXDMA (BIT(0))98#define PCIE_HDP_INT_HBM_UF (BIT(1))99#define PCIE_HDP_INT_RX_LEN_ERR (BIT(2))100#define PCIE_HDP_INT_RX_HDR_LEN_ERR (BIT(3))101#define PCIE_HDP_INT_EP_TXDMA (BIT(12))102#define PCIE_HDP_INT_HHBM_UF (BIT(13))103#define PCIE_HDP_INT_EP_TXEMPTY (BIT(15))104#define PCIE_HDP_INT_IPC (BIT(29))105 106/* PCIe interrupt status definition */107#define PCIE_INT_MSI (BIT(24))108#define PCIE_INT_INTX (BIT(23))109 110/* PCIe legacy INTx */111#define PEARL_PCIE_CFG0_OFFSET (0x6C)112#define PEARL_ASSERT_INTX (BIT(9))113 114/* SYS CTL regs */115#define QTN_PEARL_SYSCTL_LHOST_IRQ_OFFSET (0x001C)116 117#define QTN_PEARL_IPC_IRQ_WORD(irq) (BIT(irq) | BIT(irq + 16))118#define QTN_PEARL_LHOST_IPC_IRQ (6)119#define QTN_PEARL_LHOST_EP_RESET (7)120 121#endif /* __PEARL_PCIE_H */122