]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agoENGR00252418 imx6: add fuse check for available devices
Dong Aisheng [Wed, 27 Feb 2013 08:50:30 +0000 (16:50 +0800)]
ENGR00252418 imx6: add fuse check for available devices

Since device availability may be different on the same SoC,
so we add fuse check for the supported device before we really
adding the device to the kernel.
This may avoid kernel crash once the CPU at the slot are changed to
a different one which with different device available but the kernel is
the same one.

Reviewed-by: Jason Liu <r64343@freescale.com>
Acked-by: Jason Liu <r64343@freescale.com>
Signed-off-by: Dong Aisheng <b29396@freescale.com>
11 years agotimer: fix the too many reries on the per-cpu event device
Jason Liu [Mon, 25 Feb 2013 11:55:04 +0000 (19:55 +0800)]
timer: fix the too many reries on the per-cpu event device

There are so many retries happen on the per-cpu event device
when run the command 'cat /proc/timer_list', as following:

root@~$ cat /proc/timer_list
Timer List Version: v0.6
HRTIMER_MAX_CLOCK_BASES: 3
now at 3297691988044 nsecs

Tick Device: mode:     1
Per CPU device: 0
Clock Event Device: local_timer
 max_delta_ns:   8624432320
 min_delta_ns:   1000
 mult:           2138893713
 shift:          32
 mode:           3
 next_event:     3297700000000 nsecs
 set_next_event: twd_set_next_event
 set_mode:       twd_set_mode
 event_handler:  hrtimer_interrupt
 retries:        36383

the reason is that the local timer will stop when enter C3 state,
we need switch the local timer to bc timer when enter the state
and switch back when exit from the that state.The code is like this:

void arch_idle(void)
{
....
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
enter_the_wait_mode();

clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
}

when the broadcast timer interrupt arrives(this interrupt just wakeup
the ARM, and ARM has no chance to handle it since local irq is disabled.
In fact it's disabled in cpu_idle() of arch/arm/kernel/process.c)

the broadcast timer interrupt will wake up the CPU and run:

clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);    ->
tick_broadcast_oneshot_control(...);
->
tick_program_event(dev->next_event, 1);
->
tick_dev_program_event(dev, expires, force);
->
for (i = 0;;) {
                int ret = clockevents_program_event(dev, expires, now);
                if (!ret || !force)
                        return ret;
                dev->retries++;
                ....
                now = ktime_get();
                expires = ktime_add_ns(now, dev->min_delta_ns);
}
clockevents_program_event(dev, expires, now);
        delta = ktime_to_ns(ktime_sub(expires, now));

        if (delta <= 0)
                return -ETIME;
when the bc timer interrupt arrives,  which means the last local timer
expires too. so, clockevents_program_event will return -ETIME, which will
cause the dev->retries++ when retry to program the expired timer.

Even under the worst case, after the re-program the expired timer,
then CPU enter idle quickly before the re-progam timer expired,
it will make system ping-pang forever if no interrupt happen.

We have found the ping-pang issue during the video play-back test.
system will freeze and video not playing for sometime until other interrupt
occured to break the error condition.

The detailed information, please refer to the LKML:https://lkml.org/lkml/2013/2/20/216
which posted by Jason Liu.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jason Liu <r64343@freescale.com>
Tested-by: Jason Liu <r64343@freescale.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
11 years agoENGR00251836 IPU device: Support local alpha with alpha value in each pixel
Wayne Zou [Fri, 23 Nov 2012 08:18:58 +0000 (16:18 +0800)]
ENGR00251836 IPU device: Support local alpha with alpha value in each pixel

Add local alpha support with alpha value in each pixel,
such as RGBA pixel format.

Signed-off-by: Wayne Zou <b36644@freescale.com>
11 years agoENGR00251830 LDB: Fix the bug of LDB separate mode for dual LVDS display
Wayne Zou [Mon, 25 Feb 2013 08:35:09 +0000 (16:35 +0800)]
ENGR00251830 LDB: Fix the bug of LDB separate mode for dual LVDS display

