]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
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>
9 years agonet: fec: reset fep link status in suspend function
Nimrod Andy [Thu, 11 Dec 2014 01:20:31 +0000 (09:20 +0800)]
net: fec: reset fep link status in suspend function

On some i.MX6 serial boards, phy power and refrence clock are supplied
or controlled by SOC. When do suspend/resume test, the power and clock
are disabled, so phy device link down.

For current driver, fep->link is still up status, which cause extra operation
like below code. To avoid the dumy operation, we set fep->link to down when
phy device is real down.
...
if (fep->link) {
napi_disable(&fep->napi);
netif_tx_lock_bh(ndev);
fec_stop(ndev);
netif_tx_unlock_bh(ndev);
napi_enable(&fep->napi);
fep->link = phy_dev->link;
status_change = 1;
}
...

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMLK-9969 dts: Enable subdev csi driver in imx6sx AI board
Sandor Yu [Mon, 8 Dec 2014 08:01:44 +0000 (16:01 +0800)]
MLK-9969 dts: Enable subdev csi driver in imx6sx AI board

Enable OV5640, VADC and CSI driver in imx6sx AI board

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-9968 dts: Enable subdev csi driver in imx6sx SDB board
Sandor Yu [Mon, 8 Dec 2014 07:59:56 +0000 (15:59 +0800)]
MLK-9968 dts: Enable subdev csi driver in imx6sx SDB board

Enable OV5640, VADC and CSI driver in imx6sx SDB board

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-9919 net: fec: reinit MAC0 MII bus for MAC1 use after resume back
Fugang Duan [Wed, 10 Dec 2014 05:46:08 +0000 (13:46 +0800)]
MLK-9919 net: fec: reinit MAC0 MII bus for MAC1 use after resume back

i.MX6SX-AI board has two enet MACs (MAC0 and MAC1), they share MAC0 MII
bus. When PHY0 don't connect to enet MAC0, MAC0 mii bus probe phy0 failed,
and the net interface is set to unattach mode. During suspend resume test,
driver don't reinit MAC0 after resume back, so MII bus don't work that causes
MAC1 also cannot access PHY1.

The patch just is workaround that reinit MAC0 MII bus for MAC1 using.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoENGR00305366-01 net: fec: disable netfilter in default
Fugang Duan [Wed, 10 Dec 2014 04:41:17 +0000 (12:41 +0800)]
ENGR00305366-01 net: fec: disable netfilter in default

Disable netfilter feature for enet can increase 30Mbps bandwidth
for imx6sx enet tx path.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoENGR00306137 ARM: imx_v7_defconfig: enable 802.2 LLC
Fugang Duan [Wed, 10 Dec 2014 04:34:11 +0000 (12:34 +0800)]
ENGR00306137 ARM: imx_v7_defconfig: enable 802.2 LLC

Enable IEEE 802.2 LLC protocol.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-9977 ARM: dts: imx6sx: specify the phy address
Fugang Duan [Mon, 13 Oct 2014 09:17:27 +0000 (17:17 +0800)]
MLK-9977 ARM: dts: imx6sx: specify the phy address

Since fec controller contain mdio bus,  for imx serial chips, there have
no independent/external MDIO bus. ENET1 and ENET2 share use ENET1 mdio bus.
So, specify the phy address for two MACs.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agonet: fec: avoid kernal crash by NULL pointer when no phy connection
Nimrod Andy [Tue, 9 Dec 2014 10:46:56 +0000 (18:46 +0800)]
net: fec: avoid kernal crash by NULL pointer when no phy connection

On i.MX6SX sabreauto board, when there have no phy daughter board connection,
there have kernel crash by NULL pointer:

