aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rapidio/switches/tsi57x.c
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2016-08-02 17:06:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-02 19:35:37 -0400
commit1ae842de1dd8051cbb65b396b6f029d07f992641 (patch)
tree8611cc33a11229df919f3d87561d803d5e5986a9 /drivers/rapidio/switches/tsi57x.c
parenta057a52e94e15d89be8af557584e0144a496b6c6 (diff)
rapidio: modify for rev.3 specification changes
Implement changes made in RapidIO specification rev.3 to LP-Serial Physical Layer register definitions: - use per-port register offset calculations based on LP-Serial Extended Features Block (EFB) Register Map type (I or II) with different per-port offset step (0x20 vs 0x40 respectfully). - remove deprecated Parallel Physical layer definitions and related code. [alexandre.bounine@idt.com: fix DocBook warning for gen3 update] Link: http://lkml.kernel.org/r/1469191173-19338-1-git-send-email-alexandre.bounine@idt.com Link: http://lkml.kernel.org/r/1469125134-16523-12-git-send-email-alexandre.bounine@idt.com Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Tested-by: Barry Wood <barry.wood@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com> Cc: Barry Wood <barry.wood@idt.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rapidio/switches/tsi57x.c')
-rw-r--r--drivers/rapidio/switches/tsi57x.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/rapidio/switches/tsi57x.c b/drivers/rapidio/switches/tsi57x.c
index 42c8b014fe15..2700d15f7584 100644
--- a/drivers/rapidio/switches/tsi57x.c
+++ b/drivers/rapidio/switches/tsi57x.c
@@ -175,12 +175,10 @@ tsi57x_em_init(struct rio_dev *rdev)
175 175
176 /* Clear all pending interrupts */ 176 /* Clear all pending interrupts */
177 rio_read_config_32(rdev, 177 rio_read_config_32(rdev,
178 rdev->phys_efptr + 178 RIO_DEV_PORT_N_ERR_STS_CSR(rdev, portnum),
179 RIO_PORT_N_ERR_STS_CSR(portnum),
180 &regval); 179 &regval);
181 rio_write_config_32(rdev, 180 rio_write_config_32(rdev,
182 rdev->phys_efptr + 181 RIO_DEV_PORT_N_ERR_STS_CSR(rdev, portnum),
183 RIO_PORT_N_ERR_STS_CSR(portnum),
184 regval & 0x07120214); 182 regval & 0x07120214);
185 183
186 rio_read_config_32(rdev, 184 rio_read_config_32(rdev,
@@ -198,7 +196,7 @@ tsi57x_em_init(struct rio_dev *rdev)
198 196
199 /* Skip next (odd) port if the current port is in x4 mode */ 197 /* Skip next (odd) port if the current port is in x4 mode */
200 rio_read_config_32(rdev, 198 rio_read_config_32(rdev,
201 rdev->phys_efptr + RIO_PORT_N_CTL_CSR(portnum), 199 RIO_DEV_PORT_N_CTL_CSR(rdev, portnum),
202 &regval); 200 &regval);
203 if ((regval & RIO_PORT_N_CTL_PWIDTH) == RIO_PORT_N_CTL_PWIDTH_4) 201 if ((regval & RIO_PORT_N_CTL_PWIDTH) == RIO_PORT_N_CTL_PWIDTH_4)
204 portnum++; 202 portnum++;
@@ -221,23 +219,23 @@ tsi57x_em_handler(struct rio_dev *rdev, u8 portnum)
221 u32 regval; 219 u32 regval;
222 220
223 rio_read_config_32(rdev, 221 rio_read_config_32(rdev,
224 rdev->phys_efptr + RIO_PORT_N_ERR_STS_CSR(portnum), 222 RIO_DEV_PORT_N_ERR_STS_CSR(rdev, portnum),
225 &err_status); 223 &err_status);
226 224
227 if ((err_status & RIO_PORT_N_ERR_STS_PORT_OK) && 225 if ((err_status & RIO_PORT_N_ERR_STS_PORT_OK) &&
228 (err_status & (RIO_PORT_N_ERR_STS_PW_OUT_ES | 226 (err_status & (RIO_PORT_N_ERR_STS_OUT_ES |
229 RIO_PORT_N_ERR_STS_PW_INP_ES))) { 227 RIO_PORT_N_ERR_STS_INP_ES))) {
230 /* Remove any queued packets by locking/unlocking port */ 228 /* Remove any queued packets by locking/unlocking port */
231 rio_read_config_32(rdev, 229 rio_read_config_32(rdev,
232 rdev->phys_efptr + RIO_PORT_N_CTL_CSR(portnum), 230 RIO_DEV_PORT_N_CTL_CSR(rdev, portnum),
233 &regval); 231 &regval);
234 if (!(regval & RIO_PORT_N_CTL_LOCKOUT)) { 232 if (!(regval & RIO_PORT_N_CTL_LOCKOUT)) {
235 rio_write_config_32(rdev, 233 rio_write_config_32(rdev,
236 rdev->phys_efptr + RIO_PORT_N_CTL_CSR(portnum), 234 RIO_DEV_PORT_N_CTL_CSR(rdev, portnum),
237 regval | RIO_PORT_N_CTL_LOCKOUT); 235 regval | RIO_PORT_N_CTL_LOCKOUT);
238 udelay(50); 236 udelay(50);
239 rio_write_config_32(rdev, 237 rio_write_config_32(rdev,
240 rdev->phys_efptr + RIO_PORT_N_CTL_CSR(portnum), 238 RIO_DEV_PORT_N_CTL_CSR(rdev, portnum),
241 regval); 239 regval);
242 } 240 }
243 241
@@ -245,7 +243,7 @@ tsi57x_em_handler(struct rio_dev *rdev, u8 portnum)
245 * valid bit 243 * valid bit
246 */ 244 */
247 rio_read_config_32(rdev, 245 rio_read_config_32(rdev,
248 rdev->phys_efptr + RIO_PORT_N_MNT_RSP_CSR(portnum), 246 RIO_DEV_PORT_N_MNT_RSP_CSR(rdev, portnum),
249 &regval); 247 &regval);
250 248
251 /* Send a Packet-Not-Accepted/Link-Request-Input-Status control 249 /* Send a Packet-Not-Accepted/Link-Request-Input-Status control
@@ -259,8 +257,8 @@ tsi57x_em_handler(struct rio_dev *rdev, u8 portnum)
259 while (checkcount--) { 257 while (checkcount--) {
260 udelay(50); 258 udelay(50);
261 rio_read_config_32(rdev, 259 rio_read_config_32(rdev,
262 rdev->phys_efptr + 260 RIO_DEV_PORT_N_MNT_RSP_CSR(rdev,
263 RIO_PORT_N_MNT_RSP_CSR(portnum), 261 portnum),
264 &regval); 262 &regval);
265 if (regval & RIO_PORT_N_MNT_RSP_RVAL) 263 if (regval & RIO_PORT_N_MNT_RSP_RVAL)
266 goto exit_es; 264 goto exit_es;