]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agoMLK-10063 vadc: Remove code from capture folder
Sandor Yu [Fri, 26 Dec 2014 08:36:24 +0000 (16:36 +0800)]
MLK-10063 vadc: Remove code from capture folder

vadc source code have move to folder
drivers/media/platform/mxc/subdev,
so remove it.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10061 csi: correct YUV444 format in v4l2 driver
Sandor Yu [Fri, 26 Dec 2014 07:37:49 +0000 (15:37 +0800)]
MLK-10061 csi: correct YUV444 format in v4l2 driver

v4l2 define YUV444 and YUV32 format as followed:
V4L2_PIX_FMT_YUV444  /* 16  xxxxyyyy uuuvvvv */
V4L2_PIX_FMT_YUV32   /* 32  YUV-8-8-8-8 */

VADC and PXP defined YUV444 as:
YUV1P444 — 32-bit pixels, 1-plane XYUV

so the format of YUV444 in PXP/VADC should
V4L2_PIX_FMT_YUV32 in v4l2.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10047: hdmi: Add hotplug detect for DVI monitors
Sandor Yu [Fri, 19 Dec 2014 08:27:19 +0000 (16:27 +0800)]
MLK-10047: hdmi: Add hotplug detect for DVI monitors

The patch merger from fsl-arm-yocto-bsp community.
HPD is optional function for DVI spec,
so some DVI only monitor not support HPD.
Add RXSENSE interrupt check in HPD process to handle such case.

Signed-off-by: Robert Winkler <robert.winkler@boundarydevices.com>
Signed-off-by: Sandor Yu <R01008@freescale.com>
(cherry picked from commit f047c45830c4e75c441056c76ded476f04938eac)

9 years agoMLK-10059 arm: imx6sx: correct the num of the pcie regulator
Richard Zhu [Thu, 25 Dec 2014 07:54:26 +0000 (15:54 +0800)]
MLK-10059 arm: imx6sx: correct the num of the pcie regulator

The orignal regulat num of the MPCIE_3V3 regulator is wrong,
change it to the correct one.
Otherwise, there would be the following warning when boot kernel.
WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:52 sysfs_warn_dup+0x6c/0x8c()
sysfs: cannot create duplicate filename
'/devices/soc0/regulators.18/3.regulato'
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.14.24-01139-g690bd11 #166
[<80014e6c>] (unwind_backtrace) from [<800118ac>] (show_stack+0x10/0x14)
[<800118ac>] (show_stack) from [<806b0018>] (dump_stack+0x78/0xc0)
[<806b0018>] (dump_stack) from [<8002c1ec>]
(warn_slowpath_common+0x68/0x8c) [<8002c1ec>] (warn_slowpath_common)
from [<8002c240>] (warn_slowpath_fmt+0x30/0) [<8002c240>]
(warn_slowpath_fmt) from [<8012de80>] (sysfs_warn_dup+0x6c/0x8c)
[<8012de80>] (sysfs_warn_dup) from [<8012df28>]
(sysfs_create_dir_ns+0x88/0x98) [<8012df28>] (sysfs_create_dir_ns) from
[<80274be8>] (kobject_add_internal+0x9c) [<80274be8>]
(kobject_add_internal) from [<80274fe0>] (kobject_add+0x4c/0x98)
[<80274fe0>] (kobject_add) from [<80317bf0>] (device_add+0xe0/0x51c)
[<80317bf0>] (device_add) from [<804e2dd4>]
(of_platform_device_create_pdata+0x)
[<804e2dd4>] (of_platform_device_create_pdata) from [<804e2edc>]
(of_platform_b) [<804e2edc>] (of_platform_bus_create) from [<804e2f38>]
(of_platform_bus_create) [<804e2f38>] (of_platform_bus_create) from
[<804e3090>] (of_platform_populate+0) [<804e3090>]
(of_platform_populate) from [<80cf2d40>] (imx6sx_init_machine+0x38)
[<80cf2d40>] (imx6sx_init_machine) from [<80cde264>]
(customize_machine+0x1c/0x) [<80cde264>] (customize_machine) from
[<800088cc>] (do_one_initcall+0xe8/0x144) [<800088cc>] (do_one_initcall)
from [<80cdbc04>] (kernel_init_freeable+0x104/0x) [<80cdbc04>]
(kernel_init_freeable) from [<806abfb4>] (kernel_init+0x8/0xec)
[<806abfb4>] (kernel_init) from [<8000e5f8>] (ret_from_fork+0x14/0x3c)
---[ end trace f90dcd76c3b24ac8 ]---

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
9 years agoMLK-10060 ARM: i.MX6: disable ethernet phy AR8031 EEE mode in default
Fugang Duan [Thu, 25 Dec 2014 09:17:49 +0000 (17:17 +0800)]
MLK-10060 ARM: i.MX6: disable ethernet phy AR8031 EEE mode in default

Disable ethernet phy AR8031 EEE mode in default to reduce the IEEE1588
latency.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoASoC: wm8960: Move register initialisation to I2C driver probe()
Zidan Wang [Thu, 27 Nov 2014 08:53:08 +0000 (16:53 +0800)]
ASoC: wm8960: Move register initialisation to I2C driver probe()

We must ensure that the clocking configuration is valid as rapidly as possible.
And do software reset before the others registers updates, or the registers
will be reset to the default state.

Signed-off-by: Zidan Wang <b50113@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 3ad5e861a715cbe932cd145d4612c11e5912a72f)

9 years agoASoC: wm8960: Cleanup manual bias level transitions
Lars-Peter Clausen [Sun, 23 Nov 2014 12:37:33 +0000 (13:37 +0100)]
ASoC: wm8960: Cleanup manual bias level transitions

Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner.

Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
anymore either.

The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
can also be removed as the core will automatically do this after the CODEC
has been probed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 0a87a6e1c09c3b93d91bf65809e79cf6cf358785)

9 years agoASoC: wm8960: Add device tree support
Zidan Wang [Thu, 20 Nov 2014 11:07:48 +0000 (19:07 +0800)]
ASoC: wm8960: Add device tree support

Document the device tree binding for the WM8960 codec, and modify the
driver to extract the platform data from device tree, if present.

Signed-off-by: Zidan Wang <b50113@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit e2280c9040d8bc5039617af35ccf7b8ac4abb428)

9 years agoMLK-10055-2: mfd: si476x-i2c: sound is registered when no FM module attached
Shengjiu Wang [Wed, 24 Dec 2014 08:51:22 +0000 (16:51 +0800)]
MLK-10055-2: mfd: si476x-i2c: sound is registered when no FM module attached

The si476x_core_get_revision_info will send i2c command to FM module, if it
return error, there is no FM modules attached, so we need't to register the
sound card. otherwise, the pulseaudio will access this sound card, but return
a lot of i2c error.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-10055-1: ASoC: imx-cs42888: when codec probe failed, alsa return RETRY error.
Shengjiu Wang [Wed, 24 Dec 2014 08:08:45 +0000 (16:08 +0800)]
MLK-10055-1: ASoC: imx-cs42888: when codec probe failed, alsa return RETRY error.

If there is no codec device, the machine driver will not register the
card. then alsa will not return RETRY error. update the error handling
for machine driver.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-10053 dma: imx-sdma: fix building error
Robin Gong [Tue, 23 Dec 2014 08:07:36 +0000 (16:07 +0800)]
MLK-10053 dma: imx-sdma: fix building error

Caused by cherry-pick 260fe87c1d744d8386057d03013e002352f8b181, current
sdma driver remove 'sdmac->mode'.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoMLK-10048-5: ASoC: fsl_asrc: underrun for playback 192k, 6ch p2p case.
Shengjiu Wang [Mon, 8 Dec 2014 07:20:41 +0000 (15:20 +0800)]
MLK-10048-5: ASoC: fsl_asrc: underrun for playback 192k, 6ch p2p case.

For p2p output, the output divider should align with the output sample
rate, if use the Ideal sample rate, there will be a lot of overload, which
will cause underrun.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-10048-4: ASoC: fsl_asrc: fix dma task timeout issue when use 3 instance
Shengjiu Wang [Mon, 15 Dec 2014 09:28:00 +0000 (17:28 +0800)]
MLK-10048-4: ASoC: fsl_asrc: fix dma task timeout issue when use 3 instance

Merged from 49108fcf7b79ed77d34be33b53a3964b2ac27204
1. Watermark level in sdma use byte as its unit. but asrc driver use
word, there is mismatch between them. Here fix this issue and sdma can
work more efficiency.
2. Enlarge the larst_period_size, when use small size, for some case,
the dma task will timeout, because sdma has no much data for output.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-10048-3: ASoC: fsl_asrc: fix asrc crach when suspend/resume
Shengjiu Wang [Mon, 8 Dec 2014 07:08:27 +0000 (15:08 +0800)]
MLK-10048-3: ASoC: fsl_asrc: fix asrc crach when suspend/resume

