]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agoMLK-9833-2 dts: imx6sx: do not touch CAN gpios pads if M4 is enabled
Dong Aisheng [Tue, 11 Nov 2014 13:18:12 +0000 (21:18 +0800)]
MLK-9833-2 dts: imx6sx: do not touch CAN gpios pads if M4 is enabled

CAN devices are allocated to run on M4.
So do not touch CAN pads setting if M4 is enabled.

Conflicts:

arch/arm/boot/dts/imx6sx-sdb.dts

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 4fc10d386d02e8ae10d8512fdadb5a02ddd25228)

9 years agoMLK-9834 mmc: sdhci-esdhc-imx: fix SD3.0 failed to resume if M/F is enabled
Dong Aisheng [Fri, 14 Nov 2014 02:27:06 +0000 (10:27 +0800)]
MLK-9834 mmc: sdhci-esdhc-imx: fix SD3.0 failed to resume if M/F is enabled

Due to the power lost in suspend if Mega/Fast is enabled which is a new
feature introduced, the static settings like tuning control in probe()
function of controller will be lost which results in the later resume
failed on tuning routine for SD3.0 cards(SDR50/SDR104).

This patch moves the tunning setting from probe() function into
register setting path before the tuning is executed.
Then the tuning setting becomes dynamically and re-set again after
resume for a SD3.0 card when doing tuning.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 2fb6a74b8b91dad7e57d65a57eabd422a4acc25e)

9 years agoENGR00324668 mmc: core: add delay for SD3.0 UHS mode switch
Dong Aisheng [Wed, 6 Aug 2014 05:04:09 +0000 (13:04 +0800)]
ENGR00324668 mmc: core: add delay for SD3.0 UHS mode switch

We may meet the following errors with a SD3.0 DDR50 cards during reboot test.
mmc0: new ultra high speed DDR50 SDHC card at address aaaa
mmcblk0: mmc0:aaaa SU08G 7.40 GiB
mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0xb00
mmcblk0: retrying using single block read
mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0x0
end_request: I/O error, dev mmcblk0, sector 0
.....
Buffer I/O error on device mmcblk0, logical block 0
 mmcblk0: unable to read partition table

The root cause is still unknown.
Since there's an errata of Sandisk eMMC card before that it requires delay for CMD6
for eMMC DDR mode to work stable, we also suspect the SD3.0 DDR requires similar delay.
(Still not confirmed by Sandisk)
By adding the delay, the overnight reboot test(run 2000+ times) did not
show the issue anymore. Originally it can easy show the error after about 20 times of
reboot test.

So this patch would be the temporary workaround for Sandisk SD3.0 DDR50 mode
unstable issue.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit ef3bce5feb2ed36c9f4483287454d35ae330dbe3)
(cherry picked from commit c0cbde8a248036fae1768f232385290c23eddbd7)
(cherry picked from commit 138bab9f78ea2285b6e7c7cd6c8cd956def44003)

9 years agoMLK-9428 dts: imx6sx: optimize can pad settings
Dong Aisheng [Mon, 17 Nov 2014 08:51:10 +0000 (16:51 +0800)]
MLK-9428 dts: imx6sx: optimize can pad settings

Detailed reproduce steps:
1. boot-up to Linux command prompt.
2. send data from CAN device using "candump" command.
3. capture the TXD waveform during transmission.
4. severe overshoot/undershoot is observed (+4.4V ~ -1.2V).

HW team found that the pad setting of the CAN signal pins is not optimized.
In existing BSP, SPEED/DSE/SRE = 10/110/1 is used. They propose change it
to SPEED/DSE/SRE = 00/100/0.

Conflicts:

arch/arm/boot/dts/imx6sx.dtsi

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 0e0d95bed6937f4846aeda27de4e93bb141be492)
(cherry picked from commit 2914d58e0182795727930fa9f0bd4236ab9ded3c)

9 years agoMLK-9501 dts: imx6sx-sdb: optimize usdhc3 pad settings
Dong Aisheng [Tue, 18 Nov 2014 08:03:55 +0000 (16:03 +0800)]
MLK-9501 dts: imx6sx-sdb: optimize usdhc3 pad settings

Detailed reproduce steps:
1. boot-up to Linux command prompt .
2. Plug SD3.0 UHS-I SD Card into SD3 Connector (make sure SD Card running
   at SD3.0 DDR50/1.8V).
2. write data to SD3 using "dd" command (SD3_CLK running at 1.8V/50MHz).
3. capture the SD3_CLK, SD3_DATA, SD3_CMD waveforms during data write using
   FET probe (>=1GHz)
4. CLK waveforms like triangular wave are observed.

HW team found that the pad setting of the SD3_CLK, SD3_DATA, SD3_CMD signal pins are
not optimized. In existing BSP, when running at SD3.0/DDR50/1.8V, SPEED/DSE/SRE
= 01/011/1 is used. They propose change it to -
 SD3_CLK: SPEED/DSE/SRE = 01/110/1.
 SD3_DATA/SD3_CMD: SPEED/DSE/SRE = 01/101/1.

SDHC high speed cards also had such issue(refer to MLK-9500).

We only changed the default state (<50Mhz) pad setting, for ultra high speed
state like 100Mhz and 200Mhz, it does not have such issue since they already
set to the maximum Drive Strength value.

Conflicts:

arch/arm/boot/dts/imx6sx-sdb.dts

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 20ea8157d2d109a7b08e308e007e1eb3157689d4)
(cherry picked from commit 3b7935fb3e29526cb3fb0c06562f57e6eb8ad377)

9 years agoMLK-9871 dts: imx6sx: remove canfd related stuff
Dong Aisheng [Tue, 18 Nov 2014 08:32:03 +0000 (16:32 +0800)]
MLK-9871 dts: imx6sx: remove canfd related stuff

The CANFD IP will be removed in final production, so remove
the CANFD related stuff in dts tree to avoid confusion.
The patch only removed user level in dts part, the exists related
clocks and pads in source code are still there which seems not matter.

Conflicts:

arch/arm/boot/dts/Makefile
arch/arm/boot/dts/imx6sx-sdb-canfd.dts
arch/arm/boot/dts/imx6sx.dtsi

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit d22d9374948d2461189a632263c2e18a13c9ea41)
(cherry picked from commit 9a0baefbd1030921e8755b9f6ebf36d19fdacfdf)

9 years agoMLK-9975-2 imx6sx-ard: fix CAN unwork if power up the borad on first time
Dong Aisheng [Tue, 9 Dec 2014 08:43:37 +0000 (16:43 +0800)]
MLK-9975-2 imx6sx-ard: fix CAN unwork if power up the borad on first time

The CAN transceiver on MX6SX Sabreauto board seems in sleep mode
by default after power up the board. User has to press the wakeup
key on ARD baseboard before using the transceiver, or it may not
work properly when power up the board at the first time(warm reset
does not have such issue).

This patch wakeup the transceiver firstly if needed during intialization
by control the wakeup pin, then user do not have to press wakeup key
button to enable the transceiver.
BTW, stby gpio is also updated which is wrong before.

Conflicts:

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

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 3141bfc97e667de4b3d88968aa18668699d735ea)
(cherry picked from commit 05eb2a0b27d37740ba6cc4769b095706c064d823)

9 years agoMLK-9975-1 doc: flexcan: add trx_wakeup_gpio optional property
Dong Aisheng [Tue, 9 Dec 2014 10:19:55 +0000 (18:19 +0800)]
MLK-9975-1 doc: flexcan: add trx_wakeup_gpio optional property

