linux.git
7 years agommc: core: Check SWITCH_ERROR bit from each CMD13 response when polling
Ulf Hansson [Mon, 21 Nov 2016 14:49:48 +0000 (15:49 +0100)]
mmc: core: Check SWITCH_ERROR bit from each CMD13 response when polling

According to the JEDEC specification, the SWITCH_ERROR bit in the device
status from a R1 response, is an error bit which may be cleared as soon as
the response that reports the error is sent.

When polling with CMD13 to find out when the card stops signaling busy
after a CMD6 has been sent, we currently parse only the last CMD13 response
for the SWITCH_ERROR bit. Consequentially we could loose important
information about the card.

In worst case if the card stops signaling busy within the allowed timeout,
we could end up believing that the CMD6 command completed successfully,
when in fact it didn't.

To improve the behaviour, let's parse each CMD13 response to see if the
SWITCH_ERROR bit is set in the device status. In such case, we abort the
polling loop and report the error.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
(cherry picked from commit 5ec32f84111a500c142961c82dd415c22e64e2be)

7 years agommc: core: Rename ignore_crc to retry_crc_err to reflect its purpose
Ulf Hansson [Tue, 8 Nov 2016 14:39:13 +0000 (15:39 +0100)]
mmc: core: Rename ignore_crc to retry_crc_err to reflect its purpose

The ignore_crc parameter/variable name is used at a couple of places in the
mmc core. Let's rename it to retry_crc_err to reflect its new purpose.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
(cherry picked from commit 625228fa3e017d80f547b35214c60b4081b5c07d)

7 years agommc: core: Remove redundant __mmc_send_status()
Ulf Hansson [Tue, 8 Nov 2016 14:27:27 +0000 (15:27 +0100)]
mmc: core: Remove redundant __mmc_send_status()

There are only one users left which calls __mmc_send_status(). Moreover,
the ignore_crc parameter isn't being used, so let's just remove these
redundant parts.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
(cherry picked from commit 89e57aedda337a121eca5f2b0adfecbc6ab39b3d)

7 years agommc: core: Retry instead of ignore at CRC errors when polling for busy
Ulf Hansson [Tue, 8 Nov 2016 12:53:36 +0000 (13:53 +0100)]
mmc: core: Retry instead of ignore at CRC errors when polling for busy

After a CMD6 command has been sent, the __mmc_switch() function might be
advised to poll the card for busy by using CMD13 and also by ignoring CRC
errors.

In the case of ignoring CRC errors, the mmc core tells the mmc host to also
ignore these errors via masking the MMC_RSP_CRC response flag. This seems
wrong, as it leads to that the mmc host could propagate an unreliable
response, instead of a proper error code.

What we really want, is not to ignore CRC errors but instead retry the
polling attempt. So, let's change this by treating a CRC error as the card
is still being busy and thus continue to run the polling loop.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
(cherry picked from commit 437590a123b6617a52e0b136cd25fe3616e4d50f)

7 years agommc: sdhci: Factor out sdhci_enable_clk
Ritesh Harjani [Mon, 21 Nov 2016 06:37:19 +0000 (12:07 +0530)]
mmc: sdhci: Factor out sdhci_enable_clk

Factor out sdhci_enable_clk from sdhci_set_clock
and make it EXPORT_SYMBOL so that it can be called.

Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit fec796739740f98737595b0ed72c6fd9d5f718e3)

7 years agommc: block: move packed command struct init
Linus Walleij [Fri, 18 Nov 2016 12:36:16 +0000 (13:36 +0100)]
mmc: block: move packed command struct init

By moving the mmc_packed_init() and mmc_packed_clean() into the
only file in the kernel where they are used, we save two exported
functions and can staticize those to the block.c file.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit e01071dd2bfc73d88b63aeec26bff8eb872b1dc9)

7 years agommc: block: rename data to blkdata
Linus Walleij [Fri, 18 Nov 2016 12:36:15 +0000 (13:36 +0100)]
mmc: block: rename data to blkdata

The struct mmc_blk_request contains an opaque void *data that
is actually only used to store a pointer to a per-request
struct mmc_blk_data. This is confusing, so rename the member
to blkdata and forward-declare the block.c local struct.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 7db3028e00f0d19d4ab10d3d5f38afb1d7814861)

7 years agommc: block: use mmc_req_is_special()
Linus Walleij [Fri, 18 Nov 2016 12:36:14 +0000 (13:36 +0100)]
mmc: block: use mmc_req_is_special()

Instead of open coding the check for the same thing that
the helper checks: use the helper.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit f2818bff37b65bbf05fb2a948f591ff67986e733)

7 years agommc: sdhci: remove unneeded (void *) casts in sdhci_(pltfm_)priv()
Masahiro Yamada [Thu, 10 Nov 2016 13:22:17 +0000 (22:22 +0900)]
mmc: sdhci: remove unneeded (void *) casts in sdhci_(pltfm_)priv()

The type of host->private is (unsigned long *).  No cast is needed
to return an opaque pointer.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 178b0fa0d465b2275bec46ebfb98bd5b5d27cf51)

7 years agommc: core: use enum mmc_blk_status properly
Linus Walleij [Fri, 4 Nov 2016 10:05:19 +0000 (11:05 +0100)]
mmc: core: use enum mmc_blk_status properly

There were several instances of code using the
enum mmc_blk_status by arbitrarily converting it to an int and
throwing it around to different functions. This makes the code
hard to understand to may give rise to strange errors.

Especially the function prototype mmc_start_req() had to be
modified to take a pointer to an enum mmc_blk_status and the
function pointer .err_check() inside struct mmc_async_req
needed to return an enum mmc_blk_status.

In every case: instead of assigning the block layer error code
to an int, use the enum, also change the signature of all
functions actually passing this enum to use the enum.

To make it possible to use the enum everywhere applicable, move
it to <linux/mmc/core.h> so that all code actually using it can
also see it.

An interesting case was encountered in the MMC test code which
did not return a enum mmc_blk_status at all in the .err_check
function supposed to check whether asynchronous requests worked
or not: instead it returned a normal -ERROR or even the test
frameworks internal error codes.

The test code would also pass on enum mmc_blk_status codes as
error codes inside the test code instead of converting them
to the local RESULT_* codes.

I have tried to fix all instances properly and run some tests
on the result.

Cc: Chunyan Zhang <zhang.chunyan@linaro.org>
Cc: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 8e8b3f514c12a3b800bba8a7766c71139ad75b89)

7 years agommc: block: convert ecc_err to a bool
Linus Walleij [Fri, 4 Nov 2016 10:05:18 +0000 (11:05 +0100)]
mmc: block: convert ecc_err to a bool

The ecc_err flag is only assigned 0 or 1 and treated as a bool,
so convert it to a bool.

Cc: Chunyan Zhang <zhang.chunyan@linaro.org>
Cc: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 2cc64587089fa73b6a8470dde4a1c704beca4920)

7 years agommc: block: make gen_err a bool variable
Linus Walleij [Fri, 4 Nov 2016 10:05:17 +0000 (11:05 +0100)]
mmc: block: make gen_err a bool variable

This gen_err flag is only assigned 0 or 1 and treated as a bool,
so convert it to a bool.

Cc: Chunyan Zhang <zhang.chunyan@linaro.org>
Cc: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit c44d6cefdf36b2c5bd58245eccc793519706a1d4)