merge 7e1a620a030d17f93fdd97d076f1cdd042e79337

The reason of crach is that some variables are not protected in
function mxc_asrc_suspend(), when suspend, there is possibility to
access one NULL pointer.
Refine the spin lock usage, add protecting for pair_hold.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-10048-2: ASoC: fsl_asrc: change the return value
Shengjiu Wang [Mon, 8 Dec 2014 05:04:58 +0000 (13:04 +0800)]
MLK-10048-2: ASoC: fsl_asrc: change the return value

Merge from c086d0151ee3e131b52bef96c5096d1ee603c852

Return value -ERESTARTSYS is not visible for user space according
to include/linux/errno.h. So use -EBUSY replace it.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-10048-1: ASoC: fsl_asrc: add protection the old version asrc
Shengjiu Wang [Mon, 8 Dec 2014 05:03:17 +0000 (13:03 +0800)]
MLK-10048-1: ASoC: fsl_asrc: add protection the old version asrc

The latest asrc's channel bits is 4, bit the old asrc's channel bits is 3.
So here add protection for when using the old version asrc.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-9776: dma: imx-sdma: make sure BUG_ON workaround do not work in loop mode
Robin Gong [Fri, 10 Oct 2014 06:55:19 +0000 (14:55 +0800)]
MLK-9776: dma: imx-sdma: make sure BUG_ON workaround do not work in loop mode

  The earlier patch for "ENGR00313512 dma: imx-sdma: A bungle of work around for
BUG ON issue" is better not applied for loop mode, since there is no any cookie
touch in loop mode which means never trigger the BUG_ON workaround. Otherwise,
if upper driver such as UART disable dma channel but the device still has sent
the data into the RXFIFO, bd buffer will be consumed quickly and then stop.That
will trigger "RX FIFO overrun", like below log:

imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun

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

9 years agoENGR00313512 dma: imx-sdma: A bungle of work around for BUG ON issue
Nicolin Chen [Wed, 16 Jul 2014 04:16:31 +0000 (12:16 +0800)]
ENGR00313512 dma: imx-sdma: A bungle of work around for BUG ON issue

The BUG ON issue could be triggered by such scenarios:

A)
issue_pending(1) ->
                <- SDMA irq(1)
                <- SDMA tasklet(1)   //Normal case
issue_pending(2) ->
terminate_all(2) ->
... system suspend/resume
issue_pending(3) ->
                <- SDMA irq(2)
                <- SDMA irq(3)     //might also happen after tasklet(2)
                <- SDMA tasklet(2)
                <- SDMA tasklet(3) //BUG ON

B)
issue_pending(1) ->
                <- SDMA irq(1)
                <- SDMA tasklet(1)   //Normal case
issue_pending(2) ->
                <- SDMA irq(2)   //might also happen after terminate_all(2)
terminate_all(2) ->
... system suspend/resume
issue_pending(3) ->
                <- SDMA irq(3)     //might also happen after tasklet(2)
                <- SDMA tasklet(2)
                <- SDMA tasklet(3) //BUG ON

The best fix for this issue is to eradicate irq(2) or tasklet(2).

However, currently we couldn't find an effective fix for both cases above.

Thus this fix could be treated as a work around. It fixes this issue by Reduce
the possiblity of irq(2) and tasklet(3).

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 1880fc41df51450825c2b17bae5be9536e26b73f)

9 years agodmaengine: imx: correct sdmac->status for cyclic dma tx
Jiada Wang [Thu, 15 May 2014 01:22:13 +0000 (18:22 -0700)]
dmaengine: imx: correct sdmac->status for cyclic dma tx

In cyclic dma tx's handler sdma_handle_channel_loop(),
SDMA channel statue is set to either DMA_ERROR or DMA_IN_PROGRESS
based on each period's status. This has the following issues:

1) If one period's status is BD_RROR, then channel status
   will be set to DMA_ERROR, but it will be overwritten to DMA_IN_PROGRESS
   if the following periods are OK.
2) DMA client may call sdma_control(DMA_TERMINATE_ALL) to stop the cyclic dma
   operation, sdma channel status will be set to DMA_ERROR,
   but if after this handler is called, then again the channel status will be overwritten
   to DMA_IN_PROGRESS. Then the following dmaengine_prep_dma_cyclic() will always fail,
   as channel status is DMA_IN_PROGRESS.

As in cyclic dma tx, channel status will be initially set to DMA_IN_PROGRESS,
driver only needs to change it to DMA_ERROR, when something wrong happens
(one period status is wrong, or stoped by client explicitly).

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit ffe59b29308791c9600ab86de2ca070d742c107d)
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit cc0787ee49f8aae2af65dbf41e6b68b2b438534e)

9 years agoENGR00319473: dma: imx-sdma: support sdma restore from mega/fast power down status
Robin Gong [Tue, 6 May 2014 07:18:26 +0000 (15:18 +0800)]
ENGR00319473: dma: imx-sdma: support sdma restore from mega/fast power down status

Support sdma suspend and resume interface to restore from mega/fast power down.

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

9 years agoMLK-10050 dma: imx-sdma: add support for sdma memory copy
Robin Gong [Tue, 23 Dec 2014 05:39:23 +0000 (13:39 +0800)]
MLK-10050 dma: imx-sdma: add support for sdma memory copy

This patch is just created by so many confilict while cherry-pick
from v3.10 a6a6cf911f85a3a09f763195478d422c571b9565.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoENGR00286273-3 arm: dtsi: imx6sl: add iram property to support internal SRAM
Nicolin Chen [Tue, 5 Nov 2013 11:46:51 +0000 (19:46 +0800)]
ENGR00286273-3 arm: dtsi: imx6sl: add iram property to support internal SRAM

By doing this, we can allow SDMA driver to allocate its memory from iram
when using i.MX6 SoloLite SoC.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
(cherry picked from commit aa527b38d52af233641edc500acae0e6212ccdb3)

9 years agoENGR00286273-2 misc: sram: Set default alignment to 4Kbytes
Nicolin Chen [Tue, 5 Nov 2013 11:23:58 +0000 (19:23 +0800)]
ENGR00286273-2 misc: sram: Set default alignment to 4Kbytes

As Kernel 3.0.35 does, we set the default iram alignment to 4Kbytes,
although it would waste few memory space.

We here try to do this as an expediency because currently we couldn't
find a perfect solution for 4Kbytes alignment requirement from SDMA.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
(cherry picked from commit 38861a0a4ded83632dd58c14fd92638c07e2a4b9)

9 years agoENGR00286273-1 dma: imx-sdma: allocate memory from iram
Nicolin Chen [Tue, 5 Nov 2013 11:19:07 +0000 (19:19 +0800)]
ENGR00286273-1 dma: imx-sdma: allocate memory from iram

We try to allocate memory from SoC internal SRAM so that we can turn off
voltage of external DDR to save power. Surely, if we failed to get the
iram DT node or allocate memory due to no enough SRAM space, we would
allow SDMA driver to allocate memory in a traditional way.

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

9 years agoENGR00303524 Plugout HDMI while video playing, the audio is blocked.
Shengjiu Wang [Mon, 10 Mar 2014 10:38:14 +0000 (18:38 +0800)]
ENGR00303524 Plugout HDMI while video playing, the audio is blocked.

The requirement for Android is different. it need the driver exit ASAP.
Don't block the user space, android will restart the driver in user space.
Yocto need the driver to start the transfer by itself.
Add a specific kernel config for this case.

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

9 years agoMLK-10038-2: ARM: dts: Add "revision-a10" to set command set to A10
Zidan Wang [Fri, 19 Dec 2014 03:43:47 +0000 (11:43 +0800)]
MLK-10038-2: ARM: dts: Add "revision-a10" to set command set to A10

Add property "revision-a10" to device tree to set the default command
set to A10.

Signed-off-by: Zidan Wang <b50113@freescale.com>
9 years agoMLK-10038-1: mfd: si476x-i2c: Add support of si476x-rev4.0 board
Zidan Wang [Fri, 19 Dec 2014 03:13:01 +0000 (11:13 +0800)]
MLK-10038-1: mfd: si476x-i2c: Add support of si476x-rev4.0 board

Currently, si476x-rev1.0 and si476x-rev4.0 board just support A10 compatible
command set. For si476x-rev1.0 board, its firmware revision is unsupported and
will revert to A10 compatible function. For si476x-rev4.0 board, its firmware
revision is two and will use A30 function, but A30 command set function can't
work for the rev4.0 board.
So make the command set configurable in dts. If "revision-a10" is present,
set the revision to SI476X_REVISION_A10 to use A10 compatible commit set.
Otherwise, get the revision from si476x register.

