]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agonet: fec: Workaround for imx6sx enet tx hang when enable three queues
Fugang Duan [Tue, 16 Sep 2014 21:18:54 +0000 (05:18 +0800)]
net: fec: Workaround for imx6sx enet tx hang when enable three queues

When enable three queues on imx6sx enet, and then do tx performance
test with iperf tool, after some time running, tx hang.

Found that:
If uDMA is running, software set TDAR may cause tx hang.
If uDMA is in idle, software set TDAR don't cause tx hang.

There is a TDAR race condition for mutliQ when the software sets TDAR
and the UDMA clears TDAR simultaneously or in a small window (2-4 cycles).
This will cause the udma_tx and udma_tx_arbiter state machines to hang.
The issue exist at i.MX6SX enet IP.

So, the Workaround is checking TDAR status four time, if TDAR cleared by
hardware and then write TDAR, otherwise don't set TDAR.

The patch is only one Workaround for the issue ERR007885.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet:fec: increase DMA queue number
Fugang Duan [Tue, 16 Sep 2014 21:18:53 +0000 (05:18 +0800)]
net:fec: increase DMA queue number

when enable interrupt coalesce, 8 BD is not enough.

Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: add interrupt coalescence feature support
Fugang Duan [Tue, 16 Sep 2014 21:18:52 +0000 (05:18 +0800)]
net: fec: add interrupt coalescence feature support

i.MX6 SX support interrupt coalescence feature
By default, init the interrupt coalescing frame count threshold and
timer threshold.

Supply the ethtool interfaces as below for user tuning to improve
enet performance:
rx_max_coalesced_frames
rx_coalesce_usecs
tx_max_coalesced_frames
tx_coalesce_usecs

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: refine error handle of parser queue number from DT
Frank Li [Tue, 16 Sep 2014 21:18:51 +0000 (05:18 +0800)]
net: fec: refine error handle of parser queue number from DT

check tx and rx queue seperately.
fix typo, "Invalidate" and "fail".
change pr_err to pr_warn.

Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoENGR00332050-2 imx_v7_defconfig: enable ADC driver by default
Luwei Zhou [Thu, 18 Sep 2014 07:33:38 +0000 (15:33 +0800)]
ENGR00332050-2 imx_v7_defconfig: enable ADC driver by default

Enable adc driver in default config.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00332050-1 ARM: dts: i.mx6sx: Add ADC device tree support on i.MX6SX-SDB.
Luwei Zhou [Thu, 18 Sep 2014 07:29:34 +0000 (15:29 +0800)]
ENGR00332050-1 ARM: dts: i.mx6sx: Add ADC device tree support on i.MX6SX-SDB.

Add ADC dts support on i.MX6SX-SDB platform.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agocrypto: testmgr - avoid DMA mapping from text, rodata, stack
Horia Geanta [Wed, 23 Jul 2014 08:59:38 +0000 (11:59 +0300)]
crypto: testmgr - avoid DMA mapping from text, rodata, stack

With DMA_API_DEBUG set, following warnings are emitted
(tested on CAAM accelerator):
DMA-API: device driver maps memory from kernel text or rodata
DMA-API: device driver maps memory from stack
and the culprits are:
-key in __test_aead and __test_hash
-result in __test_hash

MAX_KEYLEN is changed to accommodate maximum key length from
existing test vectors in crypto/testmgr.h (131 bytes) and rounded.

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 29b77e5dd88e1b920e3e65681f0e7b961ebbdeb8)

9 years agocrypto: testmgr - Fix DMA-API warning
Tadeusz Struk [Mon, 19 May 2014 16:51:33 +0000 (09:51 -0700)]
crypto: testmgr - Fix DMA-API warning

With DMA-API debug enabled testmgr triggers a "DMA-API: device driver maps memory from stack" warning, when tested on a crypto HW accelerator.

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 9bac019dad8098a77cce555d929f678e22111783)

9 years agoENGR00327300 ARM: dts: imx6qdl-sabresd: enable wdog2 instead of wdog1 in ldo-bypass...
Robin Gong [Thu, 14 Aug 2014 05:40:22 +0000 (13:40 +0800)]
ENGR00327300 ARM: dts: imx6qdl-sabresd: enable wdog2 instead of wdog1 in ldo-bypass board.

As we use WDOG_B pin of wdog2 to reset extenal pmic in ldo-bypass mode, so we need
use WDOG2 as the default watchdog device in kernel.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 50dad2a0ba9809da6fe446526f0acb65b5eaed25)

9 years agoENGR00279402-1 ARM: dts: imx6: add wdog reset source seclect in dts
Robin Gong [Thu, 12 Sep 2013 08:22:26 +0000 (16:22 +0800)]
ENGR00279402-1 ARM: dts: imx6: add wdog reset source seclect in dts

Some boards use another WDOG reset source to reboot system in ldo-bypass mode.
We need add the property in board dts file so that we can easily know the
WDOG reset source currently.

For Sabresd, WDOG1 for ldo-enable mode(WDOG event), WDOG2 for ldo-bypass mode
(reset external pmic to trigger POR event).
For sl-evk board, there is no WDOG pin connected with external pmic as Sabresd
, because mx6sl boot at 400Mhz. Then both ldo-enable and ldo-bypass mode use
the common WDOG1 as reset source.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit d960bbe78009d306f80957321622aaad0628ac4b)

9 years agoENGR00287983-2 imx restart: add another WDOG2 reset support for ldo-bypass
Robin Gong [Thu, 14 Nov 2013 05:58:21 +0000 (13:58 +0800)]
ENGR00287983-2 imx restart: add another WDOG2 reset support for ldo-bypass

For ldo-bypass mode on i.MX6Q/DL sabresd board, we will use another WDOG2 to
reset external pmic to trigger POR event, rather than WDOG1 to trigger WDOG
event in ldo-enable mode. We need to consider it in common mxc_restart().
On i.MX6SL sabresd board we use WDOG1 to trigger WDOG event both ldo-bypass and
ldo-enable mode.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit ee07b144e1adff13d262e7f353f5804e3c2d3e06)

9 years agoENGR00332011: ARM: dts: imx6qdl-sabreauto: enable gpio-key
Robin Gong [Thu, 18 Sep 2014 04:04:31 +0000 (12:04 +0800)]
ENGR00332011: ARM: dts: imx6qdl-sabreauto: enable gpio-key

enable gpio-key on imx6qdl-sabreauto board.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoARM: dts: imx6sl: add keypad support for i.mx6sl-evk board.
Anson Huang [Tue, 14 Jan 2014 09:30:28 +0000 (17:30 +0800)]
ARM: dts: imx6sl: add keypad support for i.mx6sl-evk board.

