]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agoENGR00292408-2 usb: chipidea: imx: enable different wakeup setting
Peter Chen [Fri, 3 Jan 2014 05:45:30 +0000 (13:45 +0800)]
ENGR00292408-2 usb: chipidea: imx: enable different wakeup setting

We have different wakeup setting for different roles:
For peripheral-only mode, we may only enable vbus wakeup.
The Micro-AB cable should not be considered as wakeup source.
For host-only mode, the ID change or vbus change should not be
considered as wakeup source.
For OTG mode, all wakeup setting should be considered as wakeup
source.

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

9 years agoENGR00292408-1 usb: chipidea: add query_available_role interface
Peter Chen [Fri, 3 Jan 2014 05:42:56 +0000 (13:42 +0800)]
ENGR00292408-1 usb: chipidea: add query_available_role interface

The glue layer may need to know current available role, add
ci_hdrc_query_available_role for that.

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

9 years agoMLK-10154 ARM: dts: imx6qdl-sd: add egalax touch to i2c2 bus
Haibo Chen [Wed, 28 Jan 2015 01:56:46 +0000 (09:56 +0800)]
MLK-10154 ARM: dts: imx6qdl-sd: add egalax touch to i2c2 bus

Add egalax touch to i2c2 bus, which can make lvds0 touch screen
work.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
9 years agoMLK-10159 Use macros for CAAM clock numbers in imx6sx DTS file
Victoria Milhoan [Tue, 27 Jan 2015 07:16:23 +0000 (00:16 -0700)]
MLK-10159 Use macros for CAAM clock numbers in imx6sx DTS file

Use macros instead of numbers to represent CAAM clocks in the
imx6sx device tree source.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-10143 Enable tcrypt and CAAM driver in default imx_v7 kernel config
Victoria Milhoan [Tue, 27 Jan 2015 06:54:57 +0000 (23:54 -0700)]
MLK-10143 Enable tcrypt and CAAM driver in default imx_v7 kernel config

This patch enables the CAAM driver in the default imx_v7 kernel
config file, plus configures tcrypt to be built as a module.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-10139 Add support for crypto/caam to imx6qdl dts
Victoria Milhoan [Tue, 27 Jan 2015 04:36:44 +0000 (21:36 -0700)]
MLK-10139 Add support for crypto/caam to imx6qdl dts

This patch adds the imx6qdl.dtsi DTS support for crypto/caam. CAAM
clocking support is also included.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoENGR00324639 usb: chipidea: set ITC to 0 for device mode
Peter Chen [Mon, 22 Sep 2014 08:45:39 +0000 (16:45 +0800)]
ENGR00324639 usb: chipidea: set ITC to 0 for device mode

ITC (Interrupt Threshold Control) is used to set the maximum rate at which
the host/device controller will issue interrupts. The default value is 8 (1ms)
for it. EHCI core will modify it to 1, but device mode keeps it as default
value.

In some use cases like this CR, it uses Android ADB to transfer data, ADB
only has one usb request for each direction, and maximum payload data is
only 4KB, so the speed is 4MB/s at most, it needs controller to trigger
interrupt as fast as possible to increase the speed. The USB performance
will be better if the interrupt can be triggered faster.

In this case, we set ITC default value as 0, which will trigger USB interrupt
immediately once the transfer has completed.

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

9 years agoMLK-9785-5 usb: chipidea: usbmisc_imx: add unburst setting for imx6
Peter Chen [Wed, 5 Nov 2014 06:58:32 +0000 (14:58 +0800)]
MLK-9785-5 usb: chipidea: usbmisc_imx: add unburst setting for imx6

With this setting and AHBBRST at SBUSCFG as "Incremental burst of
unspecified length", each unburst size can be taken as one single transfer.
It is benefit for unburst size transfer.

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

9 years agoMLK-9785-3 usb: chipidea: imx: change ahb burst setting
Peter Chen [Wed, 5 Nov 2014 06:38:28 +0000 (14:38 +0800)]
MLK-9785-3 usb: chipidea: imx: change ahb burst setting

For imx6, below AHB burst setting are better performance:
- Incremental burst of unspecified length, see SBUSCFG, $BASE + 0x90
- Set Both RX/TX burst size as 16 DWords, see BURSTSIZE, $BASE + 0x160

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

