]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 years agoPCI: imx6: Fix imprecise abort handler
Tim Harvey [Fri, 18 Oct 2013 00:27:22 +0000 (17:27 -0700)]
PCI: imx6: Fix imprecise abort handler

An imprecise abort is triggered when a port behind a switch is accessed
and no device is present.  At enumeration, imprecise aborts are not enabled
thus this ends up getting deferred until the kernel has completed init.  At
that point we must not adjust PC - the handler must do nothing, but a
handler must exist.

This fixes random crashes that occur right after freeing init.

Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Marek Vasut <marex@denx.de>(cherry picked from commit 4ec3ed7f5e91e9325c810dcb995ef5a55e4a79a6)
10 years agoPCI: imx6: Remove redundant dev_err() in imx6_pcie_probe()
Wei Yongjun [Sat, 12 Oct 2013 06:11:02 +0000 (14:11 +0800)]
PCI: imx6: Remove redundant dev_err() in imx6_pcie_probe()

There is an error message within devm_ioremap_resource()
already, so remove the dev_err() call to avoid redundant
error message.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>(cherry picked from commit 9b5cd0948b67e1750498b5ff85267e87d3b4c5b3)
10 years agoPCI: imx6: Add support for i.MX6 PCIe controller
Sean Cross [Thu, 26 Sep 2013 03:24:47 +0000 (11:24 +0800)]
PCI: imx6: Add support for i.MX6 PCIe controller

Add support for the PCIe port present on the i.MX6 family of controllers.
These use the Synopsis Designware core tied to their own PHY.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
(cherry picked from commit bb38919ec56e0758c3ae56dfc091dcde1391353e)

10 years agoARM: imx6q: Add PCIe bits to GPR syscon definition
Sean Cross [Thu, 26 Sep 2013 03:24:46 +0000 (11:24 +0800)]
ARM: imx6q: Add PCIe bits to GPR syscon definition

PCIe requires additional bits be defined for GPR8 and GPR12.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
(cherry picked from commit 8d6a35fb13406f87d926fffeee0d70360ce3077d)

10 years agoARM: dts: imx6qdl: add pcie device node
Sean Cross [Thu, 26 Sep 2013 02:51:09 +0000 (10:51 +0800)]
ARM: dts: imx6qdl: add pcie device node

Add pcie device node for imx6qdl.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
(cherry picked from commit 3a57291fa4ca7f7647d826f5b47082ef306d839f)

10 years agoENGR00288568 Revert "ENGR00275213-1 arm: pcie: enable pcie on imx6 platforms"
Richard Zhu [Thu, 7 Nov 2013 08:44:23 +0000 (16:44 +0800)]
ENGR00288568 Revert "ENGR00275213-1 arm: pcie: enable pcie on imx6 platforms"

switch to community upstreamed pcie driver.
Revert "ENGR00275213-1 arm: pcie: enable pcie on imx6 platforms"
This reverts commit d33370c77e57aed5a9b6733c9898418541fed54a.

Conflicts:

Documentation/devicetree/bindings/clock/imx6q-clock.txt
arch/arm/mach-imx/clk-imx6q.c

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288567 Revert "ENGR00275213-2 ARM: imx6q: update the pcie bits definitions...
Richard Zhu [Thu, 7 Nov 2013 08:39:38 +0000 (16:39 +0800)]
ENGR00288567 Revert "ENGR00275213-2 ARM: imx6q: update the pcie bits definitions of gpr"

switch to community upstreamed pcie driver.
Revert "ENGR00275213-2 ARM: imx6q: update the pcie bits definitions of gpr"
This reverts commit 0ddad708c7484a8b5d2016d31fda2bd8b9b8f275.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288566 Revert "ENGR00275213-3 arm: dts: enable pcie on imx6 platforms"
Richard Zhu [Thu, 7 Nov 2013 08:38:10 +0000 (16:38 +0800)]
ENGR00288566 Revert "ENGR00275213-3 arm: dts: enable pcie on imx6 platforms"

switch to community upstreamed pcie driver.
Revert "ENGR00275213-3 arm: dts: enable pcie on imx6 platforms"
This reverts commit 085fa6af23253017220d29e156dd19060af3d9c1.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288565 Revert "ENGR00275213-4 pcie_imx: enable pcie on imx6 platforms"
Richard Zhu [Thu, 7 Nov 2013 08:34:54 +0000 (16:34 +0800)]
ENGR00288565 Revert "ENGR00275213-4 pcie_imx: enable pcie on imx6 platforms"

switch to community upstreamed pcie driver.
Revert "ENGR00275213-4 pcie_imx: enable pcie on imx6 platforms"
This reverts commit dce7d25b770086a978d4dd9838c46f5ff52ee135.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288564 Revert "ENGR00277241 imx: pcie: Re-correct the pcie dts"
Richard Zhu [Thu, 7 Nov 2013 08:34:31 +0000 (16:34 +0800)]
ENGR00288564 Revert "ENGR00277241 imx: pcie: Re-correct the pcie dts"

switch to community upstreamed pcie driver.
Revert "ENGR00277241 imx: pcie: Re-correct the pcie dts"
This reverts commit 611f8d430690643f828ba94f8cab52e45bbfcca9.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288563 Revert "ENGR00277654 imx: pcie: enable pcie lm errata when pcie is enabled"
Richard Zhu [Thu, 7 Nov 2013 08:34:15 +0000 (16:34 +0800)]
ENGR00288563 Revert "ENGR00277654 imx: pcie: enable pcie lm errata when pcie is enabled"

switch to community upstreamed pcie driver.
Revert "ENGR00277654 imx: pcie: enable pcie lm errata when pcie is enabled"
This reverts commit 72524b16f5cb4e13c1a194dda4cc0c4f206e4e46.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288562 Revert "ENGR00278492 imx: pcie: delay is required after REF_CLK_EN is...
Richard Zhu [Thu, 7 Nov 2013 08:33:17 +0000 (16:33 +0800)]
ENGR00288562 Revert "ENGR00278492 imx: pcie: delay is required after REF_CLK_EN is set"

switch to community upstreamed pcie driver.
Revert "ENGR00278492 imx: pcie: delay is required after REF_CLK_EN is set"
This reverts commit 1976e889408175354a19824375bc5137f43ef14e.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00270037 mxc: mlb: Fix MLB crash when testing abnormally
Luwei Zhou [Tue, 19 Nov 2013 09:32:35 +0000 (17:32 +0800)]
ENGR00270037 mxc: mlb: Fix MLB crash when testing abnormally

If quit the test program via CTRL+c during the test and leaving
the MITB still running, kernel crash sometimes happen when launching
the test program for a second time. This patch fix this issue. The
main modification is:

* Initialize the wait queue head dynamically not statically
* Enable/Disalbe IRQ when necessary

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = 80004000
[00000000] *pgd=00000000
Internal error: Oops: 80000007 [#1] SMP ARM
Modules linked in: mxc_mlb150
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.10.17-16879-g5d48ab5 #227
task: 80c2d908 ti: 80c22000 task.ti: 80c22000
PC is at 0x0
LR is at __wake_up_common+0x54/0x94
pc : [<00000000>]    lr : [<8004b9fc>]    psr: 90000193
sp : 80c23e18  ip : dc86ff1c  fp : 80c23e44
r10: 00000000  r9 : 00000001  r8 : 00000000
r7 : 00000000  r6 : 7f002fe0  r5 : 7f0017fc  r4 : dcaff0f4
r3 : 00000000  r2 : 00000000  r1 : 00000001  r0 : dc86ff1c
Flags: NzcV  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: 6c90004a  DAC: 00000015
Process swapper/0 (pid: 0, stack limit = 0x80c22238)
Stack: (0x80c23e18 to 0x80c24000)
3e00:                                                       00000000 00000001
3e20: dc1d14c0 7f002fdc 20000193 00000001 00000001 00000000 00000000 80c7018e
3e40: 80c23e6c 8004bbf4 00000000 8004bbf4 00000004 0091a840 7f002f80 7f002e1c
3e60: 00000004 fffffff9 00000001 7f001054 ffffae63 00000009 0000005a 00000000
3e80: ffffffff 00000010 00000095 00000000 00000000 00000095 dc011180 7f001168
3ea0: dc482e40 80073c08 00000015 80c2a770 80c1e7e0 dc011180 00000095 00000000
3ec0: f4000100 00000000 00000000 80c22000 80c2a4d8 80073d70 00000000 dc011180
3ee0: 00000095 80076ae8 00000095 800733d0 80c1ee3c 8000e848 f400010c 80c2a8b8
3f00: 80c23f20 80008570 8005a15c 804299d0 60000013 ffffffff 80c23f54 8000dbc0
3f20: 80c23f68 0000005a 3437dc5e 00000015 34373d83 00000015 81aef080 80c30050
3f40: 00000000 00000000 80c22000 80c2a4d8 00000017 80c23f68 8005a15c 804299d0
3f60: 60000013 ffffffff 3437dc5e 00000015 80cc41a4 806152ac 81aef080 80cc41a4
3f80: 00000000 80c30050 00000000 80429b10 00000001 80c7017a 80c2a524 806152ac
3fa0: 80c22000 80c7017a 80c22000 8000eb7c 00067162 800599f0 000000d9 80c12ef0
3fc0: 00000000 80bd6a9c ffffffff ffffffff 80bd6548 00000000 00000000 80c12ef0
3fe0: 10c53c7d 80c2a4a0 80c12eec 80c2e6ec 1000406a 10008074 00000000 00000000
[<8004b9fc>] (__wake_up_common+0x54/0x94) from [<8004bbf4>] (__wake_up+0x3c/0x50)
[<8004bbf4>] (__wake_up+0x3c/0x50) from [<7f001054>] (mlb_tx_isr+0xa0/0xf4 [mxc_mlb150])
[<7f001054>] (mlb_tx_isr+0xa0/0xf4 [mxc_mlb150]) from [<7f001168>] (mlb_ahb_isr+0xc0/0x134 [mxc_mlb150])
[<7f001168>] (mlb_ahb_isr+0xc0/0x134 [mxc_mlb150]) from [<80073c08>] (handle_irq_event_percpu+0x54/0x17c)
[<80073c08>] (handle_irq_event_percpu+0x54/0x17c) from [<80073d70>] (handle_irq_event+0x40/0x60)
[<80073d70>] (handle_irq_event+0x40/0x60) from [<80076ae8>] (handle_fasteoi_irq+0x80/0x158)
[<80076ae8>] (handle_fasteoi_irq+0x80/0x158) from [<800733d0>] (generic_handle_irq+0x2c/0x3c)
[<800733d0>] (generic_handle_irq+0x2c/0x3c) from [<8000e848>] (handle_IRQ+0x40/0x90)
[<8000e848>] (handle_IRQ+0x40/0x90) from [<80008570>] (gic_handle_irq+0x2c/0x5c)
[<80008570>] (gic_handle_irq+0x2c/0x5c) from [<8000dbc0>] (__irq_svc+0x40/0x50

Signed-off-by: Luwei Zhou <b45643@freescale.com>
10 years agoENGR00288421-4 mxc: asrc: keep map/unmap parameters symmetic
Nicolin Chen [Tue, 19 Nov 2013 06:57:00 +0000 (14:57 +0800)]
ENGR00288421-4 mxc: asrc: keep map/unmap parameters symmetic

We are using DEV_TO_MEM for dma_map but MEM_TO_DEV for dma_unmap, thus fix it.
It also adds missing device pointer since assigning it to dma_free_coherent().

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00288421-3 ASoC: fsl_ssi: Move i2s_mode from static to ssi_private
Nicolin Chen [Mon, 18 Nov 2013 09:54:01 +0000 (17:54 +0800)]
ENGR00288421-3 ASoC: fsl_ssi: Move i2s_mode from static to ssi_private

It's no good to use static variable because there might be several
drivers calling the function and the value would be overwritten by
all of them. Thus we move it into ssi_private.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00288421-2 ASoC: fsl_spdif: Ignore system clock due to potential risk
Nicolin Chen [Mon, 18 Nov 2013 09:35:19 +0000 (17:35 +0800)]
ENGR00288421-2 ASoC: fsl_spdif: Ignore system clock due to potential risk

The current clock selecting mechanism would choose a clock and set its rate
later when using it. It might be feasible for other clock sources but not
for sysclk -- ipg clock. Changing ipg clock rate in specific driver would
be a dangerous operation, so we here ingore the sysclk and will restore it
after we accomplish a better mechanism.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00288421-1 ASoC: fsl_spdif: Use correct clock for Rx clock rate calculation
Nicolin Chen [Mon, 18 Nov 2013 09:17:10 +0000 (17:17 +0800)]
ENGR00288421-1 ASoC: fsl_spdif: Use correct clock for Rx clock rate calculation

According to the Reference Manual, we should use system clock to calculate
rx clock rate instead of spdif own clock. Thus add system clock to spdif
driver and replace the incorrect one in rate calculation.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agomtd: gpmi: use devm_request_irq
Huang Shijie [Thu, 14 Nov 2013 06:25:49 +0000 (14:25 +0800)]
mtd: gpmi: use devm_request_irq

Use devm_request_irq to simplify the code.
Also remove the unused fields of structure resources{}.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: use devm_ioremap_resource
Huang Shijie [Thu, 14 Nov 2013 06:25:48 +0000 (14:25 +0800)]
mtd: gpmi: use devm_ioremap_resource

Use the devm_ioremap_resource to simplify the code.

[Note: as a side effect, this adds a missing call to request_memory().]

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: rename the functions from gpmi_nfc_* to gpmi_nand_*
Huang Shijie [Thu, 14 Nov 2013 06:25:47 +0000 (14:25 +0800)]
mtd: gpmi: rename the functions from gpmi_nfc_* to gpmi_nand_*

The gpmi_nfc_* is the legacy name. In order to avoid the confusion,
The patch renames the gpmi_nfc_* functions to gpmi_nand_*.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: remove the unused line
Huang Shijie [Thu, 14 Nov 2013 06:25:46 +0000 (14:25 +0800)]
mtd: gpmi: remove the unused line

We do not use the chip->oob_poi in the mx23_write_transcription_stamp.
So remove the unused line.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: delete the gpmi_pre_bbt_scan
Huang Shijie [Thu, 14 Nov 2013 06:25:45 +0000 (14:25 +0800)]
mtd: gpmi: delete the gpmi_pre_bbt_scan

We do not scan the BBT after we call the gpmi_pre_bbt_scan,
so it has lost the meaning of existence.

This patch merges this function into gpmi_init_last, and delete it.
This patch does not change any logic.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: do not use the local array to do the DMA transfer
Huang Shijie [Thu, 14 Nov 2013 06:25:44 +0000 (14:25 +0800)]
mtd: gpmi: do not use the local array to do the DMA transfer

The local array feature[] is in the stack. We can see the warning
when we enable the CONFIG_DMA_API_DEBUG:
----------------------------------------------------------
WARNING: at lib/dma-debug.c:950 check_for_stack+0xac/0xf8()
gpmi-nand 112000.gpmi-nand: DMA-API: device driver maps memory fromstack [addr=dc05be34]
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.17-16851-g2414a73 #1324
[<80014cbc>] (unwind_backtrace+0x0/0x138) from [<8001251c>] (show_stack+0x10/0x14)
[<8001251c>] (show_stack+0x10/0x14) from [<8002699c>] (warn_slowpath_common+0x4c/0x68)
[<8002699c>] (warn_slowpath_common+0x4c/0x68) from [<80026a4c>] (warn_slowpath_fmt+0x30/0x40)
[<80026a4c>] (warn_slowpath_fmt+0x30/0x40) from [<8028e2f8>] (check_for_stack+0xac/0xf8)
[<8028e2f8>] (check_for_stack+0xac/0xf8) from [<8028e438>] (debug_dma_map_sg+0xf4/0x188)
[<8028e438>] (debug_dma_map_sg+0xf4/0x188) from [<803968d0>] (prepare_data_dma+0xb8/0x1a8)
[<803968d0>] (prepare_data_dma+0xb8/0x1a8) from [<80397b20>] (gpmi_send_data+0x84/0xfc)
[<80397b20>] (gpmi_send_data+0x84/0xfc) from [<8038c2b4>] (nand_onfi_set_features+0x50/0x74)
[<8038c2b4>] (nand_onfi_set_features+0x50/0x74) from [<80397198>] (gpmi_extra_init+0x90/0x170)
[<80397198>] (gpmi_extra_init+0x90/0x170) from [<8039520c>] (gpmi_nand_probe+0x2f8/0xb3c)
[<8039520c>] (gpmi_nand_probe+0x2f8/0xb3c) from [<8031b974>] (platform_drv_probe+0x18/0x1c)
----------------------------------------------------------

The patch uses the kzalloc to allocate the buffer, and free it when
we do not use it anymore.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agoENGR00288123 [iMX6SL] Add low power audio support
Ranjani Vaidyanathan [Wed, 13 Nov 2013 20:03:35 +0000 (14:03 -0600)]
ENGR00288123 [iMX6SL] Add low power audio support

Add support for low power audio playback:
1. SSI2 is sourced from PLL4
2. Extern_audio_clk is sourced from pll4
3. PLL4 is in bypass mode during audio playback (based
   on freq requested by extern_audio_clk and ssi2 clk)
4. DDR is at 100MHz, AHB is at 24MHz.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
10 years agoENGR00283186 imx6sl: Add support for power gating of display MIX
Robby Cai [Thu, 14 Nov 2013 10:15:53 +0000 (18:15 +0800)]
ENGR00283186 imx6sl: Add support for power gating of display MIX

The display MIX can be power gated when EPDC, PXP and LCDIF are all inactive.
For safety, this feature is only supported when system enters suspend/standby
mode, in other words, this patch does not support run-time gating.

Signed-off-by: Robby Cai <R63905@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
10 years agousb: phy: phy-mxs-usb: set the correct platform drvdata
Jisheng Zhang [Thu, 7 Nov 2013 02:55:49 +0000 (10:55 +0800)]
usb: phy: phy-mxs-usb: set the correct platform drvdata

We need to set mxs_phy rather as the platform drvdata so that we can get
the correct mxs_phy in mxs_phy_remove().

Acked-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
10 years agoENGR00255359 usb: core: notify disconnection when core detects disconnect
Peter Chen [Thu, 21 Mar 2013 06:56:17 +0000 (14:56 +0800)]
ENGR00255359 usb: core: notify disconnection when core detects disconnect

It is safe to call notify disconnect when the usb core
thinks the device is disconnected.

This commit also fixes one bug found at below situation:
we have not enabled usb wakeup, we do suspend when there
is an usb device at the port, after suspend, we plug out
the usb device, then plug in device again. At that time,
the nofity disconnect was not called at former code, as
the controller doesn't know the usb device was disconnected
during the suspend, but USB core knows, so to fix this problem,
let the usb core call notify disconnect.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit 54d314b320e8adee0593d1bed045197f134cd9cc)

10 years agoENGR00287992-7 ARM: imx_v7_defconfig: enable USB charger detection for imx6
Peter Chen [Thu, 14 Nov 2013 08:48:23 +0000 (16:48 +0800)]
ENGR00287992-7 ARM: imx_v7_defconfig: enable USB charger detection for imx6

Enable imx6 USB charger detection

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00287992-6 usb: chipidea: imx: add usb charger detection for imx6
Peter Chen [Thu, 14 Nov 2013 08:27:05 +0000 (16:27 +0800)]
ENGR00287992-6 usb: chipidea: imx: add usb charger detection for imx6

The usb controller driver creates usb charger, and notify
the charger connect and disconnect using vbus connect and
disconnect event.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00287992-5 usb: chipidea: msm: change the return value for msm notify_event
Peter Chen [Thu, 14 Nov 2013 08:24:38 +0000 (16:24 +0800)]
ENGR00287992-5 usb: chipidea: msm: change the return value for msm notify_event

The return value of .notify_event has changed.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00287992-4 usb: chipidea: Add usb charger detect notify
Peter Chen [Thu, 14 Nov 2013 06:38:20 +0000 (14:38 +0800)]
ENGR00287992-4 usb: chipidea: Add usb charger detect notify

- Change .notify's return value from void to int.
- Add CI_HDRC_CONTROLLER_CHARGER_EVENT and
CI_HDRC_CONTROLLER_CHARGER_POST_EVENT to finish the USB charger
detection flow.
- Add usb_gadget_vbus_connect for only notify udc when vbus
is on, the main reason we add it is we don't want the first
notification when the vbus is off, it causes the
dev->power.usage_count equals -1 when do charger detection.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00287992-3 ARM: imx6: add usb charger detection property
Peter Chen [Thu, 14 Nov 2013 06:35:06 +0000 (14:35 +0800)]
ENGR00287992-3 ARM: imx6: add usb charger detection property

Besides, we have added anatop phandle at usbotg node to
access anatop register.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00287992-2 usb: doc: chipidea: imx: add imx6-usb-charger-detection property
Peter Chen [Thu, 14 Nov 2013 06:29:51 +0000 (14:29 +0800)]
ENGR00287992-2 usb: doc: chipidea: imx: add imx6-usb-charger-detection property

It is used to indicate whether we use SoC's usb charger
detection or not. Besides, we add anatop phandle since
we need to use anatop register to do most of charger detect operations.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00287992-1 power: imx6: add imx6 USB charger detection
Peter Chen [Thu, 14 Nov 2013 05:52:14 +0000 (13:52 +0800)]
ENGR00287992-1 power: imx6: add imx6 USB charger detection

Add imx6 USB charger detection, the vbus supplier will create and
remove struct usb_charger, and notify vbus connect and disconnect
event. The detail USB charger detection flow is at: "i.MX6 RM,
Chapter Universal Serial Bus 2.0 Integrated PHY (USB-PHY),
Charger detection, Charger detection software flow".

Since imx6 only has charger detection function, and no charging
current function is existed. It the user wants the detection abilities
from SoC, it can use this detection method
(add imx6-usb-charger-detection at dts). If the charger IC
already has USB charger detection function, and the user wants
to use the detection method from charger IC, please do not add
imx6-usb-charger-detection property at dts.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00288351 sabresd_battery: fix usb charger detect when resume back on mx6sl
Robin Gong [Fri, 15 Nov 2013 10:29:03 +0000 (18:29 +0800)]
ENGR00288351 sabresd_battery: fix usb charger detect when resume back on mx6sl

Fix  below redundant log after first resume back on mx6slevk:
max8903-charger max8903.12: USB Charger Connected

It's caused by not add enough prepare for uok&dok which are connected, such as
i.MX6SL-EVK. In this case the board only support DC charger detect, so we
didn't need judge the uok pin for USB charger detect, although uok share with
dok pin.

Signed-off-by: Robin Gong <b38343@freescale.com>
10 years agoENGR00288342 net:fec_ptp: fix the potential issue for storing timestamp
Fugang Duan [Mon, 18 Nov 2013 02:17:03 +0000 (10:17 +0800)]
ENGR00288342 net:fec_ptp: fix the potential issue for storing timestamp

The timestamps generated in the i.MX drivers are generated by the
nanoseconds part coming from the 1588 clock. But the number of seconds
are maintained in a private structure of the interface. Those are
updated in a 1588 clock rollover interrupt.

The timestamp is generated right before a rollover of a second and the
timestamp value is constructed afterwards. Therefore the bigger part of
the timestamp is wrong (the second).

Suggested solution (pseudo-code):
If( actual-time.nsec < timestamp.nsec )
Timestamp.sec = fpp->prtc -1;
Else
Timestamp.sec = fpp->prtc;

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00288196 ARM: dts: fix epdc and csi conflict on imx6sl evk
Robby Cai [Fri, 15 Nov 2013 09:21:16 +0000 (17:21 +0800)]
ENGR00288196 ARM: dts: fix epdc and csi conflict on imx6sl evk

There is pinmux conflict for EPDC and I2C3 on imx6sl soc.
While on imx6sl evk board, the camera is attached on I2C3 bus, so the
EPDC function and CSI function can not be used at same time.
This patch removes the conflict in imx6sl-evk.dts file for EPDC function
and adds a new dts file for CSI function.

Signed-off-by: Robby Cai <R63905@freescale.com>
10 years agoENGR00279980 ubi: attach: do not return -EINVAL if the mtd->numeraseregions is 1
Huang Shijie [Wed, 18 Sep 2013 02:17:39 +0000 (10:17 +0800)]
ENGR00279980 ubi: attach: do not return -EINVAL if the mtd->numeraseregions is 1

If the master mtd does not have any slave mtd partitions,
and its numeraseregions is one(only has one erease block), and
we attach the master mtd with : ubiattach -m 0 -d 0

We will meet the error:
-------------------------------------------------------
root@freescale ~$ ubiattach /dev/ubi_ctrl -m 0 -d 0
UBI: attaching mtd0 to ubi0
UBI error: io_init: multiple regions, not implemented
ubiattach: error!: cannot attach mtd0
           error 22 (Invalid argument)
-------------------------------------------------------

In fact, if there is only one "erase block", we should not
prevent the attach.

This patch fixes it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoENGR00288133 arm: imx: correct arm clock usecount for i.MX6Q/DL
Anson Huang [Fri, 15 Nov 2013 14:35:20 +0000 (09:35 -0500)]
ENGR00288133 arm: imx: correct arm clock usecount for i.MX6Q/DL

ARM clock is sourcing from pll1_sw, and pll1_sw can be either
from pll1_sys or step, so we should enable arm clock during
clock initialization instead of pll1_sys, otherwise, arm clock's
usecount would be incorrect and PLL1 will never be disabled even
it is not used.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00286962-2 usb: chipidea: fix the system will be deadlock with ID wakeup
Peter Chen [Sat, 9 Nov 2013 00:08:10 +0000 (08:08 +0800)]
ENGR00286962-2 usb: chipidea: fix the system will be deadlock with ID wakeup

When we plug in Micro B-TO-A cable at OTG port with u-disk connected,
and enable USB ID wakeup, then, suspend the system, the system
will be deadlock during the resume. See below Sysrq dump.

If the flush_work at block layer is called after system resume
has completed, this problem has fixed (using pm_mutex at ci_otg_work).
It seems if the task is rescheduled before the system resume has
completed (after thaw_processes), it will cause the system dead lock.
Unless the task has been freezed explicitly before system suspend.

The fixes uses wait_event_freezable to wait event, it should call
try_to_freeze during the freeze_processes, and task will not be
scheduled until thaw_processes has called (for frozen process, it will
call wake_up_process explicitly).

--------------------------------------Sysrq dump------------------------------------------
sh              D 80600860     0  1016   1014 0x00000000

[<80600860>] (__schedule+0x1e0/0x5d8) from [<80601274>] (schedule_preempt_disabled+0xc/0x10)

[<80601274>] (schedule_preempt_disabled+0xc/0x10) from [<805ffe00>] (__mutex_lock_slowpath+0x154/0x1f4)

[<805ffe00>] (__mutex_lock_slowpath+0x154/0x1f4) from [<805ffef0>] (mutex_lock+0x50/0x54)

[<805ffef0>] (mutex_lock+0x50/0x54) from [<802f7f84>] (dpm_complete+0xac/0x1ac)

[<802f7f84>] (dpm_complete+0xac/0x1ac) from [<80057a34>] (suspend_devices_and_enter+0x1bc/0x330)

[<80057a34>] (suspend_devices_and_enter+0x1bc/0x330) from [<80057d50>] (pm_suspend+0x1a8/0x240)

[<80057d50>] (pm_suspend+0x1a8/0x240) from [<80056a8c>] (state_store+0x6c/0xbc)

[<80056a8c>] (state_store+0x6c/0xbc) from [<802586c0>] (kobj_attr_store+0x14/0x20)

[<802586c0>] (kobj_attr_store+0x14/0x20) from [<80117374>] (sysfs_write_file+0xfc/0x17c)

[<80117374>] (sysfs_write_file+0xfc/0x17c) from [<800bdcc0>] (vfs_write+0xbc/0x184)

[<800bdcc0>] (vfs_write+0xbc/0x184) from [<800be058>] (SyS_write+0x40/0x68)

[<800be058>] (SyS_write+0x40/0x68) from [<8000e040>] (ret_fast_syscall+0x0/0x30)

kworker/u8:2    D 80600860     0 16146      2 0x00000000

Workqueue: ci_otg ci_otg_work

[<80600860>] (__schedule+0x1e0/0x5d8) from [<805ff374>] (schedule_timeout+0x14c/0x198)

[<805ff374>] (schedule_timeout+0x14c/0x198) from [<80600db8>] (wait_for_common+0xc4/0x17c)

[<80600db8>] (wait_for_common+0xc4/0x17c) from [<8003bbd0>] (flush_work+0xc0/0x160)

[<8003bbd0>] (flush_work+0xc0/0x160) from [<8009d02c>] (bdi_unregister+0x108/0x148)

[<8009d02c>] (bdi_unregister+0x108/0x148) from [<8024b5b4>] (del_gendisk+0xf8/0x1c4)

[<8024b5b4>] (del_gendisk+0xf8/0x1c4) from [<8031e8e8>] (sd_remove+0x64/0x98)

[<8031e8e8>] (sd_remove+0x64/0x98) from [<802f0678>] (__device_release_driver+0x70/0xcc)

[<802f0678>] (__device_release_driver+0x70/0xcc) from [<802f06f0>] (device_release_driver+0x1c/0x28)

[<802f06f0>] (device_release_driver+0x1c/0x28) from [<802f01e4>] (bus_remove_device+0xd8/0xf8)

[<802f01e4>] (bus_remove_device+0xd8/0xf8) from [<802edef8>] (device_del+0xf4/0x178)

[<802edef8>] (device_del+0xf4/0x178) from [<8031abbc>] (__scsi_remove_device+0x48/0xa0)

[<8031abbc>] (__scsi_remove_device+0x48/0xa0) from [<80319bb8>] (scsi_forget_host+0x5c/0x60)

[<80319bb8>] (scsi_forget_host+0x5c/0x60) from [<8031072c>] (scsi_remove_host+0x64/0xf0)

[<8031072c>] (scsi_remove_host+0x64/0xf0) from [<803be150>] (usb_stor_disconnect+0x50/0xc8)

[<803be150>] (usb_stor_disconnect+0x50/0xc8) from [<803ac020>] (usb_unbind_interface+0x58/0x188)

[<803ac020>] (usb_unbind_interface+0x58/0x188) from [<802f0678>] (__device_release_driver+0x70/0xcc)

[<802f0678>] (__device_release_driver+0x70/0xcc) from [<802f06f0>] (device_release_driver+0x1c/0x28)

[<802f06f0>] (device_release_driver+0x1c/0x28) from [<802f01e4>] (bus_remove_device+0xd8/0xf8)

[<802f01e4>] (bus_remove_device+0xd8/0xf8) from [<802edef8>] (device_del+0xf4/0x178)

[<802edef8>] (device_del+0xf4/0x178) from [<803a9e8c>] (usb_disable_device+0xa0/0x1c8)

[<803a9e8c>] (usb_disable_device+0xa0/0x1c8) from [<803a25fc>] (usb_disconnect+0x88/0x1a0)

[<803a25fc>] (usb_disconnect+0x88/0x1a0) from [<803a25e4>] (usb_disconnect+0x70/0x1a0)

[<803a25e4>] (usb_disconnect+0x70/0x1a0) from [<803a5940>] (usb_remove_hcd+0xac/0x15c)

[<803a5940>] (usb_remove_hcd+0xac/0x15c) from [<803c487c>] (host_stop+0x1c/0x3c)

[<803c487c>] (host_stop+0x1c/0x3c) from [<803c1880>] (ci_otg_work+0xc8/0x118)

[<803c1880>] (ci_otg_work+0xc8/0x118) from [<8003c62c>] (process_one_work+0x110/0x360)

[<8003c62c>] (process_one_work+0x110/0x360) from [<8003d180>] (worker_thread+0x144/0x3ac)

[<8003d180>] (worker_thread+0x144/0x3ac) from [<8004272c>] (kthread+0xa4/0xb0)

[<8004272c>] (kthread+0xa4/0xb0) from [<8000e0d8>] (ret_from_fork+0x14/0x3c)

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286962-1 ARM: imx6dl-auto: enable usb peripheral mode for nor and nand
Peter Chen [Fri, 8 Nov 2013 07:17:08 +0000 (15:17 +0800)]
ENGR00286962-1 ARM: imx6dl-auto: enable usb peripheral mode for nor and nand

Enable usb peripheral mode for spi-nor and gpmi nand.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00288021 IPUv3 disp:get the integer part of div correctly
Sandor Yu [Thu, 14 Nov 2013 08:48:42 +0000 (16:48 +0800)]
ENGR00288021 IPUv3 disp:get the integer part of div correctly

TV will show 639x480p60 when HDMI output 640x480p60.
The same issue can be found when pixel clock sources from ipu internally.
All video modes whose pixel clocks derive from DI clock work OK.
It is caused by the wrong parent clock rate the driver gets.
Fix the issue by getting the right parent clock(ipu->pixel_clk_sel).

Signed-off-by: Sandor Yu <R01008@freescale.com>
10 years agoENGR00288046: net:fec_ptp: fix WARNING caused by mutex_trylock run in interrupt context
Fugang Duan [Thu, 14 Nov 2013 09:21:14 +0000 (17:21 +0800)]
ENGR00288046: net:fec_ptp: fix WARNING caused by mutex_trylock run in interrupt context

Kernel warning dump by enable kernel config "CONFIG_DEBUG_MUTEXES":

------------[ cut here ]------------
WARNING: at kernel/mutex.c:577 mutex_trylock+0x180/0x1d0()
DEBUG_LOCKS_WARN_ON(in_interrupt())
Modules linked in:
CPU: 0 PID: 68 Comm: kworker/0:2 Tainted: G W 3.10.17-16855-ga44de14 #1325
Workqueue: events phy_state_machine
[<80014cbc>] (unwind_backtrace+0x0/0x138) from [<8001251c>]
(show_stack+0x10/0x14)
[<8001251c>] (show_stack+0x10/0x14) from [<80026754>]
(warn_slowpath_common+0x4c/0x68)
[<80026754>] (warn_slowpath_common+0x4c/0x68) from [<80026804>]
(warn_slowpath_fmt+0x30/0x40)
[<80026804>] (warn_slowpath_fmt+0x30/0x40) from [<8069f6b0>]
(mutex_trylock+0x180/0x1d0)
[<8069f6b0>] (mutex_trylock+0x180/0x1d0) from [<804dce7c>]
(clk_prepare_lock+0xc/0xd8)
[<804dce7c>] (clk_prepare_lock+0xc/0xd8) from [<804ddbcc>]
(clk_get_rate+0xc/0x5c)
[<804ddbcc>] (clk_get_rate+0xc/0x5c) from [<803b7528>]
(fec_ptp_start_cyclecounter+0x1c/0x198)
[<803b7528>] (fec_ptp_start_cyclecounter+0x1c/0x198) from [<803b5928>]
(fec_restart+0x6e8/0x870)
[<803b5928>] (fec_restart+0x6e8/0x870) from [<803b5d50>]
(fec_enet_adjust_link+0x7c/0xb4)
[<803b5d50>] (fec_enet_adjust_link+0x7c/0xb4) from [<803b07b8>]
(phy_state_machine+0xfc/0x394)
[<803b07b8>] (phy_state_machine+0xfc/0x394) from [<8003f03c>]
(process_one_work+0x198/0x428)
[<8003f03c>] (process_one_work+0x198/0x428) from [<8003fd24>]
(worker_thread+0x144/0x3a4)
[<8003fd24>] (worker_thread+0x144/0x3a4) from [<800458d8>]
(kthread+0xa4/0xb0)
[<800458d8>] (kthread+0xa4/0xb0) from [<8000ebd8>] (ret_from_fork+0x14/0x3c)
---[ end trace d1930b3e1c195329 ]---

Root cause:
Worker thread call netif_tx_lock_bh() to diable the softirq preempt, and
then call clk_get_rate() to get ptp clock rate.
In fact, netif_tx_lock_bh()->local_bh_disable(), which make in_interrupt()
to be ture. clk_get_rate()->clk_prepare_lock()->mutex_trylock(), and
mutex_trylock() cannot use at interrupt context, otherwise there have
kernel dump.

So, remove the clk_get_rate() in there.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 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>
10 years agoENGR00287983-1 imx6sl: replace mx6sl_restart with mxc_restart
Robin Gong [Thu, 14 Nov 2013 05:46:00 +0000 (13:46 +0800)]
ENGR00287983-1 imx6sl: replace mx6sl_restart with mxc_restart

Using common mxc_restart interface to do restart instead of platform specific
interface of imx6sl_restart.

Signed-off-by: Robin Gong <b38343@freescale.com>
10 years agoARM: imx: remove imx_src_prepare_restart() call
Shawn Guo [Mon, 28 Oct 2013 08:37:12 +0000 (16:37 +0800)]
ARM: imx: remove imx_src_prepare_restart() call

There is ~10% possibility that the following emergency restart command
fails to reboot imx6q.

$ echo b > /proc/sysrq-trigger

The IMX restart routine mxc_restart() assumes that it will always run on
primary core, and will call imx_src_prepare_restart() to disable
secondary cores in order to get them come to online in the following
boot.  However, the assumption is only true for normal kernel_restart()
case where migrate_to_reboot_cpu() will be called to migrate to primary
core, but not necessarily true for emergency_restart() case.  So when
emergency_restart() calls into mxc_restart() on any secondary core,
system will hang immediately once imx_src_prepare_restart() is called
to disabled secondary cores.  Since emergency_restart() is defined as a
function that is safe to call in interrupt context, we cannot just call
migrate_to_reboot_cpu() to fix the issue.

Fortunately, we just found that the issue can be fixed at imx6q platform
level.  We used to call imx_src_prepare_restart() to disable all
secondary cores before resetting hardware.  Otherwise, the secondary
will fail come to online in the reboot.  However, we recently found that
after commit 6050d18 (ARM: imx: reset core along with enable/disable
operation) comes to play, we do not need to reset the secondary cores
any more.  That said, mxc_restart() now can run on any core to reboot
the system, as long as we remove the imx_src_prepare_restart() call from
mxc_restart().

So let's simply remove imx_src_prepare_restart() call to fix the above
emergency restart failure.

Reported-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
(cherry picked from commit e2eb7f22c90ab47cce77c6836183fa5e684489d1)

Conflicts:

arch/arm/mach-imx/common.h

Signed-off-by: Robin Gong <b38343@freescale.com>
10 years agoARM: imx: replace imx6q_restart() with mxc_restart()
Shawn Guo [Sun, 6 Oct 2013 08:47:46 +0000 (16:47 +0800)]
ARM: imx: replace imx6q_restart() with mxc_restart()

The imx6q_restart() works fine with normal reboot but will run into
problem with emergency reboot like sysrq-b.  In that case, of_iomap()
gets called from interrupt context and hence triggers the BUG_ON in
__get_vm_area_node().

Actually, since commit c1e31d1 (ARM: imx: create
mxc_arch_reset_init_dt() for DT boot), imx6q/dl should try to use
mxc_restart() by calling mxc_arch_reset_init_dt() beforehand, where
things like of_iomap() can be done.

The patch updates mxc_restart() a little bit to get it work for imx6q/dl
and kill imx6q_restart() completely.

Reported-by: Nathan Lynch <nathan_lynch@mentor.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
(cherry picked from commit 87a84b69824d7fd63b20f3bc98d75c0238b8e7d0)

Conflicts:

arch/arm/mach-imx/mach-imx6q.c

Signed-off-by: Robin Gong <b38343@freescale.com>
10 years agomtd: gpmi: add a new DT property to use the datasheet's minimum required ECC
Huang Shijie [Thu, 7 Nov 2013 10:07:38 +0000 (18:07 +0800)]
mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC

In default way, we use the ecc_strength/ecc_step size calculated by ourselves
and use all the OOB area.

This patch adds a new property : "fsl,use-minimum-ecc"

If we enable it, we will firstly try to use the datasheet's minimum required
ECC provided by the MTD layer (the ecc_strength_ds/ecc_step_ds fields
in the nand_chip{}). So we may have free space in the OOB area by using the
minimum ECC, and we may support JFFS2 with some SLC NANDs, such as Micron's
SLC NAND.

If we fail to use the minimum ECC, we will use the legacy method to calculate
the ecc_strength and ecc_step size.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi-lib: Make checkpatch happy
Fabio Estevam [Fri, 8 Nov 2013 01:28:43 +0000 (23:28 -0200)]
mtd: gpmi-lib: Make checkpatch happy

Fix the following checkpatch warnings:

WARNING: line over 80 characters
#268: FILE: mtd/nand/gpmi-nand/gpmi-lib.c:268:
+ * consecutive reboots. The latter case has not been seen on the MX23 yet,

WARNING: space prohibited before semicolon
#356: FILE: mtd/nand/gpmi-nand/gpmi-lib.c:356:
+ (target.tRHOH_in_ns >= 0) ;

WARNING: space prohibited before semicolon
#1006: FILE: mtd/nand/gpmi-nand/gpmi-lib.c:1006:
+ BF_GPMI_TIMING0_DATA_SETUP(hw.data_setup_in_cycles)       ;

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: gpmi: Use devm_clk_get()
Fabio Estevam [Fri, 8 Nov 2013 00:32:38 +0000 (22:32 -0200)]
mtd: gpmi: Use devm_clk_get()

Using devm_clk_get() can make the code smaller and cleaner.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
11 years agoENGR00287826 mxc: mlb: Fix MLB rcu stall issue when MITB is not set correctly
Luwei Zhou [Wed, 13 Nov 2013 08:21:02 +0000 (16:21 +0800)]
ENGR00287826 mxc: mlb: Fix MLB rcu stall issue when MITB is not set correctly

MLB lock and clock check has logic issue in code. The timeout cann't work and
it will cause rcu-stall.

Exception stack(0xdca21e68 to 0xdca21eb0)
1e60:                   00000001 00000000 ffffff7f 0000270f 00002710 0000ffc0
1e80: 00000000 00000004 00000002 00000001 00000001 7f003b50 f0378000 dca21eb0
1ea0: 7f003b50 7f0009cc 20000013 ffffffff
[<8000dc04>] (__irq_svc+0x44/0x58) from [<7f0009cc>] (mlb150_dev_unmute_syn_ch
[<7f0009cc>] (mlb150_dev_unmute_syn_ch+0x34/0xd4 [mxc_mlb150]) from [<7f002584
[<7f002584>] (mxc_mlb150_ioctl+0x85c/0x898 [mxc_mlb150]) from [<800db86c>] (do_
[<800db86c>] (do_vfs_ioctl+0x40c/0x5e4) from [<800dba7c>] (SyS_ioctl+0x38/0x64)
[<800dba7c>] (SyS_ioctl+0x38/0x64) from [<8000e000>] (ret_fast_syscall+0x0/0x48
INFO: rcu_sched self-detected stall on CPU
        0: (14684 ticks this GP) idle=fdf/140000000000001/0 softirq=1555/1555
         (t=14720 jiffies g=2 c=1 q=22)
CPU: 0 PID: 628 Comm: mxc_mlb150_test Not tainted 3.10.17-16837-g187ed79-dirty
[<80013d7c>] (unwind_backtrace+0x0/0xf4) from [<80011798>] (show_stack+0x10/0x
[<80011798>] (show_stack+0x10/0x14) from [<8008575c>] (rcu_check_callbacks+0x3
[<8008575c>] (rcu_check_callbacks+0x3d0/0x7f8) from [<80033884>] (update_proce
[<80033884>] (update_process_times+0x40/0x6c) from [<80064f48>] (tick_sched_ti
[<80064f48>] (tick_sched_timer+0x4c/0x78) from [<80048508>] (__run_hrtimer.isr
[<80048508>] (__run_hrtimer.isra.32+0x44/0xd4) from [<80048de4>] (hrtimer_inte
[<80048de4>] (hrtimer_interrupt+0x108/0x294) from [<800136f0>] (twd_handler+0x
[<800136f0>] (twd_handler+0x34/0x44) from [<80080208>] (handle_percpu_devid_ir
[<80080208>] (handle_percpu_devid_irq+0x6c/0x84) from [<8007c958>] (generic_ha
[<8007c958>] (generic_handle_irq+0x2c/0x3c) from [<8000e908>] (handle_IRQ+0x40
[<8000e908>] (handle_IRQ+0x40/0x90) from [<8000856c>] (gic_handle_irq+0x2c/0x5
[<8000856c>] (gic_handle_irq+0x2c/0x5c) from [<8000dc04>] (__irq_svc+0x44/0x5.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
11 years agoENGR00287579 mxsfb: i.MX6SL clean master bit before enter suspend
Sandor Yu [Wed, 13 Nov 2013 02:13:14 +0000 (10:13 +0800)]
ENGR00287579 mxsfb: i.MX6SL clean master bit before enter suspend

Clean lcdif bus master bit when lcdif enter low power mode.
Restore the master bit when lcdif back to work mode.

Signed-off-by: Sandor Yu <R01008@freescale.com>
11 years agoENGR00286961-5 ASoC: fsl: set tdm slot number for imx-si476x
Nicolin Chen [Mon, 11 Nov 2013 08:31:22 +0000 (16:31 +0800)]
ENGR00286961-5 ASoC: fsl: set tdm slot number for imx-si476x

When using SSI I2S master mode, we need to decide the time slot number.
Because we use SSI normal mode to trick I2S signal, we here need to set
time slot number to two (left/right).

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
11 years agoENGR00286961-4 ASoC: fsl_ssi: add monaural audio support
Nicolin Chen [Fri, 8 Nov 2013 08:38:43 +0000 (16:38 +0800)]
ENGR00286961-4 ASoC: fsl_ssi: add monaural audio support

We use SSI's normal mode to trick I2S signal by fetching data only from
one side of time slot so that we can purely get or put the monaural audio
data.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
11 years agoENGR00286961-3 ARM: dtsi: imx6qdl: Use non-default value for audmux pinctrl
Nicolin Chen [Fri, 8 Nov 2013 08:26:25 +0000 (16:26 +0800)]
ENGR00286961-3 ARM: dtsi: imx6qdl: Use non-default value for audmux pinctrl

It's better to specify pinctrl value so that we can clearly know what the
exact configuration they are. Also, when we need to set pinctrl state from
another state to default one, it must be given the exact values of pinctrl.

And this patch also sets TXD iomux to PUE keep. This would force TXD pin not
to pull down its signal during an unused state so that it won't distort its
output signal during that state.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
11 years agoENGR00286961-2 ASoC: fsl_ssi: Move DC configuration to set_dai_tdm_slot()
Nicolin Chen [Fri, 8 Nov 2013 07:48:42 +0000 (15:48 +0800)]
ENGR00286961-2 ASoC: fsl_ssi: Move DC configuration to set_dai_tdm_slot()

DC indicates Frame Rate Divider. By setting it we can get a desired
time slot numbers. Thus it should be more plausible to set DC in
set_dai_tdm_slot() instead of hw_params().

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
11 years agoENGR00286961-1 ASoC: fsl_ssi: add period size constraint for dual fifo mode
Nicolin Chen [Fri, 8 Nov 2013 07:38:18 +0000 (15:38 +0800)]
ENGR00286961-1 ASoC: fsl_ssi: add period size constraint for dual fifo mode

When using dual fifo mode, we need to keep period size as an even number
due to behavior of SDMA script. Otherwise, it might neglect the 2nd fifo
at each period when its size appears to be an odd number.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
11 years agomtd: gpmi: fix the NULL pointer
Huang Shijie [Tue, 12 Nov 2013 04:23:08 +0000 (12:23 +0800)]
mtd: gpmi: fix the NULL pointer

The imx23 board will check the fingerprint, so it will call the
mx23_check_transcription_stamp. This function will use @chip->buffers->databuf
as its buffer which is allocated in the nand_scan_tail().

Unfortunately, the mx23_check_transcription_stamp is called before the
nand_scan_tail(). So we will meet a NULL pointer bug:

--------------------------------------------------------------------
[    1.150000] NAND device: Manufacturer ID: 0xec, Chip ID: 0xd7 (Samsung NAND 4GiB 3,3V 8-bit), 4096MiB, page size: 4096, OOB size: 8
[    1.160000] Unable to handle kernel NULL pointer dereference at virtual address 000005d0
[    1.170000] pgd = c0004000
[    1.170000] [000005d0] *pgd=00000000
[    1.180000] Internal error: Oops: 5 [#1] ARM
[    1.180000] Modules linked in:
[    1.180000] CPU: 0 PID: 1 Comm: swapper Not tainted 3.12.0 #89
[    1.180000] task: c7440000 ti: c743a000 task.ti: c743a000
[    1.180000] PC is at memcmp+0x10/0x54
[    1.180000] LR is at gpmi_nand_probe+0x42c/0x894
[    1.180000] pc : [<c025fcb0>]    lr : [<c02f6a68>]    psr: 20000053
[    1.180000] sp : c743be2c  ip : 600000d3  fp : ffffffff
[    1.180000] r10: 000005d0  r9 : c02f5f08  r8 : 00000000
[    1.180000] r7 : c75858a8  r6 : c75858a8  r5 : c7585b18  r4 : c7585800
[    1.180000] r3 : 000005d0  r2 : 00000004  r1 : c05c33e4  r0 : 000005d0
[    1.180000] Flags: nzCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
[    1.180000] Control: 0005317f  Table: 40004000  DAC: 00000017
[    1.180000] Process swapper (pid: 1, stack limit = 0xc743a1c0)
--------------------------------------------------------------------

This patch rearrange the init procedure:
   Set the NAND_SKIP_BBTSCAN to skip the nand scan firstly, and after we
   set the proper settings, we will call the chip->scan_bbt() manually.

Cc: stable@vger.kernel.org # 3.12
Signed-off-by: Huang Shijie <b32955@freescale.com>
Reported-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
11 years agoRevert "serial: i.MX: evaluate linux,stdout-path property"
Greg Kroah-Hartman [Tue, 8 Oct 2013 02:06:59 +0000 (19:06 -0700)]
Revert "serial: i.MX: evaluate linux,stdout-path property"

This reverts commit f7d2c0bbdb7b784cc035cacb7d36b379ba1c3bef, as it
causes build errors when the driver is built as a module.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
11 years agoENGR00287278 mxc: mlb: Enable the clock when open MLB device.
Luwei Zhou [Mon, 11 Nov 2013 08:56:57 +0000 (16:56 +0800)]
ENGR00287278 mxc: mlb: Enable the clock when open MLB device.

The driver enalbe/disable the clock in probe()/remove().
It should be done in open()/close() hook function in fact.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
11 years agoENGR00287512 net:fec: fix WARNING caused by lack of calling dma_mapping_error()
Fugang Duan [Tue, 12 Nov 2013 02:00:43 +0000 (10:00 +0800)]
ENGR00287512 net:fec: fix WARNING caused by lack of calling dma_mapping_error()

Enable CONFIG_HAVE_DMA_API_DEBUG, the kernel dump warning:

------------[ cut here ]------------
WARNING: at lib/dma-debug.c:937 check_unmap+0x43c/0x7d8()
fec 2188000.ethernet: DMA-API: device driver failed to check map
error[device address=0x00000000383a8040] [size=2048 bytes] [mapped as single]

Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.10.17-16827-g9cdb0ba-dirty #188
[<80013c4c>] (unwind_backtrace+0x0/0xf8) from [<80011704>] (show_stack+0x10
[<80011704>] (show_stack+0x10/0x14) from [<80025614>] (warn_slowpath_common
[<80025614>] (warn_slowpath_common+0x4c/0x6c) from [<800256c8>] (warn_slowp
[<800256c8>] (warn_slowpath_fmt+0x30/0x40) from [<8026bfdc>] (check_unmap+0
[<8026bfdc>] (check_unmap+0x43c/0x7d8) from [<8026c584>] (debug_dma_unmap_p
[<8026c584>] (debug_dma_unmap_page+0x6c/0x78) from [<8038049c>] (fec_enet_r
[<8038049c>] (fec_enet_rx_napi+0x254/0x8a8) from [<804dc8c0>] (net_rx_actio
[<804dc8c0>] (net_rx_action+0x94/0x160) from [<8002c758>] (__do_softirq+0xe
[<8002c758>] (__do_softirq+0xe8/0x1d0) from [<8002c8e8>] (do_softirq+0x4c/0
[<8002c8e8>] (do_softirq+0x4c/0x58) from [<8002cb50>] (irq_exit+0x90/0xc8)
[<8002cb50>] (irq_exit+0x90/0xc8) from [<8000ea88>] (handle_IRQ+0x3c/0x94)
[<8000ea88>] (handle_IRQ+0x3c/0x94) from [<8000855c>] (gic_handle_irq+0x28/
[<8000855c>] (gic_handle_irq+0x28/0x5c) from [<8000de00>] (__irq_svc+0x40/0
Exception stack(0x815a5f38 to 0x815a5f80)
5f20:                                                       815a5f80 3b9aca
5f40: 0fe52383 00000002 0dd8950e 00000002 81e7b080 00000000 00000000 815ac4
5f60: 806032ec 00000000 00000017 815a5f80 80059028 8041fc4c 60000013 ffffff
[<8000de00>] (__irq_svc+0x40/0x50) from [<8041fc4c>] (cpuidle_enter_state+0
[<8041fc4c>] (cpuidle_enter_state+0x50/0xf0) from [<8041fd94>] (cpuidle_idl
[<8041fd94>] (cpuidle_idle_call+0xa8/0x14c) from [<8000edac>] (arch_cpu_idl
[<8000edac>] (arch_cpu_idle+0x10/0x4c) from [<800582f8>] (cpu_startup_entry
[<800582f8>] (cpu_startup_entry+0x60/0x130) from [<80bc7a48>] (start_kernel
[<80bc7a48>] (start_kernel+0x2d0/0x328) from [<10008074>] (0x10008074)
---[ end trace c6edec32436e0042 ]---

Because dma-debug add new interfaces to debug dma mapping errors, pls refer
to: http://lwn.net/Articles/516640/

After dma mapping, it must call dma_mapping_error() to check mapping error,
otherwise the map_err_type alway is MAP_ERR_NOT_CHECKED, check_unmap() define
the mapping is not checked and dump the error msg.

So, and dma_mapping_error() checking to fix the WARNING.

Signed-off-by: Fugang Duan <B38611@freescale.com>
11 years agoENGR00287256 mxc: mlb: Fix the SYNC mode hang issue when connected with MITB
Luwei Zhou [Mon, 11 Nov 2013 08:03:59 +0000 (16:03 +0800)]
ENGR00287256 mxc: mlb: Fix the SYNC mode hang issue when connected with MITB

This patch fixes the hang and crash issue of MLB SYNC mode in the driver.
The MITB will casue Sabreauto to hang and crash when testing the SYNC mode.
It is because MITB will cause something error on MLB bus when stopping the
SYNC test. The Sabreauto will keep entering error ISR and hang. Since we
don't know the details about MITB, we make drivers provide IO_CTRL
interface to disable the interrupt in SYNC mode.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
11 years agomtd: gpmi: only scan two chips for imx6
Huang Shijie [Thu, 7 Nov 2013 09:46:37 +0000 (17:46 +0800)]
mtd: gpmi: only scan two chips for imx6

We cannot scan two chips for imx23 and imx28:
  imx23: the Ready-Busy1 line is not connected for some board.
  imx28: we do not set the pinctrl for Ready-Busy1

So we only scan two chips for imx6.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
11 years agomtd: gpmi: fix kernel BUG due to racing DMA operations
Huang Shijie [Mon, 11 Nov 2013 04:13:45 +0000 (12:13 +0800)]
mtd: gpmi: fix kernel BUG due to racing DMA operations

[1] The gpmi uses the nand_command_lp to issue the commands to NAND chips.
    The gpmi issues a DMA operation with gpmi_cmd_ctrl when it handles
    a NAND_CMD_NONE control command. So when we read a page(NAND_CMD_READ0)
    from the NAND, we may send two DMA operations back-to-back.

    If we do not serialize the two DMA operations, we will meet a bug when

    1.1) we enable CONFIG_DMA_API_DEBUG, CONFIG_DMADEVICES_DEBUG,
         and CONFIG_DEBUG_SG.

    1.2) Use the following commands in an UART console and a SSH console:
         cmd 1: while true;do dd if=/dev/mtd0 of=/dev/null;done
         cmd 1: while true;do dd if=/dev/mmcblk0 of=/dev/null;done

    The kernel log shows below:
    -----------------------------------------------------------------
    kernel BUG at lib/scatterlist.c:28!
    Unable to handle kernel NULL pointer dereference at virtual address 00000000
      .........................
    [<80044a0c>] (__bug+0x18/0x24) from [<80249b74>] (sg_next+0x48/0x4c)
    [<80249b74>] (sg_next+0x48/0x4c) from [<80255398>] (debug_dma_unmap_sg+0x170/0x1a4)
    [<80255398>] (debug_dma_unmap_sg+0x170/0x1a4) from [<8004af58>] (dma_unmap_sg+0x14/0x6c)
    [<8004af58>] (dma_unmap_sg+0x14/0x6c) from [<8027e594>] (mxs_dma_tasklet+0x18/0x1c)
    [<8027e594>] (mxs_dma_tasklet+0x18/0x1c) from [<8007d444>] (tasklet_action+0x114/0x164)
    -----------------------------------------------------------------

    1.3) Assume the two DMA operations is X (first) and Y (second).

         The root cause of the bug:
   Assume process P issues DMA X, and sleep on the completion
 @this->dma_done. X's tasklet callback is dma_irq_callback. It firstly
 wake up the process sleeping on the completion @this->dma_done,
 and then trid to unmap the scatterlist S. The waked process P will
 issue Y in another ARM core. Y initializes S->sg_magic to zero
 with sg_init_one(), while dma_irq_callback is unmapping S at the same
 time.

 See the diagram:

                   ARM core 0              |         ARM core 1
 -------------------------------------------------------------
         (P issues DMA X, then sleep)  --> |
                                           |
         (X's tasklet wakes P)         --> |
                                           |
                                           | <-- (P begin to issue DMA Y)
                                           |
         (X's tasklet unmap the            |
      scatterlist S with dma_unmap_sg) --> | <-- (Y calls sg_init_one() to init
                                           |      scatterlist S)
                                           |

[2] This patch serialize both the X and Y in the following way:
     Unmap the DMA scatterlist S firstly, and wake up the process at the end
     of the DMA callback, in such a way, Y will be executed after X.

     After this patch:

                   ARM core 0              |         ARM core 1
 -------------------------------------------------------------
         (P issues DMA X, then sleep)  --> |
                                           |
         (X's tasklet unmap the            |
      scatterlist S with dma_unmap_sg) --> |
                                           |
         (X's tasklet wakes P)         --> |
                                           |
                                           | <-- (P begin to issue DMA Y)
                                           |
                                           | <-- (Y calls sg_init_one() to init
                                           |     scatterlist S)
                                           |

Cc: stable@vger.kernel.org # 3.2
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
11 years agoENGR00174886-2 - EPDC fb: Don't register EPDC unless "epdc" kernel option set
Danny Nold [Wed, 22 Feb 2012 18:59:59 +0000 (12:59 -0600)]
ENGR00174886-2 - EPDC fb: Don't register EPDC unless "epdc" kernel option set

- EPDC firmware build was breaking due to binary build pre-empting
the conversion from .fw.ihex->.fw.  Resolve this by forcing
firmware objects to be built in order.

Signed-off-by: Danny Nold <dannynold@freescale.com>
(cherry picked from commit 7b6cb73b0a86a1d274633830fed5c65c1a0dd7d8)

11 years agoENGR00279944 ath6kl: sdio: fix system panic when doing wifi stress test
Jason Liu [Mon, 11 Nov 2013 06:29:01 +0000 (14:29 +0800)]
ENGR00279944 ath6kl: sdio: fix system panic when doing wifi stress test

When did the wifi test, meet one following kernel panic:

Unable to handle kernel paging request at virtual address 1a480000
pgd = 80004000
[1a480000] *pgd=00000000
Internal error: Oops: 805 [#1] SMP ARM
Modules linked in: ath6kl_sdio ath6kl_core [last unloaded: ath6kl_core]
CPU: 0 PID: 1953 Comm: kworker/u4:0 Not tainted 3.10.9-1.0.0_alpha+dbf364b #1
Workqueue: ath6kl ath6kl_sdio_write_async_work [ath6kl_sdio]
task: dcc9a680 ti: dc9ae000 task.ti: dc9ae000
PC is at v7_dma_clean_range+0x20/0x38
LR is at dma_cache_maint_page+0x50/0x54
pc : [<8001a6f8>]    lr : [<800170fc>]    psr: 20000093
sp : dc9afcf8  ip : 8001a748  fp : 00000004
r10: 00000000  r9 : 00000001  r8 : 00000000
r7 : 00000001  r6 : 00000000  r5 : 80cb7000  r4 : 03f9a480
r3 : 0000001f  r2 : 00000020  r1 : 1a480000  r0 : 1a480000
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: 6cc5004a  DAC: 00000015
Process kworker/u4:0 (pid: 1953, stack limit = 0xdc9ae238)
Stack: (0xdc9afcf8 to 0xdc9b0000)
fce0:                                                       80c9b29c 00000000
fd00: 00000000 80017134 8001a748 dc302ac0 00000000 00000000 dc454a00 80c12ed8
fd20: dc115410 80017238 00000000 dc454a10 00000001 80017588 00000001 00000000
fd40: 00000000 dc302ac0 dc9afe38 dc9afe68 00000004 80c12ed8 00000000 dc454a00
fd60: 00000004 80436f88 00000000 00000000 00000600 0000ffff 0000000c 80c113c4
fd80: 80c9b29c 00000001 00000004 dc115470 60000013 dc302ac0 dc46e000 dc302800
fda0: dc9afe10 dc302b78 60000013 dc302ac0 dc46e000 00000035 dc46e5b0 80438c90
fdc0: dc9afe10 dc302800 dc302800 dc9afe68 dc9afe38 80424cb4 00000005 dc9afe10
fde0: dc9afe20 80424de8 dc9afe10 dc302800 dc46e910 80424e90 dc473c00 dc454f00
fe00: 000001b5 7f619d64 dcc7c830 00000000 00000000 dc9afe38 dc9afe68 00000000
fe20: 00000000 00000000 dc9afe28 dc9afe28 80424d80 00000000 00000035 9cac0034
fe40: 00000000 00000000 00000000 00000000 000001b5 00000000 00000000 00000000
fe60: dc9afe68 dc9afe10 3b9aca00 00000000 00000080 00000034 00000000 00000100
fe80: 00000000 00000000 dc9afe10 00000004 dc454a00 00000000 dc46e010 dc46e96c
fea0: dc46e000 dc46e964 00200200 00100100 dc46e910 7f619ec0 00000600 80c0e770
fec0: dc15a900 dcc7c838 00000000 dc46e954 8042d434 dcc44680 dc46e954 dc004400
fee0: dc454500 00000000 00000000 dc9ae038 dc004400 8003c450 dcc44680 dc004414
ff00: dc46e954 dc454500 00000001 dcc44680 dc004414 dcc44698 dc9ae000 dc9ae030
ff20: 00000001 dc9ae000 dc004400 8003d158 8003d020 00000000 00000000 80c53941
ff40: dc9aff64 dcb71ea0 00000000 dcc44680 8003d020 00000000 00000000 00000000
ff60: 00000000 80042480 00000000 00000000 000000f8 dcc44680 00000000 00000000
ff80: dc9aff80 dc9aff80 00000000 00000000 dc9aff90 dc9aff90 dc9affac dcb71ea0
ffa0: 800423cc 00000000 00000000 8000e018 00000000 00000000 00000000 00000000
ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
...
---[ end trace 0c038f0b8e0b67a3 ]---

The kernel panic is caused by the sg_buf is not set correctly with the
following code when compiled with Yocto GCC 4.8.1:

drivers/net/wireless/ath/ath6kl/hif.h:
struct hif_scatter_req {
        struct list_head list;
        /* address for the read/write operation */
        u32 addr;
...

        /* bounce buffer for upper layers to copy to/from */
        u8 *virt_dma_buf;

        struct hif_scatter_item scat_list[1];

        u32 scat_q_depth;
};

(Note: the scat_req.scat_list[] will dynamiclly grow with run-time)

drivers/net/wireless/ath/ath6kl/sdio.c: ath6kl_sdio_setup_scat_data(...)
/* assemble SG list */
for (i = 0; i < scat_req->scat_entries; i++, sg++) {
ath6kl_dbg(ATH6KL_DBG_SCATTER, "%d: addr:0x%p, len:%d\n",
   i, scat_req->scat_list[i].buf,
   scat_req->scat_list[i].len);

sg_set_buf(sg, scat_req->scat_list[i].buf,
   scat_req->scat_list[i].len);
}

The GCC 4.8.1 compiler will not do the for-loop till scat_entries, instead,
it only run one round loop. This may be caused by that the GCC 4.8.1 thought
that the scat_list only have one item and then no need to do full iteration,
but this is simply wrong by looking at the assebly code. This will cause the
sg buffer not get set when scat_entries > 1 and thus lead to kernel panic.

This patch is a workaround to the GCC 4.8.1 complier issue by passing the
entry address of the scat_req->scat_list to the for-loop and interate it,
then, GCC 4.8.1 will do the full for-loop correctly.
(Note: This issue not observed with GCC 4.7.2, only found on the GCC 4.8.1)

This patch does not change any function logic and no any performance downgrade.

Signed-off-by: Jason Liu <r64343@freescale.com>
11 years agoENGR00287331-3 sdhci-esdhc-imx: do not need disable clock during remove function
Dong Aisheng [Mon, 11 Nov 2013 08:44:19 +0000 (16:44 +0800)]
ENGR00287331-3 sdhci-esdhc-imx: do not need disable clock during remove function

Since the clock is managed by runtime pm currently, we do not need
disable it again during driver remove function, or it will cause
clock disable count mismatch issue since the clocks have already been disabled.

mx6slevk:/sys/bus/platform/drivers/sdhci-esdhc-imx# echo 2194000.usdhc > unbind
mmc1: card aaaa removed
------------[ cut here ]------------
WARNING: at drivers/clk/clk.c:780 clk_disable+0x18/0x24()
....

Signed-off-by: Dong Aisheng <b29396@freescale.com>
11 years agoENGR00287331-2 sdhci-esdhc-imx: use bus freq in runtime pm
Dong Aisheng [Mon, 11 Nov 2013 06:53:58 +0000 (14:53 +0800)]
ENGR00287331-2 sdhci-esdhc-imx: use bus freq in runtime pm

Request BUS_FREQ_HIGH when bus is busy and then release BUS_FREQ_HIGH
when bus becomes idle.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
11 years agoENGR00287331-1 mmc: add delay after CMD6 befoer sending CMD13 for sandisk
Ryan QIAN [Wed, 16 Jan 2013 02:23:28 +0000 (10:23 +0800)]
ENGR00287331-1 mmc: add delay after CMD6 befoer sending CMD13 for sandisk

- Some sandisk emmc cards need certain delay befor sending cmd13 after cmd6.
Original CR: ENGR174296 (commit: fd031f9)

Acked-by: Aisheng Dong <b29396@freescale.com>
Signed-off-by: Ryan QIAN <b32804@freescale.com>
(cherry picked from commit f942bf1db36355d46f38792601594949f3f2c71b)

11 years agoENGR00286960-2 arm: imx: improve status check of clock gate
Anson Huang [Fri, 8 Nov 2013 19:59:05 +0000 (14:59 -0500)]
ENGR00286960-2 arm: imx: improve status check of clock gate

For ccm clock gate, both 2b'11 and 2b'01 should be treated
as clock enabled, see below description in CCM:

2b'00: clock is off during all modes;
2b'01: clock is on in run mode, but off in wait and stop mode;
2b'10: Not applicable;
2b'11: clock is on during all modes, except stop mode.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00286960-1 arm: imx: initialize clock gate status
Anson Huang [Fri, 8 Nov 2013 19:54:31 +0000 (14:54 -0500)]
ENGR00286960-1 arm: imx: initialize clock gate status

Some clocks gates need to be set to 2b'01 to allow CCM
auto disabling them when system enters WAIT mode, this
setting can save many runtime power. These clock gates
are normally always enabled, so no need to add another
status for clk gate enable function, just set them to
right status when system boot up is good enough.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00286744-3 arm: imx: optimize power number for busfreq
Anson Huang [Thu, 7 Nov 2013 20:38:20 +0000 (15:38 -0500)]
ENGR00286744-3 arm: imx: optimize power number for busfreq

i.MX6DL's axi clock is sourcing from pfd540 by default,
need to switch axi clock from pfd540 to periph when system
enters low bus mode, this is to allow pfd540 to be disabled,
and it also keeps clk tree correct.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00286744-2 arm: dts: imx6dl: add clks for busfreq
Anson Huang [Thu, 7 Nov 2013 19:11:44 +0000 (14:11 -0500)]
ENGR00286744-2 arm: dts: imx6dl: add clks for busfreq

Need to switch axi clock from pfd540 to periph when
system enters low bus mode, so add necessary clks for
bufreq driver.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00286744-1 arm: imx: add necessary interface for pfd
Anson Huang [Thu, 7 Nov 2013 19:06:00 +0000 (14:06 -0500)]
ENGR00286744-1 arm: imx: add necessary interface for pfd

Common clk framework will disable unused clks only if
they are enabled by default, so we need to add is_enabled
callback for clk framework to get clks' status.

pfd clocks are enabled by default, so we need to add this
interface for common clk framework to disable unused pfds.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00287081 [iMX6SL] - Make sure MMDC clocks are enabled at boot
Ranjani Vaidyanathan [Fri, 8 Nov 2013 18:37:10 +0000 (12:37 -0600)]
ENGR00287081 [iMX6SL] - Make sure MMDC clocks are enabled at boot

Need to enable MMDC clocks to maintain the correct usecount, else
PLL2 can get disabled incorrectly thus hanging the system.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
11 years agoENGR00286345 [iMX6DL] Fixed random hang bug in bus freq driver
Ranjani Vaidyanathan [Tue, 5 Nov 2013 20:44:20 +0000 (14:44 -0600)]
ENGR00286345 [iMX6DL] Fixed random hang bug in bus freq driver

Incorrect clock disable of PLL2 caused random hangs during
DDR freq change in iMX6DL.
Remove PERCLK freq change code as this is not required for TO1.1
and later.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
11 years agommc: sdhci: fix ctrl_2 on super-speed selection
Giuseppe CAVALLARO [Thu, 13 Jun 2013 14:41:28 +0000 (16:41 +0200)]
mmc: sdhci: fix ctrl_2 on super-speed selection

This patch fixes the HC ctrl_2 programming where, in case of
SDR104 and HS200, we have to write 100b in the the UHS Mode
bits. We wrote 101b that is reserved from Arasan Specs.

Reported-by: Youssef Triki <youssef.triki@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit 599115686d8f62999a871f7d7ee87de3b939b258)

11 years agommc: sdhci: fix caps2 for HS200
Giuseppe CAVALLARO [Wed, 12 Jun 2013 06:16:38 +0000 (08:16 +0200)]
mmc: sdhci: fix caps2 for HS200

Although the HC supports HS200 (eMMC) the caps2 are always zero; this
means there's no way to use the super speed mode (when init the card).

If the HC support SDR104, for SD3.0, so it also supports HS200 for eMMC
and this patch just sets the MMC_CAP2_HS200 in the host caps2 field.

Reported-by: Youssef Triki <youssef.triki@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Philip Rakity <prakity@nvidia.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit 156e14b126ffb6f040bc6f1aff3c51077e42a744)

11 years agommc: sdhci: add ability to stay runtime-resumed if the card is powered up
Adrian Hunter [Mon, 6 May 2013 09:17:32 +0000 (12:17 +0300)]
mmc: sdhci: add ability to stay runtime-resumed if the card is powered up

If card power is dependent on SD bus power then the host controller
must not be runtime suspended while the card is powered up.  Add
the ability to stay runtime-resumed in that case and enable it with a new
quirk SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit f0710a557cb17746b09234f01073a2cdafe4f4a5)

11 years agoENGR00286971-4 Revert "ENGR00278504-1 mmc: sdhci: add quirk for broken acmd23"
Dong Aisheng [Fri, 8 Nov 2013 10:50:07 +0000 (18:50 +0800)]
ENGR00286971-4 Revert "ENGR00278504-1 mmc: sdhci: add quirk for broken acmd23"

The ACMD23 unwork issue is fixed now. so the former quirk to disable
ACMD23 can be removed.

This reverts commit fd27fce042bfd289eab6dbb7c98ab3adb48ca25b.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
11 years agoENGR00286971-3 Revert "ENGR00278504-2 sdhci-esdhc-imx: add broken auto cmd23"
Dong Aisheng [Fri, 8 Nov 2013 10:49:41 +0000 (18:49 +0800)]
ENGR00286971-3 Revert "ENGR00278504-2 sdhci-esdhc-imx: add broken auto cmd23"

This reverts commit 7b725c102e1ddfbaca5856af7c286bfd626363ea.

Conflicts:

drivers/mmc/host/sdhci-esdhc-imx.c

Signed-off-by: Dong Aisheng <b29396@freescale.com>
11 years agoENGR00286971-2 dts: imx6-sabreauto: disabled flexcan when max7310 is gone
Dong Aisheng [Fri, 8 Nov 2013 07:51:10 +0000 (15:51 +0800)]
ENGR00286971-2 dts: imx6-sabreauto: disabled flexcan when max7310 is gone

Flexcan transceiver is using GPIOs from max7310 on i2c3.
Since max7310 is gone on below dts files, so there's no reason
to keep flexcan alive in those dts files.

Note: since flexcan1 is disabled by default, so did not need
to add it.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
11 years agoENGR00286971-1 imx6q: add sanity check for getting gpio for flexcan
Dong Aisheng [Fri, 8 Nov 2013 07:48:23 +0000 (15:48 +0800)]
ENGR00286971-1 imx6q: add sanity check for getting gpio for flexcan

This is used to avoid a warning:
WARNING: at /home/b29397/work/projects/linux-2.6-imx/drivers/gpio/gpiolib.c:126
gpio_to_desc+0x30/0x44()
invalid GPIO -517
Modules linked in:
....
gpiod_request: invalid GPIO

Signed-off-by: Dong Aisheng <b29396@freescale.com>
11 years agoENGR00286926 usb: chipidea: imx: add release_bus_freq at failure path
Peter Chen [Fri, 8 Nov 2013 02:14:18 +0000 (10:14 +0800)]
ENGR00286926 usb: chipidea: imx: add release_bus_freq at failure path

If not, the request{release}_bus_freq will be mismatch if
fail occurs.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
11 years agommc: sdhci: Avoid needless loop while handling SDIO interrupts in sdhci_irq()
Alexey Neyman [Wed, 6 Nov 2013 03:40:36 +0000 (19:40 -0800)]
mmc: sdhci: Avoid needless loop while handling SDIO interrupts in sdhci_irq()

Ignore Card Interrupt bit in the interrupt status if we already know that
mmc_signal_sdio_irq() is going to be called at the end of sdhci_irq(). This
avoids a needless loop in sdhci_irq() repeatedly reading interrupt status
and doing nothing.

Signed-off-by: Alexey Neyman <stilor@att.net>
Acked-by: Dong Aisheng <b29396@freescale.com>
11 years agommc: sdhci-esdhc-imx: add runtime pm support
Dong Aisheng [Wed, 30 Oct 2013 13:13:26 +0000 (21:13 +0800)]
mmc: sdhci-esdhc-imx: add runtime pm support

The root clock will be disabled in runtime pm which can be used to save power.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
11 years agommc: sdhci-esdhc-imx: fix runtime pm unblance issue
Dong Aisheng [Thu, 7 Nov 2013 07:12:48 +0000 (15:12 +0800)]
mmc: sdhci-esdhc-imx: fix runtime pm unblance issue

Since we're using common esdhc_send_command for tuning commands and
the core code will call pm_runtime_put after command is finished.
So we add a pm_runtime_get_sync here to get the blance.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
11 years agommc: sdhci-esdhc-imx: clear SDHCI_CTRL_EXEC_TUNING should not affect other bits
Dong Aisheng [Wed, 30 Oct 2013 10:48:52 +0000 (18:48 +0800)]
mmc: sdhci-esdhc-imx: clear SDHCI_CTRL_EXEC_TUNING should not affect other bits

Current code will clear all turning related bits like ESDHC_STD_TUNING_EN
and ESDHC_MIX_CTRL_FBCLK_SEL when clear SDHCI_CTRL_EXEC_TUNING.
This may cause the card which has already passed the turning to become
unwork since the turning status lost.
We observed this failure when enable runtime pm.

BTW, imx needs to enable ESDHC_MIX_CTRL_FBCLK_SEL bit for turned clock.
The FBCLK_SEL will be cleared when SDHCI_CTRL_TUNED_CLK is cleared
and SDHCI_CTRL_EXEC_TUNING is not set.
This is used in case we change to another normal card from a UHS card
in the same slot. FBCLK_SEL is not needed for normal card.

After that, SDHCI_CTRL_EXEC_TUNING will only affect ESDHC_MIX_CTRL_EXE_TUNE.
Clearing it does not affect the turned card to remain working on UHS mode.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
11 years agommc: sdhci-esdhc-imx: tuning bits should not be cleared during reset
Dong Aisheng [Wed, 30 Oct 2013 08:54:09 +0000 (16:54 +0800)]
mmc: sdhci-esdhc-imx: tuning bits should not be cleared during reset

We should not clear tuning bits during reset or the SD3.0/eMMC4.5 card
working on UHS mode may not work after reset since the former tuning
settings was lost.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
11 years agommc: sdhci-pltfm: export pltfm suspend/resume api
Dong Aisheng [Thu, 7 Nov 2013 07:11:00 +0000 (15:11 +0800)]
mmc: sdhci-pltfm: export pltfm suspend/resume api

It is helpful for platforms code to use to elimiate duplicated code.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
11 years agommc: sdhci-esdhc-imx: add eMMC HS200 mode support
Dong Aisheng [Mon, 21 Oct 2013 13:38:30 +0000 (21:38 +0800)]
mmc: sdhci-esdhc-imx: add eMMC HS200 mode support

Add support for eMMC 4.5 cards to work on hs200 mode.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
11 years agommc: core: mmc DDR mode should not depend on UHS_DDR50
Dong Aisheng [Wed, 16 Oct 2013 08:48:39 +0000 (16:48 +0800)]
mmc: core: mmc DDR mode should not depend on UHS_DDR50

The MMC_CAP_UHS_DDR50 must work on 1.8v.
However, the eMMC DDR mode can work on either 1.8v or 3.3v and
should not depend on UHS_DDR50.
So get rid of this limitation to let controller without 1.8v
signal voltage support can also work for eMMC DDR mode if it claims.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
11 years agommc: sdhci-esdhc-imx: add MMC_CAP_1_8V_DDR for mx6
Dong Aisheng [Thu, 7 Nov 2013 07:08:34 +0000 (15:08 +0800)]
mmc: sdhci-esdhc-imx: add MMC_CAP_1_8V_DDR for mx6

The i.MX6 supports 1.8v/3.3v eMMC DDR mode, so add this flag.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
11 years agommc: sdhci-esdhc-imx: fix cpas over write issue
Dong Aisheng [Thu, 17 Oct 2013 06:29:32 +0000 (14:29 +0800)]
mmc: sdhci-esdhc-imx: fix cpas over write issue

We should use '|=' instead '=', or it may over write
the original caps assigned before this line.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
11 years agommc: sdhci-esdhc-imx: add SDHCI_TRANSFER_MODE read function
Dong Aisheng [Fri, 18 Oct 2013 11:38:25 +0000 (19:38 +0800)]
mmc: sdhci-esdhc-imx: add SDHCI_TRANSFER_MODE read function

Used to read out the correct value of SDHCI_TRANSFER_MODE register
for upper layer.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
11 years agommc: sdhci: clear auto cmd setting bits for no data cmds
Dong Aisheng [Fri, 18 Oct 2013 11:36:50 +0000 (19:36 +0800)]
mmc: sdhci: clear auto cmd setting bits for no data cmds

The auto cmd settings bits should be cleared before sending new commands
or we may receive command timeout error for normal commands due to wrongly
pre-sent auto cmd.

e.g. we receive CMD13 timeout error due to ACMD23 is wrongly enabled
by former data commands.

mmc2: new high speed DDR MMC card at address 0001
mmcblk1: mmc2:0001 SEM08G 7.39 GiB
mmcblk1boot0: mmc2:0001 SEM08G partition 1 2.00 MiB
mmcblk1boot1: mmc2:0001 SEM08G partition 2 2.00 MiB
mmcblk1rpmb: mmc2:0001 SEM08G partition 3 128 KiB
 mmcblk1: p1 p2 p3 p4 < p5 p6 p7 >
mmc2: Timeout waiting for hardware interrupt.
 mmcblk1boot1: unknown partition table
mmc2: Timeout waiting for hardware interrupt.
 mmcblk1boot0: unknown partition table

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
11 years agoENGR00286724-11 imx_v7_defconfig: add flexcan support
Dong Aisheng [Thu, 7 Nov 2013 08:10:06 +0000 (16:10 +0800)]
ENGR00286724-11 imx_v7_defconfig: add flexcan support

Add flexcan support.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
11 years agoENGR00286724-10 dts: sabreauto: add new dts for flexcan1 support
Dong Aisheng [Wed, 6 Nov 2013 11:37:38 +0000 (19:37 +0800)]
ENGR00286724-10 dts: sabreauto: add new dts for flexcan1 support

The flexcan1 is pin conflict with fec. So we add a new dts file with
flexcan1 enabled with fec disabled for user to use.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
11 years agoENGR00286724-9 dts: imx6qdl: add properties for flexcan to support wakeup
Dong Aisheng [Wed, 6 Nov 2013 11:14:08 +0000 (19:14 +0800)]
ENGR00286724-9 dts: imx6qdl: add properties for flexcan to support wakeup

According to binding doc, add missed properties for remote wakeup
support.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
11 years agoENGR00286724-8 can: flexcan: add self wakeup support
Dong Aisheng [Wed, 6 Nov 2013 11:10:28 +0000 (19:10 +0800)]
ENGR00286724-8 can: flexcan: add self wakeup support

If wakeup is enabled, enter stop mode, else enter disabled mode.
Self wake can only work on stop mode.
For imx6q, the stop request has to be mannually assert on
IOMUX GPR13[28:29] register, we use syscon to control that bit.

Signed-off-by: Dong Aisheng <b29396@freescale.com>