Fix the bug of LDB separate mode for dual LVDS display on i.mx6.
For 'ldb=sep0' option on kernel command line, it means that LVDS0 is
the primary display. While 'ldb=sep1' means that LVDS1 is the primary display.
For LDB separate mode, the Display Interface(disp_id) should be
configured differently on the platform layer. That is, IPU DI0 to LVDS1 or
IPU DI1 to LVDS0 configuration should be avoided.

Signed-off-by: Wayne Zou <b36644@freescale.com>
11 years agoENGR00251849-2 ldo_bypass:print the ldo_bypass mode directly, not obscure number
Robin Gong [Tue, 26 Feb 2013 08:10:54 +0000 (16:10 +0800)]
ENGR00251849-2 ldo_bypass:print the ldo_bypass mode directly, not obscure number

You can see "cpu regulator mode:ldo_bypass" log directly from console when boot.
not "cpu regulator init ldo=1" before.
Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00251849-1 cpufreq:print the max freq directly, not obscure number
Robin Gong [Tue, 26 Feb 2013 08:04:09 +0000 (16:04 +0800)]
ENGR00251849-1 cpufreq:print the max freq directly, not obscure number

You can see "arm_max_freq=1GHz" log directly from console during boot.
not "arm_max_freq=1" before.

Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00243077 Fixed JB4.2 multi-user switch hang issue
Xianzhong [Tue, 26 Feb 2013 10:38:59 +0000 (18:38 +0800)]
ENGR00243077 Fixed JB4.2 multi-user switch hang issue

Gpu virtual memory has potiential hang issue exposed,
Vivante will fix this hang issue with 4K contigueous memory limit.

4K limit is needless now and should be disabled by default.

Signed-off-by: Xianzhong <b07117@freescale.com>
Acked-by: Lily Zhang
11 years agoENGR00251630 MX6DQ: do not power off ARM in suspend on TO1.1
Robin Gong [Mon, 25 Feb 2013 02:56:21 +0000 (10:56 +0800)]
ENGR00251630 MX6DQ: do not power off ARM in suspend on TO1.1

System will resume back failed which caused by IPG clock glich issue. The issue
(TKT094231) has been fixed on MX6DQ TO1.2 and MX6DL TO1.1.It is hard to
reproduced on MX6DQ TO1.1/1.0 with 0xffffffff in GPC_PGC_CPU_PUPSCR
which implemented on GA release. But it is easy to reproduced with 0xf0f0 on
mainline now. As we focus on latest formal chip, the problem is cleaned up until
now. We will aign with the workaround on MX6DL which do not power off ARM in
suspend.

Signed-off-by: Robin Gong <b38343@freescale.com>
11 years agoENGR00251008 [GPU] 4.6.9p11 integration for DRM
Loren Huang [Mon, 25 Feb 2013 10:58:22 +0000 (18:58 +0800)]
ENGR00251008 [GPU] 4.6.9p11 integration for DRM

-DRM copyright update

Signed-off-by: Loren Huang <b02279@freescale.com>
11 years agoENGR00251005 [gpu]4.6.9p11 kernel code integration
Loren Huang [Fri, 15 Feb 2013 15:34:51 +0000 (23:34 +0800)]
ENGR00251005 [gpu]4.6.9p11 kernel code integration

-4.6.9p11 kernel code integration
-Additionally release runtime pm and regulator when destory gpu driver
to avoid reference count mismatch.

Signed-off-by: Loren Huang <b02279@freescale.com>
Acked-by: Lily Zhang
11 years agoENGR00250756-4 V4L2 output: fix coding format and review commit warning
Wayne Zou [Tue, 19 Feb 2013 05:33:47 +0000 (13:33 +0800)]
ENGR00250756-4 V4L2 output: fix coding format and review commit warning

Fix the review commit warning such as "line over 80 characters",
"no space before tabs".