9 years agoMLK-9785-2 usb: chipidea: add AHB configuration interface
Peter Chen [Wed, 5 Nov 2014 06:30:35 +0000 (14:30 +0800)]
MLK-9785-2 usb: chipidea: add AHB configuration interface

The AHBBRST at SBUSCFG and RX/TX burst size at BURSTSIZE are implementation
dependent, each platform may have different values, and some values may not be
optimized.

The glue layer can override ahb burst configuration value by setting flag
CI_HDRC_OVERRIDE_AHB_BURST and ahbburst_config.

The glue layer can override RX/TX burst size by setting flag
CI_HDRC_OVERRIDE_BURST_LENGTH and burst_length.

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

9 years agoMLK-9785-1 usb: host: ehci-hcd: enable park mode
Peter Chen [Tue, 4 Nov 2014 12:46:15 +0000 (20:46 +0800)]
MLK-9785-1 usb: host: ehci-hcd: enable park mode

Enable park mode will improve the performance a lot at USB ethernet use
case, but a little at USB mass storage use case, and it is not harm from
the tests. Below the performance comparison at imx6sl:

USB Ethernet (Mbps)
Default Enable Park
TX 192 262
RX 262 290

USB Mass Storage (MB/s)
Read 21.8 22.9
Write 19.5 22.8

This patch is used for freescale internal.

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

9 years agoMLK-9770-3 usb: chipidea: imx: add stream mode enable for device mode at imx6sl/imx6sx
Peter Chen [Thu, 30 Oct 2014 03:10:04 +0000 (11:10 +0800)]
MLK-9770-3 usb: chipidea: imx: add stream mode enable for device mode at imx6sl/imx6sx

Stream mode enable is known for better performance
(eg, rx at g_ncm: 175Mbps->250Mbps), and stream mode
enable has been passed with stress tests at device mode
for imx6sl and imx6sx, and no issue is found.

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

9 years agoMLK-9770-2 usb: chipidea: define stream mode disable for both roles
Peter Chen [Thu, 30 Oct 2014 01:15:15 +0000 (09:15 +0800)]
MLK-9770-2 usb: chipidea: define stream mode disable for both roles

The chipidea IP has different limitations for host and device mode,
see below errata, we may need to enable SDIS(Stream Disable Mode)
at host mode, but we don't want it at device mode at some situations.

TAR 9000378958
Title: Non-Double Word Aligned Buffer Address Sometimes Causes Host to Hang on OUT Retry
Impacted Configuration: Host mode, all transfer types
Description:
The host core operating in streaming mode may under run while sending the data packet of an OUT transaction. This under run can occur if there are unexpected system delays in fetching the remaining packet data from memory. The host forces a bad CRC on the packet, the device detects the error and discards the packet. The host then retries a Bulk, Interrupt, or Control transfer if an under run occurs according to the USB specification.
During simulations, it was found that the host does not issue the retry of the failed bulk OUT. It does not issue any other transactions except SOF packets that have incorrect frame numbers.
The second failure mode occurs if the under run occurs on an ISO OUT transaction and the next ISO transaction is a zero byte packet. The host does not issue any transactions (including SOFs). The device detects a Suspend condition, reverts to full speed, and waits for resume signaling.
A third failure mode occurs when the host under runs on an ISO OUT and the next ISO in the schedule is an ISO OUT with two max packets of 1024 bytes each.
The host should issue MDATA for the first OUT followed by DATA1 for the second. However, it drops the MDATA transaction, and issues the DATA1 transaction.
The system impact of this bug is the same regardless of the failure mode observed. The host core hangs, the ehci_ctrl state machine waits for the protocol engine to send the completion status for the corrupted transaction, which never occurs. No indication is sent to the host controller driver, no register bits change and no interrupts occur. Eventually the requesting application times out.
Detailed internal behavior:
The EHCI control state machine (ehci_ctrl) in the DMA block is responsible for parsing the schedules and initiating all transactions. The ehci_ctrl state machine passes the transaction details to the protocol block by writing the transaction information in to the TxFIFO. It then asserts the pe_hst_run_pkt signal to inform the host protocol state machine (pe_hst_state) that there is a packet in the TxFIFO.
A tag of 0x0 indicates a start of packet with the data providing the following information:

35:32 Tag
31:30 Reserved
29:23 Endpoint (lowest 4 bits)
22:16 Address
15:10 Reserved
9:8 Endpoint speed
7:6 Endpoint type
5:6 Data Toggle
3:0 PID
The pe_hst_state reads the packet information and constructs the packet and issues it to the PHY interface.
The ehci_ctrl state machine writes the start transaction information in to the TxFIFO as 0x03002910c for the OUT packet that had the under run error. However, it writes 0xC3002910C for the retry of the Out transaction, which is incorrect.
The pe_hst_state enters a bus timeout state after sending the bad CRC for the packet that under ran. It then purges any data that was back filled in to the TxFIFO for the packet that under ran. The pe_hst_state machine stops purging the TxFIFO when it is empty or if it reads a location that has a tag of 0x0, indicating a start of packet command.
The pe_hst_state reads 0xC3002910C and discards it as it does not decode to a start of packet command. It continues to purge the OUT data that has been pre-buffered for the OUT retry . The pe_hst_state detects the hst_packet_run signal and attempts to read the PID and address information from the TxFIFO. This location has packet data and so does not decode to a valid PID and so falls through to the PE_HST_SOF_LOAD state where the frame_num_counter is updated. The frame_num_counter is updated with the data in the TxFIFO. In this case, the data is incorrect as the ehci_ctrl state machine did not initiate the load. The hst_pe_state machine detects the SOF request signal and sends an SOF with the bad frame number. Meanwhile, the ehci_ctrl state machine waits indefinitely in the run_pkt state waiting for the completion status from pe_hst_state machine, which will never happen.
The ISO failure case is similar except that there is no retry for ISO. The ehci_ctrl state machine moves to the next transfer in the periodic schedule. If the under run occurs on the last entry of the periodic list then it moves to the Async schedule.
In the case of ISO OUT simulations, the next ISO is a zero byte OUT and again the start of packet command gets corrupted. The TxFIFO is empty when the hst_pe_state attempts to read the Address and PID information as the transaction is a zero byte packet. This results in the hst_pe_state machine staying in the GET_PID state, which means that it does not issue any transactions (including SOFs). The device detects a Suspend condition and reverts to full speed mode and waits for a Resume or Reset signal.
The EHCI specification allows a Non-DoubleWord (32 bits) offset to be used as a current offset for Buffer Pointer Page 0 of the qTD. In Non-DoubleWord aligned cases, the core reads the packet data from the AHB memory, performs the alignment operation before writing it in to the TxFIFO as a 32 bit data word. An End Of Packet tag (EOP) is written to the TxFIFO after all the packet data has been written in to the TxFIFO. The alignment function is reset to Idle by the EOP tag. The corruption of the start of packet command arises because the packet buffer for the OUT transaction that under ran is not aligned to a DoubleWord, and hence no EOP tag is written to the TxFIFO. The alignment function is still active when the start packet information is written in to the TxFIFO for the retry of the bulk packet or for the next transaction in the case of an under run on an ISO. This results in the corruption of the start tag and the transaction information.
Click for waveform showing the command 0x 0000300291 being written in to the TX FIFO for the Out that under ran.
Click for waveform showing the command 0xC3002910C written to the TxFIFO instead of 0x 0000300291
Versions affected: Versions 2.10a and previous versions
How discovered: Customer simulation
Workaround:
1- The EHCI specification allows a non-DoubleWord offset to be used as a current offset for Buffer Pointer Page 0 of the qTD. However, if a DoubleWord offset is used then this issue does not arise.
2- Use non streaming mode to eliminate under runs.
Resolution:
The fix involves changes to the traffic state machine in the vusb_hs_dma_traf block. The ehci_ctrl state machine updates the context information by encoding the transaction results on the hst_op_context_update signals at the end of a transaction. The signal hst_op_context_update is added to the traffic state machine, and the tx_fifo_under_ran_r signal is generated if the transaction results in an under run error. Click for waveform
The traffic state machine then traverses to the do_eop states if the tx_fifo_under_ran error is asserted. Thus an EOP tag is written in to the TxFIFO as shown in this waveform .
The EOP tag resets the align state machine to the Idle state ensuring that the next command written by the echi_ctrl state machine does not get corrupted.
File(s) modified:
RTL code fixed: …..
Method of reproducing: This failure cannot be reproduced in the current test bench.
Date Found: March 2010
Date Fixed: June 2010
Update information:
Added the RTL code fix

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