7 years agommc: sdhci: Use sdhci-caps-mask and sdhci-caps to change the caps read during __sdhci...
Zach Brown [Wed, 2 Nov 2016 15:26:16 +0000 (10:26 -0500)]
mmc: sdhci: Use sdhci-caps-mask and sdhci-caps to change the caps read during __sdhci_read_caps

The sdhci capabilities register can be incorrect. The sdhci-caps-mask
and sdhci-caps dt properties specify which bits of the register are
incorrect and what their values should be. This patch makes the sdhci
driver use those properties to correct the caps during
__sdhci_read_caps.

During __sdhci_read_caps
Use the sdhci-caps-mask property to turn off the incorrect bits of the
sdhci register after reading them.
Use the sdhci-caps to turn on bits after using sdhci-caps-mask to turn
off the incorrect ones.

Signed-off-by: Zach Brown <zach.brown@ni.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 92e0c44b92e463a47746b520ea9aa9ef154f27e7)

7 years agommc: core: Don't power off the card when starting the host
Ulf Hansson [Thu, 13 Oct 2016 11:37:40 +0000 (13:37 +0200)]
mmc: core: Don't power off the card when starting the host

The MMC_CAP2_NO_PRESCAN_POWERUP was invented to avoid running the power up
sequence, mmc_power_up(), during ->probe() of the mmc host driver, but
instead defer this to the mmc detect work. This is especially useful for
those hosts that suffers from a long initialization time, as this time
would otherwise add up to the total boot time.

However, due to the introduction of runtime PM of mmc host devices in the
mmc core, this behaviour changed a bit. More precisely, it caused the mmc
core to runtime resume the host device during ->probe() of the host driver.
In cases like the rtsx_usb_sdmmc, runtime resuming the device may be costly
and thus affecting the total boot time.

To improve this behaviour when using MMC_CAP2_NO_PRESCAN_POWERUP, let's
postpone also calling mmc_power_off() when starting the host. This change
allows the mmc core to avoid runtime resuming the device, as it don't need
to claim the host for that execution path.

Cc: Ritesh Raj Sarraf <rrs@researchut.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit c2c24819b28087f2a62750957e8dfa889d1f8bb2)

7 years agommc: core: expose the capability of gpio card detect
Shawn Lin [Wed, 12 Oct 2016 02:50:37 +0000 (10:50 +0800)]
mmc: core: expose the capability of gpio card detect

Add new helper API mmc_can_gpio_cd for slot-gpio to make
host drivers know whether it supports gpio card detect.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 50fcbbbb79de4b95a765ea170677c9810fcb9cee)

7 years agommc: core: Don't use ->card_busy() and CMD13 in combination when polling
Ulf Hansson [Wed, 19 Oct 2016 14:15:31 +0000 (16:15 +0200)]
mmc: core: Don't use ->card_busy() and CMD13 in combination when polling

When polling for busy after sending a MMC_SWITCH command, both the optional
->card_busy() callback and CMD13 are being used in conjunction.

This doesn't make sense. Instead it's more reasonable to rely solely on the
->card_busy() callback when it exists. Let's change that and instead use
the CMD13 as a fall-back. In this way we avoid sending CMD13, unless it's
really needed.

Within this context, let's also take the opportunity to make some
additional clean-ups and clarifications to the related code.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
(cherry picked from commit 70562644f4ee15214986966720ffe82fad03e693)

7 years agommc: core: Factor out code related to polling in __mmc_switch()
Ulf Hansson [Wed, 19 Oct 2016 11:20:49 +0000 (13:20 +0200)]
mmc: core: Factor out code related to polling in __mmc_switch()

In yet another step of cleaning up __mmc_switch(), let's factor out the
code that deals with card busy polling.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
(cherry picked from commit 716bdb8953c7cad649a62e3333bf59cdd177db3b)

7 years agommc: core: Clarify code which deals with polling in __mmc_switch()
Ulf Hansson [Wed, 19 Oct 2016 09:35:12 +0000 (11:35 +0200)]
mmc: core: Clarify code which deals with polling in __mmc_switch()

The __mmc_switch() deserves a clean-up. In this step, let's move some code
outside of the do-while loop, which deal deals with the card busy polling.

This change simplifies the code in that sense that it becomes easier to follow
what is being executed during card busy polling, but it also gives a better
understanding for when polling isn't done.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
(cherry picked from commit cb26ce069ffa87a1d237d0288176aac8ff79bffa)

Conflicts:
drivers/mmc/core/mmc_ops.c

7 years agommc: core: Make mmc_switch_status() available for mmc core
Ulf Hansson [Wed, 19 Oct 2016 09:04:42 +0000 (11:04 +0200)]
mmc: core: Make mmc_switch_status() available for mmc core

Following changes needs mmc_switch_status() to be available both from mmc.c
and mmc_ops.c. Allow that by moving its implementation to mmc_ops.c and
make it available via mmc_ops.h.

Moving mmc_switch_status() to mmc_ops.c, also enables us to turn
mmc_switch_status_error() into static function. So let's take the
opportunity to change this as well.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
(cherry picked from commit 20348d1981da783d125c8265ce2ba7e3f2a24103)

7 years agommc: sdhci: put together into one condition checking
Jaehoon Chung [Fri, 7 Oct 2016 05:08:43 +0000 (14:08 +0900)]
mmc: sdhci: put together into one condition checking

value of ios->timing is not related with SDCHI v3.0.  If Controller version
is v3.0, SDHCI_QUIRK_NO_HISPD_BIT is meaningless.  To prevent the setting
wrong bit moves into one condition checking.  (e.g sdhci-s3c doesn't use
SDHCI_CTRL_HISPD bit, instead using this bit as other purpose.)

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 273c5414e3a4465733fa55c9070692c724bf6726)

7 years agoMLK-16013-44 staging: typec: tcpm: set data role after src detach
Li Jun [Fri, 18 Aug 2017 19:11:57 +0000 (03:11 +0800)]
MLK-16013-44 staging: typec: tcpm: set data role after src detach

As the default data role is device mode if the port is not host,
so set the port data role to be device mode after src detach, this
is to fix the issue of port data role still kept to be host while
the port is open.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16013-43 staging: typec: tcpci: add extcon for data role switch
Li Jun [Fri, 18 Aug 2017 18:32:48 +0000 (02:32 +0800)]
MLK-16013-43 staging: typec: tcpci: add extcon for data role switch

Use extcon device for dual role switch on typec port.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16013-42 ARM64: imx8mq-evk: enable typec port to be otg
Li Jun [Fri, 18 Aug 2017 18:30:15 +0000 (02:30 +0800)]
MLK-16013-42 ARM64: imx8mq-evk: enable typec port to be otg

Add extcon for typec port(USB0) for support dual roles.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agousb: dwc3: Add dual-role support
Roger Quadros [Wed, 5 Apr 2017 10:39:31 +0000 (13:39 +0300)]
usb: dwc3: Add dual-role support

If dr_mode is "otg" then support dual role mode of operation.
Currently this mode is only supported when an extcon handle is
present in the dwc3 device tree node. This is needed to
get the ID status events of the port.

