From 73446619979cd97a46f6efad43e53e905b58213e Mon Sep 17 00:00:00 2001 From: Marian-Cristian Rotariu Date: Wed, 29 Apr 2015 11:29:59 +0300 Subject: dpaa_eth: fix symbols for dynamic driver modules This patch fixes the dependencies between several DPAA Ethernet driver modules by exporting the needed functions as kernel symbols. Signed-off-by: Marian-Cristian Rotariu Change-Id: Idf7525add92bfd20738eaac0b9d43ed62d7de0af Reviewed-on: http://git.am.freescale.net:8181/35747 Reviewed-by: Cristian-Constantin Sovaiala Reviewed-by: Madalin-Cristian Bucur diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c index 327246c..06ada5f 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c @@ -821,6 +821,7 @@ void dpa_bp_drain(struct dpa_bp *bp) } } while (ret > 0); } +EXPORT_SYMBOL(dpa_bp_drain); static void __cold __attribute__((nonnull)) _dpa_bp_free(struct dpa_bp *dpa_bp) diff --git a/drivers/net/ethernet/freescale/dpa/mac-api.c b/drivers/net/ethernet/freescale/dpa/mac-api.c index c9866db..3b93ddc 100644 --- a/drivers/net/ethernet/freescale/dpa/mac-api.c +++ b/drivers/net/ethernet/freescale/dpa/mac-api.c @@ -818,6 +818,7 @@ int fm_mac_dump_rx_stats(struct mac_device *h_mac, char *buf, int nn) return n; } +EXPORT_SYMBOL(fm_mac_dump_rx_stats); int fm_mac_dump_tx_stats(struct mac_device *h_mac, char *buf, int nn) { @@ -828,6 +829,7 @@ int fm_mac_dump_tx_stats(struct mac_device *h_mac, char *buf, int nn) return n; } +EXPORT_SYMBOL(fm_mac_dump_tx_stats); static void __cold setup_dtsec(struct mac_device *mac_dev) { -- cgit v0.10.2 From c3daec44cca63898ba70fb8b8a223392d3c209d4 Mon Sep 17 00:00:00 2001 From: Marian-Cristian Rotariu Date: Wed, 6 May 2015 11:19:55 +0300 Subject: onic: fix debugfs remove procedure Signed-off-by: Marian-Cristian Rotariu Change-Id: I2023fbdc7419aecdef5386933e86083daeb40d91 Reviewed-on: http://git.am.freescale.net:8181/35993 Reviewed-by: Madalin-Cristian Bucur diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_generic_debugfs.c b/drivers/net/ethernet/freescale/dpa/dpaa_generic_debugfs.c index 2b655cd..b53c289 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_generic_debugfs.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_generic_debugfs.c @@ -247,7 +247,7 @@ int dpa_generic_debugfs_create(struct net_device *net_dev) void dpa_generic_debugfs_remove(struct net_device *net_dev) { - struct dpa_priv_s *priv = netdev_priv(net_dev); + struct dpa_generic_priv_s *priv = netdev_priv(net_dev); debugfs_remove(priv->debugfs_file); } -- cgit v0.10.2 From 303990f99f84220044d666da814857dc593af624 Mon Sep 17 00:00:00 2001 From: Marian-Cristian Rotariu Date: Wed, 6 May 2015 11:23:18 +0300 Subject: dpaa_eth: fix unload procedure for onic This patch fixes the module unload for onic in the context of creating the DPAA Ethernet drivers as dynamic kernel modules that can be loaded/unloaded at runtime. Change-Id: Ib813d4c99869a09875a3dc9d07f6fcb9b5bb65e2 Signed-off-by: Marian-Cristian Rotariu Reviewed-on: http://git.am.freescale.net:8181/35781 Reviewed-by: Madalin-Cristian Bucur diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c index 970e7c8..5bb4af0 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c @@ -1347,6 +1347,46 @@ static int dpa_generic_bp_create(struct net_device *net_dev, return 0; } +static void dpa_generic_bp_free(struct dpa_generic_priv_s *priv) +{ + struct dpa_bp *bp = NULL; + int i = 0; + + /* release the rx bpools */ + for (i = 0; i < priv->rx_bp_count; i++) { + bp = &priv->rx_bp[i]; + if (!bp) + continue; + + if (!atomic_dec_and_test(&bp->refs)) + continue; + + if (bp->free_buf_cb) + dpa_bp_drain(bp); + + bman_free_pool(bp->pool); + + if (bp->dev) + platform_device_unregister(to_platform_device(bp->dev)); + } + + /* release the tx draining bpool */ + bp = priv->draining_tx_bp; + if (!bp) + return; + + if (!atomic_dec_and_test(&bp->refs)) + return; + + if (bp->free_buf_cb) + dpa_bp_drain(bp); + + bman_free_pool(bp->pool); + + if (bp->dev) + platform_device_unregister(to_platform_device(bp->dev)); +} + static int dpa_generic_remove(struct platform_device *of_dev) { int err; @@ -1363,22 +1403,11 @@ static int dpa_generic_remove(struct platform_device *of_dev) dev_set_drvdata(dev, NULL); unregister_netdev(net_dev); - /* TODO: this is for private driver; make it generic */ - err = 0; -#if 0 err = dpa_fq_free(dev, &priv->dpa_fq_list); -#endif - dpa_private_napi_del(net_dev); + dpa_generic_napi_del(net_dev); - /* TODO: this is for private dirver also; make generic */ -#if 0 - dpa_bp_free(priv); - devm_kfree(dev, priv->dpa_bp); - - if (priv->buf_layout) - devm_kfree(dev, priv->buf_layout); -#endif + dpa_generic_bp_free(priv); #ifdef CONFIG_FSL_DPAA_ETH_DEBUGFS dpa_generic_debugfs_remove(net_dev); -- cgit v0.10.2 From 75fa2a4a3309c181dd64a1a7ded69ab0615b646c Mon Sep 17 00:00:00 2001 From: Mandy Lavi Date: Thu, 30 Apr 2015 17:04:21 +0900 Subject: fmd: add replication of relative_storage_profile_id in compat layer Change-Id: I408d577d952f3ce9237dce1105ef1e577ad2cc6b Signed-off-by: Mandy Lavi Reviewed-on: http://git.am.freescale.net:8181/35819 Reviewed-by: Eyal Harari Reviewed-by: Honghua Yin Tested-by: Honghua Yin 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 b5ffe5c..ea0885a 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 @@ -310,12 +310,18 @@ static inline void compat_copy_fm_pcd_cc_next_kg( { param->new_fqid = compat_param->new_fqid; param->override_fqid = compat_param->override_fqid; +#if DPAA_VERSION >= 11 + param->new_relative_storage_profile_id = compat_param->new_relative_storage_profile_id; +#endif param->p_direct_scheme = compat_pcd_id2ptr(compat_param->p_direct_scheme); } else { compat_param->new_fqid = param->new_fqid; compat_param->override_fqid = param->override_fqid; +#if DPAA_VERSION >= 11 + compat_param->new_relative_storage_profile_id = param->new_relative_storage_profile_id; +#endif compat_param->p_direct_scheme = compat_pcd_ptr2id(param->p_direct_scheme); } -- cgit v0.10.2 From d345eaf21d8c9b032d8e9d6facf316a2b2b90ef5 Mon Sep 17 00:00:00 2001 From: Mandy Lavi Date: Wed, 6 May 2015 21:16:54 +0900 Subject: fmd: fix total-fifo-size related error messages Change-Id: Ibb15bb7b55678030e577c7ec6e0f0980b49e985b Signed-off-by: Mandy Lavi Reviewed-on: http://git.am.freescale.net:8181/36009 Reviewed-by: Eyal Harari Reviewed-by: Honghua Yin Tested-by: Honghua Yin diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c index 16dd8aa..fe05428 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c @@ -153,7 +153,7 @@ static t_Error CheckFmParameters(t_Fm *p_Fm) if (!p_Fm->p_FmStateStruct->totalFifoSize || (p_Fm->p_FmStateStruct->totalFifoSize > BMI_MAX_FIFO_SIZE)) RETURN_ERROR(MAJOR, E_INVALID_VALUE, - ("totalFifoSize (curr - %d) has to be in the range 256 - %d", + ("totalFifoSize (currently defined as %d) has to be in the range of 256 to %d", p_Fm->p_FmStateStruct->totalFifoSize, BMI_MAX_FIFO_SIZE)); if (!p_Fm->p_FmStateStruct->totalNumOfTasks || @@ -2637,8 +2637,15 @@ t_Error FmSetSizeOfFifo(t_Handle h_Fm, /* check that there are enough uncommitted fifo size */ if ((p_Fm->p_FmStateStruct->accumulatedFifoSize - currentVal + sizeOfFifo) > - (p_Fm->p_FmStateStruct->totalFifoSize - p_Fm->p_FmStateStruct->extraFifoPoolSize)) - RETURN_ERROR(MAJOR, E_NOT_AVAILABLE, ("Requested fifo size and extra size exceed total FIFO size.")); + (p_Fm->p_FmStateStruct->totalFifoSize - p_Fm->p_FmStateStruct->extraFifoPoolSize)){ + REPORT_ERROR(MAJOR, E_INVALID_VALUE, + ("Port request fifo size + accumulated size > total FIFO size:")); + RETURN_ERROR(MAJOR, E_INVALID_VALUE, + ("port 0x%x requested %d bytes, extra size = %d, accumulated size = %d total size = %d", + hardwarePortId, sizeOfFifo, p_Fm->p_FmStateStruct->extraFifoPoolSize, + p_Fm->p_FmStateStruct->accumulatedFifoSize, + p_Fm->p_FmStateStruct->totalFifoSize)); + } else { /* update accumulated */ -- cgit v0.10.2 From c9770fdc0629546a00dff1a1ad2d14a009abeeb7 Mon Sep 17 00:00:00 2001 From: Hou Zhiqiang Date: Thu, 23 Apr 2015 18:49:16 +0800 Subject: powerpc/corenet64_smp_defconfig: Enable spi-nor framework Enable CONFIG_MTD_SPI_NOR_BASE for corenet64_smp_defconfig. Verified on P5040DS. Signed-off-by: Hou Zhiqiang Change-Id: I534c2bf9d18ef330d14c4d7ed79dcfeb5185d562 Reviewed-on: http://git.am.freescale.net:8181/35462 Tested-by: Review Code-CDREVIEW Reviewed-by: Mingkai Hu Reviewed-by: Honghua Yin diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig index c063a2c..39df852 100644 --- a/arch/powerpc/configs/corenet64_smp_defconfig +++ b/arch/powerpc/configs/corenet64_smp_defconfig @@ -93,6 +93,7 @@ CONFIG_MTD_NAND=y CONFIG_MTD_NAND_IDS=y CONFIG_MTD_NAND_FSL_ELBC=y CONFIG_MTD_NAND_FSL_IFC=y +CONFIG_MTD_SPI_NOR_BASE=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MTD_UBI_BEB_RESERVE=1 -- cgit v0.10.2 From e7ae9f858ea2603976a9d326f56c0794cfcaaeba Mon Sep 17 00:00:00 2001 From: Nikhil Badola Date: Mon, 11 May 2015 13:15:18 +0530 Subject: drivers:usb:fsl: Check memory resource before releasing it Check memory resource existence before releasing it to avoid NULL pointer dereference Signed-off-by: Nikhil Badola Change-Id: I1f34b13e1669a3271250205c788e74b3228477e8 Reviewed-on: http://git.am.freescale.net:8181/36193 Tested-by: Review Code-CDREVIEW Reviewed-by: Honghua Yin diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 12dc799..16aa821 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -2554,7 +2554,7 @@ static int __exit fsl_udc_remove(struct platform_device *pdev) dma_pool_destroy(udc_controller->td_pool); free_irq(udc_controller->irq, udc_controller); iounmap(dr_regs); - if (pdata->operating_mode == FSL_USB2_DR_DEVICE) + if (res && (pdata->operating_mode == FSL_USB2_DR_DEVICE)) release_mem_region(res->start, resource_size(res)); /* free udc --wait for the release() finished */ -- cgit v0.10.2 From 0f011fea61de2dc9d2da3e30c7e96c4cbec8c758 Mon Sep 17 00:00:00 2001 From: Nikhil Badola Date: Mon, 11 May 2015 13:19:09 +0530 Subject: drivers:usb:fsl: Remove unused variable Remove unused variable td_complete Signed-off-by: Nikhil Badola Change-Id: I5e16b5ff77577db19ddd5f231603aba78bbaaa6d Reviewed-on: http://git.am.freescale.net:8181/36195 Tested-by: Review Code-CDREVIEW Reviewed-by: Ramneek Mehresh Reviewed-by: Honghua Yin diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 16aa821..c60a512 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -1594,14 +1594,13 @@ static int process_ep_req(struct fsl_udc *udc, int pipe, struct fsl_req *curr_req) { struct ep_td_struct *curr_td; - int td_complete, actual, remaining_length, j, tmp; + int actual, remaining_length, j, tmp; int status = 0; int errors = 0; struct ep_queue_head *curr_qh = &udc->ep_qh[pipe]; int direction = pipe % 2; curr_td = curr_req->head; - td_complete = 0; actual = curr_req->req.length; for (j = 0; j < curr_req->dtd_count; j++) { @@ -1646,11 +1645,9 @@ static int process_ep_req(struct fsl_udc *udc, int pipe, status = -EPROTO; break; } else { - td_complete++; break; } } else { - td_complete++; VDBG("dTD transmitted successful"); } -- cgit v0.10.2 From adee53c1ffdaaf23765ef7666cecbb300f4328e7 Mon Sep 17 00:00:00 2001 From: Nikhil Badola Date: Mon, 11 May 2015 17:21:27 +0530 Subject: drivers:usb:fsl: Correct endpoint name checking Endpoint name being statically defined cannot be NULL hence checking name's first two character with "ep" for endpoint validity Signed-off-by: Nikhil Badola Change-Id: I1fc6b71fce4807fdc18a96db0182c15dd9e3c649 Reviewed-on: http://git.am.freescale.net:8181/36196 Tested-by: Review Code-CDREVIEW Reviewed-by: Ramneek Mehresh Reviewed-by: Honghua Yin diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index c60a512..aee03cb 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -1690,7 +1690,7 @@ static void dtd_complete_irq(struct fsl_udc *udc) curr_ep = get_ep_by_pipe(udc, i); /* If the ep is configured */ - if (curr_ep->name == NULL) { + if (strncmp(curr_ep->name, "ep", 2)) { WARNING("Invalid EP?"); continue; } -- cgit v0.10.2 From 2ad3b8b1b21ccf675403433f936b1b9ac8bb792a Mon Sep 17 00:00:00 2001 From: Nikhil Badola Date: Mon, 11 May 2015 17:48:31 +0530 Subject: drivers:usb:fsl: Compile out USB clk functions Compile out USB clk functions for PPC platforms as there is no usb clk specific initialization on any of these platforms Signed-off-by: Nikhil Badola Change-Id: I766a30c6584b56d7105f7c080440ba5acb3f62a8 Reviewed-on: http://git.am.freescale.net:8181/36197 Tested-by: Review Code-CDREVIEW Reviewed-by: Ramneek Mehresh Reviewed-by: Honghua Yin diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index aee03cb..638a345 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -2401,10 +2401,12 @@ static int __init fsl_udc_probe(struct platform_device *pdev) usb_sys_regs = (void *)dr_regs + USB_DR_SYS_OFFSET; #endif +#ifdef CONFIG_ARCH_MXC /* Initialize USB clocks */ ret = fsl_udc_clk_init(pdev); if (ret < 0) goto err_iounmap_noclk; +#endif /* Read Device Controller Capability Parameters register */ dccparams = fsl_readl(&dr_regs->dccparams); @@ -2444,9 +2446,11 @@ static int __init fsl_udc_probe(struct platform_device *pdev) dr_controller_setup(udc_controller); } +#ifdef CONFIG_ARCH_MXC ret = fsl_udc_clk_finalize(pdev); if (ret) goto err_free_irq; +#endif /* Setup gadget structure */ udc_controller->gadget.ops = &fsl_gadget_ops; @@ -2510,7 +2514,9 @@ err_free_irq: err_iounmap: if (pdata->exit) pdata->exit(pdev); +#ifdef CONFIG_ARCH_MXC fsl_udc_clk_release(); +#endif err_iounmap_noclk: iounmap(dr_regs); err_release_mem_region: @@ -2538,8 +2544,9 @@ static int __exit fsl_udc_remove(struct platform_device *pdev) udc_controller->done = &done; usb_del_gadget_udc(&udc_controller->gadget); +#ifdef CONFIG_ARCH_MXC fsl_udc_clk_release(); - +#endif /* DR has been stopped in usb_gadget_unregister_driver() */ remove_proc_file(); diff --git a/drivers/usb/gadget/fsl_usb2_udc.h b/drivers/usb/gadget/fsl_usb2_udc.h index e4c4c01..0f120be 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.h +++ b/drivers/usb/gadget/fsl_usb2_udc.h @@ -598,18 +598,6 @@ struct platform_device; int fsl_udc_clk_init(struct platform_device *pdev); int fsl_udc_clk_finalize(struct platform_device *pdev); void fsl_udc_clk_release(void); -#else -static inline int fsl_udc_clk_init(struct platform_device *pdev) -{ - return 0; -} -static inline int fsl_udc_clk_finalize(struct platform_device *pdev) -{ - return 0; -} -static inline void fsl_udc_clk_release(void) -{ -} #endif #endif -- cgit v0.10.2 From a06c92c2f6895e624f656f75e00be14ce98f2cd7 Mon Sep 17 00:00:00 2001 From: Marian Chereji Date: Thu, 7 May 2015 15:54:58 +0300 Subject: dpa_offload: Restore ONIC interface buffer pool The ONIC interface only works when the offline port OH2 is using buffer pool #17 which was prepared for it. This prevents the unification of the DTS example files for the "ipsec_offload" and "dpa_offload" demo applications, because the NF offloading demo application requests the buffer pool #16 on the OH2 offline port as NF IP Forwarding does not support VSPs. Signed-off-by: Marian Chereji Change-Id: I3e2996f6777e4b16aee1a3cf489f89b60a37f325 Reviewed-on: http://git.am.freescale.net:8181/36070 Tested-by: Review Code-CDREVIEW Reviewed-by: Nicolae-Sebastian Grigore Reviewed-by: Pinghua An Reviewed-by: Honghua Yin diff --git a/drivers/staging/fsl_dpa_offload/dts/b4860qds-usdpaa-nf-offload.dts b/drivers/staging/fsl_dpa_offload/dts/b4860qds-usdpaa-nf-offload.dts new file mode 100644 index 0000000..daaed81 --- /dev/null +++ b/drivers/staging/fsl_dpa_offload/dts/b4860qds-usdpaa-nf-offload.dts @@ -0,0 +1,181 @@ +/* + * B4860QDS Device Tree Source + * + * Copyright 2013 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/include/ "b4860qds.dts" + +/ { + /* NB: "bpool-ethernet-seeds" is not set to avoid buffer seeding, + * because apps seed these pools with buffers allocated at + * run-time. + * HOWEVER, the kernel driver requires the buffer-size so + * "fsl,bpool-ethernet-cfg" is set. It also mis-interprets + * things if the base-address is zero (hence the 0xdeadbeef + * values). + */ + bp7: buffer-pool@7 { + compatible = "fsl,b4860-bpool", "fsl,bpool"; + fsl,bpid = <7>; + fsl,bpool-ethernet-cfg = <0 0 0 192 0 0xdeadbeef>; + fsl,bpool-thresholds = <0x400 0xc00 0x0 0x0>; + }; + bp8: buffer-pool@8 { + compatible = "fsl,b4860-bpool", "fsl,bpool"; + fsl,bpid = <8>; + fsl,bpool-ethernet-cfg = <0 0 0 576 0 0xabbaf00d>; + fsl,bpool-thresholds = <0x100 0x300 0x0 0x0>; + }; + bp9: buffer-pool@9 { + compatible = "fsl,b4860-bpool", "fsl,bpool"; + fsl,bpid = <9>; + fsl,bpool-ethernet-cfg = <0 0 0 1728 0 0xfeedabba>; + fsl,bpool-thresholds = <0x100 0x300 0x0 0x0>; + }; + + bp10: buffer-pool@10 { + compatible = "fsl,b4860-bpool", "fsl,bpool"; + fsl,bpid = <10>; + fsl,bpool-thresholds = <0x10 0x30 0x0 0x0>; + }; + bp11: buffer-pool@11 { + compatible = "fsl,b4860-bpool", "fsl,bpool"; + fsl,bpid = <11>; + fsl,bpool-thresholds = <0x100 0x300 0x0 0x0>; + }; + bp12: buffer-pool@12 { + compatible = "fsl,b4860-bpool", "fsl,bpool"; + fsl,bpid = <12>; + fsl,bpool-thresholds = <0x100 0x300 0x0 0x0>; + }; + + bp16: buffer-pool@16 { + compatible = "fsl,b4860-bpool", "fsl,bpool"; + fsl,bpid = <16>; + fsl,bpool-ethernet-cfg = <0 2048 0 1728 0 0>; + fsl,bpool-thresholds = <0x100 0x300 0x0 0x0>; + }; + bp17: buffer-pool@17 { + compatible = "fsl,b4860-bpool", "fsl,bpool"; + fsl,bpid = <17>; + fsl,bpool-ethernet-cfg = <0 2048 0 1728 0 0>; + fsl,bpool-thresholds = <0x100 0x300 0x0 0x0>; + fsl,bpool-ethernet-seeds; + }; + + + fsl,dpaa { + ethernet@0 { + compatible = "fsl,b4860-dpa-ethernet-init", "fsl,dpa-ethernet-init"; + fsl,bman-buffer-pools = <&bp16>; + fsl,qman-frame-queues-rx = <0x50 1 0x51 1>; + fsl,qman-frame-queues-tx = <0x70 1 0x71 1>; + }; + ethernet@1 { + compatible = "fsl,b4860-dpa-ethernet-init", "fsl,dpa-ethernet-init"; + fsl,bman-buffer-pools = <&bp16>; + fsl,qman-frame-queues-rx = <0x52 1 0x53 1>; + fsl,qman-frame-queues-tx = <0x72 1 0x73 1>; + }; + ethernet@2 { + compatible = "fsl,b4860-dpa-ethernet-init", "fsl,dpa-ethernet-init"; + fsl,bman-buffer-pools = <&bp16>; + fsl,qman-frame-queues-rx = <0x54 1 0x55 1>; + fsl,qman-frame-queues-tx = <0x74 1 0x75 1>; + }; + ethernet@3 { + compatible = "fsl,b4860-dpa-ethernet-init", "fsl,dpa-ethernet-init"; + fsl,bman-buffer-pools = <&bp16>; + fsl,qman-frame-queues-rx = <0x56 1 0x57 1>; + fsl,qman-frame-queues-tx = <0x76 1 0x77 1>; + }; + ethernet@4 { + compatible = "fsl,b4860-dpa-ethernet-shared", "fsl,dpa-ethernet-shared"; + fsl,bman-buffer-pools = <&bp16>; + fsl,qman-frame-queues-rx = <0x58 1 0x59 1 0x1000 2>; + fsl,qman-frame-queues-tx = <0x78 1 0x79 1 0x2000 8>; + }; + ethernet@5 { + compatible = "fsl,b4860-dpa-ethernet-shared", "fsl,dpa-ethernet-shared"; + fsl,bman-buffer-pools = <&bp16>; + fsl,qman-frame-queues-rx = <0x5a 1 0x5b 1 0x1002 2>; + fsl,qman-frame-queues-tx = <0x7a 1 0x7b 1 0x2008 8>; + }; + ethernet@8 { + compatible = "fsl,b4860-dpa-ethernet-init", "fsl,dpa-ethernet-init"; + fsl,bman-buffer-pools = <&bp16>; + fsl,qman-frame-queues-rx = <0x5c 1 0x5d 1>; + fsl,qman-frame-queues-tx = <0x7c 1 0x7d 1>; + }; + + /* ethernet@16 declared as MAC-less interface with no "fsl,fman-mac" property. + * USDPAA will seed buffers to this buffer pool and initialize 8 TX Frame + * queues. The ethernet driver will initialize 8 RX default Frame queues. + * On receiving frame at this interface, the ethernet driver will do + * kmap_atomic/kunmap_atomic for that frame. */ + ethernet@16 { + compatible = "fsl,b4860-dpa-ethernet-macless", "fsl,dpa-ethernet-macless"; + fsl,bman-buffer-pools = <&bp16>; + fsl,qman-frame-queues-rx = <4000 8>; + fsl,qman-frame-queues-tx = <4008 8>; + local-mac-address = [00 11 22 33 44 55]; + }; + ethernet@17 { + compatible = "fsl,b4860-dpa-ethernet-macless", "fsl,dpa-ethernet-macless"; + fsl,bman-buffer-pools = <&bp16>; + fsl,qman-frame-queues-rx = <5000 8>; + fsl,qman-frame-queues-tx = <5008 8>; + local-mac-address = [00 11 22 33 44 66]; + }; + + dpa-fman0-oh@2 { + compatible = "fsl,dpa-oh"; + /* Define frame queues for the OH port*/ + /* */ + fsl,qman-frame-queues-oh = <0x6e 1 0x6f 1>; + fsl,bman-buffer-pools = <&bp16>; + fsl,fman-oh-port = <&fman0_oh2>; + }; + dpa_fman0_oh3: dpa-fman0-oh@3 { + compatible = "fsl,dpa-oh"; + fsl,qman-frame-queues-oh = <0x68 1 0x69 1>; + fsl,bman-buffer-pools = <&bp9>; + fsl,fman-oh-port = <&fman0_oh3>; + }; + dpa_fman0_oh4: dpa-fman0-oh@4 { + compatible = "fsl,dpa-oh"; + fsl,qman-frame-queues-oh = <0x70 1 0x71 1>; + fsl,bman-buffer-pools = <&bp9>; + fsl,fman-oh-port = <&fman0_oh4>; + }; + }; +}; diff --git a/drivers/staging/fsl_dpa_offload/dts/b4860qds-usdpaa-shared-interfaces.dts b/drivers/staging/fsl_dpa_offload/dts/b4860qds-usdpaa-shared-interfaces.dts index fe64763..151979b 100644 --- a/drivers/staging/fsl_dpa_offload/dts/b4860qds-usdpaa-shared-interfaces.dts +++ b/drivers/staging/fsl_dpa_offload/dts/b4860qds-usdpaa-shared-interfaces.dts @@ -89,6 +89,7 @@ fsl,bpid = <17>; fsl,bpool-ethernet-cfg = <0 2048 0 1728 0 0>; fsl,bpool-thresholds = <0x100 0x300 0x0 0x0>; + fsl,bpool-ethernet-seeds; }; @@ -118,22 +119,16 @@ fsl,qman-frame-queues-tx = <0x76 1 0x77 1>; }; ethernet@4 { - compatible = "fsl,b4860-dpa-ethernet-shared", "fsl,dpa-ethernet-shared"; + compatible = "fsl,b4860-dpa-ethernet-init", "fsl,dpa-ethernet-init"; fsl,bman-buffer-pools = <&bp16>; - fsl,qman-frame-queues-rx = <0x58 1 0x59 1 0x1000 2>; - fsl,qman-frame-queues-tx = <0x78 1 0x79 1 0x2000 8>; + fsl,qman-frame-queues-rx = <0x58 1 0x59 1>; + fsl,qman-frame-queues-tx = <0x78 1 0x79 1>; }; ethernet@5 { - compatible = "fsl,b4860-dpa-ethernet-shared", "fsl,dpa-ethernet-shared"; - fsl,bman-buffer-pools = <&bp16>; - fsl,qman-frame-queues-rx = <0x5a 1 0x5b 1 0x1002 2>; - fsl,qman-frame-queues-tx = <0x7a 1 0x7b 1 0x2008 8>; - }; - ethernet@8 { compatible = "fsl,b4860-dpa-ethernet-init", "fsl,dpa-ethernet-init"; fsl,bman-buffer-pools = <&bp16>; - fsl,qman-frame-queues-rx = <0x5c 1 0x5d 1>; - fsl,qman-frame-queues-tx = <0x7c 1 0x7d 1>; + fsl,qman-frame-queues-rx = <0x5a 1 0x5b 1>; + fsl,qman-frame-queues-tx = <0x7a 1 0x7b 1>; }; /* ethernet@16 declared as MAC-less interface with no "fsl,fman-mac" property. @@ -176,7 +171,7 @@ /* Define frame queues for the OH port*/ /* */ fsl,qman-frame-queues-oh = <0x6e 1 0x6f 1>; - fsl,bman-buffer-pools = <&bp16>; + fsl,bman-buffer-pools = <&bp17>; fsl,fman-oh-port = <&fman0_oh2>; }; oh3: dpa_fman0_oh3: dpa-fman0-oh@3 { -- cgit v0.10.2 From e4fd75bc70c7dcb6007c50e9ac68978726d5da25 Mon Sep 17 00:00:00 2001 From: Shengzhou Liu Date: Wed, 29 Apr 2015 16:28:16 +0800 Subject: mdio: remove unused workaround for xgmac_mdio_read The bug in xgmac_mdio_read have been fixed, so remove the temporary workaround which is no longer needed. Signed-off-by: Shengzhou Liu Change-Id: I7d932208ff81bd00f6c761b57c5b1dacf456e48b Reviewed-on: http://git.am.freescale.net:8181/35748 Tested-by: Review Code-CDREVIEW Reviewed-by: Xiaobo Xie Reviewed-by: Honghua Yin diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c index 5eef8ce..b2d060c 100644 --- a/drivers/net/ethernet/freescale/xgmac_mdio.c +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c @@ -19,9 +19,6 @@ #include #include #include -#ifdef CONFIG_FMAN_V3L -#include -#endif /* Number of microseconds to wait for a register to respond */ #define TIMEOUT 1000 @@ -183,12 +180,6 @@ static int xgmac_mdio_read(struct mii_bus *bus, int phy_id, int regnum) return ret; } -#ifdef CONFIG_FMAN_V3L - /* Fixup for RTL8211F MDIO timing delay on T1023RDB */ - if (SVR_SOC_VER(mfspr(SPRN_SVR)) == SVR_T1023) - udelay(100); -#endif - /* Initiate the read */ out_be32(®s->mdio_ctl, mdio_ctl | MDIO_CTL_READ); -- cgit v0.10.2 From 8aa7fc35dabf261899525f3da29ea21a111b3707 Mon Sep 17 00:00:00 2001 From: Horia Geanta Date: Fri, 8 May 2015 18:29:37 +0300 Subject: crypto: talitos - avoid out of bound scatterlist iterator Check return value of scatterlist_sg_next(), i.e. don't rely solely on number of bytes to be processed or number of scatterlist entries. Change-Id: I6c10ed15e9a456b87828ebb21cc1121c7041be7d Signed-off-by: Horia Geanta Reviewed-on: http://git.am.freescale.net:8181/36122 Tested-by: Review Code-CDREVIEW Reviewed-by: Tudor-Dan Ambarus Reviewed-by: Honghua Yin diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index c7a1368..1edb686 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -1298,7 +1298,7 @@ static int sg_to_link_tbl(struct scatterlist *sg, int sg_count, { int n_sg = sg_count; - while (n_sg--) { + while (sg && n_sg--) { to_talitos_ptr(link_tbl_ptr, sg_dma_address(sg)); link_tbl_ptr->len = cpu_to_be16(sg_dma_len(sg)); link_tbl_ptr->j_extent = 0; @@ -1486,7 +1486,7 @@ static int sg_count(struct scatterlist *sg_list, int nbytes, bool *chained) int sg_nents = 0; *chained = false; - while (nbytes > 0) { + while (nbytes > 0 && sg) { sg_nents++; nbytes -= sg->length; if (!sg_is_last(sg) && (sg + 1)->length == 0) -- cgit v0.10.2 From f11665f4997debcce6f8c7f3c0e7a84d9dcf5bb0 Mon Sep 17 00:00:00 2001 From: Horia Geanta Date: Fri, 8 May 2015 18:33:33 +0300 Subject: Revert "crypto: talitos - convert to use be16_add_cpu()" This reverts commit 7291a932c6e27d9768e374e9d648086636daf61c. The conversion to be16_add_cpu() is incorrect in case cryptlen is negative due to premature (i.e. before addition / subtraction) implicit conversion of cryptlen (int -> u16) leading to sign loss. Change-Id: Iee27eb0881df6f1134f977cbe471cd23479752ce Signed-off-by: Horia Geanta Reviewed-on: http://git.am.freescale.net:8181/36123 Tested-by: Review Code-CDREVIEW Reviewed-by: Tudor-Dan Ambarus Reviewed-by: Honghua Yin diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 1edb686..e9163ab 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -1316,7 +1316,8 @@ static int sg_to_link_tbl(struct scatterlist *sg, int sg_count, sg_count--; link_tbl_ptr--; } - be16_add_cpu(&link_tbl_ptr->len, cryptlen); + link_tbl_ptr->len = cpu_to_be16(be16_to_cpu(link_tbl_ptr->len) + + cryptlen); /* tag end of link table */ link_tbl_ptr->j_extent = DESC_PTR_LNKTBL_RETURN; -- cgit v0.10.2 From fb45eb098d451ff42c02428d49430f5500ae4a39 Mon Sep 17 00:00:00 2001 From: Horia Geanta Date: Fri, 8 May 2015 18:40:22 +0300 Subject: crypto: talitos - static code checker fixes -change req_ctx->nbuf from u64 to unsigned int to silence checker warnings; this is safe since nbuf value is <= HASH_MAX_BLOCK_SIZE -remove unused value read from TALITOS_CCPSR; there is no requirement to read upper 32b before reading lower 32b of a 64b register; SEC RM mentions: "reads can always be done by byte, word, or dword" -remove unused return value of sg_to_link_tbl() -change "len" parameter of map_single_talitos_ptr(); cpu_to_be16 will __force downcast the value to unsigned short without any checker warning Change-Id: I2245e6a7f5e7d60d3a86b3b68a76a104ba372530 Signed-off-by: Horia Geanta Reviewed-on: http://git.am.freescale.net:8181/36124 Tested-by: Review Code-CDREVIEW Reviewed-by: Tudor-Dan Ambarus Reviewed-by: Honghua Yin diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index e9163ab..ee49966 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -65,7 +65,7 @@ static void to_talitos_ptr(struct talitos_ptr *talitos_ptr, dma_addr_t dma_addr) */ static void map_single_talitos_ptr(struct device *dev, struct talitos_ptr *talitos_ptr, - unsigned short len, void *data, + unsigned int len, void *data, unsigned char extent, enum dma_data_direction dir) { @@ -458,7 +458,7 @@ static void talitos_error(struct device *dev, u32 isr, u32 isr_lo) struct talitos_private *priv = dev_get_drvdata(dev); unsigned int timeout = TALITOS_TIMEOUT; int ch, error, reset_dev = 0, reset_ch = 0; - u32 v, v_lo; + u32 v_lo; for (ch = 0; ch < priv->num_channels; ch++) { /* skip channels without errors */ @@ -467,7 +467,6 @@ static void talitos_error(struct device *dev, u32 isr, u32 isr_lo) error = -EINVAL; - v = in_be32(priv->chan[ch].reg + TALITOS_CCPSR); v_lo = in_be32(priv->chan[ch].reg + TALITOS_CCPSR_LO); if (v_lo & TALITOS_CCPSR_LO_DOF) { @@ -1052,7 +1051,7 @@ struct talitos_ahash_req_ctx { unsigned int first; unsigned int last; unsigned int to_hash_later; - u64 nbuf; + unsigned int nbuf; struct scatterlist bufsl[2]; struct scatterlist *psrc; }; @@ -1826,8 +1825,7 @@ static int common_nonsnoop(struct talitos_edesc *edesc, (edesc->src_nents + 1) * sizeof(struct talitos_ptr)); desc->ptr[4].j_extent |= DESC_PTR_LNKTBL_JUMP; - sg_count = sg_to_link_tbl(areq->dst, sg_count, cryptlen, - link_tbl_ptr); + sg_to_link_tbl(areq->dst, sg_count, cryptlen, link_tbl_ptr); dma_sync_single_for_device(ctx->dev, edesc->dma_link_tbl, edesc->dma_len, DMA_BIDIRECTIONAL); } -- cgit v0.10.2 From 0af4b6a3b092660a7b90f3f5c0bf7942e76eec3a Mon Sep 17 00:00:00 2001 From: Horia Geanta Date: Fri, 8 May 2015 18:20:12 +0300 Subject: crypto: talitos - avoid memleak in talitos_alg_alloc() Change-Id: I0e1cbb1d09eef65fedf75d7c3787898fc5b67f50 Signed-off-by: Horia Geanta Reviewed-on: http://git.am.freescale.net:8181/36121 Tested-by: Review Code-CDREVIEW Reviewed-by: Tudor-Dan Ambarus Reviewed-by: Honghua Yin diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index ee49966..8ebe3f9 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -2960,6 +2960,7 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev, break; default: dev_err(dev, "unknown algorithm type %d\n", t_alg->algt.type); + kfree(t_alg); return ERR_PTR(-EINVAL); } -- cgit v0.10.2 From fcb98ca99626b913043d7f0264601ec04a7fbf10 Mon Sep 17 00:00:00 2001 From: Pan Jiafei Date: Wed, 6 May 2015 13:07:48 +0800 Subject: fmd: fix ioctl of FM_CtrlMonGetCounters Signed-off-by: Pan Jiafei Change-Id: If3f1264a02dbc9241b10e6050ff0c55c17170ab1 Reviewed-on: http://git.am.freescale.net:8181/35983 Reviewed-by: Mandy Lavi Reviewed-by: Honghua Yin Tested-by: Honghua Yin 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 109dd36..886cd5d 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 @@ -3523,7 +3523,7 @@ t_Error LnxwrpFmIOCTL(t_LnxWrpFmDev *p_LnxWrpFmDev, unsigned int cmd, unsigned l else #endif { - if (copy_from_user(¶m, (void *)arg, sizeof(ioc_fm_counters_params_t))) + if (copy_from_user(¶m, (void *)arg, sizeof(ioc_fm_ctrl_mon_counters_params_t))) RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG); } diff --git a/include/uapi/linux/fmd/Peripherals/fm_ioctls.h b/include/uapi/linux/fmd/Peripherals/fm_ioctls.h index 54e65b7..e0c2dd3 100644 --- a/include/uapi/linux/fmd/Peripherals/fm_ioctls.h +++ b/include/uapi/linux/fmd/Peripherals/fm_ioctls.h @@ -328,7 +328,7 @@ typedef struct ioc_fm_vsp_prs_result_params_t { #endif typedef struct fm_ctrl_mon_t { - uint8_t percent_cnt[1]; + uint8_t percent_cnt[2]; } fm_ctrl_mon_t; typedef struct ioc_fm_ctrl_mon_counters_params_t { -- cgit v0.10.2 From 4660e029b87eee5b2a28ee3ee13f2042548803fa Mon Sep 17 00:00:00 2001 From: Marian Chereji Date: Thu, 14 May 2015 17:50:24 +0300 Subject: dpa_offload: Avoid illegal access of IPSec instance after release The function "dpa_ipsec_free" is calling "free_resources" which is releasing the dpa_ipsec instance by executing kfree(dpa_ipsec); Once this call ends, "dpa_ipsec_free" is accessing again the "instance" pointer to call "mark_unused_gbl_dpa_ipsec". The problem is that the "instance" pointer is inconsistent at his point (was released by the call to "free_resources"). To fix this, the call to "mark_unused_gbl_dpa_ipsec" was simply removed from "dpa_ipsec_free" because the function "free_resources" is already doing that. Signed-off-by: Marian Chereji Change-Id: Ibabc69253a8a21c7bb158bc371193a6b9ace01ac Reviewed-on: http://git.am.freescale.net:8181/36404 Tested-by: Review Code-CDREVIEW Reviewed-by: Pinghua An Reviewed-by: Honghua Yin diff --git a/drivers/staging/fsl_dpa_offload/dpa_ipsec.c b/drivers/staging/fsl_dpa_offload/dpa_ipsec.c index 5b3fc91..23b0521 100644 --- a/drivers/staging/fsl_dpa_offload/dpa_ipsec.c +++ b/drivers/staging/fsl_dpa_offload/dpa_ipsec.c @@ -3680,8 +3680,6 @@ int dpa_ipsec_free(int dpa_ipsec_id) free_resources(dpa_ipsec_id); - mark_unused_gbl_dpa_ipsec(instance->id); - return 0; } EXPORT_SYMBOL(dpa_ipsec_free); -- cgit v0.10.2 From ea9b03c57eec92f184b7d24a5086e1f335866c29 Mon Sep 17 00:00:00 2001 From: Bogdan Purcareata Date: Mon, 18 May 2015 13:13:54 +0000 Subject: powerpc/kvm: Disable in-kernel MPIC emulation for PREEMPT_RT_FULL Current in-kernel MPIC emulation for PowerPC is unsuitable for RT. More specifically, the MPIC lock becomes a sleeping mutex, causing concurrency issues on a KVM guest enter. Converting the lock to a raw_spinlock is still not a viable solution, since the current implementation is prone to induce large latencies with preemption and irqs disabled on the host kernel. Patch aready applied in the upstream 3.18.13 RT patch, version 9 [1]. [1] http://www.spinics.net/lists/linux-rt-users/msg13340.html Signed-off-by: Bogdan Purcareata Change-Id: Ie942de00717527ea78c2471f6a5153489f432e89 Reviewed-on: http://git.am.freescale.net:8181/36530 Tested-by: Review Code-CDREVIEW Reviewed-by: Scott Wood Reviewed-by: Honghua Yin diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig index ffaef2c..78c3c30 100644 --- a/arch/powerpc/kvm/Kconfig +++ b/arch/powerpc/kvm/Kconfig @@ -155,6 +155,7 @@ config KVM_E500MC config KVM_MPIC bool "KVM in-kernel MPIC emulation" depends on KVM && E500 + depends on !PREEMPT_RT_FULL select HAVE_KVM_IRQCHIP select HAVE_KVM_IRQ_ROUTING select HAVE_KVM_MSI -- cgit v0.10.2 From 11e21064d853b7f212a54abd1cd1442b12b0eeee Mon Sep 17 00:00:00 2001 From: Mandy Lavi Date: Tue, 5 May 2015 21:54:30 +0900 Subject: fmd: fix licensing conflicts Change-Id: Ib662fba72d3ad0e5260bcc36006fa0dd7158b056 Signed-off-by: Mandy Lavi Reviewed-on: http://git.am.freescale.net:8181/36405 Tested-by: Review Code-CDREVIEW Reviewed-by: Nir Erez Reviewed-by: Honghua Yin diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/HC/hc.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/HC/hc.c index 5b03cfc..8bc0889 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/HC/hc.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/HC/hc.c @@ -342,19 +342,6 @@ t_Error FmHcSetFramesDataMemory(t_Handle h_FmHc, return FillBufPool(p_FmHc); } -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) -t_Error FmHcDumpRegs(t_Handle h_FmHc) -{ - t_FmHc *p_FmHc = (t_FmHc*)h_FmHc; - - SANITY_CHECK_RETURN_ERROR(p_FmHc, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(p_FmHc->h_HcPortDev, E_INVALID_HANDLE); - - return FM_PORT_DumpRegs(p_FmHc->h_HcPortDev); - -} -#endif /* (defined(DEBUG_ERRORS) && ... */ - void FmHcTxConf(t_Handle h_FmHc, t_DpaaFD *p_Fd) { t_FmHc *p_FmHc = (t_FmHc*)h_FmHc; diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/dtsec.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/dtsec.c index d0ed2e7..5ae65f8 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/dtsec.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/dtsec.c @@ -1202,52 +1202,6 @@ static t_Error DtsecSetException(t_Handle h_Dtsec, e_FmMacExceptions exception, return E_OK; } -/* ........................................................................... */ - -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) -static t_Error DtsecDumpRegs(t_Handle h_Dtsec) -{ - t_Dtsec *p_Dtsec = (t_Dtsec *)h_Dtsec; - int i = 0; - - DECLARE_DUMP; - - if (p_Dtsec->p_MemMap) - { - DUMP_TITLE(p_Dtsec->p_MemMap, ("dTSEC %d: ", p_Dtsec->macId)); - DUMP_VAR(p_Dtsec->p_MemMap, tsec_id); - DUMP_VAR(p_Dtsec->p_MemMap, tsec_id2); - DUMP_VAR(p_Dtsec->p_MemMap, ievent); - DUMP_VAR(p_Dtsec->p_MemMap, imask); - DUMP_VAR(p_Dtsec->p_MemMap, ecntrl); - DUMP_VAR(p_Dtsec->p_MemMap, ptv); - DUMP_VAR(p_Dtsec->p_MemMap, tmr_ctrl); - DUMP_VAR(p_Dtsec->p_MemMap, tmr_pevent); - DUMP_VAR(p_Dtsec->p_MemMap, tmr_pemask); - DUMP_VAR(p_Dtsec->p_MemMap, tctrl); - DUMP_VAR(p_Dtsec->p_MemMap, rctrl); - DUMP_VAR(p_Dtsec->p_MemMap, maccfg1); - DUMP_VAR(p_Dtsec->p_MemMap, maccfg2); - DUMP_VAR(p_Dtsec->p_MemMap, ipgifg); - DUMP_VAR(p_Dtsec->p_MemMap, hafdup); - DUMP_VAR(p_Dtsec->p_MemMap, maxfrm); - - DUMP_VAR(p_Dtsec->p_MemMap, macstnaddr1); - DUMP_VAR(p_Dtsec->p_MemMap, macstnaddr2); - - DUMP_SUBSTRUCT_ARRAY(i, 8) - { - DUMP_VAR(p_Dtsec->p_MemMap, macaddr[i].exact_match1); - DUMP_VAR(p_Dtsec->p_MemMap, macaddr[i].exact_match2); - } - DUMP_VAR(p_Dtsec->p_MemMap, car1); - DUMP_VAR(p_Dtsec->p_MemMap, car2); - } - - return E_OK; -} -#endif /* (defined(DEBUG_ERRORS) && ... */ - /*****************************************************************************/ /* dTSEC Init & Free API */ @@ -1447,9 +1401,6 @@ static void InitFmMacControllerDriver(t_FmMacControllerDriver *p_FmMacController p_FmMacControllerDriver->f_FM_MAC_MII_WritePhyReg = DTSEC_MII_WritePhyReg; p_FmMacControllerDriver->f_FM_MAC_MII_ReadPhyReg = DTSEC_MII_ReadPhyReg; -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) - p_FmMacControllerDriver->f_FM_MAC_DumpRegs = DtsecDumpRegs; -#endif /* (defined(DEBUG_ERRORS) && ... */ } diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/memac.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/memac.c index a2b8751..b5aacc9 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/memac.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/memac.c @@ -812,63 +812,6 @@ static uint16_t MemacGetMaxFrameLength(t_Handle h_Memac) return fman_memac_get_max_frame_len(p_Memac->p_MemMap); } -/* ......................................................................... */ - -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) -static t_Error MemacDumpRegs(t_Handle h_Memac) -{ - t_Memac *p_Memac = (t_Memac *)h_Memac; - int i = 0; - - DECLARE_DUMP; - - if (p_Memac->p_MemMap) - { - DUMP_TITLE(p_Memac->p_MemMap, ("mEMAC %d: ", p_Memac->macId)); - DUMP_VAR(p_Memac->p_MemMap, command_config); - DUMP_VAR(p_Memac->p_MemMap, mac_addr0.mac_addr_l); - DUMP_VAR(p_Memac->p_MemMap, mac_addr0.mac_addr_u); - DUMP_VAR(p_Memac->p_MemMap, maxfrm); - DUMP_VAR(p_Memac->p_MemMap, hashtable_ctrl); - DUMP_VAR(p_Memac->p_MemMap, ievent); - DUMP_VAR(p_Memac->p_MemMap, tx_ipg_length); - DUMP_VAR(p_Memac->p_MemMap, imask); - - DUMP_SUBSTRUCT_ARRAY(i, 4) - { - DUMP_VAR(p_Memac->p_MemMap, pause_quanta[i]); - } - DUMP_SUBSTRUCT_ARRAY(i, 4) - { - DUMP_VAR(p_Memac->p_MemMap, pause_thresh[i]); - } - - DUMP_VAR(p_Memac->p_MemMap, rx_pause_status); - - DUMP_SUBSTRUCT_ARRAY(i, MEMAC_NUM_OF_PADDRS) - { - DUMP_VAR(p_Memac->p_MemMap, mac_addr[i].mac_addr_l); - DUMP_VAR(p_Memac->p_MemMap, mac_addr[i].mac_addr_u); - } - - DUMP_VAR(p_Memac->p_MemMap, lpwake_timer); - DUMP_VAR(p_Memac->p_MemMap, sleep_timer); - DUMP_VAR(p_Memac->p_MemMap, statn_config); - DUMP_VAR(p_Memac->p_MemMap, if_mode); - DUMP_VAR(p_Memac->p_MemMap, if_status); - DUMP_VAR(p_Memac->p_MemMap, hg_config); - DUMP_VAR(p_Memac->p_MemMap, hg_pause_quanta); - DUMP_VAR(p_Memac->p_MemMap, hg_pause_thresh); - DUMP_VAR(p_Memac->p_MemMap, hgrx_pause_status); - DUMP_VAR(p_Memac->p_MemMap, hg_fifos_status); - DUMP_VAR(p_Memac->p_MemMap, rhm); - DUMP_VAR(p_Memac->p_MemMap, thm); - } - - return E_OK; -} -#endif /* (defined(DEBUG_ERRORS) && ... */ - /*****************************************************************************/ /* mEMAC Init & Free API */ @@ -1086,10 +1029,6 @@ static void InitFmMacControllerDriver(t_FmMacControllerDriver *p_FmMacController p_FmMacControllerDriver->f_FM_MAC_MII_WritePhyReg = MEMAC_MII_WritePhyReg; p_FmMacControllerDriver->f_FM_MAC_MII_ReadPhyReg = MEMAC_MII_ReadPhyReg; - -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) - p_FmMacControllerDriver->f_FM_MAC_DumpRegs = MemacDumpRegs; -#endif /* (defined(DEBUG_ERRORS) && ... */ } diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/tgec.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/tgec.c index 8f39f25..bf12c5d 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/tgec.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/tgec.c @@ -741,50 +741,6 @@ static t_Error TgecTxEccWorkaround(t_Tgec *p_Tgec) } #endif /* FM_TX_ECC_FRMS_ERRATA_10GMAC_A004 */ -/* ......................................................................... */ - -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) -static t_Error TgecDumpRegs(t_Handle h_Tgec) -{ - t_Tgec *p_Tgec = (t_Tgec *)h_Tgec; - - DECLARE_DUMP; - - if (p_Tgec->p_MemMap) - { - DUMP_TITLE(p_Tgec->p_MemMap, ("10G MAC %d: ", p_Tgec->macId)); - DUMP_VAR(p_Tgec->p_MemMap, tgec_id); - DUMP_VAR(p_Tgec->p_MemMap, command_config); - DUMP_VAR(p_Tgec->p_MemMap, mac_addr_0); - DUMP_VAR(p_Tgec->p_MemMap, mac_addr_1); - DUMP_VAR(p_Tgec->p_MemMap, maxfrm); - DUMP_VAR(p_Tgec->p_MemMap, pause_quant); - DUMP_VAR(p_Tgec->p_MemMap, rx_fifo_sections); - DUMP_VAR(p_Tgec->p_MemMap, tx_fifo_sections); - DUMP_VAR(p_Tgec->p_MemMap, rx_fifo_almost_f_e); - DUMP_VAR(p_Tgec->p_MemMap, tx_fifo_almost_f_e); - DUMP_VAR(p_Tgec->p_MemMap, hashtable_ctrl); - DUMP_VAR(p_Tgec->p_MemMap, mdio_cfg_status); - DUMP_VAR(p_Tgec->p_MemMap, mdio_command); - DUMP_VAR(p_Tgec->p_MemMap, mdio_data); - DUMP_VAR(p_Tgec->p_MemMap, mdio_regaddr); - DUMP_VAR(p_Tgec->p_MemMap, status); - DUMP_VAR(p_Tgec->p_MemMap, tx_ipg_len); - DUMP_VAR(p_Tgec->p_MemMap, mac_addr_2); - DUMP_VAR(p_Tgec->p_MemMap, mac_addr_3); - DUMP_VAR(p_Tgec->p_MemMap, rx_fifo_ptr_rd); - DUMP_VAR(p_Tgec->p_MemMap, rx_fifo_ptr_wr); - DUMP_VAR(p_Tgec->p_MemMap, tx_fifo_ptr_rd); - DUMP_VAR(p_Tgec->p_MemMap, tx_fifo_ptr_wr); - DUMP_VAR(p_Tgec->p_MemMap, imask); - DUMP_VAR(p_Tgec->p_MemMap, ievent); - } - - return E_OK; -} -#endif /* (defined(DEBUG_ERRORS) && ... */ - - /*****************************************************************************/ /* FM Init & Free API */ /*****************************************************************************/ @@ -960,10 +916,6 @@ static void InitFmMacControllerDriver(t_FmMacControllerDriver *p_FmMacController p_FmMacControllerDriver->f_FM_MAC_MII_WritePhyReg = TGEC_MII_WritePhyReg; p_FmMacControllerDriver->f_FM_MAC_MII_ReadPhyReg = TGEC_MII_ReadPhyReg; - -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) - p_FmMacControllerDriver->f_FM_MAC_DumpRegs = TgecDumpRegs; -#endif /* (defined(DEBUG_ERRORS) && ... */ } diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_kg.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_kg.c index dae5575..720da19 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_kg.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_kg.c @@ -3240,105 +3240,3 @@ t_Error FM_PCD_KgSetDfltValue(t_Handle h_FmPcd, uint8_t valueId, uint32_t value) WRITE_UINT32(p_Regs->fmkg_gdv1r,value); return E_OK; } - -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) -t_Error FM_PCD_KgDumpRegs(t_Handle h_FmPcd) -{ - t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd; - int i = 0, j = 0; - uint8_t hardwarePortId = 0; - uint32_t tmpKgarReg, intFlags; - t_Error err = E_OK; - - DECLARE_DUMP; - - SANITY_CHECK_RETURN_ERROR(p_FmPcd, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(p_FmPcd->p_FmPcdKg, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE); - SANITY_CHECK_RETURN_ERROR(((p_FmPcd->guestId == NCSW_MASTER_ID) || - p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs), E_INVALID_OPERATION); - - DUMP_SUBTITLE(("\n")); - DUMP_TITLE(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs, ("FmPcdKgRegs Regs")); - - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_gcr); - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_eer); - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_eeer); - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_seer); - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_seeer); - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_gsr); - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_tpc); - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_serc); - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_fdor); - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_gdv0r); - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_gdv1r); - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_feer); - DUMP_VAR(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs,fmkg_ar); - - DUMP_SUBTITLE(("\n")); - intFlags = KgHwLock(p_FmPcd->p_FmPcdKg); - for (j = 0;jp_FmPcdKg->p_IndirectAccessRegs->schemeRegs, ("FmPcdKgIndirectAccessSchemeRegs Scheme %d Regs", j)); - - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_mode); - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_ekfc); - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_ekdv); - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_bmch); - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_bmcl); - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_fqb); - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_hc); - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_ppc); - - DUMP_TITLE(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs.kgse_gec, ("kgse_gec")); - DUMP_SUBSTRUCT_ARRAY(i, FM_KG_NUM_OF_GENERIC_REGS) - { - DUMP_MEMORY(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs.kgse_gec[i], sizeof(uint32_t)); - } - - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_spc); - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_dv0); - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_dv1); - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_ccbs); - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->schemeRegs,kgse_mv); - } - DUMP_SUBTITLE(("\n")); - - for (i=0;ip_FmPcdKg->p_IndirectAccessRegs->portRegs, ("FmPcdKgIndirectAccessPortRegs PCD Port %d regs", hardwarePortId)); - - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->portRegs, fmkg_pe_sp); - DUMP_VAR(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->portRegs, fmkg_pe_cpp); - } - - DUMP_SUBTITLE(("\n")); - for (j=0;jp_FmPcdKg->p_IndirectAccessRegs->clsPlanRegs, ("FmPcdKgIndirectAccessClsPlanRegs Regs group %d", j)); - DUMP_TITLE(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->clsPlanRegs.kgcpe, ("kgcpe")); - - tmpKgarReg = ReadClsPlanBlockActionReg((uint8_t)j); - err = WriteKgarWait(p_FmPcd, tmpKgarReg); - if (err) - RETURN_ERROR(MINOR, err, NO_MSG); - DUMP_SUBSTRUCT_ARRAY(i, 8) - DUMP_MEMORY(&p_FmPcd->p_FmPcdKg->p_IndirectAccessRegs->clsPlanRegs.kgcpe[i], sizeof(uint32_t)); - } - KgHwUnlock(p_FmPcd->p_FmPcdKg, intFlags); - - return E_OK; -} -#endif /* (defined(DEBUG_ERRORS) && ... */ diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_pcd.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_pcd.c index 4adf9a1..1534331 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_pcd.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_pcd.c @@ -1752,41 +1752,6 @@ uint32_t FM_PCD_GetCounter(t_Handle h_FmPcd, e_FmPcdCounters counter) return 0; } -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) -t_Error FM_PCD_DumpRegs(t_Handle h_FmPcd) -{ - t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd; - t_Error err = E_OK; - - DECLARE_DUMP; - - SANITY_CHECK_RETURN_ERROR(h_FmPcd, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE); - - if (p_FmPcd->p_FmPcdKg) - err |= FM_PCD_KgDumpRegs(h_FmPcd); - if (p_FmPcd->p_FmPcdPlcr) - err |= FM_PCD_PlcrDumpRegs(h_FmPcd); - if (p_FmPcd->p_FmPcdPrs) - err |= FM_PCD_PrsDumpRegs(h_FmPcd); - - return err; -} - -t_Error FM_PCD_HcDumpRegs(t_Handle h_FmPcd) -{ - t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd; - - DECLARE_DUMP; - - SANITY_CHECK_RETURN_ERROR(h_FmPcd, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE); - SANITY_CHECK_RETURN_ERROR(p_FmPcd->h_Hc, E_INVALID_STATE); - - return FmHcDumpRegs(p_FmPcd->h_Hc); -} -#endif /* (defined(DEBUG_ERRORS) && ... */ - t_Error FM_PCD_SetException(t_Handle h_FmPcd, e_FmPcdExceptions exception, bool enable) { t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd; diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_plcr.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_plcr.c index a28b363..f0f1676 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_plcr.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_plcr.c @@ -1532,52 +1532,6 @@ t_Error FM_PCD_SetPlcrStatistics(t_Handle h_FmPcd, bool enable) return E_OK; } -/* ... */ -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) -t_Error FM_PCD_PlcrDumpRegs(t_Handle h_FmPcd) -{ - t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd; - int i = 0; - - DECLARE_DUMP; - - SANITY_CHECK_RETURN_ERROR(p_FmPcd, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(p_FmPcd->p_FmPcdPlcr, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE); - SANITY_CHECK_RETURN_ERROR(((p_FmPcd->guestId == NCSW_MASTER_ID) || - p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs), E_INVALID_OPERATION); - - DUMP_SUBTITLE(("\n")); - DUMP_TITLE(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs, ("FM-PCD policer regs")); - - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_gcr); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_gsr); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_evr); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_ier); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_ifr); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_eevr); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_eier); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_eifr); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_rpcnt); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_ypcnt); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_rrpcnt); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_rypcnt); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_tpcnt); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_flmcnt); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_serc); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_upcr); - DUMP_VAR(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs,fmpl_dpmr); - - DUMP_TITLE(&p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_pmr, ("fmpl_pmr")); - DUMP_SUBSTRUCT_ARRAY(i, 63) - { - DUMP_MEMORY(&p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_pmr[i], sizeof(uint32_t)); - } - - return E_OK; -} -#endif /* (defined(DEBUG_ERRORS) && ... */ - t_Handle FM_PCD_PlcrProfileSet(t_Handle h_FmPcd, t_FmPcdPlcrProfileParams *p_ProfileParams) { @@ -1890,54 +1844,3 @@ t_Error FM_PCD_PlcrProfileSetCounter(t_Handle h_Profile, e_FmPcdPlcrProfileCount return E_OK; } - -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) -t_Error FM_PCD_PlcrProfileDumpRegs(t_Handle h_Profile) -{ - t_FmPcdPlcrProfile *p_Profile = (t_FmPcdPlcrProfile*)h_Profile; - t_FmPcd *p_FmPcd; - t_FmPcdPlcrProfileRegs *p_ProfilesRegs; - uint16_t profileIndx; - uint32_t tmpReg, intFlags; - - DECLARE_DUMP; - - SANITY_CHECK_RETURN_ERROR(p_Profile, E_INVALID_HANDLE); - p_FmPcd = p_Profile->h_FmPcd; - SANITY_CHECK_RETURN_ERROR(p_FmPcd, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(p_FmPcd->p_FmPcdPlcr, E_INVALID_HANDLE); - - profileIndx = p_Profile->absoluteProfileId; - - DUMP_SUBTITLE(("\n")); - DUMP_TITLE(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs, ("FM-PCD policer-profile regs")); - - p_ProfilesRegs = &p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->profileRegs; - - tmpReg = FmPcdPlcrBuildReadPlcrActionReg((uint16_t)profileIndx); - intFlags = PlcrHwLock(p_FmPcd->p_FmPcdPlcr); - WritePar(p_FmPcd, tmpReg); - - DUMP_TITLE(p_ProfilesRegs, ("Profile %d regs", profileIndx)); - - DUMP_VAR(p_ProfilesRegs, fmpl_pemode); - DUMP_VAR(p_ProfilesRegs, fmpl_pegnia); - DUMP_VAR(p_ProfilesRegs, fmpl_peynia); - DUMP_VAR(p_ProfilesRegs, fmpl_pernia); - DUMP_VAR(p_ProfilesRegs, fmpl_pecir); - DUMP_VAR(p_ProfilesRegs, fmpl_pecbs); - DUMP_VAR(p_ProfilesRegs, fmpl_pepepir_eir); - DUMP_VAR(p_ProfilesRegs, fmpl_pepbs_ebs); - DUMP_VAR(p_ProfilesRegs, fmpl_pelts); - DUMP_VAR(p_ProfilesRegs, fmpl_pects); - DUMP_VAR(p_ProfilesRegs, fmpl_pepts_ets); - DUMP_VAR(p_ProfilesRegs, fmpl_pegpc); - DUMP_VAR(p_ProfilesRegs, fmpl_peypc); - DUMP_VAR(p_ProfilesRegs, fmpl_perpc); - DUMP_VAR(p_ProfilesRegs, fmpl_perypc); - DUMP_VAR(p_ProfilesRegs, fmpl_perrpc); - PlcrHwUnlock(p_FmPcd->p_FmPcdPlcr, intFlags); - - return E_OK; -} -#endif /* (defined(DEBUG_ERRORS) && ... */ diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_prs.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_prs.c index e6ac6df..da2fccf 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_prs.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_prs.c @@ -418,49 +418,3 @@ t_Error FM_PCD_ConfigPrsMaxCycleLimit(t_Handle h_FmPcd,uint16_t value) return E_OK; } - -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) -t_Error FM_PCD_PrsDumpRegs(t_Handle h_FmPcd) -{ - t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd; - - DECLARE_DUMP; - - SANITY_CHECK_RETURN_ERROR(p_FmPcd, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(p_FmPcd->p_FmPcdPrs, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE); - SANITY_CHECK_RETURN_ERROR(((p_FmPcd->guestId == NCSW_MASTER_ID) || - p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs), E_INVALID_OPERATION); - - DUMP_SUBTITLE(("\n")); - DUMP_TITLE(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs, ("FM-PCD parser regs")); - - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_rpclim); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_rpimac); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,pmeec); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_pevr); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_pever); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_perr); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_perer); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_ppsc); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_pds); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_l2rrs); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_l3rrs); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_l4rrs); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_srrs); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_l2rres); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_l3rres); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_l4rres); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_srres); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_spcs); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_spscs); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_hxscs); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_mrcs); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_mwcs); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_mrscs); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_mwscs); - DUMP_VAR(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs,fmpr_fcscs); - - return E_OK; -} -#endif /* (defined(DEBUG_ERRORS) && ... */ 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 56f9f80..379406e 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 @@ -5496,271 +5496,6 @@ t_Error FM_PORT_PcdPrsModifyStartOffset(t_Handle h_FmPort, return E_OK; } -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) -t_Error FM_PORT_DumpRegs(t_Handle h_FmPort) -{ - t_FmPort *p_FmPort = (t_FmPort*)h_FmPort; - t_Error err = E_OK; - char arr[20]; - uint8_t flag; - int i=0; - - DECLARE_DUMP; - - SANITY_CHECK_RETURN_ERROR(h_FmPort, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(!p_FmPort->p_FmPortDriverParam, E_INVALID_STATE); - SANITY_CHECK_RETURN_ERROR(p_FmPort->p_FmPortQmiRegs, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(p_FmPort->p_FmPortBmiRegs, E_INVALID_HANDLE); - - memset(arr, 0, sizeof(arr)); - switch (p_FmPort->portType) - { - case (e_FM_PORT_TYPE_OH_OFFLINE_PARSING): - strcpy(arr, "OFFLINE-PARSING"); - flag = 0; - break; - case (e_FM_PORT_TYPE_OH_HOST_COMMAND): - strcpy(arr, "HOST-COMMAND"); - flag = 0; - break; - case (e_FM_PORT_TYPE_RX): - strcpy(arr, "RX"); - flag = 1; - break; - case (e_FM_PORT_TYPE_RX_10G): - strcpy(arr, "RX-10G"); - flag = 1; - break; - case (e_FM_PORT_TYPE_TX): - strcpy(arr, "TX"); - flag = 2; - break; - case (e_FM_PORT_TYPE_TX_10G): - strcpy(arr, "TX-10G"); - flag = 2; - break; - default: - return ERROR_CODE(E_INVALID_VALUE); - } - - DUMP_TITLE(NULL, - ("FMan-Port (%s #%d) registers:", - arr, p_FmPort->portId)); - - err = FmDumpPortRegs(p_FmPort->h_Fm, p_FmPort->hardwarePortId); - if (err) - RETURN_ERROR(MAJOR, err, NO_MSG); - - DUMP_TITLE(p_FmPort->p_FmPortBmiRegs, ("Bmi Port Regs")); - - switch (flag) - { - case (0): - DUMP_SUBTITLE(("\n")); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ocfg); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ost); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_oda); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_oicp); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofdne); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofne); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofca); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofpne); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_opso); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_opp); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_occb); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_oim); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofp); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofed); - - DUMP_TITLE(&(p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs.fmbm_oprai), ("fmbm_oprai")); - DUMP_SUBSTRUCT_ARRAY(i, FM_PORT_PRS_RESULT_NUM_OF_WORDS) - { - DUMP_MEMORY(&(p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs.fmbm_oprai[i]), sizeof(uint32_t)); - } - DUMP_SUBTITLE(("\n")); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofqid ); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_oefqid); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofsdm ); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofsem ); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofene ); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_orlmts); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_orlmt); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ocmne); - { - #ifndef FM_NO_OP_OBSERVED_POOLS - if (p_FmPort->fmRevInfo.majorRev == 4) - { - DUMP_TITLE(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs.fmbm_oebmpi, ("fmbm_oebmpi")); - - DUMP_SUBSTRUCT_ARRAY(i, FM_PORT_MAX_NUM_OF_OBSERVED_EXT_POOLS) - { - DUMP_MEMORY(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs.fmbm_oebmpi[i], sizeof(uint32_t)); - } - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ocgm); - } - #endif /* !FM_NO_OP_OBSERVED_POOLS */ - } - - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ostc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofrc ); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofdc ); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofledc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofufdc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_offc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofwdc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofldec); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_obdc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_opc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_opcp); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_occn); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_otuc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_oduc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ofuc); - DUMP_TITLE(&(p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs.fmbm_odcfg), ("fmbm_odcfg")); - DUMP_SUBSTRUCT_ARRAY(i, 3) - { - DUMP_MEMORY(&(p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs.fmbm_odcfg[i]), sizeof(uint32_t)); - } - DUMP_SUBTITLE(("\n")); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->ohPortBmiRegs,fmbm_ogpr); - break; - - case (1): - DUMP_SUBTITLE(("\n")); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rcfg); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rst); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rda); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfp); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_reth); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfed); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_ricp); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rebm); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfne); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfca); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfpne); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rpso); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rpp); - - DUMP_TITLE(&(p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs.fmbm_rprai), ("fmbm_rprai")); - DUMP_SUBSTRUCT_ARRAY(i, FM_PORT_PRS_RESULT_NUM_OF_WORDS) - { - DUMP_MEMORY(&(p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs.fmbm_rprai[i]), sizeof(uint32_t)); - } - DUMP_SUBTITLE(("\n")); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfqid); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_refqid); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfsdm); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfsem); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfene); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rcmne); - DUMP_TITLE(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs.fmbm_ebmpi, ("fmbm_ebmpi")); - DUMP_SUBSTRUCT_ARRAY(i, FM_PORT_MAX_NUM_OF_EXT_POOLS) - { - DUMP_MEMORY(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs.fmbm_ebmpi[i], sizeof(uint32_t)); - } - DUMP_TITLE(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs.fmbm_acnt, ("fmbm_acnt")); - DUMP_SUBSTRUCT_ARRAY(i, FM_PORT_MAX_NUM_OF_EXT_POOLS) - { - DUMP_MEMORY(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs.fmbm_acnt[i], sizeof(uint32_t)); - } - DUMP_TITLE(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs.fmbm_rcgm, ("fmbm_rcgm")); - DUMP_SUBSTRUCT_ARRAY(i, FM_PORT_NUM_OF_CONGESTION_GRPS/32) - { - DUMP_MEMORY(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs.fmbm_rcgm[i], sizeof(uint32_t)); - } - DUMP_SUBTITLE(("\n")); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rmpd); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rstc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfrc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfbc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rlfc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rffc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfcd); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfldec); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rodc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rpc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rpcp); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rccn); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rtuc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rrquc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rduc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rfuc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rpac); - DUMP_TITLE(&(p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs.fmbm_rdcfg), ("fmbm_rdcfg")); - DUMP_SUBSTRUCT_ARRAY(i, 3) - { - DUMP_MEMORY(&(p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs.fmbm_rdcfg[i]), sizeof(uint32_t)); - } - DUMP_SUBTITLE(("\n")); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->rxPortBmiRegs,fmbm_rgpr); - break; - - case (2): - DUMP_SUBTITLE(("\n")); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tcfg); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tst); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tda); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tfp); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tfed); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_ticp); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tfdne); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tfca); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tcfqid); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tfeqid); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tfene); - #if (DPAA_VERSION >= 11) - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tfne); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tcmne); - #endif /* (DPAA_VERSION >= 11) */ - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_trlmts); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_trlmt); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tstc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tfrc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tfdc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tfledc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tfufdc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tbdc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tpc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tpcp); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tccn); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_ttuc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_ttcquc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tduc); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tfuc); - DUMP_TITLE(&(p_FmPort->p_FmPortBmiRegs->txPortBmiRegs.fmbm_tdcfg), ("fmbm_tdcfg")); - DUMP_SUBSTRUCT_ARRAY(i, 3) - { - DUMP_MEMORY(&(p_FmPort->p_FmPortBmiRegs->txPortBmiRegs.fmbm_tdcfg[i]), sizeof(uint32_t)); - } - DUMP_SUBTITLE(("\n")); - DUMP_VAR(&p_FmPort->p_FmPortBmiRegs->txPortBmiRegs,fmbm_tgpr); - break; - - default: - RETURN_ERROR(MAJOR, E_INVALID_STATE, ("Invalid flag")); - } - - DUMP_TITLE(p_FmPort->p_FmPortQmiRegs, ("Qmi Port Regs")); - - DUMP_VAR(p_FmPort->p_FmPortQmiRegs,fmqm_pnc); - DUMP_VAR(p_FmPort->p_FmPortQmiRegs,fmqm_pns); - DUMP_VAR(p_FmPort->p_FmPortQmiRegs,fmqm_pnts); - DUMP_VAR(p_FmPort->p_FmPortQmiRegs,fmqm_pnen); - DUMP_VAR(p_FmPort->p_FmPortQmiRegs,fmqm_pnetfc); - - if (flag !=1) - { - DUMP_VAR(&p_FmPort->p_FmPortQmiRegs->nonRxQmiRegs,fmqm_pndn); - DUMP_VAR(&p_FmPort->p_FmPortQmiRegs->nonRxQmiRegs,fmqm_pndc); - DUMP_VAR(&p_FmPort->p_FmPortQmiRegs->nonRxQmiRegs,fmqm_pndtfc); - DUMP_VAR(&p_FmPort->p_FmPortQmiRegs->nonRxQmiRegs,fmqm_pndfdc); - DUMP_VAR(&p_FmPort->p_FmPortQmiRegs->nonRxQmiRegs,fmqm_pndcc); - } - - return E_OK; -} -#endif /* (defined(DEBUG_ERRORS) && ... */ - t_Error FM_PORT_AddCongestionGrps(t_Handle h_FmPort, t_FmPortCongestionGrps *p_CongestionGrps) { diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Rtc/fm_rtc.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Rtc/fm_rtc.c index b0bcf26..727d5c8 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Rtc/fm_rtc.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Rtc/fm_rtc.c @@ -690,52 +690,3 @@ t_Error FM_RTC_DisableInterrupt(t_Handle h_FmRtc, uint32_t events) return E_OK; } #endif - -/*****************************************************************************/ -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) -t_Error FM_RTC_DumpRegs(t_Handle h_FmRtc) -{ - t_FmRtc *p_Rtc = (t_FmRtc *)h_FmRtc; - struct rtc_regs *p_MemMap = p_Rtc->p_MemMap; - int i = 0; - - DECLARE_DUMP; - - if (p_MemMap) - { - - DUMP_TITLE(p_MemMap, ("RTC:")); - DUMP_VAR(p_MemMap, tmr_id); - DUMP_VAR(p_MemMap, tmr_id2); - DUMP_VAR(p_MemMap, tmr_ctrl); - DUMP_VAR(p_MemMap, tmr_tevent); - DUMP_VAR(p_MemMap, tmr_temask); - DUMP_VAR(p_MemMap, tmr_cnt_h); - DUMP_VAR(p_MemMap, tmr_cnt_l); - DUMP_VAR(p_MemMap, tmr_ctrl); - DUMP_VAR(p_MemMap, tmr_add); - DUMP_VAR(p_MemMap, tmr_acc); - DUMP_VAR(p_MemMap, tmr_prsc); - DUMP_VAR(p_MemMap, tmr_off_h); - DUMP_VAR(p_MemMap, tmr_off_l); - - DUMP_SUBSTRUCT_ARRAY(i, 2) - { - DUMP_VAR(p_MemMap, tmr_alarm[i].tmr_alarm_h); - DUMP_VAR(p_MemMap, tmr_alarm[i].tmr_alarm_l); - } - DUMP_SUBSTRUCT_ARRAY(i, 2) - { - DUMP_VAR(p_MemMap, tmr_fiper[i]); - DUMP_VAR(p_MemMap, tmr_fiper[i]); - } - DUMP_SUBSTRUCT_ARRAY(i, 2) - { - DUMP_VAR(p_MemMap, tmr_etts[i].tmr_etts_l); - DUMP_VAR(p_MemMap, tmr_etts[i].tmr_etts_l); - } - } - - return E_OK; -} -#endif /* (defined(DEBUG_ERRORS) && ... */ diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c index fe05428..a1083a0 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c @@ -5084,139 +5084,6 @@ t_Error FM_CtrlMonGetCounters(t_Handle h_Fm, uint8_t fmCtrlIndex, t_FmCtrlMon *p return E_OK; } -#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) -t_Error FM_DumpRegs(t_Handle h_Fm) -{ - t_Fm *p_Fm = (t_Fm *)h_Fm; - uint8_t i,j = 0; - DECLARE_DUMP; - SANITY_CHECK_RETURN_ERROR(p_Fm, E_INVALID_HANDLE); - SANITY_CHECK_RETURN_ERROR(!p_Fm->p_FmDriverParam, E_INVALID_STATE); - SANITY_CHECK_RETURN_ERROR(((p_Fm->guestId == NCSW_MASTER_ID) || - p_Fm->baseAddr), E_INVALID_OPERATION); - - DUMP_SUBTITLE(("\n")); - - DUMP_TITLE(p_Fm->p_FmFpmRegs, ("FM-FPM Regs")); - - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_tnc); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_prc); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_brkc); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_mxd); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_dist1); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_dist2); - DUMP_VAR(p_Fm->p_FmFpmRegs,fm_epi); - DUMP_VAR(p_Fm->p_FmFpmRegs,fm_rie); - - DUMP_TITLE(&p_Fm->p_FmFpmRegs->fmfp_fcev, ("fmfp_fcev")); - DUMP_SUBSTRUCT_ARRAY(i, 4) - { - DUMP_MEMORY(&p_Fm->p_FmFpmRegs->fmfp_fcev[i], sizeof(uint32_t)); - } - - DUMP_TITLE(&p_Fm->p_FmFpmRegs->fmfp_cee, ("fmfp_cee")); - DUMP_SUBSTRUCT_ARRAY(i, 4) - { - DUMP_MEMORY(&p_Fm->p_FmFpmRegs->fmfp_cee[i], sizeof(uint32_t)); - } - - DUMP_SUBTITLE(("\n")); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_tsc1); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_tsc2); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_tsp); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_tsf); - DUMP_VAR(p_Fm->p_FmFpmRegs,fm_rcr); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_extc); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_ext1); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_ext2); - - DUMP_SUBTITLE(("\n")); - WRITE_UINT32(p_Fm->p_FmFpmRegs->fmfp_dra, 0); - CORE_MemoryBarrier(); - for (j=0; j<128; j++) - { - DUMP_TITLE(j, ("fmfp_dra")); - DUMP_SUBSTRUCT_ARRAY(i, 4) - { - DUMP_MEMORY(&p_Fm->p_FmFpmRegs->fmfp_drd[i], sizeof(uint32_t)); - } - DUMP_TITLE(j, ("fmfp_ts")); - DUMP_MEMORY(&p_Fm->p_FmFpmRegs->fmfp_ts[j], sizeof(uint32_t)); - } - - DUMP_SUBTITLE(("\n")); - DUMP_VAR(p_Fm->p_FmFpmRegs,fm_ip_rev_1); - DUMP_VAR(p_Fm->p_FmFpmRegs,fm_ip_rev_2); - DUMP_VAR(p_Fm->p_FmFpmRegs,fm_rstc); - DUMP_VAR(p_Fm->p_FmFpmRegs,fm_cld); - DUMP_VAR(p_Fm->p_FmFpmRegs,fm_npi); - DUMP_VAR(p_Fm->p_FmFpmRegs,fmfp_ee); - - DUMP_TITLE(&p_Fm->p_FmFpmRegs->fmfp_cev, ("fmfp_cev")); - DUMP_SUBSTRUCT_ARRAY(i, 4) - { - DUMP_MEMORY(&p_Fm->p_FmFpmRegs->fmfp_cev[i], sizeof(uint32_t)); - } - - DUMP_TITLE(&p_Fm->p_FmFpmRegs->fmfp_ps, ("fmfp_ps")); - DUMP_SUBSTRUCT_ARRAY(i, 64) - { - DUMP_MEMORY(&p_Fm->p_FmFpmRegs->fmfp_ps[i], sizeof(uint32_t)); - } - - DUMP_TITLE(p_Fm->p_FmDmaRegs, ("FM-DMA Regs")); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmsr); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmemsr); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmmr); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmtr); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmhy); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmsetr); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmtah); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmtal); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmtcid); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmra); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmrd); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmwcr); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmebcr); - DUMP_VAR(p_Fm->p_FmDmaRegs,fmdmdcr); - - DUMP_TITLE(&p_Fm->p_FmDmaRegs->fmdmplr, ("fmdmplr")); - - DUMP_SUBSTRUCT_ARRAY(i, FM_MAX_NUM_OF_HW_PORT_IDS/2) - { - DUMP_MEMORY(&p_Fm->p_FmDmaRegs->fmdmplr[i], sizeof(uint32_t)); - } - - DUMP_TITLE(p_Fm->p_FmBmiRegs, ("FM-BMI COMMON Regs")); - DUMP_VAR(p_Fm->p_FmBmiRegs,fmbm_init); - DUMP_VAR(p_Fm->p_FmBmiRegs,fmbm_cfg1); - DUMP_VAR(p_Fm->p_FmBmiRegs,fmbm_cfg2); - DUMP_VAR(p_Fm->p_FmBmiRegs,fmbm_ievr); - DUMP_VAR(p_Fm->p_FmBmiRegs,fmbm_ier); - - DUMP_TITLE(&p_Fm->p_FmBmiRegs->fmbm_arb, ("fmbm_arb")); - DUMP_SUBSTRUCT_ARRAY(i, 8) - { - DUMP_MEMORY(&p_Fm->p_FmBmiRegs->fmbm_arb[i], sizeof(uint32_t)); - } - - DUMP_TITLE(p_Fm->p_FmQmiRegs, ("FM-QMI COMMON Regs")); - DUMP_VAR(p_Fm->p_FmQmiRegs,fmqm_gc); - DUMP_VAR(p_Fm->p_FmQmiRegs,fmqm_eie); - DUMP_VAR(p_Fm->p_FmQmiRegs,fmqm_eien); - DUMP_VAR(p_Fm->p_FmQmiRegs,fmqm_eif); - DUMP_VAR(p_Fm->p_FmQmiRegs,fmqm_ie); - DUMP_VAR(p_Fm->p_FmQmiRegs,fmqm_ien); - DUMP_VAR(p_Fm->p_FmQmiRegs,fmqm_if); - DUMP_VAR(p_Fm->p_FmQmiRegs,fmqm_gs); - DUMP_VAR(p_Fm->p_FmQmiRegs,fmqm_etfc); - DUMP_VAR(p_Fm->p_FmQmiRegs,fmqm_tapc); - - return E_OK; -} -#endif /* (defined(DEBUG_ERRORS) && ... */ - - /****************************************************/ /* Hidden-DEBUG Only API */ diff --git a/drivers/net/ethernet/freescale/fman/inc/ctype_ext.h b/drivers/net/ethernet/freescale/fman/inc/ctype_ext.h deleted file mode 100644 index e3d5d8d..0000000 --- a/drivers/net/ethernet/freescale/fman/inc/ctype_ext.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2008-2012 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#ifndef __CTYPE_EXT_H -#define __CTYPE_EXT_H - - -#if defined(NCSW_LINUX) && defined(__KERNEL__) -/* - * NOTE! This ctype does not handle EOF like the standard C - * library is required to. - */ - -#define _U 0x01 /* upper */ -#define _L 0x02 /* lower */ -#define _D 0x04 /* digit */ -#define _C 0x08 /* cntrl */ -#define _P 0x10 /* punct */ -#define _S 0x20 /* white space (space/lf/tab) */ -#define _X 0x40 /* hex digit */ -#define _SP 0x80 /* hard space (0x20) */ - -extern unsigned char _ctype[]; - -#define __ismask(x) (_ctype[(int)(unsigned char)(x)]) - -#define isalnum(c) ((__ismask(c)&(_U|_L|_D)) != 0) -#define isalpha(c) ((__ismask(c)&(_U|_L)) != 0) -#define iscntrl(c) ((__ismask(c)&(_C)) != 0) -#define isdigit(c) ((__ismask(c)&(_D)) != 0) -#define isgraph(c) ((__ismask(c)&(_P|_U|_L|_D)) != 0) -#define islower(c) ((__ismask(c)&(_L)) != 0) -#define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0) -#define ispunct(c) ((__ismask(c)&(_P)) != 0) -#define isspace(c) ((__ismask(c)&(_S)) != 0) -#define isupper(c) ((__ismask(c)&(_U)) != 0) -#define isxdigit(c) ((__ismask(c)&(_D|_X)) != 0) - -#define isascii(c) (((unsigned char)(c))<=0x7f) -#define toascii(c) (((unsigned char)(c))&0x7f) - -static __inline__ unsigned char __tolower(unsigned char c) -{ - if (isupper(c)) - c -= 'A'-'a'; - return c; -} - -static __inline__ unsigned char __toupper(unsigned char c) -{ - if (islower(c)) - c -= 'a'-'A'; - return c; -} - -#define tolower(c) __tolower(c) -#define toupper(c) __toupper(c) - -#else -#include -#endif /* defined(NCSW_LINUX) && defined(__KERNEL__) */ - - -#endif /* __CTYPE_EXT_H */ diff --git a/drivers/net/ethernet/freescale/fman/src/xx/Makefile b/drivers/net/ethernet/freescale/fman/src/xx/Makefile index 7199b57..3d832a4 100644 --- a/drivers/net/ethernet/freescale/fman/src/xx/Makefile +++ b/drivers/net/ethernet/freescale/fman/src/xx/Makefile @@ -8,5 +8,5 @@ include $(srctree)/drivers/net/ethernet/freescale/fman/ncsw_config.mk obj-y += fsl-ncsw-xx.o -fsl-ncsw-xx-objs := xx_linux.o stdlib.o \ +fsl-ncsw-xx-objs := xx_linux.o \ module_strings.o diff --git a/drivers/net/ethernet/freescale/fman/src/xx/stdlib.c b/drivers/net/ethernet/freescale/fman/src/xx/stdlib.c deleted file mode 100644 index 851bcf1..0000000 --- a/drivers/net/ethernet/freescale/fman/src/xx/stdlib.c +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright 2008-2012 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/*------------------------------------------------------*/ -/* */ -/* File: stdlib.c */ -/* */ -/* Description: */ -/* Standard library routines (externals) */ -/* */ -/* Modifications: */ -/* ============== */ -/* */ -/*------------------------------------------------------*/ -#include "stdlib_ext.h" -#include "stdarg_ext.h" -#include "ctype_ext.h" -#include "string_ext.h" -#include "std_ext.h" -#include "xx_ext.h" - - -#ifdef MODULE -/** - * strtoul - convert a string to an uint32_t - * @cp: The start of the string - * @endp: A pointer to the end of the parsed string will be placed here - * @base: The number base to use - */ -uint32_t strtoul(const char *cp,char **endp,uint32_t base) -{ - uint32_t result = 0,value; - - if (!base) { - base = 10; - if (*cp == '0') { - base = 8; - cp++; - if ((*cp == 'x') && isxdigit(cp[1])) { - cp++; - base = 16; - } - } - } - while (isxdigit(*cp) && - (value = (uint32_t)(isdigit(*cp) ? *cp-'0' : toupper((uint8_t)(*cp))-'A'+10)) < base) { - result = result*base + value; - cp++; - } - if (endp) - *endp = (char *)cp; - return result; -} - -/** - * strtol - convert a string to a int32_t - * @cp: The start of the string - * @endp: A pointer to the end of the parsed string will be placed here - * @base: The number base to use - */ -long strtol(const char *cp,char **endp,uint32_t base) -{ - if(*cp=='-') - return (long)(-strtoul(cp+1,endp,base)); - return (long)strtoul(cp,endp,base); -} - -/** - * strtoull - convert a string to an uint64_t - * @cp: The start of the string - * @endp: A pointer to the end of the parsed string will be placed here - * @base: The number base to use - */ -uint64_t strtoull(const char *cp,char **endp,uint32_t base) -{ - uint64_t result = 0,value; - - if (!base) { - base = 10; - if (*cp == '0') { - base = 8; - cp++; - if ((*cp == 'x') && isxdigit(cp[1])) { - cp++; - base = 16; - } - } - } - while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) - ? toupper((uint8_t)(*cp)) : *cp)-'A'+10) < base) { - result = result*base + value; - cp++; - } - if (endp) - *endp = (char *)cp; - return result; -} - -/** - * strtoll - convert a string to a int64 - * @cp: The start of the string - * @endp: A pointer to the end of the parsed string will be placed here - * @base: The number base to use - */ -long long strtoll(const char *cp,char **endp,uint32_t base) -{ - if(*cp=='-') - return (long long)(-strtoull(cp+1,endp,base)); - return (long long)(strtoull(cp,endp,base)); -} - -/** - * atoi - convert a string to a int - * @s: The start of the string - */ -int atoi(const char *s) -{ - int i=0; - const char **tmp_s = &s; - - while (isdigit(**tmp_s)) - i = i*10 + *((*tmp_s)++) - '0'; - return i; -} - -/** - * strlen - Find the length of a string - * @s: The string to be sized - */ -size_t strlen(const char * s) -{ - const char *sc; - - for (sc = s; *sc != '\0'; ++sc) - /* nothing */; - - return sc - s; -} - -/** - * strnlen - Find the length of a length-limited string - * @s: The string to be sized - * @count: The maximum number of bytes to search - */ -size_t strnlen(const char * s, size_t count) -{ - const char *sc; - - for (sc = s; count-- && *sc != '\0'; ++sc) - /* nothing */; - - return sc - s; -} - -/** - * strcpy - Copy a %NUL terminated string - * @dest: Where to copy the string to - * @src: Where to copy the string from - */ -char * strcpy(char * dest,const char *src) -{ - char *tmp = dest; - - while ((*dest++ = *src++) != '\0') - /* nothing */; - - return tmp; -} -#endif /* MODULE */ - -/** - * strtok - Split a string into tokens - * @s: The string to be searched - * @ct: The characters to search for - * - * WARNING: strtok is deprecated, use strsep instead. - */ -char *___strtok; - -char * strtok(char * s,const char * ct) -{ - char *sbegin, *send; - - sbegin = s ? s : ___strtok; - if (!sbegin) { - return NULL; - } - sbegin += strspn(sbegin,ct); - if (*sbegin == '\0') { - ___strtok = NULL; - return( NULL ); - } - send = strpbrk( sbegin, ct); - if (send && *send != '\0') - *send++ = '\0'; - ___strtok = send; - return (sbegin); -} - - -#ifdef MODULE -/** - * strncpy - Copy a length-limited, %NUL-terminated string - * @dest: Where to copy the string to - * @src: Where to copy the string from - * @count: The maximum number of bytes to copy - * - * Note that unlike userspace strncpy, this does not %NUL-pad the buffer. - * However, the result is not %NUL-terminated if the source exceeds - * @count bytes. - */ -char * strncpy(char * dest,const char *src,size_t count) -{ - char *tmp = dest; - - while (count-- && (*dest++ = *src++) != '\0') - /* nothing */; - - return tmp; -} - -/** - * vsprintf - Format a string and place it in a buffer - * @buf: The buffer to place the result into - * @fmt: The format string to use - * @args: Arguments for the format string - * - * Call this function if you are already dealing with a va_list. - * You probably want sprintf instead. - */ -int vsprintf(char *buf, const char *fmt, va_list args) -{ - return vsnprintf(buf, INT32_MAX, fmt, args); -} -#endif /* MODULE */ -- cgit v0.10.2 From 14d6a9acd8e744191ec489d205c1b1f7515a0eec Mon Sep 17 00:00:00 2001 From: Tudor Ambarus Date: Mon, 11 May 2015 18:29:43 +0300 Subject: crypto: caam - fix warning in APPEND_MATH_IMM_u64 An implicit truncation is done when using a variable of 64 bits in MATH command: warning: large integer implicitly truncated to unsigned type [-Woverflow] Silence the compiler by feeding it with an explicit truncated value. Change-Id: I95e3f397f62f9b850c0c7f26e7079b9d9688b87e Signed-off-by: Tudor Ambarus Reviewed-on: http://git.am.freescale.net:8181/36218 Tested-by: Review Code-CDREVIEW Reviewed-by: Horia Ioan Geanta Neag Reviewed-by: Honghua Yin diff --git a/drivers/crypto/caam/desc_constr.h b/drivers/crypto/caam/desc_constr.h index 112eb29..7d1990c70 100644 --- a/drivers/crypto/caam/desc_constr.h +++ b/drivers/crypto/caam/desc_constr.h @@ -369,7 +369,7 @@ do { \ if (upper) \ append_u64(desc, data); \ else \ - append_u32(desc, data); \ + append_u32(desc, lower_32_bits(data)); \ } while (0) #define append_math_add_imm_u64(desc, dest, src0, src1, data) \ -- cgit v0.10.2 From 86e7a5137b6cd1626a2ee0536236c526fc9427a7 Mon Sep 17 00:00:00 2001 From: Tudor Ambarus Date: Mon, 11 May 2015 18:09:07 +0300 Subject: crypto: caam - tls10 support for 32bit ppc platforms Tested with tcrypt on bsc9132qds platform. Change-Id: Ia8a58b786779e00b267ad3cd2fa05b30d5e17bfb Signed-off-by: Tudor Ambarus Reviewed-on: http://git.am.freescale.net:8181/36219 Reviewed-by: Horia Ioan Geanta Neag Tested-by: Review Code-CDREVIEW Reviewed-by: Honghua Yin diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index ba0c55a..e820381 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c @@ -660,6 +660,12 @@ static int tls_set_sh_desc(struct crypto_aead *aead) unsigned int blocksize = crypto_aead_blocksize(aead); /* Associated data length is always = 13 for TLS */ unsigned int assoclen = 13; + /* + * Pointer Size bool determines the size of address pointers. + * false - Pointers fit in one 32-bit word. + * true - Pointers fit in two 32-bit words. + */ + static const bool ps = (CAAM_PTR_SZ != CAAM_CMD_SZ); if (!ctx->enckeylen || !ctx->authsize) return 0; @@ -917,23 +923,66 @@ static int tls_set_sh_desc(struct crypto_aead *aead) /* VSIL = (payloadlen + icvlen + padlen) - icvlen + padlen */ append_math_sub(desc, VARSEQINLEN, REG3, REG2, 4); - /* move seqoutptr fields into math registers */ - append_move(desc, MOVE_WAITCOMP | MOVE_SRC_DESCBUF | MOVE_DEST_MATH0 | - (54 * 4 << MOVE_OFFSET_SHIFT) | 20); - /* seqinptr will point to seqoutptr */ - append_math_and_imm_u32(desc, REG0, REG0, IMM, - ~(CMD_SEQ_IN_PTR ^ CMD_SEQ_OUT_PTR)); - /* Load jump command */ - jumpback = CMD_JUMP | (char)-9; - append_load_imm_u32(desc, jumpback, LDST_CLASS_DECO | LDST_IMM | - LDST_SRCDST_WORD_DECO_MATH2 | - (4 << LDST_OFFSET_SHIFT)); - append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 1); - /* move updated seqinptr fields to JD */ - append_move(desc, MOVE_WAITCOMP | MOVE_SRC_MATH0 | MOVE_DEST_DESCBUF | - (54 * 4 << MOVE_OFFSET_SHIFT) | 24); - /* read updated seqinptr */ - append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 6); + /* + * Start a new input sequence using the SEQ OUT PTR command options, + * pointer and length used when the current output sequence was defined. + */ + if (ps) { + /* + * Move the lower 32 bits of Shared Descriptor address, the + * SEQ OUT PTR command, Output Pointer (2 words) and + * Output Length into math registers. + */ + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_DESCBUF | + MOVE_DEST_MATH0 | (54 * 4 << MOVE_OFFSET_SHIFT) | + 20); + /* Transform SEQ OUT PTR command in SEQ IN PTR command */ + append_math_and_imm_u32(desc, REG0, REG0, IMM, + ~(CMD_SEQ_IN_PTR ^ CMD_SEQ_OUT_PTR)); + /* Append a JUMP command after the copied fields */ + jumpback = CMD_JUMP | (char)-9; + append_load_imm_u32(desc, jumpback, LDST_CLASS_DECO | LDST_IMM | + LDST_SRCDST_WORD_DECO_MATH2 | + (4 << LDST_OFFSET_SHIFT)); + append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 1); + /* Move the updated fields back to the Job Descriptor */ + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_MATH0 | + MOVE_DEST_DESCBUF | (54 * 4 << MOVE_OFFSET_SHIFT) | + 24); + /* + * Read the new SEQ IN PTR command, Input Pointer, Input Length + * and then jump back to the next command from the + * Shared Descriptor. + */ + append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 6); + } else { + /* + * Move the SEQ OUT PTR command, Output Pointer (1 word) and + * Output Length into math registers. + */ + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_DESCBUF | + MOVE_DEST_MATH0 | (53 * 4 << MOVE_OFFSET_SHIFT) | + 12); + /* Transform SEQ OUT PTR command in SEQ IN PTR command */ + append_math_and_imm_u64(desc, REG0, REG0, IMM, + ~(((u64)(CMD_SEQ_IN_PTR ^ CMD_SEQ_OUT_PTR)) << 32)); + /* Append a JUMP command after the copied fields */ + jumpback = CMD_JUMP | (char)-7; + append_load_imm_u32(desc, jumpback, LDST_CLASS_DECO | LDST_IMM | + LDST_SRCDST_WORD_DECO_MATH1 | + (4 << LDST_OFFSET_SHIFT)); + append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 1); + /* Move the updated fields back to the Job Descriptor */ + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_MATH0 | + MOVE_DEST_DESCBUF | (53 * 4 << MOVE_OFFSET_SHIFT) | + 16); + /* + * Read the new SEQ IN PTR command, Input Pointer, Input Length + * and then jump back to the next command from the + * Shared Descriptor. + */ + append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 5); + } /* skip payload */ append_seq_fifo_load(desc, 0, FIFOLD_CLASS_SKIP | FIFOLDST_VLF); -- cgit v0.10.2 From ffa9ec2473a74f839971ec84f4394820d06e6925 Mon Sep 17 00:00:00 2001 From: Alex Porosanu Date: Tue, 12 May 2015 07:54:23 +0300 Subject: crypto: caam - add support for MOVEB command CHAs of SEC work natively in BE mode. When moving data to the alignment blocks, swapping is needed for LE platforms. This is done by means of the MOVEB command (introduced in ERA 7). This patch adds support to DCL for this command. Change-Id: Ie74f2d8a1cf101acd5a23686ff8eb835d1a1f047 Signed-off-by: Alex Porosanu Reviewed-on: http://git.am.freescale.net:8181/36365 Tested-by: Review Code-CDREVIEW Reviewed-by: Tudor-Dan Ambarus Reviewed-by: Horia Ioan Geanta Neag Reviewed-by: Honghua Yin diff --git a/drivers/crypto/caam/desc.h b/drivers/crypto/caam/desc.h index 03efd6e..e57fefa 100644 --- a/drivers/crypto/caam/desc.h +++ b/drivers/crypto/caam/desc.h @@ -38,6 +38,7 @@ struct sec4_sg_entry { #define CMD_SEQ_LOAD (0x03 << CMD_SHIFT) #define CMD_FIFO_LOAD (0x04 << CMD_SHIFT) #define CMD_SEQ_FIFO_LOAD (0x05 << CMD_SHIFT) +#define CMD_MOVEB (0x07 << CMD_SHIFT) #define CMD_STORE (0x0a << CMD_SHIFT) #define CMD_SEQ_STORE (0x0b << CMD_SHIFT) #define CMD_FIFO_STORE (0x0c << CMD_SHIFT) diff --git a/drivers/crypto/caam/desc_constr.h b/drivers/crypto/caam/desc_constr.h index 7d1990c70..12a0eda 100644 --- a/drivers/crypto/caam/desc_constr.h +++ b/drivers/crypto/caam/desc_constr.h @@ -167,6 +167,7 @@ static inline u32 *append_##cmd(u32 *desc, u32 options) \ } APPEND_CMD_RET(jump, JUMP) APPEND_CMD_RET(move, MOVE) +APPEND_CMD_RET(moveb, MOVEB) static inline void set_jump_tgt_here(u32 *desc, u32 *jump_cmd) { -- cgit v0.10.2 From 4fdd20544205a52488783479b2da53f3bf51d081 Mon Sep 17 00:00:00 2001 From: Alex Porosanu Date: Tue, 12 May 2015 08:09:25 +0300 Subject: crypto: caam - fix TLS processing for SEC in LE mode In order to process TLS data that is received in network byte order, a swap is needed for a SEC block working in little endian mode. This is done by using the MOVEB command. Change-Id: I8290ad7348d9e66169c05eff8bda71e587beb0a9 Signed-off-by: Alex Porosanu Reviewed-on: http://git.am.freescale.net:8181/36369 Tested-by: Review Code-CDREVIEW Reviewed-by: Tudor-Dan Ambarus Reviewed-by: Honghua Yin diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index e820381..ea44991 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c @@ -884,6 +884,10 @@ static int tls_set_sh_desc(struct crypto_aead *aead) /* VSOL = payloadlen + icvlen + padlen */ append_math_add(desc, VARSEQOUTLEN, ZERO, REG3, 4); +#ifdef __LITTLE_ENDIAN + append_moveb(desc, MOVE_WAITCOMP | + MOVE_SRC_MATH0 | MOVE_DEST_MATH0 | 8); +#endif /* update Len field */ append_math_sub(desc, REG0, REG0, REG2, 8); @@ -933,9 +937,15 @@ static int tls_set_sh_desc(struct crypto_aead *aead) * SEQ OUT PTR command, Output Pointer (2 words) and * Output Length into math registers. */ +#ifdef __LITTLE_ENDIAN + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_DESCBUF | + MOVE_DEST_MATH0 | (55 * 4 << MOVE_OFFSET_SHIFT) | + 20); +#else append_move(desc, MOVE_WAITCOMP | MOVE_SRC_DESCBUF | MOVE_DEST_MATH0 | (54 * 4 << MOVE_OFFSET_SHIFT) | 20); +#endif /* Transform SEQ OUT PTR command in SEQ IN PTR command */ append_math_and_imm_u32(desc, REG0, REG0, IMM, ~(CMD_SEQ_IN_PTR ^ CMD_SEQ_OUT_PTR)); @@ -946,9 +956,15 @@ static int tls_set_sh_desc(struct crypto_aead *aead) (4 << LDST_OFFSET_SHIFT)); append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 1); /* Move the updated fields back to the Job Descriptor */ +#ifdef __LITTLE_ENDIAN + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_MATH0 | + MOVE_DEST_DESCBUF | (55 * 4 << MOVE_OFFSET_SHIFT) | + 24); +#else append_move(desc, MOVE_WAITCOMP | MOVE_SRC_MATH0 | MOVE_DEST_DESCBUF | (54 * 4 << MOVE_OFFSET_SHIFT) | 24); +#endif /* * Read the new SEQ IN PTR command, Input Pointer, Input Length * and then jump back to the next command from the @@ -960,9 +976,15 @@ static int tls_set_sh_desc(struct crypto_aead *aead) * Move the SEQ OUT PTR command, Output Pointer (1 word) and * Output Length into math registers. */ +#ifdef __LITTLE_ENDIAN + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_DESCBUF | + MOVE_DEST_MATH0 | (54 * 4 << MOVE_OFFSET_SHIFT) | + 12); +#else append_move(desc, MOVE_WAITCOMP | MOVE_SRC_DESCBUF | MOVE_DEST_MATH0 | (53 * 4 << MOVE_OFFSET_SHIFT) | 12); +#endif /* Transform SEQ OUT PTR command in SEQ IN PTR command */ append_math_and_imm_u64(desc, REG0, REG0, IMM, ~(((u64)(CMD_SEQ_IN_PTR ^ CMD_SEQ_OUT_PTR)) << 32)); @@ -973,9 +995,15 @@ static int tls_set_sh_desc(struct crypto_aead *aead) (4 << LDST_OFFSET_SHIFT)); append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 1); /* Move the updated fields back to the Job Descriptor */ +#ifdef __LITTLE_ENDIAN + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_MATH0 | + MOVE_DEST_DESCBUF | (54 * 4 << MOVE_OFFSET_SHIFT) | + 16); +#else append_move(desc, MOVE_WAITCOMP | MOVE_SRC_MATH0 | MOVE_DEST_DESCBUF | (53 * 4 << MOVE_OFFSET_SHIFT) | 16); +#endif /* * Read the new SEQ IN PTR command, Input Pointer, Input Length * and then jump back to the next command from the -- cgit v0.10.2 From ed306324dd1583499ab4c98ca30754ba179d5662 Mon Sep 17 00:00:00 2001 From: Mandy Lavi Date: Tue, 19 May 2015 13:58:01 +0900 Subject: fmd: fix buffer overflow in dsar sysfs printouts Change-Id: Id5ecb2f85caea934dc3de2b69e538af45316e14f Signed-off-by: Mandy Lavi Reviewed-on: http://git.am.freescale.net:8181/36567 Tested-by: Review Code-CDREVIEW Reviewed-by: Eyal Harari Reviewed-by: Honghua Yin 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 0cdf6a8..bd62011 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 @@ -380,7 +380,7 @@ static int fm_port_dsar_dump_regs(void *h_dev, char *buf, int nn) FM_DMP_LN(buf, n, "control bits 0x%04x\n", ArpDescriptor->control); if (ArpDescriptor->numOfBindings) { - char ip_str[20]; + char ip_str[100]; t_DsarArpBindingEntry* bindings = ioremap( ioread32be(&ArpDescriptor->p_Bindings) + p_FmPort->fmMuramPhysBaseAddr, @@ -390,8 +390,11 @@ static int fm_port_dsar_dump_regs(void *h_dev, char *buf, int nn) FM_DMP_LN(buf, n, " ip vlan id\n"); for (i = 0; i < ArpDescriptor->numOfBindings; i++) { - n += sprintf(ip_str, "%d:%d:%d:%d", ip_addr[0], ip_addr[1], ip_addr[2], ip_addr[3]); - FM_DMP_LN(buf, n, "%-15s 0x%x\n", ip_str, bindings->vlanId); + n += snprintf(ip_str, 100, "%d.%d.%d.%d", + ip_addr[0], ip_addr[1], + ip_addr[2], ip_addr[3]); + FM_DMP_LN(buf, n, "%-15s 0x%x\n", + ip_str, bindings->vlanId); } iounmap(bindings); } @@ -427,7 +430,7 @@ static int fm_port_dsar_dump_regs(void *h_dev, char *buf, int nn) FM_DMP_LN(buf, n, "control bits 0x%04x\n", ICMPV4Descriptor->control); if (ICMPV4Descriptor->numOfBindings) { - char ip_str[20]; + char ip_str[100]; t_DsarArpBindingEntry* bindings = ioremap( ioread32be(&ICMPV4Descriptor->p_Bindings) + p_FmPort->fmMuramPhysBaseAddr, @@ -437,8 +440,11 @@ static int fm_port_dsar_dump_regs(void *h_dev, char *buf, int nn) FM_DMP_LN(buf, n, " ip vlan id\n"); for (i = 0; i < ICMPV4Descriptor->numOfBindings; i++) { - n += sprintf(ip_str, "%d:%d:%d:%d", ip_addr[0], ip_addr[1], ip_addr[2], ip_addr[3]); - FM_DMP_LN(buf, n, "%-15s 0x%x\n", ip_str, bindings->vlanId); + n += snprintf(ip_str, 100, "%d.%d.%d.%d", + ip_addr[0], ip_addr[1], + ip_addr[2], ip_addr[3]); + FM_DMP_LN(buf, n, "%-15s 0x%x\n", + ip_str, bindings->vlanId); } iounmap(bindings); } @@ -470,7 +476,7 @@ static int fm_port_dsar_dump_regs(void *h_dev, char *buf, int nn) FM_DMP_LN(buf, n, "solicited address 0x%08x\n", NDDescriptor->solicitedAddr); if (NDDescriptor->numOfBindings) { - char ip_str[20]; + char ip_str[100]; t_DsarIcmpV6BindingEntry* bindings = ioremap( ioread32be(&NDDescriptor->p_Bindings) + p_FmPort->fmMuramPhysBaseAddr, @@ -480,7 +486,8 @@ static int fm_port_dsar_dump_regs(void *h_dev, char *buf, int nn) FM_DMP_LN(buf, n, " ip vlan id\n"); for (i = 0; i < NDDescriptor->numOfBindings; i++) { - n += sprintf(ip_str, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x", + n += snprintf(ip_str, 100, + "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x", ip_addr[0], ip_addr[1], ip_addr[2], ip_addr[3], ip_addr[4], ip_addr[5], ip_addr[6], ip_addr[7]); FM_DMP_LN(buf, n, "%s 0x%x\n", ip_str, bindings->vlanId); @@ -516,7 +523,7 @@ static int fm_port_dsar_dump_regs(void *h_dev, char *buf, int nn) FM_DMP_LN(buf, n, "control bits 0x%04x\n", ICMPV6Descriptor->control); if (ICMPV6Descriptor->numOfBindings) { - char ip_str[20]; + char ip_str[100]; t_DsarIcmpV6BindingEntry* bindings = ioremap( ioread32be(&ICMPV6Descriptor->p_Bindings) + p_FmPort->fmMuramPhysBaseAddr, @@ -526,7 +533,8 @@ static int fm_port_dsar_dump_regs(void *h_dev, char *buf, int nn) FM_DMP_LN(buf, n, " ip vlan id\n"); for (i = 0; i < ICMPV6Descriptor->numOfBindings; i++) { - n += sprintf(ip_str, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x", + n += snprintf(ip_str, 100, + "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x", ip_addr[0], ip_addr[1], ip_addr[2], ip_addr[3], ip_addr[4], ip_addr[5], ip_addr[6], ip_addr[7]); FM_DMP_LN(buf, n, "%s 0x%x\n", ip_str, bindings->vlanId); @@ -560,7 +568,7 @@ static int fm_port_dsar_dump_regs(void *h_dev, char *buf, int nn) FM_DMP_LN(buf, n, "max message length 0x%04x\n", SnmpDescriptor->maxSnmpMsgLength); if (SnmpDescriptor->numOfIpv4Addresses) { - char ip_str[20]; + char ip_str[100]; t_DsarSnmpIpv4AddrTblEntry* addrs = ioremap( ioread32be(&SnmpDescriptor->p_Ipv4AddrTbl) + p_FmPort->fmMuramPhysBaseAddr, @@ -570,7 +578,9 @@ static int fm_port_dsar_dump_regs(void *h_dev, char *buf, int nn) FM_DMP_LN(buf, n, " ip vlan id\n"); for (i = 0; i < SnmpDescriptor->numOfIpv4Addresses; i++) { - n += sprintf(ip_str, "%d:%d:%d:%d", ip_addr[0], ip_addr[1], ip_addr[2], ip_addr[3]); + n += snprintf(ip_str, 100, "%d.%d.%d.%d", + ip_addr[0], ip_addr[1], + ip_addr[2], ip_addr[3]); FM_DMP_LN(buf, n, "%-15s 0x%x\n", ip_str, addrs->vlanId); } iounmap(addrs); -- cgit v0.10.2 From cffaa48ffefae00664bdb0bba446e9de799afe23 Mon Sep 17 00:00:00 2001 From: Ahmed Mansour Date: Thu, 14 May 2015 12:09:05 -0400 Subject: qbman: Fix qman_ceetm_cscn_dcp_get() Corrections to struct qm_mcr_ceetm_ccgr_query to match block guide Corrections to qman_ceetm_cscn_dcp_get() bit manipulation to match bit order in block guide Signed-off-by: Ahmed Mansour Change-Id: I78d730263495358c29be766933aceae9d5b36326 Reviewed-on: http://git.am.freescale.net:8181/36407 Tested-by: Review Code-CDREVIEW Reviewed-by: Haiying Wang Reviewed-by: Roy Pledge Reviewed-by: Honghua Yin diff --git a/drivers/staging/fsl_qbman/qman_high.c b/drivers/staging/fsl_qbman/qman_high.c index 565de9e..1f5102a 100644 --- a/drivers/staging/fsl_qbman/qman_high.c +++ b/drivers/staging/fsl_qbman/qman_high.c @@ -4963,7 +4963,7 @@ int qman_ceetm_cscn_dcp_get(struct qm_ceetm_ccg *ccg, *vcgid = query_result.cm_query.cdv; *cscn_enabled = (query_result.cm_query.cscn_targ_dcp >> - (7 - dcp_idx)) & 0x1; + dcp_idx) & 0x1; return 0; } EXPORT_SYMBOL(qman_ceetm_cscn_dcp_get); diff --git a/include/linux/fsl_qman.h b/include/linux/fsl_qman.h index 95fdd38..824652c 100644 --- a/include/linux/fsl_qman.h +++ b/include/linux/fsl_qman.h @@ -1245,8 +1245,8 @@ struct qm_mcr_ceetm_ccgr_query { struct qm_cgr_wr_parm wr_parm_g; struct qm_cgr_wr_parm wr_parm_y; struct qm_cgr_wr_parm wr_parm_r; - u8 cscn_targ_dcp; - u16 dcp_lsn; + u16 cscn_targ_dcp; + u8 dcp_lsn; u64 i_cnt:40; u8 __reserved4[3]; u64 a_cnt:40; -- cgit v0.10.2 From 7191bc627c7038611663f90c7dd053733bc5586b Mon Sep 17 00:00:00 2001 From: Tudor Ambarus Date: Fri, 15 May 2015 16:48:49 +0300 Subject: crypto: caampkc - workaround for erratum A-006899 The problem will occur only in T1040R1. A workaround has been verified; set a Scatter Gather (SG) flag on the Q or G Pointers on KPG, which will give the PKHA unload time to complete. It's sufficient to have the SG flag set for only one of these. Change-Id: I5a403576c6e995110227872c84de7e74da0144c5 Signed-off-by: Tudor Ambarus Reviewed-on: http://git.am.freescale.net:8181/36617 Tested-by: Review Code-CDREVIEW Reviewed-by: Horia Ioan Geanta Neag Reviewed-by: Honghua Yin diff --git a/drivers/crypto/caam/caampkc.c b/drivers/crypto/caam/caampkc.c index f98abfb..e9944a4 100644 --- a/drivers/crypto/caam/caampkc.c +++ b/drivers/crypto/caam/caampkc.c @@ -30,6 +30,12 @@ struct caam_pkc_context_s { struct device *dev; }; +struct caam_pkc_alg { + struct list_head entry; + struct device *ctrldev; + struct crypto_alg crypto_alg; +}; + static void rsa_unmap(struct device *dev, struct rsa_edesc *edesc, struct pkc_request *req) { @@ -484,6 +490,10 @@ static int caam_keygen_edesc(struct pkc_request *req, { struct crypto_pkc *tfm = crypto_pkc_reqtfm(req); struct caam_pkc_context_s *ctxt = crypto_pkc_ctx(tfm); + struct crypto_alg *alg = crypto_pkc_tfm(tfm)->__crt_alg; + struct caam_pkc_alg *caam_alg = + container_of(alg, struct caam_pkc_alg, crypto_alg); + struct caam_drv_private *caam_priv = dev_get_drvdata(caam_alg->ctrldev); struct device *dev = ctxt->dev; struct keygen_req_s *key_req = &req->req_u.keygen; @@ -491,6 +501,7 @@ static int caam_keygen_edesc(struct pkc_request *req, edesc->n_len = key_req->r_len; edesc->req_type = req->type; edesc->curve_type = req->curve_type; + edesc->erratum_A_006899 = caam_priv->errata & SEC_ERRATUM_A_006899; edesc->q_dma = dma_map_single(dev, key_req->q, key_req->q_len, DMA_TO_DEVICE); @@ -513,6 +524,20 @@ static int caam_keygen_edesc(struct pkc_request *req, goto g_map_fail; } + if (edesc->erratum_A_006899) { + dma_to_sec4_sg_one(&(edesc->g_sg), edesc->g_dma, + key_req->g_len, 0); + edesc->g_sg.len |= SEC4_SG_LEN_FIN; + + edesc->g_sg_dma = dma_map_single(dev, &(edesc->g_sg), + sizeof(struct sec4_sg_entry), + DMA_TO_DEVICE); + if (dma_mapping_error(dev, edesc->g_sg_dma)) { + dev_err(dev, "unable to map S/G table\n"); + goto g_sg_dma_fail; + } + } + edesc->key_dma = dma_map_single(dev, key_req->pub_key, key_req->pub_key_len, DMA_FROM_DEVICE); if (dma_mapping_error(dev, edesc->key_dma)) { @@ -545,6 +570,10 @@ s_map_fail: dma_unmap_single(dev, edesc->key_dma, key_req->pub_key_len, DMA_FROM_DEVICE); key_map_fail: + if (edesc->erratum_A_006899) + dma_unmap_single(dev, edesc->g_sg_dma, key_req->g_len, + DMA_TO_DEVICE); +g_sg_dma_fail: dma_unmap_single(dev, edesc->g_dma, key_req->g_len, DMA_TO_DEVICE); g_map_fail: dma_unmap_single(dev, edesc->r_dma, key_req->r_len, DMA_TO_DEVICE); @@ -1324,12 +1353,6 @@ static struct caam_pkc_template driver_pkc[] = { } }; -struct caam_pkc_alg { - struct list_head entry; - struct device *ctrldev; - struct crypto_alg crypto_alg; -}; - /* Per session pkc's driver context creation function */ static int caam_pkc_cra_init(struct crypto_tfm *tfm) { diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 7a22427..321deb0 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -480,6 +480,7 @@ static int caam_probe(struct platform_device *pdev) { int ret, ring, rspec; u64 caam_id; + u32 caam_id_ms; struct device *dev; struct device_node *nprop, *np; struct caam_ctrl __iomem *ctrl; @@ -660,7 +661,12 @@ static int caam_probe(struct platform_device *pdev) /* NOTE: RTIC detection ought to go here, around Si time */ ctrlpriv->era = caam_get_era(); - caam_id = (u64)rd_reg32(&ctrl->perfmon.caam_id_ms) << 32 | + + caam_id_ms = rd_reg32(&ctrl->perfmon.caam_id_ms); + if (caam_id_ms == SEC_ID_MS_T1040) + ctrlpriv->errata |= SEC_ERRATUM_A_006899; + + caam_id = (u64)caam_id_ms << 32 | (u64)rd_reg32(&ctrl->perfmon.caam_id_ls); /* Report "alive" for developer to see */ diff --git a/drivers/crypto/caam/intern.h b/drivers/crypto/caam/intern.h index 43596fe..9faf832 100644 --- a/drivers/crypto/caam/intern.h +++ b/drivers/crypto/caam/intern.h @@ -95,6 +95,11 @@ struct caam_drv_private { struct list_head pkc_list; int era; /* SEC Era */ + +#define SEC_ERRATUM_A_006899 0x01 + /* SEC errata bitmask */ + u32 errata; + int virt_en; /* Virtualization enabled in CAAM */ #define RNG4_MAX_HANDLES 2 diff --git a/drivers/crypto/caam/pkc_desc.c b/drivers/crypto/caam/pkc_desc.c index 5bcf5d3..2e81519 100644 --- a/drivers/crypto/caam/pkc_desc.c +++ b/drivers/crypto/caam/pkc_desc.c @@ -271,10 +271,15 @@ void *caam_keygen_desc(struct dsa_edesc_s *edesc) (start_idx << HDR_START_IDX_SHIFT) | (start_idx & HDR_DESCLEN_MASK) | HDR_ONE); ecc_desc->sgf_ln = (edesc->l_len << DSA_PDB_L_SHIFT) | - ((edesc->n_len & DSA_PDB_N_MASK)); + (edesc->n_len & DSA_PDB_N_MASK); + if (edesc->erratum_A_006899) { + ecc_desc->sgf_ln |= DSA_PDB_SGF_G; + ecc_desc->g_dma = edesc->g_sg_dma; + } else { + ecc_desc->g_dma = edesc->g_dma; + } ecc_desc->q_dma = edesc->q_dma; ecc_desc->r_dma = edesc->r_dma; - ecc_desc->g_dma = edesc->g_dma; ecc_desc->s_dma = edesc->s_dma; ecc_desc->w_dma = edesc->key_dma; ecc_desc->ab_dma = edesc->ab_dma; diff --git a/drivers/crypto/caam/pkc_desc.h b/drivers/crypto/caam/pkc_desc.h index 03013c2..e859e40 100644 --- a/drivers/crypto/caam/pkc_desc.h +++ b/drivers/crypto/caam/pkc_desc.h @@ -20,6 +20,7 @@ #include "desc_constr.h" #include "jr.h" #include "error.h" +#include "sg_sw_sec4.h" #include #include "pdb.h" @@ -187,8 +188,11 @@ struct dsa_edesc_s { dma_addr_t d_dma; dma_addr_t ab_dma; dma_addr_t g_dma; + dma_addr_t g_sg_dma; dma_addr_t tmp_dma; uint8_t *tmp; /* Allocate locally for dsa_verify */ + struct sec4_sg_entry g_sg; + bool erratum_A_006899; u32 hw_desc[]; }; diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h index 928cb53..72193f8 100644 --- a/drivers/crypto/caam/regs.h +++ b/drivers/crypto/caam/regs.h @@ -182,6 +182,8 @@ struct sec_vid { u8 min_rev; }; +#define SEC_ID_MS_T1040 0x0A120400 + struct caam_perfmon { /* Performance Monitor Registers f00-f9f */ u64 req_dequeued; /* PC_REQ_DEQ - Dequeued Requests */ diff --git a/drivers/crypto/caam/sg_sw_sec4.h b/drivers/crypto/caam/sg_sw_sec4.h index eef6345..752134c 100644 --- a/drivers/crypto/caam/sg_sw_sec4.h +++ b/drivers/crypto/caam/sg_sw_sec4.h @@ -90,9 +90,9 @@ static inline int sg_count(struct scatterlist *sg_list, int nbytes, return sg_nents; } -static int dma_map_sg_chained(struct device *dev, struct scatterlist *sg, - unsigned int nents, enum dma_data_direction dir, - bool chained) +static int __maybe_unused dma_map_sg_chained(struct device *dev, + struct scatterlist *sg, unsigned int nents, enum dma_data_direction dir, + bool chained) { if (!sg || !nents) return 0; @@ -109,9 +109,9 @@ static int dma_map_sg_chained(struct device *dev, struct scatterlist *sg, return nents; } -static void dma_unmap_sg_chained(struct device *dev, struct scatterlist *sg, - unsigned int nents, enum dma_data_direction dir, - bool chained) +static void __maybe_unused dma_unmap_sg_chained(struct device *dev, + struct scatterlist *sg, unsigned int nents, enum dma_data_direction dir, + bool chained) { if (!sg || !nents) return; -- cgit v0.10.2 From aea16084b7cb5e4b7625df0d39dbc7f27ff2f5e9 Mon Sep 17 00:00:00 2001 From: Shengzhou Liu Date: Tue, 19 May 2015 11:01:52 +0800 Subject: board/t1023rdb: add ina220 current sense node Add support for INA220 current sense. Signed-off-by: Shengzhou Liu Change-Id: I8a09e9a41219ce5d31bf8744be1552927cd0b302 Reviewed-on: http://git.am.freescale.net:8181/36538 Tested-by: Review Code-CDREVIEW Reviewed-by: Xiaobo Xie Reviewed-by: Honghua Yin diff --git a/arch/powerpc/boot/dts/t1023rdb.dts b/arch/powerpc/boot/dts/t1023rdb.dts index 0fd8dc8..7db5093 100644 --- a/arch/powerpc/boot/dts/t1023rdb.dts +++ b/arch/powerpc/boot/dts/t1023rdb.dts @@ -107,7 +107,17 @@ }; i2c@118100 { + ina220@40 { + compatible = "ti,ina220"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + ina220@41 { + compatible = "ti,ina220"; + reg = <0x41>; + shunt-resistor = <1000>; + }; }; fman0: fman@400000 { -- cgit v0.10.2 From 7df35d1df29c3a96cc5e4138a98d2a37efcc0d26 Mon Sep 17 00:00:00 2001 From: Shengzhou Liu Date: Tue, 19 May 2015 11:51:53 +0800 Subject: t1024rdb/dts: add ina220 current sense node Add support for INA220 current sense. Signed-off-by: Shengzhou Liu Change-Id: I08f12b33f73528abc681bfa34027b28eea9dc45b Reviewed-on: http://git.am.freescale.net:8181/36539 Tested-by: Review Code-CDREVIEW Reviewed-by: Xiaobo Xie Reviewed-by: Honghua Yin diff --git a/arch/powerpc/boot/dts/t1024rdb.dts b/arch/powerpc/boot/dts/t1024rdb.dts index af52aeb..559a422 100644 --- a/arch/powerpc/boot/dts/t1024rdb.dts +++ b/arch/powerpc/boot/dts/t1024rdb.dts @@ -126,6 +126,13 @@ reg = <0x4c>; }; + /* INA220 Current Sense */ + ina220@40 { + compatible = "ti,ina220"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + eeprom@50 { compatible = "at24,24c256"; reg = <0x50>; -- cgit v0.10.2 From a43259698c278230c46e10996b9894a2a4ba7fda Mon Sep 17 00:00:00 2001 From: Ahmed Mansour Date: Tue, 19 May 2015 17:08:32 -0400 Subject: pme: Protect against possible NULL dereference Add BUG_ON to prevent NULL dereference if ctx->flags indicate flow mode (none direct mode) then a call back token must be specified otherwise the call back token can be passed NULL Signed-off-by: Ahmed Mansour Change-Id: I20f95b2fd77699eb32ef54515666127ebc6b1743 Reviewed-on: http://git.am.freescale.net:8181/36607 Tested-by: Review Code-CDREVIEW Reviewed-by: Roy Pledge Reviewed-by: Haiying Wang Reviewed-by: Mahammad Ismayilzada Reviewed-by: Honghua Yin diff --git a/drivers/staging/fsl_pme2/pme2_high.c b/drivers/staging/fsl_pme2/pme2_high.c index 094ee9d..12ab7a1 100644 --- a/drivers/staging/fsl_pme2/pme2_high.c +++ b/drivers/staging/fsl_pme2/pme2_high.c @@ -727,6 +727,9 @@ static inline int __update_flow(struct pme_ctx *ctx, u32 flags, BUG_ON(ctx->flags & PME_CTX_FLAG_DIRECT); if (!hw_res) return -ENOMEM; + /* Direct mode is not enabled. Therefore the call back token must not + * be NULL */ + BUG_ON(!token); token->internal_flow_ptr = pme_hw_flow_new(); if (!token->internal_flow_ptr) { pme_hw_residue_free(hw_res); -- cgit v0.10.2 From 4e171757017a9dd7183255d4680f256ec5e4b5d4 Mon Sep 17 00:00:00 2001 From: Ahmed Mansour Date: Tue, 19 May 2015 17:58:24 -0400 Subject: fsl_usdpaa: Protect against truncation is_power_of_2 is a Linux function that takes unsigned long. it was used by our new function is_power_of_4 which takes u64. Trucation is possible because unsigned long is 32 bits wide in 32 bit applications. This patch removes the dependancy on is_power_of_2 to solve this issue Signed-off-by: Ahmed Mansour Change-Id: I5939e7e6457e07e9355ba54fef80a7bc71c3a64b Reviewed-on: http://git.am.freescale.net:8181/36609 Tested-by: Review Code-CDREVIEW Reviewed-by: Mahammad Ismayilzada Reviewed-by: Honghua Yin diff --git a/drivers/staging/fsl_qbman/fsl_usdpaa.c b/drivers/staging/fsl_qbman/fsl_usdpaa.c index dfef598..e2e3308 100644 --- a/drivers/staging/fsl_qbman/fsl_usdpaa.c +++ b/drivers/staging/fsl_qbman/fsl_usdpaa.c @@ -195,9 +195,9 @@ static u32 largest_page_size(u32 size) /* Determine if value is power of 4 */ static inline bool is_power_of_4(u64 x) { - if (!is_power_of_2(x)) + if (x == 0 || ((x & (x - 1)) != 0)) return false; - return !!(x & 0x5555555555555555ul); + return !!(x & 0x5555555555555555ull); } /* Helper for ioctl_dma_map() when we have a larger fragment than we need. This -- cgit v0.10.2 From 88d1f2201d74648b81ff17325f6b635d19c06648 Mon Sep 17 00:00:00 2001 From: Mahammad Ismayilzada Date: Wed, 20 May 2015 14:34:22 -0400 Subject: qbman: Fix null pointer issue bufs passed as NULL and dereferenced. Replaced with local variable. Signed-off-by: Mahammad Ismayilzada Change-Id: I39aecee95b086567a21487ee2b751126aa0777f1 Reviewed-on: http://git.am.freescale.net:8181/36648 Tested-by: Review Code-CDREVIEW Reviewed-by: Haiying Wang Reviewed-by: Roy Pledge Reviewed-by: Honghua Yin diff --git a/drivers/staging/fsl_qbman/bman_test_high.c b/drivers/staging/fsl_qbman/bman_test_high.c index 7bdd181..4676fb0 100644 --- a/drivers/staging/fsl_qbman/bman_test_high.c +++ b/drivers/staging/fsl_qbman/bman_test_high.c @@ -165,7 +165,9 @@ do_loop: BUG_ON(tmp != num); i -= num; } - i = bman_acquire(pool, NULL, 1, 0); + + struct bm_buffer tmp_buf; + i = bman_acquire(pool, &tmp_buf, 1, 0); BUG_ON(i > 0); bufs_confirm(); -- cgit v0.10.2 From 3be643b5c235100cde3580186419ac8661f97fba Mon Sep 17 00:00:00 2001 From: Mahammad Ismayilzada Date: Wed, 20 May 2015 15:00:35 -0400 Subject: dce: Typo correction slab_scr_128b should be checked for NULL. Signed-off-by: Mahammad Ismayilzada Change-Id: I51f5b7c96fbee9a0f1baf2340ff97b23caed434e Reviewed-on: http://git.am.freescale.net:8181/36649 Reviewed-by: Haiying Wang Tested-by: Review Code-CDREVIEW Reviewed-by: Roy Pledge Reviewed-by: Honghua Yin diff --git a/drivers/staging/fsl_dce/dce_sys.c b/drivers/staging/fsl_dce/dce_sys.c index 29ad636..d865d90 100644 --- a/drivers/staging/fsl_dce/dce_sys.c +++ b/drivers/staging/fsl_dce/dce_sys.c @@ -87,7 +87,7 @@ static int dce_sys_init(void) slab_scr_128b = kmem_cache_create("fsl_dce_scr_128b", sizeof(struct scf_128b), /* 128 byte size */ DCE_SCR_ALIGN, SLAB_HWCACHE_ALIGN, NULL); - if (!slab_scr_64b) + if (!slab_scr_128b) goto end; slab_compress_history = kmem_cache_create("fsl_dce_compress_history", DCE_COMP_HISTORY_SIZE, -- cgit v0.10.2 From b207d2c887415a6b501249f3c3f067f266cc8b86 Mon Sep 17 00:00:00 2001 From: Hou Zhiqiang Date: Thu, 21 May 2015 23:32:40 +0800 Subject: spi-nor: Add the SPI Flash RESET commands Signed-off-by: Hou Zhiqiang Change-Id: I1ec25215b53c3edd542c2afb5d6cc820ef2de041 Reviewed-on: http://git.am.freescale.net:8181/36724 Tested-by: Review Code-CDREVIEW Reviewed-by: Mingkai Hu Reviewed-by: Honghua Yin diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index bde191c..c3d6651 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -38,6 +38,8 @@ #define SPINOR_OP_RDID 0x9f /* Read JEDEC ID */ #define SPINOR_OP_RDCR 0x35 /* Read configuration register */ #define SPINOR_OP_RDFSR 0x70 /* Read flag status register */ +#define SPINOR_OP_RESET_EN 0x66 /* Reset enable */ +#define SPINOR_OP_RESET_MEM 0x99 /* Reset memory */ /* 4-byte address opcodes - used on Spansion and some Macronix flashes. */ #define SPINOR_OP_READ4 0x13 /* Read data bytes (low frequency) */ -- cgit v0.10.2 From 325fb9fc577c522242003b124eca933a6b4bcba6 Mon Sep 17 00:00:00 2001 From: Hou Zhiqiang Date: Thu, 21 May 2015 23:34:56 +0800 Subject: mtd: m25p80: add reset process before suspend Make sure the SPI Flash into reset state. Signed-off-by: Hou Zhiqiang Change-Id: I627606256571b80ba80a5a84a25b52685e799b0c Reviewed-on: http://git.am.freescale.net:8181/36725 Tested-by: Review Code-CDREVIEW Reviewed-by: Mingkai Hu Reviewed-by: Honghua Yin diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index fa5e463..d531b1e 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -26,6 +26,7 @@ #include #include #include +#include #define MAX_CMD_SIZE 6 struct m25p { @@ -256,9 +257,13 @@ static int m25p_suspend(struct device *dev) struct m25p *flash = dev_get_drvdata(dev); struct spi_nor *nor = &flash->spi_nor; - /* Wait till previous write/erase is done. */ - if (nor->wait_till_ready) - return nor->wait_till_ready(nor); + /* + * A minimum de-selection time of 50ns must come between the + * RESET ENABLE and RESET MEMORY commands + */ + m25p80_write_reg(nor, SPINOR_OP_RESET_EN, NULL, 0, 0); + ndelay(50); + m25p80_write_reg(nor, SPINOR_OP_RESET_MEM, NULL, 0, 0); return 0; } -- cgit v0.10.2 From 6955ca30891c40706493c1538fd7ab3d3948b538 Mon Sep 17 00:00:00 2001 From: Wang Dongsheng Date: Thu, 21 May 2015 13:31:59 +0800 Subject: bsc9132/pci: Fix PCIe interrput always be triggered on BSC9132 We missed to handle PME and message interrupt when system back from sleep, so system will popup "nobody cared" call trace. Add .pcibios_fixup_phb for BSC9132 platform, PME interrupt handler will be registered in fsl_pcibios_fixup_phb. Signed-off-by: Wang Dongsheng Change-Id: I0550322707a7a48116761f2d691304aec217e4a2 Reviewed-on: http://git.am.freescale.net:8181/36664 Tested-by: Review Code-CDREVIEW Reviewed-by: Mingkai Hu Reviewed-by: Chenhui Zhao Reviewed-by: Honghua Yin diff --git a/arch/powerpc/platforms/85xx/bsc913x_qds.c b/arch/powerpc/platforms/85xx/bsc913x_qds.c index 2812784..428973f 100644 --- a/arch/powerpc/platforms/85xx/bsc913x_qds.c +++ b/arch/powerpc/platforms/85xx/bsc913x_qds.c @@ -72,6 +72,7 @@ define_machine(bsc9132_qds) { .init_IRQ = bsc913x_qds_pic_init, #ifdef CONFIG_PCI .pcibios_fixup_bus = fsl_pcibios_fixup_bus, + .pcibios_fixup_phb = fsl_pcibios_fixup_phb, #endif .get_irq = mpic_get_irq, .restart = fsl_rstcr_restart, -- cgit v0.10.2 From 1af603c39758b2d66e7dde3f8b6fef3a16d3e1a1 Mon Sep 17 00:00:00 2001 From: Tudor Ambarus Date: Mon, 11 May 2015 19:16:26 +0300 Subject: crypto: caam/qi - tls10 support for 32bit platforms Tested with tcrypt on p1023rdb platform. Change-Id: Ic19a8d2ed5ce3603d2d9f893736b68eea03d480b Signed-off-by: Tudor Ambarus Reviewed-on: http://git.am.freescale.net:8181/36220 Tested-by: Review Code-CDREVIEW Reviewed-by: Horia Ioan Geanta Neag Reviewed-by: Honghua Yin diff --git a/drivers/crypto/caam/caamalg_qi.c b/drivers/crypto/caam/caamalg_qi.c index 81b82bd..cc47085 100644 --- a/drivers/crypto/caam/caamalg_qi.c +++ b/drivers/crypto/caam/caamalg_qi.c @@ -376,6 +376,12 @@ static int tls_set_sh_desc(struct crypto_aead *aead) unsigned int blocksize = crypto_aead_blocksize(aead); /* Associated data length is always = 13 for TLS */ unsigned int assoclen = 13; + /* + * Pointer Size bool determines the size of address pointers. + * false - Pointers fit in one 32-bit word. + * true - Pointers fit in two 32-bit words. + */ + static const bool ps = (CAAM_PTR_SZ != CAAM_CMD_SZ); if (!ctx->enckeylen || !ctx->authsize) return 0; @@ -587,6 +593,10 @@ static int tls_set_sh_desc(struct crypto_aead *aead) /* VSOL = payloadlen + icvlen + padlen */ append_math_add(desc, VARSEQOUTLEN, ZERO, REG3, 4); +#ifdef __LITTLE_ENDIAN + append_moveb(desc, MOVE_WAITCOMP | + MOVE_SRC_MATH0 | MOVE_DEST_MATH0 | 8); +#endif /* update Len field */ append_math_sub(desc, REG0, REG0, REG2, 8); @@ -626,23 +636,90 @@ static int tls_set_sh_desc(struct crypto_aead *aead) /* VSIL = (payloadlen + icvlen + padlen) - icvlen + padlen */ append_math_sub(desc, VARSEQINLEN, REG3, REG2, 4); - /* move seqoutptr fields into math registers */ - append_move(desc, MOVE_WAITCOMP | MOVE_SRC_DESCBUF | MOVE_DEST_MATH0 | - (54 * 4 << MOVE_OFFSET_SHIFT) | 20); - /* seqinptr will point to seqoutptr */ - append_math_and_imm_u32(desc, REG0, REG0, IMM, - ~(CMD_SEQ_IN_PTR ^ CMD_SEQ_OUT_PTR)); - /* Load jump command */ - jumpback = CMD_JUMP | (char)-9; - append_load_imm_u32(desc, jumpback, LDST_CLASS_DECO | LDST_IMM | - LDST_SRCDST_WORD_DECO_MATH2 | - (4 << LDST_OFFSET_SHIFT)); - append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 1); - /* move updated seqinptr fields to JD */ - append_move(desc, MOVE_WAITCOMP | MOVE_SRC_MATH0 | MOVE_DEST_DESCBUF | - (54 * 4 << MOVE_OFFSET_SHIFT) | 24); - /* read updated seqinptr */ - append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 6); + /* + * Start a new input sequence using the SEQ OUT PTR command options, + * pointer and length used when the current output sequence was defined. + */ + if (ps) { + /* + * Move the lower 32 bits of Shared Descriptor address, the + * SEQ OUT PTR command, Output Pointer (2 words) and + * Output Length into math registers. + */ +#ifdef __LITTLE_ENDIAN + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_DESCBUF | + MOVE_DEST_MATH0 | (55 * 4 << MOVE_OFFSET_SHIFT) | + 20); +#else + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_DESCBUF | + MOVE_DEST_MATH0 | (54 * 4 << MOVE_OFFSET_SHIFT) | + 20); +#endif + /* Transform SEQ OUT PTR command in SEQ IN PTR command */ + append_math_and_imm_u32(desc, REG0, REG0, IMM, + ~(CMD_SEQ_IN_PTR ^ CMD_SEQ_OUT_PTR)); + /* Append a JUMP command after the copied fields */ + jumpback = CMD_JUMP | (char)-9; + append_load_imm_u32(desc, jumpback, LDST_CLASS_DECO | LDST_IMM | + LDST_SRCDST_WORD_DECO_MATH2 | + (4 << LDST_OFFSET_SHIFT)); + append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 1); + /* Move the updated fields back to the Job Descriptor */ +#ifdef __LITTLE_ENDIAN + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_MATH0 | + MOVE_DEST_DESCBUF | (55 * 4 << MOVE_OFFSET_SHIFT) | + 24); +#else + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_MATH0 | + MOVE_DEST_DESCBUF | (54 * 4 << MOVE_OFFSET_SHIFT) | + 24); +#endif + /* + * Read the new SEQ IN PTR command, Input Pointer, Input Length + * and then jump back to the next command from the + * Shared Descriptor. + */ + append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 6); + } else { + /* + * Move the SEQ OUT PTR command, Output Pointer (1 word) and + * Output Length into math registers. + */ +#ifdef __LITTLE_ENDIAN + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_DESCBUF | + MOVE_DEST_MATH0 | (54 * 4 << MOVE_OFFSET_SHIFT) | + 12); +#else + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_DESCBUF | + MOVE_DEST_MATH0 | (53 * 4 << MOVE_OFFSET_SHIFT) | + 12); +#endif + /* Transform SEQ OUT PTR command in SEQ IN PTR command */ + append_math_and_imm_u64(desc, REG0, REG0, IMM, + ~(((u64)(CMD_SEQ_IN_PTR ^ CMD_SEQ_OUT_PTR)) << 32)); + /* Append a JUMP command after the copied fields */ + jumpback = CMD_JUMP | (char)-7; + append_load_imm_u32(desc, jumpback, LDST_CLASS_DECO | LDST_IMM | + LDST_SRCDST_WORD_DECO_MATH1 | + (4 << LDST_OFFSET_SHIFT)); + append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 1); + /* Move the updated fields back to the Job Descriptor */ +#ifdef __LITTLE_ENDIAN + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_MATH0 | + MOVE_DEST_DESCBUF | (54 * 4 << MOVE_OFFSET_SHIFT) | + 16); +#else + append_move(desc, MOVE_WAITCOMP | MOVE_SRC_MATH0 | + MOVE_DEST_DESCBUF | (53 * 4 << MOVE_OFFSET_SHIFT) | + 16); +#endif + /* + * Read the new SEQ IN PTR command, Input Pointer, Input Length + * and then jump back to the next command from the + * Shared Descriptor. + */ + append_jump(desc, JUMP_TEST_ALL | JUMP_COND_CALM | 5); + } /* skip payload */ append_seq_fifo_load(desc, 0, FIFOLD_CLASS_SKIP | FIFOLDST_VLF); -- cgit v0.10.2 From c8d7e1ecee68d61bcdfb25f5a93fe10ecc932cee Mon Sep 17 00:00:00 2001 From: Jaiprakash Singh Date: Mon, 11 May 2015 16:20:42 +0530 Subject: t1023rdb/dts: set ifc nand chip select from 2 to 1 IFC NAND chip select is wrongly mapped to 2 in reg property of NAND node.Due to this kernel is not able probe NAND flash.Set chip select to 1 in reg property Signed-off-by: Jaiprakash Singh Change-Id: I44c020f964c3960ec0208ba6b594f69dd5019e9d Reviewed-on: http://git.am.freescale.net:8181/36183 Tested-by: Review Code-CDREVIEW Reviewed-by: Shengzhou Liu Reviewed-by: Prabhakar Kushwaha Reviewed-by: Honghua Yin diff --git a/arch/powerpc/boot/dts/t1023rdb.dts b/arch/powerpc/boot/dts/t1023rdb.dts index 7db5093..4aa16c3 100644 --- a/arch/powerpc/boot/dts/t1023rdb.dts +++ b/arch/powerpc/boot/dts/t1023rdb.dts @@ -60,7 +60,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "fsl,ifc-nand"; - reg = <0x2 0x0 0x10000>; + reg = <0x1 0x0 0x10000>; }; }; -- cgit v0.10.2 From 80ebb366ecebdc1fda4a691dc71d241ce6822656 Mon Sep 17 00:00:00 2001 From: Haiying Wang Date: Mon, 27 Apr 2015 13:28:24 -0400 Subject: fsl_qbman: Update ceetm with some user friendly APIs Signed-off-by: Haiying Wang Change-Id: Iaaf60a7e20a7cd96698fbcb3f98b5918000872e1 Reviewed-on: http://git.am.freescale.net:8181/36225 Tested-by: Review Code-CDREVIEW Reviewed-by: Roy Pledge Reviewed-by: Honghua Yin diff --git a/drivers/staging/fsl_qbman/qman_high.c b/drivers/staging/fsl_qbman/qman_high.c index 1f5102a..b94bfb4 100644 --- a/drivers/staging/fsl_qbman/qman_high.c +++ b/drivers/staging/fsl_qbman/qman_high.c @@ -3504,11 +3504,6 @@ int qman_ceetm_lni_enable_shaper(struct qm_ceetm_lni *lni, int coupled, { struct qm_mcc_ceetm_mapping_shaper_tcfc_config config_opts; - if (lni->shaper_enable) { - pr_err("The shaper has already been enabled\n"); - return -EINVAL; - } - lni->shaper_enable = 1; lni->shaper_couple = coupled; lni->oal = oal; @@ -3550,6 +3545,12 @@ int qman_ceetm_lni_disable_shaper(struct qm_ceetm_lni *lni) } EXPORT_SYMBOL(qman_ceetm_lni_disable_shaper); +int qman_ceetm_lni_is_shaper_enabled(struct qm_ceetm_lni *lni) +{ + return lni->shaper_enable; +} +EXPORT_SYMBOL(qman_ceetm_lni_is_shaper_enabled); + int qman_ceetm_lni_set_commit_rate(struct qm_ceetm_lni *lni, const struct qm_ceetm_rate *token_rate, u16 token_limit) @@ -3559,34 +3560,52 @@ int qman_ceetm_lni_set_commit_rate(struct qm_ceetm_lni *lni, struct qm_mcr_ceetm_mapping_shaper_tcfc_query query_result; int ret; - if (!lni->shaper_enable) { - pr_err("The LNI#%d is unshaped, cannot set CR rate\n", - lni->idx); - return -EINVAL; + lni->cr_token_rate.whole = token_rate->whole; + lni->cr_token_rate.fraction = token_rate->fraction; + lni->cr_token_bucket_limit = token_limit; + if (lni->shaper_enable) { + query_opts.cid = CEETM_COMMAND_LNI_SHAPER | lni->idx; + query_opts.dcpid = lni->dcp_idx; + ret = qman_ceetm_query_mapping_shaper_tcfc(&query_opts, + &query_result); + if (ret) { + pr_err("Fail to get current LNI shaper setting\n"); + return -EINVAL; + } + + config_opts.cid = CEETM_COMMAND_LNI_SHAPER | lni->idx; + config_opts.dcpid = lni->dcp_idx; + config_opts.shaper_config.crtcr = (token_rate->whole << 13) | + (token_rate->fraction); + config_opts.shaper_config.crtbl = token_limit; + config_opts.shaper_config.cpl = query_result.shaper_query.cpl; + config_opts.shaper_config.ertcr = + query_result.shaper_query.ertcr; + config_opts.shaper_config.ertbl = + query_result.shaper_query.ertbl; + return qman_ceetm_configure_mapping_shaper_tcfc(&config_opts); + } else { + return 0; } +} +EXPORT_SYMBOL(qman_ceetm_lni_set_commit_rate); - query_opts.cid = CEETM_COMMAND_LNI_SHAPER | lni->idx; - query_opts.dcpid = lni->dcp_idx; - ret = qman_ceetm_query_mapping_shaper_tcfc(&query_opts, &query_result); +int qman_ceetm_lni_set_commit_rate_bps(struct qm_ceetm_lni *lni, + u64 bps, + u16 token_limit) +{ + struct qm_ceetm_rate token_rate; + int ret; + + ret = qman_ceetm_bps2tokenrate(bps, &token_rate, 0); if (ret) { - pr_err("Fail to get current LNI shaper setting\n"); + pr_err("Can not convert bps to token rate\n"); return -EINVAL; } - lni->cr_token_rate.whole = token_rate->whole; - lni->cr_token_rate.fraction = token_rate->fraction; - lni->cr_token_bucket_limit = token_limit; - config_opts.cid = CEETM_COMMAND_LNI_SHAPER | lni->idx; - config_opts.dcpid = lni->dcp_idx; - config_opts.shaper_config.crtcr = (token_rate->whole << 13) | - (token_rate->fraction); - config_opts.shaper_config.crtbl = token_limit; - config_opts.shaper_config.cpl = query_result.shaper_query.cpl; - config_opts.shaper_config.ertcr = query_result.shaper_query.ertcr; - config_opts.shaper_config.ertbl = query_result.shaper_query.ertbl; - return qman_ceetm_configure_mapping_shaper_tcfc(&config_opts); + return qman_ceetm_lni_set_commit_rate(lni, &token_rate, token_limit); } -EXPORT_SYMBOL(qman_ceetm_lni_set_commit_rate); +EXPORT_SYMBOL(qman_ceetm_lni_set_commit_rate_bps); int qman_ceetm_lni_get_commit_rate(struct qm_ceetm_lni *lni, struct qm_ceetm_rate *token_rate, @@ -3611,6 +3630,22 @@ int qman_ceetm_lni_get_commit_rate(struct qm_ceetm_lni *lni, } EXPORT_SYMBOL(qman_ceetm_lni_get_commit_rate); +int qman_ceetm_lni_get_commit_rate_bps(struct qm_ceetm_lni *lni, + u64 *bps, u16 *token_limit) +{ + struct qm_ceetm_rate token_rate; + int ret; + + ret = qman_ceetm_lni_get_commit_rate(lni, &token_rate, token_limit); + if (ret) { + pr_err("The LNI CR rate or limit is not available\n"); + return -EINVAL; + } + + return qman_ceetm_tokenrate2bps(&token_rate, bps, 0); +} +EXPORT_SYMBOL(qman_ceetm_lni_get_commit_rate_bps); + int qman_ceetm_lni_set_excess_rate(struct qm_ceetm_lni *lni, const struct qm_ceetm_rate *token_rate, u16 token_limit) @@ -3620,35 +3655,53 @@ int qman_ceetm_lni_set_excess_rate(struct qm_ceetm_lni *lni, struct qm_mcr_ceetm_mapping_shaper_tcfc_query query_result; int ret; - if (!lni->shaper_enable) { - pr_err("The LIN#%d is unshaped, cannot set ER rate\n", - lni->idx); - return -EINVAL; + lni->er_token_rate.whole = token_rate->whole; + lni->er_token_rate.fraction = token_rate->fraction; + lni->er_token_bucket_limit = token_limit; + if (lni->shaper_enable) { + query_opts.cid = CEETM_COMMAND_LNI_SHAPER | lni->idx; + query_opts.dcpid = lni->dcp_idx; + ret = qman_ceetm_query_mapping_shaper_tcfc(&query_opts, + &query_result); + if (ret) { + pr_err("Fail to get current LNI shaper setting\n"); + return -EINVAL; + } + + config_opts.cid = CEETM_COMMAND_LNI_SHAPER | lni->idx; + config_opts.dcpid = lni->dcp_idx; + config_opts.shaper_config.ertcr = + (token_rate->whole << 13) | (token_rate->fraction); + config_opts.shaper_config.ertbl = token_limit; + config_opts.shaper_config.cpl = query_result.shaper_query.cpl; + config_opts.shaper_config.crtcr = + query_result.shaper_query.crtcr; + config_opts.shaper_config.crtbl = + query_result.shaper_query.crtbl; + + return qman_ceetm_configure_mapping_shaper_tcfc(&config_opts); + } else { + return 0; } +} +EXPORT_SYMBOL(qman_ceetm_lni_set_excess_rate); - query_opts.cid = CEETM_COMMAND_LNI_SHAPER | lni->idx; - query_opts.dcpid = lni->dcp_idx; - ret = qman_ceetm_query_mapping_shaper_tcfc(&query_opts, &query_result); +int qman_ceetm_lni_set_excess_rate_bps(struct qm_ceetm_lni *lni, + u64 bps, + u16 token_limit) +{ + struct qm_ceetm_rate token_rate; + int ret; + + ret = qman_ceetm_bps2tokenrate(bps, &token_rate, 0); if (ret) { - pr_err("Fail to get current LNI shaper setting\n"); + pr_err("Can not convert bps to token rate\n"); return -EINVAL; } - lni->er_token_rate.whole = token_rate->whole; - lni->er_token_rate.fraction = token_rate->fraction; - lni->er_token_bucket_limit = token_limit; - config_opts.cid = CEETM_COMMAND_LNI_SHAPER | lni->idx; - config_opts.dcpid = lni->dcp_idx; - config_opts.shaper_config.ertcr = - (token_rate->whole << 13) | (token_rate->fraction); - config_opts.shaper_config.ertbl = token_limit; - config_opts.shaper_config.cpl = query_result.shaper_query.cpl; - config_opts.shaper_config.crtcr = query_result.shaper_query.crtcr; - config_opts.shaper_config.crtbl = query_result.shaper_query.crtbl; - - return qman_ceetm_configure_mapping_shaper_tcfc(&config_opts); + return qman_ceetm_lni_set_excess_rate(lni, &token_rate, token_limit); } -EXPORT_SYMBOL(qman_ceetm_lni_set_excess_rate); +EXPORT_SYMBOL(qman_ceetm_lni_set_excess_rate_bps); int qman_ceetm_lni_get_excess_rate(struct qm_ceetm_lni *lni, struct qm_ceetm_rate *token_rate, @@ -3672,6 +3725,22 @@ int qman_ceetm_lni_get_excess_rate(struct qm_ceetm_lni *lni, } EXPORT_SYMBOL(qman_ceetm_lni_get_excess_rate); +int qman_ceetm_lni_get_excess_rate_bps(struct qm_ceetm_lni *lni, + u64 *bps, u16 *token_limit) +{ + struct qm_ceetm_rate token_rate; + int ret; + + ret = qman_ceetm_lni_get_excess_rate(lni, &token_rate, token_limit); + if (ret) { + pr_err("The LNI ER rate or limit is not available\n"); + return -EINVAL; + } + + return qman_ceetm_tokenrate2bps(&token_rate, bps, 0); +} +EXPORT_SYMBOL(qman_ceetm_lni_get_excess_rate_bps); + #define QMAN_CEETM_LNITCFCC_CQ_LEVEL_SHIFT(n) ((15 - n) * 4) #define QMAN_CEETM_LNITCFCC_ENABLE 0x8 int qman_ceetm_lni_set_tcfcc(struct qm_ceetm_lni *lni, @@ -3893,11 +3962,6 @@ int qman_ceetm_channel_disable_shaper(struct qm_ceetm_channel *channel) struct qm_mcc_ceetm_mapping_shaper_tcfc_config config_opts; u8 map; - if (channel->shaper_enable == 0) { - pr_err("This channel shaper has been disabled\n"); - return -EINVAL; - } - query_opts.cid = CEETM_COMMAND_CHANNEL_MAPPING | channel->idx; query_opts.dcpid = channel->dcp_idx; @@ -3916,6 +3980,25 @@ int qman_ceetm_channel_disable_shaper(struct qm_ceetm_channel *channel) } EXPORT_SYMBOL(qman_ceetm_channel_disable_shaper); +int qman_ceetm_channel_is_shaper_enabled(struct qm_ceetm_channel *channel) +{ + struct qm_mcc_ceetm_mapping_shaper_tcfc_query query_opts; + struct qm_mcr_ceetm_mapping_shaper_tcfc_query query_result; + u8 map; + + query_opts.cid = CEETM_COMMAND_CHANNEL_MAPPING | channel->idx; + query_opts.dcpid = channel->dcp_idx; + + if (qman_ceetm_query_mapping_shaper_tcfc(&query_opts, &query_result)) { + pr_err("Can't query channel mapping\n"); + return -EINVAL; + } + + map = query_result.channel_mapping_query.map; + return (map & QMAN_CEETM_ENABLE_CHANNEL_SHAPER) ? 1 : 0; +} +EXPORT_SYMBOL(qman_ceetm_channel_is_shaper_enabled); + int qman_ceetm_channel_set_commit_rate(struct qm_ceetm_channel *channel, const struct qm_ceetm_rate *token_rate, u16 token_limit) @@ -3925,11 +4008,6 @@ int qman_ceetm_channel_set_commit_rate(struct qm_ceetm_channel *channel, struct qm_mcr_ceetm_mapping_shaper_tcfc_query query_result; int ret; - if (!channel->shaper_enable) { - pr_err("This channel is unshaped\n"); - return -EINVAL; - } - query_opts.cid = CEETM_COMMAND_CHANNEL_SHAPER | channel->idx; query_opts.dcpid = channel->dcp_idx; @@ -3954,6 +4032,22 @@ int qman_ceetm_channel_set_commit_rate(struct qm_ceetm_channel *channel, } EXPORT_SYMBOL(qman_ceetm_channel_set_commit_rate); +int qman_ceetm_channel_set_commit_rate_bps(struct qm_ceetm_channel *channel, + u64 bps, u16 token_limit) +{ + struct qm_ceetm_rate token_rate; + int ret; + + ret = qman_ceetm_bps2tokenrate(bps, &token_rate, 0); + if (ret) { + pr_err("Can not convert bps to token rate\n"); + return -EINVAL; + } + return qman_ceetm_channel_set_commit_rate(channel, &token_rate, + token_limit); +} +EXPORT_SYMBOL(qman_ceetm_channel_set_commit_rate_bps); + int qman_ceetm_channel_get_commit_rate(struct qm_ceetm_channel *channel, struct qm_ceetm_rate *token_rate, u16 *token_limit) @@ -3978,6 +4072,23 @@ int qman_ceetm_channel_get_commit_rate(struct qm_ceetm_channel *channel, } EXPORT_SYMBOL(qman_ceetm_channel_get_commit_rate); +int qman_ceetm_channel_get_commit_rate_bps(struct qm_ceetm_channel *channel, + u64 *bps, u16 *token_limit) +{ + struct qm_ceetm_rate token_rate; + int ret; + + ret = qman_ceetm_channel_get_commit_rate(channel, &token_rate, + token_limit); + if (ret) { + pr_err("The channel CR rate or limit is not available\n"); + return -EINVAL; + } + + return qman_ceetm_tokenrate2bps(&token_rate, bps, 0); +} +EXPORT_SYMBOL(qman_ceetm_channel_get_commit_rate_bps); + int qman_ceetm_channel_set_excess_rate(struct qm_ceetm_channel *channel, const struct qm_ceetm_rate *token_rate, u16 token_limit) @@ -3987,11 +4098,6 @@ int qman_ceetm_channel_set_excess_rate(struct qm_ceetm_channel *channel, struct qm_mcr_ceetm_mapping_shaper_tcfc_query query_result; int ret; - if (!channel->shaper_enable) { - pr_err("This channel is unshaped\n"); - return -EINVAL; - } - query_opts.cid = CEETM_COMMAND_CHANNEL_SHAPER | channel->idx; query_opts.dcpid = channel->dcp_idx; ret = qman_ceetm_query_mapping_shaper_tcfc(&query_opts, &query_result); @@ -4015,6 +4121,22 @@ int qman_ceetm_channel_set_excess_rate(struct qm_ceetm_channel *channel, } EXPORT_SYMBOL(qman_ceetm_channel_set_excess_rate); +int qman_ceetm_channel_set_excess_rate_bps(struct qm_ceetm_channel *channel, + u64 bps, u16 token_limit) +{ + struct qm_ceetm_rate token_rate; + int ret; + + ret = qman_ceetm_bps2tokenrate(bps, &token_rate, 0); + if (ret) { + pr_err("Can not convert bps to token rate\n"); + return -EINVAL; + } + return qman_ceetm_channel_set_excess_rate(channel, &token_rate, + token_limit); +} +EXPORT_SYMBOL(qman_ceetm_channel_set_excess_rate_bps); + int qman_ceetm_channel_get_excess_rate(struct qm_ceetm_channel *channel, struct qm_ceetm_rate *token_rate, u16 *token_limit) @@ -4038,6 +4160,23 @@ int qman_ceetm_channel_get_excess_rate(struct qm_ceetm_channel *channel, } EXPORT_SYMBOL(qman_ceetm_channel_get_excess_rate); +int qman_ceetm_channel_get_excess_rate_bps(struct qm_ceetm_channel *channel, + u64 *bps, u16 *token_limit) +{ + struct qm_ceetm_rate token_rate; + int ret; + + ret = qman_ceetm_channel_get_excess_rate(channel, &token_rate, + token_limit); + if (ret) { + pr_err("The channel ER rate or limit is not available\n"); + return -EINVAL; + } + + return qman_ceetm_tokenrate2bps(&token_rate, bps, 0); +} +EXPORT_SYMBOL(qman_ceetm_channel_get_excess_rate_bps); + int qman_ceetm_channel_set_weight(struct qm_ceetm_channel *channel, u16 token_limit) { @@ -4416,6 +4555,7 @@ int qman_ceetm_cq_release(struct qm_ceetm_cq *cq) return -EBUSY; } list_del(&cq->node); + qman_ceetm_drain_cq(cq); kfree(cq); return 0; } @@ -4549,6 +4689,38 @@ int qman_ceetm_ratio2wbfs(u32 numerator, } EXPORT_SYMBOL(qman_ceetm_ratio2wbfs); +int qman_ceetm_set_queue_weight_in_ratio(struct qm_ceetm_cq *cq, u32 ratio) +{ + struct qm_ceetm_weight_code weight_code; + + if (qman_ceetm_ratio2wbfs(ratio, 100, &weight_code, 0)) { + pr_err("Cannot get wbfs code for cq %x\n", cq->idx); + return -EINVAL; + } + return qman_ceetm_set_queue_weight(cq, &weight_code); +} +EXPORT_SYMBOL(qman_ceetm_set_queue_weight_in_ratio); + +int qman_ceetm_get_queue_weight_in_ratio(struct qm_ceetm_cq *cq, u32 *ratio) +{ + struct qm_ceetm_weight_code weight_code; + u32 n, d; + + if (qman_ceetm_get_queue_weight(cq, &weight_code)) { + pr_err("Cannot query the weight code for cq%x\n", cq->idx); + return -EINVAL; + } + + if (qman_ceetm_wbfs2ratio(&weight_code, &n, &d)) { + pr_err("Cannot get the ratio with wbfs code\n"); + return -EINVAL; + } + + *ratio = (n * (u32)100) / d; + return 0; +} +EXPORT_SYMBOL(qman_ceetm_get_queue_weight_in_ratio); + int qman_ceetm_cq_get_dequeue_statistics(struct qm_ceetm_cq *cq, u32 flags, u64 *frame_count, u64 *byte_count) { @@ -4576,6 +4748,23 @@ int qman_ceetm_cq_get_dequeue_statistics(struct qm_ceetm_cq *cq, u32 flags, } EXPORT_SYMBOL(qman_ceetm_cq_get_dequeue_statistics); +int qman_ceetm_drain_cq(struct qm_ceetm_cq *cq) +{ + struct qm_mcr_ceetm_cq_peek_pop_xsfdrread ppxr; + int ret; + + do { + ret = qman_ceetm_cq_peek_pop_xsfdrread(cq, 1, 0, &ppxr); + if (ret) { + pr_err("Failed to pop frame from CQ\n"); + return -EINVAL; + } + } while (!(ppxr.stat & 0x2)); + + return 0; +} +EXPORT_SYMBOL(qman_ceetm_drain_cq); + #define CEETM_LFQMT_LFQID_MSB 0xF00000 #define CEETM_LFQMT_LFQID_LSB 0x000FFF int qman_ceetm_lfq_claim(struct qm_ceetm_lfq **lfq, diff --git a/include/linux/fsl_qman.h b/include/linux/fsl_qman.h index 824652c..2909cc5 100644 --- a/include/linux/fsl_qman.h +++ b/include/linux/fsl_qman.h @@ -2702,6 +2702,12 @@ int qman_ceetm_lni_enable_shaper(struct qm_ceetm_lni *lni, int coupled, int qman_ceetm_lni_disable_shaper(struct qm_ceetm_lni *lni); /** + * qman_ceetm_lni_is_shaper_enabled - Check LNI shaper status + * @lni: the give LNI + */ +int qman_ceetm_lni_is_shaper_enabled(struct qm_ceetm_lni *lni); + +/** * qman_ceetm_lni_set_commit_rate * qman_ceetm_lni_get_commit_rate * qman_ceetm_lni_set_excess_rate @@ -2730,6 +2736,33 @@ int qman_ceetm_lni_set_excess_rate(struct qm_ceetm_lni *lni, int qman_ceetm_lni_get_excess_rate(struct qm_ceetm_lni *lni, struct qm_ceetm_rate *token_rate, u16 *token_limit); +/** + * qman_ceetm_lni_set_commit_rate_bps + * qman_ceetm_lni_get_commit_rate_bps + * qman_ceetm_lni_set_excess_rate_bps + * qman_ceetm_lni_get_excess_rate_bps - Set/get the shaper CR/ER rate + * and token limit for the given LNI. + * @lni: the given LNI. + * @bps: the desired shaping rate in bps for "set" fuction, or the shaping rate + * of the LNI queried by "get" function. + * @token_limit: the desired token bucket limit for "set" function, or the token + * limit of the given LNI queried by "get" function. + * + * Returns zero for success. The "set" function returns -EINVAL if the given + * LNI is unshapped or -EIO if the configure shaper command returns error. + * The "get" function returns -EINVAL if the token rate or the token limit is + * not set or the query command returns error. + */ +int qman_ceetm_lni_set_commit_rate_bps(struct qm_ceetm_lni *lni, + u64 bps, + u16 token_limit); +int qman_ceetm_lni_get_commit_rate_bps(struct qm_ceetm_lni *lni, + u64 *bps, u16 *token_limit); +int qman_ceetm_lni_set_excess_rate_bps(struct qm_ceetm_lni *lni, + u64 bps, + u16 token_limit); +int qman_ceetm_lni_get_excess_rate_bps(struct qm_ceetm_lni *lni, + u64 *bps, u16 *token_limit); /** * qman_ceetm_lni_set_tcfcc @@ -2808,6 +2841,12 @@ int qman_ceetm_channel_enable_shaper(struct qm_ceetm_channel *channel, int qman_ceetm_channel_disable_shaper(struct qm_ceetm_channel *channel); /** + * qman_ceetm_channel_is_shaper_enabled - Check channel shaper status. + * @channel: the give channel. + */ +int qman_ceetm_channel_is_shaper_enabled(struct qm_ceetm_channel *channel); + +/** * qman_ceetm_channel_set_commit_rate * qman_ceetm_channel_get_commit_rate * qman_ceetm_channel_set_excess_rate @@ -2835,6 +2874,31 @@ int qman_ceetm_channel_set_excess_rate(struct qm_ceetm_channel *channel, int qman_ceetm_channel_get_excess_rate(struct qm_ceetm_channel *channel, struct qm_ceetm_rate *token_rate, u16 *token_limit); +/** + * qman_ceetm_channel_set_commit_rate_bps + * qman_ceetm_channel_get_commit_rate_bps + * qman_ceetm_channel_set_excess_rate_bps + * qman_ceetm_channel_get_excess_rate_bps - Set/get channel CR/ER shaper + * parameters. + * @channel: the given channel. + * @token_rate: the desired shaper rate in bps for "set" function, or the + * shaper rate in bps for "get" function. + * @token_limit: the desired token limit for "set" function, or the queried + * token limit for "get" function. + * + * Return zero for success. The "set" function returns -EINVAL if the channel + * is unshaped, or -EIO if the configure shapper command returns error. The + * "get" function returns -EINVAL if token rate of token limit is not set, or + * the query shaper command returns error. + */ +int qman_ceetm_channel_set_commit_rate_bps(struct qm_ceetm_channel *channel, + u64 bps, u16 token_limit); +int qman_ceetm_channel_get_commit_rate_bps(struct qm_ceetm_channel *channel, + u64 *bps, u16 *token_limit); +int qman_ceetm_channel_set_excess_rate_bps(struct qm_ceetm_channel *channel, + u64 bps, u16 token_limit); +int qman_ceetm_channel_get_excess_rate_bps(struct qm_ceetm_channel *channel, + u64 *bps, u16 *token_limit); /** * qman_ceetm_channel_set_weight @@ -3009,6 +3073,21 @@ int qman_ceetm_set_queue_weight(struct qm_ceetm_cq *cq, int qman_ceetm_get_queue_weight(struct qm_ceetm_cq *cq, struct qm_ceetm_weight_code *weight_code); +/** + * qman_ceetm_set_queue_weight_in_ratio + * qman_ceetm_get_queue_weight_in_ratio - Configure/query the weight of a + * grouped class queue. + * @cq: the given class queue. + * @ratio: the weight in ratio. It should be the real ratio number multiplied + * by 100 to get rid of fraction. + * + * Returns zero for success, or -EIO if the configure weight command returns + * error for "set" function, or -EINVAL if the query command returns + * error for "get" function. + */ +int qman_ceetm_set_queue_weight_in_ratio(struct qm_ceetm_cq *cq, u32 ratio); +int qman_ceetm_get_queue_weight_in_ratio(struct qm_ceetm_cq *cq, u32 *ratio); + /* Weights are encoded using a pseudo-exponential scheme. The weight codes 0, * 32, 64, [...] correspond to weights of 1, 2, 4, [...]. The weights * corresponding to intermediate weight codes are calculated using linear @@ -3077,6 +3156,13 @@ int qman_ceetm_ratio2wbfs(u32 numerator, int qman_ceetm_cq_get_dequeue_statistics(struct qm_ceetm_cq *cq, u32 flags, u64 *frame_count, u64 *byte_count); +/** + * qman_ceetm_drain_cq - drain the CQ till it is empty. + * @cq: the give CQ object. + * Return 0 for success or -EINVAL for unsuccessful command to empty CQ. + */ +int qman_ceetm_drain_cq(struct qm_ceetm_cq *cq); + /* ---------------------- */ /* CEETM :: logical FQIDs */ /* ---------------------- */ -- cgit v0.10.2 From bc1e8e3930a4af07aea58062cf2442e538bc5d69 Mon Sep 17 00:00:00 2001 From: Mandy Lavi Date: Tue, 26 May 2015 08:50:24 +0900 Subject: fmd: fix case label consistency Change-Id: I41397d36e3966e099e53d8d5c35b2fdbd27e2055 Signed-off-by: Mandy Lavi Reviewed-on: http://git.am.freescale.net:8181/36866 Reviewed-by: Igal Liberman Reviewed-by: Honghua Yin Tested-by: Honghua Yin 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 886cd5d..b4ab295 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 @@ -1456,7 +1456,7 @@ Status: feature not supported } goto invalid_port_id; - case (e_FM_PORT_TYPE_OH_OFFLINE_PARSING): + case (e_IOC_FM_PORT_TYPE_OH_OFFLINE_PARSING): if (port_params->port_id && port_params->port_id < FM_MAX_NUM_OF_OH_PORTS) { h_Port = p_LnxWrpFmDev->opPorts[port_params->port_id - 1].h_Dev; break; -- cgit v0.10.2 From f32970246cb5547c18e421273c5f8b1e2f7e7b66 Mon Sep 17 00:00:00 2001 From: Emil Medve Date: Wed, 21 Jan 2015 04:03:30 -0600 Subject: powerpc/corenet: Enable CLK_QORIQ Change-Id: I1a80ad7b9f6854791bd270b746f93a91439155a6 Signed-off-by: Emil Medve Acked-by: Tang Yuantian Signed-off-by: Michael Turquette Signed-off-by: Lijun Pan Reviewed-on: http://git.am.freescale.net:8181/37059 Tested-by: Review Code-CDREVIEW Reviewed-by: Honghua Yin diff --git a/arch/powerpc/configs/corenet32_smp_defconfig b/arch/powerpc/configs/corenet32_smp_defconfig index 47b01412..605fd5a 100644 --- a/arch/powerpc/configs/corenet32_smp_defconfig +++ b/arch/powerpc/configs/corenet32_smp_defconfig @@ -156,6 +156,7 @@ CONFIG_FSL_PME2=y CONFIG_FSL_PAMU=y CONFIG_VIRT_DRIVERS=y CONFIG_FSL_HV_MANAGER=y +CONFIG_CLK_QORIQ=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig index 39df852..e9fe78a 100644 --- a/arch/powerpc/configs/corenet64_smp_defconfig +++ b/arch/powerpc/configs/corenet64_smp_defconfig @@ -174,6 +174,7 @@ CONFIG_FSL_PME2=y CONFIG_FSL_PAMU=y CONFIG_VIRT_DRIVERS=y CONFIG_FSL_HV_MANAGER=y +CONFIG_CLK_QORIQ=y CONFIG_MEMORY=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y -- cgit v0.10.2 From 6dfc79b030b4ea1d34e65eb75f25161e3038b134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Horia=20Geant=C4=83?= Date: Fri, 29 May 2015 10:22:07 +0300 Subject: crypto: caam - fix size_t print format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ARRAY_SIZE() returns a size_t value. Thus, when printing these values, %zu or %zx must be used, or else warnings show up: CC drivers/crypto/caam//caamalg.o In file included from include/linux/thread_info.h:11:0, from include/linux/preempt.h:9, from include/linux/spinlock.h:50, from include/linux/seqlock.h:35, from include/linux/time.h:5, from include/linux/stat.h:18, from include/linux/module.h:10, from drivers/crypto/caam//compat.h:9, from drivers/crypto/caam//caamalg.c:47: drivers/crypto/caam//caamalg.c: In function 'caam_cra_init': include/linux/bug.h:33:45: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=] #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) ^ include/linux/compiler-gcc.h:47:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO' #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) ^ include/linux/kernel.h:41:59: note: in expansion of macro '__must_be_array' #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) ^ drivers/crypto/caam//caamalg.c:4396:13: note: in expansion of macro 'ARRAY_SIZE' op_id, ARRAY_SIZE(digest_size)); ^ CC drivers/crypto/caam//caamhash.o In file included from include/linux/thread_info.h:11:0, from include/linux/preempt.h:9, from include/linux/spinlock.h:50, from include/linux/seqlock.h:35, from include/linux/time.h:5, from include/linux/stat.h:18, from include/linux/module.h:10, from drivers/crypto/caam//compat.h:9, from drivers/crypto/caam//caamhash.c:56: drivers/crypto/caam//caamhash.c: In function 'caam_hash_cra_init': include/linux/bug.h:33:45: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=] #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) ^ include/linux/compiler-gcc.h:47:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO' #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) ^ include/linux/kernel.h:41:59: note: in expansion of macro '__must_be_array' #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) ^ drivers/crypto/caam//caamhash.c:1782:12: note: in expansion of macro 'ARRAY_SIZE' op_id, ARRAY_SIZE(runninglen)); ^ Signed-off-by: Horia Geantă Change-Id: Ica005a337d654f7d55eea6f5e5aee911cbd016b2 Reviewed-on: http://git.am.freescale.net:8181/37071 Tested-by: Review Code-CDREVIEW Reviewed-by: Tudor-Dan Ambarus Reviewed-by: Honghua Yin diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index ea44991..0f117d0 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c @@ -4392,7 +4392,7 @@ static int caam_cra_init(struct crypto_tfm *tfm) if (op_id < ARRAY_SIZE(digest_size)) { ctx->authsize = digest_size[op_id]; } else { - dev_err(ctx->jrdev, "incorrect op_id %d; must be less than %d\n", + dev_err(ctx->jrdev, "incorrect op_id %d; must be less than %zu\n", op_id, ARRAY_SIZE(digest_size)); caam_jr_free(ctx->jrdev); return -EINVAL; diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index 697a683..e99a45b 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -1778,7 +1778,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm) op_id = (ctx->alg_op & OP_ALG_ALGSEL_SUBMASK) >> OP_ALG_ALGSEL_SHIFT; if (op_id >= ARRAY_SIZE(runninglen)) { - dev_err(ctx->jrdev, "incorrect op_id %d; must be less than %d\n", + dev_err(ctx->jrdev, "incorrect op_id %d; must be less than %zu\n", op_id, ARRAY_SIZE(runninglen)); ret = -EINVAL; goto out_err; -- cgit v0.10.2 From 1b189c445fc54387c7a3bb94c61232d4f3846922 Mon Sep 17 00:00:00 2001 From: Lijun Pan Date: Fri, 29 May 2015 12:24:19 -0500 Subject: clk: fix type cast warning Signed-off-by: Lijun Pan Change-Id: Ife4ad017add52bdd911b373d5d8dbb55a7e680ec Reviewed-on: http://git.am.freescale.net:8181/37122 Tested-by: Review Code-CDREVIEW Reviewed-by: Honghua Yin diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c index bbb2568..4c3d27c 100644 --- a/drivers/clk/clk-qoriq.c +++ b/drivers/clk/clk-qoriq.c @@ -127,7 +127,7 @@ static void __init core_mux_init(struct device_node *np) init.name = clk_name; init.ops = &cmux_ops; init.parent_names = parent_names; - init.num_parents = count; + init.num_parents = (u8)count; init.flags = 0; cmux_clk->hw.init = &init; -- cgit v0.10.2