i.MX6SL EVK board has a 3*3 keypad matrix to support 8 keypads,
enable them, the keymap is as below:

SW6:  MATRIX_KEY(0x0, 0x0, KEY_UP)         /* ROW0, COL0 */
SW7:  MATRIX_KEY(0x0, 0x1, KEY_DOWN)       /* ROW0, COL1 */
SW8:  MATRIX_KEY(0x0, 0x2, KEY_ENTER)      /* ROW0, COL2 */
SW9:  MATRIX_KEY(0x1, 0x0, KEY_HOME)       /* ROW1, COL0 */
SW10: MATRIX_KEY(0x1, 0x1, KEY_RIGHT)      /* ROW1, COL1 */
SW11: MATRIX_KEY(0x1, 0x2, KEY_LEFT)       /* ROW1, COL2 */
SW12: MATRIX_KEY(0x2, 0x0, KEY_VOLUMEDOWN) /* ROW2, COL0 */
SW13: MATRIX_KEY(0x2, 0x1, KEY_VOLUMEUP)   /* ROW2, COL1 */

Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
(cherry picked from commit 4291b6455aa7bf6620cff9e8ef2b1389b8c8d4e0)

9 years agoENGR00318936-2 input: keyboard: imx: remove usless release interrupt enabled code
Robin Gong [Wed, 18 Jun 2014 06:14:09 +0000 (14:14 +0800)]
ENGR00318936-2 input: keyboard: imx: remove usless release interrupt enabled code

Remove useless code for release interrupt enabled, because we check status by
timer rather than release interrupt. Remove the code which may disable depress
interrupt. Also make sure enable depress interrupt in suspend function.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 806ed5b9769efff2c9d8c66ed19315b48ec6fd57)

9 years agoENGR00318936-1 input: keyboard: imx: add pm_stay_awake and pm_relax
Robin Gong [Tue, 10 Jun 2014 03:56:49 +0000 (11:56 +0800)]
ENGR00318936-1 input: keyboard: imx: add pm_stay_awake and pm_relax

There is a small window after system suspend but timer scan function
didn't finish timely, in this case,  system enter suspend without kpp
interrupt enabled and failed to resume back if key depressed.We add
pm_stay_awake and pm_relax to make sure system suspend flow abort in
this case.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 3868f06af8f39673f270643ada63dd88e2f5699e)

9 years agoENGR00243120 rtc:snvs: support power off system by SNVS
Robin Gong [Mon, 4 Feb 2013 08:20:05 +0000 (16:20 +0800)]
ENGR00243120 rtc:snvs: support power off system by SNVS

Enable the function by SNVS which located in snvs-rtc driver

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 79e3dc7b9f29213179ad6904ee0abc63d3ba5301)

9 years agoENGR00331116 ARM: dts: i.mx6sl-evk: Add mma8450 sensor dts support on i.MX6SL-EVK...
Luwei Zhou [Thu, 18 Sep 2014 05:15:43 +0000 (13:15 +0800)]
ENGR00331116 ARM: dts: i.mx6sl-evk: Add mma8450 sensor dts support on i.MX6SL-EVK platform.

Support MMA8450 sensor on i.MX6SL-EVK

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00331509-3 imx_v7_defconfig: enable isl29023 by default
Luwei Zhou [Wed, 17 Sep 2014 05:38:56 +0000 (13:38 +0800)]
ENGR00331509-3 imx_v7_defconfig: enable isl29023 by default

Enable isl29023 driver in default config.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00331509-2 ARM: dts: i.mx6q/dl/sx: Add isl29023 device tree support.
Luwei Zhou [Wed, 17 Sep 2014 05:03:03 +0000 (13:03 +0800)]
ENGR00331509-2 ARM: dts: i.mx6q/dl/sx: Add isl29023 device tree support.

Add isl29023 sensor device tree support on i.MX6Q/DL/SX platform.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00331509-1 input: misc: isl29023: Add isl29023 driver support on i.MX6Q/DL/SX...
Luwei Zhou [Wed, 17 Sep 2014 02:50:08 +0000 (10:50 +0800)]
ENGR00331509-1 input: misc: isl29023: Add isl29023 driver support on i.MX6Q/DL/SX platform.

Add isl29023 driver support for i.MX6Q/DL/SX platform. The code derives from 3.10.y branch.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00331790 ARM: dts: add new dts imx6sx-17x17-arm2-gpmi-weim.dts
Allen Xu [Fri, 12 Sep 2014 17:38:24 +0000 (12:38 -0500)]
ENGR00331790 ARM: dts: add new dts imx6sx-17x17-arm2-gpmi-weim.dts

For NAND and WEIM verification on 3.14 Kernel.

Signed-off-by: Allen Xu <b45815@freescale.com>
9 years agoENGR00331085-10: ARM: imx_v7_defconfig: build in audio modules
Shengjiu Wang [Wed, 3 Sep 2014 09:06:18 +0000 (17:06 +0800)]
ENGR00331085-10: ARM: imx_v7_defconfig: build in audio modules

Build in audio modules: FM, IMX_CS42888, IMX_HDMI.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00331085-9: ARM: dts: imx6sx-sdb: Support spdif out in sx-sdb board
Shengjiu Wang [Fri, 27 Jun 2014 06:02:28 +0000 (14:02 +0800)]
ENGR00331085-9: ARM: dts: imx6sx-sdb: Support spdif out in sx-sdb board

Add device tree for spdif in sx-sdb board.

Signed-off-by: Shengjiu Wang <b02247@freescale.com>
9 years agoENGR00331085-8: ARM: dts: imx6sx: add sai support for imx6sx-sdb board
Shengjiu Wang [Mon, 15 Sep 2014 11:40:20 +0000 (19:40 +0800)]
ENGR00331085-8: ARM: dts: imx6sx: add sai support for imx6sx-sdb board

SAI has pin conflicts with other moudles on all current boards of Solo X
and two sdma event conflicts with UART5.

Thus this patch adds new dtbs for SAI cases that occupy the pins and the
event IDs of SDMA.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00331085-7: ARM: dts: imx6sx: Add SSI<->WM8962 audio support for imx6sx-sdb
Shengjiu Wang [Tue, 16 Sep 2014 06:14:52 +0000 (14:14 +0800)]
ENGR00331085-7: ARM: dts: imx6sx: Add SSI<->WM8962 audio support for imx6sx-sdb

Append audio nodes to the devicetree to add audio support for imx6sx-sdb with
Wolfson WM8962 CODEC.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00331085-6: ARM: dts: imx6sl-evk: Add spdif support for imx6sl-evk
Shengjiu Wang [Tue, 16 Sep 2014 06:11:21 +0000 (14:11 +0800)]
ENGR00331085-6: ARM: dts: imx6sl-evk: Add spdif support for imx6sl-evk

