aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rapidio/switches/tsi568.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rapidio/switches/tsi568.c')
-rw-r--r--drivers/rapidio/switches/tsi568.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/rapidio/switches/tsi568.c b/drivers/rapidio/switches/tsi568.c
index bce9112ff0d9..905cf9cb09cc 100644
--- a/drivers/rapidio/switches/tsi568.c
+++ b/drivers/rapidio/switches/tsi568.c
@@ -25,6 +25,9 @@
25#define SPP_ROUTE_CFG_DESTID(n) (0x11070 + 0x100*n) 25#define SPP_ROUTE_CFG_DESTID(n) (0x11070 + 0x100*n)
26#define SPP_ROUTE_CFG_PORT(n) (0x11074 + 0x100*n) 26#define SPP_ROUTE_CFG_PORT(n) (0x11074 + 0x100*n)
27 27
28#define TSI568_SP_MODE_BC 0x10004
29#define TSI568_SP_MODE_PW_DIS 0x08000000
30
28static int 31static int
29tsi568_route_add_entry(struct rio_mport *mport, u16 destid, u8 hopcount, 32tsi568_route_add_entry(struct rio_mport *mport, u16 destid, u8 hopcount,
30 u16 table, u16 route_destid, u8 route_port) 33 u16 table, u16 route_destid, u8 route_port)
@@ -104,3 +107,24 @@ tsi568_route_clr_table(struct rio_mport *mport, u16 destid, u8 hopcount,
104} 107}
105 108
106DECLARE_RIO_ROUTE_OPS(RIO_VID_TUNDRA, RIO_DID_TSI568, tsi568_route_add_entry, tsi568_route_get_entry, tsi568_route_clr_table); 109DECLARE_RIO_ROUTE_OPS(RIO_VID_TUNDRA, RIO_DID_TSI568, tsi568_route_add_entry, tsi568_route_get_entry, tsi568_route_clr_table);
110
111static int
112tsi568_em_init(struct rio_dev *rdev)
113{
114 struct rio_mport *mport = rdev->net->hport;
115 u16 destid = rdev->rswitch->destid;
116 u8 hopcount = rdev->rswitch->hopcount;
117 u32 regval;
118
119 pr_debug("TSI568 %s [%d:%d]\n", __func__, destid, hopcount);
120
121 /* Make sure that Port-Writes are disabled (for all ports) */
122 rio_mport_read_config_32(mport, destid, hopcount,
123 TSI568_SP_MODE_BC, &regval);
124 rio_mport_write_config_32(mport, destid, hopcount,
125 TSI568_SP_MODE_BC, regval | TSI568_SP_MODE_PW_DIS);
126
127 return 0;
128}
129
130DECLARE_RIO_EM_OPS(RIO_VID_TUNDRA, RIO_DID_TSI568, tsi568_em_init, NULL);