Signed-off-by: Zidan Wang <b50113@freescale.com>
9 years agoMGS-374 [#1500] fix GPU kernel debugfs crash issue
Xianzhong [Wed, 17 Dec 2014 09:55:18 +0000 (17:55 +0800)]
MGS-374 [#1500] fix GPU kernel debugfs crash issue

this crash issue is caused by kernel NULL pointer when access GPU database,
GPU database is shared by all kernels, it can be queried with any valid kernel.
this patch will find the valid kernel pointer to avoid GPU kernel crash.

the crash backtrace with 'cat /sys/kernel/debug/gc/vidmem' on i.mx6sl:

[<80480600>] (gckKERNEL_FindDatabase+0x8/0xec) from [<80478db0>] (vidmem_show+0x2c/0x60)
[<80478db0>] (vidmem_show+0x2c/0x60) from [<800e4d5c>] (seq_read+0x1dc/0x47c)
[<800e4d5c>] (seq_read+0x1dc/0x47c) from [<800c7164>] (vfs_read+0x98/0x144)
[<800c7164>] (vfs_read+0x98/0x144) from [<800c77c4>] (SyS_read+0x3c/0x78)
[<800c77c4>] (SyS_read+0x3c/0x78) from [<8000e080>] (ret_fast_syscall+0x0/0x30)

Date: Dec 18, 2014
Signed-off-by: Xianzhong <b07117@freescale.com>
Acked-by: Jason Liu
(cherry picked from commit 5b59e9d67ee1ce25e43fcb8934fcf0c75abfd0e3)

9 years agoMLK-10003-2: ARM: clk-imx6sx: register SAI/SAI_IPG as shared clocks
Shengjiu Wang [Wed, 17 Dec 2014 06:30:44 +0000 (14:30 +0800)]
MLK-10003-2: ARM: clk-imx6sx: register SAI/SAI_IPG as shared clocks

SAI and SAI_IPG are controlled by the same clock gating bits, so register
them with imx_clk_gate2_shared.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 1223c730e5ca58794721c26b3803b96f95fd3937)

9 years agoMLK-10003-1: ASoC: fsl_sai: The record sound is faster or slower in master mode
Shengjiu Wang [Tue, 16 Dec 2014 05:06:13 +0000 (13:06 +0800)]
MLK-10003-1: ASoC: fsl_sai: The record sound is faster or slower in master mode

The default setting of sai is RX sync with TX, TX output the I2S clock. So
When recording, we should set TCR2's divider, not RCR2's divider.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 9bfe1d33b984b44af011c644f995c3b406b2f3e1)

9 years agoMLK-10001: ASoC: fsl_sai: no sound for mono wav in master mode
Shengjiu Wang [Tue, 16 Dec 2014 02:09:50 +0000 (10:09 +0800)]
MLK-10001: ASoC: fsl_sai: no sound for mono wav in master mode

The bclk caculation should according to the slot num, not the channels.
Because sometime we have two slots, but only one slot is enabled for mono
channel.
As when the codec wm8962 works on mono mode, it needs two slots I2S signal.
So here set the default slots of sai to 2, and add function set_tdm_slots for
future usage.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 991a1f269ce4e4d0daa2cf5615169891acca0607)

9 years agoMLK-9997-3: csi v4l2 capture: function enhancement
Sandor Yu [Mon, 15 Dec 2014 08:31:25 +0000 (16:31 +0800)]
MLK-9997-3: csi v4l2 capture: function enhancement

-Add subdev function call enum_mbus_fmt from vidioc_enum_fmt_vid_cap.
-Add mbus convert to v4l2 pixelformat function.
-Return subdev function call result to ioctl function.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-9997-2 vadc: enhancement vadc function
Sandor Yu [Mon, 15 Dec 2014 08:29:21 +0000 (16:29 +0800)]
MLK-9997-2 vadc: enhancement vadc function

-Add V4L2_FRMIVAL_TYPE_DISCRETE setting in vadc_enum_framesizes.
-Add s_parm function implement.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-9997-1 ov5640: function enhancement
Sandor Yu [Mon, 15 Dec 2014 08:07:01 +0000 (16:07 +0800)]
MLK-9997-1 ov5640: function enhancement

-Add V4L2_FRMIVAL_TYPE_DISCRETE setting in ov5640_enum_framesizes.
-Correct pixelformat setting.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-9988 PXP V4L2 output: Add YUYV format support
Sandor Yu [Fri, 12 Dec 2014 06:17:04 +0000 (14:17 +0800)]
MLK-9988 PXP V4L2 output: Add YUYV format support

Add YUYV output support to pxp v4l2 output.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoARM: imx: clk-imx6sx: register SSI/SSI_IPG as shared gate clocks
Fabio Estevam [Wed, 2 Jul 2014 14:58:51 +0000 (11:58 -0300)]
ARM: imx: clk-imx6sx: register SSI/SSI_IPG as shared gate clocks

SSI and SSI_IPG are clocks controlled by the same clock gating field, so
register them with imx_clk_gate2_shared.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
(cherry picked from commit 42222ee66ae046187b0ca8ec4b0c00c8832810a7)

9 years agonet: fec: Fix NAPI race
Fugang Duan [Tue, 16 Dec 2014 07:24:39 +0000 (15:24 +0800)]
net: fec: Fix NAPI race

Do camera capture test on i.MX6q sabresd board, and save the capture data to
nfs rootfs. The command is:
gst-launch-1.0 -e imxv4l2src device=/dev/video1 num-buffers=2592000 ! tee name=t !
queue ! imxv4l2sink sync=false t. ! queue ! vpuenc ! queue ! mux. pulsesrc num-buffers=3720937
blocksize=4096 ! 'audio/x-raw, rate=44100, channels=2' ! queue ! imxmp3enc ! mpegaudioparse !
queue ! mux. qtmux name=mux ! filesink location=video_recording_long.mov

After about 10 hours running, there have net watchdog timeout kernel dump:
...
WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:264 dev_watchdog+0x2b4/0x2d8()
NETDEV WATCHDOG: eth0 (fec): transmit queue 0 timed out
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.14.24-01051-gdb840b7 #440
[<80014e6c>] (unwind_backtrace) from [<800118ac>] (show_stack+0x10/0x14)
[<800118ac>] (show_stack) from [<806ae3f0>] (dump_stack+0x78/0xc0)
[<806ae3f0>] (dump_stack) from [<8002b504>] (warn_slowpath_common+0x68/0x8c)
[<8002b504>] (warn_slowpath_common) from [<8002b558>] (warn_slowpath_fmt+0x30/0x40)
[<8002b558>] (warn_slowpath_fmt) from [<8055e0d4>] (dev_watchdog+0x2b4/0x2d8)
[<8055e0d4>] (dev_watchdog) from [<800352d8>] (call_timer_fn.isra.33+0x24/0x8c)
[<800352d8>] (call_timer_fn.isra.33) from [<800354c4>] (run_timer_softirq+0x184/0x220)
[<800354c4>] (run_timer_softirq) from [<8002f420>] (__do_softirq+0xc0/0x22c)
[<8002f420>] (__do_softirq) from [<8002f804>] (irq_exit+0xa8/0xf4)
[<8002f804>] (irq_exit) from [<8000ee5c>] (handle_IRQ+0x54/0xb4)
[<8000ee5c>] (handle_IRQ) from [<80008598>] (gic_handle_irq+0x28/0x5c)
[<80008598>] (gic_handle_irq) from [<800123c0>] (__irq_svc+0x40/0x74)
Exception stack(0x80d27f18 to 0x80d27f60)
7f00:                                                       80d27f60 0000014c
7f20: 8858c60e 0000004d 884e4540 0000004d ab7250d0 80d34348 00000000 00000000
7f40: 00000001 00000000 00000017 80d27f60 800702a4 80476e6c 600f0013 ffffffff
[<800123c0>] (__irq_svc) from [<80476e6c>] (cpuidle_enter_state+0x50/0xe0)
[<80476e6c>] (cpuidle_enter_state) from [<80476fa8>] (cpuidle_idle_call+0xac/0x154)
[<80476fa8>] (cpuidle_idle_call) from [<8000f174>] (arch_cpu_idle+0x8/0x44)
[<8000f174>] (arch_cpu_idle) from [<80064c54>] (cpu_startup_entry+0x100/0x158)
[<80064c54>] (cpu_startup_entry) from [<80cd8a9c>] (start_kernel+0x304/0x368)
---[ end trace 09ebd32fb032f86d ]---
...