This property is used to wakeup transceiver if it's in
sleep mode.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 9fa3b150ae0c4249ca1b6a7aba57d844540aa383)
(cherry picked from commit b492b7ca89bf8826a3cd5b2513b3235be63101d8)

9 years agoENGR00333130-2 dts: imx6sx: add legacy imx6sx sdb revA support
Dong Aisheng [Thu, 25 Sep 2014 07:14:16 +0000 (15:14 +0800)]
ENGR00333130-2 dts: imx6sx: add legacy imx6sx sdb revA support

The CAN transceiver is changed on RevB board and the default imx6sx-sdb.dts
is for support new RevB board.
This patch adds the dts for legacy RevA board support, especially for CAN
device.
This is for people who still wants to use RevA board with this code base.

Conflicts:

arch/arm/boot/dts/Makefile
arch/arm/boot/dts/imx6sx-sdb-reva.dts
arch/arm/boot/dts/imx6sx-sdb.dts

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 9d90c66e3cf61ed243ae148d401f2b46875f0745)
(cherry picked from commit 2717020f1b12d54757e0b7c51cb931d00e99d525)

9 years agoENGR00333130-1 ARM: imx6sx: setting can trx according to gpio flags
Dong Aisheng [Thu, 25 Sep 2014 07:12:00 +0000 (15:12 +0800)]
ENGR00333130-1 ARM: imx6sx: setting can trx according to gpio flags

With this, we can pass the gpio active flag from device tree
for initialize the transceiver.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 1847de083ac1dd0f0e150cc65ea1460baf362656)
(cherry picked from commit fde505aab652a8575f3c27a018697df34831edc3)

9 years agoMLK-9413 mmc: sdhci: fix potential unblanced regulator disable
Dong Aisheng [Wed, 19 Nov 2014 07:20:09 +0000 (15:20 +0800)]
MLK-9413 mmc: sdhci: fix potential unblanced regulator disable

The host->vmmc will be in disabled state if there's no card detected.
In that case arbitrarily disabling the host->vmmc in sdhci_remove_host()
may cause the following warning due to unblanced use count of regulator.

root@imx6qdlsolo:~# modprobe -r sdhci-esdhc-imx
mmc3: card e624 removed
------------[ cut here ]------------
WARNING: at drivers/regulator/core.c:1727 _regulator_disable+0xe4/0x14c()
unbalanced disables for VCC_SD3
Modules linked in: sdhci_esdhc_imx(-) sdhci_pltfm
CPU: 0 PID: 884 Comm: modprobe Not tainted 3.10.53-02577-gd22d937 #715
[<80013b00>] (unwind_backtrace+0x0/0xf4) from [<80011524>] (show_stack+0x10/0x14)
[<80011524>] (show_stack+0x10/0x14) from [<8002c290>] (warn_slowpath_common+0x54/0x6c)
[<8002c290>] (warn_slowpath_common+0x54/0x6c) from [<8002c2d8>] (warn_slowpath_fmt+0x30/0x40)
[<8002c2d8>] (warn_slowpath_fmt+0x30/0x40) from [<802cc054>] (_regulator_disable+0xe4/0x14c)
[<802cc054>] (_regulator_disable+0xe4/0x14c) from [<802cc0ec>] (regulator_disable+0x30/0x64)
[<802cc0ec>] (regulator_disable+0x30/0x64) from [<80468dfc>] (sdhci_remove_host+0x78/0x160)
[<80468dfc>] (sdhci_remove_host+0x78/0x160) from [<7f005934>] (sdhci_esdhc_imx_remove+0x30/0x58 [sdhci_esdhc_imx])
[<7f005934>] (sdhci_esdhc_imx_remove+0x30/0x58 [sdhci_esdhc_imx]) from [<80313038>] (platform_drv_remove+0x18/0x1c)
[<80313038>] (platform_drv_remove+0x18/0x1c) from [<803119d8>] (__device_release_driver+0x70/0xcc)
[<803119d8>] (__device_release_driver+0x70/0xcc) from [<803120cc>] (driver_detach+0xac/0xb0)
[<803120cc>] (driver_detach+0xac/0xb0) from [<803116c4>] (bus_remove_driver+0x7c/0xd0)
[<803116c4>] (bus_remove_driver+0x7c/0xd0) from [<8006fc80>] (SyS_delete_module+0x124/0x210)
[<8006fc80>] (SyS_delete_module+0x124/0x210) from [<8000e080>] (ret_fast_syscall+0x0/0x30)
---[ end trace 7bd0fb3a78254b54 ]---
root@imx6qdlsolo:~# EXT3-fs (mmcblk3p2): I/O error while writing superblock

Only disable regulators if they're on when remove host controller.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 89aa41ebb49c495be76ce107d037e4f31b3671cd)
(cherry picked from commit 5f2ea9ff90daa3e99512c4c7c453278910b78f34)

9 years agoMLK-10123: cpufreq: imx6q-cpufreq: initialize local variable 'i'
Robin Gong [Wed, 21 Jan 2015 04:57:47 +0000 (12:57 +0800)]
MLK-10123: cpufreq: imx6q-cpufreq: initialize local variable 'i'

Initialize local variable 'i' to 0, otherwise may fall into wrong
code path. The issue come with commit 757ff4b89.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoMLK-10116 tty: serial: imx: fix flush buffer issue when module clock is at 4Mhz
Fugang Duan [Mon, 19 Jan 2015 09:16:35 +0000 (17:16 +0800)]
MLK-10116 tty: serial: imx: fix flush buffer issue when module clock is at 4Mhz

In general, uart module clock require it is great than 80Mhz to match 5Mbps
baud rate. When test below 14Mhz module clock, software reset cause state
machines off normal. And for i.MX6SL evk board low power test, it set uart
module clock to 4Mhz, which cause console port print out messy code.
The patch just is workaround to fix console issue.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-10115: ov5640:define function ov5640_turn_on_AE_AG() with static
Sandor Yu [Mon, 19 Jan 2015 06:36:59 +0000 (14:36 +0800)]
MLK-10115: ov5640:define function ov5640_turn_on_AE_AG() with static

ov5640 driver will failed to build with build-in:
drivers/media/platform/mxc/subdev/built-in.o: In function
`ov5640_turn_on_AE_AG':
ov5640.c:(.text+0x3890): multiple definition of `ov5640_turn_on_AE_AG'
drivers/media/platform/mxc/capture/built-in.o:v4l2-int-device.c:(.text+0x783c):
first defined here
make[3]: *** [drivers/media/platform/built-in.o] Error 1
make[2]: *** [drivers/media/platform] Error 2
make[1]: *** [drivers/media] Error 2
make: *** [drivers] Error 2
make: *** Waiting for unfinished jobs....

It is caused by function of ov5640_turn_on_AE_AG define as global function,
change it to static function to resolv the issue.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10058-4 pci: imx6: refine imx6sx pcie pm
Richard Zhu [Thu, 25 Dec 2014 06:36:44 +0000 (14:36 +0800)]
MLK-10058-4 pci: imx6: refine imx6sx pcie pm

- Regarding to the pcie design on imx6sx, some gpc
operations are mandatory pre-required when pcie phy
is powered on/off.
In order to DO NOT touch gpc module in pcie driver,
register one pcie phy regulator into gpc, encapsulate
the pcie phy power on/off pre gpc related operations into
regulator's notify and contained in gpc driver
- in order to save power consumption, disable pcie clks and phy
regulator if the pcie link is down.
- remove the PRST set/unset in suspend/resume, because that
usb hub would be reset, and the name of the dev node of the
thumb disk inserted in the port of the pcie2usb device,
would be changed randomly after suspend resume on imx6sx.
- add the extremely power save mode

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
9 years agoMLK-10058-3 arm: gpc: add pcie phy power gpc operations
Richard Zhu [Thu, 25 Dec 2014 06:30:38 +0000 (14:30 +0800)]
MLK-10058-3 arm: gpc: add pcie phy power gpc operations