9 years agoENGR00325724-4 usb: chipidea: udc: disconnect host if system enters suspend
Peter Chen [Sat, 13 Sep 2014 07:10:04 +0000 (15:10 +0800)]
ENGR00325724-4 usb: chipidea: udc: disconnect host if system enters suspend

It is better we disconnect (pulldown dp) host when the system enters
suspend if the host did not suspend bus beforehand, it can avoid
unnecessary udc suspend irq during usb enters suspend. This unexpected
suspend irq occurs due to the udc still pulls up dp, but the host
suspends bus due to it finds the device has disconnected. The device
turns off high speed terminal will be considered a disconnection event
from the host.

It also fixes the bug ENGR00325724 describes.

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

9 years agoENGR00289645 usb: chipidea: udc: don't do hardware access if gadget has stopped
Peter Chen [Tue, 26 Nov 2013 05:33:21 +0000 (13:33 +0800)]
ENGR00289645 usb: chipidea: udc: don't do hardware access if gadget has stopped

After _gadget_stop_activity is executed, we can consider the hardware
operation for gadget has finished, and the udc can be stopped and enter
low power mode. So, any later hardware operations (from usb_ep_ops APIs
or usb_gadget_ops APIs) should be considered invalid, any deinitializatons
has been covered at _gadget_stop_activity.

I meet this problem when I plug out usb cable from PC (using g_mass_storage),
my callstack like: vbus interrupt->.vbus_session->composite_disconnect
->pm_runtime_put_sync(&_gadget->dev), the composite_disconnect will
call fsg_disable, but fsg_disable calls usb_ep_disable using async way,
there are register accesses for usb_ep_disable. So sometimes, I get system
hang due to visit register without clock, sometimes not.

The Linux Kernel USB maintainer Alan Stern suggests this kinds of solution.
See: http://marc.info/?l=linux-usb&m=138541769810983&w=2.

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

9 years agoMLK-10144 thermal: imx: fix potential issues for thermal driver
Bai Ping [Mon, 26 Jan 2015 13:39:33 +0000 (21:39 +0800)]
MLK-10144 thermal: imx: fix potential issues for thermal driver

this patch fixes the thermal_zone read failed error for i.MX6SX TO 1.2 and
temp value invalid error when changing the critical trip point temp.

Signed-off-by: Bai Ping <b51503@freescale.com>
9 years agoMLK-10147 imx_v7_defconfig: remove unnessary config
Fugang Duan [Mon, 26 Jan 2015 08:18:10 +0000 (16:18 +0800)]
MLK-10147 imx_v7_defconfig: remove unnessary config

Remove unnessary config since phylib can handle Atheros AT8031 PHYs.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-10146 arm: mcc: fix one compile error when DYNAMIC_DEBUG is set
Richard Zhu [Mon, 26 Jan 2015 06:35:14 +0000 (14:35 +0800)]
MLK-10146 arm: mcc: fix one compile error when DYNAMIC_DEBUG is set

When CONFIG_DYNAMIC_DEBUG is configured, there is one
compile error in mcc_linux.c file, the memcpy() is not
defined.
Fix it by including the linux/string.h header explicitly.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
9 years agoMLK-10086-5 usb: chipidea: imx: define quirk CI_HDRC_IMX_EHCI_QUIRK
Peter Chen [Mon, 26 Jan 2015 05:05:45 +0000 (13:05 +0800)]
MLK-10086-5 usb: chipidea: imx: define quirk CI_HDRC_IMX_EHCI_QUIRK

Define quirk CI_HDRC_IMX_EHCI_QUIRK for necessary platforms.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10086-4 usb: chipidea: imx: add HSIC support
Li Jun [Tue, 20 Jan 2015 08:03:37 +0000 (16:03 +0800)]
MLK-10086-4 usb: chipidea: imx: add HSIC support