Signed-off-by: Wayne Zou <b36644@freescale.com>
11 years agoENGR00251015-2 FB/IPU: Add mxcfb ioctrl to update IPU DP CSC matrix
Wayne Zou [Wed, 20 Feb 2013 05:46:01 +0000 (13:46 +0800)]
ENGR00251015-2 FB/IPU: Add mxcfb ioctrl to update IPU DP CSC matrix

Add mxcfb ioctrl MXCFB_CSC_UPDATE to update IPU DP CSC matrix
for display adjustment.
This patch implements the ioctrl interface.

Signed-off-by: Wayne Zou <b36644@freescale.com>
11 years agoENGR00251015-1 FB/IPU: Add mxcfb ioctrl to update IPU DP CSC matrix
Wayne Zou [Wed, 20 Feb 2013 05:46:01 +0000 (13:46 +0800)]
ENGR00251015-1 FB/IPU: Add mxcfb ioctrl to update IPU DP CSC matrix

Add mxcfb ioctrl MXCFB_CSC_UPDATE to update IPU DP CSC matrix
for display adjustment.
This patch defines the ioctrl interface in header file.

Signed-off-by: Wayne Zou <b36644@freescale.com>
11 years agoENGR00244769-2 [NOR FLASH]-Improve WEIM NOR speed
Oliver Brown [Wed, 13 Feb 2013 17:54:25 +0000 (11:54 -0600)]
ENGR00244769-2 [NOR FLASH]-Improve WEIM NOR speed

Increase the NOR flash read speed.
Added weimnor driver to use cached (and page mode) reads.

Signed-off-by: Oliver Brown <oliver.brown@freescale.com>
11 years agoENGR00244769-1 [NOR FLASH]-Improve WEIM NOR speed
Oliver Brown [Wed, 13 Feb 2013 17:48:35 +0000 (11:48 -0600)]
ENGR00244769-1 [NOR FLASH]-Improve WEIM NOR speed

Increase the NOR flash read speed.
Added weimnor driver to use cached (and page mode) reads.

Signed-off-by: Oliver Brown <oliver.brown@freescale.com>
11 years agoENGR00243348 imx: pcie: disable pcie phy in kernel initialization
Richard Zhu [Tue, 5 Feb 2013 07:27:34 +0000 (15:27 +0800)]
ENGR00243348 imx: pcie: disable pcie phy in kernel initialization

In order to save power consumption, disable pcie phy
(enable IDDQ mode) in kernel initialization.

Signed-off-by: Richard Zhu <r65037@freescale.com>
11 years agoENGR00243339 imx: sata: disable sata phy when sata is not enabled
Richard Zhu [Tue, 5 Feb 2013 06:11:08 +0000 (14:11 +0800)]
ENGR00243339 imx: sata: disable sata phy when sata is not enabled

In order to save power consumption, disable sata phy
(enable PDDQ mode) in kernel level, if the sata module
is not enabled in kernel configuration.

Signed-off-by: Richard Zhu <r65037@freescale.com>
11 years agoENGR00243106 imx: pcie: enable pcie msi on imx6 platforms
Richard Zhu [Fri, 1 Feb 2013 04:31:21 +0000 (12:31 +0800)]
ENGR00243106 imx: pcie: enable pcie msi on imx6 platforms

deprieved from boundary msi support patch
add the following modifications
 * use the RC's line address 0x01FF8000 instead of one
 actual physical memory as the msi start address.
 The physical memory address is not mandatory required by the
 msi start address.

 * set PCI_MSI_FLAGS_ENABLE in RC's msi capability
 structure when the msi int is enabled.

 * the data of msg is only 16bit, set the upper 8bit
 cputype, and the msi int num to the lower 8bit.

Signed-off-by: Richard Zhu <r65037@freescale.com>
11 years agoENGR00242327 V4L2 output: Support field format changes on frame by frame base
Wayne Zou [Wed, 30 Jan 2013 06:05:08 +0000 (14:05 +0800)]
ENGR00242327 V4L2 output: Support field format changes on frame by frame base

Support interlace field format or progressive format changes
on the frame by frame base for V4L2 output

