diff options
author | Alexandre Bounine <alexandre.bounine@idt.com> | 2010-05-26 17:43:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 12:12:50 -0400 |
commit | e5cabeb3d60f9cd3e3950aff071319ae0e2d08d8 (patch) | |
tree | e866f1a9076608630a40f21f0a50c073dedb0e57 /drivers/rapidio/switches/tsi568.c | |
parent | 818a04a0bb93643d57dd8935815de2ff307b58a3 (diff) |
rapidio: add Port-Write handling for EM
Add RapidIO Port-Write message handling in the context of Error
Management Extensions Specification Rev.1.3.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Tested-by: Thomas Moll <thomas.moll@sysgo.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rapidio/switches/tsi568.c')
-rw-r--r-- | drivers/rapidio/switches/tsi568.c | 24 |
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 | |||
28 | static int | 31 | static int |
29 | tsi568_route_add_entry(struct rio_mport *mport, u16 destid, u8 hopcount, | 32 | tsi568_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 | ||
106 | DECLARE_RIO_ROUTE_OPS(RIO_VID_TUNDRA, RIO_DID_TSI568, tsi568_route_add_entry, tsi568_route_get_entry, tsi568_route_clr_table); | 109 | DECLARE_RIO_ROUTE_OPS(RIO_VID_TUNDRA, RIO_DID_TSI568, tsi568_route_add_entry, tsi568_route_get_entry, tsi568_route_clr_table); |
110 | |||
111 | static int | ||
112 | tsi568_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, ®val); | ||
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 | |||
130 | DECLARE_RIO_EM_OPS(RIO_VID_TUNDRA, RIO_DID_TSI568, tsi568_em_init, NULL); | ||