1
0
Fork 0
Commit Graph

718537 Commits (3041c698bb7763010e00a4be92a65f008a6a7f31)

Author SHA1 Message Date
Shengjiu Wang 3041c698bb MLK-16563-1: ASoC: cs42xx8: reset the codec in the beginning of probe
In AUDIO IO board for imx8qxp mek, after board reset, the codec
failed to probe, system can't find codec device on i2c bus.
The reason is not clear, but add reset operation in the beginning of
probe can fix this issue.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Weiguang Kong 74543072b8 MLK-16545-2: ASoC: fsl_hifi4: add support to reset hifi4 codec
add cases to support resetting the hifi4 codec when receiving
HIFI4_RESET_CODEC command from the user space.

Signed-off-by: Weiguang Kong <weiguang.kong@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Weiguang Kong 6ec23d0c62 MLK-16545-1: uapi: mxc_hifi4: add reset command for hifi4
add reset command declaration into mxc_hifi4.h file,
this command is used to reset hifi4 codec when seeking

Signed-off-by: Weiguang Kong <weiguang.kong@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Weiguang Kong baca07d1bb MLK-16558: ASoC: fsl_hifi4: add reference counter for hifi4 device
When abnormal situation occurs and the current process terminates
abnormally, the hifi4 driver can't get the HIFI4_CODEC_CLOSE CMD
from user space to release the multi-codec resource, so the current
resource can't be used again.

Have found that the fsl_hifi4_close() function can be called
implicitly when process terminates abnormally, so add a reference
counter in fsl_hifi4_open() and fsl_hifi4_close() to check this
abnormal situation, when the number is same for opening and closing
hifi4 device, the multi-codec should be reinitialized again and
the hifi4 driver should send ICM_EXT_MSG_ADDR CMD to hifi4 framework
to initialize the multi-codec resources too.