Add imx6 HSIC support

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10086-3 usb: phy-nop: add the implementation of .set_suspend
Li Jun [Tue, 20 Jan 2015 08:03:38 +0000 (16:03 +0800)]
MLK-10086-3 usb: phy-nop: add the implementation of .set_suspend

Add clock enable/disable at .set_suspend if the PHY has
suspend requirement, it can be benefit of power saving for
phy and the whole system (parent clock may also be disabled).

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10086-2 ARM: imx6: add dts entries for hsic controller
Li Jun [Tue, 20 Jan 2015 08:03:36 +0000 (16:03 +0800)]
MLK-10086-2 ARM: imx6: add dts entries for hsic controller

- Add usbphy_nop, hsic uses nop phy driver
- Add anatop phandle, hsic needs to access anatop register to
change osc clock for different boards
- Add phy_type, hsic needs to config PHY parameters at portsc
- For imx6q-arm2 board, hsic has pin conflict with ethernet, we create a
  dedicated dts(imx6q-arm2-hsic.dts) for it with ethernet disabled, besides
  please make sure keep the line of data and strobe unchanged between board
  boots up and enable hsic controller.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10086-1 usb: doc: ci-hdrc-imx: update for hsic controller
Li Jun [Tue, 20 Jan 2015 08:03:35 +0000 (16:03 +0800)]
MLK-10086-1 usb: doc: ci-hdrc-imx: update for hsic controller

Update for HSIC controller

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10132-3 usb: chipidea: udc: do not enter low power mode if vbus on
Li Jun [Fri, 23 Jan 2015 10:35:35 +0000 (18:35 +0800)]
MLK-10132-3 usb: chipidea: udc: do not enter low power mode if vbus on

This patch is to prevent usb entering low power mode if vbus is on even gadget
driver is not binded, by holding the PM count of ci->dev.
So, there are 3 pm usage_count status:
- ci->dev: 1 ci->gadget.dev: 1
  Device mode with gadget driver binded and vbus on.
- ci->dev: 1 ci->gadget.dev: 0
  USB vbus on but gadget driver not binded.
- ci->dev: 0 ci->gadget.dev: 1
  USB OTG FSM is in a_peripheral mode.
Above 2 device's pm usage_count hold by ci otg(ci->dev) and usb gadget
(ci->gadget.dev).

Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-9831-1 usb: chipidea: udc: refine ci_udc_start
Li Jun [Thu, 25 Dec 2014 09:34:01 +0000 (17:34 +0800)]
MLK-9831-1 usb: chipidea: udc: refine ci_udc_start

Use ci_hdrc_gadget_connect() API directly if vbus is on.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-9897-1 usb: chipidea: otg: use shared queue to handle hnp polling
Li Jun [Mon, 24 Nov 2014 02:00:18 +0000 (10:00 +0800)]
MLK-9897-1 usb: chipidea: otg: use shared queue to handle hnp polling

This patch moves out hnp polling from usb otg work queue to shared queue, as
hnp polling call to usb_control_msg() which sends a control message and waits
for it complete or timeout, so it's not proper to handle it in usb otg work
queue which handles work with usb irq disabled.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit a147c8808ad198a7b9694b7dd517166505b76c50)

9 years agonet: fec: fix the warning found by dma debug
Nimrod Andy [Tue, 20 Jan 2015 06:10:35 +0000 (14:10 +0800)]
net: fec: fix the warning found by dma debug

