Anson Huang [Tue, 18 Jun 2013 05:57:33 +0000 (13:57 +0800)]
ENGR00267442 mx6: clk: some clock settings are incorrect
1. The ipg_per clock rate setting should be done after
its parent initilization done, otherwise it will get wrong
parent rate and lead to incorrect rate setting;
2. The parent info of emi_clk has been changed in latest RM,
need to update it according to RM, the parent info is as below:
ENGR00240112-1 caam: fix user space crypto API support.
This patch fix the CAAM support for Crypto User Space API support.
in the dma_map_sg_chained() function, the chained mode will loop
until the scatter list end, but when the scatter list end, it will
return null and orignal code will set this to the sg list point
used by dma_sync, so it will panic.
When do chain dma, use a tmp do going through the list.
b02247 [Mon, 14 May 2012 01:54:27 +0000 (09:54 +0800)]
ENGR00181680-2 No audio when play 3 streams after 3~10 seconds sometimes
sdma: bd is bufferable dma buffer, interrupt handler can not get correct
data after sdma script updated. Which will cause there is no interrupt
after failed period number times in the interrupt handler.
This is a workaround.
b02247 [Wed, 9 May 2012 09:30:41 +0000 (17:30 +0800)]
ENGR00181680-1 No audio when play 3 streams after 3~10 seconds sometimes
sdma: bd is bufferable dma buffer, interrupt handler can not get correct
data after sdma script updated. Which will cause there is no interrupt
after failed period number times in the interrupt handler.
This is a workaround.
Jay Monkman [Fri, 14 Jun 2013 16:47:50 +0000 (11:47 -0500)]
ENGR00267024 mx6q: Stop DMA memory fragmentation
Applied patch from customer to prevent DMA memory
fragmentation. Customer reported system crashes due to running out of
DMA-able memory while playing videos. Reported in CT42391649.
Signed-off-by: Jay Monkman <jay.monkman@freescale.com>
Liu Ying [Thu, 13 Jun 2013 04:50:27 +0000 (12:50 +0800)]
ENGR00266881 mxc vout:Flush workqueue when change is needed for streaming
We currently call cancel_work_sync() to have all left work be done. But,
this is not safe to make sure all left work being done successfully.
Instead, chances are that some work may be cancelled before starting
to be done, which may cause frame lost and make us hang at upcoming
wait_event_interruptible() in videobuf_waiton() called from video buffer
core v1 framework's dqbuf API. This patch replaces the function
call cancel_work_sync() with flush_workqueue() to fix the issue.
Liu Ying [Thu, 13 Jun 2013 03:49:56 +0000 (11:49 +0800)]
ENGR00266873 mxc vout:Release or invalidate previous buffers correctly
Users may call VIDIOC_S_CTRL ioctrl to do rotation, such as 90 degree
rotation, when a video is streaming in IC bypass mode. The runtime
rotation setting may make the vout driver lose the track for a previous
video buffer and finally cause the streaming hang. This patch releases
that video buffer in this case and invalidates previous video buffers
when necessary.
Fugang Duan [Sun, 9 Jun 2013 06:43:52 +0000 (14:43 +0800)]
ENGR00266312 mx6dl: add i2c4 bus support for sabresd/auto, arm2 platforms
imx6dq have 3 i2c controllers and 5 ecspi,imx6dl have 4 i2c4
controllers and 4 ecspi. imx6dl i2c4 clock source is routed
from pll3 through to ecspi_root gate.
Add i2c4 bus support for sabresd/auto, and arm2 platforms.
Loren Huang [Tue, 4 Jun 2013 07:08:15 +0000 (15:08 +0800)]
ENGR00265465 gpu:Add global value for minimum 3D clock export
Add global value gpu3DMinClock so that minimum 3D clock can be change by user.
When gpu min clock is too low, it may cause IPU starvation issue in certain case.
Use echo x > /sys/module/galcore/parameters/gpu3DMinClock to change it.
ENGR00263639 MX6SL-Ensure Audio PLL (PLL4) is enabled correctly
The following commit: 6f394da8b374dc4a063209deedeb5d8a62ae4c74
introduced a bug that does not enable audio PLL when its
frequency is something other than 24MHz.
This patch ensures that Audio PLL will be enabled for
all frequencies.
Mahesh Mahadevan [Wed, 22 May 2013 22:05:06 +0000 (17:05 -0500)]
ENGR00263785 Update code to read GPIO signal value
The code reads the direction register and returns value from the
DR register if pin is configured as output and from the PSR
register if pin is configured as input.
Liu Ying [Tue, 21 May 2013 09:02:46 +0000 (17:02 +0800)]
ENGR00263304-3 IPUv3:Check NULL irq handler in ipu_request_irq()
To avoid NULL interrupt handler being called potentially in the
IPU sync interrupt source handler, this patch adds sanity check
on NULL interrupt handler in the function ipu_request_irq() for
sync interrupts because the callers are likely to request a sync
interrupt without specifying a handler. The error interrupts can
still be enabled by this function without this kind of sanity
check since we simply print out the relevant error interrupt
register values in the IPU error interrupt source's handler.
This patch also corrects _ipu_get() and _ipu_put() function call
in the function ipu_request_irq() to make them be called in pair
when handler has already been registered.
Liu Ying [Tue, 21 May 2013 09:00:35 +0000 (17:00 +0800)]
ENGR00263304-2 IPUv3:Check NULL irq handler in ipu_enable_irq()
To avoid NULL interrupt handler being called potentially in the
IPU sync interrupt source handler, this patch adds sanity check
on NULL interrupt handler in the function ipu_enable_irq() before
the relevant interrupt is enabled in the sync interrupt registers.
The error interrupts can still be enabled by this function without
this kind of sanity check since we simply print out the relevant
error interrupt register values in the IPU error interrupt source's
handler. This patch also makes the function return error code to
it's callers if any error happens.
Liu Ying [Tue, 21 May 2013 03:37:59 +0000 (11:37 +0800)]
ENGR00263304-1 arm: IPUv3:Make ipu_enable_irq be able to return error
The callers of ipu_enable_irq() may choose to enable a sync interrupt
without calling ipu_request_irq() to assign an interrupt handler to
that interrupt beforehand. This is wrong and may cause NULL interrupt
handler being called in the IPU sync interrupt handler and finally
makes the system hang. This patch changes the return type of the
function ipu_enable_irq() from 'void' to 'int' so that the callers
may be aware of the error.
ENGR00262815-2 MX6SL-Add support for SDMA buffers in IRAM
Store SDMA channel and buffer descriptors in IRAM for MX6SL.
This will improve the audio playback power when both the
SDMA and audio buffers are all in IRAM. The DDR will be
self-refresh for longer periods of time.
ENGR00262815-1 MX6SL-Add support for SDMA buffers in IRAM
Store SDMA channel and buffer descriptors in IRAM for MX6SL.
This will improve the audio playback power when both the
SDMA and audio buffers are all in IRAM. The DDR will be
self-refresh for longer periods of time.
Move MMDC to be sourced from PLL2_200M in audio mode.
Set the DDR freq to be 100MHz in audio mode.
Add code to drop DDR to 25MHz when ARM is in WFI while
playing audio. This will be the case when SDMA is transferring
data from the audio buffer in IRAM. Also float the DDR IO
pins in this state.
Set Audio PLL to bypass mode.
Source both WM8962 and SSI2 from audio PLL (PLL4).
Set AHB to 8MHz in Audio playback mode when ARM is going to enter WFI.
ENGR00262435 MX6x-Drain L1/L2 buffers before DDR enters self-refresh.
The DDR freq change code and the low power WFI code in
MX6SL runs from non-cacheable but bufferable IRAM space.
Its possible for an eviction to occur from the L1
and/or L2 sync buffers after the DDR has been put into
self-refresh. This will cause the system to hang. To
avoid this ensure that the L1/L2 sync buffers are drained
properly.
Following is the info from ARM on L2 store buffers:
**********************************************************
You can use L2 sync operation to drain L2store buffer manually,
and the store buffer would be drained in such conditions:
* store buffer slot is immediately drained if targeting
device memory area
* store buffer slots are drained as soon as they are full
* store buffer is drained at each strongly ordered read
occurrence in slave ports
* store buffer is drained at each strongly ordered write
occurrence in slave ports
* as soon as all three slots of the store buffer contain data,
the least recently accessed slot starts draining
* if a hazard is detected in a store buffer slot , that slot
is drained to resolve the hazard
* store buffer slots are drained when a lock ed transaction is
received by one slave port
* store buffer slots are drained when a transaction targeting
the configuration registers is received by one slave port
* store buffer slots are automatically drained after 256 cycles
of presence in the store buffer.
You can refer to 2.5.3 Store buffer operation of PL310 trm(r3p3, DDI0246H)
for the detail.
You have to apply the explicit cache sync operation, which should be
followed by DSB, before entering the low power mode. And the bit0 of
the cache sync register(base offset 0x730) should be polling to guarantee
that the PL310 has finished sync operation.
PL310 owns three 256 bit entry store buffer & eviction buffer, and
four 256 bit LFB & LRB, and Cache sync would complete when all buffers,
LRB, LFB, STB, and EB, are empty.
The actual overhead should be close to your L3 access latency.
*************************************************************************
~
~
Liu Ying [Wed, 15 May 2013 06:43:10 +0000 (14:43 +0800)]
ENGR00262701 mxc v4l2 capture:Correct v4l2 internal master device name
There could be two v4l2 internal master devices with the same name in
the system if the name is in 'mxc_v4l2_cap<csi>' fashion, since there
are two IPUs embedded in i.MX6Q and each IPU has two CSI ports. This
patch changes the name to be in 'mxc_v4l2_cap<pdev->id>' fashion to
fix the naming issue.
Liu Ying [Mon, 13 May 2013 05:09:11 +0000 (13:09 +0800)]
ENGR00262270 IPUv3:Basic 16-bit generic data support for SMFC chan
This patch adds basic 16-bit generic data support for SMFC channel.
Although we didn't verify capturing frames with 16-bit generic
data, this could be a good starting point for developers to go on
with.
Since we move the debounce time into get the PHY out
of low power mode function(f1ac6159, ENGR00261451-3:
mx6-msl: usb: add debounce time for otgsc value),
usb_debounce_id_vbus is useless now.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Peter Chen [Tue, 7 May 2013 06:39:07 +0000 (14:39 +0800)]
ENGR00261451-4 usb: host: Fix the bug that no id INT after system resume
- Fix the bug that no id interrupt after system resume if we
plug ID cable during the system suspend periods.
- It needs to consider OTG and non-OTG condition when handling
system resume.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
- If the device is on the port during the system suspend,
and the USB as system wakeup source is not enabled. We
don't need to put the PHY into low power mode again after
platform resume, since usb bus layer will handle it. If
auto suspend is supported, the bus layer will put the PHY
into low power mode.
- Passed below two conditions for use cases, delete the useless
handling code.
1. Tested plug usb devices (high/full/low speed) during the system
suspend when usb wakeup is not enabled.
2. Tested unplug and replug usb devices (high/full/low speed) during
the system suspended when usb wakeup is not enabled.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Liu Ying [Wed, 8 May 2013 08:16:48 +0000 (16:16 +0800)]
ENGR00261860 IPUv3 dev:Correct uv offset for non-tiled formats
This patch corrects the formulae to calculate uv offset for
several non-tiled planar yuv pixel formats:
1) NV12(partial interleaved):
A part of the formula does math in this way: (width * pos_y)/2.
This is wrong for odd crop pos_y. We should rigidly get half
of crop pos_y and then have the result multiply stride(in this
case, width) instead: width * (pos_y/2). The issue could be
reproduced by the following unit test case:
/unit_tests/mxc_v4l2_output.out -iw 1024 -ih 768
-cr 496, 377, 264, 195 -ow 1024 -oh 768 -fr 30
-f NV12 ./test_nv12_xga.yuv
2) YUV420/YVU420(non-interleaved):
Similar to NV12, the wrong part '(width/2 * pos_y/2)' should
be changed to '(width/2) * (pos_y/2)', otherwise, odd crop
pos_y would cause wrong uv offset. Moreover, although height
should be a muliply of 2 according to the IPUv3 spec, it still
probably can process frames with odd height, i.e, the last y
line might consume an additional line for u and v respectively.
So, this patch rounds up height to even value by '(height+1)',
which doesn't hurt in any way. The issue could be reproduced
by the following unit test case:
/unit_tests/mxc_v4l2_output.out -iw 1024 -ih 768
-cr 496, 378, 272, 195 -ow 1024 -oh 768 -fr 30
./test_yuv420_xga.yuv
3) YUV422/YVU422(non-interleaved):
Within the context, the width parameter in the function
update_offset() is equal to stride line. The function
ipu_init_channel_buffer() requires stride line to be 4-byte
aligned, so, for this part, code change only is done without
any logic modification to make the calculation be straightforward
to be understood.
Liu Ying [Tue, 23 Apr 2013 06:36:11 +0000 (14:36 +0800)]
ENGR00261255 mxc vout:Replace classical timer with hrtimer
This patch replaces the old classical timer(low resolution timer)
with high resolution timer. This change improves the accuracy of
time point we put/activate buffers on display flow. For example,
we intend to show several frames in a framerate of 30fps(constant
interval bewteen 2 adjacent frames should be 33.33ms), the classical
timer would introduce a 10ms error in the interval which may
downgrade the video quality(jitter can be seen).
Sandor [Tue, 7 May 2013 07:20:24 +0000 (15:20 +0800)]
ENGR00261533 MX6 HDMI add 59.94Hz support
In HDMI driver, such as 59.94/60 video mode use the same
parameter, but the 59.94 is filter by HDMI driver.
Change the video mode check, add 59.94 support.
In support modes list, the 59.94 show as 59.
Peter Chen [Thu, 2 May 2013 01:04:18 +0000 (09:04 +0800)]
ENGR00261037-1: usb: usb host works abnormal after unload gadget module
If there is usb device on the OTG port when controller works
at host mode, and at this time, we unload gadget module, the
usbcmd.rs will be cleared, it is unexpected behavior.
When the controller works at one mode(eg, host mode), the register
should not be written by other mode driver (eg, devcie driver).
The OTG driver does not consider this situation, and current i.mx
FSL OTG driver does not support fully OTG function, so we remove
the caller at fsl_otg_set_peripheral which will touch controller
register.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Liu Ying [Tue, 23 Apr 2013 04:24:17 +0000 (12:24 +0800)]
ENGR00259949 mxc vout:fix screen tearing issue in ic bypass case
In ic bypass case, we put video buffers at a framebuffer display
channel directly. The display channel works at triple buffer
mode. To make sure a video buffer(buf N) has been shown on display
device, we at least need to wait for the second video buffer(buf N+2)
after the current buffer(buf N) is put on the display channel. Then,
the current buffer(buf N) can be added to the dequeue list, otherwise,
the user may get the buffer too early so that the buffer being shown
can be overwritten - screen tearing issue happens.
ASRC allocated memory for output buffer but didn't correctly free it.
This patch removed the input-buffer's incorrect double-free code,
and freed the output-buffer instead.
Liu Ying [Wed, 24 Apr 2013 06:55:46 +0000 (14:55 +0800)]
ENGR00260231 mxc vout:fill black correctly for more planar formats
In ic bypass mode, the display framebuffer pixel format will be
changed to the pixel format of the buffer queued by user. It could
be all the planar pixel formats. We will fall back to the wrong
black filling logic for UYVY and RGB pixel formats if the planar
pixel format is not NV12. This patch corrects the black filling
logic for the following planar pixel formats:
IPU_PIX_FMT_YUV420P2
IPU_PIX_FMT_YUV420P
IPU_PIX_FMT_YVU420P
IPU_PIX_FMT_YUV422P
IPU_PIX_FMT_YVU422P
IPU_PIX_FMT_YUV444P
Wayne Zou [Wed, 24 Apr 2013 01:06:36 +0000 (09:06 +0800)]
ENGR00259754 V4L2 output: Fix HDMI display green bar after video playback
After doing video playback with Bypass IC mode on HDMI display, there is
a green bar at the bottom of the display, it is caused by resetting
miscalculated display buffer size.
ENGR00260082 mx6sl_evk: Change wm8962's MCLK to 24MHz
The clock, output from wm8962's FLL, is sometimes inaccurate.
This's because 26MHz is not quite stable for wm8962's internal FLL,
So change to 24MHz, the value recommended by Wolfson,
which has been used on SabreSD for quite a long time.
Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
Peter Chen [Tue, 16 Apr 2013 01:47:15 +0000 (09:47 +0800)]
ENGR00258491-2 msl-mx6: usb: put PHY to be out of low power explicitly
We have wrong understanding that reset controller will put PHY
to be out of low power automatically, but in fact, it is not.
So, we should put PHY to be out of low power explicitly if the
portsc.phcd = 1 before we need to access controller's register.
Some register writing will hang system (eg,PERIODICLISTBASE),
some reading will not get the correct value (eg, otgsc).
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Peter Chen [Fri, 12 Apr 2013 08:04:37 +0000 (16:04 +0800)]
ENGR00258491-1 usb: host: fix error at unload module path
- When take the PHY out of low power mode, it needs to
call PHY's API, only set controller register is
not enough for some platforms
- usb_put_hcd will free hcd, all hcd related operation should
be prior to it.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
That patch will lead to kernel crash when doing video playback on video16 with
overlay on. The reason is that fb driver doesn't reallocate larger DMA buffer
requested by V4L2 driver, while IPU hardware write to large DMA address.
Other solution is needed for the original issue.
ENGR00259341 mx6: Need to keep WAIT mode fix bit set before standby
According to hardware design requirement, the WAIT mode setting bit17
need to be set if system enter suspend without ARM power gated, so in
standby mode, we can NOT clear this bit.
ENGR00259189 thermal:mx6: Make sure thermal alarm working safely
The thermal sensor's value will be updated even it is power down,
as thermal sensor's clock source is from PLL3, so there is chance
that PLL3 is disabled before thermal driver is probed during kernel
boot up, so the value in thermal sensor can be incorrect in this
PLL3 disabled window.
Previous flow of thermal driver probe routine will enable PLL3
clock, then set the thermal alarm value and enable the alarm irq,
there is no delay or check about the thermal sensor's value, only
when the thermal sensor's value is correct, its alarm function
can be enabled. As adding delay in the probe routine is not a
good option, so we move the enabling of thermal alarm function
into the get temperature routine, as after the thermal value is
read, the alarm function is safe enough, as the thermal sensor
will be always working right after a read if its clock is enabled.
Wayne Zou [Fri, 1 Mar 2013 08:05:47 +0000 (16:05 +0800)]
ENGR00239959 V4L2 output: Fix video playback bug if pulling window out of screen
Add strict input parameters check for v4l2 output drivers. The part of window
inside the display boundary is shown if pulling window out of screen.
About this issue: video playback error if pulling window out of screen
Using totem to play a video and using the mouse to pull the video window
out of the screen, it will print the follow errors:
imx-ipuv3 imx-ipuv3.0: ERR:[0xbad85200]-no:0x15c0 "wait_for_comp_timeo
ut" ret:0,line:2768
imx-ipuv3 imx-ipuv3.0: ERR: [0xbad85200] no-0x15c0, timeout:1000ms!
imx-ipuv3 imx-ipuv3.0: ERR: no-0x15c0,ipu_queue_task err:-110
mxc_v4l2_output mxc_v4l2_output.0: display work fail ret = -110
imx-ipuv3 imx-ipuv3.0: warning: disable ipu dma channel 21 during its busy state
Terry Lv [Tue, 16 Apr 2013 11:05:54 +0000 (19:05 +0800)]
ENGR00259008: mlb: reduce iram usage amount in async mode
In testing async mode on mx6q ard and mx6dl ard, driver always said "can
not alloc rx buffer".
Change async's ring buffer size from 2048 to 1536(MEP package size) and
reduce the extra ring buffer for drop package, now the iram usage amount
in async mode reduced from 34816 to 24576.
ENGR00258885 flexcan: fix errata ERR005641 that MB may fail to be sent
This is an issue from IC errata ERR005641 which is described as follows:
----------------------------------------------------------
FlexCAN does not transmit a message that is enabled to be transmitted
in a specific moment during the arbitration process. The following
conditions are necessary to have the issue.
- Only one MB is configured to be transmitted
- The write which enables the MB to be transmitted (write on Control status
word) happens during a specific clock during the arbitration process.
After this arbitration process occurs, the bus goes to Idle state and no
new message is received on bus.
For example:
1) MB13 is deactivated on RxIntermission (write 0x0 on CODE field from Control
Status word) - First write on CODE
2) Reconfigure the ID and data fields
3) Enable the MB13 to be transmitted on BusIdle (write 0xC on Code
field) - Second write on code
4) CAN bus keeps in Idle state
5) No write on Control status from any MB happens.
During the second write on code (step 3), the write must happen one clock
before the current MB13 is to be scanned by arbitration process.
In this case, it does not detect the new code (0xC) and no new arbitration is
scheduled.
The suggested workaround which is implemented in this patch is:
The workaround consists of executing two extra steps:
6. Reserve the first valid mailbox as an inactive mailbox (CODE=0b1000).
If RX FIFO is disabled, this mailbox must be MB0. Otherwise, the first
valid mailbox can be found by using table "RX FIFO filters" on FlexCAN3 chapter.
7. Write twice INACTIVE code (0b1000) into the first valid mailbox.
Note: The first mailbox cannot be used for reception or transmission process.
-------------------------------------------------------------
Note: Although the currently flexcan driver does not have the step 1 to run,
it's also possible to meet this issue in theory because we can not predict
when the arbitration is scheduled.
With a modified can-utils/canfdttest tool simulating Pingpong test, we were
able to reproduce this issue after running a about one day.
After applying this patch, we ran six days and did not see the issue happen
again on two mx6q sabrelite boards.
Reuben Dowle [Mon, 31 Oct 2011 22:18:03 +0000 (11:18 +1300)]
can: flexcan: Fix CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK
Currently the flexcan driver uses hardware local echo. This blindly
echos all transmitted frames to all receiving sockets, regardless what
CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK are set to.
This patch now submits transmitted frames to be echoed in the transmit
complete interrupt, preserving the reference to the sending
socket. This allows the can protocol to correctly handle the local
echo.
Further this patch moves tx_bytes statistic accounting into the tx_complete
handler.
Signed-off-by: Reuben Dowle <reuben.dowle@navico.com>
[mkl: move tx_bytes accounting into tx_complete handler; cleanups] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
can: dev: let can_get_echo_skb() return dlc of CAN frame
can_get_echo_skb() is usually called in the TX complete handler.
The stats->tx_packets and stats->tx_bytes should be updated there, too.
This patch simplifies to figure out the size of the sent CAN frame.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
ENGR00257847-2 MX6Q/DL-Fix Ethernet performance issue when WAIT mode is active
All of the interrupts from the ENET block are not routed to
the GPC block. Hence ENET interrupts are not able to wake
up the SOC when the system is in WAIT mode. And the ENET
interrupt gets serviced only when another interrupt causes
the SOC to exit WAIT mode. This impacts the ENET performance.
To fix the issue two options:
1. Route the ENET interrupt to a GPIO. Need to enable the
CONFIG_MX6_ENET_IRQ_TO_GPIO in the config.
2. If the GPIO mechanism cannot be used and is not enabled
by the above mentioned config, the patch will disable entry
to WAIT mode until ENET clock is active. When the ENET clock
is disabled, WAIT mode will be automatically enetered.
ENGR00257847-1 MX6Q/DL-Fix Ethernet performance issue when WAIT mode is active
All of the interrupts from the ENET block are not routed to
the GPC block. Hence ENET interrupts are not able to wake
up the SOC when the system is in WAIT mode. And the ENET
interrupt gets serviced only when another interrupt causes
the SOC to exit WAIT mode. This impacts the ENET performance.
To fix the issue two options:
1. Route the ENET interrupt to a GPIO. Need to enable the
CONFIG_MX6_ENET_IRQ_TO_GPIO in the config.
This patch provides support for routing the ENET interrupt
to GPIO_1_6. Routing to this GPIO requires no HW board mods.
If the GPIO_1_6 is being used for some other peripheral,
this patch can be followed to route the ENET interrupt to
any other GPIO though a HW mode maybe required.
2. If the GPIO mechanism cannot be used and is not enabled
by the above mentioned config, the patch will disable entry
to WAIT mode until ENET clock is active. When the ENET clock
is disabled, WAIT mode will be automatically enetered.
Terry Lv [Fri, 12 Apr 2013 07:44:46 +0000 (15:44 +0800)]
ENGR00258357-5: mlb: Use circle buf macros to replace old ringbuf mechanism
Use circle buf to replace old ringbuf mechanism.
Change to use circle buffer in read, write, rx isr and tx isr functions.
In first design of MLB, it's using it's own mechanism to manage ring
buffer, like in mxc_mlb.c.
And then, I saw that kernel already had a serials of circ buffer macros
which can be used to manage ring buffers.
This patch is to use circle buffer macros to manage mlb internal ring
buffers.
For detail of circle buffers, you can refer to
linux-2.6-imx/Documentation/circular-buffers.txt.
Terry Lv [Fri, 12 Apr 2013 07:33:56 +0000 (15:33 +0800)]
ENGR00258357-4: mlb: Group static variables to structure mlb_data
Group static variables to structure mlb_data.
Use mlb_data as platform data to be passed to file operation
functions.
Change accordingly functions for this change.
Terry Lv [Fri, 12 Apr 2013 07:18:50 +0000 (15:18 +0800)]
ENGR00258357-3: mlb: Reset whole CDR in init function
Reset whole CDR in init function. This will make mlb connection to MITB
more stable.
This is a missed part in mx6 rm's mlb section, but new in mlb's latest
spec DS62420AP2.pdf 12.1.1-1.
Without this patch, mlb may receive irq from MITB during initialization.
It might cause some connection issue that mlb can't receive data
sometimes. It was treat to be MITB's fault before we get the latest
spec.
Terry Lv [Thu, 11 Apr 2013 09:05:00 +0000 (17:05 +0800)]
ENGR00256417: MLB: can't receive data in wait mode
For MLB uses iram for data transfer, and there's a missing of dependency
on iram in MLB's clock setting, MLB can't receive data in wait mode.
We need to add ocram clock dependency in MLB clock.
Peter Chen [Wed, 10 Apr 2013 07:18:39 +0000 (15:18 +0800)]
ENGR00257130-7 usb: host: Disable wakeup when switch PHY from off to on
Disable wakeup interrupt, since there is wakeup
when phcd from 1->0 if wakeup interrupt is enabled.
The unexpected wakeup can be disappeared using this fix.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Peter Chen [Tue, 9 Apr 2013 08:18:51 +0000 (16:18 +0800)]
ENGR00257130-6 mx6-msl: usb: Add 500us delay for phy stable time
The PHY needs 500us time to be stable when its clock
from off to on. If there is wakeup enable before the
PHY is stable, there will be an unexpected wakeup.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Peter Chen [Wed, 3 Apr 2013 08:36:45 +0000 (16:36 +0800)]
ENGR00257130-3 usb: host: open the PHY when changing wakeup setting
- Disable irq when we change wakeup setting as there is unexpected
interrupt when we power PHY but enables wakeup.
- Power PHY when we need to change wakeup setting, as some wakeup
settings at PHY domain.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Peter Chen [Wed, 3 Apr 2013 08:28:01 +0000 (16:28 +0800)]
ENGR00257130-2 msl: usb: Disable auto power PHY if usb wakeup disabled
- We need to disable auto power PHY if there is a wakeup at USB port,
but usb as wakeup source is disabled, otherwise, there will be unexpected
interrupt when the software thinks the controller is still at low power
mode.
- Rework usbh1_wakeup_event_clear. The old design was incorrect, align
it with usb_dr.c.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
mtd: fix recovery after failed write-buffer operation in cfi_cmdset_0002.c
When working on a problem with some flash chips that lock up during
write-buffer operations, I think there may be a bug in the linux
handling of chips using cfi_cmdset_0002.c.
The datasheets I have found for a number of these chips all specify that
when aborting a write-buffer command, it is not enough to use the
standard reset. Rather a "write-to-buffer-reset command" is needed.
This command is quite similar for all chips, the main variance seem to
be if the final 0xF0 can go to any address or must go to addr_unlock1.
The bug is then in the recovery handling when timing out at the end of
do_write_buffer, where using the normal reset command is not sufficient.
Without this change, if the write-buffer command fails then any
following operations on the flash also fail.
mtd: cfi_cmdset_0002: Micron M29EW bugfixes as per TN-13-07
Fix the following issues with Micron's (formerly Numonyx)
M29EW NOR flash chips, as documented on TN-13-07:
- Correcting Erase Suspend Hang Ups (page 20)
- Resolving the Delay After Resume Issue (page 22)
Paul Parsons [Wed, 7 Mar 2012 14:11:16 +0000 (14:11 +0000)]
mtd: chips: cfi_cmdset_0002: Match ENABLE_VPP()/DISABLE_VPP() calls
This patch is part of a set which fixes unnecessary flash erase and write errors
resulting from the MTD CFI driver turning off vpp while an erase is in progress.
This patch ensures that only those flash operations which call ENABLE_VPP() can
then call DISABLE_VPP(). Other operations should never call DISABLE_VPP().
Signed-off-by: Paul Parsons <lost.distance@yahoo.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Huang Shijie <b32955@freescale.com>
Ira W. Snyder [Fri, 6 Jan 2012 19:29:19 +0000 (11:29 -0800)]
mtd: cfi: AMD/Fujitsu compatibles: add panic write support
This allows the mtdoops driver to work on flash chips using the
AMD/Fujitsu compatible command set.
As the code comments note, the locks used throughout the normal code
paths in the driver are ignored, so that the chance of writing out the
kernel's last messages are maximized.
Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Huang Shijie <b32955@freescale.com>
ENGR00257947 mtd: use memcpy to replace the memcpy_fromio
During the read of NOR, the kernel actually calls the inline_map_copy_from()
to read the data out. And inline_map_copy_from() will use the memcpy_fromio()
to do the real job.
The memcpy_fromio macro maps _memcpy_fromio() in the current code.
But the _memcpy_fromio() will use readb() to do the copy work one byte
by one byte. This makes the read performance of NOR very slow(about 2~3MB/s).
A similiar discussion could be found in:
http://lists.infradead.org/pipermail/linux-arm-kernel/2009-November/003860.html
This patch replace the memcpy_fromio with memcpy which is optimized by the
kernel.
The following is the result from mtd_speedtest with M29W256GL7AN6E:
=================================================
mtd_speedtest: MTD device: 2
mtd_speedtest: not NAND flash, assume page size is 512 bytes.
mtd_speedtest: MTD device size 4194304, eraseblock size 131072, page size 512,
count of eraseblocks 32, pages per eraseblock 256, OOB size 0
mtd_speedtest: testing eraseblock write speed
mtd_speedtest: eraseblock write speed is 845 KiB/s
mtd_speedtest: testing eraseblock read speed
mtd_speedtest: eraseblock read speed is 19504 KiB/s
mtd_speedtest: testing page write speed
mtd_speedtest: page write speed is 845 KiB/s
mtd_speedtest: testing page read speed
mtd_speedtest: page read speed is 19140 KiB/s
mtd_speedtest: testing 2 page write speed
mtd_speedtest: 2 page write speed is 846 KiB/s
mtd_speedtest: testing 2 page read speed
mtd_speedtest: 2 page read speed is 19320 KiB/s
mtd_speedtest: Testing erase speed
mtd_speedtest: erase speed is 233 KiB/s
mtd_speedtest: Testing 2x multi-block erase speed
mtd_speedtest: 2x multi-block erase speed is 225 KiB/s
mtd_speedtest: Testing 4x multi-block erase speed
mtd_speedtest: 4x multi-block erase speed is 224 KiB/s
mtd_speedtest: Testing 8x multi-block erase speed
mtd_speedtest: 8x multi-block erase speed is 225 KiB/s
mtd_speedtest: Testing 16x multi-block erase speed
mtd_speedtest: 16x multi-block erase speed is 225 KiB/s
mtd_speedtest: Testing 32x multi-block erase speed
mtd_speedtest: 32x multi-block erase speed is 225 KiB/s
mtd_speedtest: Testing 64x multi-block erase speed
mtd_speedtest: 64x multi-block erase speed is 224 KiB/s
mtd_speedtest: finished
=================================================
Richard Zhu [Tue, 12 Mar 2013 08:35:42 +0000 (16:35 +0800)]
ENGR00257661 pcie: imx: pcie ep/rc validation
HW setup:
* Two i.MX6Q SD boards, one is used as PCIe RC, the other
is used as PCIe EP. Connected by 2*mini_PCIe to standard_PCIe
adaptors, 2*PEX cable adaptors, One PCIe cable.
SW setup:
* When build RC image, make sure that
CONFIG_IMX_PCIE=y
# CONFIG_IMX_PCIE_EP_MODE_IN_EP_RC_SYS is not set
CONFIG_IMX_PCIE_RC_MODE_IN_EP_RC_SYS=y
* When build EP image, make sure that
CONFIG_IMX_PCIE=y
CONFIG_IMX_PCIE_EP_MODE_IN_EP_RC_SYS=y
# CONFIG_IMX_PCIE_RC_MODE_IN_EP_RC_SYS is not set
Features:
* Set-up link between RC and EP by their stand-alone
125MHz running internally.
* In EP's system, EP can access the reserved ddr memory
(default address:0x40000000) of PCIe RC's system, by the
interconnection between PCIe EP and PCIe RC.
* add the configuration methods in the EP side, used to
configure the start address and the size of the reserved
RC's memory window.
- cat /sys/devices/platform/imx-pcie/rc_memw_info
- echo 0x41000000 > /sys/devices/platform/imx-pcie/rc_memw_start_set
- echo 0x800000 > /sys/devices/platform/imx-pcie/rc_memw_size_set
Throughput:
* when enable the EP_SELF_IO_TEST, and ARM core used as the
bus master: write speed ~300MB/s, read speed ~100MB/s.
* IPU used as the bus master: write speed ~344MB/s, read
speed ~211MB/s.