For PCIe module on i.mx6sx, some GPC operations would
be mandatory required when PCIe PHY is powered on/off.
So we need update gpc driver for the new requirements.
We implement it by regulator notify framwork in gpc driver.
NOTE:
make sure gpc driver is ready before PCIe driver is probed.
Otherwise, cause system hang during PCIe driver probe,
because the notify NOT installed ready and the gpc will
NOT power on PCIe.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
9 years agoMLK-10058-2 regulator: consumer: define pre_xxx event macros
Richard Zhu [Thu, 25 Dec 2014 06:28:06 +0000 (14:28 +0800)]
MLK-10058-2 regulator: consumer: define pre_xxx event macros

Some gpc operations are mandatory required when
iMX6SX PCIe PHY is powered on/off.
use the notify framwork to encapsulate the
pre-operations in gpc driver
- add two pre-xxx macros into consumer.h
- kick off the pre-xxx events in enable/disalbe call back.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
9 years agoMLK-10058-1 ARM: imx6sx: add one pcie phy regulator in gpc dts
Richard Zhu [Fri, 16 Jan 2015 07:00:54 +0000 (15:00 +0800)]
MLK-10058-1 ARM: imx6sx: add one pcie phy regulator in gpc dts

Register one pcie phy regulator in gpc driver, so thus,
the gpc related operations when pcie phy is powered
on/off can be moved into gpc driver

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
9 years agoMLK-10110 imx_v7_defconfig: add atheros wireless card support
Dong Aisheng [Fri, 16 Jan 2015 09:36:49 +0000 (17:36 +0800)]
MLK-10110 imx_v7_defconfig: add atheros wireless card support

Add atheros wireless card support

Signed-off-by: Dong Aisheng <b29396@freescale.com>
9 years agoASoC: fsl-sai: using 'lsb-first' property instead of 'big-endian-data'.
Xiubo Li [Fri, 29 Aug 2014 07:12:12 +0000 (15:12 +0800)]
ASoC: fsl-sai: using 'lsb-first' property instead of 'big-endian-data'.

The 'big-endian-data' property is originally used to indicate whether the
LSB firstly or MSB firstly will be transmitted to the CODEC or received
from the CODEC, and there has nothing relation to the memory data.

Generally, if the audio data in big endian format, which will be using the
bytes reversion, Here this can only be used to bits reversion.

So using the 'lsb-first' instead of 'big-endian-data' can make the code
to be readable easier and more easy to understand what this property is
used to do.

This property used for configuring whether the LSB or the MSB is transmitted
first for the fifo data.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit eadb0019d206591e34e864b62059b292e157d8fc)

9 years agoASoC: fsl-sai: Convert to use regmap framework's endianness method.
Xiubo Li [Mon, 25 Aug 2014 03:31:02 +0000 (11:31 +0800)]
ASoC: fsl-sai: Convert to use regmap framework's endianness method.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 014fd22ef9c6a7e9536b7e16635714a1a34810a8)

9 years agoMLK-9618-7 usb: chipidea: otg: delay turn on vbus when detecting data pulse
Li Jun [Thu, 16 Oct 2014 14:18:00 +0000 (22:18 +0800)]
MLK-9618-7 usb: chipidea: otg: delay turn on vbus when detecting data pulse

This patch adds a timer to delay turn on vbus after detecting data pulse
from B-device, this is required by OTG SRP timing.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10107-4: ARM: imx_v7_defconfig: enable USB Host ACM support
Peter Chen [Fri, 16 Jan 2015 06:34:59 +0000 (14:34 +0800)]
MLK-10107-4: ARM: imx_v7_defconfig: enable USB Host ACM support

It can be used to connect ACM supported gadget

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10107-3 ARM: imx_v7_defconfig: enable more USB functions
Peter Chen [Tue, 30 Sep 2014 01:10:59 +0000 (09:10 +0800)]
MLK-10107-3 ARM: imx_v7_defconfig: enable more USB functions

USB Ethernet function at host mode
USB Media function(webcam) at host mode
USB Audio function at host mode
USB Serial function at host mode
USB EHSET driver at host mode (for OTG & EH Certification test)
Several USB Gadget functions:
- Configfs
- NCM
- Zero (used for test)
- Gadgetfs
- Serial

Above functions are built as module.

Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10107-2 usb: chipidea: add CONFIG_PM_RUNTIME for runtime pm API
Peter Chen [Fri, 16 Jan 2015 06:26:05 +0000 (14:26 +0800)]
MLK-10107-2 usb: chipidea: add CONFIG_PM_RUNTIME for runtime pm API

For 3.19 kernel, it doesn't be needed due to CONFIG_PM_RUNTIME depends
on CONFIG_PM_SLEEP, but in 3.14, it still needs a standalone
CONFIG_PM_RUNTIME.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoENGR00286426-21 usb: chipidea: host: add ehci quirk for imx controller
Peter Chen [Sun, 29 Sep 2013 02:52:43 +0000 (10:52 +0800)]
ENGR00286426-21 usb: chipidea: host: add ehci quirk for imx controller

When the port goes to suspend or finishes resme, it needs to
notify PHY, it is not a standard EHCI operation, so we add a
quirk for it.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10107-1 usb: chipidea: host: add .bus_suspend quirk
Peter Chen [Thu, 25 Dec 2014 07:02:39 +0000 (15:02 +0800)]
MLK-10107-1 usb: chipidea: host: add .bus_suspend quirk

For chipidea, its resume sequence is not-EHCI compatible, see
below description for FPR at portsc. So in order to send SoF in
time for remote wakeup sequence(within 3ms), the RUN/STOP bit must
be set before the resume signal is ended, but the usb resume
code may run after resume signal is ended, so we had to set it
at suspend path.

Force Port Resume - RW. Default = 0b.
1= Resume detected/driven on port.
0=No resume (K-state) detected/driven on port.
Host mode:
Software sets this bit to one to drive resume signaling. The Controller sets this bit to '1' if
a J-to-K transition is detected while the port is in the Suspend state. When this bit
transitions to a '1' because a J-to-K transition is detected, the Port Change Detect bit in
the USBSTS register is also set to '1'. This bit will automatically change to '0' after the
resume sequence is complete. This behavior is different from EHCI where the controller
driver is required to set this bit to a '0' after the resume duration is timed in the driver.
Note that when the controller owns the port, the resume sequence follows the defined

sequence documented in the USB Specification Revision 2.0. The resume signaling
(Full-speed 'K') is driven on the port as long as this bit remains a '1'. This bit will remain
a '1' until the port has switched to idle. Writing a '0' has no affect because the port
controller will time the resume operation, clear the bit and the port control state switches
to HS or FS idle.
This field is '0' if Port Power(PP) is '0' in host mode.

This bit is not-EHCI compatible.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoENGR00291876 usb: phy-mxs: add delay before set phyctrl.clkgate
Peter Chen [Thu, 12 Dec 2013 06:33:02 +0000 (14:33 +0800)]
ENGR00291876 usb: phy-mxs: add delay before set phyctrl.clkgate

There is a request from IC engineer that if we doesn't
set phypwd as 0xffffffff, we need to delay about five
32Khz cycles before set phypwd, otherwise, the wakeup
signal may can't wake up controller.

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

9 years agoENGR00288578-8 usb: phy-mxs: do not set PWD.RXPWD1PT1 for low speed connection
Peter Chen [Thu, 21 Nov 2013 08:45:18 +0000 (16:45 +0800)]
ENGR00288578-8 usb: phy-mxs: do not set PWD.RXPWD1PT1 for low speed connection