Enable kernel config "CONFIG_HAVE_DMA_API_DEBUG", FEC have kernel warning:
[    6.650444] fec 2188000.ethernet: DMA-API: device driver tries to free DMA memory it has not allocated
[    6.664289] Modules linked in:
[    6.667378] CPU: 0 PID: 3 Comm: ksoftirqd/0 Not tainted 3.19.0-rc4-00688-g8834016-dirty #150
[    6.675841] Hardware name: Freescale i.MX6 SoloX (Device Tree)
[    6.681698] Backtrace:
[    6.684189] [<80011e3c>] (dump_backtrace) from [<80011fdc>] (show_stack+0x18/0x1c)
[    6.691789]  r6:80890154 r5:00000000 r4:00000000 r3:00000000
[    6.697533] [<80011fc4>] (show_stack) from [<806d2d88>] (dump_stack+0x80/0x9c)
[    6.704799] [<806d2d08>] (dump_stack) from [<8002a4e4>] (warn_slowpath_common+0x7c/0xb4)
[    6.712917]  r5:00000445 r4:00000000
[    6.716544] [<8002a468>] (warn_slowpath_common) from [<8002a5c0>] (warn_slowpath_fmt+0x38/0x40)
[    6.725265]  r8:809a2ee8 r7:00000000 r6:00000000 r5:00000000 r4:00000042
[    6.732087] [<8002a58c>] (warn_slowpath_fmt) from [<802d6268>] (check_unmap+0x86c/0x98c)
[    6.740202]  r3:808c79bc r2:8089060c
[    6.743826] [<802d59fc>] (check_unmap) from [<802d65e4>] (debug_dma_unmap_page+0x80/0x88)
[    6.752029]  r10:00000000 r9:00000000 r8:00000000 r7:00000001 r6:be12a410 r5:00000000
[    6.759967]  r4:00000042
[    6.762538] [<802d6564>] (debug_dma_unmap_page) from [<80440248>] (fec_enet_rx_napi+0x7ec/0xb9c)
[    6.771345]  r7:00000400 r6:be3e4000 r5:bf08fa20 r4:be036000
[    6.777094] [<8043fa5c>] (fec_enet_rx_napi) from [<8056ae24>] (net_rx_action+0x134/0x324)
[    6.785297]  r10:be089e60 r9:80998180 r8:ffff8d68 r7:0000012c r6:00000040 r5:00000001
[    6.793239]  r4:be036718
[    6.795801] [<8056acf0>] (net_rx_action) from [<8002db24>] (__do_softirq+0x138/0x2d0)
[    6.803655]  r10:00000003 r9:00000003 r8:80996378 r7:8099c080 r6:00000100 r5:8099c08c
[    6.811593]  r4:00000000
[    6.814157] [<8002d9ec>] (__do_softirq) from [<8002dd00>] (run_ksoftirqd+0x44/0x5c)
[    6.821836]  r10:00000000 r9:00000000 r8:809b133c r7:00000000 r6:00000001 r5:00000000
[    6.829775]  r4:be027e80
[    6.832346] [<8002dcbc>] (run_ksoftirqd) from [<80048290>] (smpboot_thread_fn+0x154/0x1c4)
[    6.840649] [<8004813c>] (smpboot_thread_fn) from [<80044780>] (kthread+0xdc/0xf8)
[    6.848224]  r10:00000000 r8:00000000 r7:8004813c r6:be027e80 r5:be027ec0 r4:00000000
[    6.856179] [<800446a4>] (kthread) from [<8000ebc8>] (ret_from_fork+0x14/0x2c)
[    6.863425]  r7:00000000 r6:00000000 r5:800446a4 r4:be027ec0
[    6.869156] ---[ end trace 861cf914d2461a8b ]---

There have one bug in .fec_enet_tx_queue() function to unmap the DMA memory:
For SG or TSO, get one buffer descriptor and then unmap the related DMA memory, and then
get the next buffer descriptor, loop to while() to check "TX_READY". If "TX_READY" bit
still __IS__ existed in the BD (The next fraglist or next TSO packet is not transmited
complitely), exit the current clean work. When the next work is triggered, it still repeat
above step with the same BD. The potential issue is that unmap the same DMA memory for
multiple times.

The patch fix the clean work for SG and TSO packet.

Reported-by: Anand Moon <moon.linux@yahoo.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMLK-10142-3 imx_v7_defconfig: add elan touch screen support
Haibo Chen [Mon, 26 Jan 2015 05:36:54 +0000 (13:36 +0800)]
MLK-10142-3 imx_v7_defconfig: add elan touch screen support

Add elan touch screen support, default build into kernel.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
9 years agoMLK-10142-2 ARM: dts: imx6sl-evk: add elan touch support
Haibo Chen [Mon, 26 Jan 2015 05:34:28 +0000 (13:34 +0800)]
MLK-10142-2 ARM: dts: imx6sl-evk: add elan touch support