Signed-off-by: Wayne Zou <b36644@freescale.com>
11 years agoENGR00220096 USB core: remove Logitech Quickcam E3500 form usb_quirk_list
make shi [Thu, 23 Aug 2012 09:07:13 +0000 (17:07 +0800)]
ENGR00220096 USB core: remove Logitech Quickcam E3500 form usb_quirk_list

Since Logitech Quickcam E3500 is defaultly listed in usb_quirk_list on current
linux kernel. So the USB camera only supports reset resume, but doesn't support
normal usb suspend/resume. Actually, the USB camera works abnormally after USB
reset resume, but it works well after doing normal suspend/resume.

Signed-off-by: make shi <b15407@freescale.com>
11 years agoENGR00242788: usb: host: disable stream mode due to IC problem
Peter Chen [Fri, 1 Feb 2013 03:05:30 +0000 (11:05 +0800)]
ENGR00242788: usb: host: disable stream mode due to IC problem

There is a bug at chipidea core, please see below synopsis problem title
and its number.
STAR 9000378958
Title: Non-Double Word Aligned Buffer Address Sometimes
Causes Host to Hang on OUT Retry

This problem will be showed when we use Ethernet device at host port, there
is an errata ERR006308 for it.

The workaround for this issue is to disable stream mode at register usbmode.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
11 years agoENGR00242672 MX6 local timer:Remove enable_wait_mode global variable
Liu Ying [Thu, 31 Jan 2013 09:05:13 +0000 (17:05 +0800)]
ENGR00242672 MX6 local timer:Remove enable_wait_mode global variable

This patch removes the unnecessary global variable declaration for
enable_wait_mode.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
11 years agoENGR00242214 IMX PWM:Correct duty cycle calculation
Liu Ying [Wed, 30 Jan 2013 04:31:55 +0000 (12:31 +0800)]
ENGR00242214 IMX PWM:Correct duty cycle calculation

Since we've already reduced 2 cycles before writing PWMPR
register, the real period cycle on PWMO is the value of
period_cycles (before reducing 2). So, the following commit
message of ENGR00170342, which changes the duty cycle
calculation wrongly, is not reasonable:
===================================================
The chip document says the counter counts up to period_cycles + 1
and then is reset to 0, so the actual period of the PWM wave is
period_cycles + 2
===================================================

Revert "ENGR00170342 PWM: fix pwm output can't be set to 100% full duty"

This reverts commit ac3711f7f24b94db9f78fd7e9bf134c2ecd025ab.

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

11 years agoENGR00242269 MX6 PCIE:Print out link up failure log
Liu Ying [Tue, 29 Jan 2013 10:13:31 +0000 (18:13 +0800)]
ENGR00242269 MX6 PCIE:Print out link up failure log

This patch contains code change only to print out
link up failure log like below.
link up failed, DB_R0:0x001b8400, DB_R1:0x08200000!

Before the change, the present print code can never
be called even if the link up fails.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
11 years agoENGR00242201-3 gpu: Makeup GPU driver for kernel 3.5.7
Loren HUANG [Tue, 29 Jan 2013 08:12:29 +0000 (16:12 +0800)]
ENGR00242201-3 gpu: Makeup GPU driver for kernel 3.5.7

Signed-off-by: Loren HUANG <b02279@freescale.com>
Acked-by: Lily Zhang
11 years agoENGR00241739-2 gpu: Enable thermal hot notification in gpu driver
Rong Dian [Mon, 28 Jan 2013 05:40:20 +0000 (13:40 +0800)]
ENGR00241739-2 gpu: Enable thermal hot notification in gpu driver

Using notify mechanism instead of global variable to
trigger gpu3d clock change through thermal driver

Signed-off-by: Rong Dian <b38775@freescale.com>
Signed-off-by: Loren Huang <b02279@freescale.com>
Acked-by: Lily Zhang
11 years agoENGR00241739-1 thermal: providing the thermal hot notification
Rong Dian [Fri, 25 Jan 2013 05:45:01 +0000 (13:45 +0800)]
ENGR00241739-1 thermal: providing the thermal hot notification

