]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agoENGR00239905 PCIe Enable PCIe switch support
Richard Zhu [Mon, 7 Jan 2013 05:26:03 +0000 (13:26 +0800)]
ENGR00239905 PCIe Enable PCIe switch support

PCIe switch access mechanism:
 - CfgRd0/CfgWr0 is used to access the CFG space of the EP device
 or the upstream port of PCIe switch that is connected to RC directly.
 - CfgRd1/CfgWr1 is used to access the CFG space of the downstream port
 of PCIe switch and so on cases.

UR and kernel crash problem:
i.MX6 PCIe maps UR(Unsupported Request)err to AXI SLVERR err, which would
cause the arm data abort exception.
There is one "Received Master Abort" in iMX6 Root complex Secondary
status register when a requester receives a Completion
with Unsupported Request Completion Status.
In this case, the Linux kernel would be crashed.

Workaround: correct this imprecise external abort.

Signed-off-by: Richard Zhu <r65037@freescale.com>
11 years agoENGR00239569 Mx6x HDMI Add RGB/YCbCr output select via system file
Sandor Yu [Thu, 10 Jan 2013 06:52:06 +0000 (14:52 +0800)]
ENGR00239569 Mx6x HDMI Add RGB/YCbCr output select via system file

Add RGB/YCbCr output select via system file,
the default output is RGB.

Signed-off-by: Sandor Yu <R01008@freescale.com>
11 years agoENGR00239207 MX6x HDMI add some support modes
Sandor Yu [Tue, 8 Jan 2013 07:11:18 +0000 (15:11 +0800)]
ENGR00239207 MX6x HDMI add some support modes

Remove video mode 2880x480p60 that not supported by IPU.
Add video mode 1080p25, 1080p30, 720p100, 720p120, 1440x480p60,
1440x288p50, 1440x576p50.

Signed-off-by: Sandor Yu <R01008@freescale.com>
11 years agoENGR00232755 USB: disable clock and abnormal wakeup when remove gadget driver
make shi [Thu, 10 Jan 2013 05:16:24 +0000 (13:16 +0800)]
ENGR00232755 USB: disable clock and abnormal wakeup when remove gadget driver

- In current bsp, the usb clock mismatch when rmmod gadget class driver. The
  clock should be turn off when gadget class driver unregister.
- There is an abnormal usb wakeup interrupt happen if phy is no power without
  VBUS. If we unplug the usb cable after unregister usb gadget driver, it is
  difficult to handle the unexpected usb wakeup interrupt. SO we must call
  dr_discharge_line()  to make sure no abnormal usb wakeup interrupt happen in
  usb unregister gadget class driver.

Signed-off-by: make shi <b15407@freescale.com>
11 years agoENGR00237682-3: mxc_v4l2_capture: ov5640: support scaling modes
Sheng Nan [Tue, 8 Jan 2013 09:32:25 +0000 (17:32 +0800)]
ENGR00237682-3: mxc_v4l2_capture: ov5640: support scaling modes

The method for change between scaling and subsampling mode is different
from ov5640_mipi.
(image bigger than 1280*960 is scaling mode, smaller is subsampling).

According to OV5640 Auto Focus Camera Module Application Notes
(with DVP Interface) R2.14.pdf,
change back from QSXGA to VGA, don't need to do exposure calculation.

According to the test result, if we do exposure calculation when change
back from scaling to subsampling mode, the image would be dark.

So the method is:
Change to scaling mode, go through exposure calcuation.
Change to or back to subsampling mode, change mode directly.

Supported mode:
- QSXGA@7.5fps
- 1080P@7.5fps

Can't make 1080P works at 15fps. Here is a reply from ov fae:
because of scaling down, max frame for 1080P is the same as 5M, both are 15fps.
so if 5M can runs up to 7.5fps on your demo, then 1080P is the same 7.5fps max.

Signed-off-by: Sheng Nan <b38800@freescale.com>
11 years agoENGR00237682-2: mxc_v4l2_capture: ov5640: support all subsampling modes
Sheng Nan [Wed, 19 Dec 2012 10:39:46 +0000 (18:39 +0800)]
ENGR00237682-2: mxc_v4l2_capture: ov5640: support all subsampling modes

Supported the following modes, verified image quality and frame rate
- VGA 30/15fps
- QVGA 30/15fps
- NTSC 30/15fps
- PAL 30/15fps
- 720P 30/15fps
Note: use the same setting as app note of ov5640 dvp
- QCIF 30/15fps
- XGA 22.5/15fps
Note: cannot make XGA work on 30fps. Just a reference of ov5640 datasheet:
1280*960 YUV422 maximum at 22.5fps.
1280*720 YUV422 maximum at 30fps.
Need to confirm later.

Signed-off-by: Sheng Nan <b38800@freescale.com>
11 years agoENGR00237706: mxc_v4l2_capture: ov5640: correct the behavior of ENUM_FMT
Sheng Nan [Wed, 19 Dec 2012 09:27:42 +0000 (17:27 +0800)]
ENGR00237706: mxc_v4l2_capture: ov5640: correct the behavior of ENUM_FMT

ov5640 ioctl_enum_fmt_cap only returns value of index = 0;
before support other formats, correct the behavior of this ioctl.

- ENUM_FMT returns all the supported format.

Signed-off-by: Sheng Nan <b38800@freescale.com>
11 years agoENGR00237682-1: mxc_v4l2_capture: ov5640: use global initialization
Sheng Nan [Wed, 19 Dec 2012 07:58:58 +0000 (15:58 +0800)]
ENGR00237682-1: mxc_v4l2_capture: ov5640: use global initialization

The current code struct of parallel ov5640 set mode directly.
The newest settings need to go through global initialization.
New settings are provided by ov company

So this patch does:
- Make parallel ov5640 mode settings go through global initialization.
- Only VGA (640 * 480) are provided as a validation of the new setting.
- Other modes will be provided in the later patches.

Signed-off-by: Sheng Nan <b38800@freescale.com>
11 years agoENGR00237364: board-mx6q_sabreauto fix adv7180 tvin powerdown
Adrian Alonso [Tue, 11 Dec 2012 00:40:38 +0000 (18:40 -0600)]
ENGR00237364: board-mx6q_sabreauto fix adv7180 tvin powerdown

* Fix adv7180 tvin powerdown function
  gpio power pin already exported in io-mux setup function
  no need to request/free gpio
* Update copyrigth year 2013.

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
11 years agofix echo 1 > compact_memory return error issue
Jason Liu [Tue, 8 Jan 2013 08:13:07 +0000 (16:13 +0800)]
fix echo 1 > compact_memory return error issue

when run the folloing command under shell, it will return error
sh/$ echo 1 > /proc/sys/vm/compact_memory
sh/$ sh: write error: Bad address

After strace, I found the following log:
...
write(1, "1\n", 2)               = 3
write(1, "", 4294967295)         = -1 EFAULT (Bad address)
write(2, "echo: write error: Bad address\n", 31echo: write error: Bad address
) = 31

This tells system return 3(COMPACT_COMPLETE) after write data to compact_memory.

The fix is to make the system just return 0 instead 3(COMPACT_COMPLETE) from
sysctl_compaction_handler after compaction_nodes finished.

Signed-off-by: Jason Liu <r64343@freescale.com>
Suggested-by: David Rientjes <rientjes@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoENGR00232879 mx6sl: EPDC VDDH and VPOS power on/off sequence is wrong
Peter Chan [Tue, 8 Jan 2013 08:04:41 +0000 (16:04 +0800)]
ENGR00232879 mx6sl: EPDC VDDH and VPOS power on/off sequence is wrong

VDDH should only be ON after VPOS when power up and should be off
before VPOS when power down. Set the appropriate MAX17135 timing
parameters for the correct power up/down sequence

Signed-off-by: Peter Chan <B18700@freescale.com>
11 years agoENGR00239062 MX6X HDMI add 1440x240p60 mode support
Sandor Yu [Mon, 7 Jan 2013 08:29:23 +0000 (16:29 +0800)]
ENGR00239062 MX6X HDMI add 1440x240p60 mode support

Adjust 1440x240p60 timing to pass HDMI compliance test.

Signed-off-by: Sandor Yu <R01008@freescale.com>
11 years agoENGR00239187 input: novatek_ts: fix some point not release issue.
Zhang Jiejing [Tue, 8 Jan 2013 04:42:15 +0000 (12:42 +0800)]
ENGR00239187 input: novatek_ts: fix some point not release issue.