We're using a workqueue to manage the dual-role state transitions
as the extcon notifier (dwc3_drd_notifier) is called in an atomic
context by extcon_sync() and this doesn't go well with
usb_del_gadget_udc() causing a lockdep and softirq warning.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
7 years agousb: dwc3: core: make dwc3_set_mode() work properly
Roger Quadros [Tue, 4 Apr 2017 09:49:18 +0000 (12:49 +0300)]
usb: dwc3: core: make dwc3_set_mode() work properly

We can't have both Host and Peripheral roles active at the same time
because of one detail on DWC3: it shares the same memory area for both
Host and Peripheral registers.

When swapping roles we must reinitialize the new role every
time. Let's make sure this works for our debugfs interface.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
7 years agousb: dwc3: debugfs: remove unnecessary | operator
Roger Quadros [Tue, 4 Apr 2017 08:27:57 +0000 (11:27 +0300)]
usb: dwc3: debugfs: remove unnecessary | operator

Each role is mutually exclusive, the | operator is unnecessary. Remove
it.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
7 years agousb: dwc3: core: add current_dr_role member
Roger Quadros [Tue, 4 Apr 2017 08:25:27 +0000 (11:25 +0300)]
usb: dwc3: core: add current_dr_role member

We're going to use this member to track which role we're currently
playing, that way we can more easily implement dual-role swap in
upcoming patches.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
7 years agousb: udc: allow adding and removing the same gadget device
Roger Quadros [Mon, 3 Apr 2017 12:20:29 +0000 (15:20 +0300)]
usb: udc: allow adding and removing the same gadget device

allow usb_del_gadget_udc() and usb add_gadget_udc() to be called
repeatedly on the same gadget->dev structure.

We need to clear the gadget->dev structure so that kobject_init()
doesn't complain about already initialized object.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
7 years agoMLK-16283 regulator: pfuze100: add 500us wait time for switch enable
Robin Gong [Mon, 28 Aug 2017 09:24:41 +0000 (17:24 +0800)]
MLK-16283 regulator: pfuze100: add 500us wait time for switch enable

add 500us enable_time for switch to be stable while turned on.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
7 years agoMLK-16275-2: ARM64: dts: imx8qm/qxp: Sync ESAI0 and AMIX SAIs rates
Viorel Suman [Thu, 24 Aug 2017 11:52:03 +0000 (14:52 +0300)]
MLK-16275-2: ARM64: dts: imx8qm/qxp: Sync ESAI0 and AMIX SAIs rates

The ESAI0 and AMIX SAIs rates need to be the same for the
common and master clocks in the clock tree given the existing
clock rates store/restore functionality and the asynchronous
nature of the drivers "probe" method invocation.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
7 years agoMLK-16275-1: ASoC: fsl: amix: fix rates constraints
Viorel Suman [Fri, 25 Aug 2017 11:14:35 +0000 (14:14 +0300)]
MLK-16275-1: ASoC: fsl: amix: fix rates constraints

AMIX SAIs frequency was doubled in order to
support the [98k rate X 8 channels X 32 bit width].
As consequence the criteria to enforce the rates
constrainsts needs to be changed accordingly.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
7 years agoMLK-16255-6 video: fbdev: dcss: use aligned width to calc pitch for DPR
Fancy Fang [Fri, 25 Aug 2017 10:14:39 +0000 (18:14 +0800)]
MLK-16255-6 video: fbdev: dcss: use aligned width to calc pitch for DPR

After alignment handling for DPR, the aligned width
may be larger than the same as original width, so
use the aligned width to calculate the pitch for
DPR.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16266-02 ARM: imx: Enhance the code to support new TO for imx6qp
Bai Ping [Fri, 25 Aug 2017 05:22:32 +0000 (13:22 +0800)]
MLK-16266-02 ARM: imx: Enhance the code to support new TO for imx6qp

Previous code don't take care about the i.MX6QP revision update of
new TO. So improve the code to include future TO support for i.MX6QP.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16266-01 ARM: imx: improve the soc revision calculation flow
Bai Ping [Fri, 25 Aug 2017 05:07:27 +0000 (13:07 +0800)]
MLK-16266-01 ARM: imx: improve the soc revision calculation flow

On our i.MX6 SOC, the DIGPROG register is used for represent the
SOC ID and silicon revision. The revision has two part: MAJOR and
MINOR. each is represented in 8 bits in the register.

  bits [15:8]: reflect the MAJOR part of the revision;
  bits [7:0]: reflect the MINOR part of the revision;

In our linux kernel, the soc revision is represented in 8 bits. MAJOR
part and MINOR each occupy 4 bits.

previous method does NOT take care about the MAJOR part in DIGPROG register.
So reformat the revision read from the HW to compatible the revision format
used in kernel.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16255-5 video: fbdev: dcss: init default video layer buffer to black
Fancy Fang [Fri, 25 Aug 2017 09:30:53 +0000 (17:30 +0800)]
MLK-16255-5 video: fbdev: dcss: init default video layer buffer to black

For video layer, the black pixel value is not 0x0,
but (Y: 0x0, U: 128, V: 128). So init the video
layer frame buffer contents to the black pixel
value by default.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16255-4 video: fbdev: dcss: add alignment handling for SCALER
Fancy Fang [Fri, 25 Aug 2017 06:32:08 +0000 (14:32 +0800)]
MLK-16255-4 video: fbdev: dcss: add alignment handling for SCALER

According to the DCSS spec, the SCALER has alignment
limitations for the input source image on both 'x'
and 'y' directions of Luma and Chroma planes. And
the 'x' and 'y' should be divisable by 4.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16255-3 video: fbdev: dcss: add alignment handling for DPR
Fancy Fang [Thu, 24 Aug 2017 09:49:18 +0000 (17:49 +0800)]
MLK-16255-3 video: fbdev: dcss: add alignment handling for DPR

According to the DCSS spec, the DPR has alignment
limitations for the input source image on both 'x'
and 'y' directions of Luma and Chroma planes. The
DPR has different alignment requirements for
different bpp, tile type, rtram buffer lines and
etc.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16255-2 video: fbdev: dcss: use 'db' of ctxld to config DTG
Fancy Fang [Wed, 23 Aug 2017 07:39:33 +0000 (15:39 +0800)]
MLK-16255-2 video: fbdev: dcss: use 'db' of ctxld to config DTG

DTG is a standard double buffer module which has
shadow registers. So use double buffer to config
its registers via Context Loader.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16255-1 video: fbdev: dcss: add 'db' support for ctxld
Fancy Fang [Wed, 23 Aug 2017 07:02:20 +0000 (15:02 +0800)]
MLK-16255-1 video: fbdev: dcss: add 'db' support for ctxld

Add double buffer Context Loader function support in
DCSS, since some of the submodules have shadow reigsters
which are more suitable to use double buffer context
loader to load the reigster values for them, and double
buffer loadding is earlier than single buffer loading.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16165-2 cpufreq: imx8mq: remove non-necessary opp table initialization
Anson Huang [Fri, 25 Aug 2017 05:06:24 +0000 (13:06 +0800)]
MLK-16165-2 cpufreq: imx8mq: remove non-necessary opp table initialization

For i.MX8MQ, suspend freq can use policy->max after cpu freq
table is validated, so no need to get OPP number and MAX
frequency for suspend freq now, also add necessary resource free
when probe failed.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-16165-1 cpufreq: imx8: remove non-necessary opp table initialization
Anson Huang [Fri, 25 Aug 2017 05:03:23 +0000 (13:03 +0800)]
MLK-16165-1 cpufreq: imx8: remove non-necessary opp table initialization