There might have a race in napi_schedule(), leaving interrupts disabled forever.
After these patch, the case still work more than 40 hours running.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMLK-10006 PCI: imx6: pcie ep rc msi demo
Richard Zhu [Tue, 16 Dec 2014 04:41:48 +0000 (12:41 +0800)]
MLK-10006 PCI: imx6: pcie ep rc msi demo

- add one imx pcie ep simple skeleton driver to demo
the msi trigger capability in imx6 pcie rc/ep validation
system
- in order to avoid the modification of common codes,
force the msi address to be fixed.
(imx6sx:0x08ff8000, imx6q/dl:0x01ff8000)

Test howto on imx6sx:
(Replace the 08ff8000 by 01ff800 when imx6q/dl are used.)
- Enable CONFIG_PCI_MSI=y, when rebuild the rc/ep images

- EP side(console command and kernel message):
root@imx6sxsabresd:~# ./memtool -32 08ff8000=0
Writing 32-bit value 0x0 to address 0x08FF8000

- RC side(console command and kernel message):
root@imx6sxsabresd:~# cat /proc/interrupts  | grep MSI
384:          1   PCI-MSI

Signed-off-by: Richard Zhu <r65037@freescale.com>
9 years agoMLK-10005 PCI: imx6:enable pcie ep rc validation system
Richard Zhu [Fri, 17 Oct 2014 05:05:03 +0000 (13:05 +0800)]
MLK-10005 PCI: imx6:enable pcie ep rc validation system

hw setup:
* two imx6q sd (imx6sx sdb) boards, one is used as pcie rc,
the other is used as pcie ep. Connected by fsl pcie adap
adaptors.

sw setup:
* when build rc image, make sure that
  CONFIG_IMX_PCIE=y
  # CONFIG_EP_MODE_IN_EP_RC_SYS is not set
  CONFIG_RC_MODE_IN_EP_RC_SYS=y
* when build ep image
  CONFIG_EP_MODE_IN_EP_RC_SYS=y
  # CONFIG_RC_MODE_IN_EP_RC_SYS is not set

features:
* set-up link between rc and ep by their stand-alone
ref clk running internally.

* in ep's system, ep can access the reserved ddr memory
(default address:0x4000_0000 on imx6q sd board, and
0xb000_0000 on imx6sx sdb board) of pcie rc's system, by the
interconnection between pcie ep and pcie rc.

* add the configuration methods in the ep side, used to
configure the start address and the size of the reserved
rc's memory window.
  - cat /sys/devices/soc0/soc.1/1ffc000.pcie/rc_memw_info
  - echo 0x41000000 > /sys/devices/soc0/soc.1/1ffc000.pcie/rc_memw_start_set
  - echo 0x800000 > /sys/devices/soc0/soc.1/1ffc000.pcie/rc_memw_size_set

* provide one example, howto configure the bar# and so on,
when pcie ep emaluates one memory ram ep device

* setup one new outbound memory region at rc side, used
to let imx6 pcie rc can access the memory of imx6 pcie ep
in imx6 pcie rc ep validation system.
  - set the default address of the ddr memory to be 0x4000_0000
  on imx6q sd board, and 0xb000_0000 on imx6sx sdb board.

NOTE:
* boot up ep platform firstly, then boot up rc platform.
* make sure that mem=768M is contained in the kernel command line,
since the start address of the upper 256mb of the 1g ddr mem is
reserved to do the pcie ep rc access operations in default.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
9 years agoMLK-10008 ARM: imx6qdl: Enable pcie on imx6qdl sabreauto
Richard Zhu [Tue, 23 Sep 2014 02:25:01 +0000 (10:25 +0800)]
MLK-10008 ARM: imx6qdl: Enable pcie on imx6qdl sabreauto

- enable pcie on imx6qdl sabreauto boards.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
9 years agoMLK-10009-9 ARM: imx6sx: Enable pcie on imx6sx sdb board
Richard Zhu [Wed, 24 Sep 2014 05:16:02 +0000 (13:16 +0800)]
MLK-10009-9 ARM: imx6sx: Enable pcie on imx6sx sdb board

Enable pcie on imx6sx sdb board.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
9 years agoMLK-10009-8 PCI: imx6: Add imx6sx pcie support
Richard Zhu [Fri, 26 Sep 2014 08:53:31 +0000 (16:53 +0800)]
MLK-10009-8 PCI: imx6: Add imx6sx pcie support

- imx6sx pcie has its own standalone pcie power supply.
In order to turn on the imx6sx pcie power during
initialization. Add the pcie regulator and the gpc regmap
into the imx6sx pcie structure.
- imx6sx pcie has the new added reset mechanism, add the
reset operations into the initialization.
- register one PM call-back, enter/exit L2 state during
system suspend/resume.
use noirq pm_ops instead of the general pm_ops in dev_pm_ops,
since cfg read/write may occurs after suspend and before resume.
do msi store/re-store in suspend/resume callbacks, since
controller maybe turned off, and these msi cfg maybe lost
in suspend.
- disp_axi clock is required by pcie inbound axi port actually.
Add one more clock named pcie_inbound_axi for imx6sx pcie.
- host init maybe failed, return negative value when
there is a failure in the host init.
- assert per-reset in suspend, and de-assert it in resume.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
9 years agoMLK-10009-7 PCI: imx6: Wait the clocks to stabilize after ref_en
Richard Zhu [Tue, 23 Sep 2014 02:25:40 +0000 (10:25 +0800)]
MLK-10009-7 PCI: imx6: Wait the clocks to stabilize after ref_en

For boards without a reset gpio we skip the delay between enabling
the pcie_ref_clk and touching the RC registers for configuration.
System would be hangs when the clocks are not yet settled in the DW
PCIe core. So we need to make sure that there is always an
appropriate delay between those two actions.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
9 years agoMLK-10009-6 PCI: designware: Fix one potential assignment error of cfg start
Richard Zhu [Tue, 30 Sep 2014 08:11:57 +0000 (16:11 +0800)]
MLK-10009-6 PCI: designware: Fix one potential assignment error of cfg start

if va_cfg0_base/va_cfg1_base are initialized by
designware core, the pp->cfg.start is not initialized
properly, when IORESOURCE_MEM "config" is represented
as cfg space resource.
solution: assign cfg_res->start to pp->cfg.start.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
9 years agoMLK-10009-5 PCI: designware: Set func type of host init to int
Richard Zhu [Mon, 13 Oct 2014 06:42:38 +0000 (14:42 +0800)]
MLK-10009-5 PCI: designware: Set func type of host init to int

host init maybe failed, change the func type of host_init
defined in struct pci_host_ops from void to int.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
9 years agoMLK-10009-4 PCI: designware: Refine setup_rc and add msi data restore
Richard Zhu [Fri, 26 Sep 2014 08:54:02 +0000 (16:54 +0800)]
MLK-10009-4 PCI: designware: Refine setup_rc and add msi data restore

- move "program correct class for RC" from dw_pcie_host_init()
to dw_pcie_setup_rc(). since this is RC setup, it's
better to contained in dw_pcie_setup_rc function.
Then, RC can be re-setup really by dw_pcie_setup_rc().
- add one store/re-store msi cfg functions. Because that
pcie controller maybe powered off during system suspend,
and the msi data configuration would be lost.
these functions can be used to store/restore the msi data
and msi_enable during the suspend/resume callback.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
9 years agoMLK-10009-3 ARM: imx6: Update dts and binding for imx6sx pcie
Richard Zhu [Mon, 22 Sep 2014 09:50:59 +0000 (17:50 +0800)]
MLK-10009-3 ARM: imx6: Update dts and binding for imx6sx pcie

- imx6sx pcie phy has its own power regulator. Add the
pcie phy power suppy into im6sx pcie dts and binding.
- in order to align with imx6qdl's pcie dts, re-format
imx6sx pcie dts.
- in order to align with imx6qdl pcie dts format and
keep clean of imx6 pcie driver, keep the pcie phy clock
in imx6sx pcie dts, although it's the parent clk of the
pcie bus clock now, and would be enabled automatically
when pcie bus clock is enabled. secondly, it's
possible that the external osc maybe used as source
of the pcie_bus clk in board design in future.
- disp_axi clock is required by pcie inbound axi port.
Add one more clock named pcie_inbound_axi for imx6sx pcie.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
9 years agoMLK-10009-2 ARM: imx6sx: Add imx6sx pcie related gpr bits definitions
Richard Zhu [Thu, 16 Oct 2014 06:54:40 +0000 (14:54 +0800)]
MLK-10009-2 ARM: imx6sx: Add imx6sx pcie related gpr bits definitions