This issue is caused by Touch Screen F/W, and it will report a
full package with 0xFF * 6 to notice the point was release.

Add this workaround to fix this issue, fixup the wrong finger id.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
11 years agoENGR00238813 ASRC: add check before release ASRC pair
Chen Liangjun [Fri, 4 Jan 2013 03:49:43 +0000 (11:49 +0800)]
ENGR00238813 ASRC: add check before release ASRC pair

Add check before relase ASRC pair to prevent ASRC register operation
while clock is not enabled. The ASRC clock is disable while index is not
applied.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
11 years agoENGR00238237-2 mx6sl: csi/v4l: Initialize the variable cam_fmt
Robby Cai [Sat, 5 Jan 2013 10:44:29 +0000 (18:44 +0800)]
ENGR00238237-2 mx6sl: csi/v4l: Initialize the variable cam_fmt

This patch fixed the cam_fmt uninitialization issue.

Signed-off-by: LiGang <b41990@freescale.com>
Signed-off-by: Robby Cai <R63905@freescale.com>
(cherry picked from commit 48a48ea30c6e55e44c9eacaad316b5caa04a3dda)

11 years agoENGR00238237-1 mx6sl: csi/v4l: fix camera picture flickering issue
Robby Cai [Wed, 26 Dec 2012 07:26:39 +0000 (15:26 +0800)]
ENGR00238237-1 mx6sl: csi/v4l: fix camera picture flickering issue

Flickering issue happens when there's no buffer to be processed(e.g., the
pace of QBUF is much slower than DQBUF). The cause is the hardware is using
double buffering, while the driver has no good protection at above case and
thus the CSI will fill the buffer not in the right order. The way to fix is
refining the output of the working_q buffer list, that is, if there's no buffer
to be processed then output to a dummy buffer.

Another important change is to only do DMA reflash operation when SOF is
detected in streamon. Remove this operation is CSI interrupt handler because
it violates to the SPEC (only do DMA reflash before DMA is enabled but NOT at
the time or after DMA's enabled).

Signed-off-by: LiGang <b41990@freescale.com>
Signed-off-by: Robby Cai <R63905@freescale.com>
(cherry picked from commit 0c4584763fa44b01a2f48198fa27c9206a116164)

11 years agoENGR00238947 [GPU]Integrate Vivante 4.6.9p10 gpu driver kernel part code
Loren Huang [Thu, 3 Jan 2013 12:16:41 +0000 (20:16 +0800)]
ENGR00238947 [GPU]Integrate Vivante 4.6.9p10 gpu driver kernel part code

Integrate both 4.6.9p9.1 and 4.6.9p10.

Signed-off-by: Loren Huang <b02279@freescale.com>
Acked-by: Lily Zhang
11 years agoENGR00238943 wm8962: add judgement for no det_pin case
Gary Zhang [Sat, 5 Jan 2013 02:28:59 +0000 (10:28 +0800)]
ENGR00238943 wm8962: add judgement for no det_pin case

add judgement to avoid no detect pin case

Signed-off-by: Gary Zhang <b13634@freescale.com>
11 years agoENGR00238307 MX6SL_EVK bluetooth: Add support to Silex SXSDMAN module
Lionel Xu [Thu, 27 Dec 2012 02:26:41 +0000 (10:26 +0800)]
ENGR00238307 MX6SL_EVK bluetooth: Add support to Silex SXSDMAN module

mx6sl_evk board uses Silex SXSDMAN board for bluetooth, add uart4 driver
to support it.

Signed-off-by: Lionel Xu <Lionel.Xu@freescale.com>
11 years agoENGR00238281 MX6SL_EVK: Add rfkill interface to bluetooth
Lionel Xu [Wed, 26 Dec 2012 05:54:49 +0000 (13:54 +0800)]
ENGR00238281 MX6SL_EVK: Add rfkill interface to bluetooth

MX6SL EVK board uses Silex SX-SDMAN board for bluetooth.
Add rfkill interface to control SX-SDMAN reset.
The reset signal is required before using bluetooth.

Signed-off-by: Lionel Xu <R63889@freescale.com>
11 years agoENGR00238809-2 mx6sl: ssi: add IRAM support
Gary Zhang [Fri, 4 Jan 2013 02:09:00 +0000 (10:09 +0800)]
ENGR00238809-2 mx6sl: ssi: add IRAM support

locate SSI playback buffer into IRAM in mx6sl.
because left IRAM room is not enough to contain record
buffer, if IRAM allocation for record fails, record
buffer will use external ram

Signed-off-by: Gary Zhang <b13634@freescale.com>
11 years agoENGR00238809-1 mx6sl: clock: add dependency of IRAM clk
Gary Zhang [Fri, 4 Jan 2013 01:38:23 +0000 (09:38 +0800)]
ENGR00238809-1 mx6sl: clock: add dependency of IRAM clk

when IRAM is used by SSI, add IRAM clock dependency to
SSI clock

Signed-off-by: Gary Zhang <b13634@freescale.com>
11 years agoENGR00238439 ASRC: add delay before reading ASRC FIFO status
Chen Liangjun [Fri, 28 Dec 2012 08:42:42 +0000 (16:42 +0800)]
ENGR00238439 ASRC: add delay before reading ASRC FIFO status

ASRC driver would read the sample number of ASRC output FIFO to fetch
the data from ASRC output FIFO. However, SDMA's fetching operation may
not finished before ASRC's reading. In this case, ASRC driver may read a
error data from the register.

In this patch, add delay before reading ASRC FIFO status to prevent
noise.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
11 years agoENGR00238391 MX6x HDMI: Add default EDID config function when read EDID failed
Sandor Yu [Thu, 27 Dec 2012 10:14:52 +0000 (18:14 +0800)]
ENGR00238391 MX6x HDMI: Add default EDID config function when read EDID failed

Add default EDID config function when read EDID failed.
Fix HDMI no audio issue  when failed read EDID.

Signed-off-by: Sandor Yu <R01008@freescale.com>
11 years agoENGR00238384 MX6x HDMI: Update HDMI setting when HDMI cable plugin
Sandor Yu [Thu, 27 Dec 2012 09:13:28 +0000 (17:13 +0800)]
ENGR00238384 MX6x HDMI: Update HDMI setting when HDMI cable plugin

Update HDMI setting when HDMI cable plugin,
HDMI will catch capbility update with EDID data updated.

Signed-off-by: Sandor Yu <R01008@freescale.com>
11 years agoENGR00238382 MX6 HDMI: Change VGA mode flag, adjust default modelist sequency
Sandor Yu [Thu, 27 Dec 2012 08:49:37 +0000 (16:49 +0800)]
ENGR00238382 MX6 HDMI: Change VGA mode flag, adjust default modelist sequency

- Change VGA mode the flag from unknow to VESA.
- Adjust default modelist order, put the VESA to the end of modelist.
- Fix a build warning.

Signed-off-by: Sandor Yu <R01008@freescale.com>
11 years agoENGR00238357 MX6x Change HDMI default output RGB
Sandor Yu [Thu, 27 Dec 2012 03:32:05 +0000 (11:32 +0800)]
ENGR00238357 MX6x Change HDMI default output RGB

Change HDMI default output RGB

Signed-off-by: Sandor Yu <R01008@freescale.com>
11 years agoENGR00238201-2 V4L2:ADV7180:driver kconfig change
guoyin.chen [Tue, 25 Dec 2012 02:52:06 +0000 (10:52 +0800)]
ENGR00238201-2 V4L2:ADV7180:driver kconfig change

Move ADV7180 out of choice to make it be enabled with other
camera config simultaneously

Signed-off-by: guoyin.chen <guoyin.chen@freescale.com>
(cherry picked from commit a6becd9a87da4fe0bdcc0e96d690377078c856b9)

11 years agoENGR00238201-1 V4L2:ADV7180:Support ioctrl_enum_framesizes
guoyin.chen [Tue, 25 Dec 2012 02:48:23 +0000 (10:48 +0800)]
ENGR00238201-1 V4L2:ADV7180:Support ioctrl_enum_framesizes

Add ioctl_enum_framesizes function to align the requirement
of Camera HAL in Android

Signed-off-by: guoyin.chen <guoyin.chen@freescale.com>
(cherry picked from commit fd0a1be3e55c3ca5b16f5bf89a24c62b1f3f3abe)

11 years agoENGR00236141 csi:Add stride alignment setting from userspace
guoyin.chen [Fri, 7 Dec 2012 02:39:57 +0000 (10:39 +0800)]
ENGR00236141 csi:Add stride alignment setting from userspace

In android, IPU fills the I420 buffer. And GPU shows the buffer to display.
mx6's GPU has 32 Y-stride alignment for I420. The stride alignment will
be passed through by bytesperline. This update is only for
csi->smfc->mem channel.

Signed-off-by: guoyin.chen <guoyin.chen@freescale.com>
(cherry picked from commit 4708dc1999ed4857799100434e4f46f68f4e7c13)

11 years agoENGR00237742 busfreq:fix IPG_PERCLK will be decreased to 6M once exit low bus
Robin Gong [Wed, 19 Dec 2012 10:48:45 +0000 (18:48 +0800)]
ENGR00237742 busfreq:fix IPG_PERCLK will be decreased to 6M once exit low bus

on Sabresd board, IPG_PERCLK will be fixed on 6Mhz once system enter low bus,
and never restore to 22Mhz which be set in boot.  It means some device clock
which sourcing from IPG_PERCLK such as I2C will be slow down. The root cause is
that there is workaround for GPT timer of Arik TO1.0 in mx6_ddr_freq.S. GPT
clock source from IPG_PERCLK on TO1.0 and should be fixed on 6Mhz. But for
TO1.1 and TO1.2 ,the workaround should be removed.
Signed-off-by: Robin Gong <B38343@freescale.com>
11 years agoENGR00237678 IPUv3:Clean up sync and error interrupt
Liu Ying [Wed, 19 Dec 2012 06:46:06 +0000 (14:46 +0800)]
ENGR00237678 IPUv3:Clean up sync and error interrupt

1) Split sync and error interrupt handler into 2 different
   handlers, so that we may save several CPU cycles to
   handler sync interrupt which is triggered in most IPU
   usecases.
