aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/include/gxio
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2013-08-01 11:36:42 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-01 17:35:50 -0400
commitf3286a3af89d6db7a488f3e8f02b98d67d50f00c (patch)
treeebe37457c3676eb8cb06ba17597134975958845d /arch/tile/include/gxio
parent6ab4ae9aadef65e2f7aca44fd963c302dcb5849e (diff)
tile: support multiple mPIPE shims in tilegx network driver
The initial driver support was for a single mPIPE shim on the chip (as is the case for the Gx36 hardware). The Gx72 chip has two mPIPE shims, so we extend the driver to handle that case. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/tile/include/gxio')
-rw-r--r--arch/tile/include/gxio/iorpc_mpipe_info.h4
-rw-r--r--arch/tile/include/gxio/mpipe.h28
2 files changed, 32 insertions, 0 deletions
diff --git a/arch/tile/include/gxio/iorpc_mpipe_info.h b/arch/tile/include/gxio/iorpc_mpipe_info.h
index 0bcf3f71ce8b..476c5e5ca22c 100644
--- a/arch/tile/include/gxio/iorpc_mpipe_info.h
+++ b/arch/tile/include/gxio/iorpc_mpipe_info.h
@@ -27,11 +27,15 @@
27#include <asm/pgtable.h> 27#include <asm/pgtable.h>
28 28
29 29
30#define GXIO_MPIPE_INFO_OP_INSTANCE_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1250)
30#define GXIO_MPIPE_INFO_OP_ENUMERATE_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1251) 31#define GXIO_MPIPE_INFO_OP_ENUMERATE_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1251)
31#define GXIO_MPIPE_INFO_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000) 32#define GXIO_MPIPE_INFO_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)
32#define GXIO_MPIPE_INFO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001) 33#define GXIO_MPIPE_INFO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)
33 34
34 35
36int gxio_mpipe_info_instance_aux(gxio_mpipe_info_context_t * context,
37 _gxio_mpipe_link_name_t name);
38
35int gxio_mpipe_info_enumerate_aux(gxio_mpipe_info_context_t * context, 39int gxio_mpipe_info_enumerate_aux(gxio_mpipe_info_context_t * context,
36 unsigned int idx, 40 unsigned int idx,
37 _gxio_mpipe_link_name_t * name, 41 _gxio_mpipe_link_name_t * name,
diff --git a/arch/tile/include/gxio/mpipe.h b/arch/tile/include/gxio/mpipe.h
index ed742e3f9562..eb7fee41c9b6 100644
--- a/arch/tile/include/gxio/mpipe.h
+++ b/arch/tile/include/gxio/mpipe.h
@@ -220,6 +220,13 @@ typedef MPIPE_PDESC_t gxio_mpipe_idesc_t;
220 */ 220 */
221typedef MPIPE_EDMA_DESC_t gxio_mpipe_edesc_t; 221typedef MPIPE_EDMA_DESC_t gxio_mpipe_edesc_t;
222 222
223/*
224 * Max # of mpipe instances. 2 currently.
225 */
226#define GXIO_MPIPE_INSTANCE_MAX HV_MPIPE_INSTANCE_MAX
227
228#define NR_MPIPE_MAX GXIO_MPIPE_INSTANCE_MAX
229
223/* Get the "va" field from an "idesc". 230/* Get the "va" field from an "idesc".
224 * 231 *
225 * This is the address at which the ingress hardware copied the first 232 * This is the address at which the ingress hardware copied the first
@@ -311,6 +318,9 @@ typedef struct {
311 /* File descriptor for calling up to Linux (and thus the HV). */ 318 /* File descriptor for calling up to Linux (and thus the HV). */
312 int fd; 319 int fd;
313 320
321 /* Corresponding mpipe instance #. */
322 int instance;
323
314 /* The VA at which configuration registers are mapped. */ 324 /* The VA at which configuration registers are mapped. */
315 char *mmio_cfg_base; 325 char *mmio_cfg_base;
316 326
@@ -1716,6 +1726,24 @@ typedef struct {
1716 uint8_t mac; 1726 uint8_t mac;
1717} gxio_mpipe_link_t; 1727} gxio_mpipe_link_t;
1718 1728
1729/* Translate a link name to the instance number of the mPIPE shim which is
1730 * connected to that link. This call does not verify whether the link is
1731 * currently available, and does not reserve any link resources;
1732 * gxio_mpipe_link_open() must be called to perform those functions.
1733 *
1734 * Typically applications will call this function to translate a link name
1735 * to an mPIPE instance number; call gxio_mpipe_init(), passing it that
1736 * instance number, to initialize the mPIPE shim; and then call
1737 * gxio_mpipe_link_open(), passing it the same link name plus the mPIPE
1738 * context, to configure the link.
1739 *
1740 * @param link_name Name of the link; see @ref gxio_mpipe_link_names.
1741 * @return The mPIPE instance number which is associated with the named
1742 * link, or a negative error code (::GXIO_ERR_NO_DEVICE) if the link does
1743 * not exist.
1744 */
1745extern int gxio_mpipe_link_instance(const char *link_name);
1746
1719/* Retrieve one of this system's legal link names, and its MAC address. 1747/* Retrieve one of this system's legal link names, and its MAC address.
1720 * 1748 *
1721 * @param index Link name index. If a system supports N legal link names, 1749 * @param index Link name index. If a system supports N legal link names,