Create thermal hot's own hot notificaiton callback register and unregister
function.
Provide the thermal notification broadcast enable and disable through /sys fs.

Signed-off-by: Rong Dian <b38775@freescale.com>
11 years agoENGR00241582 MX6 USB host: USB host certification patch
make shi [Wed, 23 Jan 2013 02:36:00 +0000 (10:36 +0800)]
ENGR00241582 MX6 USB host: USB host certification patch

The patch include:
- USB test mode on hub port and Root-hub port
- support 3 types of message:
too much hub ties for hub attachment
too much power consumption for device attachment
unsupported device class warning
- support menuconfig select the FSL_USB_TEST_MODE, located in:
  -> Device Drivers
   -> USB support (USB_SUPPORT [=y])
     -> FSL High-speed Electrical Test Mode support

Signed-off-by: make shi <b15407@freescale.com>
11 years agoENGR00241003-2 pfuze: using _sel interface to add delay support
Anson Huang [Wed, 23 Jan 2013 07:11:34 +0000 (15:11 +0800)]
ENGR00241003-2 pfuze: using _sel interface to add delay support

use regulator _sel interface set to support auto delay,
as when regulator's voltage go up, it will take some time
to ramp up to the required voltage, so the delay is necessary.
_sel interface set support such function, now we switch to this
interface set.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00241003-1 mx6: need to add delay in LDO voltage setting
Anson Huang [Mon, 21 Jan 2013 08:20:56 +0000 (16:20 +0800)]
ENGR00241003-1 mx6: need to add delay in LDO voltage setting

1.LDO ramp up time may be modified by ROM code
according to fuse setting, cpu freq driver use
fixed delay time which assume the LDO ramp up time
is the reset value of ANATOP register, need to set
it to reset value in regulator init.

2.The regulator set voltage should take care of
the ramp up time, calculate the ramp up time based
of register setting and to the delay, make sure that
when the set voltage function return, the voltage is
stable enough.

3.CPUFreq no need to use delay, it is already taken
care by regulator voltage setting.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00240988-12 Enable GPU hardware reset for 3.5 kernel
Loren HUANG [Mon, 21 Jan 2013 07:37:03 +0000 (15:37 +0800)]
ENGR00240988-12 Enable GPU hardware reset for 3.5 kernel

Cherry-pick from imx_3.5.7 branch.

Signed-off-by: Loren HUANG <b02279@freescale.com>
Acked-by: Lily Zhang
11 years agoENGR00240988-10 Add runtime pm function call in gpu driver
Loren HUANG [Mon, 14 Jan 2013 08:53:12 +0000 (16:53 +0800)]
ENGR00240988-10 Add runtime pm function call in gpu driver

Cherry-pick from imx_3.5.7 branch.
-Add runtime pm function.
-Set bus frequency to high when gpu power is on.

Signed-off-by: Loren HUANG <b02279@freescale.com>
Acked-by: Lily Zhang
11 years agoENGR00240988-5 Update gpu code to support 3.5 kernel
Loren HUANG [Fri, 9 Nov 2012 04:51:41 +0000 (12:51 +0800)]
ENGR00240988-5 Update gpu code to support 3.5 kernel

Cherry-pick from imx_3.5.7 branch.
-Comment regulator setting code temperarily for 3.5 kernel.
-Adjust clock setting code based on new clock framework.
-Disable dynamic frequency change feature as it depends on thermal
driver.
-Use DTS to get reserved memory information.
-Comment cpu check code for 3.5 kernel.
-Comment GPU reset code for 3.5 kernel.

Signed-off-by: Loren HUANG <b02279@freescale.com>
Acked-by: Lily Zhang
11 years agoENGR00240972-3 V4L2: VDI double frame rate for interlace stream
Wayne Zou [Mon, 21 Jan 2013 05:44:54 +0000 (13:44 +0800)]
ENGR00240972-3 V4L2: VDI double frame rate for interlace stream