2) So far, every IPUv3 version in different SoCs has sync
   and error interrupts, so we return -ENODEV if they cannot
   be gotten from platform resource. Then, we may request
   them directly but do not check more.
3) Clean up free irq code by removing unnecessary check.

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

11 years agoENGR00236910 wm8962: use alsa jack mechanism to handle pin detection
Gary Zhang [Tue, 18 Dec 2012 07:15:25 +0000 (15:15 +0800)]
ENGR00236910 wm8962: use alsa jack mechanism to handle pin detection

use alsa jack mechanism to handle pin detection

Signed-off-by: Gary Zhang <b13634@freescale.com>
11 years agoENGR00236240 i2c: i2c performance optimization
Fugang Duan [Fri, 7 Dec 2012 10:48:34 +0000 (18:48 +0800)]
ENGR00236240 i2c: i2c performance optimization

It is unnecessary to calculate and update i2c divider during
every transaction. Only do it if current i2c clock is different
with the previous clock frequency.

Signed-off-by: Fugang Duan <B38611@freescale.com>
11 years agoENGR00236879 Enhance VPU driver to handle API call sequence abnormal abort
Hongzhang Yang [Thu, 13 Dec 2012 08:44:16 +0000 (16:44 +0800)]
ENGR00236879 Enhance VPU driver to handle API call sequence abnormal abort

Some application may exit without calling neccessay API to wrap up VPU
after it receives error message.

This could lead to system hang because driver will power off VPU
(vpu_release) while VPU may still be busy.

We require application to strictly follow the API call sequence even in
error handling case. Meanwhile, we enhance VPU driver to protect against
such abnormal abort, to prevent system hang at least.

If the last instance is closed, VPU will gate off or power off only if
VPU is idle.

Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
11 years agoENGR00231808: Add epdc pmic shut down feature
LiGang [Wed, 14 Nov 2012 02:12:53 +0000 (10:12 +0800)]
ENGR00231808: Add epdc pmic shut down feature

For some cases, system maybe restart with epdc pmic on.
If epdc pmic on for sometime(2~3s), the current epdc pmic consume will increase
obviously, then the total current of board maybe exceed to the current limit,
which will pull down the input voltage to lead to the system pmic reset,
an un-expected POR reset occurs.
So it is necessary to close epdc pmic before system restart.

This patch is added by Robby Cai<r63905@freescale.com>

Signed-off-by: LiGang <b41990@freescale.com>
(cherry picked from commit ee9ffb4307b2b3d7440fc3468b0faaace3d2829e)

11 years agoENGR00236722 mx6sl: csi: Ensure dma reflash operation done when dma is disabled
Robby Cai [Mon, 10 Dec 2012 09:13:45 +0000 (17:13 +0800)]
ENGR00236722 mx6sl: csi: Ensure dma reflash operation done when dma is disabled

If do dma reflash operation when dma is enabled, the system will hang and we
can not connect to the core through jtag. The reason is the reflash signal
(DMA_REFLASH_RFF) will initialize the AHB bus signals and it indeed seems to
modify the AHB address on the clock as soon as the programmable register value
is changed, the bus may not respond.

This patch revised it according to the RM:
"Reflash DMA Controller for RxFIFO. This bit reflash the embedded DMA controller
for RxFIFO. It should be reflashed before the embedded DMA controller starts
to work."

Signed-off-by: Robby Cai <R63905@freescale.com>
11 years agoENGR00236137 mx6sl: csi: Change video buffer access mode to writecombine
Robby Cai [Thu, 6 Dec 2012 10:15:27 +0000 (18:15 +0800)]
ENGR00236137 mx6sl: csi: Change video buffer access mode to writecombine

Change buffer access mode from noncached to writecombine for better
performance.

Signed-off-by: Robby Cai <R63905@freescale.com>
11 years agoENGR00229855 mx6sl: csi: can not support two camera instances
Robby Cai [Thu, 29 Nov 2012 09:58:43 +0000 (17:58 +0800)]
ENGR00229855 mx6sl: csi: can not support two camera instances

run two unit test instances as follows fails (sometimes kernel dump).
/unit_tests/csi_v4l2_capture.out &
/unit_tests/csi_v4l2_capture.out

Fix by improving the resource lock.
- We get busy_lock semaphore before we get a dqueue event, so, when user
  is blocked at DQBUF ioctrl, the user will also be blocked at QBUF ioctrl,
  then the video performance will drop. This patch changes to get busy_lock
  semaphore to protect DQBUF ioctrl until we successfully get a dqueue event.
- Use queue_int_lock spinlock to protect cam->ping_pong_csi, since it can be
  modified either in irq handler or in queue event.
- linked list should be protected by the lock:
  -- Use queue_int_lock and dqueue_int_lock spinlocks to protect working_q/
     ready_q/done_q in the end of frame interrupt handler camera_callback(),
     in case, the handler and VIDIOC_QBUF/VIDIOC_DQBUF ioctrls are called on
     different threads at same time.
  -- Protect ready_q with queue_int_lock spinlock in streamon(), in case,
     VIDIOC_STREAMON and VIDIOC_QBUF ioctrls are called on different threads
     at same time.

Signed-off-by: Robby Cai <R63905@freescale.com>
11 years agoENGR00236837 MX6SL-Fix random crash caused by incorrect setting of IPG clk rate.
Ranjani Vaidyanathan [Tue, 11 Dec 2012 23:50:33 +0000 (17:50 -0600)]
ENGR00236837 MX6SL-Fix random crash caused by incorrect setting of IPG clk rate.

Need to ensure that bus frequency setpoint is changed only if
the system is not already at the requested setpoint.
Changing the bus freq to high setpoint when its already at
high setpoint causes the AHB/IPG dividers to be set incorrectly.
Then when the system enters WAIT mode, the 12:5 ratio of
ARM_CLK:IPG_CLK is no longer maintained.
This causes random crashes.
Fix is to return immediately if the bus is already at the
requested setpoint

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
11 years agoENGR00223037-1 pmic: Fix the bug of pmic I2C
Zhang Xiaodong [Wed, 12 Dec 2012 07:57:31 +0000 (15:57 +0800)]
ENGR00223037-1 pmic: Fix the bug of pmic I2C

Fix the bug of wm831x pmic I2C

Signed-off-by: Zhang Xiaodong <B39117@freescale.com>
Acked-by: Lily Zhang
11 years agoENGR00236169 MX6 USB :kfree udc_controller when remove udc driver
make shi [Mon, 10 Dec 2012 08:40:05 +0000 (16:40 +0800)]
ENGR00236169 MX6 USB :kfree udc_controller when remove udc driver