Signed-off-by: Weiguang Kong <weiguang.kong@nxp.com>
2018-10-29 11:10:38 +08:00
Yuchou Gan b4f8157a86 MGS-3314 [#ccc] Enable GPU for 8QM MEK board
Enable GPU for 8QM MEK board

Signed-off-by: Yuchou<yuchou.gan@nxp.com>
Date: 9th Oct, 2017
2018-10-29 11:10:38 +08:00
Richard Zhu e9d2a097c7 MLK-16530-3 rpmsg: imx: init mu and limit the pingpong cycles
- Init mu power and clk.
- Change the cycles of the pingpong demot refer to
the limitation of M4 side.
When the received data larger than 100, the
pingpong of M4 side would be finished.
BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
2018-10-29 11:10:38 +08:00
Richard Zhu c91cf3ce43 MLK-16530-1 ARM64: dts: imx8: enable rpmsg support
enable imx8qm rpmsg support, and validated the
pingpong demo.
add the mu power and clk on imx8qxp.

BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
2018-10-29 11:10:38 +08:00
Richard Zhu 558204d601 MLK-16530-2 clk: imx8qm: add the cm40 ipg clk
Add the cm40 ipg clk
BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
2018-10-29 11:10:38 +08:00
Sandor Yu fca4ee33fd MLK-16538-6: dts: Add hdmi property to imx8qm dts
-Add hdmi property item to imx8qm dts file.
-Connect hdmi to dpu1_disp0 port.
-Remove unnecessary clk from hdmi steer irq property.
-Fix typo for irqsteer_csi0

Acked-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-10-29 11:10:38 +08:00
Sandor Yu b386e35386 MLK-16538-4: defconfig: Add hdmi/dp driver to default kernel build
Default enable hdmi/dp drm dirver.

Acked-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang f37670a41f MLK-13946-4: ASoC: imx-cdnhdmi: refine machine driver for api changes
Since commit 3f5780eb4520 ("MLK-16538-2: hdmi api: Relocate hdmi api
soure code") change the api. And hdmi video driver provide a new api
for hdmi audio. Machine driver need to be updated accrodingly

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Sandor Yu b174603d35 MLK-16570-2: hdmi audio: Add hdmi audio config function
Add hdmi audio config function to hdmi driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-10-29 11:10:38 +08:00
Sandor Yu ba88d79e8b MLK-16570-1: hdp: Add hdp audio config function
Add hdp audio config function to hdp driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-10-29 11:10:38 +08:00
Sandor Yu ccf331b51d MLK-16538-3: hdmi/dp: Add imx8qm hdmi/dp driver
Add hdmi/dp drm architecture driver.
HDMI and DP driver can work in imx8qm ARM2 board.
The driver support basic hotplug function.
Default working mode is 1080p60.

Acked-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
2018-10-29 11:10:38 +08:00
Sandor Yu a0a18c1133 MLK-16538-2: hdmi api: Relocate hdmi api soure code
-Relocate hdmi api source code from drivers/video/fbdev/mxc/cdn_hdp
to drivers/mxc/hdp.
-Add displayport and hdcp api function.
-Move t28hpc_hdmitx function from api source code folder
to hdmi fb driver folder.
-Update imx8 hdmi fb driver according api source code change.
-Sync api source code with CDN_API_1_0_33 release.

Acked-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-10-29 11:10:38 +08:00
Sandor Yu e62910a24e MLK-16538-1: clks: correct ipg_hdmi_clk_root clk parent
Correct imx8qm ipg_hdmi_clk_root clk parent name.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-10-29 11:10:38 +08:00
Leonard Crestez e14fd75b25 MLK-16225: imx8 pm: Check of_device_is_available
This patch causes imx8-pd nodes marked with status = "disabled" to be
ignored. This is very common in devicetree handling.

When running with xen the hypervisor will convert all xen,passthrough
properties to status = "disabled" before passing dtb to dom0. This patch
allows power domains to be marked this way and have them be ignored by
the host automatically.

The alternative is to remove the power domain nodes and references using
/delete-node/ and /delete-property/ and that gets messy.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2018-10-29 11:10:38 +08:00
Leonard Crestez 5d41296b4c MLK-16225: clk: imx8qm: Add fsl,lpcg_base_offset property
Right now the imx8qm clock provider hardcodes physical addresses. In
virtualization scenarios the intermediate physical addresses visible
from a guest can be different. In theory a 1:1 mapping could be done but
that in xen it would overlap with hardcoded guest ram starting at
0x40000000.

Solve this by adding a property with a common offset for all lpcg
areas. This should be set in the guest dts.

In theory each lpcg block could be remapped with it's own offset but
that is not supported.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Leonard Crestez 0bf9578916 MLK-16225: clk: imx8: Do not register clocks for unowned resources
Registering clocks for unowned resources can result in lots of pointless
scfw errors and potential faults when attempting to use LPCG.

Solve this by checking ownership via sc_rm_is_resource_owned and
returning -ENODEV from clock registration functions. The top-level clock
provider is also modified so that it accepts such errors silently.

This is intended for xen but could also be useful for SCFW partitioning.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Leonard Crestez 87c8e7562e MLK-16225: clk: imx8qm: Add LPCG_ADDR macro
All this does is replace the cast from physical address with a macro in
order to make later changes easier.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Leonard Crestez c7221ac64e MLK-16225: clk: imx8qm: Ignore imx8qm-acm node missing
This can happen in virtualization scenarios, so just skip registering
the associated clocks instead of failing to boot.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Leonard Crestez f7f54e1320 MLK-16225: clk: imx8qm: Remove initial prepare/enable for A-core clk
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Robert Chiras d7e080bb90 MLK-16056 clk: imx8qm: add new dsi clocks
Add clk for dsi0-i2c1, dsi1-i2c0 and dsi1-i2c1

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus cec26d8776 MLK-16442-3: dts: imx8qm: Add clock parents for DC clocks.
Adds dt settings for the dpu driver to set the default clock
parents
- PLL1 (dc0_pll0_clk) for dispay0 and PLL2(dc0_pll1_clk) for display1.
Functionality is not changed from dpu driver perspective as the same
parents for the display clocks were used before.

The resulting clock topology for dc0_disp1 is:

dc0_pll1_div                1            1  1188000000 0 0
    dc0_pll1_clk            2            2  1188000000 0 0
       dc0_disp1_sel        1            1  1188000000 0 0
          dc0_disp1_div     1            1   148500000 0 0
             dc0_disp1_clk  1            1   148500000 0 0

(BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0)

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
Reviewed by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus 2593bdd319 MLK-16442-2: clk: imx8qm: Add mux for DC clocks.
DC clocks can choose their clock source between PLL1, PLL2 and
bypass input.
This patch introduces a multiplexer in the dc clock topology to
allow this choice and introduces one set of parents that will be used
for both display0 and display1 clocks.

Clock paths tested:
    1. PLL2(dc0_pll1_clk)->DC0_DISP1(dc0_disp1_clk)->LVDS
    2. BYP(dc0_bypass0_clk)->DC0_DISP1(dc0_disp1_clk)->LVDS

(BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0)

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
Reviewed by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus e4aff55805 MLK-16442-1: clk: clk-mux-scu: Add new mux type.
Display clocks can choose their parrent between various clock sources
(ex pll1, pll2, bypass).

This patch adds a new mux type that uses the underlying support in scfw
to set/get a parent.

(BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0)

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
Reviewed by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus f711d5b098 MLK-16442-0: clk: imx8: Remove imx_clk_divider2_scu duplicate declaration.
The imx_clk_divider2_scu is declared twice.
Remove the second occurrence.

(BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0)

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
Reviewed by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang 332981bac5 MLK-16536-16 video: fbdev: dcss: change 'refcount' to 'struct kref' type
Use 'struct kref' type for 'refcount' field instead of
'atomic_t' to take advantage of 'kref_*()' interface
series. The benefit to do so can improve the defered
cfifo flush performance, since this defered flush does
not need to wait to be done until next vsync happens.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang 4eed7f4c96 MLK-16536-15 video: fbdev: dcss: improve cfifo wrapping handling
After changing the strategy to 'flush cfifo once per frame',
the cfifo wrapping handling should also be changed accordingly.
Now, when it is found that the cfifo has no enough room from 'in'
to the buffer end to hold the current commit, the 'commit_cfifo'
will cancel this commit and flush the cfifo workqueue before
restart the commit again.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang 81c9e6c613 MLK-16536-14 video: fbdev: dcss: correct ret value for 'dcss_wait_for_vsync()'
The correct return value for 'dcss_wait_for_vsync()' when
it executes successfully should be '0'. But this current
value now gets from 'wait_event_interruptible_timeout()'
which returns non-zero value when the wait is not timeout.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang 7f419d023c MLK-16536-13 video: fbdev: dcss: improve 'kfifo_to_end_len()' macro
The macro 'kfifo_to_end_len()' is used to get the length
between the current kfifo 'in' and the kfifo end. Previous
implementation has a short-coming under the new strategy
that multiple commits are combined into one cfifo flush.

For a simple example, commits 'A' and 'B' are going to be
combined into one flush, and the last byte of 'A' exactly
occupy the last byte of fifo coincidently. Then when handling
the 'B' commit, the old 'kfifo_to_end_len()' logic returns
the fifo size instead of 0,  So the condition 'commit_size >
kfifo_to_end_len(&cfifo->fifo)' will be false and let 'B'
to be stored from fifo beginning which finally triggers
below kernel BUG log:

[  568.558341] ------------[ cut here ]------------
[  568.558343] kernel BUG at drivers/video/fbdev/mxc/imx_dcss.c:2261!
[  568.558348] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[  568.558354] Modules linked in:
[  568.558362] CPU: 0 PID: 34 Comm: kworker/u8:1 Not tainted
[  568.558364] Hardware name: Freescale i.MX8MQ EVK (DT)
[  568.558385] Workqueue: ctxld-wq dcss_ctxld_config
[  568.558387] task: ffff8000ba2d8c80 task.stack: ffff8000ba2f8000
[  568.558392] PC is at dcss_ctxld_config+0x1dc/0x1e8
[  568.558396] LR is at dcss_ctxld_config+0x1dc/0x1e8
[  568.558398] pc : [<ffff0000084786c4>] lr : [<ffff0000084786c4>]
pstate: 80000145
[  568.558399] sp : ffff8000ba2fbd30
[  568.558404] x29: ffff8000ba2fbd30 x28: ffff8000ba1f0000
[  568.558407] x27: ffff8000ba0096a8 x26: ffff8000ba9d8930
[  568.558411] x25: ffff8000ba3a2410 x24: 0000000000000003
[  568.558414] x23: 0000000000000008 x22: ffff8000ba9d8918
[  568.558417] x21: ffff8000ba9d88f0 x20: ffff8000ba9d8818
[  568.558421] x19: ffff8000bbdd0080 x18: ffffffffffffffff
[  568.558424] x17: 0000ffff934c8b60 x16: ffff0000081df178
[  568.558427] x15: ffff0000092db010 x14: 202c387830203d20
[  568.558431] x13: ffff0000092dafe0 x12: ffff0000091be498
[  568.558434] x11: ffff0000091be498 x10: ffff0000092d8650
[  568.558437] x9 : 0000000000000000 x8 : ffff8000bff7352f
[  568.558441] x7 : 0000000000000000 x6 : 0000000000000016
[  568.558444] x5 : 0000000000804738 x4 : 0000000000000000
[  568.558447] x3 : 0000000000000140 x2 : 000000000000f9bd
[  568.558450] x1 : ffff8000ba2f8000 x0 : 0000000000000030
[  568.558451]
[  568.558453] Process kworker/u8:1 (pid: 34, stack limit =
0xffff8000ba2f8020)
...
[  568.558541] Call trace:
[  568.558545] Exception stack(0xffff8000ba2fbb60 to 0xffff8000ba2fbc90)
...
[  568.558586] [<ffff0000084786c4>] dcss_ctxld_config+0x1dc/0x1e8
[  568.558595] [<ffff0000080d3bb4>] process_one_work+0x11c/0x370
[  568.558600] [<ffff0000080d3e58>] worker_thread+0x50/0x4a0
[  568.558606] [<ffff0000080d9a70>] kthread+0xd0/0xe8
[  568.558611] [<ffff000008082e80>] ret_from_fork+0x10/0x50
[  568.558616] Code: d00055e1 aa1903e0 91074021 94056a66 (d4210000)
[  568.558623] ---[ end trace faae62afa988e865 ]---
[  568.558707] Unable to handle kernel paging request at virtual address
ffffffffffffffd8
[  568.558709] pgd = ffff8000bbda1000
[  568.558712] [ffffffffffffffd8] *pgd=00000000fb7ad003
[  568.558714] , *pud=00000000fb6a0003
[  568.558715] , *pmd=0000000000000000
...

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang 563d55c8b7 MLK-16536-12 video: fbdev: dcss: flush cfifo once per frame
Change the cfifo flush to be once per frame to combine
possible multiple flush requests in one frame into one
flush to improve performance. And during one frame, only
flush requests from different channels can be combined,
and the different requests from the same channel cannot
be combined into one flush.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang 1457545a04 MLK-16536-11 video: fbdev: dcss: add '__maybe_unused' to 'dtg_irq_mask()'
The function 'dtg_irq_mask()' is not used at this
moment which caused gcc compiler generate the build
warning:

"‘dtg_irq_mask’ defined but not used [-Wunused-function]"

So add attribute '__maybe_unused' to 'dtg_irq_mask()'
functon definition to avoid this build warning.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang b13c5586c4 MLK-16536-10 video: fbdev: dcss: unmask 'IRQ_TC_LINE1' by default
Unmask the 'IRQ_TC_LINE1' when initialize it by default,
since the vsync count can be used as a reference count or
timestamp.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang e858a307b7 MLK-16536-9 video: fbdev: dcss: remove undesired variables in 'dcss_set_par()'
The variables 'cinfo' and 'chan_info' both refer to the
same 'struct dcss_channel_info' data. So remove 'chan_info'
and its related variables to make code more clean.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang 90abbb4bf5 MLK-16536-8 video: fbdev: dcss: move 'ctxld_list' field to 'struct ctxld_fifo'
The 'ctxld_list' is more closely related to 'struct ctxld_info'
structure. So moving its definition to this structure is more
reasonable.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang 7ae5e561aa MLK-16536-7 video: fbdev: dcss: abstract cfifo wq flush operation
Abstract the cfifo workqueue flush operation to a separate
interface 'finish_cfifo()'.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang 7d9c978b0d MLK-16536-6 video: fbdev: dcss: split 'commit_to_fifo' into three parts
This commit split the function 'commit_to_fifo' into three
parts: 'alloc_cc()', 'commit_cfifo()' and 'flush_cfifo()'.
So that each of the three parts can be used as required,
but not used all together.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang 7a5e4d62c8 MLK-16536-5 video: fbdev: dcss: move 'ctxld_wq' to 'struct ctxld_fifo'
The 'ctxld_wq' is more closely related to 'struct ctxld_info'
structure. So moving its definition to this structure is more
reasonable.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang b999946b10 MLK-16536-4 video: fbdev: abstract cfifo 'in' operation
Abstract the process that copy data from 'cb' to 'cfifo'
to a separate function from 'commit_to_fifo()'. This is
a refinement.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang 45e37a6819 MLK-16536-3 video: fbdev: dcss: replace 'kfifo_esize()' by 'esize'
When doing ctxld config, the 'esize' variable is already
assigned to the value derived from 'kfifo_esize()'. So
using the exsiting value instead of deriving it again.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang d687f36350 MLK-16536-2 video: fbdev: dcss: refine 'esize' obtainment
The 'esize' is better be got by 'kfifo_esize()'
instead of using 'sizeof' to make the code more
compatible and easier to unserstand.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang e569f36704 MLK-16536-1 video: fbdev: dcss: use kfifo 'out' to be next read offset
The kfifo 'out' points to the first byte of data to be
consumed next time. So use it to get the data offset to
be accessed by CTXLD and remove unused field 'fifo_in'
from 'struct ctxld_commit'.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Peter Chen cfffa52a71 MLK-16551 ARM64: dts: fsl-imx8qxp-mek: enable USB2 port
Both host and device mode are support, and the port is at base board.

Below rework is needed:
Remove R145, R143, R1390, and install R144, R142, R1389.

BuildInfo:
- SCFW 1f59442e, IMX-MKIMAGE fb52c576, ATF
- U-Boot 2017.03-imx_v2017.03+g34be5a2

Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2018-10-29 11:10:38 +08:00
Peter Chen e5710d0019 MLK-16522-4 ARM64: dts: fsl-imx8qxp-mek: add USB3 support
Add TCPCI device NXP PTN5110 as well as USB3 port support, they are
disabled by default due to board rework is needed, it needs to
replace U182 from NTB0104 to NTS0104, please consult hardware team
for detail.

Without rework, but enable USB3 will cause endless of PTN5110 interrupts
due to voltage of ALERN_N from PTN5110 is incorrect.

BuildInfo:
- SCFW 1f59442e, IMX-MKIMAGE fb52c576, ATF
- U-Boot 2017.03-imx_v2017.03+g34be5a2

Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2018-10-29 11:10:38 +08:00
Peter Chen 6a2e287a6d MLK-16522-3 usb: cdns3: do not disable interrupt during role switch
After "MLK-16522-1 usb: cdns3: change cdns3_role_start work flow", the
software maintained role is current role which is doing role_start, so
it should handle its initialization routine well, just like we only has
one role and the interrupt is enabled at that time.

And disable interrupt causes one timeout problem during remove hcd, the
last command takes about 5 seconds to finish. See below for detail:

[   84.894639]  xhci-cdns3: remove, state 1
[   84.898768]  xhci-cdns3: roothub graceful disconnect
[   84.898784] usb usb2: USB disconnect, device number 1
[   84.904052] usb 2-1: USB disconnect, device number 4
[   84.909195] usb 2-1: unregistering device
[   84.909204] usb 2-1: unregistering interface 2-1:1.0
[   84.931247] usb 2-1: usb_disable_device nuking all URBs
[   84.931264]  xhci-cdns3: xhci_drop_endpoint called for udev ffff80083b755000
[   84.931274]  xhci-cdns3: drop ep 0x81, slot id 3, new drop flags = 0x8, new add flags = 0x0
[   84.931278]  xhci-cdns3: xhci_drop_endpoint called for udev ffff80083b755000
[   84.931283]  xhci-cdns3: drop ep 0x2, slot id 3, new drop flags = 0x18, new add flags = 0x0
[   84.931288]  xhci-cdns3: xhci_check_bandwidth called for udev ffff80083b755000
[   84.931302]  xhci-cdns3: New Input Control Context:
[   84.931309]  xhci-cdns3: @ffff000009aa7000 (virt) @d8288000 (dma) 0x000018 - drop flags
[   84.931314]  xhci-cdns3: @ffff000009aa7004 (virt) @d8288004 (dma) 0x000001 - add flags
[   84.931320]  xhci-cdns3: @ffff000009aa7008 (virt) @d8288008 (dma) 0x000000 - rsvd2[0]
[   84.931325]  xhci-cdns3: @ffff000009aa700c (virt) @d828800c (dma) 0x000000 - rsvd2[1]
[   84.931331]  xhci-cdns3: @ffff000009aa7010 (virt) @d8288010 (dma) 0x000000 - rsvd2[2]
[   84.931336]  xhci-cdns3: @ffff000009aa7014 (virt) @d8288014 (dma) 0x000000 - rsvd2[3]
[   84.931341]  xhci-cdns3: @ffff000009aa7018 (virt) @d8288018 (dma) 0x000000 - rsvd2[4]
[   84.931346]  xhci-cdns3: @ffff000009aa701c (virt) @d828801c (dma) 0x000000 - rsvd2[5]
[   84.931350]  xhci-cdns3: Slot Context:
[   84.931355]  xhci-cdns3: @ffff000009aa7020 (virt) @d8288020 (dma) 0x8400000 - dev_info
[   84.931360]  xhci-cdns3: @ffff000009aa7024 (virt) @d8288024 (dma) 0x020000 - dev_info2
[   84.931365]  xhci-cdns3: @ffff000009aa7028 (virt) @d8288028 (dma) 0x000000 - tt_info
[   84.931371]  xhci-cdns3: @ffff000009aa702c (virt) @d828802c (dma) 0x000000 - dev_state
[   84.931377]  xhci-cdns3: @ffff000009aa7030 (virt) @d8288030 (dma) 0x000000 - rsvd[0]
[   84.931382]  xhci-cdns3: @ffff000009aa7034 (virt) @d8288034 (dma) 0x000000 - rsvd[1]
[   84.931387]  xhci-cdns3: @ffff000009aa7038 (virt) @d8288038 (dma) 0x000000 - rsvd[2]
[   84.931392]  xhci-cdns3: @ffff000009aa703c (virt) @d828803c (dma) 0x000000 - rsvd[3]
[   84.931398]  xhci-cdns3: IN Endpoint 00 Context (ep_index 00):
[   84.931403]  xhci-cdns3: @ffff000009aa7040 (virt) @d8288040 (dma) 0x000000 - ep_info
[   84.931408]  xhci-cdns3: @ffff000009aa7044 (virt) @d8288044 (dma) 0x2000026 - ep_info2
[   84.931414]  xhci-cdns3: @ffff000009aa7048 (virt) @d8288048 (dma) 0xd828f001 - deq
[   84.931419]  xhci-cdns3: @ffff000009aa7050 (virt) @d8288050 (dma) 0x000000 - tx_info
[   84.931424]  xhci-cdns3: @ffff000009aa7054 (virt) @d8288054 (dma) 0x000000 - rsvd[0]
[   84.931429]  xhci-cdns3: @ffff000009aa7058 (virt) @d8288058 (dma) 0x000000 - rsvd[1]
[   84.931434]  xhci-cdns3: @ffff000009aa705c (virt) @d828805c (dma) 0x000000 - rsvd[2]
[   84.931447]  xhci-cdns3: // Ding dong!
[   85.096180] FAT-fs (sda1): FAT read failed (blocknr 32)
[   90.134581]  xhci-cdns3: Command timeout
[   90.134590]  xhci-cdns3: Abort command ring
[   92.150582]  xhci-cdns3: No stop event for abort, ring start fail?
[   92.150606]  xhci-cdns3: Timeout while waiting for configure endpoint command
[   92.158310] usb usb2: unregistering device
[   92.158321] usb usb2: unregistering interface 2-0:1.0
[   92.158447]  xhci-cdns3: shutdown urb ffff80083b8f0700 ep1in-intr
[   92.158704] usb usb2: usb_disable_device nuking all URBs
[   92.158715] xHCI xhci_drop_endpoint called for root hub
[   92.158719] xHCI xhci_check_bandwidth called for root hub
[   92.159067]  xhci-cdns3: // Halt the HC
[   92.159075]  xhci-cdns3: // Reset the HC
[   92.159096]  xhci-cdns3: Wait for controller to be ready for doorbell rings
[   92.159102]  xhci-cdns3: USB bus 2 deregistered
[   92.163789]  xhci-cdns3: remove, state 4
[   92.167772]  xhci-cdns3: roothub graceful disconnect
[   92.167786] usb usb1: USB disconnect, device number 1
[   92.172880] usb usb1: unregistering device
[   92.172894] usb usb1: unregistering interface 1-0:1.0
[   92.173151] usb usb1: usb_disable_device nuking all URBs

BuildInfo:
- SCFW 1f59442e, IMX-MKIMAGE fb52c576, ATF
- U-Boot 2017.03-imx_v2017.03+g34be5a2

Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2018-10-29 11:10:38 +08:00
Peter Chen 29ca6d5bec MLK-16522-2 usb: cdns3: host: change remove sequence for hcd
At probe, the main hcd is added first, then shared_hcd is added later,
so when we tries to remove hcds, the shared_hcd needs to remove first.

BuildInfo:
- SCFW 1f59442e, IMX-MKIMAGE fb52c576, ATF
- U-Boot 2017.03-imx_v2017.03+g34be5a2

Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2018-10-29 11:10:38 +08:00
Peter Chen 015b78a114 MLK-16522-1 usb: cdns3: change cdns3_role_start work flow
When it goes to start new role, the interrupt may be occurred before
role_start returns, but at this time, the cdns->role is still the old
role, so the interrupt handler will make mistake.

In this commit, we set desired role before role_start, if the role_start
has failed and the desired role is different with current one, it tries
to back current role.

BuildInfo:
- SCFW 1f59442e, IMX-MKIMAGE fb52c576, ATF
- U-Boot 2017.03-imx_v2017.03+g34be5a2

Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2018-10-29 11:10:38 +08:00
Peter Chen e0ccad30e4 MLK-16532 usb: chipidea: do not call WARN_ON if controller is going to suspend twice
At current PM framework, the dev->runtime_suspend may be called after
dev->system_suspend is called, and the dev->runtime_resume may be called
before dev->system_suspend is called. So, we need to delete WARN_ON to
avoid before dump:

[  466.712978] [<ffff200008c49cdc>] ci_hdrc_imx_runtime_suspend+0x2c/0xa8
[  466.719619] [<ffff2000088c29e8>] pm_generic_runtime_suspend+0x48/0x68
[  466.726168] [<ffff2000088d4f04>] genpd_runtime_suspend+0xcc/0x300
[  466.732372] [<ffff2000088c7068>] pm_runtime_force_suspend+0x48/0xa8
[  466.738748] [<ffff2000088d5330>] pm_genpd_suspend_noirq+0xa0/0x118
[  466.745032] [<ffff2000088c86ec>] dpm_run_callback+0x4c/0xc0
[  466.750709] [<ffff2000088c941c>] __device_suspend_noirq+0x194/0x3d0
[  466.757080] [<ffff2000088cb460>] dpm_suspend_noirq+0x188/0x328
[  466.763024] [<ffff200008143218>] suspend_devices_and_enter+0x230/0x650
[  466.769655] [<ffff200008143990>] pm_suspend+0x358/0x3d0
[  466.774984] [<ffff200008141f0c>] state_store+0x8c/0x100
[  466.780321] [<ffff20000857a83c>] kobj_attr_store+0x44/0x60
[  466.785915] [<ffff2000083436a8>] sysfs_kf_write+0x98/0xb0
[  466.791419] [<ffff200008342118>] kernfs_fop_write+0x120/0x288
[  466.797276] [<ffff20000828d518>] __vfs_write+0xc0/0x238
[  466.802604] [<ffff20000828e900>] vfs_write+0xc8/0x248
[  466.807764] [<ffff200008290678>] SyS_write+0xa0/0x110
[  466.812919] [<ffff20000808374c>] __sys_trace_return+0x0/0x4

BuildInfo:
- SCFW 1f59442e, IMX-MKIMAGE fb52c576, ATF
- U-Boot 2017.03-imx_v2017.03+g34be5a2

Cc: Anson Huang <anson.huang@nxp.com>
Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus 0695d71fa7 MLK-16469: clk-imx8qxp: Fix GPT clock hierarchy
This is a change similar to:

'commit 01fdf7bf572b ("MLK-16281-2: clk-imx8qm: Fix GPT clock hierarchy")'
    There are five gpt modules on imx8qm (gpt0 .. gpt4).
    Of these, gpt2 and gpt4 clock hierarchies are inconsistent
    with the rest.
    Having the per clocks (gpt_hf_clk and gpt_clk) as children of the
    peripheral access clock (ipg_s) and bus sync slave clock
    (ipg_slv_clk)
    ensures that the latter are enabled when the driver enables the
    gpt_clk
    (or hf).
    This patch reconciles these two gpt clock trees with the rest.

    Before:

     gpt_2_div
        gpt_2_hf_clk
        gpt_2_ipg_s_clk
           gpt_2_ipg_slv_clk
              gpt_2_clk

     gpt_4_div
        gpt_4_hf_clk
        gpt_4_clk
        gpt_4_ipg_s_clk
           gpt_4_ipg_slv_clk

    After:

     gpt_2_div
        gpt_2_ipg_s_clk
           gpt_2_ipg_slv_clk
              gpt_2_hf_clk
              gpt_2_clk

     gpt_4_div
        gpt_4_ipg_s_clk
           gpt_4_ipg_slv_clk
              gpt_4_hf_clk
              gpt_4_clk

Apply this change  for imx8qxp also which has the same inconsistency
regarding the gpt clocks.
(BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE imx8-mu, ATF 0)

Reviewed-by: Anson Huang <anson.huang@nxp.com>
Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
2018-10-29 11:10:38 +08:00