For i.MX8QM/8QXP, suspend freq can use policy->max after cpu
freq table is validated, so no need to get OPP number and MAX
frequency for suspend freq now, also add necessary resource free
when probe failed.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-16244-2 cpufreq: imx8: add SIP cpu-freq support
Anson Huang [Wed, 23 Aug 2017 05:00:47 +0000 (13:00 +0800)]
MLK-16244-2 cpufreq: imx8: add SIP cpu-freq support

Add SIP cpu-freq support, the CPU hardware frequency
scale will be performed by ARM Trusted Firmware,
and add cpu-freq suspend support, MAX frequency will
be used during suspend.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-16244-1 arm64: dts: freescale: imx8qxp: add cpu-freq set-point
Anson Huang [Wed, 23 Aug 2017 04:48:59 +0000 (12:48 +0800)]
MLK-16244-1 arm64: dts: freescale: imx8qxp: add cpu-freq set-point

Add i.MX8QXP cpu-freq setpoints, currently only
1.2GHz and 1GHz are supported.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-16262: Input: snvs_pwrkey - move devm_request_irq to the end of probe function
Shenwei Wang [Thu, 24 Aug 2017 15:13:41 +0000 (10:13 -0500)]
MLK-16262: Input: snvs_pwrkey - move devm_request_irq to the end of probe function

A pending interrupt may cause a kernel panic at system
startup. It is because the necessary data have not been
initialized completely before the interrupt handler is
called.

[    1.141547] Unable to handle kernel NULL pointer dereference at virtual address 00000048
[    1.149642] pgd = ffff000009275000
[    1.153048] [00000048] *pgd=00000000ffffe003[    1.157148] , *pud=00000000ffffd003
, *pmd=0000000000000000[    1.162660]
[    1.164164] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    1.169740] Modules linked in:
[    1.172818] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.11-03067-g40eb128-dirty #112
[    1.180738] Hardware name: Freescale i.MX8MQ EVK (DT)
[    1.185794] task: ffff8000ba0e0000 task.stack: ffff8000ba0e8000
[    1.191725] PC is at imx_snvs_pwrkey_interrupt+0x14/0x70
[    1.197046] LR is at __handle_irq_event_percpu+0x9c/0x128
[    1.202450] pc : [<ffff000008849524>] lr : [<ffff000008101d4c>] pstate: 000001c5
[    1.209848] sp : ffff8000bff79ed0
[    1.213166] x29: ffff8000bff79ed0 x28: ffff8000ba0e8000
[    1.218514] x27: 0000000000000001 x26: ffff000008e582b8
[    1.223862] x25: ffff000009113eaf x24: ffff8000ba480200
[    1.229210] x23: 0000000000000021 x22: ffff8000bff79f8c
[    1.234557] x21: 0000000000000000 x20: ffff8000ba480200
[    1.239906] x19: 0000000000000000 x18: 0000000000000000
[    1.245253] x17: 0000000000000000 x16: 0000000000000000
[    1.250600] x15: 0000000000000000 x14: 0000000000000000
[    1.255947] x13: 0000000000000000 x12: 0000000000000000
[    1.261293] x11: 0000000000000040 x10: ffff8000b8000028
[    1.266642] x9 : ffff8000b8000130 x8 : 0000000000000000
[    1.271989] x7 : ffff8000ba480200 x6 : ffff8000ba480200
[    1.277336] x5 : ffff8000b8000000 x4 : 00008000b6eca000
[    1.282684] x3 : 0000000000000000 x2 : ffff000008849510
[    1.288030] x1 : 0000000000000000 x0 : 0000000000000021
[    1.293378]
[    1.294875] Process swapper/0 (pid: 1, stack limit = 0xffff8000ba0e8020)
[    1.301581] Stack: (0xffff8000bff79ed0 to 0xffff8000ba0ec000)
[    1.307330] Call trace:
[    1.309782] Exception stack(0xffff8000bff79d00 to 0xffff8000bff79e30)
[    1.316229] 9d00: 0000000000000000 0001000000000000 ffff8000bff79ed0 ffff000008849524
[    1.324065] 9d20: ffff8000bff79d40 ffff0000080e0830 ffff8000bffaa980 0000000000000000
[    1.331901] 9d40: ffff8000bff79d60 ffff0000080e0898 ffff8000bff79d70 ffff0000080f83d8
[    1.339736] 9d60: 0000000000554179 ffff0000080e097c ffff8000bff79da0 ffff0000080e7ff0
[    1.347572] 9d80: ffff8000ba0e0000 0000000000554179 ffff8000bff79dc0 ffff0000080eb20c
[    1.355408] 9da0: 0000000000000021 0000000000000000 ffff000008849510 0000000000000000
[    1.363243] 9dc0: 00008000b6eca000 ffff8000b8000000 ffff8000ba480200 ffff8000ba480200
[    1.371079] 9de0: 0000000000000000 ffff8000b8000130 ffff8000b8000028 0000000000000040
[    1.378914] 9e00: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    1.386748] 9e20: 0000000000000000 0000000000000000
[    1.391633] [<ffff000008849524>] imx_snvs_pwrkey_interrupt+0x14/0x70
[    1.397994] [<ffff000008101d4c>] __handle_irq_event_percpu+0x9c/0x128
[    1.404440] [<ffff000008101df4>] handle_irq_event_percpu+0x1c/0x58
[    1.410626] [<ffff000008101e78>] handle_irq_event+0x48/0x78
[    1.416206] [<ffff0000081057c0>] handle_fasteoi_irq+0xb8/0x1b0
[    1.422045] [<ffff000008100e4c>] generic_handle_irq+0x24/0x38
[    1.427797] [<ffff0000081014b4>] __handle_domain_irq+0x5c/0xb8
[    1.433637] [<ffff00000808163c>] gic_handle_irq+0xbc/0x168
[    1.439127] Exception stack(0xffff8000ba0eb9e0 to 0xffff8000ba0ebb10)
[    1.445574] b9e0: ffff8000ba48029c 0000000000000040 0000000000000005 0000000000000000
[    1.453409] ba00: 0000000000000004 000000000000000f ffff8000ba480220 0000000000000000
[    1.461244] ba20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    1.469080] ba40: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    1.476915] ba60: 0000000000000000 0000000000000000 0000000000000000 ffff8000ba837f00
[    1.484751] ba80: ffff8000ba480200 0000000000000021 ffff8000ba48029c ffff8000ba480268
[    1.492586] baa0: 0000000000000000 0000000000000040 ffff8000ba480220 ffff8000ba480220
[    1.500422] bac0: 0000000000000000 ffff8000ba0ebb10 ffff000008103cb8 ffff8000ba0ebb10
[    1.508258] bae0: ffff000008b2b868 0000000040000045 ffff8000ba837f00 ffff8000ba480200
[    1.516092] bb00: ffffffffffffffff ffff000008103e18
[    1.520975] [<ffff0000080827b0>] el1_irq+0xb0/0x124
[    1.525863] [<ffff000008b2b868>] _raw_spin_unlock_irqrestore+0x10/0x48
[    1.532397] [<ffff000008104124>] request_threaded_irq+0xec/0x1c0
[    1.538410] [<ffff00000810689c>] devm_request_threaded_irq+0x74/0xe0
[    1.544770] [<ffff0000088497a8>] imx_snvs_pwrkey_probe+0x178/0x2a8
[    1.550958] [<ffff0000085ccaa0>] platform_drv_probe+0x58/0xc0
[    1.556713] [<ffff0000085caf54>] driver_probe_device+0x1fc/0x2a8
[    1.562727] [<ffff0000085cb0ac>] __driver_attach+0xac/0xb0
[    1.568220] [<ffff0000085c8fa4>] bus_for_each_dev+0x64/0xa0
[    1.573800] [<ffff0000085ca740>] driver_attach+0x20/0x28
[    1.579119] [<ffff0000085ca290>] bus_add_driver+0x110/0x230
[    1.584698] [<ffff0000085cb880>] driver_register+0x60/0xf8
[    1.590190] [<ffff0000085cc9d8>] __platform_driver_register+0x40/0x48
[    1.596640] [<ffff000009027a24>] imx_snvs_pwrkey_driver_init+0x18/0x20
[    1.603174] [<ffff0000080830b8>] do_one_initcall+0x38/0x128
[    1.608754] [<ffff000008fe0cec>] kernel_init_freeable+0x1a4/0x248
[    1.614853] [<ffff000008b26230>] kernel_init+0x10/0x100
[    1.620084] [<ffff000008082e80>] ret_from_fork+0x10/0x50
[    1.625403] Code: 910003fd f9000bf3 f9405833 52800001 (f9402660)
[    1.631518] ---[ end trace 7bb9749c5dc6e8f9 ]---
[    1.636148] Kernel panic - not syncing: Fatal exception in interrupt

