Should read TS character before updating value of GPCNT1, because TS
character will also cost 12 etus.
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Shouldn't clear PEF/FEF flag in irq handler as they are just a flag which
can't trigger interrupt. And they will be check later in irq handler.
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Once detected a valid TS, the ICM bit is cleared and the data format bit,
IC bit , is set to appropriate value depending on the data format
detected using the initial character.
When TS is 0x3B (direct convention) in cold reset, and then become 0x3F
(inverse convention) in warm reset, it will not in ICM mode.
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Enable CWT for ATR, and switch to RX_DATA_IM to detect receiving data
in fifo.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Card Presence Detect Status Bit SPDP in EMV_SIM_PCSR is
synchronized by two posedge of low_ref_clk which is 32KHz.
So there should be 1.5 low_ref_clk cycles(about 90us) before
reading SPDP Bit.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
The EMVSIM module is designed to facilitate communication to
Smart Cards compatible to the EMV ver4.3 standard and compatible
with ISO/IEC 7816-3 Standard.
This patch adds driver to support EMVSIM module for imx8.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Reviewed-by: Andy Duan <fugang.duan@nxp.com>
Kernel space cannot access user space memory directly.
In fact, the issue always exited. Since 4.4, the kernel
handle the action as page abort.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
SIM1 IOMUX is changed into reset state in LPSR mode.As a result,
sim can't work again.
This patch sets sim1 IOMUX to default state after existing from LPSR mode.
(cherry-picked from commit 8e237775cd413645bfd806e4c648954e1a773a2d)
Signed-off-by: Gao Pan <b54642@freescale.com>
sim_activate() process is contained in the cold reset.
Thus, it is redundant and should be removed.
This patch also adds comments to cold reset process.
Signed-off-by: Gao Pan <b54642@freescale.com>
The API devm_request_and_ioremap meets compile error
on branch imx_4.1.y. It is recommend to replace the api
with devm_ioremap_resource.
Signed-off-by: Gao Pan <b54642@freescale.com>
The EMV4.3 has strict requirement about the reset sequence. The old code use the mdelay, udelay to
achievet, which is not precise enough. Replace it with the timer interrupt. The EMV4.3 requires
40000~45000 clock cycles duration when reset is low.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from a006fe283c8b97f0a711cb0829bfbdaaf4a5f31f)
In EMV4.3 after warm/cold reset, there would be a receiving window. The receiving
window would be 42000 clock length.If the receiving window expires without receiving
one byte, IFD need to take actions as EMV4.3 spec. The driver need to support this
to identify the sequence of the receiving window expiring event and the receiving event.
Since theinterrupt latency in linux OS is not certain, we need to tune this setting to
pass the cases. Current tuning parameter can work.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from faf1d8d881a6ad2c6b88fdf312cef142996937c1)
The CWT timer is used to detect the the character interval in the data traffic.
When tx, SIM IP can guarantee the interval based our setting. When RX, we need
to enalbe the CWT timer to check whether the interval is in the range. This patch
fix this.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from 9c92dfd070e7427eb1e0166f368b89b4a7ac1bff)
Modify the driver to support the SIM on i.MX6UL-EVK platform. The main modification is:
1. Add port index to support different port on platform.
2. Add POS-CARD support. The POS card has external IC to assert when SVEN to low. Add support.
3. Using a function to calculate the strict timing delay.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from 17d1315b0704e2db63ee6bd7aaefa0c796f53104)
Add the option to enable SIM driver build.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
Signed-off-by: Gao Pan <b45643@freescale.com>
(cherry picked from 0f7a6fa3c141bfc7333d9056639b7a5b1154ed1d)
This driver is based on the current code which runs the the EMV test on the i.MX258 platform.
Since there are still many cases that can't pass on the i.MX258 and i.MX7d platform. The
driver will need to be improved after per-test work. Just check in as a base code. There
would be definitly some timing improvement work to do in the future.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from 3ac1ad5b2a68ecb052ccacca4ac7459ead04415e)
if the eos flag is not clear after output streamoff,
it may cause firmware hang with multi instances
Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
VPU decoder driver create some debug fs,
but don't set the release function,
in open function, it will alloc some memory,
it should be freed when release function is called.
otherwise, memory will be leaked.
Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
the csr register 'CM0Px_CPUWAIT' will be cleared to '1' after
reset(poweroff then poweron), hence we could check is vpu poweroff
when suspend according to this value.
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
Acked-by: Zhou Peng <eagle.zhou@nxp.com>
platform vzalloc may call wait_completion to sleep,
but sleep is forbidden during spinlock,
so use mutex instead
Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Acked-by: Zhou Peng <eagle.zhou@nxp.com>
If close is called without calling streamoff,
the status of decode is enable,
some buffer status may be wrong.
disable before release it will avoid such error.
Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Acked-by: Zhou Peng <eagle.zhou@nxp.com>
Add a missing semicolon. This missing semicolon is not breaking the
build in defconfig since the next MODULE_DEVICE_TABLE() expand to an
empty string, so the next semicolon is used. When this macro expands
to a non-empty string, the build breaks. This was found by a
"make allmodconfig" build.
Signed-off-by: Julien Olivain <julien.olivain@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Acked-by: Zhou Peng <eagle.zhou@nxp.com>
Add a missing semicolon. This missing semicolon is not breaking the
build in defconfig since the next MODULE_DEVICE_TABLE() expand to an
empty string, so the next semicolon is used. When this macro expands
to a non-empty string, the build breaks. This was found by a
"make allmodconfig" build.
Signed-off-by: Julien Olivain <julien.olivain@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Acked-by: Zhou Peng <eagle.zhou@nxp.com>
Upstream rejected per-SOC kconfig symbols such as CONFIG_ARCH_FSL_IMX8MQ
so just use CONFIG_ARCH_MXC instead.
There is already an ARM64 check in drivers/mxc/Kconfig so this
shouldn't change anything except that we can drop CONFIG_ARCH_FSL_IMX8MQ
from linux-nxp tree.
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Zhou Peng <eagle.zhou@nxp.com>
If the writeable flag is not change synchronously,
the flag may not changed correct,
it'll case the encode stream hang.
It's likely to happen when small resolution stream do suspend.
Signed-off-by: ming_qian <ming.qian@nxp.com>
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
- Enable mailbox for vpu decoder
The mailbox of mu_m0 is used by imx8qxp and imx8qm
- Unify code between 4.19 and 5.x
Update code from 4.19
Separate sc and mu contents to vpu_mu.h/vpu_mu.c
Separate pm_domain contents to vpu_pm.h/vpu_pm.c
Add kfifo for better hold received mu message
Sync v4l2 change
Use ktime_get_real_ts64() replace do_gettimeofday()
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
- Enable mailbox for vpu encoder
The mailbox of mu1_m0 is used by imx8qxp
The mailbox of mu2_m0 are used by imx8qm
- Unify code between 4.19 and 5.x
Update code from 4.19
Separate sc and mu contents to vpu_encoder_mu.h/.c
Separate pm_domain contents to vpu_encoder_pm.h/.c
Add kfifo for better hold received mu message
Sync v4l2 change
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
compat_ptr() depends on CONFIG_COMPAT.
Make hx280enc_ioctl() conditionally compiled to avoid a build
break in case CONFIG_COMPAT is not defined.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
fix dma_alloc_attrs failure issue:
need to set valid device pointer instead of null pointer in
parameters of functions: dma_alloc_coherent/dma_free_coherent
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Due to below commit:
7e98b7b542 ("media: v4l2: Get rid of ->vidioc_enum_fmt_vid_{cap, out}_mplane")
We met the following build error:
../drivers/mxc/vpu_malone/vpu_b0.c:1721:2: error: unknown field ‘vidioc_enum_fmt_vid_cap_mplane’ specified in initializer
.vidioc_enum_fmt_vid_cap_mplane = v4l2_ioctl_enum_fmt_vid_cap_mplane,
^
../drivers/mxc/vpu_malone/vpu_b0.c:1722:2: error: unknown field ‘vidioc_enum_fmt_vid_out_mplane’ specified in initializer
.vidioc_enum_fmt_vid_out_mplane = v4l2_ioctl_enum_fmt_vid_out_mplane,
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Fix build error for kernel 5.x:
- power domain adjustment
use dev_pm_domain_attach_by_name()/device_link_add
- remove sc fw api
comment fuse related function
- definition of vb2_qbuf() changed
set 'media_device' for vb2_qbuf()
- 'vidioc_g_crop'/'vidioc_s_crop' removed
comment function 'v4l2_ioctl_g_crop'
- remove legacy macro, such as 'VB2_BUF_STATE_PREPARED'
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Fix build error for kernel 5.x:
- power domain adjustment
use dev_pm_domain_attach_by_name()/device_link_add
- remove sc fw api
comment fuse related function
- definition of vb2_qbuf() changed
set 'media_device' for vb2_qbuf()
- 'vidioc_g_crop' removed
comment function 'v4l2_ioctl_g_crop'
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c: In function ‘show_buffer_info’:
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:3951:23: error: ‘VB2_BUF_STATE_REQUEUEING’ undeclared (first use in this function)
" %d:requeueing,", VB2_BUF_STATE_REQUEUEING);
Due to this macro was removed by the following commit:
commit c6e4e2c403
Author: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Date: Thu Feb 28 07:35:46 2019 -0500
media: vb2: drop VB2_BUF_STATE_REQUEUEING
The last user of this state has been converted, so we can now drop
this. Requeueing causes the queue to become unordered, which causes
problems with requests and (in the future) fences.
Since it is no longer needed, just get rid of this.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c: In function ‘show_buffer_info’:
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:4001:21: error: ‘VB2_BUF_STATE_PREPARED’ undeclared (first use in this function)
" %d:prepared,", VB2_BUF_STATE_PREPARED);
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c: At top level:
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:1415:2: error: unknown field ‘vidioc_g_crop’ specified in initializer
.vidioc_g_crop = vpu_enc_v4l2_ioctl_g_crop,
^
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:1415:2: warning: initialization from incompatible pointer type
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:1415:2: warning: (near initialization for ‘vpu_enc_v4l2_ioctl_ops.vidioc_dqbuf’)
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:1416:2: error: unknown field ‘vidioc_s_crop’ specified in initializer
.vidioc_s_crop = vpu_enc_v4l2_ioctl_s_crop,
^
Module owner can double check later if need implement the same function
in other callbackes.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c: In function ‘vpu_enc_v4l2_ioctl_qbuf’:
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:1048:8: warning: passing argument 2 of ‘vb2_qbuf’ from incompatible pointer type
ret = vb2_qbuf(&q_data->vb2_q, buf);
^
In file included from ../include/media/v4l2-mem2mem.h:20:0,
from ../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:47:
../include/media/videobuf2-v4l2.h:144:5: note: expected ‘struct media_device *’ but argument is of type ‘struct v4l2_buffer *’
int vb2_qbuf(struct vb2_queue *q, struct media_device *mdev,
^
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:1048:8: error: too few arguments to function ‘vb2_qbuf’
ret = vb2_qbuf(&q_data->vb2_q, buf);
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
../drivers/mxc/vpu_malone/vpu_b0.c: In function ‘v4l2_ioctl_qbuf’:
../drivers/mxc/vpu_malone/vpu_b0.c:920:8: warning: passing argument 2 of ‘vb2_qbuf’ from incompatible pointer type
ret = vb2_qbuf(&q_data->vb2_q, buf);
^
In file included from ../include/media/v4l2-mem2mem.h:20:0,
from ../drivers/mxc/vpu_malone/vpu_b0.c:47:
../include/media/videobuf2-v4l2.h:144:5: note: expected ‘struct media_device *’ but argument is of type ‘struct v4l2_buffer *’
int vb2_qbuf(struct vb2_queue *q, struct media_device *mdev,
^
../drivers/mxc/vpu_malone/vpu_b0.c:920:8: error: too few arguments to function ‘vb2_qbuf’
ret = vb2_qbuf(&q_data->vb2_q, buf);
^
In file included from ../include/media/v4l2-mem2mem.h:20:0,
from ../drivers/mxc/vpu_malone/vpu_b0.c:47:
../include/media/videobuf2-v4l2.h:144:5: note: declared here
int vb2_qbuf(struct vb2_queue *q, struct media_device *mdev,
^
../drivers/mxc/vpu_malone/vpu_b0.c: At top level:
../drivers/mxc/vpu_malone/vpu_b0.c:1150:2: error: unknown field ‘vidioc_g_crop’ specified in initializer
.vidioc_g_crop = v4l2_ioctl_g_crop,
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
../drivers/mxc/hantro/hantrodec.c: In function ‘hantrodec_ioctl’:
../drivers/mxc/hantro/hantrodec.c:1033:62: error: macro "access_ok" passed 3 arguments, but takes just 2
err = !access_ok(VERIFY_WRITE, (void *) arg, _IOC_SIZE(cmd));
^
../drivers/mxc/hantro/hantrodec.c:1033:10: error: ‘access_ok’ undeclared (first use in this function)
err = !access_ok(VERIFY_WRITE, (void *) arg, _IOC_SIZE(cmd));
^
../drivers/mxc/hantro/hantrodec.c:1033:10: note: each undeclared identifier is reported only once for each function it appears in
../drivers/mxc/hantro/hantrodec.c:1035:61: error: macro "access_ok" passed 3 arguments, but takes just 2
err = !access_ok(VERIFY_READ, (void *) arg, _IOC_SIZE(cmd));
^
CC drivers/mtd/nand/raw/nand_base.o
CC drivers/irqchip/irq-mvebu-odmi.o
CC drivers/mtd/nand/raw/nand_legacy.o
../drivers/mxc/hantro/hantrodec.c: In function ‘get_hantro_core_desc32’:
../drivers/mxc/hantro/hantrodec.c:1266:61: error: macro "access_ok" passed 3 arguments, but takes just 2
if (!access_ok(VERIFY_READ, up, sizeof(struct core_desc_32)) ||
^
../drivers/mxc/hantro/hantrodec.c:1266:7: error: ‘access_ok’ undeclared (first use in this function)
if (!access_ok(VERIFY_READ, up, sizeof(struct core_desc_32)) ||
^
../drivers/mxc/hantro/hantrodec.c: In function ‘put_hantro_core_desc32’:
../drivers/mxc/hantro/hantrodec.c:1280:62: error: macro "access_ok" passed 3 arguments, but takes just 2
if (!access_ok(VERIFY_WRITE, up, sizeof(struct core_desc_32)) ||
^
../drivers/mxc/hantro/hantrodec.c:1280:7: error: ‘access_ok’ undeclared (first use in this function)
if (!access_ok(VERIFY_WRITE, up, sizeof(struct core_desc_32)) ||
^
../scripts/Makefile.build:278: recipe for target 'drivers/mxc/hantro/hantrodec.o' failed
make[4]: *** [drivers/mxc/hantro/hantrodec.o] Error 1
../scripts/Makefile.build:489: recipe for target 'drivers/mxc/hantro' failed
make[3]: *** [drivers/mxc/hantro] Error 2
../scripts/Makefile.build:489: recipe for target 'drivers/mxc' failed
make[2]: *** [drivers/mxc] Error 2
make[2]: *** Waiting for unfinished jobs...
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
gpu_probe set coherent_dma_mask with 40BIT configuration,
L5.4 dma_alloc_wc will return physical address beyond 4GB,
that will cause GPU hang and kernel panic problem on QM.
default coherent_dma_mask is 32BIT, can meet GPU requirement,
this patch remove coherent_dma_mask setting from GPU driver.
Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
fix the gpu dump when enable vProfile on 8MN_EVK
Date: 7th Nov ,2019
Signed-off-by Ya Zhou <ya.zhou@nxp.com>
(cherry picked from commit 053c97c0387673c4e730d9b2f780f8cde5fcdf5b)
Update the imx platform gpu driver to accommodate layerscape soc,
so that both platform can share the same platform driver.
Signed-off-by: Tang Yuantian <andy.tang@nxp.com>
dummy draw is required for 8MM GPU errata - HBN1285,
this fix shall be applied for GPU power-up transition,
otherwise GPU shader hang with the unnecessary flush.
check GPU MMU state to enable dummy draw fix only.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
When vm_mmap fail, code jump to OnError with error status and userLogical variable != 0.
Then _CMAFSLUnmapUser is called with a invalid virtual address (MdlMap->vmaAddr) and cause panic.
Check userLogical to avoid GPU kernel panic for error handling.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Fix GPU memory problem when disable CMA allocator,
set LINUX_CMA_FSL=0 in gc_hal_kernel_platform_imx.config
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
there are lots of PFNs busy message when run GPU tests:
[ 622.370671] alloc_contig_range: [4ea70, 4ea7c) PFNs busy
[ 626.518072] alloc_contig_range: [4ea90, 4ea9c) PFNs busy
this problem is related with CMA migration for fragments,
move CMA allocator after GFP to avoid memory migration,
also fix CMA preempt for contiguous memory request.
can improve CTS and gpubench benchmarks on M850D.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit ad77ed61b72c8362b04361acd2deb685fee15436)
When alloc NonContiguous1MPages, if malloc fail, need free the pages to avoid memory leak
Date: 24 Oct, 2019
Signed-off-by: Xianzhong Li <xianzhong.li@nxp.com>
The intension of this code is that, if current core is null, go to get the next one.
If it's already the last one, no need to do this.
Date: 23 Oct, 2019
Signed-off-by: Ella Feng <ella.feng@nxp.com>
The SCU API used in this file is for 4.19 kernel version and need to upgrade,
Need to modify the method to distinguish 8QM.8QXP by compatible string
drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c
This api was removed from kernel. Use new instead.
../drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c: In function ‘gckOS_GetTime’:
../drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c:3006:5: error: implicit declaration of function ‘do_gettimeofday’ [-Werror=implicit-function-declaration]
do_gettimeofday(&tv);
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
gc_hal_kernel_platform_imx.c:90:14: fatal error: linux/busfreq-imx.h: No such file or directory
# include <linux/busfreq-imx.h>
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>