fec 2188000.ethernet eth0: could not attach to PHY
Unable to handle kernel NULL pointer dereference at virtual address 00000220
pgd = 80004000
[00000220] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.14.24-01042-g27eaeea-dirty #405
task: d8078000 ti: d8076000 task.ti: d8076000
PC is at mutex_lock+0x10/0x54
LR is at phy_start+0x14/0x68
pc : [<806ad4e4>]    lr : [<803b0f90>]    psr: 60000113
sp : d8077d80  ip : 00000000  fp : d83cc000
r10: 0000100c  r9 : d83cc800  r8 : 00000000
r7 : d83bcd0c  r6 : 00000200  r5 : 00000220  r4 : 00000220
r3 : 00000000  r2 : 00000000  r1 : d83bcd90  r0 : 00000220
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 8000404a  DAC: 00000015
Process swapper/0 (pid: 1, stack limit = 0xd8076240)
Stack: (0xd8077d80 to 0xd8078000)
7d80: 00000000 803b0f90 00000001 00000000 d83bc800 803be034 00000007 805c3fb4
7da0: 00000003 80d4e0bc 805efcb8 fffffff1 fffffff0 00000000 00000000 d8077dfc
7dc0: 0000000d 80d6ce80 80d126b0 800499c8 d83bc800 d83bc800 806f0f40 d83bc82c
7de0: 00000000 00000000 80d6ce80 80d126b0 0000016b 80540250 d8076008 d83bc800
7e00: 0000016b d83bc800 00001003 00000001 00001002 805404d4 d83bc800 00000120
7e20: 00001002 00001002 00000000 805405d4 d83bc800 00000001 80d126c0 00001002
7e40: 80dbc5dc 80d02024 00000000 806ae360 00000002 d6128420 d6127198 12400000
7e60: 00000000 00000000 00000002 d61271e8 00000000 12400000 d801674c 800e49f0
7e80: d6127198 d6124e58 00000000 80238848 d61271c4 00000000 00000001 d8016700
7ea0: 80dd2e00 80d752c0 80d752c0 80cfdaec 0000010c 80239430 806c2e90 d800f080
7ec0: d800f380 804e46b4 ffffffbc 80d15cb0 00000007 80d752c0 80d752c0 80d01e94
7ee0: 0000010c d8076030 00000000 800088cc 80dbaba4 80bd411c d80a6f00 806b1e04
7f00: 00000000 00000000 00000000 80125b84 00000000 80d2c56c 60000113 00000001
7f20: ef7ff9df 806c80cc 0000010c 80043f5c 80c95eb8 00000007 ef7ffa1d 00000007
7f40: 80d2c55c 80d15cb0 00000007 80d752c0 80d752c0 80ccc50c 0000010c 80d0a114
7f60: 80d0a10c 80cccc04 00000007 00000007 80ccc50c 806ae410 00000000 8004cb84
7f80: 80d17bc0 00000000 806a4bd4 00000000 00000000 00000000 00000000 00000000
7fa0: 00000000 806a4bdc 00000000 8000e5f8 00000000 00000000 00000000 00000000
7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 1e79a7bb e5337f77
[<806ad4e4>] (mutex_lock) from [<803b0f90>] (phy_start+0x14/0x68)
[<803b0f90>] (phy_start) from [<803be034>] (fec_enet_open+0x448/0x5dc)
[<803be034>] (fec_enet_open) from [<80540250>] (__dev_open+0xa8/0x110)
[<80540250>] (__dev_open) from [<805404d4>] (__dev_change_flags+0x88/0x170)
[<805404d4>] (__dev_change_flags) from [<805405d4>] (dev_change_flags+0x18/0x48)
[<805405d4>] (dev_change_flags) from [<80d02024>] (ip_auto_config+0x190/0xf94)
[<80d02024>] (ip_auto_config) from [<800088cc>] (do_one_initcall+0xe8/0x144)
[<800088cc>] (do_one_initcall) from [<80cccc04>] (kernel_init_freeable+0x104/0x1c8)
[<80cccc04>] (kernel_init_freeable) from [<806a4bdc>] (kernel_init+0x8/0xec)
[<806a4bdc>] (kernel_init) from [<8000e5f8>] (ret_from_fork+0x14/0x3c)
Code: e92d4010 e3a03000 e1a04000 ee073fba (e1903f9f)

Add phydev check to fix the issue.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoENGR00322839 ARM: dts: imx6sx: enet RGMII TXCLK output drive strength is weak
Fugang Duan [Mon, 8 Dec 2014 10:40:02 +0000 (18:40 +0800)]
ENGR00322839 ARM: dts: imx6sx: enet RGMII TXCLK output drive strength is weak

The current enet RGMII TXCLK rise/fall time which could be observed(~0.85ns)
is longer than requirement (<=0.75ns).

The current setting, SPEED/DSE/SRE=10/110/1 is used, and then it needs to
increase DSE to 111 "37 Ohm @ 3.3V, 21 Ohm@1.8V, 34 Ohm for DDR". After the
change RGMII TXCLK match the spec requirement.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-9768: dma: imx-sdma: fix UART loopback random failed
Robin Gong [Mon, 8 Dec 2014 09:30:40 +0000 (17:30 +0800)]
MLK-9768: dma: imx-sdma: fix UART loopback random failed