At very rare cases, the SoF will not send out after resume with
low speed connection. The workaround is do not power down
PWD.RXPWD1PT1 bit during the suspend.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10107-5 usb: phy: mxs: refine mxs_phy_disconnect_line
Li Jun [Sun, 29 Jun 2014 06:16:03 +0000 (14:16 +0800)]
MLK-10107-5 usb: phy: mxs: refine mxs_phy_disconnect_line

(It is derived from ENGR00320439-9)

For non-otg mode, we keep the usage of disconnect line between phy analog
and digital unchanging; for otg mode, at peripheral role, we keep the usage
unchanging too, at host role, the digital part needs to know dp/dm change
to respond device's data pulse when it is at low power mode.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoENGR00286426-8 usb: phy-mxs: Add implementation of nofity_suspend{resume}
Peter Chen [Wed, 18 Sep 2013 05:57:59 +0000 (13:57 +0800)]
ENGR00286426-8 usb: phy-mxs: Add implementation of nofity_suspend{resume}

Implementation of notify_suspend and notify_resume will be different
according to mxs_phy_data->flags.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoENGR00286426-7 usb: phy: add notify suspend and resume callback
Peter Chen [Mon, 16 Sep 2013 08:31:24 +0000 (16:31 +0800)]
ENGR00286426-7 usb: phy: add notify suspend and resume callback

They are used to notify PHY that the controller enters suspend
or finishes resume.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10089 arm: imx: Add 198MHz OPP for i.MX6SX
Bai Ping [Tue, 13 Jan 2015 14:19:53 +0000 (22:19 +0800)]
MLK-10089 arm: imx: Add 198MHz OPP for i.MX6SX

Update the i.MX6SX operating points to comply with the latest
datasheet. Latest i.MX6SX datasheet of Rev.F, 1/2015 adds the
198MHz setpoint. For the RevB board, the VDD_ARM and ADD_SOC
are connected together, so the voltage for 198MHz needs to be
set to 1.175V. for the general setting, add a 25mV margin to
cover the board IR drop.

this patch is copy from commit: 17dae6e92 on branch imx_3.10.y
as too many conflicts to resolve.

Signed-off-by: Bai Ping <b51503@freescale.com>
9 years agoMLK-10091 arm: imx: check pll1 enable when changing arm_podf
Bai Ping [Wed, 14 Jan 2015 14:46:10 +0000 (22:46 +0800)]
MLK-10091 arm: imx: check pll1 enable when changing arm_podf

According to the hardware design, when changing the arm_podf divider,
make sure the pll1 has clk output. If the pll1 output is disabled before
changing the arm_podf, enbale and bypass the pll1 to make sure the
arm_podf can be successfully changed.

Signed-off-by: Bai Ping <b51503@freescale.com>
9 years agoMLK-10106 thermal: imx: correct clk enable and thermal sensor init sequence
Anson Huang [Fri, 16 Jan 2015 13:16:35 +0000 (21:16 +0800)]
MLK-10106 thermal: imx: correct clk enable and thermal sensor init sequence

thermal sensor's irq init should be done after clk enabled, also,
the low alarm value should be set correctly before clearing its
irq status.

Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Bai Ping <b51503@freescale.com>
9 years agoENGR00320439-2 usb: chipidea: host: set ci->hcd to be NULL after stop host role.
Li Jun [Sat, 28 Jun 2014 14:01:00 +0000 (22:01 +0800)]
ENGR00320439-2 usb: chipidea: host: set ci->hcd to be NULL after stop host role.

Set ci->hcd to be NULL after the hcd is removed.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10102-10 usb: chipidea: otg: Add power lost support for otg fsm mode
Li Jun [Thu, 15 Jan 2015 13:27:40 +0000 (21:27 +0800)]
MLK-10102-10 usb: chipidea: otg: Add power lost support for otg fsm mode

This patch adds support of power lost during system sleep in otg fsm mode.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10102-9 usb: chipidea: host: add ci_hdrc_host_has_device API
Li Jun [Thu, 15 Jan 2015 13:26:05 +0000 (21:26 +0800)]
MLK-10102-9 usb: chipidea: host: add ci_hdrc_host_has_device API

This patch adds a new API ci_hdrc_host_has_device to check if there
is usb device connected on host port.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10102-8 usb: chipidea: support role change after power lost
Li Jun [Thu, 15 Jan 2015 13:00:34 +0000 (21:00 +0800)]
MLK-10102-8 usb: chipidea: support role change after power lost

This patch is to complete support usb resume from power lost in non-otg
fsm mode:
- Re-init usb phy.
- Support role changes during system sleep with power lost.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10102-7 usb: chipidea: otg: fix deadlock of usb host removal after system resume
Li Jun [Fri, 16 Jan 2015 05:11:57 +0000 (13:11 +0800)]
MLK-10102-7 usb: chipidea: otg: fix deadlock of usb host removal after system resume

This is to fix possible deadlock of usb host with mass storage removal after
system resume, by waiting host finish device disconnection and then stop host
This is a patch merge for ideas from below 2 patches:
ENGR00308442-2 usb: chipidea: otg: wait devices disconnected before stop host.
ENGR00310498 usb: chipidea: otg: fix otg role switch from host to device failure

How to reproduce:
Failure case 1:
- Enable console wakeup:
  echo enabled > /sys/class/tty/ttymxc0/power/wakeup
- Connect a udisk with ID cable to OTG port.
- Suspend the system:
  ehco mem > /sys/power/state
- Remove ID cable together with udisk.
- Wakeup the system by console.
- OTG port cannot switch to device role.
Failure case 2:
- Connect a udisk with ID cable to OTG port.
- Enable usb wakeup by ./low_power_usb.sh
- Suspend the system:
  ehco mem > /sys/power/state
- Remove ID cable together with udisk.
- System wakeup but OTG port cannot switch to device role.

Root cause:
In this case, ID change interrupt generates before port change interrupt,
so with irq disabled, ci_handle_id_switch() will find there is usb device
still connected and wait it to disconnect by sleep, but disconnect will not
happen since usb irq still disabled so port change irq has no chance to be
handled.

How this patch is fixing this issue:
This patch waits host finish handle usb device disconnection before stop host,
and enables irq before sleep and disables irq after, thus port change
rq can be handled and usb device disconnection can timely happen, then
ci_handle_id_switch() can stop host and switch to device role correctly.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10102-6 usb: chipidea: otg: export ci_handle_id_switch API
Li Jun [Thu, 15 Jan 2015 13:05:12 +0000 (21:05 +0800)]
MLK-10102-6 usb: chipidea: otg: export ci_handle_id_switch API

Export ci_handle_id_switch interface for controller handle id
changes during system sleep with power lost.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10102-5 usb: chipidea: udc: support resume udc from power lost
Li Jun [Thu, 15 Jan 2015 12:49:36 +0000 (20:49 +0800)]
MLK-10102-5 usb: chipidea: udc: support resume udc from power lost

This patch implements the suspend and resume routine for udc resume
from power lost.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10102-4 usb: chipidea: host: support resume usb from power lost
Li Jun [Thu, 15 Jan 2015 12:10:36 +0000 (20:10 +0800)]
MLK-10102-4 usb: chipidea: host: support resume usb from power lost

This patch implements the suspend and resume routine for save and restore
registers of ehci, this is to support host resume from a system sleep with
power lost.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10102-3 usb: chipidea: export hw_controller_reset API
Li Jun [Thu, 15 Jan 2015 12:21:45 +0000 (20:21 +0800)]
MLK-10102-3 usb: chipidea: export hw_controller_reset API