Review-by: Frank Li <frank.li@nxp.com>
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
7 years agoMGS-3800 drm,imx: drop drm_of_component_probe() in favor of imx specifics.
Marius Vlad [Tue, 22 Aug 2017 16:19:20 +0000 (19:19 +0300)]
MGS-3800 drm,imx: drop drm_of_component_probe() in favor of imx specifics.

In order to be able to specify a comparison based on driver name.
This is due to the fact that we don't have a dts/dtb entry for the
blit engine and we rely only on the driver name.

Not present in previous patches.

Signed-off-by: Adrian Negreanu <adrian.negreanu@nxp.com>
Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
7 years agoMLK-15321 drm,imx: Add DRM support for dpu-blit
Meng Mingming [Mon, 14 Aug 2017 05:46:21 +0000 (13:46 +0800)]
MLK-15321 drm,imx: Add DRM support for dpu-blit

This patch adds DRM support for the blit engine, allowing
DRM_RENDER_ALLOW ioctls() to be registered dynamically.

Signed-off-by: Adrian Negreanu <adrian.negreanu@nxp.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
---
Changes since v3:

Added support for registering DRM_RENDER ioctls dynamically, by replacing fops
ioctl to a routed one (provided by drm core), where we get the chance to verify
in the list of previously registered ioctls for a blit ioctls.

7 years agoMLK-15321 dpu: Register the blit engine(s).
Marius Vlad [Tue, 22 Aug 2017 15:38:20 +0000 (18:38 +0300)]
MLK-15321 dpu: Register the blit engine(s).

Signed-off-by: Marius-Adrian Negreanu <adrian.negreanu@nxp.com>
Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
---
Changes since v3:

Use a features array for bliteng driver name, as not to polute
dpu_add_client_devices() and simply the register process in the same time.

7 years agoMLK-15321 dpu-blit: Add dpu blit engine driver
Meng Mingming [Mon, 14 Aug 2017 05:38:49 +0000 (13:38 +0800)]
MLK-15321 dpu-blit: Add dpu blit engine driver

Initial support for the iMX8 DPU Blitter engine.

Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
7 years agoMGS-3224: arm64: dts: fsl-imx8qxp-mek: enable gpu
Xianzhong [Thu, 24 Aug 2017 05:44:50 +0000 (13:44 +0800)]
MGS-3224: arm64: dts: fsl-imx8qxp-mek: enable gpu

this patch enable gpu feature for i.mx8qxp mek board

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
7 years agoMLK-16227: arm64: dts: fsl-imx8qm-lpddr4-arm2: Introduce it6263 dual chan dts
Oliver Brown [Mon, 21 Aug 2017 01:09:18 +0000 (20:09 -0500)]
MLK-16227: arm64: dts: fsl-imx8qm-lpddr4-arm2: Introduce it6263 dual chan dts

This patch adds support for dual lvds channels for the it6263 LVDS to HDMI
bridge for fsl-imx8qm-lpddr4-arm2 board. LVDS Dual channel mode is supported on the
the MCIMX8-HDMIDC board. LVDS Dual channel mode is not supported on the mini SAS LVDS
to HDMI daughter card.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
7 years agoMLK-16243: mtd: gpmi: enable the EDO mode for i.MX8
Han Xu [Tue, 22 Aug 2017 14:45:50 +0000 (09:45 -0500)]
MLK-16243: mtd: gpmi: enable the EDO mode for i.MX8

Enable the EDO mode on i.MX8 platforms for better performance.

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-16242-7 video: fbdev: dcss: add non-blocking mode in pan display
Fancy Fang [Tue, 22 Aug 2017 08:56:24 +0000 (16:56 +0800)]
MLK-16242-7 video: fbdev: dcss: add non-blocking mode in pan display

Add non-blocking mode for pan display interface to
support very special cases to focus on the maximum
FPS display.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16242-6 video: fbdev: dcss: refine cfifo synchronization logic
Fancy Fang [Tue, 22 Aug 2017 08:51:00 +0000 (16:51 +0800)]
MLK-16242-6 video: fbdev: dcss: refine cfifo synchronization logic

Remove the synchronization workaround in 'commit_to_fifo()'
and add ctxld wq flush calls in pan display, since the pan
display usually requires blocking mode behavior. But other
functions can also work in non-blocking mode, so perform
synchronization handling in 'commit_to_fifo' is not good
for the interfaces which doesn't require blocking mode.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16242-5 video: fbdev: dcss: add 'FBIO_WAITFORVSYNC' support
Fancy Fang [Tue, 22 Aug 2017 08:43:50 +0000 (16:43 +0800)]
MLK-16242-5 video: fbdev: dcss: add 'FBIO_WAITFORVSYNC' support

Implement 'FBIO_WAITFORVSYNC' ioctl which is a non-standard
command to provide vsyc active wait function for user space
applications.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16242-4 video: fbdev: dcss: realize 'fb_ioctl' interface
Fancy Fang [Tue, 22 Aug 2017 03:32:55 +0000 (11:32 +0800)]
MLK-16242-4 video: fbdev: dcss: realize 'fb_ioctl' interface

Realize the 'fb_ioctl' hook interface with a blank
function. Non-standard ioctl commands implementations
can be added later.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16242-3 video: fbdev: dcss: add dtg irq handling
Fancy Fang [Mon, 21 Aug 2017 11:22:44 +0000 (19:22 +0800)]
MLK-16242-3 video: fbdev: dcss: add dtg irq handling

Add the 8th interrupt of DCSS handling for DTG
which is used to trigger the signal when the VSYNC
start point reaches. By default, this irq is masked
to avoid too many unnecessary interrupt handles.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16242-2 video: fbdev: dcss: correct some irq indexes
Fancy Fang [Mon, 21 Aug 2017 11:07:57 +0000 (19:07 +0800)]
MLK-16242-2 video: fbdev: dcss: correct some irq indexes