Complete spdif devicetree binding for imx6sl, also add its support
for imx6sl-evk board.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00331085-5: ARM: dts: imx6sl-evk: Add WM8962 support for imx6sl-evk
Shengjiu Wang [Tue, 16 Sep 2014 06:08:11 +0000 (14:08 +0800)]
ENGR00331085-5: ARM: dts: imx6sl-evk: Add WM8962 support for imx6sl-evk

Add WM8962 support for imx6sl-evk:
 * Add pinctrl group for audmux on evk board
 * Add WM8962-related devictree binding for evk board
 * Add clock route for ssi.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00331085-4: ARM: dts: imx6qdl: Add si4763 support for imx6qdl-sabreauto
Shengjiu Wang [Thu, 11 Sep 2014 02:57:18 +0000 (10:57 +0800)]
ENGR00331085-4: ARM: dts: imx6qdl: Add si4763 support for imx6qdl-sabreauto

Add missing devicetree nodes and binding for the support.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00331085-3: ARM: dts: imx6qdl: enable hdmi audio
Shengjiu Wang [Wed, 3 Sep 2014 07:59:34 +0000 (15:59 +0800)]
ENGR00331085-3: ARM: dts: imx6qdl: enable hdmi audio

The HDMI audio's DMA type is changed to 24. So need to update the dts.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00331085-2: ARM: dts: imx6qdl: enable asrc support
Shengjiu Wang [Wed, 3 Sep 2014 07:48:34 +0000 (15:48 +0800)]
ENGR00331085-2: ARM: dts: imx6qdl: enable asrc support

Enable asrc support and enable asrc p2p for sound-cs42888.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00331085-1: ARM: dts: imx6qdl: enable sound-cs42888
Shengjiu Wang [Mon, 4 Aug 2014 08:38:45 +0000 (16:38 +0800)]
ENGR00331085-1: ARM: dts: imx6qdl: enable sound-cs42888

Enable sound-cs42888 in sabreauto board. Enable clock route for esai
from external 24.576MHz OSC to internal ESAI clock via analog clock2
PADs on the SoC and pll4 so that ESAI can get an entirely synchronous
clock source against CS42888.

    anaclk2                 0           1            24576000
     lvds2_in               0           1            24576000
      pll4_sel              0           1            24576000
       pll4_audio           0           1            24576000
        pll4_post_div       0           1            24576000
         pll4_audio_div     0           1            24576000
          esai_sel          0           1            24576000
           esai_pred        0           1            24576000
            esai_podf       0           1            24576000
             esai           0           1            24576000

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00301869-1 iio: adc: Enable i.MX6SX adc driver.
Luwei Zhou [Thu, 6 Mar 2014 07:47:47 +0000 (15:47 +0800)]
ENGR00301869-1 iio: adc: Enable i.MX6SX adc driver.

Enable i.MX6SX adc driver. ADC driver will try getting ADC controller
channel number via device tree, because i.MX chip enable 4 channels
on each controller.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from commit 14a6a98f64e26702b1c0ecfc7d58a45ee5752d54)

9 years agoiio:adc:imx: add Freescale Vybrid vf610 adc driver
Fugang Duan [Sun, 26 Jan 2014 05:39:00 +0000 (05:39 +0000)]
iio:adc:imx: add Freescale Vybrid vf610 adc driver

Add Freescale Vybrid vf610 adc driver. The driver only support
ADC software trigger.

VF610 ADC device documentation is available at below reference manual
(chapter 37):
http://cache.freescale.com/files/32bit/doc/ref_manual/VYBRIDRM.pdf?
fpsp=1&WT_TYPE=Reference%20Manuals&WT_VENDOR=FREESCALE&WT_FILE_FORMAT
=pdf&WT_ASSET=Documentation

CC: Shawn Guo <shawn.guo@linaro.org>
CC: Jonathan Cameron <jic23@kernel.org>
CC: Mark Rutland <mark.rutland@arm.com>
CC: Otavio Salvador <otavio@ossystems.com.br>
CC: Peter Meerwald <pmeerw@pmeerw.net>
CC: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
(cherry picked from commit 98f8dc71365e31944e34f225e08e1c87d3001b41)

9 years agoENGR00307635-6 ASoC: fsl: Enable SAI for imx-sgtl5000 and imx-wm8962
Nicolin Chen [Wed, 9 Apr 2014 09:12:12 +0000 (17:12 +0800)]
ENGR00307635-6 ASoC: fsl: Enable SAI for imx-sgtl5000 and imx-wm8962

Since we are able to link SAI and sgtl5000 and wm8962, we should update
the Kconfig to make it build-in if enabling their machine drivers.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit 5cf1d7bcc43ff45b60b90981845df03f20aede87)

9 years agoENGR00307635-5 ASoC: imx-wm8962: Add non-SSI cpu dai support
Nicolin Chen [Tue, 8 Apr 2014 11:13:15 +0000 (19:13 +0800)]
ENGR00307635-5 ASoC: imx-wm8962: Add non-SSI cpu dai support

The current imx-wm8962 machine driver is designed for SSI as CPU DAI only
while as its name we should make the driver more generic to any other CPU
DAI on i.MX serires -- ESAI, SAI for example.

So this patch makes the driver more general so as to support those non-SSI
cases.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit b6fca438dde1b4c0bbdee31729871d601f287dc9)

9 years agoENGR00312217-1 ASoC: fsl: pop noise with wm8962
Shengjiu Wang [Wed, 7 May 2014 10:02:15 +0000 (18:02 +0800)]
ENGR00312217-1 ASoC: fsl: pop noise with wm8962

The reason of pop noise is that we change the sysclk in hw_free, which is
for another wm8962 issue. So in currently the pop noise can't be resolved
with no confliction. So for Android, because the samplerate is fixed. we can
use other workaround for this issue: change the sysclk in the set_bias().

Signed-off-by: Shengjiu Wang <b02247@freescale.com>
(cherry picked from commit 84babc7fa0a56f6620f8b04a86baece620297dda)

9 years agoENGR00306857 pulseaudio5.0 mute Headphone volume when Headphone plugged
Shengjiu Wang [Thu, 3 Apr 2014 08:05:40 +0000 (16:05 +0800)]
ENGR00306857 pulseaudio5.0 mute Headphone volume when Headphone plugged

Pulseaudio will detect the Headphone Jack, then swith to Headphone.
So register new Jack for Headphone, the iface=CARD.

