summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2010-05-26 14:44:05 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-27 09:12:51 -0700
commit679395fdaa68de39aaf2ddf7298b504fed9622d3 (patch)
tree86239253b766027f88a7675216704db31caa1f7b /drivers
parent7a88d6286240f1e8a0cf9c07252e1576169020f5 (diff)
downloadlinux-679395fdaa68de39aaf2ddf7298b504fed9622d3.tar.bz2
rapidio: use default route value for CPS switches
Fix to use correct default value for routing table entries. Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Cc: Li Yang <leoli@freescale.com> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: Thomas Moll <thomas.moll@sysgo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/rapidio/switches/idtcps.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/rapidio/switches/idtcps.c b/drivers/rapidio/switches/idtcps.c
index 73c3677e5ac6..2c790c144f89 100644
--- a/drivers/rapidio/switches/idtcps.c
+++ b/drivers/rapidio/switches/idtcps.c
@@ -15,7 +15,8 @@
#include <linux/rio_ids.h>
#include "../rio.h"
-#define CPS_NO_ROUTE 0xdf
+#define CPS_DEFAULT_ROUTE 0xde
+#define CPS_NO_ROUTE 0xdf
#define IDTCPS_RIO_DOMAIN 0xf20020
@@ -53,10 +54,11 @@ idtcps_route_get_entry(struct rio_mport *mport, u16 destid, u8 hopcount,
rio_mport_read_config_32(mport, destid, hopcount,
RIO_STD_RTE_CONF_PORT_SEL_CSR, &result);
- if (CPS_NO_ROUTE == (u8)result)
- result = RIO_INVALID_ROUTE;
-
- *route_port = (u8)result;
+ if (CPS_DEFAULT_ROUTE == (u8)result ||
+ CPS_NO_ROUTE == (u8)result)
+ *route_port = RIO_INVALID_ROUTE;
+ else
+ *route_port = (u8)result;
}
return 0;
@@ -74,9 +76,9 @@ idtcps_route_clr_table(struct rio_mport *mport, u16 destid, u8 hopcount,
RIO_STD_RTE_CONF_DESTID_SEL_CSR, i);
rio_mport_write_config_32(mport, destid, hopcount,
RIO_STD_RTE_CONF_PORT_SEL_CSR,
- (RIO_INVALID_ROUTE << 24) |
- (RIO_INVALID_ROUTE << 16) |
- (RIO_INVALID_ROUTE << 8) | RIO_INVALID_ROUTE);
+ (CPS_DEFAULT_ROUTE << 24) |
+ (CPS_DEFAULT_ROUTE << 16) |
+ (CPS_DEFAULT_ROUTE << 8) | CPS_DEFAULT_ROUTE);
i += 4;
}
}