Add imx6sx pcie related gpr bits definitions.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
9 years agoMLK-10009-1 ARM: imx6sx: Add syscon into gpc dts
Richard Zhu [Wed, 24 Sep 2014 08:11:53 +0000 (16:11 +0800)]
MLK-10009-1 ARM: imx6sx: Add syscon into gpc dts

In order to manipulate gpc bits for imx6sx
pcie in driver, add syscon into gpc dts

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
9 years agoPCI: imx6: Delay enabling reference clock for SS until it stabilizes
Tim Harvey [Fri, 8 Aug 2014 06:36:40 +0000 (23:36 -0700)]
PCI: imx6: Delay enabling reference clock for SS until it stabilizes

According to the IMX6 reference manuals, REF_SSP_EN (Reference clock enable
for SS function) must remain deasserted until the reference clock is
running at the appropriate frequency.

Delay enabling the reference clock for the SS function until it has
stabilized.  This prevents a high link failure rate (>5%) on certain IMX6
boards at various temperatures.

[bhelgaas: reword changelog slightly]
Tested-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
(cherry picked from commit 3fce0e882f61513c45c67e15bd0fde03341b58a5)

9 years agoPCI: imx6: Probe in module_init(), not fs_initcall()
Lucas Stach [Fri, 5 Sep 2014 15:36:48 +0000 (09:36 -0600)]
PCI: imx6: Probe in module_init(), not fs_initcall()

This effectively reverts f216f57ffe6e ("PCI: imx6: Probe the PCIe in
fs_initcall()") as the resource allocation issue that prevented the driver
from working properly at module_initcall level is now fixed in
pcie-designware.c.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Richard Zhu <r65037@freescale.com>
(cherry picked from commit 61da50da903fdfc00b40f3b3e3abeca7ae51b591)

9 years agoPCI: designware: Remove pci_assign_unassigned_resources() from dw_pcie_host_init()
Lucas Stach [Wed, 23 Jul 2014 17:52:40 +0000 (19:52 +0200)]
PCI: designware: Remove pci_assign_unassigned_resources() from dw_pcie_host_init()

The pci_common_init_dev() call right before will already handle the device
resource allocation, so this call was a no-op.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Mohit Kumar <mohit.kumar@st.com>
(cherry picked from commit 8ddebc4103e6544bd31f0c97e55491387717a124)

9 years agoPCI: designware: Use pci_create_root_bus() instead of pci_scan_root_bus()
Lucas Stach [Wed, 23 Jul 2014 17:52:39 +0000 (19:52 +0200)]
PCI: designware: Use pci_create_root_bus() instead of pci_scan_root_bus()

Use pci_create_root_bus() similar to other PCI host controller drivers.

The main problem with pci_scan_root_bus() is that it not only creates the
root bus, but also activates all devices on the bus.  This triggers PCI
device driver probe routines, which fail because resources haven't been
allocated.

To work around this we made sure that the host controller driver is probed
early and finishes resource allocation before any other device drivers are
registered.  Switching to pci_create_root_bus() allows us to get rid of
this special handling.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Pratyush Anand <pratyush.anand@st.com>
Acked-by: Mohit Kumar <mohit.kumar@st.com>
(cherry picked from commit 92483df2bad7649caacad60ec7b0f8016e894e11)

9 years agoPCI: designware: Parse bus-range property from devicetree
Lucas Stach [Wed, 23 Jul 2014 17:52:38 +0000 (19:52 +0200)]
PCI: designware: Parse bus-range property from devicetree

This allows to explicitly specify the covered bus numbers in the
devicetree, which will come in handy once we see a SoC with more than one
PCIe host controller instance.

Previously the driver relied on the behavior of pci_scan_root_bus() to fill
in a range of 0x00-0xff if no valid range was found.  We fall back to the
same range if no valid DT entry was found to keep backwards compatibility,
but now do it explicitly.

[bhelgaas: use %pR in error message to avoid duplication]
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Pratyush Anand <pratyush.anand@st.com>
Acked-by: Mohit Kumar <mohit.kumar@st.com>
(cherry picked from commit 4f2ebe00597c44f7dc6f88a052a2981ddcf6a0b6)

9 years agoPCI: imx6: Put LTSSM in "Detect" state before disabling it
Lucas Stach [Thu, 31 Jul 2014 18:16:05 +0000 (20:16 +0200)]
PCI: imx6: Put LTSSM in "Detect" state before disabling it

This fixes a boot hang observed when the bootloader already enabled the
PCIe link for its own use.  The fundamental problem is that Freescale
forgot to wire up the core reset, so software doesn't have a sane way to
get the core into a defined state.

According to the DW PCIe core reference manual, configuration of the core
may only happen when the LTSSM is disabled, so this is one of the first
things we need to do.  Apparently this isn't safe to do when the LTSSM is in
any state other than "detect" as we observe an instant machine hang when
trying to do so while the link is already up.

As a workaround, force LTSSM into detect state right before hitting the
disable switch.  There is still a race window because the LTSSM may
transition out of "detect" before we can disable it, but it's the best
we can do for now.

[bhelgaas: mention race window]
Link: http://lkml.kernel.org/r/1406830565-23450-3-git-send-email-l.stach@pengutronix.de
Reported-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Tim Harvey <tharvey@gateworks.com>
(cherry picked from commit 3e3e406e3807235906ee0b7c697664ea6dfd88de)

9 years agoPCI: designware: Add support for v3.65 hardware
Murali Karicheri [Wed, 23 Jul 2014 18:54:51 +0000 (14:54 -0400)]
PCI: designware: Add support for v3.65 hardware

The Keystone PCI controller is based on v3.65 DesignWare hardware.  This
version differs from newer versions of the hardware in functional areas
discussed below that make it necessary to change dw_pcie_host_init() to
support v3.65 based PCI controller.

    1. No support for ATU port.  Any ATU-specific resource handling code is
       to be bypassed for v3.65 h/w.

    2. MSI controller uses application space to implement MSI and 32 MSI
       interrupts are multiplexed over 8 IRQs to the host.  Hence the code
       to process MSI IRQ needs to be different.  This patch allows
       platform driver to provide its own irq_domain_ops ptr to
       irq_domain_add_linear() through an API callback from the DesignWare
       core driver.

    3. MSI interrupt generation requires EP to write to the RC's
       application register.  So enhance the driver to allow setup of
       inbound access to MSI IRQ register as a post scan bus API callback.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Pratyush Anand <pratyush.anand@st.com>
Acked-by: Mohit KUMAR <mohit.kumar@st.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
CC: Russell King <linux@arm.linux.org.uk>
CC: Grant Likely <grant.likely@linaro.org>
CC: Rob Herring <robh+dt@kernel.org>
CC: Jingoo Han <jg1.han@samsung.com>
CC: Richard Zhu <r65037@freescale.com>
CC: Kishon Vijay Abraham I <kishon@ti.com>
CC: Marek Vasut <marex@denx.de>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Pawel Moll <pawel.moll@arm.com>
CC: Mark Rutland <mark.rutland@arm.com>
CC: Ian Campbell <ijc+devicetree@hellion.org.uk>
CC: Kumar Gala <galak@codeaurora.org>
CC: Randy Dunlap <rdunlap@infradead.org>
CC: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit b14a3d1784a9252aa3bbe0bb9d14588be32f18a1)

9 years agoPCI: designware: Add MSI-related pcie_host_ops for v3.65 hardware
Murali Karicheri [Mon, 21 Jul 2014 16:58:42 +0000 (12:58 -0400)]
PCI: designware: Add MSI-related pcie_host_ops for v3.65 hardware

DesignWare v3.65 hardware implements MSI controller registers in
application space.  This requires updates to the DesignWare core to
support controllers based on this older hardware.

Add msi_irq_set()/clear() interfaces to allow Set/Clear MSI IRQ enable bit
in the application register.  Also, v3.65 hardware uses the MSI_IRQ
register in application register space to raise MSI IRQ to the RC from EP.
Current code uses the standard mechanism as per PCI spec.  So add
get_msi_data() to get the address of this register so common code can
work on both v3.65 and newer hardware.

[bhelgaas: changelog]
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Pratyush Anand <pratyush.anand@st.com>
Acked-by: Mohit Kumar <mohit.kumar@st.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
CC: Russell King <linux@arm.linux.org.uk>
CC: Grant Likely <grant.likely@linaro.org>
CC: Rob Herring <robh+dt@kernel.org>
CC: Richard Zhu <r65037@freescale.com>
CC: Kishon Vijay Abraham I <kishon@ti.com>
CC: Marek Vasut <marex@denx.de>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Pawel Moll <pawel.moll@arm.com>
CC: Mark Rutland <mark.rutland@arm.com>
CC: Ian Campbell <ijc+devicetree@hellion.org.uk>
CC: Kumar Gala <galak@codeaurora.org>
CC: Randy Dunlap <rdunlap@infradead.org>
CC: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 2f37c5a81cff2c341fa19fdd132ece6aea30a735)