Kree and reset udc_controller should be done when remove udc driver to avoid
kernel dump during modprobe gadget driver after modprobe and rmmod udc driver.

Signed-off-by: make shi <b15407@freescale.com>
11 years agoENGR00236020-2 wm8962: hp/speaker switching afer resume
Gary Zhang [Tue, 11 Dec 2012 05:48:05 +0000 (13:48 +0800)]
ENGR00236020-2 wm8962: hp/speaker switching afer resume

implement headphone and speaker automatically switch
even if headphone is plugin/out during suspend

Signed-off-by: Gary Zhang <b13634@freescale.com>
11 years agoENGR00236020-1 ALSA: add calling of trigger in machine driver
Gary Zhang [Tue, 11 Dec 2012 04:42:42 +0000 (12:42 +0800)]
ENGR00236020-1 ALSA: add calling of trigger in machine driver

soc_pcm_trigger() calls trigger functions of cpu_dai, codec_dai
and platform, but the trigger function of machine is not called.
add calling of trigger in machine driver in soc_pcm_trigger()

Signed-off-by: Gary Zhang <b13634@freescale.com>
11 years agoENGR00235817 mx6: use SNVS LPGPR register to store boot mode value.
Zhang Jiejing [Tue, 11 Dec 2012 07:34:25 +0000 (15:34 +0800)]
ENGR00235817 mx6: use SNVS LPGPR register to store boot mode value.

After using POR reset, the content in SRC will be reset.
See RM: 63.5.1.2.3 IPP_RESET_B(POR)

Because POR reset will reset most of register in IC, so use
SNVS_LP General Purpose Register (LPGPR) to store the boot mode value.

Below copy from SNVS_BlockGuide.pdf:
The SNVS_LP General Purpose Register provides a 32 bit read write
register, which can be used by any application for retaining 32 bit
data during a power-down mode

This Patch will use [7,8] bits of this register.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
11 years agoENGR00236499 ASRC: fix build warning
Chen Liangjun [Tue, 11 Dec 2012 06:47:09 +0000 (14:47 +0800)]
ENGR00236499 ASRC: fix build warning

Remove unused function "asrc_get_output_buffer_size()" to fix build
warning.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
11 years agoENGR00236196: mxc_vout: add YV12 format support in enum fmt field.
Sheng Nan [Fri, 7 Dec 2012 09:08:07 +0000 (17:08 +0800)]
ENGR00236196: mxc_vout: add YV12 format support in enum fmt field.

Since YV12 format is supported in mxc_v4l2_capture, it should be also
supported in mxc_vout.

Signed-off-by: Sheng Nan <b38800@freescale.com>
11 years agoENGR00235665: mxc_v4l2_capture: add YV12 format support in camera driver
Sheng Nan [Wed, 5 Dec 2012 02:22:35 +0000 (10:22 +0800)]
ENGR00235665: mxc_v4l2_capture: add YV12 format support in camera driver

Android CTS verifier have a must requirement for YV12 format. Since IPUv3
common driver has supported IPU_PIX_FMT_YVU420P pixel format, add the
support of YV12 format in mxc_v4l2_capture.

Signed-off-by: Sheng Nan <b38800@freescale.com>
11 years agoENGR00236031 MX6 USB :Change default USB H1 and OTG driver load order
make shi [Thu, 6 Dec 2012 09:19:30 +0000 (17:19 +0800)]
ENGR00236031 MX6 USB :Change default USB H1 and OTG driver load order

In current linux BSP USB H1 driver default load before otg driver load,
which cause USBx not match the ehci controller number. like bellow:

root@freescale /sys/devices/platform/fsl-ehci.0$ ls
driver     modalias   pools      power      subsystem  uevent     usb2
root@freescale /sys/devices/platform/fsl-ehci.1$ ls
driver     modalias   pools      power      subsystem  uevent     usb1

Signed-off-by: make shi <b15407@freescale.com>
11 years agoENGR00235624 Quad/DualLite ARD: MTD partition non aligned
Alejandro Sierra [Mon, 3 Dec 2012 23:59:02 +0000 (17:59 -0600)]
ENGR00235624 Quad/DualLite ARD: MTD partition non aligned

MTD partition for SPI-NOR was not aligned to 8K.
Replace its offset from MTDPART_OFS_APPEND to MTDPART_OFS_NXTBLK.

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
11 years agoENGR00232530 Refine VPU suspend/resume according to open_count
Hongzhang Yang [Tue, 6 Nov 2012 06:49:38 +0000 (14:49 +0800)]
ENGR00232530 Refine VPU suspend/resume according to open_count

1. Refine VPU suspend/resume according to open_count to completely
fix bug: ENGR00230203 [Android_MX6DL_SD] Gallery: System hang
after resume from suspend during video playback. 20%

open_count == 0 case can be simplified because VPU is released
(all instances are freed), so
- clock is already off
- context is no longer needed
- power is already off on MX6

VPU reset is removed from resume because power is ensured to be off
before entering resume on MX6 by calling regulator API.

2. Fix bug: VPU always busy after suspend/resume

Error log (VPU refused to suspend due to VPU busy):
pm_op(): platform_pm_suspend+0x0/0x54 returns -11
PM: Device mxc_vpu failed to suspend: error -11
PM: Some devices failed to suspend

Root cause:
- Suspend happened during vpu_Init(), somewhere after VPU lib started
  to download FW (when PC == 0), but before run FW. (BIT_BUSY_FLAG=1,
  BIT_CODE_RUN=1).
- In such case, VPU resume downloaded FW and run VPU to idle because
  suspend was triggered after VPU was opened (active).
- vpu_Init run VPU again with BIT_BUSY_FLAG=1. So VPU was trapped in
  idle loop but BIT_BUSY_FLAG was never cleared. VPU lib regarded VPU
  as always busy.

Solution (in VPU resume):
- run VPU FW only if VPU was opened and PC before suspend is not 0
- restore host register is required
- download FW is required, because program memory is lost after power
  off.

Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
11 years agoENGR00235626 FEC: Enable phy pause frame feature
Fugang Duan [Thu, 29 Nov 2012 08:55:12 +0000 (08:55 +0000)]
ENGR00235626 FEC: Enable phy pause frame feature

Since some ethernet MAC flow control is relied on phy pause
status, both link partners exchange information via auto neg to
determine if both parties are capable of flow control.
Advertise phy pause frame to avoid pause frame is not responsed
by the other net node.

Signed-off-by: Fugang Duan <B38611@freescale.com>
11 years agoENGR00235630 MX6 USB :fix USB does not work when plug in device during suspend
make shi [Wed, 5 Dec 2012 06:31:41 +0000 (14:31 +0800)]
ENGR00235630 MX6 USB :fix USB does not work when plug in device during suspend

USB does not work when plug in a usb device during system suspend. Under this
case, USB driver will be in low power mode, but WIE bit not be set if usb wake
up is not enabled.So there are only ID change interrupt no USB wakeup interrupt
after system resume.In current bsp, after system resume ID change status not be
clear,and ID change interrupt will continue happen, which cause the system busy.
No checking WIR bit if ID change interrupt happen when USB in low power mode to
fix this issue.

Signed-off-by: make shi <b15407@freescale.com>
11 years agoENGR00234722 USB: fix Kernel dump issue after USB driver loadable
make shi [Thu, 29 Nov 2012 08:28:25 +0000 (16:28 +0800)]
ENGR00234722 USB: fix Kernel dump issue after USB driver loadable

- It is better to disable otgsc and wake up interrupt to avoid an
  abnormal interrupt happen during USB driver being removed.
- If the USB host is already at low power mode, only need turn on
  the clock, no need turn off the clock.
- Need discharge dp and dm during USB driver being removed ,in order
  to avoid a wakeup interrupt happen. And if the USB otg is in host
  mode, we should clear discharge dp and dm in fsl_otg_set_host()
  during system boot up.

Signed-off-by: make shi <b15407@freescale.com>
11 years agoENGR00235363 I2C: fix kernel crash due
Fugang Duan [Fri, 30 Nov 2012 00:58:17 +0000 (08:58 +0800)]
ENGR00235363 I2C: fix kernel crash due

