diff options
author | Andy Fleming <afleming@freescale.com> | 2013-07-31 23:56:25 (GMT) |
---|---|---|
committer | Andy Fleming <afleming@freescale.com> | 2013-07-31 23:56:25 (GMT) |
commit | a4460591eff829d4805dfe2bdf43c041899ad4f2 (patch) | |
tree | 11c6ba968c1bf12845e34edeb6367bea9de57feb /drivers/net/ethernet/freescale/fman | |
parent | 8db1e318905a970d3291305581021f3f9225db9b (diff) | |
parent | a8d022f84c57846be4b39ff740f86c8454c78b52 (diff) | |
download | linux-fsl-qoriq-a4460591eff829d4805dfe2bdf43c041899ad4f2.tar.xz |
Merge remote-tracking branch 'fsl_devel/sdk-kernel-3.8' into sdk1.5
Diffstat (limited to 'drivers/net/ethernet/freescale/fman')
11 files changed, 68 insertions, 35 deletions
diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Port/fm_port.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Port/fm_port.c index 6b92941..b2dbcac 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Port/fm_port.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Port/fm_port.c @@ -2444,6 +2444,17 @@ t_Handle FM_PORT_Config(t_FmPortParams *p_FmPortParams) } } +#ifdef FM_HEAVY_TRAFFIC_SEQUENCER_HANG_ERRATA_FMAN_A006981 + if ((p_FmPort->fmRevInfo.majorRev == 6) && + (p_FmPort->fmRevInfo.minorRev == 0) && + ((p_FmPort->portType == e_FM_PORT_TYPE_OH_OFFLINE_PARSING) || + (p_FmPort->portType == e_FM_PORT_TYPE_TX))) + { + p_FmPort->openDmas.num = 16; + p_FmPort->openDmas.extra = 0; + } +#endif /* FM_HEAVY_TRAFFIC_SEQUENCER_HANG_ERRATA_FMAN_A006981 */ + if (p_FmPort->portType == e_FM_PORT_TYPE_OH_HOST_COMMAND) p_FmPort->p_FmPortDriverParam->syncReq = DEFAULT_PORT_syncReqForHc; else diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c index 2fdc4c8..a44bdab 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c @@ -3313,6 +3313,10 @@ t_Error FmSetNumOfOpenDmas(t_Handle h_Fm, p_Fm->p_FmStateStruct->fmId)); #else if ((p_Fm->p_FmStateStruct->revInfo.majorRev >= 6) && +#ifdef FM_HEAVY_TRAFFIC_SEQUENCER_HANG_ERRATA_FMAN_A006981 + !((p_Fm->p_FmStateStruct->revInfo.majorRev == 6) && + (p_Fm->p_FmStateStruct->revInfo.minorRev == 0)) && +#endif /* FM_HEAVY_TRAFFIC_SEQUENCER_HANG_ERRATA_FMAN_A006981 */ (p_Fm->p_FmStateStruct->accumulatedNumOfOpenDmas - oldVal + numOfOpenDmas > DMA_THRESH_MAX_COMMQ + 1)) RETURN_ERROR(MAJOR, E_NOT_AVAILABLE, ("Requested numOfOpenDmas for fm%d exceeds DMA Command queue (%d)", diff --git a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_pcd_ext.h b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_pcd_ext.h index 60edfd2..e2199e4 100644 --- a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_pcd_ext.h +++ b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_pcd_ext.h @@ -99,16 +99,6 @@ #define FM_PCD_SW_PRS_SIZE 0x00000800 /**< Total size of SW parser area */ #define FM_PCD_PRS_SW_OFFSET 0x00000040 /**< Size of illegal addresses at the beginning of the SW parser area */ -#if (DPAA_VERSION >= 11) -#define FM_PCD_PRS_SW_PATCHES_SIZE 0x00000240 /**< Number of bytes saved for patches */ -#else -#define FM_PCD_PRS_SW_PATCHES_SIZE 0x00000200 /**< Number of bytes saved for patches */ -#endif /* (DPAA_VERSION >= 11) */ - -#define FM_PCD_PRS_SW_TAIL_SIZE 4 /**< Number of bytes that must be cleared at - the end of the SW parser area */ -#define FM_SW_PRS_MAX_IMAGE_SIZE (FM_PCD_SW_PRS_SIZE-FM_PCD_PRS_SW_OFFSET-FM_PCD_PRS_SW_TAIL_SIZE-FM_PCD_PRS_SW_PATCHES_SIZE) - /**< Maximum size of SW parser code */ #define FM_PCD_MAX_MANIP_INSRT_TEMPLATE_SIZE 128 /**< Maximum size of insertion template for insert manipulation */ diff --git a/drivers/net/ethernet/freescale/fman/inc/integrations/T4240/dpaa_integration_ext.h b/drivers/net/ethernet/freescale/fman/inc/integrations/T4240/dpaa_integration_ext.h index 83ae8ba..52ed8f8 100644 --- a/drivers/net/ethernet/freescale/fman/inc/integrations/T4240/dpaa_integration_ext.h +++ b/drivers/net/ethernet/freescale/fman/inc/integrations/T4240/dpaa_integration_ext.h @@ -261,6 +261,7 @@ typedef enum #define FM_WRONG_RESET_VALUES_ERRATA_FMAN_A005127 #define FM_RX_FIFO_CORRUPT_ERRATA_10GMAC_A006320 #define FM_OP_NO_VSP_NO_RELEASE_ERRATA_FMAN_A006675 +#define FM_HEAVY_TRAFFIC_SEQUENCER_HANG_ERRATA_FMAN_A006981 #define FM_BCB_ERRATA_BMI_SW001 #define FM_LEN_CHECK_ERRATA_FMAN_SW002 diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.h b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.h index d89327c..feab96f 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.h +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.h @@ -228,6 +228,7 @@ typedef struct { struct device_attribute *dev_pcd_attr_stats; struct device_attribute *dev_pcd_attr_regs; + struct device_attribute *dev_attr_muram_free_size; struct qman_fq *hc_tx_conf_fq, *hc_tx_err_fq, *hc_tx_fq; } t_LnxWrpFmDev; 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 f9a8e26..519c443 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 @@ -124,18 +124,6 @@ #error Error: please synchronize IOC_ defines! #endif -#if CMP_IOC_DEFINE(FM_PCD_PRS_SW_PATCHES_SIZE) -#error Error: please synchronize IOC_ defines! -#endif - -#if CMP_IOC_DEFINE(FM_PCD_PRS_SW_TAIL_SIZE) -#error Error: please synchronize IOC_ defines! -#endif - -#if CMP_IOC_DEFINE(FM_SW_PRS_MAX_IMAGE_SIZE) -#error Error: please synchronize IOC_ defines! -#endif - #if CMP_IOC_DEFINE(FM_PCD_MAX_MANIP_INSRT_TEMPLATE_SIZE) #error Error: please synchronize IOC_ defines! #endif diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.c index 7e29867..68142b6 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.c @@ -909,8 +909,8 @@ void compat_copy_keys( #if (DPAA_VERSION >= 11) memcpy(¶m->frame_length_ranges, &compat_param->frame_length_ranges, - sizeof(param->frame_length_ranges[0] * - IOC_FM_PCD_CC_STATS_MAX_NUM_OF_FLR)); + sizeof(param->frame_length_ranges[0]) * + IOC_FM_PCD_CC_STATS_MAX_NUM_OF_FLR); #endif /* (DPAA_VERSION >= 11) */ } else { diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.h b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.h index 288777a..f8655db 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.h +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.h @@ -52,7 +52,7 @@ /* mapping kernel pointers w/ UserSpace id's { */ /* Because compat_ptr(ptr_to_compat(X)) != X, this way we cannot exchange pointers back and forth (US - KS). compat_ptr is a cast and pointers are broken. */ -#define COMPAT_PTR2ID_ARRAY_MAX (256+1) /* first location is not used */ +#define COMPAT_PTR2ID_ARRAY_MAX (512+1) /* first location is not used */ #define COMPAT_PTR2ID_WATERMARK 0xface0000 #define COMPAT_PTR2ID_WM_MASK 0xffff0000 diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_sysfs_fm.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_sysfs_fm.c index 2cfc0b9..9237688 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_sysfs_fm.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_sysfs_fm.c @@ -308,6 +308,37 @@ static ssize_t show_fm_stats(struct device *dev, return n; } +static ssize_t show_fm_muram_free_size(struct device *dev, + struct device_attribute *attr, char *buf) +{ + t_LnxWrpFmDev *p_LnxWrpFmDev = NULL; + unsigned long flags = 0; + unsigned n = 0; + uint64_t muram_free_size = 0; + + if (attr == NULL || buf == NULL || dev == NULL) + return -EINVAL; + + p_LnxWrpFmDev = (t_LnxWrpFmDev *) dev_get_drvdata(dev); + if (WARN_ON(p_LnxWrpFmDev == NULL)) + return -EINVAL; + + if (!p_LnxWrpFmDev->active || !p_LnxWrpFmDev->h_Dev) + return -EIO; + + muram_free_size = FM_MURAM_GetFreeMemSize(p_LnxWrpFmDev->h_MuramDev); + + local_irq_save(flags); + + n = snprintf(buf, PAGE_SIZE, "\tFM %d muram_free_size: %lld\n", + p_LnxWrpFmDev->id, muram_free_size); + + local_irq_restore(flags); + + return n; +} + + static ssize_t show_fm_pcd_stats(struct device *dev, struct device_attribute *attr, char *buf) { @@ -530,6 +561,7 @@ static ssize_t show_pcd_regs(struct device *dev, static DEVICE_ATTR(fm_regs, S_IRUGO, show_fm_regs, NULL); static DEVICE_ATTR(fm_pcd_regs, S_IRUGO, show_pcd_regs, NULL); +static DEVICE_ATTR(fm_muram_free_size, S_IRUGO, show_fm_muram_free_size, NULL); int fm_sysfs_create(struct device *dev) { @@ -543,6 +575,7 @@ int fm_sysfs_create(struct device *dev) /* store to remove them when module is disabled */ p_LnxWrpFmDev->dev_attr_regs = &dev_attr_fm_regs; p_LnxWrpFmDev->dev_pcd_attr_regs = &dev_attr_fm_pcd_regs; + p_LnxWrpFmDev->dev_attr_muram_free_size = &dev_attr_fm_muram_free_size; /* Create sysfs statistics group for FM module */ if (sysfs_create_group(&dev->kobj, &fm_dev_stats_attr_grp) != 0) @@ -553,6 +586,10 @@ int fm_sysfs_create(struct device *dev) device_create_file(dev, &dev_attr_fm_pcd_regs) != 0) return -EIO; + /* muram free size */ + if (device_create_file(dev, &dev_attr_fm_muram_free_size) != 0 ) + return -EIO; + return 0; } @@ -570,4 +607,5 @@ void fm_sysfs_destroy(struct device *dev) sysfs_remove_group(&dev->kobj, &fm_dev_stats_attr_grp); device_remove_file(dev, p_LnxWrpFmDev->dev_attr_regs); device_remove_file(dev, p_LnxWrpFmDev->dev_pcd_attr_regs); + device_remove_file(dev, p_LnxWrpFmDev->dev_attr_muram_free_size); } diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_sysfs_fm_port.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_sysfs_fm_port.c index 97dacb7..cab44ef 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_sysfs_fm_port.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_sysfs_fm_port.c @@ -147,10 +147,9 @@ static ssize_t show_fm_port_stats(struct device *dev, } local_irq_save(flags); - n = snprintf(buf, PAGE_SIZE, "\tFM %d Port %d counter: %d\n", - p_LnxWrpFmDev->id, - p_LnxWrpFmPortDev->id, - FM_PORT_GetCounter(p_LnxWrpFmPortDev->h_Dev, + n = snprintf(buf, PAGE_SIZE, "\t%s counter: %d\n", + p_LnxWrpFmPortDev->name, + FM_PORT_GetCounter(p_LnxWrpFmPortDev->h_Dev, (e_FmPortCounters) counter)); local_irq_restore(flags); @@ -223,8 +222,8 @@ static struct attribute *fm_oh_port_dev_stats_attributes[] = { &dev_attr_port_deq_total.attr, &dev_attr_port_deq_from_default.attr, &dev_attr_port_deq_confirm.attr, - /*RX*/ &dev_attr_port_rx_bad_frame.attr, - &dev_attr_port_rx_large_frame.attr, + /* &dev_attr_port_rx_bad_frame.attr, */ + /* &dev_attr_port_rx_large_frame.attr, */ &dev_attr_port_rx_out_of_buffers_discard.attr, /*&dev_attr_port_rx_filter_frame.attr, */ NULL diff --git a/drivers/net/ethernet/freescale/fman/src/xx/xx_linux.c b/drivers/net/ethernet/freescale/fman/src/xx/xx_linux.c index 9c2371d..132459b 100644 --- a/drivers/net/ethernet/freescale/fman/src/xx/xx_linux.c +++ b/drivers/net/ethernet/freescale/fman/src/xx/xx_linux.c @@ -168,7 +168,7 @@ void XX_Print(char *str, ...) #ifdef CONFIG_SMP if (vsnprintf (buf, BUF_SIZE, str, args) >= BUF_SIZE) printk(KERN_WARNING "Illegal string to print!\n more than %d characters.\n\tString was not printed completelly.\n", BUF_SIZE); - printk (KERN_CRIT "cpu%d: %s",raw_smp_processor_id(), buf); + printk(KERN_CRIT "cpu%d/%d: %s", get_hard_smp_processor_id(raw_smp_processor_id()), raw_smp_processor_id(), buf); #else vprintk(str, args); #endif /* CONFIG_SMP */ @@ -186,7 +186,8 @@ void XX_Fprint(void *file, char *str, ...) #ifdef CONFIG_SMP if (vsnprintf (buf, BUF_SIZE, str, args) >= BUF_SIZE) printk(KERN_WARNING "Illegal string to print!\n more than %d characters.\n\tString was not printed completelly.\n", BUF_SIZE); - printk (KERN_CRIT "cpu%d: %s", raw_smp_processor_id(), buf); + printk (KERN_CRIT "cpu%d/%d: %s",hard_smp_processor_id(), smp_processor_id(), buf); + #else vprintk(str, args); #endif /* CONFIG_SMP */ @@ -353,14 +354,14 @@ uint32_t XX_DisableAllIntr(void) { unsigned long flags; - local_irq_save(flags); + local_irq_save_nort(flags); return (uint32_t)flags; } void XX_RestoreAllIntr(uint32_t flags) { - local_irq_restore((unsigned long)flags); + local_irq_restore_nort((unsigned long)flags); } t_Error XX_Call( uint32_t qid, t_Error (* f)(t_Handle), t_Handle id, t_Handle appId, uint16_t flags ) |