Host needs to reset controller for recovery from power lost.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10102-2 usb: chipidea: add suspend and resume routine for role driver
Li Jun [Thu, 15 Jan 2015 12:17:07 +0000 (20:17 +0800)]
MLK-10102-2 usb: chipidea: add suspend and resume routine for role driver

We may need to do extra things for system suspend/resume per different
roles(e.g. power lost during system sleep), so define system suspend/resume
handler for roles.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10102-1 usb: chipidea: imx: usb resume from power lost during system sleep
Li Jun [Thu, 15 Jan 2015 11:13:13 +0000 (19:13 +0800)]
MLK-10102-1 usb: chipidea: imx: usb resume from power lost during system sleep

i.MX6SX mega off can shutdown domain power supply if none of peripheral
in this domain is registered as wakeup source, this patch adds usb controller
imx specific re-init after resume from such power lost during system sleep.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10103-2 cpufreq: imx6: increase SOC/PU voltage for vpu 352M
Anson Huang [Fri, 16 Jan 2015 10:47:42 +0000 (18:47 +0800)]
MLK-10103-2 cpufreq: imx6: increase SOC/PU voltage for vpu 352M

When VPU is running at 352MHz, SOC/PU voltage need to be
at 1.25V for 396/792MHz setpoint, as 396M setpoint is
removed, so only increase 792M setpoint's voltage.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-10103-1 ARM: imx: add VPU 352M for i.mx6q
Anson Huang [Fri, 16 Jan 2015 10:42:08 +0000 (18:42 +0800)]
MLK-10103-1 ARM: imx: add VPU 352M for i.mx6q

When VPU freq is set to 352MHz, it needs to source clk
from PLL2_PFD2_396M, and PLL2_PFD2_396M need to change
freq to 352M, cpufreq's 396M setpoint will be removed.

Busfreq will be disabled as it needs PLL2_PFD2 to be
as 396MHz to achieve low power audio freq setpoint.

To enable VPU 352MHz feature, select it in menuconfig,
it is disabled by default.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00320136 net: fec: fix rcv is not last issue when do suspend/resume test
Fugang Duan [Fri, 16 Jan 2015 05:18:00 +0000 (13:18 +0800)]
ENGR00320136 net: fec: fix rcv is not last issue when do suspend/resume test

When do suspend/resume stress test, some log shows "rcv is not +last".
The issue is that enet suspend will disable phy clock, phy link down,
after resume back, enet MAC redo initial and ready to tx/rx packet,
but phy still is not ready which is doing auto-negotiation. When phy
link is not up, don't schdule napi soft irq.

(cherry-picked from commit 61b16b307663ac972bc6c80cc5b308c546396027)

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-10105 ARM: dtsi: Add MLB50 support for the i.MX6SX
Luwei Zhou [Fri, 16 Jan 2015 04:37:41 +0000 (12:37 +0800)]
MLK-10105 ARM: dtsi: Add MLB50 support for the i.MX6SX

Add MLB50 support on the i.MX6SX-ARD platform.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoMLK-9769-26 caam: fix RNG buffer cache alignment
Steve Cornelius [Tue, 6 Jan 2015 23:20:15 +0000 (16:20 -0700)]
MLK-9769-26 caam: fix RNG buffer cache alignment

The hwrng output buffers (2) are cast inside of a a struct (caam_rng_ctx)
allocated in one DMA-tagged region. While the kernel's heap allocator
should place the overall struct on a cacheline aligned boundary, the 2
buffers contained within may not necessarily align. Consenquently, the ends
of unaligned buffers may not fully flush, and if so, stale data will be left
behind, resulting in small repeating patterns.

This fix aligns the buffers inside the struct.

Note that not all of the data inside caam_rng_ctx necessarily needs to be
DMA-tagged, only the buffers themselves require this. However, a fix would
incur the expense of error-handling bloat in the case of allocation failure.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
9 years agoMLK-9769-25 Modify CAAM RNG entropy delay value
Victoria Milhoan [Wed, 14 Jan 2015 19:21:10 +0000 (12:21 -0700)]
MLK-9769-25 Modify CAAM RNG entropy delay value

Modify the minimum entropy delay value for CAAM's RNG based on
recommended settings.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-24 Add cache coherency support to CAAM scatterlist implementation
Victoria Milhoan [Wed, 14 Jan 2015 19:00:59 +0000 (12:00 -0700)]
MLK-9769-24 Add cache coherency support to CAAM scatterlist implementation

Add cache coherency support to the CAAM scatterlist implementation.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-23 Replace SECVIO of_irq_to_resource() with irq_of_parse_and_map()
Victoria Milhoan [Wed, 14 Jan 2015 18:43:12 +0000 (11:43 -0700)]
MLK-9769-23 Replace SECVIO of_irq_to_resource() with irq_of_parse_and_map()

Replace of_irq_to_resource() in the SECVIO module with the simpler
equivalent irq_of_parse_and_map().  Also, add error checking to
to the SECVIO and Job Ring modules. Based on upstream commit
f7578496a671a96e501f16a5104893275e32c33a.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9980 Modify CAAM driver to hide algorithm registered notifications
Victoria Milhoan [Wed, 10 Dec 2014 22:32:26 +0000 (15:32 -0700)]
MLK-9980 Modify CAAM driver to hide algorithm registered notifications

The CAAM driver prints a message for each algorithm it registers
with the Crypto API. This patch hides the messages unless debug is
enabled.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit 84fcc913c4017d7c60ad19d07f277165b10e7848)

9 years agoMLK-10036 Freescale CAAM: Add support for DSM with Mega/Fast mix on
Victoria Milhoan [Thu, 18 Dec 2014 21:06:50 +0000 (14:06 -0700)]
MLK-10036 Freescale CAAM: Add support for DSM with Mega/Fast mix on

This patch allows CAAM to be enabled as a wakeup source for the
Mega/Fast mix domain. If CAAM is enabled as a wakeup source, it
will continue to be powered on across Deep Sleep Mode (DSM). This
allows CAAM to be functional after the system resumes from DSM.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit 290744e3b40a563319324e234fa5a65b49fd4d82)

9 years agoMLK-9971 Add XCBC-AES support for CAAM in i.MX6 family
Winston Hudson (b45308) [Thu, 27 Jun 2013 20:22:39 +0000 (13:22 -0700)]
MLK-9971 Add XCBC-AES support for CAAM in i.MX6 family

Add XCBC-AES support to the CAAM crypto accelerator core in
the i.MX6 family of SoC devices.

Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families (such as QorIQ).
Thus the property names are often tied to the sec-4.0+ nomenclature.

Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
9 years agoNeed gate the QSPI2 and GPMI_IO clock during clock init
Jason Liu [Tue, 6 Jan 2015 03:23:59 +0000 (11:23 +0800)]
Need gate the QSPI2 and GPMI_IO clock during clock init

QSPI2/GPMI_IO share the same clock source but with the
different gate, need explicitely gate the QSPI2 & GPMI_IO
during the clock init phase according to the SOC design.

The topo of the clock for the GPMI_IO and NAND as below:

mux --> pre divider --> post divider --gate-- >GPMI_IO
                                     |-gate-- >QSPI2

(Note: i.MX6SX:GPMI_NAND and GSPI2 is PINMUX conflicts.)

The SOC design spec required that if change the parent clock
of the GPMI_IO or QSPI2, need gate the GPMI_IO and QSPI2 first
otherwise, there will have some glitch which cause the divider
malfunciton. Thus, we need explicitely gate QSPI2 & GPMI_IO at
the clock initialization phase and then later on common clock
framework will gurantee that each time, the parent clock rate
changes after the child clock is disabled(gated).

