-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extentions to RapidIO switch support: 1. modify switch route operation declarations to allow using single switch-specific file for family of switches that share the same route table operations. 2. add standard route table operations for switches that that support route table manipulation registers as defined in the Rev.1.3 of RapidIO specification. 3. add clear-route-table operation for switches 4. add CPSxx and TSIxxx families of RapidIO switches 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>
- Loading branch information
Alexandre Bounine
authored and
Linus Torvalds
committed
May 27, 2010
1 parent
f67231f
commit 07590ff
Showing
13 changed files
with
505 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# RapidIO switches configuration | ||
# | ||
config RAPIDIO_TSI57X | ||
bool "IDT Tsi57x SRIO switches support" | ||
depends on RAPIDIO | ||
---help--- | ||
Includes support for ITD Tsi57x family of serial RapidIO switches. | ||
|
||
config RAPIDIO_CPS_XX | ||
bool "IDT CPS-xx SRIO switches support" | ||
depends on RAPIDIO | ||
---help--- | ||
Includes support for ITD CPS-16/12/10/8 serial RapidIO switches. | ||
|
||
config RAPIDIO_TSI568 | ||
bool "Tsi568 SRIO switch support" | ||
depends on RAPIDIO | ||
default n | ||
---help--- | ||
Includes support for ITD Tsi568 serial RapidIO switch. | ||
|
||
config RAPIDIO_TSI500 | ||
bool "Tsi500 Parallel RapidIO switch support" | ||
depends on RAPIDIO | ||
default n | ||
---help--- | ||
Includes support for ITD Tsi500 parallel RapidIO switch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* IDT CPS RapidIO switches support | ||
* | ||
* Copyright 2009 Integrated Device Technology, Inc. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. | ||
*/ | ||
|
||
#include <linux/rio.h> | ||
#include <linux/rio_drv.h> | ||
#include <linux/rio_ids.h> | ||
#include "../rio.h" | ||
|
||
#define CPS_NO_ROUTE 0xdf | ||
|
||
static int | ||
idtcps_route_add_entry(struct rio_mport *mport, u16 destid, u8 hopcount, | ||
u16 table, u16 route_destid, u8 route_port) | ||
{ | ||
u32 result; | ||
|
||
if (table == RIO_GLOBAL_TABLE) { | ||
rio_mport_write_config_32(mport, destid, hopcount, | ||
RIO_STD_RTE_CONF_DESTID_SEL_CSR, route_destid); | ||
|
||
rio_mport_read_config_32(mport, destid, hopcount, | ||
RIO_STD_RTE_CONF_PORT_SEL_CSR, &result); | ||
|
||
result = (0xffffff00 & result) | (u32)route_port; | ||
rio_mport_write_config_32(mport, destid, hopcount, | ||
RIO_STD_RTE_CONF_PORT_SEL_CSR, result); | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
static int | ||
idtcps_route_get_entry(struct rio_mport *mport, u16 destid, u8 hopcount, | ||
u16 table, u16 route_destid, u8 *route_port) | ||
{ | ||
u32 result; | ||
|
||
if (table == RIO_GLOBAL_TABLE) { | ||
rio_mport_write_config_32(mport, destid, hopcount, | ||
RIO_STD_RTE_CONF_DESTID_SEL_CSR, route_destid); | ||
|
||
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; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
static int | ||
idtcps_route_clr_table(struct rio_mport *mport, u16 destid, u8 hopcount, | ||
u16 table) | ||
{ | ||
u32 i; | ||
|
||
if (table == RIO_GLOBAL_TABLE) { | ||
for (i = 0x80000000; i <= 0x800000ff;) { | ||
rio_mport_write_config_32(mport, destid, 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); | ||
i += 4; | ||
} | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
DECLARE_RIO_ROUTE_OPS(RIO_VID_IDT, RIO_DID_IDTCPS6Q, idtcps_route_add_entry, idtcps_route_get_entry, idtcps_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_IDT, RIO_DID_IDTCPS8, idtcps_route_add_entry, idtcps_route_get_entry, idtcps_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_IDT, RIO_DID_IDTCPS10Q, idtcps_route_add_entry, idtcps_route_get_entry, idtcps_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_IDT, RIO_DID_IDTCPS12, idtcps_route_add_entry, idtcps_route_get_entry, idtcps_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_IDT, RIO_DID_IDTCPS16, idtcps_route_add_entry, idtcps_route_get_entry, idtcps_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_IDT, RIO_DID_IDT70K200, idtcps_route_add_entry, idtcps_route_get_entry, idtcps_route_clr_table); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.