Signed-off-by: Shengjiu Wang <b02247@freescale.com>
(cherry picked from commit 6a715373c43f16e48883061049e67919281878d1)

9 years agoENGR00290229 ASoC: fsl: Drop snd_soc_dapm_sync() in imx-wm8962
Nicolin Chen [Fri, 29 Nov 2013 09:44:39 +0000 (17:44 +0800)]
ENGR00290229 ASoC: fsl: Drop snd_soc_dapm_sync() in imx-wm8962

As DAPM would do the sync() for us, we don't need to handle it by ourselves.
And leaving snd_soc_dapm_sync() here is dangerous because it would disable
the clock from WM8962 during the short period of the output route changing
since we don't leave the alternative route's enanbling to this machine driver
but to DAPM core.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
(cherry picked from commit c4dcde0b5119262cbb75c5136422af2071bffbda)

9 years agoENGR00279368-1 ASoC: fsl: Drop useless resume function in WM8962 machine driver
Nicolin Chen [Thu, 12 Sep 2013 06:24:20 +0000 (14:24 +0800)]
ENGR00279368-1 ASoC: fsl: Drop useless resume function in WM8962 machine driver

The resume function is useless for the driver because registered jack pin has
already handled suspend/resume cases, thus drop it.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
(cherry picked from commit d9357cae4492abd5bca41515793ab6fe461717b2)

9 years agoENGR00277715-4 ARM: dts: Add WM8962 jack detecting support for SabreSD
Nicolin Chen [Tue, 3 Sep 2013 11:03:05 +0000 (19:03 +0800)]
ENGR00277715-4 ARM: dts: Add WM8962 jack detecting support for SabreSD

Update devicetree to add WM8962 jack detecting support

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
(cherry picked from commit f1bbc5f51ed53148018ecf1fac171568f52d1d84)

9 years agoENGR00277715-3 ASoC: fsl: Add WM8962 jack detecting support
Nicolin Chen [Tue, 3 Sep 2013 04:45:05 +0000 (12:45 +0800)]
ENGR00277715-3 ASoC: fsl: Add WM8962 jack detecting support

There're two GPIOs connected to the headphone jack and microphone jack,
thus add the states detection.

Reviewed-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
(cherry picked from commit f85ca1dd664178328bd813651e91d612787b6926)

9 years agoENGR00277471 ASoC: fsl: Fix set-mute-failed issue after WM8962 capture
Nicolin Chen [Fri, 30 Aug 2013 08:02:35 +0000 (16:02 +0800)]
ENGR00277471 ASoC: fsl: Fix set-mute-failed issue after WM8962 capture

We only need to mute WM8962 after playback, so add direction check
before doing mute.

And a mute failure would cause hw_free() abruptly return after it,
which might drop the essential procedure code for FLL controlling.
Thus put mute before FLL controlling code and drop its return check.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
(cherry picked from commit 3133b6cfb31b202805d31d449bfa70383e5e1c75)

9 years agoENGR00274386-2 ASoC: imx-wm8962: Set MCLK source clock to 0Hz in hw_free()
Nicolin Chen [Tue, 13 Aug 2013 03:37:54 +0000 (11:37 +0800)]
ENGR00274386-2 ASoC: imx-wm8962: Set MCLK source clock to 0Hz in hw_free()

When DAPM closed WM8962 after playback, its driver would prompt
'wm8962 0-001a: Unsupported sysclk ratio 500' due to the invalid
divisor calculated by WM8962 codec driver.

To fix it, we can work around by setting its MCLK source to 0Hz,
so the codec driver would never get an invalid divisor any more.
Since hw_params() would re-set the MCLK source, no need to worry
about any side-effect.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
(cherry picked from commit a935f7680ac3958ce72cf7413cac278c0683d4c0)

9 years agoENGR00273838-9 ASoC: WM8962: Remove 64KHz sample rate support
Nicolin Chen [Mon, 5 Aug 2013 09:26:45 +0000 (17:26 +0800)]
ENGR00273838-9 ASoC: WM8962: Remove 64KHz sample rate support

64KHz is not in the auto samplerate list of WM8962. When playing a 64KHz
wave file, 'Unsupported rate 64000Hz' will be prompted.

Thus remove to let alsa-lib handle it.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
(cherry picked from commit 8ef4c44e90e1c4cc04d0351cc4df76923885bd58)

9 years agoENGR00273838-8 ASoC: WM8962: Let codec driver enable/disable its MCLK
Nicolin Chen [Mon, 5 Aug 2013 08:26:16 +0000 (16:26 +0800)]
ENGR00273838-8 ASoC: WM8962: Let codec driver enable/disable its MCLK

WM8962 needs its MCLK when powerup -- wm8962_resume(). Thus it's better
to control the MCLK in codec driver. Thus remove the clock enable in
machine dirver accordingly.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
(cherry picked from commit 007d3504914096760124f2ef13d52da206341a66)

9 years agoENGR00273838-7 ASoC: fsl: Use hw_params() and hw_free() to set FLL
Nicolin Chen [Mon, 5 Aug 2013 07:34:05 +0000 (15:34 +0800)]
ENGR00273838-7 ASoC: fsl: Use hw_params() and hw_free() to set FLL

We followed community way by using set_bias() to set FLL of WM8962.
But this can't meet our requirement: aplay -Dhw: 16khz.wav 24khz.wav.
Thus use hw_params() and hw_free() instead.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
(cherry picked from commit 8db9a2f44a5eecd02be2259a3783178a521ef2d2)

9 years agoASoC: wm8962: Let CODEC driver enable and disable its own MCLK
Nicolin Chen [Tue, 29 Jul 2014 10:38:39 +0000 (18:38 +0800)]
ASoC: wm8962: Let CODEC driver enable and disable its own MCLK

snd_soc_open() will trigger pm_runtime resume() which will then enable
the regulator and initialization. So we should make sure the MCLK is
enabled before this resume().

Previously we let the machine driver get the clock and enable it in
its probe(). However, considering about power saving, it'll be better
to enable it when it's going to be used and disable it after using.

So this patch just simply adds clk_get() and clk_enable() to WM8962
driver. Meanwhile, it marks clock pointer to NULL if no clock assigned
to it so it will not break any current function.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit d7821953cfe9803c593a682320468ce2de862803)

9 years agoASoC: wm8962: Convert to params_width()
Mark Brown [Thu, 31 Jul 2014 11:53:36 +0000 (12:53 +0100)]
ASoC: wm8962: Convert to params_width()

The CODEC doesn't care how data is laid out in memory.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
(cherry picked from commit ec4dc01eb41a7eb03675516975f704b355fe2fc1)