Signed-off-by: Jason Liu <r64343@freescale.com>
(cherry picked from commit 110d63a5886e065e77a69f816216af044c096a44)

Conflicts:
arch/arm/mach-imx/clk-imx6sx.c

9 years agoENGR00320792-3 usb: gadget: mark init as late_initcall
Peter Chen [Mon, 23 Sep 2013 03:20:08 +0000 (11:20 +0800)]
ENGR00320792-3 usb: gadget: mark init as late_initcall

Since we introduce -EPROBE_DEFER for udc driver, it will be
probed at late_initcall if it is defered. When the gadget
is built in, it will return "couldn't find an available UDC"
at such case. That's the problem we met at below link:

http://marc.info/?l=linux-usb&m=137706435611447&w=2

We have no driver's probe at gadget driver, so we can't return
-EPROBE_DEFER. And it is also not suitable to defer udc_bind_to_driver
if the udc is not found temporarily, since it is hard to decide the
return value for usb_gadget_probe_driver.

Due to above reasons, mark gadget's init as late_initcall may be a
moderate solution.

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

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

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoENGR00286459 usb: chipidea: imx: add request{release}_bus_freq
Peter Chen [Wed, 6 Nov 2013 08:38:18 +0000 (16:38 +0800)]
ENGR00286459 usb: chipidea: imx: add request{release}_bus_freq

When the usb in idle, it calls release_bus_req.
When the usb is going to use, it calls request_bus_req.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10101-1 usb: chipidea: otg: runtime PM support for otg fsm mode
Li Jun [Wed, 14 Jan 2015 10:10:09 +0000 (18:10 +0800)]
MLK-10101-1 usb: chipidea: otg: runtime PM support for otg fsm mode

Add runtime PM for otg fsm.

Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-10085-7 usb: chipidea: imx: add usb charger detection for imx6
Li Jun [Fri, 9 Jan 2015 13:58:41 +0000 (21:58 +0800)]
MLK-10085-7 usb: chipidea: imx: add usb charger detection for imx6

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

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-10085-6 usb: chipidea: Add usb charger detect support in otg fsm mode
Li Jun [Wed, 14 Jan 2015 05:12:04 +0000 (13:12 +0800)]
MLK-10085-6 usb: chipidea: Add usb charger detect support in otg fsm mode

Use b_sess_valid_event for charger detection in otg fsm mode.

Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-10085-5 usb: chipidea: Add usb charger detect notify
Li Jun [Fri, 9 Jan 2015 07:35:07 +0000 (15:35 +0800)]
MLK-10085-5 usb: chipidea: Add usb charger detect notify

- Change .notify's return value from void to int, update msm notify_event
  return value accordingly.
- Add CI_HDRC_CONTROLLER_VBUS_EVENT and
  CI_HDRC_CONTROLLER_CHARGER_POST_EVENT to finish the USB charger
  detection flow.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-10085-4 usb: doc: chipidea: imx: add imx6-usb-charger-detection property
Li Jun [Fri, 9 Jan 2015 06:37:24 +0000 (14:37 +0800)]
MLK-10085-4 usb: doc: chipidea: imx: add imx6-usb-charger-detection property

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

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10085-3 ARM: imx6: remove imx6-usb-charger-detection for imx6sx-sabreauto
Li Jun [Mon, 12 Jan 2015 07:58:21 +0000 (15:58 +0800)]
MLK-10085-3 ARM: imx6: remove imx6-usb-charger-detection for imx6sx-sabreauto

Disable imx6-usb-charger-detection by default.

Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-10085-2 ARM: imx6: add usb anatop phandle at usbotg node
Li Jun [Fri, 9 Jan 2015 06:27:07 +0000 (14:27 +0800)]
MLK-10085-2 ARM: imx6: add usb anatop phandle at usbotg node

Add anatop phandle at usbotg node to access anatop register.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10085-1 power: imx6: add imx6 USB charger detection
Li Jun [Fri, 9 Jan 2015 03:39:33 +0000 (11:39 +0800)]
MLK-10085-1 power: imx6: add imx6 USB charger detection

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

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

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10099 ARM: dts: imx6qdl: Add VDOA support
Liu Ying [Thu, 15 Jan 2015 03:04:18 +0000 (11:04 +0800)]
MLK-10099 ARM: dts: imx6qdl: Add VDOA support

This patch adds VDOA device tree node support.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
9 years agoMLK-9941 mtd: qspi: Update device tree binding doc for ddrsmp property
Ye.Li [Mon, 1 Dec 2014 14:06:53 +0000 (22:06 +0800)]
MLK-9941 mtd: qspi: Update device tree binding doc for ddrsmp property

The new property "ddrsmp" was added into device tree. Update the doc
accordingly.

Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit 4239df12c5d6c3ac19a25e120ffe17df93c358a3)

9 years agoMLK-10028 QSPI dynamically alloc memory for AHB read
Allen Xu [Thu, 15 Jan 2015 02:18:29 +0000 (10:18 +0800)]
MLK-10028 QSPI dynamically alloc memory for AHB read

QSPI may failed to alloc enough memory (256MB) for AHB read in
previous implementation, especially in 3G/1G memory layout kernel.
Dynamically alloc memory to avoid such issue.

This implementation generally alloc 4MB memory for AHB read, it should
be enough for common scenarios, and the side effect (0.6% performance
drop) is minor.

Previous implementation

root@imx6qdlsolo:~# dd if=/dev/mtd0 of=/dev/null bs=1K count=32K
32768+0 records in
32768+0 records out
33554432 bytes (34 MB) copied, 2.16006 s, 15.5 MB/s

root@imx6qdlsolo:~# dd if=/dev/mtd0 of=/dev/null bs=32M count=1
1+0 records in
1+0 records out
33554432 bytes (34 MB) copied, 1.43149 s, 23.4 MB/s

After applied the patch

root@imx6qdlsolo:~# dd if=/dev/mtd0 of=/dev/null bs=1K count=32K
32768+0 records in
32768+0 records out
33554432 bytes (34 MB) copied, 2.1743 s, 15.4 MB/s

root@imx6qdlsolo:~# dd if=/dev/mtd0 of=/dev/null bs=32M count=1
1+0 records in
1+0 records out
33554432 bytes (34 MB) copied, 1.43158 s, 23.4 MB/s

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit ebcd4437450c4f0075988ef9c8824e837546c70b)

9 years agoMLK-9976: ARM: dts: NAND BBT inconsistency causes UBIFS randomly mount failed
Allen Xu [Tue, 9 Dec 2014 22:12:00 +0000 (06:12 +0800)]
MLK-9976: ARM: dts: NAND BBT inconsistency causes UBIFS randomly mount failed

NAND scans the bad blocks during kernel boots up, which invokes the
gpmi_ecc_read_oob function to check the badblock mark for each block. In
this function the oob data was raw read from NAND chip without ECC, so
it hardly to guarantee the consistency of the data considering the
possible bitflips. It found that in some MLC NAND the oob data changed
and consequently the BBT changed in different power cycles. This issue
may cause the UBIFS mount failed.

To fix this issue, add "nand_on_flash_bbt" option in dts to store the BBT
in NAND flash. On the first time kernel boot up, all bad blocks and
probably some fake bad block would be recognized and be recorded in
on-nand bad block table. From the second time boot, kernel will read BBT
from NAND Flash rather than calling gpmi_ecc_read_oob function to check
bad block.

No bad block would be missed when create BBT since the probability that
16bit bad block mark filps from 0x00 to 0xFF is extremely low.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit d957353768a1b6d39b340b9d10b22fc42b0aa8e2)

