aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/rapidio/switches/tsi568.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/rapidio/switches/tsi568.c b/drivers/rapidio/switches/tsi568.c
index f7fd7898606e..b9a389b9f812 100644
--- a/drivers/rapidio/switches/tsi568.c
+++ b/drivers/rapidio/switches/tsi568.c
@@ -29,7 +29,7 @@
29#define SPP_ROUTE_CFG_DESTID(n) (0x11070 + 0x100*n) 29#define SPP_ROUTE_CFG_DESTID(n) (0x11070 + 0x100*n)
30#define SPP_ROUTE_CFG_PORT(n) (0x11074 + 0x100*n) 30#define SPP_ROUTE_CFG_PORT(n) (0x11074 + 0x100*n)
31 31
32#define TSI568_SP_MODE_BC 0x10004 32#define TSI568_SP_MODE(n) (0x11004 + 0x100*n)
33#define TSI568_SP_MODE_PW_DIS 0x08000000 33#define TSI568_SP_MODE_PW_DIS 0x08000000
34 34
35static int 35static int
@@ -117,14 +117,19 @@ tsi568_em_init(struct rio_dev *rdev)
117 u16 destid = rdev->rswitch->destid; 117 u16 destid = rdev->rswitch->destid;
118 u8 hopcount = rdev->rswitch->hopcount; 118 u8 hopcount = rdev->rswitch->hopcount;
119 u32 regval; 119 u32 regval;
120 int portnum;
120 121
121 pr_debug("TSI568 %s [%d:%d]\n", __func__, destid, hopcount); 122 pr_debug("TSI568 %s [%d:%d]\n", __func__, destid, hopcount);
122 123
123 /* Make sure that Port-Writes are disabled (for all ports) */ 124 /* Make sure that Port-Writes are disabled (for all ports) */
124 rio_mport_read_config_32(mport, destid, hopcount, 125 for (portnum = 0;
125 TSI568_SP_MODE_BC, &regval); 126 portnum < RIO_GET_TOTAL_PORTS(rdev->swpinfo); portnum++) {
126 rio_mport_write_config_32(mport, destid, hopcount, 127 rio_mport_read_config_32(mport, destid, hopcount,
127 TSI568_SP_MODE_BC, regval | TSI568_SP_MODE_PW_DIS); 128 TSI568_SP_MODE(portnum), &regval);
129 rio_mport_write_config_32(mport, destid, hopcount,
130 TSI568_SP_MODE(portnum),
131 regval | TSI568_SP_MODE_PW_DIS);
132 }
128 133
129 return 0; 134 return 0;
130} 135}