Xinyu Chen [Fri, 2 Dec 2011 06:38:21 +0000 (14:38 +0800)]
ENGR00163703 uart: console write routing is unsafe on SMP
The console feature's write routing is unsafe on SMP with
the startup/shutdown call. It happend to cause Android bootup
without shell runnable.
Actually on Android boot, there's 3 consumers of the console
* the kernel printk
* the init process using /dev/kmsg to call printk to show log
* shell, which open /dev/console and write with sys_write()
The shell goes into the normal uart open/write routing,
but the other two go into the console operations.
The open routing calls imx serial startup, which will write USR1/2
register without any lock and critical with imx_console_write call.
Here add spin_lock for startup/shutdown/console_write routing.
Remove the imx_setup_ufcr() call on startup when CONSOLE enabled,
as this will cause clock reinit, and output garbage.
Huang Shijie [Wed, 23 Nov 2011 08:45:17 +0000 (16:45 +0800)]
ENGR00163603-2 IMX/SDMA : save the real count for one DMA transaction.
When we use the SDMA in the UART driver(such as imx6q), we will
meet one situation:
Assume we set 64 bytes for the RX DMA buffer.
The receiving DMA buffer has received some data, but not full.
An Aging DMA request will be received by the SDMA controller if we enable the
IDDMAEN(UCR4[6]) in this case.
So the UART driver needs to know the count of the real received bytes,
and push them to upper layer.
Add two new fields to sdmac, and update the `residue` in sdma_tx_status().
Anson Huang [Thu, 1 Dec 2011 07:51:27 +0000 (15:51 +0800)]
ENGR00163275 [MX6]Fix PLL enable fail panic
The root cause is irqs come between PLL register reading
and getting system time, an interrupt handle could take
more than 2ms, which will make the time reading and register
reading unalignment, see below:
1. pll reg read, it is still not locked;
2. here comes an interrupt, and its handler could spent > 2ms;
3. time reading, found current time already > expiration time(1.2ms),
and we treated the pll lock fail;
There are two method could fix it, one is disable interrupt
during pll lock bit and time expiration check, the other is
to add a second time read after time expiration to make sure
the pll didn't lock during the time we set. I choose the seconde
choise, since it impacts kernel less than disable interrupt;
Even Xu [Wed, 30 Nov 2011 01:36:18 +0000 (09:36 +0800)]
ENGR00163497-3 MX6Q: Enable io_init function for camera drivers
1. Enable io_init function for camera drivers.
2. Add ov5640_mipi camera driver supported resolutions
3. Fine-turn ov5640_mipi camera driver output image quality
Richard Zhu [Mon, 28 Nov 2011 05:02:51 +0000 (13:02 +0800)]
ENGR00163128 [MX6q_ARM2]SATA Boot: reboot failed if boot from SATA
The root cause is that the sata power is not enabled after reboot
the system when boot from sata.
Built in the sata driver would fix this issue.
In this way, the sata power would be enabled defautly
when there is a sata device is plugged into the slot, otherwise,
the power would be disabled.
NOTE:
Pls don't plug the sata disk after the system is booted up.
System wouldn't recognized it, since there are no any power and
clocks on the sata slot.
Fugang Duan [Fri, 25 Nov 2011 10:27:29 +0000 (18:27 +0800)]
ENGR00163040 - FEC : Fix ethernet cannot work after system sleep.
- Descript:
Ethernet can't work in uboot and kernel DHCP throught press
'reset' key when send sleep command 'echo mem > /sys/power/state'
- Cause:
FEC driver will power down phy when system sleep. If just reset the
board, FEC driver cannot run resume function. So, need power on phy
in uboot and linux driver.
Yauheni Kaliuta [Thu, 13 Oct 2011 11:19:05 +0000 (14:19 +0300)]
usb: gadget: file_storage: fix race on unloading
There is a race, reproduced rarely if you unload the module
when host finishes mass storage device initialization (reading
partition table and so on): fsg_unbind() code first closes
lun files then waits for worker thread to finish its work, as
the result the thread may operate on already closed device
with an oops and backtrace:
[ 484.937225] [<b00e403c>] (touch_atime+0x4/0x140) from [<b00a1498>] (generic_file_aio_read+0x678/0x6f0)
[ 484.946563] [<b00a1498>] (generic_file_aio_read+0x678/0x6f0) from [<b00d08c4>] (do_sync_read+0xb0/0xf4)
[ 484.955963] [<b00d08c4>] (do_sync_read+0xb0/0xf4) from [<b00d1478>] (vfs_read+0xac/0x144)
[ 484.964172] [<b00d1478>] (vfs_read+0xac/0x144) from [<af24c6a8>] (fsg_setup+0x7f4/0x900 [g_file_storage])
[ 484.973785] [<af24c6a8>] (fsg_setup+0x7f4/0x900 [g_file_storage]) from [<af24da14>] (fsg_main_thread+0x85c/0x175c [g_file_storage])
[ 484.985626] [<af24da14>] (fsg_main_thread+0x85c/0x175c [g_file_storage]) from [<b0077c48>] (kthread+0x7c/0x84)
[ 484.995666] [<b0077c48>] (kthread+0x7c/0x84) from [<b002f950>] (kernel_thread_exit+0x0/0x8)
[ 485.004028] Code: eaffffd0e28dd008e8bd8df0e92d40f7 (e591400c)
Change the order in unbind: wait for the thread first, then close
the files.
Jason Chen [Wed, 23 Nov 2011 02:46:01 +0000 (10:46 +0800)]
ENGR00162919 mxc_vout: there is one column garbage line at right for split mode
as ipu processing device driver has protect check, the CR ENGR00155141 can be
reverted, this CR is the cause of garbage line.
this patch also change v4l2 output try_task function to make sure there is no
cropping for output when display support window.
Sandor Yu [Tue, 22 Nov 2011 12:25:32 +0000 (20:25 +0800)]
ENGR00162881 Workaround for some MX6x boards failed read EDID data
HDMI video mode setting in command line will not work if no EDID data
reading from HDMI sink.
Creat a default modelist for HDMI video mode when no EDID data.
Then default video mode can work even if no EDID data.
Anson Huang [Tue, 22 Nov 2011 10:26:57 +0000 (18:26 +0800)]
ENGR00162867 [MX6]Fix pm bug of error coding
Before suspend, we need to check whether there
is wakeup source's irq pending via GPC_ISR1~4,
previous coding checked for set of irq status
of GPC_ISR1, should be GPC_ISR1~4.
Yauheni Kaliuta [Thu, 13 Oct 2011 11:19:05 +0000 (14:19 +0300)]
usb: gadget: file_storage: fix race on unloading
There is a race, reproduced rarely if you unload the module
when host finishes mass storage device initialization (reading
partition table and so on): fsg_unbind() code first closes
lun files then waits for worker thread to finish its work, as
the result the thread may operate on already closed device
with an oops and backtrace:
[ 484.937225] [<b00e403c>] (touch_atime+0x4/0x140) from [<b00a1498>] (generic_file_aio_read+0x678/0x6f0)
[ 484.946563] [<b00a1498>] (generic_file_aio_read+0x678/0x6f0) from [<b00d08c4>] (do_sync_read+0xb0/0xf4)
[ 484.955963] [<b00d08c4>] (do_sync_read+0xb0/0xf4) from [<b00d1478>] (vfs_read+0xac/0x144)
[ 484.964172] [<b00d1478>] (vfs_read+0xac/0x144) from [<af24c6a8>] (fsg_setup+0x7f4/0x900 [g_file_storage])
[ 484.973785] [<af24c6a8>] (fsg_setup+0x7f4/0x900 [g_file_storage]) from [<af24da14>] (fsg_main_thread+0x85c/0x175c [g_file_storage])
[ 484.985626] [<af24da14>] (fsg_main_thread+0x85c/0x175c [g_file_storage]) from [<b0077c48>] (kthread+0x7c/0x84)
[ 484.995666] [<b0077c48>] (kthread+0x7c/0x84) from [<b002f950>] (kernel_thread_exit+0x0/0x8)
[ 485.004028] Code: eaffffd0e28dd008e8bd8df0e92d40f7 (e591400c)
Change the order in unbind: wait for the thread first, then close
the files.
Peter Chen [Mon, 21 Nov 2011 06:10:49 +0000 (14:10 +0800)]
ENGR00161644 usb-gadget: prime directly for status dTD of ep0
During the setup transfer, if prime status just after prime the data,
but before the data completes, there is a potential problem:
The device's qTD has NO direction bit, If the IN request(Status Stage)
is added to qTD list while the OUT (Data Stage) is priming,
then the IN will not prime by software, it will prime automatically
by controller as OUT.
We met one usb hang issue during repeat plug in/out test at i.mx6q
that the data status has finished but status has never finished,
it is most likely above issue.
After this fix, the repeat plug in/out test passes successfully.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Anson Huang [Sat, 19 Nov 2011 02:24:21 +0000 (10:24 +0800)]
ENGR00162643 [MX6]Decline SOC LDO voltage to make suspend/resume work
Need to decline SOC LDO domain voltage to make 800M ARM2 board work,
we can set the SOC power domain to be same as ARM core power domain.
Tested on both 1G rework board and 800M origin board.
Anson Huang [Fri, 18 Nov 2011 13:11:04 +0000 (21:11 +0800)]
ENGR00162612 [Mx6]Change arm core voltage of suspend for 1G cpufreq
Previous setting for ARM core is 1V during suspend, it
is working for 800MHz cpu freq, but not enough for
1G cpu freq, actually, we didn't need to change ARM core
LDO's setting during suspend, hardware will auto change it.
Peter Chen [Fri, 18 Nov 2011 06:02:45 +0000 (14:02 +0800)]
ENGR00162583-3 usb header: avoid class driver access register after usb is off
- An well-behavior class driver should disable their endpoints
after being notified disconnect with host, we use all endpoints
are stopped (ep->stopped) to indicates the class
driver will not visit device driver any more.
the ep-stopped will be initialized as 1 for non-control endpoint
it will be 0 after fsl_ep_enable, and be 1 after fsl_ep_disable.
Where is a non-sleep wait routine at disconnect event for waiting all
endpoints are stopped
- Some controller's (like i.mx6q) DP will change from J
to SE0 slowly after the cable disconnects with host, in that case there
will be a wakeup interrupt after driver enables the wakeup interrupt.
For i.mx6q, there is a discharge routine for DP after the disconnection.
- Should not wait vbus to low during first otg switch, as the wait will
be timeout when the usb cable is connecting to host.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Peter Chen [Fri, 18 Nov 2011 06:01:06 +0000 (14:01 +0800)]
ENGR00162583-2 usb driver: avoid class driver access register after usb is off
- An well-behavior class driver should disable their endpoints
after being notified disconnect with host, we use all endpoints
are stopped (ep->stopped) to indicates the class
driver will not visit device driver any more.
the ep-stopped will be initialized as 1 for non-control endpoint
it will be 0 after fsl_ep_enable, and be 1 after fsl_ep_disable.
Where is a non-sleep wait routine at disconnect event for waiting all
endpoints are stopped
- Some controller's (like i.mx6q) DP will change from J
to SE0 slowly after the cable disconnects with host, in that case there
will be a wakeup interrupt after driver enables the wakeup interrupt.
For i.mx6q, there is a discharge routine for DP after the disconnection.
- Should not wait vbus to low during first otg switch, as the wait will
be timeout when the usb cable is connecting to host.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Peter Chen [Fri, 18 Nov 2011 05:57:47 +0000 (13:57 +0800)]
ENGR00162583-1 usb msl: avoid class driver access register after usb is off
- An well-behavior class driver should disable their endpoints
after being notified disconnect with host, we use all endpoints
are stopped (ep->stopped) to indicates the class
driver will not visit device driver any more.
the ep-stopped will be initialized as 1 for non-control endpoint
it will be 0 after fsl_ep_enable, and be 1 after fsl_ep_disable.
Where is a non-sleep wait routine at disconnect event for waiting all
endpoints are stopped
- Some controller's (like i.mx6q) DP will change from J
to SE0 slowly after the cable disconnects with host, in that case there
will be a wakeup interrupt after driver enables the wakeup interrupt.
For i.mx6q, there is a discharge routine for DP after the disconnection.
- Should not wait vbus to low during first otg switch, as the wait will
be timeout when the usb cable is connecting to host.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
ENGR00162319: MX6 - Add support for updated VDDARM voltages
Set the ARM LDO voltage to 1.225V to run the part at 1GHz.
Also updated the rest of the voltages based on the latest
available working points.
The boards will need to be modified for this change to work
correctly. Please ensure that the VDDARM_IN is set to 1.38V
(using the potentiometer on the ARM2 board or choosing the correct
resistors on the sabrelite boards).
Also added command line option (arm_freq=800) to set the max ARM freq.
Add:
arm_freq=1000 -> to set the max ARM freq to 1GHz
arm_freq=800 -> to set the max ARM freq to 800MHz.
Default max ARM freq is 1GHz. No other values are currently
supported. If your board is not modified, please add the command
line "arm_freq=800' to avoid failures.
Dong Aisheng [Thu, 17 Nov 2011 11:24:54 +0000 (19:24 +0800)]
ENGR00162506 mx6q: set a correct clock for asrc
The ASRC mem to mem mode does not work without this patch.
Bacause 1.5Mhz clock rate is not available which will cause
clock setting fail, change to 7.5Mhz (the mininum one) to make
ASRC work properly.
Fugang Duan [Fri, 11 Nov 2011 06:25:11 +0000 (14:25 +0800)]
ENGR00162013 - FEC : Fix loss interrupt when add "rootwait"
- MII timeout when config ipg 40MHz mode and add "rootwait"
para in uboot. Kernel will delay before peripheral equipment
are ready, which lead to CPU loss interrupt.
- So, prolong the timeout time, and increase the MII clock.
Tony Lin [Thu, 17 Nov 2011 04:51:27 +0000 (12:51 +0800)]
ENGR00162335-1 [mx6q_arm2]SD card 3.0 can't be recognized
fix pin conflict between sd vselect and canbus enable pin.
add 'canbus' to the cmdline will enable canbus driver.
if canbus driver is enabled, sd 3.0 card will not work
ENGR00162460:MX6-Revert "MX6-Disable PLL1 when CPU clk is below 400MHz."
This reverts commit 564e25cb10cd827ea3fa5cda2487fd978f08bbd7.
Sourcing ARM_CLK from PLL2_PFD_400M is causing issues when setting
the ARM_PODF. So for now source arm_clk from PLL1_SYS_MAIN only.
Dong Aisheng [Wed, 16 Nov 2011 09:46:59 +0000 (17:46 +0800)]
ENGR00162364 flexcan: fix endless errors causing system hang
Clear state error to avoid ednless state error if error happens
which will call napi_schedule() each time, seems a little high load,
to cause system hang.
Jason Chen [Wed, 16 Nov 2011 09:33:15 +0000 (17:33 +0800)]
ENGR00162360 mxc_vout: fix STREAMOFF and G_CROP issues
1. move videobuf_mmap_free to mxc_vout_release.
2. call videobuf_queue_cancel in mxc_vout_release if no streamon called.
3. correct return value of G_CROP for support_window case.
wu guoxing [Wed, 16 Nov 2011 03:56:45 +0000 (11:56 +0800)]
ENGR00162325 mx6:Make GPU as kernel module defaultly
GC355 needs to map all reserved memory and consume too much vmalloc space.
So it needs a special kernel command line vmalloc=xxxM.
otherwise, kernel can not boot
Anson Huang [Wed, 16 Nov 2011 06:04:41 +0000 (14:04 +0800)]
ENGR00162330 [mx6]Only mask irq#86 and #125 for wait mode
These two irqs can't be masked together, otherwise, system
will crash when only booting up one core, and NFS can only
work with 4 cores running. Need hardware team to help find
the root cause, this is only a temp work around.
ENGR00162318: MX6: Donot power down PLL when PLL is disabled
Relocking of PLL sometimes takes longer than 1msec when PLL is
enabled after a power down. The kernel panics if the PLL is not locked
in 1ms. Max time expected by HW is only 500us.
Workaround is to disable the output of the PLL and set it in bypass
mode when its output is not being used.
Jason Chen [Tue, 15 Nov 2011 04:54:26 +0000 (12:54 +0800)]
ENGR00162064 mxc v4l2 output: check ipu task in S_CROP ioctl
In mxc_vout, ioctl S_CROP should call before S_FMT, for fist time S_CROP,
will not check ipu task, it actually will check in S_FMT, after S_FMT,
S_CROP should check ipu task too.
Anson Huang [Mon, 14 Nov 2011 12:31:30 +0000 (20:31 +0800)]
ENGR00162115 [WDOG]Should suspend timer in LPM
We should set the WDOG timer to suspend in low
power mode, or when system suspend, wdog will continue
to run, and reset the system. This WCR_WDZST is a write
once-only register.
Dong Aisheng [Mon, 14 Nov 2011 09:31:42 +0000 (17:31 +0800)]
ENGR00162093 mx6q: use gpio_set_value_cansleep for sleepable gpios
This can fix the following issue:
root@freescale ~$ ./ip link set can1 up type can bitrate 125000
flexcan imx6q-flexcan.1: writing ctrl=0x0e312005
------------[ cut here ]------------
WARNING: at drivers/gpio/gpiolib.c:1593 __gpio_set_value+0x64/0x74()
Modules linked in:
[<8005499c>] (unwind_backtrace+0x0/0x108) from [<804db0e8>] (dump_stack+0x20/0x24)
[<804db0e8>] (dump_stack+0x20/0x24) from [<80079ac0>] (warn_slowpath_common+0x5c/0x74)
[<80079ac0>] (warn_slowpath_common+0x5c/0x74) from [<80079b04>] (warn_slowpath_null+0x2c/0x34)
[<80079b04>] (warn_slowpath_null+0x2c/0x34) from [<80297d50>] (__gpio_set_value+0x64/0x74)
[<80297d50>] (__gpio_set_value+0x64/0x74) from [<80064630>] (mx6q_flexcan1_switch+0x50/0x54)
[<80064630>] (mx6q_flexcan1_switch+0x50/0x54) from [<80324bf0>] (flexcan_chip_start+0x2dc/0x378)
[<80324bf0>] (flexcan_chip_start+0x2dc/0x378) from [<80324d0c>] (flexcan_open+0x80/0xe8)
[<80324d0c>] (flexcan_open+0x80/0xe8) from [<8041b7a8>] (__dev_open+0xac/0xf8)
[<8041b7a8>] (__dev_open+0xac/0xf8) from [<80418848>] (__dev_change_flags+0x90/0x148)
[<80418848>] (__dev_change_flags+0x90/0x148) from [<8041b6c4>] (dev_change_flags+0x20/0x58)
[<8041b6c4>] (dev_change_flags+0x20/0x58) from [<804292d8>] (do_setlink+0x1a0/0x7b4)
[<804292d8>] (do_setlink+0x1a0/0x7b4) from [<8042a734>] (rtnl_newlink+0x438/0x488)
[<8042a734>] (rtnl_newlink+0x438/0x488) from [<8042a2d4>] (rtnetlink_rcv_msg+0x200/0x228)
[<8042a2d4>] (rtnetlink_rcv_msg+0x200/0x228) from [<80434e88>] (netlink_rcv_skb+0xcc/0xe8)
[<80434e88>] (netlink_rcv_skb+0xcc/0xe8) from [<8042a0cc>] (rtnetlink_rcv+0x2c/0x34)
[<8042a0cc>] (rtnetlink_rcv+0x2c/0x34) from [<80434aac>] (netlink_unicast+0x2c0/0x328)
[<80434aac>] (netlink_unicast+0x2c0/0x328) from [<804354a0>] (netlink_sendmsg+0x22c/0x350)
[<804354a0>] (netlink_sendmsg+0x22c/0x350) from [<80406e24>] (sock_sendmsg+0xa4/0xc4)
[<80406e24>] (sock_sendmsg+0xa4/0xc4) from [<804073a4>] (sys_sendmsg+0x140/0x270)
[<804073a4>] (sys_sendmsg+0x140/0x270) from [<8004dc40>] (ret_fast_syscall+0x0/0x30)
---[ end trace 4612d184c78ddab8 ]---
Anson Huang [Fri, 11 Nov 2011 10:45:15 +0000 (18:45 +0800)]
ENGR00162010-2 [Thermal]Add calibration to thermal
1. Read calibration from fuse to adjust formula
for thermal driver;
2. For the parts that didn't contain valid
calibration data, cooling device will be disabled;
Will Deacon [Tue, 15 Feb 2011 13:31:37 +0000 (14:31 +0100)]
ARM: 6674/1: LPAE: use long long format when printing physical addresses and ptes
[Frank Li]Fix mx6 boot failure issue during cherry-pick
For the Kernel to support 2 level and 3 level page tables, physical
addresses (and also page table entries) need to be 32 or 64-bits depending
upon the configuration.
This patch uses the %08llx conversion specifier for physical addresses
and page table entries, ensuring that they are cast to (long long) so
that common code can be used regardless of the datatype widths.
Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Jason Chen [Mon, 14 Nov 2011 02:34:49 +0000 (10:34 +0800)]
ENGR00161948 mxc v4l2 output: fix case of input crop with xoffset
run test like:
/unit_tests//mxc_v4l2_output.out -iw 1280 -ih 720 -cr 1024 700 40 0 -ow 1024
-oh 700 /unit_tests/720p.yuv
Under IPU IC bypass mode, the output color is not correct.
And sometimes come out tearing issue.
Fix them by modify fb driver adding xpanstep support and set vb->state to DONE
after it finish show.
When previous videobuf finish show and next videobuf ready to show, set
VIDEOBUF_DONE state to avoid tearing issue, which make sure showing buffer will
not be dequeue to write new data. It also bring side-effect that the last buffer
can not be dequeue correctly, app need take care about it.
- Added V3P3 regulator definitions to board file
- Added V3P3 GPIO defines and setup in board files
- Changed V220 panel timings to match settings used for certification
Signed-off-by: Danny Nold <dannynold@freescale.com>
Peter Chen [Thu, 10 Nov 2011 02:45:23 +0000 (10:45 +0800)]
ENGR00161848 mx5x: usb: fix build error
Fix the build error for mx5x
arch/arm/plat-mxc/usb_common.c: In function 'fsl_usb_host_init':
arch/arm/plat-mxc/usb_common.c:526:
error: 'UCTRL_OVER_CUR_POL' undeclared (first use in this function)
arch/arm/plat-mxc/usb_common.c:526: error:
(Each undeclared identifier is reported only once
arch/arm/plat-mxc/usb_common.c:526:
error: for each function it appears in.)
arch/arm/plat-mxc/usb_common.c:529:
error: 'UCTRL_OVER_CUR_DIS' undeclared (first use in this function)
arch/arm/plat-mxc/usb_common.c: In function 'usbotg_init':
arch/arm/plat-mxc/usb_common.c:840:
error: 'UCTRL_OVER_CUR_POL' undeclared (first use in this function)
arch/arm/plat-mxc/usb_common.c:843:
error: 'UCTRL_OVER_CUR_DIS' undeclared (first use in this function)
make[1]: *** [arch/arm/plat-mxc/usb_common.o] Error 1
make: *** [arch/arm/plat-mxc] Error 2
Signed-off-by: Peter Chen <peter.chen@freescale.com>