diff options
author | Mandy Lavi <mandy.lavi@freescale.com> | 2014-11-19 06:42:16 (GMT) |
---|---|---|
committer | Matthew Weigel <Matthew.Weigel@freescale.com> | 2014-12-11 18:41:07 (GMT) |
commit | ba7b5732b312eb4b4584a4f2766e562fcee08c06 (patch) | |
tree | ebfe97531e7efd31e90f6bfca20cb09226b787ee /drivers/net/ethernet/freescale/fman/src/wrapper | |
parent | abfec970cb0f8384e9b10eef316393a2339e2d64 (diff) | |
download | linux-fsl-qoriq-ba7b5732b312eb4b4584a4f2766e562fcee08c06.tar.xz |
fmd: add support for t1024 features
Change-Id: I37dbffe63e57af8a783b251d0f78087400b09d99
Signed-off-by: Mandy Lavi <mandy.lavi@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/23940
Reviewed-by: Eyal Harari <Eyal.Harari@freescale.com>
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Nir Erez <nir.erez@freescale.com>
Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/fman/src/wrapper')
-rw-r--r-- | drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm_port.c | 32 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c | 10 |
2 files changed, 38 insertions, 4 deletions
diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm_port.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm_port.c index af31390..f5f51b2 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm_port.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm_port.c @@ -51,6 +51,7 @@ #include <linux/cdev.h> #include <linux/slab.h> #include <linux/spinlock.h> +#include <asm/mpc85xx.h> #include "sprint_ext.h" #include "fm_common.h" @@ -81,6 +82,8 @@ do {\ } \ } while (0) +#define IS_T1023_T1024 (SVR_SOC_VER(mfspr(SPRN_SVR)) == SVR_T1024 || \ + SVR_SOC_VER(mfspr(SPRN_SVR)) == SVR_T1023) static volatile int hcFrmRcv/* = 0 */; static spinlock_t lock; @@ -355,6 +358,8 @@ static t_LnxWrpFmPortDev *ReadFmPortDevTreeNode(struct platform_device } p_LnxWrpFmPortDev = &p_LnxWrpFmDev->txPorts[*uint32_prop + FM_MAX_NUM_OF_1G_TX_PORTS]; + if (IS_T1023_T1024) + p_LnxWrpFmPortDev = &p_LnxWrpFmDev->txPorts[*uint32_prop]; p_LnxWrpFmPortDev->id = *uint32_prop; p_LnxWrpFmPortDev->settings.param.portId = @@ -398,6 +403,9 @@ static t_LnxWrpFmPortDev *ReadFmPortDevTreeNode(struct platform_device p_LnxWrpFmPortDev = &p_LnxWrpFmDev->rxPorts[*uint32_prop + FM_MAX_NUM_OF_1G_RX_PORTS]; + if (IS_T1023_T1024) + p_LnxWrpFmPortDev = &p_LnxWrpFmDev->rxPorts[*uint32_prop]; + p_LnxWrpFmPortDev->id = *uint32_prop; p_LnxWrpFmPortDev->settings.param.portId = p_LnxWrpFmPortDev->id; @@ -685,9 +693,11 @@ static t_Error CheckNSetFmPortAdvArgs (t_LnxWrpFmPortDev *p_LnxWrpFmPortDev) if (p_LnxWrpFmPortDev->settings.param.portType != e_FM_PORT_TYPE_OH_OFFLINE_PARSING) { portId = fmVspParams.portParams.portId; - if (p_LnxWrpFmPortDev->settings.param.portType == e_FM_PORT_TYPE_RX_10G) - portId += FM_MAX_NUM_OF_1G_RX_PORTS; - portVSPAllocParams.h_FmTxPort = + if (p_LnxWrpFmPortDev->settings.param.portType == e_FM_PORT_TYPE_RX_10G){ + if (!(IS_T1023_T1024)) + portId += FM_MAX_NUM_OF_1G_RX_PORTS; + } + portVSPAllocParams.h_FmTxPort = p_LnxWrpFmDev->txPorts[portId].h_Dev; fmVspParams.liodnOffset = p_LnxWrpFmDev->rxPorts[portId].settings.param.specificParams.rxParams.liodnOffset; @@ -1260,6 +1270,14 @@ static int /*__devinit*/ fm_port_probe(struct platform_device *of_dev) p_LnxWrpFmPortDev->minor = p_LnxWrpFmPortDev->id + FM_MAX_NUM_OF_1G_RX_PORTS + DEV_FM_RX_PORTS_MINOR_BASE; + if (IS_T1023_T1024) { + Sprint(p_LnxWrpFmPortDev->name, "%s-port-rx%d", + p_LnxWrpFmDev->name, + p_LnxWrpFmPortDev->id); + p_LnxWrpFmPortDev->minor = + p_LnxWrpFmPortDev->id + + DEV_FM_RX_PORTS_MINOR_BASE; + } } else if (p_LnxWrpFmPortDev->settings.param.portType == e_FM_PORT_TYPE_TX) { Sprint(p_LnxWrpFmPortDev->name, "%s-port-tx%d", @@ -1274,6 +1292,14 @@ static int /*__devinit*/ fm_port_probe(struct platform_device *of_dev) p_LnxWrpFmPortDev->minor = p_LnxWrpFmPortDev->id + FM_MAX_NUM_OF_1G_TX_PORTS + DEV_FM_TX_PORTS_MINOR_BASE; + if (IS_T1023_T1024) { + Sprint(p_LnxWrpFmPortDev->name, "%s-port-tx%d", + p_LnxWrpFmDev->name, + p_LnxWrpFmPortDev->id); + p_LnxWrpFmPortDev->minor = + p_LnxWrpFmPortDev->id + + DEV_FM_TX_PORTS_MINOR_BASE; + } } else if (p_LnxWrpFmPortDev->settings.param.portType == e_FM_PORT_TYPE_OH_HOST_COMMAND) { Sprint(p_LnxWrpFmPortDev->name, "%s-port-oh%d", diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c index 8fa4c89..4161a23 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c @@ -60,6 +60,7 @@ #include <asm/uaccess.h> #include <asm/errno.h> #include <sysdev/fsl_soc.h> +#include <asm/mpc85xx.h> #if defined(CONFIG_COMPAT) #include <linux/compat.h> @@ -71,6 +72,9 @@ #include "fm_port_ioctls.h" #include "fm_vsp_ext.h" +#define IS_T1023_T1024 (SVR_SOC_VER(mfspr(SPRN_SVR)) == SVR_T1024 || \ + SVR_SOC_VER(mfspr(SPRN_SVR)) == SVR_T1023) + #define __ERR_MODULE__ MODULE_FM #if defined(CONFIG_COMPAT) @@ -1431,7 +1435,11 @@ Status: feature not supported case (e_IOC_FM_PORT_TYPE_RX_10G): if (port_params->port_id < FM_MAX_NUM_OF_10G_RX_PORTS) { - h_Port = p_LnxWrpFmDev->rxPorts[port_params->port_id + FM_MAX_NUM_OF_1G_RX_PORTS].h_Dev; + if (IS_T1023_T1024) { + h_Port = p_LnxWrpFmDev->rxPorts[port_params->port_id].h_Dev; + } else { + h_Port = p_LnxWrpFmDev->rxPorts[port_params->port_id + FM_MAX_NUM_OF_1G_RX_PORTS].h_Dev; + } break; } goto invalid_port_id; |