9 years agoMLK-9957 mtd: NAND: fix the kernel panic issue for NAND suspend/resume
Allen Xu [Thu, 4 Dec 2014 13:51:48 +0000 (21:51 +0800)]
MLK-9957 mtd: NAND: fix the kernel panic issue for NAND suspend/resume

The branch determined by GPMI_IS_MX6SX() should not include
acquire_dma_channels() function which causes unbalanced dma
request/release on other platform.

Removed GPMI_IS_MX6SX() to make code simple although it is not necessary
to restore GPMI/BCH registers for i.MX6Q/DL

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 54cd0fe03180dc44e3783bca1546e61d698abd2f)

9 years agoMLK-9811 mtd: gpmi: add supend/resume support
Huang Shijie [Wed, 7 May 2014 09:15:03 +0000 (17:15 +0800)]
MLK-9811 mtd: gpmi: add supend/resume support

support gpmi nand suspend/resume function

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit d5bad6203191a64ac78bddbf2385da3606b94460)

9 years agoMLK-9810 dma: mxs-dma: add power management support
Huang Shijie [Wed, 7 May 2014 06:04:09 +0000 (14:04 +0800)]
MLK-9810 dma: mxs-dma: add power management support

this patch adds power management support for mxs-dma driver.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 7a59828eeda36457e6e60383705a0bc5831ffbf7)

9 years agoMLK-9949: mtd: qspi: Handle QSPI probe error path correctly
Allen Xu [Wed, 3 Dec 2014 17:06:47 +0000 (01:06 +0800)]
MLK-9949: mtd: qspi: Handle QSPI probe error path correctly

If QSPI probe failed in some cases, such as board rework, the error
patch was not handled correctly.

This issue may cause kernle dump in fec driver, since the
pm_qos_remove_request() in QSPI driver was not invoked when probe
failed.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 350d532e0266a0a6918cbc6a17952ef64aef2521)

9 years agoMLK-9842 mtd: fsl-quadspi: Propagate the error from of_modalias_node()
Fabio Estevam [Fri, 17 Oct 2014 18:31:08 +0000 (15:31 -0300)]
MLK-9842 mtd: fsl-quadspi: Propagate the error from of_modalias_node()

The 'map_failed' label will return 'ret', so we need to assign the error
code to 'ret', otherwise the probe function will return success.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
(cherry picked from commit b26171e392c7d3952b6eeb6da62a861c5317e438)
(cherry picked from commit 9e4a091d30e27dd40a04b892bf5f6bf372271380)

9 years agoMLK-9948: ARM: dts: Add ddrsmp parameter for 19x19 arm2 board
Allen Xu [Wed, 3 Dec 2014 17:04:20 +0000 (01:04 +0800)]
MLK-9948: ARM: dts: Add ddrsmp parameter for 19x19 arm2 board

Add the ddrsmp parameter for 19x19 arm2 board.
2 ---- i.MX6SX 19x19 ARM2 board

And reduce the clock frequency from 53Mhz to 29Mhz.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 44a1d6c7b438fa1139572e864ee6aa111de39f18)

9 years agoMLK-9939 ARM: dts: Add ddrsmp parameter to device tree for i.MX6SX ARM2 board
Allen Xu [Mon, 1 Dec 2014 11:55:18 +0000 (19:55 +0800)]
MLK-9939 ARM: dts: Add ddrsmp parameter to device tree for i.MX6SX ARM2 board

The ddr sample point is board related, so add ddrsmp parameter to device
tree for i.MX6SX 17x17 ARM2 board.

DDRSMP value:
2 ---- i.MX6SX 17x17 ARM2 board

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit c5d9eb443cda0c4d6e5705a2b51904f49b4f8297)

9 years agoMLK-9920 mtd: qspi: Add ddrsmp parameter to device tree
Ye.Li [Mon, 1 Dec 2014 09:28:47 +0000 (17:28 +0800)]
MLK-9920 mtd: qspi: Add ddrsmp parameter to device tree

Since QSPI internal DDR sample point is relevant with board layout,
we can't use same value for all boards. Add ddrsmp parameter to device
tree for i.MX6SX Sabreauto/Sabresd board.

DDRSMP value:
0 ---- i.MX6SX Sabresd board (RevB and RevA)
2 ---- i.MX6SX Sabreauto board

The Sabresd RevA board also needs to reduce clock to 29Mhz according to
the Spansion spec.

Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit c9115cc22d836b5b980ca20932a005ea61b20082)

9 years agoMLK-9924 mtd: qspi: QSPI1 cannot wake up WAIT mode workaround
Allen Xu [Sat, 29 Nov 2014 09:51:36 +0000 (03:51 -0600)]
MLK-9924 mtd: qspi: QSPI1 cannot wake up WAIT mode workaround

QSPI1 cannot wake up CCM from WAIT mode on SX ARD board, add pmqos to
let CCM NOT enter WAIT mode when accessing QSPI1, refer to TKT245618.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit feb3b71bffc8afd440c0b972334f2479ebfefa1d)

9 years agoMLK-9910: ARM: dts: reduce the i.MX6sx AI board QSPI clock frequency
Allen Xu [Sat, 22 Nov 2014 19:35:36 +0000 (13:35 -0600)]
MLK-9910: ARM: dts: reduce the i.MX6sx AI board QSPI clock frequency

Reduced the QSPI clock from 53Mhz to 29Mhz according to spec requirement

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit ea5d6d29564c29b21d117056e9cbd1430199b4de)

9 years agoMLK-9909 ARM: dts: add imx6sx sdb revA QSPI legacy support
Allen Xu [Sat, 22 Nov 2014 19:15:19 +0000 (13:15 -0600)]
MLK-9909 ARM: dts: add imx6sx sdb revA QSPI legacy support

add sdb revA board QSPI legacy support for Spansion QSPI chip.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 3fd143ae78007e58d1dc45bc829b462a12b93cd2)

9 years agoMLK-9851 mtd: Change the mtd device driver build order for mfgtool
Allen Xu [Fri, 14 Nov 2014 16:36:07 +0000 (00:36 +0800)]
MLK-9851 mtd: Change the mtd device driver build order for mfgtool

i.MX6SX Sabreauto board enabled both NAND and QSPI1 drivrers, and by default,
NAND driver built first in kernel compiling, and it would be load first when
Kernel brought up.

Since we could not guarantee all boards mounted NAND chips, we wish the Kernel
could load QSPI driver first, when system mapped QSPI and NAND, the mtd device
index won't change dynamically, otherwise, the mfgtool may write images to the
inappropriate storage devices.

The code change moved the SPI driver at the prior position of NAND driver in
Makefile to solve this issue.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 3d2d5724f7a2968b40c2ea0a70c09a3214da1496)

9 years agoMLK-9675 ARM: dts: code change for new QSPI chip on SDB board
Allen Xu [Sun, 5 Oct 2014 19:39:31 +0000 (14:39 -0500)]
MLK-9675 ARM: dts: code change for new QSPI chip on SDB board

QSPI chip changed from spansion s25fl128s to micron n25q256a

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 56c87a201946e4582de2f574c218e43c4db7fadb)
(cherry picked from commit 628c08401cf3b6fcd477bdf118269b0c868e16d8)

9 years agoMLK-9660 ARM: dts reduce QSPI freq on imx6sx sabresd board
Allen Xu [Wed, 1 Oct 2014 22:32:34 +0000 (17:32 -0500)]
MLK-9660 ARM: dts reduce QSPI freq on imx6sx sabresd board

According to design spec on QSPI IO freq, reduce the freq to 29MHz.