9 years agoENGR00331635-3: ARM: dts: imx6sx: Update sdma DT binding
Shengjiu Wang [Tue, 16 Sep 2014 05:40:39 +0000 (13:40 +0800)]
ENGR00331635-3: ARM: dts: imx6sx: Update sdma DT binding

Complete the compatible for sdma and use same firmware as imx6q.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00331635-2: dma: imx-sdma: Add SAI script support
Shengjiu Wang [Tue, 16 Sep 2014 05:43:59 +0000 (13:43 +0800)]
ENGR00331635-2: dma: imx-sdma: Add SAI script support

This patch adds SAI script support to imx-sdma.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00331635-1: dma: imx-sdma: Add imx6sx platform support
Shengjiu Wang [Tue, 16 Sep 2014 05:39:06 +0000 (13:39 +0800)]
ENGR00331635-1: dma: imx-sdma: Add imx6sx platform support

The new Solo X has more requirements for SDMA events. So it creates a event mux
to remap most of event numbers in GPR (General Purpose Register). If we want to
use SDMA support for those module who do not get the even number as default, we
need to configure GPR first.

Thus this patch adds this support of GPR event remapping configuration to the
SDMA driver.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00331450-14: ARM: dts: imx6sx-sdb: add pfuze100 support
Robin Gong [Mon, 15 Sep 2014 08:20:08 +0000 (16:20 +0800)]
ENGR00331450-14: ARM: dts: imx6sx-sdb: add pfuze100 support

Add pfuze100 support for imx6sx-sdb.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-13: ARM: dts: imx6sl: remove always-on for vddpu
Robin Gong [Mon, 15 Sep 2014 08:13:55 +0000 (16:13 +0800)]
ENGR00331450-13: ARM: dts: imx6sl: remove always-on for vddpu

PU can be dynamically turned off or on, so we need remove
"regulator-always-on" property.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-12: ARM: dts: imx6sl-evk-pf200: add pfuze200 support
Robin Gong [Mon, 15 Sep 2014 08:07:50 +0000 (16:07 +0800)]
ENGR00331450-12: ARM: dts: imx6sl-evk-pf200: add pfuze200 support

Add pfuze200 support on imx6sl-evk board.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-11: ARM: dts: imx6dl-sabresd-pf200: use ldo-enable mode
Robin Gong [Mon, 15 Sep 2014 07:59:38 +0000 (15:59 +0800)]
ENGR00331450-11: ARM: dts: imx6dl-sabresd-pf200: use ldo-enable mode

For pfuze200, we have to use ldo-enable mode, because VDDARM_IN and VDDSOC_IN
share the same regulator.
Add GPL license head.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-10 ARM: dts: imx6sl-evk: add ldo-bypass support
Robin Gong [Mon, 15 Sep 2014 07:28:42 +0000 (15:28 +0800)]
ENGR00331450-10 ARM: dts: imx6sl-evk: add ldo-bypass support

Add ldo-bypass support for imx6sl-evk board. Meanwhile, add ldo dts
to support ldo-enable mode.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-9: ARM: dts: imx6sl-evk: add pfuze100 support
Robin Gong [Mon, 15 Sep 2014 07:19:10 +0000 (15:19 +0800)]
ENGR00331450-9: ARM: dts: imx6sl-evk: add pfuze100 support

Add pfuze100 support for imx6sl-evk board.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-8: ARM: dts: imx6dl-sabresd-pf200: add pfuze200 support
Robin Gong [Mon, 15 Sep 2014 07:00:38 +0000 (15:00 +0800)]
ENGR00331450-8: ARM: dts: imx6dl-sabresd-pf200: add pfuze200 support

Add pfuze200 support on imx6dl-sabresd board.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-7: ARM: dts: imx6-sabresd: move pfuze100 device node to board level dts
Robin Gong [Mon, 15 Sep 2014 06:58:14 +0000 (14:58 +0800)]
ENGR00331450-7: ARM: dts: imx6-sabresd: move pfuze100 device node to board level dts

Move pfuze100 device node from imx6q/dl-sabresd.dts to imx6qdl-sabresd.dts

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-6: ARM: dts: imx6-sabresd: add dts for ldo enable mode
Robin Gong [Mon, 15 Sep 2014 06:07:52 +0000 (14:07 +0800)]
ENGR00331450-6: ARM: dts: imx6-sabresd: add dts for ldo enable mode

Add dts for ldo enable mode on imx6q/dl-sabresd board.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-5 ARM: imx: gpc: support PU bypass case
Robin Gong [Mon, 15 Sep 2014 05:36:30 +0000 (13:36 +0800)]
ENGR00331450-5 ARM: imx: gpc: support PU bypass case

Current anatop regulator driver will force vddsoc->sel = 0 if vddsoc
bypassed in u-boot. That also make sel of vddpu = 0 because vddpu
track the same value with vddsoc. So we bypass vddpu firstly to flow
anatop driver rule.
Another thing is consider there is no vddpu regulator in i.mx6sx, we
need take care of this case in gpc driver.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-4: ARM: dts: imx6q/dl: add ldo-bypass support
Robin Gong [Mon, 15 Sep 2014 05:33:46 +0000 (13:33 +0800)]
ENGR00331450-4: ARM: dts: imx6q/dl: add ldo-bypass support

Add ldo-bypass support on imx6q/dl. Currently, we use ldo-bypass
mode on imx6qdl-sabresd board, and ldo-enabled mode on imx6dl-sabre
auto board.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-3: ARM: dts: imx6qdl-sabreauto: add pfuze100 support
Robin Gong [Mon, 15 Sep 2014 01:01:51 +0000 (09:01 +0800)]
ENGR00331450-3: ARM: dts: imx6qdl-sabreauto: add pfuze100 support

Add pfuze100 support on imx6qdl-sabreaauto board.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-2: ARM: dts: imx6dl-sabresd: add pfuze100 support
Robin Gong [Mon, 15 Sep 2014 01:00:30 +0000 (09:00 +0800)]
ENGR00331450-2: ARM: dts: imx6dl-sabresd: add pfuze100 support

Add supoort pfuze100 on imx6dl-sabresd board

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331450-1: ARM: imx6q-sabresd: add pfuze100 support
Robin Gong [Mon, 15 Sep 2014 00:59:26 +0000 (08:59 +0800)]
ENGR00331450-1: ARM: imx6q-sabresd: add pfuze100 support

Add pfuze100 support on imx6q-sabresd board.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00331508-3 imx_v7_defconfig: enable mag3110 by default
Luwei Zhou [Tue, 16 Sep 2014 05:47:09 +0000 (13:47 +0800)]
ENGR00331508-3 imx_v7_defconfig: enable mag3110 by default