Each VPU decoded frame is de-interlaced twice inside v4l2 output driver,
and show twice also to achieve IPU/VDI double frame rate output.
This feature is disable by default.

Signed-off-by: Wayne Zou <b36644@freescale.com>
11 years agoENGR00240972-2 IPU: Add vdic double frame rate feature
Wayne Zou [Mon, 21 Jan 2013 05:36:10 +0000 (13:36 +0800)]
ENGR00240972-2 IPU: Add vdic double frame rate feature

Add vdic double frame rate feature
It depends on the which frame(0 or 1),
and interlace field format(top or bottom) to do VDI process

Signed-off-by: Wayne Zou <b36644@freescale.com>
11 years agoENGR00240972-1 IPU: Add deinterlace frame rate double flags
Wayne Zou [Mon, 21 Jan 2013 05:30:25 +0000 (13:30 +0800)]
ENGR00240972-1 IPU: Add deinterlace frame rate double flags

Add deinterlace frame rate double flags for ipu header file

Signed-off-by: Wayne Zou <b36644@freescale.com>
11 years agoENGR00240990 MX6 HDMI dongle:Configure HDMI PHY registers
Liu Ying [Mon, 21 Jan 2013 07:38:18 +0000 (15:38 +0800)]
ENGR00240990 MX6 HDMI dongle:Configure HDMI PHY registers

This patch sets HDMI PHY register values in MXC HDMI driver
platform data so that MXC HDMI driver can configure the
0x09 CKSYMTXCTRL register(Clock Symbol and Transmitter
Control Register) and 0x0E VLEVCTRL register(Voltage Level
Control Register), then we may pass HDMI compliance test
for MX6 HDMI dongle board.

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

11 years agoENGR00240740-3 IPUv3 fb:Workaround bootup ipu error
Liu Ying [Fri, 18 Jan 2013 08:33:00 +0000 (16:33 +0800)]
ENGR00240740-3 IPUv3 fb:Workaround bootup ipu error

Enabling IPU hsp clock in mxcfb_probe() context by calling
ipu_init_channel() can avoid the IPU display channel(setup
in bootloader) from being damaged by some IPU common driver
APIS which enable/disable IPU hsp clock when doing driver
probe. However, somehow, after LDO bypass patch set is pushed
to kernel, this clock enablement can trigger IPU errors
(IPU_INT_STAT_5 - 0x00800000/IPU_INT_STAT_10 - 0x00100000) and
a display flash. A workaround is to enable IPU hsp clock when
we are at ipu_probe() context, which is earlier than mxcfb_probe()
context, and then to disable(cleanup) the clock once more when
fb_set_par() is triggered by the user for the first time. This
patch updates the comment for ipu_init_channel() and
ipu_enable_channel() in mxcfb_probe() context, and disables ipu
hsp clock when fb_set_par() is triggered by the user for the first
time.

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

11 years agoENGR00240740-2 ARM:IPUv3:Add an interface to disable IPU hsp clk
Liu Ying [Fri, 18 Jan 2013 08:30:40 +0000 (16:30 +0800)]
ENGR00240740-2 ARM:IPUv3:Add an interface to disable IPU hsp clk

This patch adds an interface to disable IPU hsp clock so that it
can be called out of ipu common driver.

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

11 years agoENGR00240740-1 IPUv3:Workaround bootup ipu error
Liu Ying [Fri, 18 Jan 2013 08:20:22 +0000 (16:20 +0800)]
ENGR00240740-1 IPUv3:Workaround bootup ipu error

Enabling IPU hsp clock in mxcfb_probe() context by calling
ipu_init_channel() can avoid the IPU display channel(setup
in bootloader) from being damaged by some IPU common driver
APIS which enable/disable IPU hsp clock when doing driver
probe. However, somehow, after LDO bypass patch set is pushed
to kernel, this clock enablement can trigger IPU errors
(IPU_INT_STAT_5 - 0x00800000/IPU_INT_STAT_10 - 0x00100000) and
a display flash. A workaround is to enable IPU hsp clock when
we are at ipu_probe() context, which is earlier than mxcfb_probe()
context, and then to disable(cleanup) the clock once more when
fb_set_par() is triggered by the user for the first time. This
patch exports an interface to disable ipu hsp clock so that
fb_set_par() may call it, and enables ipu hsp clock in ipu_probe()
context.

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