The hw irq index for DEC400D, DTRC2 and DTRC3 should
be '15', '16' and '17'. So correct the corresponding
macro definitions in DCSS driver.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16242-1 ARM64: dts: imx8mq: add the 8th irq for DCSS
Fancy Fang [Mon, 21 Aug 2017 10:02:04 +0000 (18:02 +0800)]
MLK-16242-1 ARM64: dts: imx8mq: add the 8th irq for DCSS

The 8th interrupt of DCSS comes from DTG module
and it is used as a general purpose timings
interrupt which can generate an interrupt at a
programmable X/Y corordinate. There are total
four such interrupts in DTG. And this one will
be used for a VSYNC Active interrupt.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16240 drm/bridge: it6263: Don't use freed edid structure in ->get_modes()
Liu Ying [Tue, 22 Aug 2017 07:54:57 +0000 (15:54 +0800)]
MLK-16240 drm/bridge: it6263: Don't use freed edid structure in ->get_modes()

We call the helper drm_detect_hdmi_monitor() to check if the EDID blob read
from a monitor indicates the monitor is connected via HDMI or not.  We pass
an edid structure to the helper.  However, the structure has been freed
before we use it.  This patch moves the helper up before the structure is
freed to fix the issue.

Fixes: a5c01aa91842 ("MLK-15001-25 drm/bridge: Add ITE IT6263 LVDS to HDMI transmitter support")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-12606 ARM64: defconfig: Enable USB host CDC ACM
Li Jun [Thu, 17 Aug 2017 13:34:08 +0000 (21:34 +0800)]
MLK-12606 ARM64: defconfig: Enable USB host CDC ACM

Build USB host cdc acm driver as module.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16013-41 ARM64: imx8mq: remove dis_u2_susphy_quirk for usb
Li Jun [Tue, 8 Aug 2017 13:34:19 +0000 (21:34 +0800)]
MLK-16013-41 ARM64: imx8mq: remove dis_u2_susphy_quirk for usb

As the USB3 hotplug issue identified by IC team, the recommended
solution is to use FREECLK by clear COMMMONONN, so remove this
quick temp workaround.

Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16013-40 phy: phy-fsl-imx8mq-usb: clear COMMONONN to keep FREECLK running
Li Jun [Tue, 8 Aug 2017 13:24:21 +0000 (21:24 +0800)]
MLK-16013-40 phy: phy-fsl-imx8mq-usb: clear COMMONONN to keep FREECLK running

COMMONONN: This signal controls whether the high-speed Bias and PLL
blocks remain powered—consuming additional current during Suspend and
Sleep modes. As imx8mq USB3 ITP&SOF have to use FREECLK, so clear
COMMONONN to be 0(valid) to make FREECLK always running, this is the
recommended setting from design team.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16013-39 ARM64: defconfig: enable typec and power delivery
Li Jun [Fri, 4 Aug 2017 16:19:56 +0000 (00:19 +0800)]
MLK-16013-39 ARM64: defconfig: enable typec and power delivery

Build-in typec, power delivery port manager and tcpci driver.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoASoC: codecs: fsl_mqs: Add PM support
Daniel Baluta [Mon, 21 Aug 2017 12:48:45 +0000 (15:48 +0300)]
ASoC: codecs: fsl_mqs: Add PM support

Save the values of registers at suspend and restore
it at resume.

We don't need to implement runtime PM support because
MQS is already enabled in startup() and disabled in
shutdown().

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-16239 clk: imx: imx8qm/qxp: Adding the missing sentinel value of match table
Jason Liu [Mon, 21 Aug 2017 21:00:02 +0000 (05:00 +0800)]
MLK-16239 clk: imx: imx8qm/qxp: Adding the missing sentinel value of match table

Need to put the sentinel value to the end of the of_device_id array.
This patch also fixes the following KASAN complains when KASAN is enabled:

[    0.671315] ==================================================================
[    0.678400] BUG: KASAN: global-out-of-bounds in __of_match_node+0x70/0xb8 at addr ffff2000092958a8
[    0.687321] Read of size 1 by task swapper/0/1
[    0.691760] Address belongs to variable imx8qm_match+0xc8/0x260
[    0.697666] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.11-03033-ge2e5fb2 #44
[    0.704955] Hardware name: Freescale i.MX8QM ARM2 (DT)
[    0.710081] Call trace:
[    0.712528] [<ffff20000808b438>] dump_backtrace+0x0/0x278
[    0.717907] [<ffff20000808b6c4>] show_stack+0x14/0x20
[    0.722949] [<ffff2000085311ec>] dump_stack+0xa4/0xc8
[    0.727990] [<ffff200008256cbc>] kasan_report_error+0x4c4/0x4d8
[    0.733892] [<ffff2000082570f8>] kasan_report+0x40/0x48
[    0.739103] [<ffff2000082552cc>] __asan_load1+0x4c/0x58
[    0.744318] [<ffff200008d7ac28>] __of_match_node+0x70/0xb8
[    0.749791] [<ffff200008d7aca8>] of_match_node+0x38/0x60
[    0.755088] [<ffff200008d7d870>] of_match_device+0x30/0x50
[    0.760565] [<ffff200008858dbc>] platform_match+0x6c/0x130
[    0.766040] [<ffff200008855dec>] __device_attach_driver+0x5c/0x138
[    0.772205] [<ffff200008852d18>] bus_for_each_drv+0xd0/0x130
[    0.777852] [<ffff2000088557fc>] __device_attach+0x13c/0x1a0
[    0.783499] [<ffff200008855f30>] device_initial_probe+0x10/0x18
[    0.789406] [<ffff200008854608>] bus_probe_device+0xe0/0xf0
[    0.794965] [<ffff200008851310>] device_add+0x5c8/0x818
[    0.800176] [<ffff200008d7dc3c>] of_device_add+0x5c/0x88
[    0.805477] [<ffff200008d7e854>] of_platform_device_create_pdata+0xb4/0x118
[    0.812426] [<ffff200008d7e8cc>] of_platform_device_create+0x14/0x20
[    0.818771] [<ffff200009913374>] arm_smmu_of_init+0x38/0x50
[    0.824332] [<ffff200009913298>] of_iommu_init+0xa4/0x100
[    0.829715] [<ffff200008083990>] do_one_initcall+0x90/0x1c8
[    0.835278] [<ffff2000098c1034>] kernel_init_freeable+0x290/0x330
[    0.841361] [<ffff20000905be28>] kernel_init+0x10/0x110
[    0.846567] [<ffff200008083680>] ret_from_fork+0x10/0x50
[    0.851860] Memory state around the buggy address:
[    0.856648]  ffff200009295780: fa fa fa fa 00 03 fa fa fa fa fa fa 00 00 00 00
[    0.863854]  ffff200009295800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    0.871065] >ffff200009295880: 00 00 00 00 00 fa fa fa fa fa fa fa 00 00 00 00
[    0.878270]                                   ^
[    0.882792]  ffff200009295900: 02 fa fa fa fa fa fa fa 00 00 07 fa fa fa fa fa
[    0.890003]  ffff200009295980: 00 00 00 00 01 fa fa fa fa fa fa fa 00 00 00 00
[    0.897208] ==================================================================

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
7 years agoMLK-16196-2: [i.MX8MQ/Hantro]: enhance power management for suspend/resume
Zhou Peng-B04994 [Mon, 21 Aug 2017 03:02:55 +0000 (11:02 +0800)]
MLK-16196-2: [i.MX8MQ/Hantro]: enhance power management for suspend/resume