Enable mag3110 driver in default config.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00331508-2 ARM: dts: i.mx6q/dl/sx: Add mag3110 device tree support.
Luwei Zhou [Tue, 16 Sep 2014 05:41:15 +0000 (13:41 +0800)]
ENGR00331508-2 ARM: dts: i.mx6q/dl/sx: Add mag3110 device tree support.

Add mag3110 sensor device tree support on i.MX6Q/DL/SX platform.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00331508-1 hwmon: mag3110: Add mag3110 driver support on i.MX6Q/DL/SX platform.
Luwei Zhou [Tue, 16 Sep 2014 05:05:41 +0000 (13:05 +0800)]
ENGR00331508-1 hwmon: mag3110: Add mag3110 driver support on i.MX6Q/DL/SX platform.

Add mag3110 driver support for i.MX6Q/DL/SX platform. The code derives from 3.10.y branch.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00317981 ARM: dts: imx: apply ENET IRQ workaround for sabresd board
Shawn Guo [Mon, 15 Sep 2014 03:32:40 +0000 (11:32 +0800)]
ENGR00317981 ARM: dts: imx: apply ENET IRQ workaround for sabresd board

This a forward porting of commit (ENGR00313685-15 ARM: dts: imx: apply
ENET IRQ workaround for sabresd board) from imx_3.10.y to imx_3.14.y.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
9 years agoENGR00317981 net: fec: handle WAIT mode issue for imx6qdl
Shawn Guo [Mon, 15 Sep 2014 03:20:58 +0000 (11:20 +0800)]
ENGR00317981 net: fec: handle WAIT mode issue for imx6qdl

This is a combination of commits 919d46e37e04 (ENGR00265935 net: fec:
add pm_qos to avoid cpu enter to wait mode) and 8a12c90c9974
(ENGR00313685-14 net: fec: check workaround for FEC_QUIRK_BUG_WAITMODE)
from imx_3.10.y branch.  It's added for imx_3.14.y branch to work around
imx6qdl issue ERR006687 (ENET: Only the ENET wake-up interrupt request
can wake the system from Wait mode).

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
9 years agoENGR00331506-3 imx_v7_defconfig: enable mma8451 by default
luweizhou [Mon, 15 Sep 2014 08:36:32 +0000 (16:36 +0800)]
ENGR00331506-3 imx_v7_defconfig: enable mma8451 by default

Enable mma8451 by default.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00331506-2 ARM: dts: i.mx6q/dl/sx: Add mma8451 device tree support.
luweizhou [Mon, 15 Sep 2014 08:34:31 +0000 (16:34 +0800)]
ENGR00331506-2 ARM: dts: i.mx6q/dl/sx: Add mma8451 device tree support.

Add mma8451 sensor device tree support on i.MX6Q/DL/SX platform.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00331506-1 hwmon: mma8451: Add mma8451 driver support on i.MX6Q/DL/SX platform.
luweizhou [Mon, 15 Sep 2014 08:20:10 +0000 (16:20 +0800)]
ENGR00331506-1 hwmon: mma8451: Add mma8451 driver support on i.MX6Q/DL/SX platform.

Add mma8451 driver support for i.MX6Q/DL/SX platform. The code derives from 3.10.y branch.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoARM: dts: imx6sx: add multi-queue support enet
Frank Li [Fri, 12 Sep 2014 21:00:57 +0000 (05:00 +0800)]
ARM: dts: imx6sx: add multi-queue support enet

Enable 3 queues suppport for ethernet

Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoARM: Documentation: Update fec dts binding doc
Frank Li [Fri, 12 Sep 2014 21:00:56 +0000 (05:00 +0800)]
ARM: Documentation: Update fec dts binding doc

    This patch update fec devicetree binding doc that add Optional
    properties "fsl,num-tx-queues" and "fsl,num-rx-queues".

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: init complete variable in early to avoid kernel dump
Fugang Duan [Fri, 12 Sep 2014 21:00:55 +0000 (05:00 +0800)]
net: fec: init complete variable in early to avoid kernel dump

Software clear the MDIO interrupt before MDIO bus access, but
MAC still generate MDIO interrupt. The issue only happen on
imx6slx chip.

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.17.0-rc1-00399-g0bcad17 #315
Backtrace:
[<800121fc>] (dump_backtrace) from [<800124e0>] (show_stack+0x18/0x1c)
 r6:8096e534 r5:8096e534 r4:00000000 r3:00000000
[<800124c8>] (show_stack) from [<806a4c60>] (dump_stack+0x8c/0xa4)
[<806a4bd4>] (dump_stack) from [<80060ab8>] (__lock_acquire+0x1814/0x1c40)
 r6:be078000 r5:be074000 r4:be03f6e4 r3:be078000
[<8005f2a4>] (__lock_acquire) from [<800616e0>] (lock_acquire+0x70/0x84)
 r10:809ada33 r9:be010600 r8:00000096 r7:00000001 r6:be074000 r5:00000000
 r4:60000193
[<80061670>] (lock_acquire) from [<806abb20>] (_raw_spin_lock_irqsave+0x40/0x54)
 r7:00000000 r6:8005a3f8 r5:00000193 r4:be03f6d4
[<806abae0>] (_raw_spin_lock_irqsave) from [<8005a3f8>] (complete+0x1c/0x4c)
 r6:80950904 r5:be03f6d0 r4:be03f6d4
[<8005a3dc>] (complete) from [<8041b4c0>] (fec_enet_interrupt+0x128/0x164)
 r6:80950904 r5:00800000 r4:be03f000 r3:00000000
[<8041b398>] (fec_enet_interrupt) from [<8006aeac>] (handle_irq_event_percpu+0x38/0x13c)
 r6:00000000 r5:be01065c r4:be399e00 r3:8041b398
[<8006ae74>] (handle_irq_event_percpu) from [<8006aff4>] (handle_irq_event+0x44/0x64)
 r10:be03f000 r9:80989fe0 r8:00000000 r7:00000096 r6:be399e00 r5:be01065c
 r4:be010600
[<8006afb0>] (handle_irq_event) from [<8006e3e8>] (handle_fasteoi_irq+0xc8/0x1bc)
 r6:8096e764 r5:be01065c r4:be010600 r3:00000000
[<8006e320>] (handle_fasteoi_irq) from [<8006a63c>] (generic_handle_irq+0x30/0x44)
 r6:be074010 r5:80945e4c r4:00000096 r3:8006e320
[<8006a60c>] (generic_handle_irq) from [<8000f218>] (handle_IRQ+0x54/0xbc)
 r4:80950d74 r3:00000180