Add elan touch for i.MX6SL-EVK board.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
9 years agoMLK-10142-1 touchscreen: elan: add elan touch screen driver support
Haibo Chen [Mon, 26 Jan 2015 05:30:40 +0000 (13:30 +0800)]
MLK-10142-1 touchscreen: elan: add elan touch screen driver support

Add elan touch screen driver in linux kernel.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
9 years agoMLK-10132-1 usb: chipidea: imx: fix a typo of i.mx6sx
Li Jun [Fri, 23 Jan 2015 02:12:52 +0000 (10:12 +0800)]
MLK-10132-1 usb: chipidea: imx: fix a typo of i.mx6sx

Use imx6sx_usb_data instead of imx6sl_usb_data for i.mx6sx in
ci_hdrc_imx_dt_ids[].

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10102-11 usb: chipidea: imx: export imx_usbmisc_power_lost_check
Li Jun [Fri, 23 Jan 2015 01:58:43 +0000 (09:58 +0800)]
MLK-10102-11 usb: chipidea: imx: export imx_usbmisc_power_lost_check

Export imx_usbmisc_power_lost_check.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10131 flexcan: fix wakeup unwork issue
Dong Aisheng [Thu, 22 Jan 2015 13:48:07 +0000 (21:48 +0800)]
MLK-10131 flexcan: fix wakeup unwork issue

Original code will always disable flexcan during suspend no matter whether
wakeup feature is enabled.
It's caused by merge issue when doing kernel upgrade.

Fix it by removing that disable code.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
9 years agoath6kl: fix struct hif_scatter_req list handling
Kalle Valo [Tue, 11 Mar 2014 10:58:00 +0000 (12:58 +0200)]
ath6kl: fix struct hif_scatter_req list handling

Jason noticed that with Yocto GCC 4.8.1 ath6kl crashes with this iperf command:

iperf -c $TARGET_IP -i 5 -t 50 -w 1M

The crash was:

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

Jason's analysis:

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

   Note: This issue not observed with GCC 4.7.2, only found on the GCC 4.8.1)"

Fix this by using the normal [0] style for defining unknown number of list
entries following the struct. This also fixes corruption with scat_q_depth, which
was mistankely added to the end of struct and overwritten if there were more
than item in the scat list.

Reported-by: Jason Liu <r64343@freescale.com>
Tested-by: Jason Liu <r64343@freescale.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoMLK-10117-5:dts: Enable dispmix power management in imx6sx/sl dts
Sandor Yu [Tue, 20 Jan 2015 08:04:58 +0000 (16:04 +0800)]
MLK-10117-5:dts: Enable dispmix power management in imx6sx/sl dts

Add disp mix power management clocks to gpc item.
Add disp mix power management to lcdif, pxp and csi module.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10117-4: mxsfb: Add lcdif register config in enable panel function
Sandor Yu [Tue, 20 Jan 2015 08:02:44 +0000 (16:02 +0800)]
MLK-10117-4: mxsfb: Add lcdif register config in enable panel function

Lcdif register configuration will lost in dispmix power off,
so register should been configured again when panel power up.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10117-3:csi: remove runtime suspend/resume function
Sandor Yu [Wed, 21 Jan 2015 05:33:01 +0000 (13:33 +0800)]
MLK-10117-3:csi: remove runtime suspend/resume function

CSI v4l2 capture driver have involved to generic pm domain,
runtime_suspend/resume function will been called when system
suspend/resume. It will cause request_bus_freq/release_bus_freq
called counter mismatch.
So move request_bus_freq/release_bus_freq function to
device open/close function.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10117-2:pxp: Remove runtime suspend/resume function
Sandor Yu [Wed, 21 Jan 2015 05:27:24 +0000 (13:27 +0800)]
MLK-10117-2:pxp: Remove runtime suspend/resume function

pxp module have involved to generic pm domain,
runtime_suspend/resume function will called when system
suspend/resume. It will cause request_bus_freq/release_bus_freq
called counter mismatch.
So move request_bus_freq/release_bus_freq to clk_enable/disable
function.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10117-1: gpc: add dispmix power save feature
Sandor Yu [Tue, 20 Jan 2015 08:00:37 +0000 (16:00 +0800)]
MLK-10117-1: gpc: add dispmix power save feature