9 years agoPCI: designware: Add config access-related pcie_host_ops for v3.65 hardware
Murali Karicheri [Mon, 21 Jul 2014 16:58:41 +0000 (12:58 -0400)]
PCI: designware: Add config access-related pcie_host_ops for v3.65 hardware

DesignWare v3.65 hardware requires application space registers to be
configured to access the remote EP config space.

To support this, add rd_other_conf() and wr_other_conf() to pcie_host_ops.

[bhelgaas: changelog]
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Pratyush Anand <pratyush.anand@st.com>
Acked-by: Mohit Kumar <mohit.kumar@st.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
CC: Russell King <linux@arm.linux.org.uk>
CC: Grant Likely <grant.likely@linaro.org>
CC: Rob Herring <robh+dt@kernel.org>
CC: Richard Zhu <r65037@freescale.com>
CC: Kishon Vijay Abraham I <kishon@ti.com>
CC: Marek Vasut <marex@denx.de>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Pawel Moll <pawel.moll@arm.com>
CC: Mark Rutland <mark.rutland@arm.com>
CC: Ian Campbell <ijc+devicetree@hellion.org.uk>
CC: Kumar Gala <galak@codeaurora.org>
CC: Randy Dunlap <rdunlap@infradead.org>
CC: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit a1c0ae9c24627a12c781ebd9947a6442861f6168)

9 years agoPCI: dra7xx: Add TI DRA7xx PCIe driver
Kishon Vijay Abraham I [Tue, 22 Jul 2014 21:23:45 +0000 (15:23 -0600)]
PCI: dra7xx: Add TI DRA7xx PCIe driver

Add support for PCIe controller in DRA7xx.  This driver re-uses the
designware core code that is already present in kernel.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Mohit Kumar <mohit.kumar@st.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Arnd Bergmann <arnd@arndb.de>
(cherry picked from commit 47ff3de911a728cdf9ecc6ad777131902cff62b4)

9 years agoPCI: designware: Program ATU with untranslated address
Kishon Vijay Abraham I [Thu, 17 Jul 2014 09:00:41 +0000 (14:30 +0530)]
PCI: designware: Program ATU with untranslated address

In DRA7, the CPU sees 32-bit addresses, but the PCIe controller can see
only 28-bit addresses.  So whenever the CPU issues a read/write request,
the 4 most significant bits are used by L3 to determine the target
controller.  For example, the CPU reserves [mem 0x20000000-0x2fffffff]
for the PCIe controller but the PCIe controller will see only
[0x00000000-0x0fffffff].  For programming the outbound translation
window the *base* should be programmed as 0x00000000.  Whenever we try to
write to, e.g., 0x20000000, it will be translated to whatever we have
programmed in the translation window with base as 0x00000000.

This is needed when the dt node is modelled something like this:

    axi {
        compatible = "simple-bus";
        #size-cells = <1>;
        #address-cells = <1>;
        ranges = <0x0        0x20000000 0x10000000 // 28-bit bus
                  0x51000000 0x51000000 0x3000>;
        pcie@51000000 {
                reg = <0x1000 0x2000>, <0x51002000 0x14c>, <0x51000000 0x2000>;
                reg-names = "config", "ti_conf", "rc_dbics";
                #address-cells = <3>;
                #size-cells = <2>;
                ranges = <0x81000000 0 0          0x03000 0 0x00010000
                          0x82000000 0 0x20013000 0x13000 0 0xffed000>;
        };
    };

Here the CPU address for configuration space is 0x20013000 and the
controller address for configuration space is 0x13000.  The controller
address should be used while programming the ATU (in order for translation
to happen properly in DRA7xx).

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Mohit Kumar <mohit.kumar@st.com>
Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Arnd Bergmann <arnd@arndb.de>
(cherry picked from commit f4c55c5a3f7f68c06cc559ed7af8b2d017cbb0a7)

9 years agoPCI: designware: Look for configuration space in 'reg', not 'ranges'
Kishon Vijay Abraham I [Thu, 17 Jul 2014 09:00:40 +0000 (14:30 +0530)]
PCI: designware: Look for configuration space in 'reg', not 'ranges'

The configuration address space has so far been specified in *ranges*,
however it should be specified in *reg* making it a platform MEM resource.
Hence used 'platform_get_resource_*' API to get configuration address space
in the designware driver.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Mohit Kumar <mohit.kumar@st.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Arnd Bergmann <arnd@arndb.de>
(cherry picked from commit 4dd964df36d0e548e1806ec2ec275b62d4dc46e8)

9 years agoPCI: designware: Split Exynos and i.MX bindings
Lucas Stach [Tue, 3 Jun 2014 14:44:25 +0000 (08:44 -0600)]
PCI: designware: Split Exynos and i.MX bindings

The glue around the core designware IP is significantly different between
the Exynos and i.MX implementation, which is reflected in the DT bindings.

This changes the i.MX6 binding to reuse as much as possible from the common
designware binding and removes old cruft.

I removed the optional GPIOs with the following reasoning:
- disable-gpio: endpoint specific GPIO, not currently wired up in any code.
  Should be handled by the PCI device driver, not the host controller
  driver.
- wake-up-gpio: same as above.
- power-on-gpio: No user in any upstream DT.  This should be handled by a
  regulator which shouldn't be controlled by the host driver, but rather by
  the PCI device driver.

[bhelgaas: whitespace fixes]
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
(cherry picked from commit 1db823ee9f677e1a863cd04fda391a7520fcd0e8)

9 years agoPCI: mvebu: Remove ARCH_KIRKWOOD dependency
Andrew Lunn [Thu, 10 Jul 2014 21:36:29 +0000 (23:36 +0200)]
PCI: mvebu: Remove ARCH_KIRKWOOD dependency

mach-kirkwood has been removed, now that kirkwood lives in mach-mvebu.
ARCH_MVEBU is sufficient.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
(cherry picked from commit c27602086d08d22b067a1267e09fb32b4b096aa0)

9 years agoPCI: spear: Add PCIe driver for ST Microelectronics SPEAr13xx
Pratyush Anand [Tue, 11 Feb 2014 06:09:26 +0000 (11:39 +0530)]
PCI: spear: Add PCIe driver for ST Microelectronics SPEAr13xx

ARM based ST Microelectronics's SPEAr1310 and SPEAr1340 SOCs have onchip
designware PCIe controller. To make that usable, this patch adds a wrapper
driver based on existing designware driver.

Adds bindings for this new driver and update MAINTAINERS as well.

Cc: linux-pci@vger.kernel.org
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
Signed-off-by: Mohit Kumar <mohit.kumar@st.com>
[viresh: fixed logs/cclist/checkpatch warnings, broken into smaller patches]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
(cherry picked from commit 51b66a6ce12570e5ee1a249c811f7f2d74814a43)

Conflicts:
MAINTAINERS

9 years agoPCI: generic: Add generic PCI host controller driver
Will Deacon [Fri, 22 Nov 2013 16:14:41 +0000 (16:14 +0000)]
PCI: generic: Add generic PCI host controller driver

Add support for a generic PCI host controller, such as a
firmware-initialised device with static windows or an emulation by
something such as kvmtool.

The controller itself has no configuration registers and has its address
spaces described entirely by the device-tree (using the bindings from
ePAPR).  Both CAM and ECAM are supported for Config Space accesses.

Add corresponding documentation for the DT binding.

[bhelgaas: currently uses the ARM-specific pci_common_init_dev() interface]
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
(cherry picked from commit ce292991d88b77160f348fb8a3a2cf6e78f4b456)

Conflicts:
drivers/pci/host/Kconfig
drivers/pci/host/Makefile

9 years agoPCI: imx6: Add support for MSI
Lucas Stach [Fri, 28 Mar 2014 16:52:59 +0000 (17:52 +0100)]
PCI: imx6: Add support for MSI

This patch adds support for Message Signaled Interrupts in the imx6-pcie
driver.

Signed-off-by: Harro Haan <hrhaan@gmail.com>
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Richard Zhu <r65037@freescale.com>
(cherry picked from commit d1dc9749a5b8239d9ae718a176b5cd39ff89f976)

9 years agoPCI: designware: Make MSI ISR shared IRQ aware
Lucas Stach [Fri, 28 Mar 2014 16:52:58 +0000 (17:52 +0100)]
PCI: designware: Make MSI ISR shared IRQ aware

On i.MX6 the host controller MSI IRQ is shared with PCI legacy INTD.  Make
sure we don't bail too early from the IRQ handler.