[<8000f1c4>] (handle_IRQ) from [<800086cc>] (gic_handle_irq+0x30/0x68)
 r8:be3ab478 r7:c080e100 r6:be075bd8 r5:80950eec r4:c080e10c r3:000000a0
[<8000869c>] (gic_handle_irq) from [<80013064>] (__irq_svc+0x44/0x5c)

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: change FEC alignment according to i.mx6 sx requirement
Fugang Duan [Fri, 12 Sep 2014 21:00:54 +0000 (05:00 +0800)]
net: fec: change FEC alignment according to i.mx6 sx requirement

i.MX6 SX change FEC alignment requirement.
i.MX6 SX change internal bus from AHB to AXI.
It require RX buffer must be 64 bytes alignment.
And remove TX buffer alignment requirement.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet:fec: Add fsl,imx6sx-fec compatible strings
Fugang Duan [Fri, 12 Sep 2014 21:00:53 +0000 (05:00 +0800)]
net:fec: Add fsl,imx6sx-fec compatible strings

Add compatible string "fsl,imx6sx-fec" for i.MX6SX.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: add enet-avb IP support
Frank Li [Fri, 12 Sep 2014 21:00:52 +0000 (05:00 +0800)]
net: fec: add enet-avb IP support

i.MX6SX Enet-AVB support 3 tx queues, 3 rx queues.
For tx queues: ring 0 -> best effort
       ring 1 -> Class A
       ring 2 -> Class B
For rx queues:
       ring 0 -> best effort
       ring 1 -> receive VLAN packet with classification match
       ring 2 -> receive VLAN packet with classification match

Add enet-avb IP multiqueue support for the driver.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet:fec: Disable enet-avb MAC instead of reset MAC
Fugang Duan [Fri, 12 Sep 2014 21:00:51 +0000 (05:00 +0800)]
net:fec: Disable enet-avb MAC instead of reset MAC

For i.MX6SX enet use AXI bus, reset MAC will make system bus dead
if ENET-AXI bus has pending access (AHB bus should not have such issue).
So, disable enet with AVB MAC instead of reset MAC itself.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: init multi queue date structure
Frank Li [Fri, 12 Sep 2014 21:00:50 +0000 (05:00 +0800)]
net: fec: init multi queue date structure

initilized all queues according to queue number get from DT file.

Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: Duan Fugang <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: parser max queue number from dt file
Fugang Duan [Fri, 12 Sep 2014 21:00:49 +0000 (05:00 +0800)]
net: fec: parser max queue number from dt file

By default, the tx/rx queue number is 1, user can config the queue number
at DTS file like this:
fsl,num-tx-queues=<3>;
fsl,num-rx-queues=<3>

Since i.MX6SX enet-AVB IP support multi queues, so use multi queues
interface to allocate and set up an Ethernet device.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: change data structure to support multiqueue
Fugang Duan [Fri, 12 Sep 2014 21:00:48 +0000 (05:00 +0800)]
net: fec: change data structure to support multiqueue

This patch just change data structure to support multi-queue.
Only 1 queue enabled.

Ethernet multiqueue mechanism can improve performance in SMP system.
For single hw queue, multiqueue can balance cpu loading.
For multi hw queues, multiple cores can process network packets in parallel,
and refer the article for the detail advantage for multiqueue:
http://vger.kernel.org/~davem/davem_nyc09.pdf

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <frank.li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet:fec: add enet AVB feature macro define for imx6sx
Fugang Duan [Fri, 12 Sep 2014 21:00:47 +0000 (05:00 +0800)]
net:fec: add enet AVB feature macro define for imx6sx

Add enet AVB feature macro define for imx6sx.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet:fec: add enet refrence clock for i.MX 6SX chip
Fugang Duan [Fri, 12 Sep 2014 21:00:46 +0000 (05:00 +0800)]
net:fec: add enet refrence clock for i.MX 6SX chip

i.MX6sx enet has below clocks for user config:
clk_ipg: ipg_clk_s, ipg_clk_mac0_s, 66Mhz
clk_ahb: enet system clock, it is enet AXI clock for imx6sx.
 For imx6sx, it alos is the clock source of interrupt coalescing.
 The clock range: 200Mhz ~ 266Mhz.
clk_ref: refrence clock for tx and rx. For imx6sx enet RGMII mode,
 the refrence clock is 125Mhz coming from internal PLL or external.
 In i.MX6sx-arm2 board, the clock is from internal PLL.
 clk_ref is optional, depends on board.
clk_enet_out: The clock can be output from internal PLL. It can supply 50Mhz
 clock for phy. clk_enet_out is optional, depends on chip and board.
clk_ptp: 1588 ts clock. It is optional, depends on chip.

The patch add clk_ref to distiguish the different clocks.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: ptp: avoid register access when ipg clock is disabled
Nimrod Andy [Thu, 21 Aug 2014 09:09:38 +0000 (17:09 +0800)]
net: fec: ptp: avoid register access when ipg clock is disabled

The current kernel hang on i.MX6SX with rootfs mount from MMC.
The root cause is that ptp uses a periodic timer to access enet register
even if ipg clock is disabled.

FEC ptp driver start one period timer to read 1588 counter register in the
ptp init function that is called after FEC driver is probed.

To save power, after FEC probe finish, FEC driver disable all clocks including
ipg clock that is needed for register access.

i.MX5x, i.MX6q/dl/sl FEC register access don't cause system hang when ipg clock
is disabled, just return zero value. But for i.MX6sx SOC, it cause system hang.

To avoid the issue, we need to check ptp clock status before ptp timer count access.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: Support phys probed from devicetree and fixed-link
Uwe Kleine-König [Mon, 11 Aug 2014 15:35:33 +0000 (17:35 +0200)]
net: fec: Support phys probed from devicetree and fixed-link

This adds support for specifying the phy to be used with the fec in the
devicetree using the standard phy-handle property and also supports
fixed-link.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agofec: Simplify the PM related hooks
Fabio Estevam [Thu, 24 Jul 2014 21:24:01 +0000 (18:24 -0300)]
fec: Simplify the PM related hooks

Get rid of the CONFIG_PM_SLEEP ifdef by annotating the suspend/resume functions
with '__maybe_unused' in order to keep the code simpler and shorter.

While at it, declare the suspend/resume functions in a single line.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: consolidate hwtstamp implementation
Russell King [Tue, 8 Jul 2014 12:02:09 +0000 (13:02 +0100)]
net: fec: consolidate hwtstamp implementation

Both transmit and receive use the same infrastructure for calculating
the packet timestamp.  Rather than duplicating the code, provide a
function to do this common work.  Model this function in the Intel
e1000e version which avoids calling ns_to_ktime() within the spinlock;
the spinlock is critical for timecounter_cyc2time() but not
ns_to_ktime().