Kernel crash log:
Unable to handle kernel NULL pointer dereference at
virtual address 00000001 pgd = d02ec000
[00000001] *pgd=00000000
Internal error: Oops: 1 [#1] PREEMPT SMP
Modules linked in:
CPU: 0    Not tainted  (3.0.35-05332-ga7a1dec-dirty #38)
PC is at i2c_imx_probe+0xdc/0x434
LR is at i2c_imx_xfer+0x53c/0x75c
pc : [<c002645c>]    lr : [<c03b1e98>]    psr: 20000013
sp : d41c3dd8  ip : 00000001  fp : 00000001
r10: 00000001  r9 : ffff8fcc  r8 : d41c3e48
r7 : c08f4dc0  r6 : 00000001  r5 : d41c3e48  r4 : d447f000
r3 : d417cbe0  r2 : 00000001  r1 : 000186a0  r0 : d447f000
Flags:nzCv IRQs on  FIQs on Mode SVC_32 ISA ARM Segment kernel
...
Process kworker/0:3 (pid: 1254, stack limit = 0xd41c22f0)
Stack: (0xd41c3dd8 to 0xd41c4000)
3dc0:  00000000

I2C driver call the function "static void __init i2c_imx_set_clk()"
in runtime, the function is linked to init.text section, and don't
be used after kernel bootup. Remove the "__init" statement to fix
the issue.

Signed-off-by: Fugang Duan <B38611@freescale.com>
11 years agoENGR00235268: change caam_ipg_clk's CG to CG6
Terry Lv [Thu, 29 Nov 2012 08:00:54 +0000 (16:00 +0800)]
ENGR00235268: change caam_ipg_clk's CG to CG6

Another patch changed caam_ipg_clk's CG to CG4 and this commit will
revert this change.

Signed-off-by: Terry Lv <r65388@freescale.com>
11 years agoENGR00223037 fsl: Add new board HDMI dongle for imx6 Q/DL.
Zhang Xiaodong [Wed, 28 Nov 2012 05:37:09 +0000 (13:37 +0800)]
ENGR00223037 fsl: Add new board HDMI dongle for imx6 Q/DL.

Add HDMIdongle board for imx6Q/DL under board/freescale.

Signed-off-by: Zhang Xiaodong <B39117@freescale.com>
11 years agoENGR00235081 Quad DL: Fix chip select for SPI-NOR and flags
Alejandro Sierra [Wed, 28 Nov 2012 00:27:23 +0000 (18:27 -0600)]
ENGR00235081 Quad DL: Fix chip select for SPI-NOR and flags

Fix chip select for SPI-NOR and
remove flags for no writeable partition for weim nor and
SPI-NOR

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
11 years agoENGR00234466 UART: Fix disablement of CTS signal
Alejandro Sierra [Wed, 21 Nov 2012 16:01:26 +0000 (10:01 -0600)]
ENGR00234466 UART: Fix disablement of CTS signal

On Uart driver, CTS signal were never disabled
on the imx_set_mctrl function since the register was
written inside of the conditional.
        if (mctrl & TIOCM_RTS) {
                temp |= UCR2_CTS;
                writel(temp, sport->port.membase + UCR2);
        }

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
11 years agoENGR00235086 I2C: update i2c clock divider for each transaction
Fugang Duan [Wed, 28 Nov 2012 02:40:52 +0000 (10:40 +0800)]
ENGR00235086 I2C: update i2c clock divider for each transaction

Currently on Arik/Rigel, the I2C clk is from IPG_PERCLK which is
sourced from IPG_CLK. Under normal operation, ipg_perclk is at 22MHz
so that we can get 400KHz i2c speed. In low bus freq mode, IPG_CLK is
at 12MHz and IPG_PERCLK is down to 4MHz.
So the I2C driver must update the divider register for each transaction.

Signed-off-by: Fugang Duan <B38611@freescale.com>
11 years agoENGR00234111 wm8962: switch automatically between speaker and hp
Gary Zhang [Wed, 28 Nov 2012 06:00:34 +0000 (14:00 +0800)]
ENGR00234111 wm8962: switch automatically between speaker and hp

when detect hp inserted, disable speaker; when hp is plugout,
enable speaker.

Signed-off-by: Gary Zhang <b13634@freescale.com>
11 years agoENGR00234236 1588: fix kernel build warning
Fugang Duan [Tue, 20 Nov 2012 03:47:25 +0000 (11:47 +0800)]
ENGR00234236 1588: fix kernel build warning

Warning: no return statement in function returning non-void.
fec_ptp_ioctl return zero when 1588 is not enable.

Signed-off-by: Fugang Duan <B38611@freescale.com>
11 years agoENGR00235090 FEC: Workaround for FEC RX hang with stress test
Fugang Duan [Tue, 27 Nov 2012 09:44:19 +0000 (17:44 +0800)]
ENGR00235090 FEC: Workaround for FEC RX hang with stress test

When do Ethernet UDP stress overnight test with abundance of
data transmission, RX path may hang-on.
Dump the RX BD, found all BD "Empty" bit is cleared, which means
CPU read BD status is not right and waiting here.

Change BD memroy attribute from Normal to strongly ordered:
changes the memory attribute of C=0, B=0 instead of C=0, B=1.
Apply the change, the issue cannot be reproduced.

Signed-off-by: Fugang Duan <B38611@freescale.com>
11 years agoENGR00234933 mmc: sdhci: invalid cd_gpio for always_present host controller
Ryan QIAN [Tue, 27 Nov 2012 23:54:32 +0000 (07:54 +0800)]
ENGR00234933 mmc: sdhci: invalid cd_gpio for always_present host controller

Issue:
By default, cd_gpio is 0 for always presented host controller, which is a
valid gpio. Then it will result to free_irq for 0 in esdhc_pltfm_exit for
these always_present host controllers.

Fix:
Invalid cd_gpio if the controller is indicated to be always present.

Acked-by: Dong Aisheng <b29396@freescale.com>
Signed-off-by: Ryan QIAN <b32804@freescale.com>
11 years agoENGR00234781 input: add novatek touch screen driver.
Zhang Jiejing [Fri, 23 Nov 2012 06:09:54 +0000 (14:09 +0800)]
ENGR00234781 input: add novatek touch screen driver.

This patch add device drvier for novatek touch screen driver.
This touch screen chip will be support because it have
more populary screen size.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
11 years agomm: fix off-by-two in __zone_watermark_ok()
Michal Hocko [Tue, 10 Jan 2012 23:08:02 +0000 (15:08 -0800)]
mm: fix off-by-two in __zone_watermark_ok()

Commit 88f5acf88ae6 ("mm: page allocator: adjust the per-cpu counter
threshold when memory is low") changed the form how free_pages is
calculated but it forgot that we used to do free_pages - ((1 << order) -
1) so we ended up with off-by-two when calculating free_pages.

Reported-by: Wang Sheng-Hui <shhuiw@gmail.com>
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoENGR00234685-2 mx6q_sabreauto: change Sabreauto board to LDO-ENABLED mode
Robin Gong [Mon, 26 Nov 2012 03:25:55 +0000 (11:25 +0800)]
ENGR00234685-2 mx6q_sabreauto: change Sabreauto board to LDO-ENABLED mode

Per hardware design, we can't set LDO bypass mode on Sabreauto board,otherwise,
system will can't reset,if cpu freq run in 400Mhz.
Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00234685-1 cpufreq:fix one bug in cpufreq driver if I2C transfer error
Robin Gong [Mon, 26 Nov 2012 03:23:28 +0000 (11:23 +0800)]
ENGR00234685-1 cpufreq:fix one bug in cpufreq driver if I2C transfer error

Currently, if we used LDO bypass, will set pfuze register by I2C bus to modify
voltage according to different cpu frequency, if I2C transfer error, we should
restore to old cpu frequency, not only in cpufreq driver but also cpufreq core.

Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00233569 SDMA: Add support for SDMA M2M copy
Ge Lei [Fri, 23 Nov 2012 06:36:04 +0000 (14:36 +0800)]
ENGR00233569 SDMA: Add support for SDMA M2M copy

Our SDMA code did not support SDMA M2M copy function before, we add
SDMA M2M copy function in this patch, you can use 'sg' to use this
function, you can refer to 'linux-test/module_test/mxc_sdma_memcopy_test.c'
for how to use this function.

Signed-off-by: Ge Lei <b42127@freescale.com>
11 years agoENGR00234387 mx6sl: csi/v4l2: add V4L2_MEMORY_USERPTR support
Robby Cai [Tue, 20 Nov 2012 08:52:04 +0000 (16:52 +0800)]
ENGR00234387 mx6sl: csi/v4l2: add V4L2_MEMORY_USERPTR support

Add V4L2_MEMORY_USERPTR support for csi v4l2 capture
Support V4L2_MEMORY_USERPTR and V4L2_MEMORY_MMAP now

Signed-off-by: Robby Cai <R63905@freescale.com>
11 years agoENGR00234519 mmc: support eMMC v4.5 memory cards
Ryan QIAN [Thu, 22 Nov 2012 07:38:46 +0000 (15:38 +0800)]
ENGR00234519 mmc: support eMMC v4.5 memory cards

Bypass eMMC version checking, so that eMMC v4.5 can work on current kernel as
eMMC v4.4 cards, no specific v4.5 feature supported. Only basic read/write
operations are supported, also ddr mode is supported.

Acked-by: Dong Aisheng <b29396@freescale.com>
Signed-off-by: Ryan QIAN <b32804@freescale.com>
11 years agoENGR00234362 Camera: ov5640_mipi: wait for sensor stable before streamon
Sheng Nan [Fri, 23 Nov 2012 02:59:22 +0000 (10:59 +0800)]
ENGR00234362 Camera: ov5640_mipi: wait for sensor stable before streamon

ov5642 add some delay to wait for sensor stable after S_PARM.
And ov5640_mipi should keep the same behavior.
So the upper layer can trust the first frame comes out of ov5640_mipi.

- delay added according to the recommended time from ov company

Signed-off-by: Sheng Nan <b38800@freescale.com>
11 years agoENGR00234531 fix MFGTOOL issue after USB module loadable done
Tony LIU [Thu, 22 Nov 2012 08:38:43 +0000 (16:38 +0800)]
ENGR00234531 fix MFGTOOL issue after USB module loadable done

- must add a new config item to enable USB
  CONFIG_USB_FSL_ARC_OTG=y

Signed-off-by: Tony LIU <junjie.liu@freescale.com>
11 years agoENGR00234401: CAAM: Fix incorrect invalidate call for output ring
Steve Cornelius [Tue, 20 Nov 2012 23:21:26 +0000 (16:21 -0700)]
ENGR00234401: CAAM: Fix incorrect invalidate call for output ring

The job ring driver exhibited a hang condition in the top of
caam_jr_dequeue() where a BUG_ON statement looks for a condition
where the output ring is said to have valid entries by the ring logic,
but the ring entries apparently have NULL descriptor pointers.

In the initial ARM port of this driver, the cache flush call
of the output ring content occured before the output ring read index
register read occurred, exposing a condition where the driver sensed valid
output entries, yet the entries written by the ring hardware were not
invalidated, and therefore were not visible to the processor, appearing
as false NULL entries.

This patch relocates the invalidate call to immediately follow the
check of the output read index, where it is required.

Signed-off-by: Vicki Milhoan <vicki.milhoan@freescale.com>
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Terry Lv <r65388@freescale.com>
11 years agoENGR00234411-2 CPUFREQ: fix one code bug on regulator restore when fail
Robin Gong [Thu, 22 Nov 2012 05:45:54 +0000 (13:45 +0800)]
ENGR00234411-2 CPUFREQ: fix one code bug on regulator restore when fail

Didn't care about pu_regulator is enabled or not when regulator restore if some
regulator set failed.

Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00234411-1 Sabreauto: fix error print COULD NOT SET GP VOLTAGE.
Robin Gong [Thu, 22 Nov 2012 05:31:05 +0000 (13:31 +0800)]
ENGR00234411-1 Sabreauto: fix error print COULD NOT SET GP VOLTAGE.

Didn't take more care about non-pfuze board, and there is two place in BSP will
call "mx6_cpu_regulator_init". It means regulator_get will be called twice on
every vddcore/vddsoc regulator. Then one value need set twice ,because from
regulator core view, there is two regulators share the same regulator. The non-
validate one will return error and print "COULD NOT SET GP VOLTAGE!!!!." on
Sabreauto board. The same as Sabrelite and ARM2 board.

Meanwhile, Sabreauto need be configured LDO bypass default.
Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00233494 EPDC: Driver only supports 16 LUTs
Michael Minnick [Tue, 13 Nov 2012 18:51:13 +0000 (12:51 -0600)]
ENGR00233494 EPDC: Driver only supports 16 LUTs

This bug was introduced by ENGR00229290 which fixed
the problem of greater than 16 LUTs used when 5-bit
waveform loaded. The bug is that now the driver is also
restricted to using 16 LUTs in 4-bit mode.

The fix is to correct the test of the EPDC_FORMAT
register used to determine if a 5-bit waveform
is loaded.

Also removed the while loop in favor of a bitwise OR
used to determine if a chosen LUT has yet to be
acknowledged by the interrupt handler.

Signed-off-by: Michael Minnick <michael.minnick@freescale.com>
11 years agoENGR00234354-2: board-mx6q_sabreauto aline weim-nor partition layout
Adrian Alonso [Wed, 21 Nov 2012 00:25:40 +0000 (18:25 -0600)]
ENGR00234354-2: board-mx6q_sabreauto aline weim-nor partition layout

* Aline weim-nor partition layout with u-boot expected
  offtsets
  "bootloader"  /dev/mtd0
  "bootenv"     /dev/mtd1
  "kernel"      /dev/mtd2
  "rootfs"      /dev/mtd3

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
11 years agoENGR00234354-1: board-mx6q_sabreauto aline spi-nor partition layout
Adrian Alonso [Tue, 20 Nov 2012 23:17:26 +0000 (17:17 -0600)]
ENGR00234354-1: board-mx6q_sabreauto aline spi-nor partition layout

* Aline spi-nor partition layout
* set correct chip-select value

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
11 years agoENGR00234217 cpufreq:fix loops_per_jiffy wrong on new suspend flow of cpufreq
Robin Gong [Tue, 20 Nov 2012 07:08:12 +0000 (15:08 +0800)]
ENGR00234217 cpufreq:fix loops_per_jiffy wrong on new suspend flow of cpufreq

Currently, we use pm_notifier to enter suspend/resume flow. But in the notifier
we only set cpufreq, didn't tell CPUFREQ core what the current cpufreq setting
now. So in the next time if CPUFREQ core find the current cpu frequncy is not
the value that CPUFREQ core want to set before. CPUFREQ core will force to set
the freqs.old with its own rule, which means the freqs.old will be MODIFYED
unexpectedly, and this will cause wrong loops_per_jiffy. We need add cpufreq_
notify_transition in the suspend/resume interface of cpufreq.

Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00229852 csi/v4l: lower the priority of "working queue empty" message
Robby Cai [Mon, 12 Nov 2012 08:17:14 +0000 (16:17 +0800)]
ENGR00229852 csi/v4l: lower the priority of "working queue empty" message

When pause the capture test program, the "working queue empty" message
shows up repeatedly. However this message is expected to show up because
there's no QBUF called. Change pr_err to pr_debug to keep it as debug level.

Signed-off-by: Robby Cai <R63905@freescale.com>
11 years agoENGR00232893 mx6sl: pxp/v4l2: add dependency on CONFIG_FB_MXC_ELCDIF_FB
Robby Cai [Thu, 8 Nov 2012 06:45:56 +0000 (14:45 +0800)]
ENGR00232893 mx6sl: pxp/v4l2: add dependency on CONFIG_FB_MXC_ELCDIF_FB

Without this dependency, we have to manually disable
CONFIG_VIDEO_MXC_PXP_V4L2 when disable CONFIG_FB_MXC_ELCDIF_FB.
Otherwise, a build error shows up. This patch fixed it.

Signed-off-by: Robby Cai <R63905@freescale.com>
11 years agoENGR00231307 csi/camera: add some ioctls
Robby Cai [Mon, 5 Nov 2012 08:29:18 +0000 (16:29 +0800)]
ENGR00231307 csi/camera: add some ioctls

added ioctls are:
VIDIOC_ENUM_FRAMEINTERVALS
VIDIOC_ENUM_FRAMESIZES
VIDIOC_ENUM_FMT
VIDIOC_DBG_G_CHIP_IDENT

Signed-off-by: Robby Cai <R63905@freescale.com>
11 years agoENGR00234045 fix building error caused by ENGR00233366
Robin Gong [Mon, 19 Nov 2012 03:35:14 +0000 (11:35 +0800)]
ENGR00234045 fix building error caused by ENGR00233366

Forget submit some local change...

Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00233366-4 WDOG LDO_BYPASS: fix wdog2 to reset external pmic in ldo bypass
Robin Gong [Mon, 19 Nov 2012 02:04:46 +0000 (10:04 +0800)]
ENGR00233366-4 WDOG LDO_BYPASS: fix wdog2 to reset external pmic in ldo bypass

On Sabresd board design, the WDOG_B output to reset external pmic source from
GPIO_2 pad which can be configured as WDOG2_WDOG_B, so if in ldo bypass mode,
we should use WDOG2 reset signal to reset pmic, not WDOG1. Also, configure the
related pins.

Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00233366-3 CPUFREQ:add cpufreq restore back if set fail
Robin Gong [Tue, 13 Nov 2012 05:02:57 +0000 (13:02 +0800)]
ENGR00233366-3 CPUFREQ:add cpufreq restore back if set fail

Restore back cpu freq and regulator if set fail.

Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00233366-2 mx6q_sabresd mx6sl_arm2 mx6sl_evk: config in LDO bypass
Robin Gong [Tue, 13 Nov 2012 07:06:16 +0000 (15:06 +0800)]
ENGR00233366-2 mx6q_sabresd mx6sl_arm2 mx6sl_evk: config in LDO bypass

U-boot will not care about ldo bypass, move these code from u-boot to kernel.
Move the workaround for PFUZE1.0 to kernel too.
Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00233366-1 Anatop PFUZE: LDO bypass can be configed by cmdline
Robin Gong [Mon, 19 Nov 2012 02:21:00 +0000 (10:21 +0800)]
ENGR00233366-1 Anatop PFUZE: LDO bypass can be configed by cmdline

Currently, use CONFIG_MX6_INTER_LDO_BYPASS to enable/disable LDO bypass, and
use the same macro in u-boot too. It's not very friendly ,it will be more
flexible if use dynamic configure by command line input by u-boot.
Two ways to enable LDO bypass:
1. use command line:
You can set "ldo_active=on" or "ldo_active=off" in command line to enable/
disable LDO bypass.
2. set enable_ldo_mode value in board file:
If you didn't set the param in command line, every board
will use its default value, for example, you can find below code in arch/arm/
mach-mx6/mx6q_sabresd_pmic_pfuze100.c:
static int pfuze100_init(struct mc_pfuze *pfuze)
{
        ....
        /*use default mode(ldo bypass) if no param from cmdline*/
        if (enable_ldo_mode == LDO_MODE_DEFAULT)
                enable_ldo_mode = LDO_MODE_BYPASSED;
        ....
}

Note:
1.You should know clearly ldo bypass can be only enabled in the board
that mounted with external pmic to supply VDDARM_IN/VDDSOC_IN power rail, and
you should implement related external regulator firstly, such as:
in arch/arm/mach-mx6/board-mx6q_sabresd.c
static struct mxc_dvfs_platform_data sabresd_dvfscore_data = {
                .reg_id = "VDDCORE",
                .soc_id = "VDDSOC",
                ....
}
otherwise, you have to use internal ldo which is the default configuration.
2.one special case, if the chip is 1.2Ghz, it can't be set LDO bypass.

Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00234040 FUSE 1.2G: add fuse bit for 1.2G
Robin Gong [Mon, 19 Nov 2012 02:16:22 +0000 (10:16 +0800)]
ENGR00234040 FUSE 1.2G: add fuse bit for 1.2G

Before, we use "arm_freq" in command line to set 1.2G. Now we will read the
fuse bit and "arm_freq", get the mini value to be used as "arm_max_freq".And:
1. you can easily set CPU max freq on what frequency you want by cmdline.
2. if you didn't set arm_freq in cmdline, kernel will read the fuse bit
(0x021bc440) to set the right arm_max_freq.

At the same time, add 1Ghz setpoint if chip max freq is 1.2Ghz.

Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00233770 i.mx6q/vpu: Add fuse check for VPU_DISABLE feature
Jason Liu [Thu, 15 Nov 2012 06:51:10 +0000 (14:51 +0800)]
ENGR00233770 i.mx6q/vpu: Add fuse check for VPU_DISABLE feature

This patch add the fuse check for VPU_DISABLE feature. If the fuse
bit for VPU_DISABLE is 1, which means VPU is disabled, then we will
not register VPU device to the kernel.

Signed-off-by: Jason Liu <r64343@freescale.com>
11 years agoENGR00233705 [MX6SL] -Fix suspend/resume issue when SD1 is used to boot.
Ranjani Vaidyanathan [Tue, 13 Nov 2012 22:08:41 +0000 (16:08 -0600)]
ENGR00233705 [MX6SL] -Fix suspend/resume issue when SD1 is used to boot.

Setting certain IOMUX settings on SD1 prevents the system from
entering suspend. These pins are already configured as GPIO, so
it does not help to reconfigure them during suspend.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
11 years agoENGR00233929: add kernel command line to enable snvs
Terry Lv [Fri, 16 Nov 2012 07:41:01 +0000 (15:41 +0800)]
ENGR00233929: add kernel command line to enable snvs

In MX6Q/DL, originally GPIO_0 is used as CKO pin function. when SNVS
module is enabled, CKO output stops suddenly.
Both CKO clock config register CCOSR and GPIO_0 IOMUX register value are
not changed. But because ALT7 of GPIO_0 pad is SNVS_VIO_5 function. I
doubt that when SNVS module is enabled, GPIO_0 pad is automatically
changed to SNVS instance by SoC.
Thus we add option for snvs enable/disable.

Signed-off-by: Terry Lv <r65388@freescale.com>
11 years agoENGR00233800: CAAM: running sha_speed in cryptodev crashed
Terry Lv [Thu, 15 Nov 2012 08:50:41 +0000 (16:50 +0800)]
ENGR00233800: CAAM: running sha_speed in cryptodev crashed

The reason is that when switching from SHA1 to SHA256, cryptodev will
create a new session.
But in this new session, the __ctx in allocated req is not fully initialized.
Thus dma_buf in __ctx will be a random value.
If the value is 0 or some address in DMA memory, that will be ok,
otherwise, it will crashed in dma_unmap_single().
The calling sequence is:
ahash_final_ctx=>try_buf_map_to_sec_sg()=>dma_unmap_single()
When calling dma_unmap_single(), the parameter buf_dma is invalid in
crash case.
The error msg is:
kernel BUG at arch/arm/mm/dma-mapping.c:478!

requested hash CRYPTO_SHA2_256, Unable to handle kernel NULL pointer
dereference at virtual address 00000000
got sha256 with driver sha256-caapgd = e4ea0000
m
        Encrypting in chunks of 256 b[00000000] *pgd=74edb831ytes: ,
*pte=00000000, *ppte=00000000
Internal error: Oops: 817 [#1] PREEMPT SMP
Modules linked in: cryptodev
CPU: 0    Not tainted  (3.0.35-02200-ge392070-dirty #68)
     PC is at __bug+0x1c/0x28
     LR is at __bug+0x18/0x28
     pc : [<80044260>]    lr : [<8004425c>]    psr: 60000013
     sp : e4ec7c40  ip : ea9a2000  fp : 00000010
     r10: 883f8038  r9 : 883f8038  r8 : e4803060
     r7 : 00000000  r6 : 00000001  r5 : 00000000  r4 : 6f66c10a
     r3 : 00000000  r2 : 80aafd5c  r1 : 60000093  r0 : 00000033
     Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
     Control: 10c53c7d  Table: 74ea004a  DAC: 00000015
     Process sha_speed (pid: 2747, stack limit = 0xe4ec62f0)
     Stack: (0xe4ec7c40 to 0xe4ec8000)
     7c40: 74803184 8004a424 e4803000 e4730c08 e4262840 803c50dc
     e4786f20 883f8000
     7c60: 00000020 00000000 00000028 883f8018 e43ffcc0 e4803000
     00000000 803c3d04
     7c80: 00000004 80041104 e4ec6000 00000000 7efc4b64 803c3d10
     e4774a3c 802079f8
     7ca0: e43ffd1c e43ffcc0 00000000 7f0031a0 e4ec7e0c e43ffcc0
     e4ec7e0c 7f00240c
     7cc0: 00000100 e4786f20 e481bd40 e4ec7cd8 e4ec7cdc 7f0016b4
     e4803200 00000000
     7ce0: e4094480 00000000 7efc4b2c 00000004 80041104 7f001b64
     8c81200c 00000000
     7d00: 3fe1c2a2 2aba7e2c 00000000 00000000 00000000 00000000
     00000000 2abc8870
     7d20: 2abc8870 2abc8870 7efc4e10 00000000 2aba3000 00000000
     2abc7f48 00000000
     7d40: 00000000 00000000 00000000 00000000 00000000 00000000
     2abc7f88 2abc7f80
     7d60: 2abc7f50 2abc7f60 2abc7f68 00000000 00000000 00000000
     2abc7f70 2abc7f78
     7d80: 00000000 32616873 2a003635 00000000 00000000 2abc7fa0
     2abc7fa8 2abc7fb0
     7da0: 2abc7f90 00000000 00000000 2abc7f98 00000000 00000000
     00000000 00000000
     7dc0: 00000000 32616873 632d3635 006d6161 00000000 00000000
     00000000 00000000
     7de0: 2abc7fc0 2abc7fb8 00000000 2abc7fd0 00000000 00000000
     00000000 00000000
     7e00: 00000000 00000000 00000001 3fe1c2a2 00000000 00000100
     00012008 00000000
     7e20: 7efc4ab8 00000000 00000000 8006a120 e4044740 8c80ef40
     00000001 00000000
     7e40: 00000002 e4044740 e4ec7e7c 8006f5f4 e4ec6000 8007ffd4
     e4348880 60000093
     7e60: 00000000 80ae6de8 e4253200 8004e0fc 00000261 8028c0f4
     e4877000 80ae6de8
     7e80: e4786f20 e481bd40 00000261 8028c0f4 000059ac 00000000
     36390b02 00000000
     7ea0: e4cd7b6c e43488d0 8c80e4c4 00000038 e43488d0 802342dc
     0000003f e43488d0
     7ec0: 8c80e4b8 8c80e4b8 00000038 80090714 0000003f 8aafab02
     00000000 80091134
     7ee0: 8aafab02 0000003f e4ec6000 80a99cc0 e4eed510 7efc4b2c
     e4ef96e0 00000004
     7f00: 80041104 800febd0 60a9b3cd e4786f20 e4348880 00000000
     e4ec7f88 e43488d0
     7f20: e4ec6000 00000000 00000000 80091408 00000000 00000001
     00000001 e4ec7f78
     7f40: 000059b1 00000000 fffffff7 80aedc50 80a8a0c0 00000000
     00000000 e4ec7f90
     7f60: 7efc4b20 e4ef96e0 7efc4b2c c01c6368 00000004 80041104
     e4ec6000 00000000
     7f80: 7efc4b64 800ff0d4 00000000 00000000 00000109 00000000
     00000000 00008628
     7fa0: 00000036 80040f80 00000000 00000000 00000004 c01c6368
     7efc4b2c 7efc4b2c
     7fc0: 00000000 00000000 00008628 00000036 00000000 00000000
     2abc8000 7efc4b64
     7fe0: 00000000 7efc4a90 00008b5c 2ac857bc 80000010 00000004
     e28bd000 e8bd0800
     [<80044260>] (__bug+0x1c/0x28) from [<8004a424>]
     (___dma_single_dev_to_cpu+0x84/0x94)
     [<8004a424>] (___dma_single_dev_to_cpu+0x84/0x94) from [<803c50dc>]
     (ahash_final_ctx+0x1a0/0x41c)
     [<803c50dc>] (ahash_final_ctx+0x1a0/0x41c) from [<803c3d10>]
     (ahash_final+0xc/0x10)
     [<803c3d10>] (ahash_final+0xc/0x10) from [<802079f8>]
     (crypto_ahash_op+0x28/0xc0)
     [<802079f8>] (crypto_ahash_op+0x28/0xc0) from [<7f0031a0>]
     (cryptodev_hash_final+0x30/0xc0 [cryptodev])
     [<7f0031a0>] (cryptodev_hash_final+0x30/0xc0 [cryptodev]) from
     [<7f00240c>] (crypto_run+0x10c/0x398 [cryptodev])
     [<7f00240c>] (crypto_run+0x10c/0x398 [cryptodev]) from [<7f001b64>]
     (cryptodev_ioctl+0x360/0x768 [cryptodev])
     [<7f001b64>] (cryptodev_ioctl+0x360/0x768 [cryptodev]) from
     [<800febd0>] (do_vfs_ioctl+0x80/0x54c)
     [<800febd0>] (do_vfs_ioctl+0x80/0x54c) from [<800ff0d4>]
     (sys_ioctl+0x38/0x5c)
     [<800ff0d4>] (sys_ioctl+0x38/0x5c) from [<80040f80>]
     (ret_fast_syscall+0x0/0x30)
     Code: e59f0010 e1a01003 eb12fddb e3a03000 (e5833000)
     ---[ end trace 0057f6be00952f77 ]---

Signed-off-by: Terry Lv <r65388@freescale.com>
11 years agoENGR00233387: MLB: read fuse to check if to enable mlb
Terry Lv [Tue, 13 Nov 2012 07:50:48 +0000 (15:50 +0800)]
ENGR00233387: MLB: read fuse to check if to enable mlb

Read "Disabled MLB" bit in OTP CFG2 to check if to enable mlb.

Signed-off-by: Terry Lv <r65388@freescale.com>
11 years agoENGR00233780 ASRC: limit output buffer size to avoid kernel dump
Chen Liangjun [Mon, 12 Nov 2012 05:41:13 +0000 (13:41 +0800)]
ENGR00233780 ASRC: limit output buffer size to avoid kernel dump

For ASRC memory to memory transfer, user would send driver input buffer
and driver would copy converted output buffer into user's buffer.
However, ASRC can't promise the ratio of output buffer size/input buffer
size being equal to output sample rate/input sample rate.e.g, for
convert from 8k to 48k and 1000 bytes input buffer size, ASRC may pop
out 5999 bytes or 6001 bytes. If driver copy all 6001 bytes into user's
buffer, kernel dump may happens cause of accessing unexisted buffer.

In this patch, if ASRC output buffer size is larger than user's buffer
size, discard exact part.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
11 years agoENGR00233886 ASRC: init variable to fix build warning
Chen Liangjun [Fri, 16 Nov 2012 02:32:07 +0000 (10:32 +0800)]
ENGR00233886 ASRC: init variable to fix build warning

warning:

Compiling warning on mainline imx_3.0.35 (potential bug):
drivers/mxc/asrc/mxc_asrc.c: In function 'asrc_output_task_worker':
drivers/mxc/asrc/mxc_asrc.c:961:68: warning: 't_size' may be used
uninitialized in this function [-Wuninitialized]
drivers/mxc/asrc/mxc_asrc.c:943:23: note: 't_size' was declared here

In this patch, init t_size.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
11 years agoENGR00233570-3 ASRC: Use function pointer to support ASRC loadable
Ge Lei [Thu, 15 Nov 2012 06:58:33 +0000 (14:58 +0800)]
ENGR00233570-3 ASRC: Use function pointer to support ASRC loadable

In ASoC ESAI machine driver, use ASRC ops instead of directly use ASRC
function calling, so that it can support ASRC loadable.

Signed-off-by: Ge Lei <b42127@freescale.com>
11 years agoENGR00233570-2 ASRC: Use function pointer and hook to support ASRC loadable
Ge Lei [Thu, 15 Nov 2012 06:53:40 +0000 (14:53 +0800)]
ENGR00233570-2 ASRC: Use function pointer and hook to support ASRC loadable

In ASoC pcm platform driver, use function pointer(ASRC ops) and hook to call
the APIs in ASRC driver, so that the ASoC platform driver can support ASRC
loadable.

Signed-off-by: Ge Lei <b42127@freescale.com>
11 years agoENGR00233570-1 ASRC: Use hook to add support for ASRC loadable
Ge Lei [Thu, 15 Nov 2012 06:46:19 +0000 (14:46 +0800)]
ENGR00233570-1 ASRC: Use hook to add support for ASRC loadable

ASoC ESAI machine driver and pcm platform driver use the APIs from mxc_asrc.c,
but once ASRC is used as a loadable module, these files can't find the APIs
from this ko. In this patch, we use 'asrc_p2p_hook' to hook the APIs which will
be used in ASoC ESAI machine driver and pcm platform driver.

Signed-off-by: Ge Lei <b42127@freescale.com>
11 years agoENGR00233452 Integrate 4.6.9p9 GPU kernel part driver
Loren Huang [Wed, 14 Nov 2012 05:35:06 +0000 (13:35 +0800)]
ENGR00233452 Integrate 4.6.9p9 GPU kernel part driver

Signed-off-by: Loren Huang <b02279@freescale.com>
Acked-by: Lily Zhang