51 #define ESPI_INTR_MASK (F_DIP4ERR | F_RXDROP | F_TXDROP | F_RXOVERFLOW | \
52 F_RAMPARITYERR | F_DIP2PARITYERR)
53 #define MON_MASK (V_MONITORED_PORT_NUM(3) | F_MONITORED_DIRECTION \
54 | F_MONITORED_INTERFACE)
57 #define TRICN_CMD_READ 0x11
58 #define TRICN_CMD_WRITE 0x21
59 #define TRICN_CMD_ATTEMPTS 10
62 int ch_addr,
int reg_offset,
u32 wr_data)
76 }
while (busy && --attempts);
79 pr_err(
"%s: TRICN write timed out\n", adapter->name);
89 pr_err(
"%s: ESPI clock not ready\n", adapter->name);
96 tricn_write(adapter, 0, 0, 0,
TRICN_CNFG, 0x81);
97 tricn_write(adapter, 0, 1, 0,
TRICN_CNFG, 0x81);
98 tricn_write(adapter, 0, 2, 0,
TRICN_CNFG, 0x81);
100 for (i = 1; i <= 8; i++)
101 tricn_write(adapter, 0, 0, i,
TRICN_CNFG, 0xf1);
102 for (i = 1; i <= 2; i++)
103 tricn_write(adapter, 0, 1, i,
TRICN_CNFG, 0xf1);
104 for (i = 1; i <= 3; i++)
105 tricn_write(adapter, 0, 2, i,
TRICN_CNFG, 0xe1);
106 tricn_write(adapter, 0, 2, 4,
TRICN_CNFG, 0xf1);
107 tricn_write(adapter, 0, 2, 5,
TRICN_CNFG, 0xe1);
108 tricn_write(adapter, 0, 2, 6,
TRICN_CNFG, 0xf1);
109 tricn_write(adapter, 0, 2, 7,
TRICN_CNFG, 0x80);
110 tricn_write(adapter, 0, 2, 8,
TRICN_CNFG, 0xf1);
188 static void espi_setup_for_pm3393(
adapter_t *adapter)
203 static void espi_setup_for_vsc7321(
adapter_t *adapter)
219 static void espi_setup_for_ixf1010(
adapter_t *adapter,
int nports)
223 if (
is_T2(adapter)) {
240 u32 status_enable_extra = 0;
246 if (
is_T2(adapter)) {
250 writel(nports == 4 ? 0x200040 : 0x1000080,
256 espi_setup_for_pm3393(adapter);
258 espi_setup_for_vsc7321(adapter);
261 espi_setup_for_ixf1010(adapter, nports);
268 if (
is_T2(adapter)) {
277 if (adapter->params.nports == 1)
303 struct peespi *espi = adapter->espi;
307 spin_lock(&espi->
lock);
311 spin_unlock(&espi->
lock);
317 struct peespi *espi = adapter->espi;
325 if (!spin_trylock(&espi->
lock))
328 spin_lock(&espi->
lock);
337 spin_unlock(&espi->
lock);
348 struct peespi *espi = adapter->espi;
349 u8 i, nport = (
u8)adapter->params.nports;
352 if (!spin_trylock(&espi->
lock))
355 spin_lock(&espi->
lock);
362 for (i = 0 ; i < nport; i++, valp++) {
371 spin_unlock(&espi->
lock);