Acked-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: remove useless status check in tx reap path
Russell King [Tue, 8 Jul 2014 12:02:04 +0000 (13:02 +0100)]
net: fec: remove useless status check in tx reap path

Remove a useless status check in the transmit reap path - we have
already checked that the BD_ENET_TX_READY bit is clear, and as the
hardware only ever clears this bit, there is no way this test can ever
be true.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: add support for dumping transmit ring on timeout
Russell King [Tue, 8 Jul 2014 12:01:59 +0000 (13:01 +0100)]
net: fec: add support for dumping transmit ring on timeout

When we timeout on transmit, it would be useful to dump the transmit
ring, so we can see the ring state.  This can be helpful to diagnose
the cause of transmit timeouts.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: reorder ethtool ops to match order in struct declaration
Russell King [Tue, 8 Jul 2014 12:01:54 +0000 (13:01 +0100)]
net: fec: reorder ethtool ops to match order in struct declaration

This allows us to merge two separate preprocessor conditionals together.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: clear receive interrupts before processing a packet
Russell King [Tue, 8 Jul 2014 12:01:49 +0000 (13:01 +0100)]
net: fec: clear receive interrupts before processing a packet

Clear any pending receive interrupt before we process a pending packet.
This helps to avoid any spurious interrupts being raised after we have
fully cleaned the receive ring, while still allowing an interrupt to be
raised if we receive another packet.

The position of this is critical: we must do this prior to reading the
next packet status to avoid potentially dropping an interrupt when a
packet is still pending.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: replace delayed work with standard work
Russell King [Tue, 8 Jul 2014 12:01:44 +0000 (13:01 +0100)]
net: fec: replace delayed work with standard work

As of "better implementation of iMX6 ERR006358 quirk", we no longer have
a requirement for a delayed work.  Moreover, the work is now only used
for timeout purposes, so the timeout flag is also pointless - we set it
each time we queue the work, and the work clears it.

Replace the fec_enet_delayed_work struct with a standard work_struct,
resulting in simplified timeout handling code.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: better implementation of iMX6 ERR006358 quirk
Russell King [Tue, 8 Jul 2014 12:01:38 +0000 (13:01 +0100)]
net: fec: better implementation of iMX6 ERR006358 quirk

Using a (delayed) workqueue for ERR006358 is not correct - a work queue
is a single-trigger device.  Once the work queue has been scheduled, it
can't be re-scheduled until it has been run.  This can cause problems -
with an appropriate packet timing, we can end up with packets queued,
but not sent by the hardware, resulting in the transmit timeout firing.

Re-implement this as per the workaround detailed in the ERR006358
documentation - if there are packets waiting to be sent when we service
the transmit ring, and we see that the transmitter is not running,
kick the transmitter to run the pending entries in the ring.

Testing here with a 10Mbit half duplex link sees the resulting iperf
TCP bandwidth increase from between 1 to 2Mbps to between 8 to 9Mbps.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: clean up duplex mode handling
Russell King [Tue, 8 Jul 2014 11:40:43 +0000 (12:40 +0100)]
net: fec: clean up duplex mode handling

Many places call fec_restart() with the second parameter being some kind
of previously saved duplex value, but only two places call it with some
other setting.  This is at odds with how the other link settings are
handled, and used to be racy before the rtnl locks were added to
fec_restart()'s various call paths.

Clean this up so all link capabilities are handled in the same way -
saved into the fec_enet_private structure, and then fec_restart() acts
on those settings.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: quiesce packet processing when taking link down in fec_enet_adjust_link()
Russell King [Tue, 8 Jul 2014 11:40:38 +0000 (12:40 +0100)]
net: fec: quiesce packet processing when taking link down in fec_enet_adjust_link()

When the link goes down, the adjust_link method will be called, but
there is no synchronisation to ensure that we won't be processing some
last remaining packets via the NAPI handlers while performing a reset of
the device.

Add the necessary synchronisation to ensure that packet processing
is complete before we stop and reset the FEC.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: quiesce packet processing before changing features
Russell King [Tue, 8 Jul 2014 11:40:33 +0000 (12:40 +0100)]
net: fec: quiesce packet processing before changing features

Changing the features (receive checksumming) requires the hardware to be
reprogrammed, and also changes the checks in the receive packet
processing.

The current implementation has a race - fec_set_features() changes the
flags which alter the receive packet processing while the adapter is
active, and potentially receiving frames.  Only after we've modified
the software flag do we shutdown and reconfigure the hardware.

This can lead to packets being received and marked with a valid checksum
(via CHECKSUM_UNNECESSARY) when the hardware checksum validation has not
yet been enabled.

We must quiesce the device, then change the software configuration for
this feature, and then resume the device if it was previously running.

The resulting code structure also allows us to add other configuration
features in this path without having to quiesce and resume the network
interface and device.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: quiesce packet processing before stopping device in fec_set_features()
Russell King [Tue, 8 Jul 2014 11:40:28 +0000 (12:40 +0100)]
net: fec: quiesce packet processing before stopping device in fec_set_features()

fec_set_features() calls fec_stop() to stop the transmit ring while the
transmit queue is still active.  This can lead to the transmit ring
being restarted by an intervening packet queued for transmission, or
by the tx quirk timer expiring.

Fix this by disabling NAPI (which ensures that the NAPI handlers are
not running), and then take the transmit lock while we stop and
restart the adapter (which prevents new packets being queued).

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: quiesce packet processing before stopping device in fec_suspend()
Russell King [Tue, 8 Jul 2014 11:40:23 +0000 (12:40 +0100)]
net: fec: quiesce packet processing before stopping device in fec_suspend()

fec_suspend() calls fec_stop() to stop the transmit ring while the
transmit packet processing is still active.  This can lead to the
transmit queue being restarted by an intervening packet queued for
transmission, or by the tx quirk timer expiring.

Fix this by disabling NAPI first, which will ensure that the NAPI
handlers are not running.  Then, take the transmit lock before
detaching the netif device.  This ensures that there are no races
with the transmit path - and also ensures that the watchdog won't
fire.

We can then safely stop the ethernet device itself, knowing that the
rest of the driver is safely shut down.

On resume, we bring the device back up in reverse order - we restart
the device, reattach the device (under the tx lock), and then enable
the NAPI handlers.

We also need to adjust the close function to cope with this new
sequence, so that it's possible to cleanly close down the driver
after the hardware fails to resume (eg, due to the regulator_enable()
or pinctrl calls in the resume path returning an error.)

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>