Add dispmix power save feature to generic power domain.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoENGR00319720-9 Documentation: usb: chipidea: Update test procedure for HNP polling...
Li Jun [Wed, 25 Jun 2014 07:28:45 +0000 (15:28 +0800)]
ENGR00319720-9 Documentation: usb: chipidea: Update test procedure for HNP polling support

Update HNP test procedure as HNP polling is supported.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoENGR00319720-7 usb: chipidea: otg_fsm: set host request flag via sys input
Li Jun [Mon, 23 Jun 2014 11:51:42 +0000 (19:51 +0800)]
ENGR00319720-7 usb: chipidea: otg_fsm: set host request flag via sys input

This patch sets host request flag with sys input when a A device
sets a_bus_req or a B device sets b_bus_req as peripheral role.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10051-2 usb: common: otg: set feature of b_hnp_enable after host request flag...
Li Jun [Wed, 24 Dec 2014 10:23:39 +0000 (18:23 +0800)]
MLK-10051-2 usb: common: otg: set feature of b_hnp_enable after host request flag is set

The A-device is required to set this feature and suspend the bus within
THOST_REQ_SUSP when it determines that the B-device wishes to become host
(host_req_flag = TRUE). So this patch does this if host request flag is set
and a_set_b_hnp_en has not been set.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoENGR00319720-6 usb: chipidea: otg_fsm: add HNP polling support
Li Jun [Mon, 23 Jun 2014 08:11:12 +0000 (16:11 +0800)]
ENGR00319720-6 usb: chipidea: otg_fsm: add HNP polling support

This patch adds HNP polling support for chipidea otg fsm driver, which
adds a SW timer to send HNP polling request.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoENGR00319720-5 usb: chipidea: udc: add OTG status request handling
Li Jun [Mon, 23 Jun 2014 07:50:50 +0000 (15:50 +0800)]
ENGR00319720-5 usb: chipidea: udc: add OTG status request handling

Peripheral answers OTG status selector request from host according to
host request flag of gadget, length is 1. this flag may be set by application
via sysfs.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-9794-2 usb: common: otg: clear host_request_flag when leaves peripheral
Li Jun [Tue, 4 Nov 2014 12:12:31 +0000 (20:12 +0800)]
MLK-9794-2 usb: common: otg: clear host_request_flag when leaves peripheral

This patch clear host_request_flag when leaves peripheral state, instead of
entering host state, this can make sure this flag can be cleared after try
to do role switch, no matter the role switch succeeds or not.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoENGR00319720-3 usb: common: otg-fsm: add HNP polling request sending funciton
Li Jun [Fri, 16 May 2014 19:15:34 +0000 (03:15 +0800)]
ENGR00319720-3 usb: common: otg-fsm: add HNP polling request sending funciton

This patch adds OTG status selector request sending function, can be used
to poll peripheral if it wants to be host.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoENGR00319720-2 usb: common: otg-fsm: start HNP polling timer in host state
Li Jun [Fri, 16 May 2014 19:15:34 +0000 (03:15 +0800)]
ENGR00319720-2 usb: common: otg-fsm: start HNP polling timer in host state

This patch starts HNP polling timer when otg is set to be a_host
or b_host.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoENGR00319720-1 usb: gadget: add host_request_flag in usb_gadget for OTG
Li Jun [Mon, 23 Jun 2014 07:39:35 +0000 (15:39 +0800)]
ENGR00319720-1 usb: gadget: add host_request_flag in usb_gadget for OTG

This patch adds host_request_flag in usb_gadget to store host request
information from application.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-9833-1 ARM: imx6sx: only set can clock parent when M4 disabled
Dong Aisheng [Tue, 11 Nov 2014 13:04:07 +0000 (21:04 +0800)]
MLK-9833-1 ARM: imx6sx: only set can clock parent when M4 disabled

Since CAN device is allocated to run on M4 and handled by M4 if M4 is enabled,
so we do not set CAN parent clock when M4 is enabled.

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

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>