in resume functions, vpu clock maybe not enabled at all,
so clk enable/disable are required by hw related operations in resume context

Signed-off-by: Zhou Peng-B04994 <eagle.zhou@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16222-2 video: fbdev: dcss: use new coeffs from tables
Fancy Fang [Fri, 18 Aug 2017 11:11:25 +0000 (19:11 +0800)]
MLK-16222-2 video: fbdev: dcss: use new coeffs from tables

The new coeff tables defined in 'imx_dcss_table.h' can
make common alpha blending operations to be correct.
So config the corresponding registers with these new
coeffs in the probe stage with only once and remove
the previous duplicate configurations. Besides, one
dtg config needs to be adjusted accordingly.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16222-1 video: fbdev: dcss: define some tables in a header file
Fancy Fang [Fri, 18 Aug 2017 10:55:23 +0000 (18:55 +0800)]
MLK-16222-1 video: fbdev: dcss: define some tables in a header file

Define some data tables to list all the coefficients config
which only requires to be configured once. The tables include:

    1. Scaler Coeffs
    2. HDR10 Input Pipe LUT and CSC Coeffs
    3. HDR10 Output Pipe Linear to Non_Linear Conversion
       and CSC Coeffs.

Each table entry includes the register offset addr and the
value needs to be written to this register.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16215 PCI: imx: refine pcie codes
Richard Zhu [Thu, 17 Aug 2017 05:27:06 +0000 (13:27 +0800)]
MLK-16215 PCI: imx: refine pcie codes

- correct the msi address
- only do shutdown reset for imx6q pcie, since only
imx6qdl pcie doesn't have the reset mechanism.
- don't limit the max link speed of imx pcie to gen2

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
7 years agoMLK-16226: arm64: dts: disable the NAND node in i.MX8QXP default device tree
Han Xu [Fri, 18 Aug 2017 16:32:33 +0000 (11:32 -0500)]
MLK-16226: arm64: dts: disable the NAND node in i.MX8QXP default device tree

NAND node was disabled in default device tree, the patch 4ad48e3cf
wrongly inserted usb node in the middle caused NAND enabled.

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-16203 enable runtime pm of i2c temporary when do system suspend
Gao Pan [Fri, 18 Aug 2017 10:35:11 +0000 (18:35 +0800)]
MLK-16203 enable runtime pm of i2c temporary when do system suspend

When we do system suspend, the runtime pm will be disabled, but we need
to control the PMIC to power on/off the regulator, if the runtime pm is
disabled, if will failed to request runtime wakeup. So data transfer will
failed.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
7 years agoMLK-13975-2: ASoC: fsl: qxp: Make AMIX working for 8 channels and 96kHz rate
Viorel Suman [Fri, 18 Aug 2017 09:13:38 +0000 (12:13 +0300)]
MLK-13975-2: ASoC: fsl: qxp: Make AMIX working for 8 channels and 96kHz rate