11 years agoENGR00240228: IPUv3: CSI: Correct enum definition of IPU_CSI_DATA_WIDTH
Sheng Nan [Wed, 16 Jan 2013 03:06:30 +0000 (11:06 +0800)]
ENGR00240228: IPUv3: CSI: Correct enum definition of IPU_CSI_DATA_WIDTH

The current definition for with 10 and 16 is not correct.
IPU_CSI_DATA_WIDTH_10 = 2;
IPU_CSI_DATA_WIDTH_16 = 3;

According to the latest i.MX6DQ RM, the correct value should be:
IPU_CSI_DATA_WIDTH_10 = 3;
IPU_CSI_DATA_WIDTH_16 = 9;

Signed-off-by: Sheng Nan <b38800@freescale.com>
11 years agoENGR00240650 pcie: imx: fix ep device no int when pcie switch is used
Richard Zhu [Fri, 18 Jan 2013 00:45:37 +0000 (08:45 +0800)]
ENGR00240650 pcie: imx: fix ep device no int when pcie switch is used

The pcie ep device inserted into the downstream port of the
pcie switch doesn't get the legacy INT when pcie switch
is used.

Signed-off-by: Richard Zhu <r65037@freescale.com>
11 years agoENGR00239734 Mx6 HDMI PHY: Add 2 variable to pass board specific config
Sandor Yu [Fri, 11 Jan 2013 07:28:51 +0000 (15:28 +0800)]
ENGR00239734 Mx6 HDMI PHY: Add 2 variable to pass board specific config

The PHY register 0x9 and 0xe should setting
to different value in different board to pass HCT.
Add variable phy_reg_vlev and phy_reg_cksymtx to pass
phy config data.

Signed-off-by: Sandor Yu <R01008@freescale.com>
11 years agoENGR00240571 mtd: gpmi: fix the compiler warning
Huang Shijie [Thu, 17 Jan 2013 08:15:45 +0000 (16:15 +0800)]
ENGR00240571 mtd: gpmi: fix the compiler warning

The current code may print out the following warning:
....................................................................
drivers/mtd/nand/gpmi-nand/gpmi-lib.c: In function gpmi_begin:
drivers/mtd/nand/gpmi-nand/gpmi-lib.c:1163: warning: hw.use_half_periods
may be used uninitialized in this function
drivers/mtd/nand/gpmi-nand/gpmi-lib.c:1163: warning: hw.sample_delay_factor
may be used uninitialized in this function
....................................................................

this patch fixes it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
11 years agoENGR00240298 IMX IPU: Optimize IPU resize performance
Wayne Zou [Tue, 15 Jan 2013 09:22:16 +0000 (17:22 +0800)]
ENGR00240298 IMX IPU: Optimize IPU resize performance

When disabling IPU channels, it needs less than 200us to wait for stop
Using msleep, it often sleep longer(above 10ms). So the extra delay
decrease the performance.

For 720p video playback on 1080p display(60Hz), the performance is about 40fps
With this patch, it can achieve around 60fps.

Signed-off-by: Wayne Zou <b36644@freescale.com>
11 years agoENGR00240506 fix a bug in abnormal abort handling
Hongzhang Yang [Thu, 17 Jan 2013 06:52:34 +0000 (14:52 +0800)]
ENGR00240506 fix a bug in abnormal abort handling

Bug:
If app quits before FW is loaded to VPU, VPU driver will hang in vpu_release().

Root cause:
In that case, if BIT_BUSY_FLAG=1, vpu_release may reset VPU and run FW
init code, but FW has not been loaded.

Solution:
- Don't run FW init code after reset since VPU lib can load it next time.
- If PC=0, which means VPU never runs, don't check BIT_BUSY_FLAG

Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
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>