The issue is fairly theoretical as it would require a system setup with a
PCIe switch where one connected device is using legacy INTD and another one
using MSI, but better fix it now.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Richard Zhu <r65037@freescale.com>
(cherry picked from commit 7f4f16eef5aeba31bdfb7702ced06a42f2777e04)

9 years agoPCI: imx6: Remove optional (and unused) IRQs
Lucas Stach [Fri, 28 Mar 2014 16:52:57 +0000 (17:52 +0100)]
PCI: imx6: Remove optional (and unused) IRQs

They are dropped with the new binding.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Richard Zhu <r65037@freescale.com>
(cherry picked from commit 5c40eea7783bbcdd5795cd7d50b7b3fd9a94dc94)

9 years agoPCI: imx6: Drop old IRQ mapping
Lucas Stach [Fri, 28 Mar 2014 16:52:56 +0000 (17:52 +0100)]
PCI: imx6: Drop old IRQ mapping

We don't need this anymore.  The IRQs are now properly mapped through the
DT.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Richard Zhu <r65037@freescale.com>
(cherry picked from commit e521519a84f6d796d3cff756969cd5902c9550dd)

9 years agoPCI: imx6: Use new clock names
Lucas Stach [Fri, 28 Mar 2014 16:52:55 +0000 (17:52 +0100)]
PCI: imx6: Use new clock names

As defined in the new binding.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Richard Zhu <r65037@freescale.com>
(cherry picked from commit 57526136532408bacf2f68c26027abc2924b45d1)

9 years agoPCI: imx6: Fix imx6_add_pcie_port() section mismatch warning
Sachin Kamat [Fri, 30 May 2014 06:38:48 +0000 (12:08 +0530)]
PCI: imx6: Fix imx6_add_pcie_port() section mismatch warning

imx6_add_pcie_port() is called only from from imx6_pcie_probe() which is
annotated with __init.  Thus it makes sense to annotate
imx6_add_pcie_port() with __init to avoid section mismatch warnings.

[bhelgaas: changelog]
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Sean Cross <xobs@kosagi.com>
(cherry picked from commit 44cb5e94f96cef72a977fc5fdea8095bc0ae25ba)

9 years agoPCI: exynos: Fix add_pcie_port() section mismatch warning
Sachin Kamat [Wed, 28 May 2014 09:48:45 +0000 (15:18 +0530)]
PCI: exynos: Fix add_pcie_port() section mismatch warning

add_pcie_port() is called only from exynos_pcie_probe(), which is annotated
with __init.  Thus it makes sense to annotate add_pcie_port() with __init
to avoid the following section mismatch warning:

  WARNING: drivers/pci/built-in.o(.text.unlikely+0xf8): Section mismatch in reference from the function add_pcie_port() to the function .init.text:dw_pcie_host_init()
    The function add_pcie_port() references
    the function __init dw_pcie_host_init().
    This is often because add_pcie_port lacks a __init
    annotation or the annotation of dw_pcie_host_init is wrong.

[bhelgaas: changelog]
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
(cherry picked from commit 17d7acc8e1c81f8125730aa900c67412a2ac69e2)

9 years agoPCI: rcar: Add Renesas R-Car PCIe driver
Phil Edworthy [Mon, 12 May 2014 10:57:48 +0000 (11:57 +0100)]
PCI: rcar: Add Renesas R-Car PCIe driver

This PCIe Host driver currently does not support MSI, so cards fall back to
INTx interrupts.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit c25da4778803b41e11fd82dd5576c35c09b5f0e0)

9 years agoPCI: exynos: Remove unnecessary OOM messages
Jingoo Han [Fri, 9 May 2014 05:31:25 +0000 (14:31 +0900)]
PCI: exynos: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they duplicate the
MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
(cherry picked from commit 755ba5e406e5ddd876e85a881dc50c7f54a8fd6b)

9 years agoPCI: designware: Remove unnecessary use of 'conf_lock' spinlock
Andrew Murray [Mon, 14 Apr 2014 20:22:54 +0000 (14:22 -0600)]
PCI: designware: Remove unnecessary use of 'conf_lock' spinlock

Serialization of configuration accesses is provided by 'pci_lock' in
drivers/pci/access.c thus making the driver's 'conf_lock' superfluous.

Signed-off-by: Andrew Murray <amurray@embedded-bits.co.uk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Richard Zhu <r65037@freescale.com>
(cherry picked from commit 11c6fbd8d982617996fbc39097a84092eb6e8005)

9 years agoPCI: designware: Use new OF interrupt mapping when possible
Lucas Stach [Wed, 5 Mar 2014 13:25:51 +0000 (14:25 +0100)]
PCI: designware: Use new OF interrupt mapping when possible

Use new OF interrupt mapping (of_irq_parse_and_map_pci()) when possible.
This is the recommended method of doing the IRQ mapping.  For old
devicetrees we fall back to the previous practice.

This makes INTB, INTC, and INTD work on i.MX.

Tested-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jingoo Han <jg1.han@samsung.com>
(cherry picked from commit 804f57b1a63c7435fe43b36942581cc6c79ebb5c)

9 years agoPCI: designware: Fix comment for setting number of lanes
Mohit Kumar [Mon, 14 Apr 2014 20:22:54 +0000 (14:22 -0600)]
PCI: designware: Fix comment for setting number of lanes

Corrects comment for setting number of lanes.

Signed-off-by: Mohit Kumar <mohit.kumar@st.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
(cherry picked from commit 66c5c34bf80c28d370eb9bcf30153ea0304a288a)

9 years agopci: pcie-designware: Remove irq_desc abuse
Thomas Gleixner [Sun, 23 Feb 2014 21:40:11 +0000 (21:40 +0000)]
pci: pcie-designware: Remove irq_desc abuse

There is no reason to care about irq_desc in that context, escpecially
as irq_data for that interrupt is retrieved as well.

Use the proper accessor for the msi descriptor

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Cc: Mohit Kumar <mohit.kumar@st.com>
Cc: pci <linux-pci@vger.kernel.org>
Link: http://lkml.kernel.org/r/20140223212736.987803648@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
(cherry picked from commit f7bfca6db60a6ca0a73126918b2fb6f851065947)

9 years agoPCI: rcar: Make the Kconfig dependencies more generic
Magnus Damm [Tue, 18 Feb 2014 02:12:01 +0000 (11:12 +0900)]
PCI: rcar: Make the Kconfig dependencies more generic

Update the R-Car Generation 2 PCI driver Kconfig dependencies to follow
same style as other drivers - no SoC dependencies.

Also, update the COMPILE_TEST bits to depend on ARM. This since the DMA
bounce buffer and dma_ops handling code is ARM specific.

[bhelgaas: adjust context after dropping DMABOUNCE patches]
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit ef4741e90c4e6523795f4375659b5097293d87db)

9 years agoMLK-9996 arm: imx6: Correct the AHB clock in low_bus_freq_mode
Bai Ping [Mon, 15 Dec 2014 15:56:09 +0000 (23:56 +0800)]
MLK-9996 arm: imx6: Correct the AHB clock in low_bus_freq_mode

When the busfreq is in audio_bus_freq_mode, the AHB bus is at 8MHz,
in low_bus_freq_mode, the AHB needs to run at 24MHz. So when switching
from audio_bus_freq_mode to low_bus_freq_mode, make sure the AHB is at
24MHz in low_bus_freq_mode.

Signed-off-by: Bai Ping <b51503@freescale.com>
9 years agoASoC: hdmi: HDMI codec doesn't benefit from pmdown delay
Jyri Sarha [Tue, 14 Oct 2014 17:29:27 +0000 (20:29 +0300)]
ASoC: hdmi: HDMI codec doesn't benefit from pmdown delay

Adds .ignore_pmdown_time = true to codec driver struct.

HDMI codec is currently a dummy codec and doesn't benefit from pmdown
delay. Even if in the future the codec would controll HDMI encoder, it
would still be a digital to digital interface that should have no need
for pmdown delay.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 69434097916bc52a4d6d495a0d719eb02e0cff9e)

9 years agoASoC: hdmi: Mark the maximum significant bits to HDMI codec
Jyri Sarha [Tue, 14 Oct 2014 17:29:26 +0000 (20:29 +0300)]
ASoC: hdmi: Mark the maximum significant bits to HDMI codec

HDMI audio can not have more than 24 bits even if on i2s bus there
would be 32 bit samples. Mark this by adding .sig_bits = 24 to
playback stream definition.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 74d813cf37c210e94d155b0c19598fe269b8f78c)