Non-DQS mode:
-          SDR: 60MHz
-          DDR: 30Mhz

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit b01578a8d466d7420cbc7cfabf984998e8e31657)

9 years agoMLK-9659 ARM: dts reduce QSPI freq on imx6sx-17x17-arm2 board
Allen Xu [Wed, 1 Oct 2014 22:25:49 +0000 (17:25 -0500)]
MLK-9659 ARM: dts reduce QSPI freq on imx6sx-17x17-arm2 board

According to design spec on QSPI IO freq, reduce the freq to 29MHz.

Non-DQS mode:
-          SDR: 60MHz
-          DDR: 30Mhz

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit da5d7175b84db47b8269a531e22a919d10d4bce9)

9 years agoMLK-9650 QSPI: imx6sx: fix QSPI build warning
Allen Xu [Thu, 25 Sep 2014 21:08:16 +0000 (16:08 -0500)]
MLK-9650 QSPI: imx6sx: fix QSPI build warning

add the missed return value to fix the build warning.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit a4e7c495626ec3a0cbe9561fa5a22306a92ca2bf)

9 years agoENGR00311101 QSPI: i.MX6SX: fixed the random QSPI access failed issue
Allen Xu [Thu, 25 Sep 2014 10:39:09 +0000 (05:39 -0500)]
ENGR00311101 QSPI: i.MX6SX: fixed the random QSPI access failed issue

We found there is a low probability(5%) QSPI access timeout issue,
usually it happened on kernel boot stage, the first time kernel tried to
access QSPI chip. The READ_ID command was sent but not executed,
consequently the probe function failed.

Finally we located the issue by these steps.

1. Since the issue happened randomly and usually it cost half day to
reproduce, we add more debug code in driver, to create a timeout file if
the issue occurred.

2. Prepared an autorun script to keep rebooting the system and check if
the timeout file existed, if the file existed, stop reboot.

3. The system will stop rebooting when timeout error occurred, set the
CCM_CCOSR register and related IOMUX to measure QPSI clock, found there
is no clock output, while clock output can be measured when QSPI driver
successfully probed.

4. Check the code and found QSPI clock rate was changed while not
disabled clock gate, most of the multiplexers on i.MX6 are glitch ones,
clock glitch may occurred and propagated into downstream clock dividers

Based on the new clock flag(CLK_SET_RATE_GATE) and new framework, we
need to change the approach of seting clock rate. In current
implementation, there are several places in which the clock was touched.

1. probe function. prepare and enable clock before setting the QSPI
register, disable and unprepare the clock before exit.

2. nor_setup & nor_setup_last, since we change clock rate in these two
functions.

3. fsl_qspi_prep and fsl_qspi_unprep, clock was enabled only when got
QSPI access request.

4. resume function. Clock was required to restroe the setting after
resume, disable the clock before exit.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 04b31985952a4a8ba226d7bac474f70a95f5e674)

9 years agoENGR00331773 qspi: imx6sx: Fixed the issues when compiled QSPI as a module
Allen Xu [Fri, 12 Sep 2014 12:17:38 +0000 (07:17 -0500)]
ENGR00331773 qspi: imx6sx: Fixed the issues when compiled QSPI as a module

There were two issues when compiled QSPI as a module.

1. two functions in spi_nor.c has not been exported.
2. unregister mtd device count is wrong.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit f8c6c7204404864a042112cbc06b046cda43a1e4)

9 years agoMLK-10092-2 dts: Rename compatible string from ov564x to ov5640
Sandor Yu [Wed, 14 Jan 2015 07:41:43 +0000 (15:41 +0800)]
MLK-10092-2 dts: Rename compatible string from ov564x to ov5640

There are two version ov5640 driver,
one is written with v4l2 int-device architecture,
and the other is written with v4l2 subdev architecture.
Rename subdev ov5640 compatible string from ov5640x
to ov5640 to distinguish with ov5640 int-device driver.
so ov564x is used for int-device architecture and
ov5640 is used for subdev architecture.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10092-1 ov5640: Rename compatible string from ov564x to ov5640
Sandor Yu [Wed, 14 Jan 2015 07:34:22 +0000 (15:34 +0800)]
MLK-10092-1 ov5640: Rename compatible string from ov564x to ov5640

There are two version ov5640 driver,
one is written with v4l2 int-device architecture,
and the other is written with v4l2 subdev architecture.
Rename subdev ov5640 compatible string from ov5640x to ov5640
to distinguish with ov5640 int-device driver.
so ov564x is used for int-device architecture and
ov5640 is used for subdev architecture.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10084 media: mxc vout: Correct black color filling for interleaved formats
Liu Ying [Tue, 13 Jan 2015 02:19:10 +0000 (10:19 +0800)]
MLK-10084 media: mxc vout: Correct black color filling for interleaved formats

In non-linear_bypass_pp and non-tiled_bypass_pp modes, the triple fbdev frame
buffer would be rendered with video frames in turn.  We need to fill all the
three frame buffers with black color before streaming on instead of filling only
one of them.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit e0155001082abc2432ec54ac86f56abbbb744fd3)

9 years agoMLK-10098 ARM: imx: fix 1588 clock init
Fugang Duan [Wed, 14 Jan 2015 08:18:58 +0000 (16:18 +0800)]
MLK-10098 ARM: imx: fix 1588 clock init

The enet clock define is changed as there has no "enet_ref" clock name.
If the tx_clk is sourced from SOC anatop PLL, user define the clock id
in devicetree. So we only to judge the ptp clock valid and then set the
related GPR bit.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-10097 ARM: dts: imx6sl: add FEC sleep pinctrl for evk board
Fugang Duan [Wed, 14 Jan 2015 07:55:19 +0000 (15:55 +0800)]
MLK-10097 ARM: dts: imx6sl: add FEC sleep pinctrl for evk board

Add FEC sleep pinctrl setting for evk board.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-10096 ARM: dts: imx6qdl: add enet ENET_REF_CLK pin set for sabreauto board
Fugang Duan [Wed, 14 Jan 2015 07:36:47 +0000 (15:36 +0800)]
MLK-10096 ARM: dts: imx6qdl: add enet ENET_REF_CLK pin set for sabreauto board

Add enet RGMII ENET_REF_CLK pin set for sabreauto board.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-10095 ARM: dts: imx6sx: correct sdb board enet pin group setting
Fugang Duan [Wed, 14 Jan 2015 07:21:26 +0000 (15:21 +0800)]
MLK-10095 ARM: dts: imx6sx: correct sdb board enet pin group setting

Correct i.MX6SX sdb board enet pin group setting.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-10094 ARM: dts: imx6sx: correct the uart compatible string
Fugang Duan [Wed, 14 Jan 2015 07:10:56 +0000 (15:10 +0800)]
MLK-10094 ARM: dts: imx6sx: correct the uart compatible string

Correct the uart compatible string.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoENGR00278822 ARM: imx_v7_defconfig: disable CONFIG_SWP_EMULATE
Shengjiu Wang [Mon, 9 Sep 2013 10:54:25 +0000 (18:54 +0800)]
ENGR00278822 ARM: imx_v7_defconfig: disable CONFIG_SWP_EMULATE

According to the help text in the config SWP_EMULATE in arch/arm/mm/Kconfig:

"In some older versions of glibc [<=2.8] SWP is used during futex trylock()
operations with the assumption that the code will not be preempted. This
invalid assumption may be more likely to fail with SWP emulation enabled,
leading to deadlock of the user application."

The audio codec toolchain version is gcc-4.1.1-glibc-2.4, we need turn off
the CONFIG_SWP_EMULATE in the imx_v7_defconfig.

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