Age | Commit message (Collapse) | Author |
|
update sdma script and the script number.
Signed-off-by: Robin Gong <b38343@freescale.com>
|
|
Add YUV444 csc support in pxp driver.
Signed-off-by: Sandor Yu <R01008@freescale.com>
|
|
This patch use more common dma interface , including "device_prep_dma_memcpy" and
"device_prep_dma_sg". The way in v3.0.35 reuse "device_prep_slave_sg" and need call
twice to tell dest dma address in one memory copy(ENGR00233569). It looks tricky
something, so give up the original patch. In this patch,"device_prep_dma_memcpy"
support memory copy by buffer and "device_prep_dma_sg" support memory copy by scatter-list.
You can get the example code from 'linux-test/module_test/mxc_sdma_memcopy_test.'
Signed-off-by: Robin Gong <b38343@freescale.com>
|
|
The new Solo X has more requirements for SDMA events. So it creates a event mux
to remap most of event numbers in GPR (General Purpose Register). If we want to
use SDMA support for those module who do not get the even number as default, we
need to configure GPR first.
Thus this patch adds this support of GPR event remapping configuration to the
SDMA driver.
Acked-by: Robin Gong <b38343@freescale.com>
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
Some V4L2 apps require that playing rotated fullscreen video on
the screen. In recent PXP driver, this is not supported yet. So
this patch adds it on through combining rotation and resize together.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
|
|
There is no sensible reason why #dma-cells shouldn't be allowed to be 0. It is
completely up to the DMA controller how many additional parameters, besides the
phandle, it needs to identify a channel. E.g. for DMA controller with only one
channel or for DMA controllers which don't have a restriction on which channel
can be used for which peripheral it completely legitimate to not require any
additional parameters.
Also fixes the following warning:
drivers/dma/of-dma.c: In function 'of_dma_controller_register':
drivers/dma/of-dma.c:67:7: warning: 'nbcells' may be used uninitialized in this function
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit ff0e0f4f568e8d7593e0035c0c58067bcaf4ab07)
|
|
This patch adds SAI script support to imx-sdma.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
Add the dependency for imx6sx.
Signed-off-by: Huang Shijie <b32955@freescale.com>
|
|
The display axi clock is a clock gating newly added on imx6sx.
It need to be enabled for lcdif/pxp/csi/pcie to work.
It should be set as a placeholder on other SoCs.
Signed-off-by: Robby Cai <R63905@freescale.com>
|
|
Since the pxp registers have been already set to default values
after hardware reset, it is not necessary to re-initialize them
again. And this can accelerate the system booting procedure.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
|
|
The function dump_pxp_reg() may be called when the pxp
clock is disabled. So this will cause system hang issue.
Now add clock enable/disable pair to this function call.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
|
|
finished
The PXP registers should be cleared to its default values after each
task done to avoid affecting the other later tasks status. And PXP
CTRL register provide a SFTRST bit to do this on hardware level.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
|
|
We should add thread stop checking before handle pxp task,
since the wait condition includes this check.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
The PXP itself doesn't support YVU420P default. But we can get the
U and V address according to the format when we try to set PS_UBUF
and PS_VBUF registers. So the YVU420P can be supported indirectly.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
avoid hang
By default, the kernel thread cannot be freezed during pm suspend.
So during pm suspend, the pxp_dipatch thread is still handling pxp
task and setting pxp registers. And in some time, this pxp register
setting may happen after the pxp_suspend done. So the hang issue
happens. This patch set the thread to be freezable to freeze it
before pxp_suspend called to avoid this hang issue.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
This change add support for new dma buffer type(writecombine and cacheable)
which allows user application has more choices for the buffer type. And if
the dma buffer is cacheable, then add flush interfaces to make it cache
coherent when necessary.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
Enhance channel and buffer reclaim to make sure that all the
allocated resources which are not freed yet to be freed
when the device file descriptor release() function called.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
Change irq_pending field in struct pxp_irq_info to a atomic
type. So the spin lock in pxp_irq_info is unnecessary.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
The allocated DMA channels via some opened file descriptor is better
to be bound to this descriptor. Since this can avoid some application
to fake a channel id which may be requested by other applications to
request PXP service. And also, this make it easier to release the dma
channel when application exists abnormally or forgets to release it
explicitly.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
The cpu_addr field in struct pxp_mem_desc cannot be used
by user application, so it is not necessary to pass this
field data to user. Now the similar field 'virtual' in
struct pxp_buf_obj is used to store the kernel space
virtual addr for allocated dma buffer.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
Create pxp_info struct data for each opened device file descriptor.
And bind all the allocated dma buffers to this struct for each opened
file. This makes the dma buffer lists management safer, more effective
and more flexible.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
Move two struct definitions defined in pxp_device.c to pxp_device.h.
Now the pxp_device.h has been created for PXP device driver. So all
the type definition should stay in header file not c source file.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
Since the number of dma channels is constant, it is more efficient
to use an array to record all the channels alloc/free status.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
header file
Some definitions used only by PXP device driver should not stay in
pxp_dma.h which is shared by PXP, EPDC and V4L2. So the patch creates
a new header file pxp_device.h to hold these definitions.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
This patch provides the following refinements:
1. For pxp channel lock, use spin_lock() instead of spin_lock_irqsave().
Since this lock is not used in any ISR. Moreover, this can increase the
driver's concurrency with no local irq disabled.
2. Narrow down the pxp lock's locking range in pxp_issue_pending().
Since this lock is also used in PXP ISR, so its hold time should be as
few as possible to reduce the time when local irq disabled.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
The head list empty check in function pxpdma_dostart_work()
is meaningless, since this function only can be called when
there is some pxp task in the head list, that is to say head
list is not empty.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
There is no need to use spin lock in pxp_prep_slave_sg() after
dynamic descriptors allocation enabled.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
struct pxp_irq_info is only used by PXP device driver, so it is unreasonable
to define it in pxp_dma.h which will be included by EPDC, V4L2 PXP and PXP
device driver.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
This mutex lock is no longer necessary in PXP dma driver. After
the commit "ENGR00291400 PXP: Organize PXP task queue to be FIFO",
protection fields can be protected by the spin lock in PXP channel
now.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
start PXP
After the commit "ffcad666548417ef21937e0a755d85ab922313a9" pushed,
adding this support in PXP device driver is also necessary. This
change allows users to submit more than one PXP tasks followd by
only one wait for finished ioctl. It means that users can wait for
more than one tasks done by calling one PXP_IOC_WAIT4CMPLT ioctl.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
The requested PXP tasks were handled based on channel unit. All the
tasks in one channel were handled one by one, and the tasks in another
channel only can get chance after all the tasks in previous channel
were finished. So this may allow some channel occupies PXP hardware
exclusively all the time, and other channels may never get PXP services.
So this change makes the PXP task queue to be a FIFO to avoid this kind
of unfair usage for PXP.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
initialization
In previous PXP driver, the number of tx descriptors allocated
for each channel is a constant 16 and they can only be allocated
during PXP initialization. But since the driver allows users to
queue more than one PXP tasks for each channel before issuing
pending tasks, so in this case the descriptors may be not enough
for some cases.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
Move PXP registers setting from pxp_issue_pending() to a seperate
kernel thread. This change will avoid the multi instances hang issues
solved in previous commits. And also the pxp users won't be blocked
when it call dma_async_issue_pending() function.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
When the s0 format is PXP_PIX_FMT_YUV422P, the s0 pitch and U/V
buffer address cannot be set correctly.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
After the patch 6320ada11093ef0a4ded9065d6ae284a9129f7d6, there still exists
some cases that more than one user would set PXP hardware registers before the
previous task done. Now use another mutex lock to make sure that registers
settings can only happen when PXP hardware is idle.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
In pxp_issue_pending(), the wait for pxp done processes will be woken up
together in PXP ISR. So there will be some situations that one process will
set PXP hardware registers after another process's setting but before the
first PXP task done. So the PXP hardware may be corrupted and hang maybe
happen.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
Use stride to set AS and PS pitch by default, if stride is 0, then use
width to set AS and PS pitch instead. This will make PXP driver both
work for PXP kernel users and G2D applications.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
Support YUV formats like: I420, NV12, NV21, UYVY,
YUYV, VYUY, YVYU, NV16, NV61 and YV12.
Support rotation in both stages before and after alpha blending.
Signed-off-by: Fancy Fang <B47543@freescale.com>
|
|
We try to allocate memory from SoC internal SRAM so that we can turn off
voltage of external DDR to save power. Surely, if we failed to get the
iram DT node or allocate memory due to no enough SRAM space, we would
allow SDMA driver to allocate memory in a traditional way.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
add runtime pm implementation for eLCDIF/EPDC/PxP
Signed-off-by: Robby Cai <R63905@freescale.com>
|
|
There's no explicit BIT in PxP register to disable AS buffer.
The right way to disable AS is to set ULC to a higher value than the LRC.
It has been done once in probe time, but not in run time.
This could cause one potential problem because even when ULC, LRC
and buffer address is set to 0 PxP will still fetch one pixel data from addr 0.
This patch fixes it by set ULC higher than LRC for AS if it's not used (i.e.,
no alpha-blending) at run time.
Signed-off-by: Robby Cai <R63905@freescale.com>
|
|
ASRC and HDMI audio might meet unexpected stop, 'ctrl+z' for example,
and then disable its sdma channel. But after 'fg' resume, because sdma
channel's status has already been set into DMA_ERROR, we need to prepare
dmaengine again to clear its error state, otherwise sdma driver would
bypass its channel enabling and 'Input/Output error' would happen to
ALSA lib.
The combined prepare and submit are also being used in soc-dmaengine,
the common ASoC dmaengine driver.
And since we already use a proper way to handle sdma channel status,
there's no need to make an exception for HDMI any more, so drop it.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
Previously, we used sdma's event pending to forcibly re-schedule sdma
for work round, because sdma channel for ASRC input task would fail to
be opened due to its dma request always keeping high after ASRC opens
the pair, which cause sdma miss the trigger point of dma request.
Now, instead of using event pending, we clear the dma request on ASRC
driver side by setting its thresholds to an impossible trigger area
during its stall state. Since ASRC would stall its process when input
fifo is near empty or output fifo is near full, during the stall state,
the specific thresholds, 0 for input fifo and 63 for output fifo, would
never let asrc meet this condition. So dma request can be cleared and
raised again after we restore the true required thresholds.
Accordingly, since we don't need event pending any more, we dropped the
code from the sdma driver.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
There's a missing script for hdmi audio support in current sdma driver,
thus add it.
This HDMI script doesn't use bd to copy memory like a normal one does
but only to update the memory address for HDMI internal AHB DMA and
then trigger its procedure automatically.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
For the sake of support asrc p2p, the sdma driver need to be updated.
1. Add another dma_request, p2p need two dma_request.
2. There are some cases which need to change the config after the
dma_request_channel. add dma_request config in dmaengine_slave_config().
3. add dma_request0 and dma_request1 in dma_slave_config for runtime config
in dmaengine_slave_config.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
It's ported from v3.5.7, which contains ePxP DMAENGINE driver and
a client driver named pxp_device. This patch also includes the changes:
- use uapi header file
- remove VM_RESERVED since it's deprecated, and drop redundant VM_IO flag
since it's automatically set in remap_pfn_range()
- use <linux/platform_data/dma-imx.h> instead of <mach/dma.h>
- use devm_kzalloc() instead in pxp_probe()
- use macro __KERNEL__ in pxp_dma uapi header to avoid definition conflict
Signed-off-by: Robby Cai <R63905@freescale.com>
|
|
Use correct sdma script for ASRC.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
Add interface to allow other modules, like ASRC for example,
to trigger a dma request manually.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
To support SSI dual-fifo mode, we need to add dual-fifo script for sdma.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
The total number should be 35. Thus fix it.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|