9 years agoMLK-9989 arm: imx: imx_v7_mfg_defconfig: enable CONFIG_IMX_SEMA4 by default
Anson Huang [Fri, 12 Dec 2014 11:28:24 +0000 (19:28 +0800)]
MLK-9989 arm: imx: imx_v7_mfg_defconfig: enable CONFIG_IMX_SEMA4 by default

enable CONFIG_IMX_SEMA4 by default for imx_v7_mfg_defconfig.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9955-10 arm: imx: add A9-M4 power management
Anson Huang [Thu, 4 Dec 2014 04:24:49 +0000 (12:24 +0800)]
MLK-9955-10 arm: imx: add A9-M4 power management

this patch adds A9-M4 power management, including
below features:

1. busfreq: M4 is registered as a high speed device
   of A9, when M4 is running at high speed, busfreq
   will NOT enter low bus mode, when M4 is entering
   its low power idle, A9 will be able to enter low
   bus mode according to its state machine;
2. low power idle: only when M4 is in its low power
   idle, busfreq is staying at low bus mode, low
   power idle is available for kernel;
3. suspend: when M4 is NOT in its low power idle,
   when linux is about to suspend, it will only
   force SOC enter WAIT mode, only when M4 is in
   its low power idle in TCM, linux suspend can
   enter DSM mode. M4 can request/release wakeup
   source via MU to A9.

as M4 can NOT switch its clk parent due to glitch MUX,
to handle this case, A9 will help switch M4's clk
parent, the flow is as below:

M4:
1. enter low power idle, send bus use count-- to A9;
2. enter wfi and only wait for MU interrupt;
3. receive A9's clk switch ready message, go into low
   power idle;
4. receive interrupt to exit low power idle, send request
   to A9 for increase busfreq and M4 freq, enter wfi
   and only wait for MU interrupt;
5. receive A9 ready message, go out of low power idle.

A9:
1. when receive M4's message of entering low power idle,
   wait M4 into wfi, hold M4 in wfi by hardware, gate
   M4 clk, then switch M4's clk to OSC, ungate M4 clk,
   send ready command to wake up M4 into low power idle;
2. when receive M4's message of exiting low power idle,
   wait M4 into wfi, hold M4 in wfi by hardware, gate
   M4 clk, then switch M4's clk to origin high clk,
   ungate M4 clk, send ready command to wake up M4
   to exit low power idle;

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9955-9 arm: imx: add A9-M4 clk shared management
Anson Huang [Thu, 4 Dec 2014 04:22:20 +0000 (12:22 +0800)]
MLK-9955-9 arm: imx: add A9-M4 clk shared management

As A9 and M4 share many resources on i.MX6SX, especially for
clk and power related resource, so we need to handle the hardware
conflict between these two cores, there are two cases that we
need to consider currently:

clk management: for every clk node, only when both A9 and
M4 do NOT need it, then we can disable it from hardware;

Here we use MU and hardware SEMA4 to achieve our goal, MU is
for communiation between A9 and M4, SEMA4 is to protect the
shared memory.

For clk management, we use shared memory to maintain the clk
status for both A9 and M4 side, and this shared memory is
protected by hardware SEMA4, A9 and M4 will maintain their
own clk tree info in their SW environment, and get other
CORE's clk tree info from shared memory to decide whether
to perform a hardware setting change when they plan to.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9872-3 arm: imx: adjust qspi device index according to dtb setting
Anson Huang [Wed, 19 Nov 2014 06:24:16 +0000 (14:24 +0800)]
MLK-9872-3 arm: imx: adjust qspi device index according to dtb setting

When resume from DSM with Mega/Fast off, we need to restore
the right QSPI module for M4, so get the qspi index from dtb file.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9674-3 arm: imx: add QSPI save/restore when M4 is enabled
Allen Xu [Mon, 13 Oct 2014 23:15:35 +0000 (18:15 -0500)]
MLK-9674-3 arm: imx: add QSPI save/restore when M4 is enabled

As M4 is executing on QSPI2 flash, and QSPI is inside Mega/Fast
domain which may lost power in DSM, so we need to do save/restore
of QSPI2 controller to make sure QSPI flash can be accessed before
waking up M4 after exiting from DSM.

Signed-off-by: Allen Xu <b45815@freescale.com>
Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9955-8 arm: imx: add mu driver support
Anson Huang [Thu, 4 Dec 2014 02:02:15 +0000 (10:02 +0800)]
MLK-9955-8 arm: imx: add mu driver support

add MU driver support in mach-imx, all the MU functions
and communications between A9 and M4 will be done in
this file, including MCC, shared clk/power management.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9955-7 arm: dts: imx6sx: add mu support
Anson Huang [Thu, 4 Dec 2014 02:06:52 +0000 (10:06 +0800)]
MLK-9955-7 arm: dts: imx6sx: add mu support

add MU support for i.MX6SX.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9955-6 arm: dts: imx6sx: add m4 dts support
Anson Huang [Thu, 4 Dec 2014 01:58:27 +0000 (09:58 +0800)]
MLK-9955-6 arm: dts: imx6sx: add m4 dts support

1. add i.MX6SX SabreAuto board M4 dts support;
2. add shared memory node support for AMP clk/power management;
3. add qspi restore node for suspend/resume with Mega/Fast off
   when M4 is enabled and running on QSPI flash.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9955-5 arm: dts: imx6sx: add sema4 support
Anson Huang [Thu, 4 Dec 2014 02:05:38 +0000 (10:05 +0800)]
MLK-9955-5 arm: dts: imx6sx: add sema4 support

add SEMA4 support for i.MX6SX.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9955-4 arm: imx: enable CONFIG_IMX_SEMA4 by default
Anson Huang [Wed, 3 Dec 2014 07:13:56 +0000 (15:13 +0800)]
MLK-9955-4 arm: imx: enable CONFIG_IMX_SEMA4 by default

enable CONFIG_IMX_SEMA4 by default.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9955-3 arm: imx: add HAVE_IMX_AMP for imx6sx
Anson Huang [Thu, 4 Dec 2014 01:51:27 +0000 (09:51 +0800)]
MLK-9955-3 arm: imx: add HAVE_IMX_AMP for imx6sx

add HAVE_IMX_AMP and select by default for i.MX6SX.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9955-2 driver: char: sema4: rename sema4 driver diretory
Anson Huang [Wed, 3 Dec 2014 07:25:59 +0000 (15:25 +0800)]
MLK-9955-2 driver: char: sema4: rename sema4 driver diretory

as sema4 is a common driver for amp system, not just
for mcc, so rename sema4 diretory from imx_mcc
to imx_amp.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9955-1 arm: imx: add necessary mcc header file
Anson Huang [Thu, 4 Dec 2014 02:07:40 +0000 (10:07 +0800)]
MLK-9955-1 arm: imx: add necessary mcc header file

add necessary mcc header file for mcc and sema4.

Acked-by: Jason Liu
Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-9870 mcc: sema4: mutex lock should be initiazled
Richard Zhu [Tue, 18 Nov 2014 02:20:03 +0000 (10:20 +0800)]
MLK-9870 mcc: sema4: mutex lock should be initiazled

mutex lock should be initialized, otherwise
there maybe kernel BUG warning.
"BUG: spinlock bad magic on CPU#0, swapper/0/1"

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
(cherry picked from commit 5db690b478afea00ca226f200ddf892b691674dd)

9 years agoMLK-9707-5 arm: mcc: mcc2.0 sema4 related changes
Richard Zhu [Mon, 20 Oct 2014 07:40:18 +0000 (15:40 +0800)]
MLK-9707-5 arm: mcc: mcc2.0 sema4 related changes

imx sema4 driver changes in mcc2.0 updates

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
9 years agoENGR00308060-3 mcc: add sema4 driver required by mcc
Richard Zhu [Fri, 11 Apr 2014 07:11:14 +0000 (15:11 +0800)]
ENGR00308060-3 mcc: add sema4 driver required by mcc

- add linux sema4 driver, that mandatory required by mcc.
  - use volatile types in sema4 structure
  - align the port definiton a9 is 1, m4 is 2.

Signed-off-by: Richard Zhu <r65037@freescale.com>
9 years agonet: fec: only enable mdio interrupt before phy device link up
Nimrod Andy [Thu, 11 Dec 2014 01:20:33 +0000 (09:20 +0800)]
net: fec: only enable mdio interrupt before phy device link up

Before phy device link up, we only enable FEC mdio interrupt, which
is more reasonable.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: clear all interrupt events to support i.MX6SX
Nimrod Andy [Thu, 11 Dec 2014 01:20:32 +0000 (09:20 +0800)]
net: fec: clear all interrupt events to support i.MX6SX

For i.MX6SX FEC controller, there have interrupt mask and event
field extension. To support all SOCs FEC, we clear all interrupt
events during MAVC initial process.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>