For UART, we need use old chn_real_count to know the real rx count even in
cylic dma mode, because UART driver use cyclic mode to increase performance
without any data loss.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agonet: fec: init maximum receive buffer size for ring1 and ring2
Fugang Duan [Mon, 8 Dec 2014 09:05:32 +0000 (17:05 +0800)]
net: fec: init maximum receive buffer size for ring1 and ring2

i.MX6SX fec support three rx ring1, the current driver lost to init
ring1 and ring2 maximum receive buffer size, that cause receving
frame date length error. The driver reports "rcv is not +last" error
log in user case.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: remove unused return value from swap_buffer()
Lothar Waßmann [Mon, 17 Nov 2014 09:51:24 +0000 (10:51 +0100)]
net: fec: remove unused return value from swap_buffer()

The return value of swap_buffer() is not used by any caller, thus
remove it.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: simplify loop counter handling in swap_buffer()
Lothar Waßmann [Mon, 17 Nov 2014 09:51:23 +0000 (10:51 +0100)]
net: fec: simplify loop counter handling in swap_buffer()

Eliminate the DIV_ROUND_UP() and change the loop counter increment to
4 instead. This results in saving 6 instructions in the functions
assembly code.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: use swab32s() instead of cpu_to_be32()
Lothar Waßmann [Mon, 17 Nov 2014 09:51:22 +0000 (10:51 +0100)]
net: fec: use swab32s() instead of cpu_to_be32()

when swap_buffer() is being called, we know for sure, that we need to
byte swap the data. Furthermore, this function is called for swapping
data in both directions. Thus cpu_to_be32() is semantically not
correct for all use cases. Use swab32s() to reflect this.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: improve access to quirk flags by copying them into fec_enet_private struct
Lothar Waßmann [Mon, 17 Nov 2014 09:51:21 +0000 (10:51 +0100)]
net: fec: improve access to quirk flags by copying them into fec_enet_private struct

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: change type of 'bufdesc_ex' to bool
Fugang Duan [Mon, 8 Dec 2014 08:45:24 +0000 (16:45 +0800)]
net: fec: change type of 'bufdesc_ex' to bool

fep->bufdesc_ex is treated as a boolean value, thus declare it as
such.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: fix regression on i.MX28 introduced by rx_copybreak support
Lothar Waßmann [Fri, 7 Nov 2014 09:02:47 +0000 (10:02 +0100)]
net: fec: fix regression on i.MX28 introduced by rx_copybreak support

commit 1b7bde6d659d ("net: fec: implement rx_copybreak to improve rx performance")
introduced a regression for i.MX28. The swap_buffer() function doing
the endian conversion of the received data on i.MX28 may access memory
beyond the actual packet size in the DMA buffer. fec_enet_copybreak()
does not copy those bytes, so that the last bytes of a packet may be
filled with invalid data after swapping.
This will likely lead to checksum errors on received packets.
E.g. when trying to mount an NFS rootfs:
UDP: bad checksum. From 192.168.1.225:111 to 192.168.100.73:44662 ulen 36

Do the byte swapping and copying to the new skb in one go if
necessary.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMLK-9828 ARM: imx: change uart clk parent to pll3_80m on i.mx6sx in default
Fugang Duan [Mon, 8 Dec 2014 08:27:54 +0000 (16:27 +0800)]
MLK-9828 ARM: imx: change uart clk parent to pll3_80m on i.mx6sx in default

By default, uboot set uart clk parent to OSC to make UART work when M4
is enabled. In the situation, uart maximum baud rate only reach at 1.5Mbps
that cannot match real case requirement.

The patch set the uart module clock source to pll3_80m in default. If
test low power case, it needs to add "uart_from_osc" in kernel command line.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-9893 tty: serial: imx: sync the completed and cur index
Fugang Duan [Thu, 20 Nov 2014 09:50:41 +0000 (17:50 +0800)]
MLK-9893 tty: serial: imx: sync the completed and cur index

The current logic has one potential issue cause data buffer lost in
busy system. When sdma copy data buffer count is zero, completed index
also increase, which cause data buffer lost. The patch fix the issue.

(cherry-picked from commit: f7b01c9263ea73b9150e8a7fa48812c1d47d0493)

Signed-off-by: Fugang Duan <B38611@freescale.com>