The patch mirrors commit 7c953daaf599 ("MLK-13975: ASoC: fsl: Make
AMIX working for 8 channels and 96kHz rate") for QXP.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
7 years agoMLK-13975-1: ASoC: fsl: qxp: Assign audio clocks within it's own power domain
Viorel Suman [Fri, 18 Aug 2017 09:09:14 +0000 (12:09 +0300)]
MLK-13975-1: ASoC: fsl: qxp: Assign audio clocks within it's own power domain

The patch mirrors commit f154ceffe411 ("MLK-13975: ASoC: fsl: Assign audio
clocks within it's own power domain") for QXP.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
7 years agoMLK-16220 lpi2c: imx8: improve i2c driver probe priority
Gao Pan [Thu, 10 Aug 2017 09:32:39 +0000 (17:32 +0800)]
MLK-16220 lpi2c: imx8: improve i2c driver probe priority

use subsys_initcall for i2c driver to improve i2c driver probe priority

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
7 years agoMLK-16217: PXP: fix pxp rotate yuv formate video issue
Guoniu.Zhou [Fri, 18 Aug 2017 02:09:08 +0000 (10:09 +0800)]
MLK-16217: PXP: fix pxp rotate yuv formate video issue

Because of IC limitation, pxp only can use rotation0 engine to
do rotation operation.

Correct coordinate settings of ps and out buffer.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-13975: ASoC: fsl: Make AMIX working for 8 channels and 96kHz rate
Viorel Suman [Fri, 18 Aug 2017 08:39:07 +0000 (11:39 +0300)]
MLK-13975: ASoC: fsl: Make AMIX working for 8 channels and 96kHz rate

Double the master and related clocks frequencies for AMIX SAIs in order to
make AMIX working for 8 channels and 96k Hz rate.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-16065-16 usb: cdns3: gadget: fix no one handled interrupt issue
Peter Chen [Wed, 2 Aug 2017 07:04:02 +0000 (15:04 +0800)]
MLK-16065-16 usb: cdns3: gadget: fix no one handled interrupt issue

If there are too many interrupts for non-control ep, the
no-one handled interrupt issue will occur due to without
return IRQ_HANDLED for them.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-15 usb: cdns3: gadget: refine the enable endpoint operation
Peter Chen [Wed, 2 Aug 2017 05:45:14 +0000 (13:45 +0800)]
MLK-16065-15 usb: cdns3: gadget: refine the enable endpoint operation

Move non-ep enable operation from set_configuration to ep_enable

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-14 ARM64: dts: fsl-imx8qm-lpddr4-arm2.dts: add USB Type-C port support
Peter Chen [Wed, 16 Aug 2017 06:59:44 +0000 (14:59 +0800)]
MLK-16065-14 ARM64: dts: fsl-imx8qm-lpddr4-arm2.dts: add USB Type-C port support

Due to pin conflict with other modules, we can only enable
host mode for Type-C port. If the user wants to use both
host and device mode for Type-C port, please use
fsl-imx8qm-lpddr4-arm2-usb3.dts instead.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-13 ARM64: defconfig: add USB testing driver and USB2 comliance client driver
Peter Chen [Tue, 25 Jul 2017 01:50:32 +0000 (09:50 +0800)]
MLK-16065-13 ARM64: defconfig: add USB testing driver and USB2 comliance client driver

Add USB testing driver and USB2 comliance client driver (used for
USB2 test in USB3 IP).

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-12 ARM64: defconfig: add EXTCON_PTN5150 support
Peter Chen [Tue, 11 Jul 2017 01:34:54 +0000 (09:34 +0800)]
MLK-16065-12 ARM64: defconfig: add EXTCON_PTN5150 support

It is a Type-C CC logic chip, the USB driver will get external events
for detach and attach for kinds of Type-C cables.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-11 ARM64: defconfig: enable cadence USB3
Peter Chen [Fri, 9 Jun 2017 06:09:20 +0000 (14:09 +0800)]
MLK-16065-11 ARM64: defconfig: enable cadence USB3

Enable both USB host and device function for Cadence USB3 IP.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-10 usb: host: xhci-dbg: do not print reseverd registers for imx cdns host
Peter Chen [Fri, 21 Jul 2017 03:15:45 +0000 (11:15 +0800)]
MLK-16065-10 usb: host: xhci-dbg: do not print reseverd registers for imx cdns host

When access reserved registers, the cdns host will trigger
an exception, and the synchronous external abort will occur
at ARM64 platforms.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-9 usb: cdns3: host: add quirk for avoid access reverved registers
Peter Chen [Wed, 19 Jul 2017 08:30:58 +0000 (16:30 +0800)]
MLK-16065-9 usb: cdns3: host: add quirk for avoid access reverved registers

Add quirk for CDNS USB3 host.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-8 usb: host: xhci: add XHCI_SKIP_ACCESS_RESERVED_REG quirk
Peter Chen [Wed, 19 Jul 2017 08:27:02 +0000 (16:27 +0800)]
MLK-16065-8 usb: host: xhci: add XHCI_SKIP_ACCESS_RESERVED_REG quirk

The IMX XHCI host which uses cadence USB3 IP is not compatible with
xHCI spec, the controller will trigger an exception if
visiting reserved registers, but the xHCI spec does not forbid it,
so add one quirk for skipping access reserved registers.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-7 usb: cdns3: add Cadence USB3 controller driver
Peter Chen [Tue, 25 Jul 2017 01:39:40 +0000 (09:39 +0800)]
MLK-16065-7 usb: cdns3: add Cadence USB3 controller driver

Add Cadence USB3 IP driver, this is the 1st version for this driver,
so wrapper layer and PHY layer are still IP core file (core.c).
Below functions are supported:

- Basic host function
- Limited gadget function, only ACM (old g_seiral) are supported, and
mass_storage support is not very well.
- Role switch between host and device through extcon design
(Eg, Type-C application NXP PTN5150).

Below functions are missing:
- Multi-queue support at gadget function, without this feature, many
gadget function are missing.
- Low power mode support, including system PM and runtime PM
- Wakeup support

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-6 doc: binding: cdns-usb3: add binding-doc for Cadence USB3
Peter Chen [Tue, 25 Jul 2017 01:38:25 +0000 (09:38 +0800)]
MLK-16065-6 doc: binding: cdns-usb3: add binding-doc for Cadence USB3

Add binding-doc for Cadence USB3

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-5 extcon: ptn5150: add PTN5150 Type-C CC logic chip
Peter Chen [Mon, 24 Jul 2017 09:30:23 +0000 (17:30 +0800)]
MLK-16065-5 extcon: ptn5150: add PTN5150 Type-C CC logic chip

Add NXP PTN5150 Type-C CC logic chip, this chip supplies CC flip
function automatically, and the driver will notify extcon
consumer (USB controller driver) attach and detach events.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-4 ARM64: dts: fsl-imx8qm: add fsl-imx8qm-lpddr4-arm2-usb3.dts
Peter Chen [Mon, 24 Jul 2017 09:16:54 +0000 (17:16 +0800)]
MLK-16065-4 ARM64: dts: fsl-imx8qm: add fsl-imx8qm-lpddr4-arm2-usb3.dts

This dts is dedicated for USB3 Type-C port, the Type-C CC logic
chip PTN5150 is conflict with other peripherals which use
i2c1 pins (I2C1_SDA/I2C1_SCL) from GTP blocks.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-3 ARM64: dts: fsl-imx8qxp-lpddr4-arm2.dts: enable USB3 Type-C port
Peter Chen [Mon, 24 Jul 2017 07:21:25 +0000 (15:21 +0800)]
MLK-16065-3 ARM64: dts: fsl-imx8qxp-lpddr4-arm2.dts: enable USB3 Type-C port

At imx8qxp arm2 board, the USB3 controller is at one Type-C port, and
the CC logic at this Type-C port is controlled by PTN5150. Enable
USB3 Type-C port at this commit.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-2 ARM64: dts: fsl-imx8qxp.dtsi: add Cadence USB3 support
Peter Chen [Mon, 24 Jul 2017 07:14:21 +0000 (15:14 +0800)]
MLK-16065-2 ARM64: dts: fsl-imx8qxp.dtsi: add Cadence USB3 support

Add Cadence USB3 controller and phy, the phy uses generic USB PHY
driver.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-1 ARM64: dts: fsl-imx8qm.dtsi: add Cadence USB3 support
Peter Chen [Mon, 24 Jul 2017 07:11:49 +0000 (15:11 +0800)]
MLK-16065-1 ARM64: dts: fsl-imx8qm.dtsi: add Cadence USB3 support

Add Cadence USB3 controller and phy, the phy uses generic USB PHY
driver.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16202-03 ARM64: dts: add separate node for each domain on imx8mq
Bai Ping [Fri, 11 Aug 2017 05:50:56 +0000 (13:50 +0800)]
MLK-16202-03 ARM64: dts: add separate node for each domain on imx8mq

Use separate node for each domain, so we can easily handle the clock
and supply specific to each domain.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16202-02 driver: soc: refact the gpc power domain driver for imx8mq
Bai Ping [Fri, 11 Aug 2017 05:50:08 +0000 (13:50 +0800)]
MLK-16202-02 driver: soc: refact the gpc power domain driver for imx8mq

Enhance the power domain driver for i.mx8mq. We may need to make sure
clock is enabled for some power domain. And also when a power domain
is down, the external supply for this power domain need to be turn off
to save power.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16202-01 driver: regulator: add enable/disable for switch for pfuze100
Robin Gong [Thu, 10 Aug 2017 09:03:45 +0000 (17:03 +0800)]
MLK-16202-01 driver: regulator: add enable/disable for switch for pfuze100

Add enable/disable support for switch regulator on pfuze100.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16209 ARM: dts: imx: add 'regulator-always-on' property for pmic sw4
Bai Ping [Thu, 17 Aug 2017 07:54:06 +0000 (15:54 +0800)]
MLK-16209 ARM: dts: imx: add 'regulator-always-on' property for pmic sw4

Add 'regulator-always-on' for PMIC SW4 switch regulator.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16204-5: arm64: defconfig: build nvmem and ocotp
Peng Fan [Thu, 17 Aug 2017 08:09:25 +0000 (16:09 +0800)]
MLK-16204-5: arm64: defconfig: build nvmem and ocotp

Build NVMEM and OCOTP driver

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16204-4: nvmem: imx-ocotp: add i.mx8mq support and fix read
Peng Fan [Fri, 18 Aug 2017 03:19:08 +0000 (11:19 +0800)]
MLK-16204-4: nvmem: imx-ocotp: add i.mx8mq support and fix read

Add i.MX8MQ support and Fix read.

When offset is not 4 bytes aligned, directly shift righty by 2 bits
will cause reading out wrong data. Since imx ocotp only supports
4 bytes reading once, we need handle offset is not 4 bytes aligned
and enlarge the bytes to 4 bytes aligned. After finished reading,
copy the needed data from buffer to caller and free buffer.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16204-3: clk: imx8mq: add ocotp clock
Peng Fan [Thu, 17 Aug 2017 07:59:00 +0000 (15:59 +0800)]
MLK-16204-3: clk: imx8mq: add ocotp clock

Add OCOTP clock support.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16204-2 arm64: dts: add ocotp node
Peng Fan [Thu, 17 Aug 2017 00:47:49 +0000 (08:47 +0800)]
MLK-16204-2 arm64: dts: add ocotp node

Add ocotp node.

Signed-off-by: Peng Fan <peng.fan@nxp.com>