linux.git
7 years agoMLK-11340-27 usb: phy-mxs: Add implementation of nofity_suspend{resume}
Peter Chen [Wed, 18 Sep 2013 05:57:59 +0000 (13:57 +0800)]
MLK-11340-27 usb: phy-mxs: Add implementation of nofity_suspend{resume}

Implementation of notify_suspend and notify_resume will be different
according to mxs_phy_data->flags.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit d1ce766d9aabdfb823131d38056ff67c94e7e20a)

7 years agoMLK-10102-10 usb: chipidea: otg: Add power lost support for otg fsm mode
Li Jun [Thu, 15 Jan 2015 13:27:40 +0000 (21:27 +0800)]
MLK-10102-10 usb: chipidea: otg: Add power lost support for otg fsm mode

This patch adds support of power lost during system sleep in otg fsm mode.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 493f3c4f04f48240dacc49f84db57e7ecf90161b)

7 years agoMLK-10102-9 usb: chipidea: host: add ci_hdrc_host_has_device API
Li Jun [Thu, 15 Jan 2015 13:26:05 +0000 (21:26 +0800)]
MLK-10102-9 usb: chipidea: host: add ci_hdrc_host_has_device API

This patch adds a new API ci_hdrc_host_has_device to check if there
is usb device connected on host port.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit fd68eb8ef9cdac1ca861ccbc3d01d874123bf52a)

7 years agoMLK-10102-8 usb: chipidea: support role change after power lost
Li Jun [Thu, 15 Jan 2015 13:00:34 +0000 (21:00 +0800)]
MLK-10102-8 usb: chipidea: support role change after power lost

This patch is to complete support usb resume from power lost in non-otg
fsm mode:
- Re-init usb phy.
- Support role changes during system sleep with power lost.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit b15794487c32a6c9317f12b6bca5d2d752c9d76c)
(cherry picked from commit 3e5d97cfd2f3b350dd5b5012cf7af73ce11531ac)

7 years agoMLK-10102-7 usb: chipidea: otg: fix deadlock of usb host removal after system resume
Li Jun [Fri, 16 Jan 2015 05:11:57 +0000 (13:11 +0800)]
MLK-10102-7 usb: chipidea: otg: fix deadlock of usb host removal after system resume

This is to fix possible deadlock of usb host with mass storage removal after
system resume, by waiting host finish device disconnection and then stop host
This is a patch merge for ideas from below 2 patches:
ENGR00308442-2 usb: chipidea: otg: wait devices disconnected before stop host.
ENGR00310498 usb: chipidea: otg: fix otg role switch from host to device failure

How to reproduce:
Failure case 1:
- Enable console wakeup:
  echo enabled > /sys/class/tty/ttymxc0/power/wakeup
- Connect a udisk with ID cable to OTG port.
- Suspend the system:
  ehco mem > /sys/power/state
- Remove ID cable together with udisk.
- Wakeup the system by console.
- OTG port cannot switch to device role.
Failure case 2:
- Connect a udisk with ID cable to OTG port.
- Enable usb wakeup by ./low_power_usb.sh
- Suspend the system:
  ehco mem > /sys/power/state
- Remove ID cable together with udisk.
- System wakeup but OTG port cannot switch to device role.

Root cause:
In this case, ID change interrupt generates before port change interrupt,
so with irq disabled, ci_handle_id_switch() will find there is usb device
still connected and wait it to disconnect by sleep, but disconnect will not
happen since usb irq still disabled so port change irq has no chance to be
handled.

How this patch is fixing this issue:
This patch waits host finish handle usb device disconnection before stop host,
and enables irq before sleep and disables irq after, thus port change
rq can be handled and usb device disconnection can timely happen, then
ci_handle_id_switch() can stop host and switch to device role correctly.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 56d79fbaa4bea3670542a96354ee7034239a1c1f)
(cherry picked from commit d5350035b22cfa1cef15956612a4eec36b4dc0de)

7 years agoMLK-10102-6 usb: chipidea: otg: export ci_handle_id_switch API
Li Jun [Thu, 15 Jan 2015 13:05:12 +0000 (21:05 +0800)]
MLK-10102-6 usb: chipidea: otg: export ci_handle_id_switch API

Export ci_handle_id_switch interface for controller handle id
changes during system sleep with power lost.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit e130afe623307b69b3737cb5a41905400082ca36)
(cherry picked from commit 7acb88a1d4d4f49cebe7c92ce92937e94c2b6486)

7 years agoMLK-10102-5 usb: chipidea: udc: support resume udc from power lost
Li Jun [Thu, 15 Jan 2015 12:49:36 +0000 (20:49 +0800)]
MLK-10102-5 usb: chipidea: udc: support resume udc from power lost

This patch implements the suspend and resume routine for udc resume
from power lost.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit a1389afb0c70d4024e07ff9634f10eba559af374)
(cherry picked from commit 733d0547c2cc90299b35b1b0d34073838ffcf6d9)

7 years agoMLK-10102-4 usb: chipidea: host: support resume usb from power lost
Li Jun [Thu, 15 Jan 2015 12:10:36 +0000 (20:10 +0800)]
MLK-10102-4 usb: chipidea: host: support resume usb from power lost

This patch implements the suspend and resume routine for save and restore
registers of ehci, this is to support host resume from a system sleep with
power lost.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit ab8e5ef4265b706b47b2e3ee36e079d63a3f0bce)
(cherry picked from commit 31039b54ec0bd2429f758626c0abfc9898c5aa82)

7 years agoMLK-10102-3 usb: chipidea: export hw_controller_reset API
Li Jun [Thu, 15 Jan 2015 12:21:45 +0000 (20:21 +0800)]
MLK-10102-3 usb: chipidea: export hw_controller_reset API

Host needs to reset controller for recovery from power lost.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit 136222e683d40890f11985e61b447f2481b8bff5)

7 years agoMLK-10102-2 usb: chipidea: add suspend and resume routine for role driver
Li Jun [Thu, 15 Jan 2015 12:17:07 +0000 (20:17 +0800)]
MLK-10102-2 usb: chipidea: add suspend and resume routine for role driver

We may need to do extra things for system suspend/resume per different
roles(e.g. power lost during system sleep), so define system suspend/resume
handler for roles.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit cac6f339b30102c63f8bb5c56e77d5c7a6c6b4b5)

7 years agoMLK-10102-1 usb: chipidea: imx: usb resume from power lost during system sleep
Li Jun [Thu, 15 Jan 2015 11:13:13 +0000 (19:13 +0800)]
MLK-10102-1 usb: chipidea: imx: usb resume from power lost during system sleep

i.MX6SX mega off can shutdown domain power supply if none of peripheral
in this domain is registered as wakeup source, this patch adds usb controller
imx specific re-init after resume from such power lost during system sleep.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit cd37f9b7157322e28c1d336e42813d441eb1f778)

7 years agoMLK-10085-7 usb: chipidea: imx: add usb charger detection for imx6
Li Jun [Fri, 9 Jan 2015 13:58:41 +0000 (21:58 +0800)]
MLK-10085-7 usb: chipidea: imx: add usb charger detection for imx6

The usb controller driver creates usb charger, and notify
the charger connect and disconnect using vbus connect and
disconnect event.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit da98a621a79b6febf4e072ffb99e16e20b5bc36a)

7 years agoMLK-10085-6 usb: chipidea: Add usb charger detect support in otg fsm mode
Li Jun [Wed, 14 Jan 2015 05:12:04 +0000 (13:12 +0800)]
MLK-10085-6 usb: chipidea: Add usb charger detect support in otg fsm mode

Use b_sess_valid_event for charger detection in otg fsm mode.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit a89ac6eb611277e140fae0ef4ebe97e1a75fb4cc)

7 years agoMLK-10085-5 usb: chipidea: Add usb charger detect notify
Li Jun [Fri, 9 Jan 2015 07:35:07 +0000 (15:35 +0800)]
MLK-10085-5 usb: chipidea: Add usb charger detect notify

- Change .notify's return value from void to int, update msm notify_event
  return value accordingly.
- Add CI_HDRC_CONTROLLER_VBUS_EVENT and
  CI_HDRC_CONTROLLER_CHARGER_POST_EVENT to finish the USB charger
  detection flow.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
7 years agoMLK-10085-4 usb: doc: chipidea: imx: add imx6-usb-charger-detection property
Li Jun [Fri, 9 Jan 2015 06:37:24 +0000 (14:37 +0800)]
MLK-10085-4 usb: doc: chipidea: imx: add imx6-usb-charger-detection property

It is used to indicate whether we use SoC's usb charger
detection or not. Besides, we add anatop phandle since
we need to use anatop register to do most of charger detect operations.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
7 years agoMLK-10085-2 ARM: imx6: add usb anatop phandle at usbotg node
Li Jun [Fri, 9 Jan 2015 06:27:07 +0000 (14:27 +0800)]
MLK-10085-2 ARM: imx6: add usb anatop phandle at usbotg node

Add anatop phandle at usbotg node to access anatop register.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
7 years agoMLK-11340-8 usb: chipidea: host: delete the redundancy ci_hdrc struct
Peter Chen [Tue, 14 Jul 2015 07:43:02 +0000 (15:43 +0800)]
MLK-11340-8 usb: chipidea: host: delete the redundancy ci_hdrc struct

The struct ci_hdrc is the drvdata for hcd device, so we don't
need to introduce extra ci_hdrc structure for ehci.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit 144247425683f783888e2a384946d05962237b60)

7 years agoMLK-11340-5 usb: chipidea: otg_fsm: delete duplicated controller reset
Peter Chen [Wed, 15 Jul 2015 05:56:26 +0000 (13:56 +0800)]
MLK-11340-5 usb: chipidea: otg_fsm: delete duplicated controller reset

At host_stop, it will call usb_remove_hcd, and reset controller later.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit b574ec92b3fcf70743a7467cfc832c7c1b0fe904)

7 years agoMLK-11340-40 usb: whitelist: update otg & eh's TPL for fsl i.mx
Peter Chen [Fri, 8 Aug 2014 01:12:52 +0000 (09:12 +0800)]
MLK-11340-40 usb: whitelist: update otg & eh's TPL for fsl i.mx

The default TPL is for USB OTG & EH compliance test, the supported
class is: mass storage, hub, and hid.

Besides, we add one match criterion that matching targeted device
through class at interface descriptor.

Tested-by: Li Jun <b47624@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit 483c071d989ceb36cacf76e1e3e779c67e5b8280)

7 years agoMLK-11340-31 usb: chipidea: udc: add OTG status request handling
Li Jun [Mon, 23 Jun 2014 07:50:50 +0000 (15:50 +0800)]
MLK-11340-31 usb: chipidea: udc: add OTG status request handling

Peripheral answers OTG status selector request from host according to
host request flag of gadget, length is 1. this flag may be set by application
via sysfs.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit c08edfce9dded6a49d3127179d5f0a036ddb99aa)

7 years agoMLK-11340-26 usb: phy: add notify suspend and resume callback
Peter Chen [Mon, 16 Sep 2013 08:31:24 +0000 (16:31 +0800)]
MLK-11340-26 usb: phy: add notify suspend and resume callback

They are used to notify PHY that the controller enters suspend
or finishes resume.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit 737908259ccc3c3166a51ed8e3638ac1f1730e08)

7 years agoMLK-11340-1 usb: chipidea: usbmisc_imx: Remove unneeded semicolon
Fabio Estevam [Sat, 9 May 2015 15:15:24 +0000 (12:15 -0300)]
MLK-11340-1 usb: chipidea: usbmisc_imx: Remove unneeded semicolon

Remove unneeded semicolon.

The semantic patch that makes this change is available
in scripts/coccinelle/misc/semicolon.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
7 years agousb: chipidea: add work-around for Marvell HSIC PHY startup
Rob Herring [Fri, 29 May 2015 16:38:46 +0000 (11:38 -0500)]
usb: chipidea: add work-around for Marvell HSIC PHY startup

The Marvell 28nm HSIC PHY requires the port to be forced to HS mode after
the port power is applied. This is done using the test mode in the PORTSC
register.

As HSIC is always HS, this work-around should be safe to do with all HSIC
PHYs and has been tested on i.MX6S.

Signed-off-by: Rob Herring <robh@kernel.org>
Tested-by: Peter Chen <Peter.Chen@freescale.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoMLK-11110: cpufreq: imx7-cpufreq: fix system resume failed
Robin Gong [Mon, 15 Jun 2015 04:43:47 +0000 (12:43 +0800)]
MLK-11110: cpufreq: imx7-cpufreq: fix system resume failed

System resume failed easily after commit b993956109856d3, the commit is no
problem, but it exposes the potential deadlock bug which not unlock mutex if
cpufreq not change, remove these code since the cpufreq framwork has consider
it.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit d791bf25e07023f7a936fcabe6f641ad391048b3)

7 years agoMLK-11071 cpufreq: imx7: add cpufreq pm_notifier on imx7d
Bai Ping [Tue, 9 Jun 2015 15:42:50 +0000 (23:42 +0800)]
MLK-11071 cpufreq: imx7: add cpufreq pm_notifier on imx7d

Add pm_notifier for cpufreq on i.MX7D to make sure when
system do suspend/resume no cpu frequency change.
cpu frequency change may use the I2C/SPI interface to
control the external PMIC chip, if the I2C/SPI are not
active in this procedure, frequency change will fail.

Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit b993956109856d3b86df501271b5a55620781c1a)

7 years agoMLK-10257-05 arm: imx7: enable cpufreq driver in defconfig
Bai Ping [Mon, 2 Mar 2015 16:44:04 +0000 (00:44 +0800)]
MLK-10257-05 arm: imx7: enable cpufreq driver in defconfig

Enable the imx7 cpufreq driver in defconfig.

Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit 88d8fe5196ce424467b5b747977af404427c4ef2)

7 years agoMLK-10257-04 cpufreq: imx7: Add cpufreq support for imx7D
Bai Ping [Thu, 12 Feb 2015 17:05:07 +0000 (01:05 +0800)]
MLK-10257-04 cpufreq: imx7: Add cpufreq support for imx7D

Add the basic cpufreq driver for imx7.

Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit db765324267a7c3b93aaf798cefd6a775cf46b1a)

7 years agoMLK-10257-03 arm: imx7: Add cpufreq platform device
Bai Ping [Thu, 12 Feb 2015 17:02:03 +0000 (01:02 +0800)]
MLK-10257-03 arm: imx7: Add cpufreq platform device

Add cpufreq platform device support for DVFS.

Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit 27642021d28555c37aab5e2b75214d8c383f668d)

7 years agoMLK-10257-01 arm: dts: Add operating-points property for cpu node
Bai Ping [Mon, 2 Mar 2015 09:52:27 +0000 (17:52 +0800)]
MLK-10257-01 arm: dts: Add operating-points property for cpu node

Add operating-points, clks and regulators property used in DVFS

Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit f13001e89f5b64750735fd190a8316d8ee800d36)

7 years agoMLK-11322-02 ARM: imx: add io map for pm code
Bai Ping [Wed, 5 Aug 2015 16:27:47 +0000 (00:27 +0800)]
MLK-11322-02 ARM: imx: add io map for pm code

add necessary io memory mapping used by power management.

Signed-off-by: Bai Ping <b51503@freescale.com>
7 years agoMLK-11322-01 ARM: dts: imx: add ocram node used for lpm code
Bai Ping [Wed, 5 Aug 2015 19:37:44 +0000 (03:37 +0800)]
MLK-11322-01 ARM: dts: imx: add ocram node used for lpm code

Reserve iram space for low power code. The first 16KB space
is used for suspend/resume and cpuidle. Another 4KB space is
for busfreq code.

for i.MX6SX, it has a dedicated ocram space start at 0x8f8000
for low power code.

Signed-off-by: Bai Ping <b51503@freescale.com>
7 years agoMLK-11323-03 ARM: defconfig: unselect ARMv6 support in v7 defconfig
Bai Ping [Wed, 5 Aug 2015 17:37:35 +0000 (01:37 +0800)]
MLK-11323-03 ARM: defconfig: unselect ARMv6 support in v7 defconfig

In imx_v7_defconfig file, no need to enable the ARMv6 support.

Signed-off-by: Bai Ping <b51503@freescale.com>
7 years agoMLK-11323-02 ARM: defconfig: enable the snvs_pwrkey support
Bai Ping [Wed, 5 Aug 2015 17:34:30 +0000 (01:34 +0800)]
MLK-11323-02 ARM: defconfig: enable the snvs_pwrkey support

Enable the snvs_pwrkey driver support.

Signed-off-by: Bai Ping <b51503@freescale.com>
7 years agoMLK-11327 dma: pxp: porting pxp dma driver to imx_4.1.y
Fancy Fang [Thu, 6 Aug 2015 07:29:15 +0000 (15:29 +0800)]
MLK-11327 dma: pxp: porting pxp dma driver to imx_4.1.y

Porting pxp dma drivers v2 and v3 to imx_4.1.y branch.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11286-3 rpmsg: imx: enable rpmsg tests on imx
Richard Zhu [Mon, 27 Jul 2015 05:59:55 +0000 (13:59 +0800)]
MLK-11286-3 rpmsg: imx: enable rpmsg tests on imx

enable the rpmsg pingpong and tty string echo tests
on imx amp socs
- pingpong test howto
insmod imx_rpmsg_pingpong.ko

- tty string echo test howto
  - step 1, load the imx_rpmsg_tty.ko
  insmod imx_rpmsg_tty.ko
  - step 2, lanunch the mxc_mcc_tty_test.out in backend
  ./mxc_mcc_tty_test.out /dev/ttyRPMSG 115200 R 512 512 &
  - step 3, issue the echo command
  echo <string> > /dev/ttyRPMSG

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
7 years agoMLK-11286-2 ARM: dts: enable rpmsg support on imx7d
Richard Zhu [Wed, 5 Aug 2015 06:20:21 +0000 (14:20 +0800)]
MLK-11286-2 ARM: dts: enable rpmsg support on imx7d

- enable rpmsg on imx7d platforms
- since there are some modules conflictions between A# and m4,
add new *-m4.dts files, that used when m4 core is kicked off.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
7 years agoMLK-11286-1 ARM: imx: enable rpmsg on imx amp platforms
Richard Zhu [Wed, 5 Aug 2015 06:17:40 +0000 (14:17 +0800)]
MLK-11286-1 ARM: imx: enable rpmsg on imx amp platforms

enable rpmsg on imx amp platforms
- use MU receive interrupter as the notify of the multi-cores.
- add the MU root clock support on imx7d

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
[Octavian: select VIRTIO_RPMGS, fix for VIRTIO_RPMSG_F_NS removal]
Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
7 years agoMLK-11318-5: video: mxsfb: porting mxsfb driver to imx_4.1.y branch
Fancy Fang [Tue, 4 Aug 2015 09:23:45 +0000 (17:23 +0800)]
MLK-11318-5: video: mxsfb: porting mxsfb driver to imx_4.1.y branch

Porting mxsfb driver to imx_4.1.y branch.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11318-4 ARM: dts: imx7d-12x12-lpddr3-arm2: add dts support for pwm backlight
Fancy Fang [Tue, 4 Aug 2015 08:08:51 +0000 (16:08 +0800)]
MLK-11318-4 ARM: dts: imx7d-12x12-lpddr3-arm2: add dts support for pwm backlight

Add dts support for pwm backlight on imx_4.1.y branch.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11318-3 ARM: dts: imx7d-12x12-lpddr3-arm2: add dts support for lcdif
Fancy Fang [Tue, 4 Aug 2015 08:05:20 +0000 (16:05 +0800)]
MLK-11318-3 ARM: dts: imx7d-12x12-lpddr3-arm2: add dts support for lcdif

Add dts support for lcdif on imx_4.1.y branch.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11318-2 ARM: dts: imx7d-sdb: add dts support for pwm backlight
Fancy Fang [Tue, 4 Aug 2015 07:51:54 +0000 (15:51 +0800)]
MLK-11318-2 ARM: dts: imx7d-sdb: add dts support for pwm backlight

Add dts support for pwm backlight on imx_4.1.y branch.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11317-02 ARM: imx: imx6ul: add enet init for i.mx6ul
Fugang Duan [Tue, 18 Aug 2015 03:28:08 +0000 (11:28 +0800)]
MLK-11317-02 ARM: imx: imx6ul: add enet init for i.mx6ul

Add enet MAC address init.

The patch is merged from commit: 67cfceab0b77e887910f11dda13ab3a98bb0d87a

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-11300-06 ARM: configs: enable imx6ul in defconfig
Bai Ping [Fri, 31 Jul 2015 14:06:36 +0000 (22:06 +0800)]
MLK-11300-06 ARM: configs: enable imx6ul in defconfig

Enable the i.MX6UL SOC support in the defconfig file.

Signed-off-by: Bai Ping <b51503@freescale.com>
7 years agoMLK-11300-05 ARM: imx: add pm support for imx6ul
Bai Ping [Fri, 31 Jul 2015 10:55:38 +0000 (18:55 +0800)]
MLK-11300-05 ARM: imx: add pm support for imx6ul

Add basic pm suspend/resume support for i.MX6UL.

Signed-off-by: Bai Ping <b51503@freescale.com>
7 years agoMLK-11300-04 ARM: imx: add gpt timer support on imx6ul
Bai Ping [Wed, 29 Jul 2015 18:22:13 +0000 (02:22 +0800)]
MLK-11300-04 ARM: imx: add gpt timer support on imx6ul

Add gpt-timer for i.MX6UL SOC.

Signed-off-by: Bai Ping <b51503@freescale.com>
7 years agoMLK-11300-02 ARM: dts: imx: add imx6ul board dts support
Bai Ping [Wed, 29 Jul 2015 17:33:13 +0000 (01:33 +0800)]
MLK-11300-02 ARM: dts: imx: add imx6ul board dts support

Add i.MX6UL board support dts file for boards:
* imx6ul-14X14-evk.dts
* imx6ul-14x14-ddr3-arm2.dts

Signed-off-by: Ye.Li <Ye.Li@freescale.com>
Signed-off-by: Bai Ping <b51503@freescale.com>
[Octavian: merge with upstream, prefer upstrem in case of conflict]
Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
7 years agoMLK-11300-01 ARM: dts: imx: add imx6ul dtsi support.
Bai Ping [Thu, 30 Jul 2015 14:22:26 +0000 (22:22 +0800)]
MLK-11300-01 ARM: dts: imx: add imx6ul dtsi support.

Add i.MX6UL SOC dtsi file.

Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Bai Ping <b51503@freescale.com>
[Octavian: merge 4.1.y into upstream keeping upstream values where values are different]
Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
7 years agoMLK-10449-1: 74x164: Add new property registers-default
Sandor Yu [Fri, 20 Mar 2015 06:58:20 +0000 (14:58 +0800)]
MLK-10449-1: 74x164: Add new property registers-default

For some platform such as imx7D SDB, one pin of 74x164 to
control all peripheral power supply(PERI_3V_EN).
The pin should keep in high voltage level when 74x164 loading,
otherwise the module depend on PERI_3V3 will lose power.
So add new property registers-default into 74x164 driver.

Signed-off-by: Sandor Yu <R01008@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 61fe7af7e47dd8bf6acc91ceabd9e660d28de28a)

7 years agoMLK-11293: gpio: pca953x: add device_reset() call
Shawn Guo [Sun, 14 Jul 2013 13:52:38 +0000 (21:52 +0800)]
MLK-11293: gpio: pca953x: add device_reset() call

The pca953x type of devices, e.g. max7310, may have a reset which needs
to be handled to get the device start working.  Add a device_reset()
call for that, and defer the probe if the reset controller for that is
not ready yet.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: d3264091b30b777d94a18efda9823a06668d5b10)

7 years agoMLK-10447-03: ARM: imx_v7_defconfig: Add spi gpio and gpio 74x164
Fugang Duan [Tue, 28 Jul 2015 03:13:20 +0000 (11:13 +0800)]
MLK-10447-03: ARM: imx_v7_defconfig: Add spi gpio and gpio 74x164

Enable CONFIG_SPI_GPIO and CONFIG_GPIO_74X164 to imx_v7_defconfig.

Signed-off-by: Sandor Yu <R01008@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: a551a35455d14d265ce7aeb4a0e6081303f43fec)

7 years agoMLK-10447-01: dts: imx7d sdb: Add 74LV595 driver
Fugang Duan [Tue, 28 Jul 2015 03:09:20 +0000 (11:09 +0800)]
MLK-10447-01: dts: imx7d sdb: Add 74LV595 driver

-74LV595 function compatible with 74HC595, add 74HC595
driver into imx7d sdb dts.
-74LV595 register as a GPIO device and access 74LV595 chip
by SPI GPIO, so add spi_gpio driver into imx7 sdb dts.

Signed-off-by: Sandor Yu <R01008@freescale.com>
igned-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 61fe7af7e47dd8bf6acc91ceabd9e660d28de28a)

7 years agoMLK-10463-1 ARM: imx: init ENET RGMII tx clock source
Fugang Duan [Fri, 6 Feb 2015 08:42:46 +0000 (16:42 +0800)]
MLK-10463-1 ARM: imx: init ENET RGMII tx clock source

Init ENET RGMII tx clock source, set GPR5[9] to select clock from
internal PLL_enet. And set phy VDDIO to 1.8V that get better signal
quality.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: d7a171fcf5218166f558428610ca8e9cb9f7e830)

7 years agoMLK-10098 ARM: imx: fix 1588 clock init
Fugang Duan [Wed, 14 Jan 2015 08:18:58 +0000 (16:18 +0800)]
MLK-10098 ARM: imx: fix 1588 clock init

The enet clock define is changed as there has no "enet_ref" clock name.
If the tx_clk is sourced from SOC anatop PLL, user define the clock id
in devicetree. So we only to judge the ptp clock valid and then set the
related GPR bit.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 01ed2a839d9b76ccb4113dc2a04af4a33b33de22)

7 years agoMLK-10060 ARM: i.MX6: disable ethernet phy AR8031 EEE mode in default
Fugang Duan [Thu, 25 Dec 2014 09:17:49 +0000 (17:17 +0800)]
MLK-10060 ARM: i.MX6: disable ethernet phy AR8031 EEE mode in default

Disable ethernet phy AR8031 EEE mode in default to reduce the IEEE1588
latency.

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-9694 ARM: imx6: init enet MAC address
Fugang Duan [Wed, 15 Oct 2014 01:36:40 +0000 (09:36 +0800)]
MLK-9694 ARM: imx6: init enet MAC address

Enet get MAC address order:
From module parameters or kernel command line -> device tree ->
pfuse -> mac registers set by bootloader -> random mac address.

When there have no "fec.macaddr" parameters set in kernel command
line, enet driver get MAC address from device tree. And then if
the MAC address set in device tree and is valid, enet driver get
MAC address from device tree. Otherwise,enet get MAarch/arm/mach-imx
/mach-imx6q.cC address from
pfuse. So, in the condition, update the MAC address (read from pfuse)
to device tree.

Cherry-pick & Merge patches from:
149ac988a25b8d8eb86d05679cbb7b42819ff7a1 &
3269e5c06bdb2f7ab9bd5afa9bbfe46d872197d3

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-11290 ARM: dts: imx7d-12x12-lpddr3-arm2: add enet, i2c, max7322 support
Fugang Duan [Mon, 27 Jul 2015 10:56:07 +0000 (18:56 +0800)]
MLK-11290 ARM: dts: imx7d-12x12-lpddr3-arm2: add enet, i2c, max7322 support

Add enet1, enet2, i2c1~4, max7322 support.

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-11206: input: misc: fxls8471: support ±2g/±4g/±8g dynamically selection
Gao Pan [Wed, 1 Jul 2015 06:38:20 +0000 (14:38 +0800)]
MLK-11206: input: misc: fxls8471: support Â±2g/±4g/±8g dynamically selection

Support Â±2g/±4g/±8g dynamically selection for motion sensor fxls8471.

Set the sensor mode to standby mode before changing the scale range
with the command "echo 0 > enable". The scale range can be changed
with the command "echo 0/1/2 > range".

Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 6824cff93d368eafbf96c71fad541f9bc2502e3a)

7 years agoMLK-11218: misc: fxos8700: support ±2g/±4g/±8g dynamically
Gao Pan [Fri, 3 Jul 2015 08:31:38 +0000 (16:31 +0800)]
MLK-11218: misc: fxos8700: support Â±2g/±4g/±8g dynamically

Support Â±2g/±4g/±8g dynamically selection for motion sensor fxos8700.

Set the sensor mode to standby mode before changing the scale range
with the command "echo 0 > enable". The scale range can be changed
with the command "echo 0/1/2 > range".

Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 74c9af0a5806fb5c926ffdab3145fc1680fc87e6)

7 years agoMLK-10947 ARM: imx_v7_defconfig: enable fxls8471 in defconfig
Fugang Duan [Mon, 27 Jul 2015 09:38:14 +0000 (17:38 +0800)]
MLK-10947 ARM: imx_v7_defconfig: enable fxls8471 in defconfig

Enable fxls8471 in defconfig.

Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 692ff04d68f953d4534f27c6c4529e46b1a48518)

7 years agoMLK-10948 input: misc: fxls8471: add motion sensor fxls8471
gaopan [Thu, 21 May 2015 06:50:47 +0000 (14:50 +0800)]
MLK-10948 input: misc: fxls8471: add motion sensor fxls8471

Add Freescale fxls8471 motion sensor.

Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 20cfe2d9d9305559e35fe2e508d5a70b057ffc70)

7 years agoMLK-10893: i2c: imx: add irqf_no_suspend
gaopan [Tue, 12 May 2015 10:25:29 +0000 (18:25 +0800)]
MLK-10893: i2c: imx: add irqf_no_suspend

The i2c irq is masked when pcie starts a i2c transfer process
during noirq suspend stage. As a result, i2c transfer fails.
To solve the problem, IRQF_NO_SUSPEND is added to i2c bus.

Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherrt picked from commit: ab13b0e11c50021905de00a0f3c0df7e0a36a3f0)

7 years agoMLK-10835-5 ARM: imx_v7_defconfig: enable mpl3115,fxas2100x and fxos8700 in defconfig
Fugang Duan [Wed, 6 May 2015 02:02:42 +0000 (10:02 +0800)]
MLK-10835-5 ARM: imx_v7_defconfig: enable mpl3115,fxas2100x and fxos8700 in defconfig

Enable mpl3115,fxas2100x and fxos8700 sensors in defconfig.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 275be06ee31ffd0b9c2c12fb7e563a6b060bf5a2)

7 years agoMLK-10835-3 input: misc: mpl3115: add Freescale MPL3115 pressure temperature sensor
Fugang Duan [Tue, 5 May 2015 12:36:58 +0000 (20:36 +0800)]
MLK-10835-3 input: misc: mpl3115: add Freescale MPL3115 pressure temperature sensor

Add Freescale MPL3115 pressure temperature sensor.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: a8c2904a442e1aa163b8562e1a940c8755ab3898)

7 years agoMLK-10835-2 misc: fxos8700: add Freescale FXOS8700 6-Axis Acc and Mag Combo Sensor
Fugang Duan [Tue, 5 May 2015 10:58:55 +0000 (18:58 +0800)]
MLK-10835-2 misc: fxos8700: add Freescale FXOS8700 6-Axis Acc and Mag Combo Sensor

Add Freescale FXOS8700 6-Axis Acc and Mag Combo Sensor

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: c0ca56bbf3f8503a858d15bb14f27652ae6612eb)

7 years agoMLK-10835-1 misc: fxas2100x: add Freescale FXAS2100X gyroscope sensor
Fugang Duan [Tue, 5 May 2015 09:08:34 +0000 (17:08 +0800)]
MLK-10835-1 misc: fxas2100x: add Freescale FXAS2100X gyroscope sensor

Add Freescale FXAS2100X gyroscope sensor

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 34a99f00d4886f95a8cf8cd4acbf37a82c67e46c)

7 years agoMLK-10833-3 imx_v7_defconfig: enable mag3110 by default
Fugang Duan [Mon, 27 Jul 2015 08:41:32 +0000 (16:41 +0800)]
MLK-10833-3 imx_v7_defconfig: enable mag3110 by default

Enable mag3110 driver in default config.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: ac43097186e94d5ecfdbc3c6a514aa20e5a7f8ca)

7 years agoMLK-10833-2 hwmon: mag3110: use global variable instead of macro define
Fugang Duan [Wed, 6 May 2015 11:37:44 +0000 (19:37 +0800)]
MLK-10833-2 hwmon: mag3110: use global variable instead of macro define

Use global variable instead of macro "MAG3110_IRQ_USED" that is more
flexible.

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-10833-1 hwmon: mag3110: Add mag3110 driver support on i.MX6Q/DL/SX platform.
Luwei Zhou [Tue, 16 Sep 2014 05:05:41 +0000 (13:05 +0800)]
MLK-10833-1 hwmon: mag3110: Add mag3110 driver support on i.MX6Q/DL/SX platform.

Add mag3110 driver support for i.MX6Q/DL/SX platform. The code derives from 3.10.y branch.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: dd027baab7652c62d26f1749f334099e4dbe61c9)

7 years agoMLK-10369 ARM: dts: Add i2c bus support for i.MX7d-sdb board
Fugang Duan [Mon, 27 Jul 2015 08:28:48 +0000 (16:28 +0800)]
MLK-10369 ARM: dts: Add i2c bus support for i.MX7d-sdb board

- Add i2c1,2,3,4 bus support for i.MX7d-sdb board (i2c4 bus need to
  rework: swap R485 and R33).
- Add i2c device PMIC support.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 45acb911f7192fcc574f1e0faaf19513b9879046)

7 years agoMLK-11288 ARM: dts: imx7d-sdb: add fec1, fec2 support
Fugang Duan [Mon, 27 Jul 2015 06:38:38 +0000 (14:38 +0800)]
MLK-11288 ARM: dts: imx7d-sdb: add fec1, fec2 support

Add fec1, fec2 support for i.MX7d-sdb board.

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-10919 net: phy: micrel: add ksz8081 resume function
Fugang Duan [Mon, 27 Jul 2015 07:40:00 +0000 (15:40 +0800)]
MLK-10919 net: phy: micrel: add ksz8081 resume function

Add ksz8081 resume function since the phy has some non-standard
register init process that has some fixup.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 65c6e997b8e020b9e87d1af23c94c15c13e3d2e3)

7 years agoMLK-10920 ARM: imx_v7_defconfig: enable MICREL phy
Fugang Duan [Tue, 19 May 2015 03:03:55 +0000 (11:03 +0800)]
MLK-10920 ARM: imx_v7_defconfig: enable MICREL phy

Enable CONFIG_MICREL_PHY for MICREL PHY since i.MX6ul boards install
micrel ksz8081 phy.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 626d87758e1724ff92708da11e8af0081bb69ce9)

7 years agoMLK-10472-2 ARM: imx_v7_defconfig: enable max7322 in default config
Fugang Duan [Mon, 27 Jul 2015 06:53:21 +0000 (14:53 +0800)]
MLK-10472-2 ARM: imx_v7_defconfig: enable max7322 in default config

Enable max7322 extention gpio driver in config

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from commit: 575b7e4c2f85b08fb09d6a639adb404718b9b644)

7 years agoMLK-11274 net: fec: add mii bus up_failed flag to reflect the real status
Fugang Duan [Wed, 22 Jul 2015 04:42:40 +0000 (12:42 +0800)]
MLK-11274 net: fec: add mii bus up_failed flag to reflect the real status

Add mii bus up_failed flag to reflect the real mii bus status.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Reported-and-tested-by: Zhang Sanshan <B51434@freescale.com>
(cherry picked from commit: ea348e597501d44841a28d8ee099361e89d63520)

7 years agoMLK-10939-01 net: fec: add stop mode support for dts register set
Fugang Duan [Wed, 20 May 2015 10:36:19 +0000 (18:36 +0800)]
MLK-10939-01 net: fec: add stop mode support for dts register set

The current driver support stop mode by calling machine api.
The patch add dts support to set gpr register for stop request.

After magic pattern comming during system suspend status, system will
be waked up, and irq handler will be running, there have enet register
access. Since all clocks are disabled in suspend, and clocks are enabled
after resume function. But irq handler run before resume function.

For imx7d chip, access register need some clocks enabled, otherwise system
hang. So the patch also disable wake up irq in the suspend, after resume
back enable the irq, which can avoid system hang issue.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry pick and merge from commit: 8da4f80af0913781a4f9d50917c1dd66180e519d)

7 years agoMLK-10724-6 net: fec: add i.mx6ul enet support
Anson Huang [Thu, 23 Apr 2015 11:04:10 +0000 (19:04 +0800)]
MLK-10724-6 net: fec: add i.mx6ul enet support

i.MX6UL enet is the lite edition of i.MX6Q enet,
don't support Gbps mode.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 32a2c3878322d8322a29c52af18de7707134ca1c)

7 years agoMLK-9919 net: fec: reinit MAC0 MII bus for MAC1 use after resume back
Fugang Duan [Wed, 10 Dec 2014 05:46:08 +0000 (13:46 +0800)]
MLK-9919 net: fec: reinit MAC0 MII bus for MAC1 use after resume back

i.MX6SX-AI board has two enet MACs (MAC0 and MAC1), they share MAC0 MII
bus. When PHY0 don't connect to enet MAC0, MAC0 mii bus probe phy0 failed,
and the net interface is set to unattach mode. During suspend resume test,
driver don't reinit MAC0 after resume back, so MII bus don't work that causes
MAC1 also cannot access PHY1.

The patch just is workaround that reinit MAC0 MII bus for MAC1 using.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: b730adeef4f9b44e302c793cbef35ea74f24fbef)

7 years agoMLK-9691 net: fec: call .pm_qos_remove_request() in .ndo_stop() callback
Fugang Duan [Tue, 14 Oct 2014 08:44:57 +0000 (16:44 +0800)]
MLK-9691 net: fec: call .pm_qos_remove_request() in .ndo_stop() callback

Call .pm_qos_remove_request() in .ndo_stop() callback to avoid kernel
warning during enet open/close test.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: f81c176d36b8189220a729d723801d2cdd495108)

7 years agoMLK-11285-02 net:fec: add enet AVB Ubuntu Gstreamer demo support
Fugang Duan [Fri, 10 Oct 2014 08:25:26 +0000 (16:25 +0800)]
MLK-11285-02 net:fec: add enet AVB Ubuntu Gstreamer demo support

Support Gstreamer AVB demo support.

ring1 -> ClassA, ring2 -> ClassB, ring0 -> Best Effort

For QoS: ring1 > ring2 > ring0
For bandwidth reverse:
      50% bandwidth -> ClassA
      33% bandwidth -> ClassB
      17% bandwidth -> Best effort queue

In general, ClassA run audio, ClassB run video.
Since AVB demo use big bandwidth streaming, video cost more than
33Mbps bandwidth, and with Qos limitation: ClassA >= ClassB > Best effort,
so we have to change ring2 bandwidth equal to ring1 bandwidth (50%).
After validate on FPGA, AVB demo can work fine for audio and video.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit 93d6579a7b3d2dafa721c835df5d5f7d30ed386e)

7 years agoMLK-11285-01 net: fec: handle WAIT mode issue for imx6qdl
Shawn Guo [Mon, 15 Sep 2014 03:20:58 +0000 (11:20 +0800)]
MLK-11285-01 net: fec: handle WAIT mode issue for imx6qdl

This is a combination of commits 919d46e37e04 (ENGR00265935 net: fec:
add pm_qos to avoid cpu enter to wait mode) and 8a12c90c9974
(ENGR00313685-14 net: fec: check workaround for FEC_QUIRK_BUG_WAITMODE)
from imx_3.10.y branch.  It's added for imx_3.14.y branch to work around
imx6qdl issue ERR006687 (ENET: Only the ENET wake-up interrupt request
can wake the system from Wait mode).

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
(cherry-pick and merge from commit: 4f406fae257cc7945a0e3a425213440bb12ba345)

7 years agoMLK-11265-11 ARM: configs: enable imx7d soc support by default
Anson Huang [Wed, 22 Jul 2015 02:40:07 +0000 (10:40 +0800)]
MLK-11265-11 ARM: configs: enable imx7d soc support by default

Enable CONFIG_SOC_IMX7D by default.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoMLK-11265-10 ARM: configs: add imx v7 support
Anson Huang [Mon, 20 Jul 2015 09:00:16 +0000 (17:00 +0800)]
MLK-11265-10 ARM: configs: add imx v7 support

Add imx_v7_defconfig and imx_v7_mfg_defconfig support
for V7 only.

Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
7 years agoMLK-11265-7 ARM: imx: add smp support for imx7d
Anson Huang [Thu, 27 Oct 2016 12:33:59 +0000 (15:33 +0300)]
MLK-11265-7 ARM: imx: add smp support for imx7d

Add SMP support for i.MX7D, including CPU hotplug support.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoMLK-11265-8 ARM: imx: add pm support for imx7d
Octavian Purdila [Thu, 27 Oct 2016 12:15:25 +0000 (15:15 +0300)]
MLK-11265-8 ARM: imx: add pm support for imx7d

Add i.MX7D suspend/resume support, including standby
and mem mode support, mega/fast mix off and DDR
retention support.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoMLK-11265-9 ARM: imx: add ddrc driver support
Anson Huang [Mon, 20 Jul 2015 08:59:24 +0000 (16:59 +0800)]
MLK-11265-9 ARM: imx: add ddrc driver support

i.MX7D has a new IP block of DDR controller called
DDRC, add driver for this module.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoMLK-11265-6 ARM: imx: add imx7d msl support
Anson Huang [Thu, 27 Oct 2016 10:55:15 +0000 (13:55 +0300)]
MLK-11265-6 ARM: imx: add imx7d msl support

Add MSL support for new SoC i.MX7D.

Signed-off-by: Anson Huang <b20788@freescale.com>
[Octavian: update upstream with minimal diff from mx_4.1.y to allow compile]
Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
7 years agoMLK-11265-2 ARM: dts: add imx7d board dtb
Anson Huang [Wed, 22 Jul 2015 02:35:01 +0000 (10:35 +0800)]
MLK-11265-2 ARM: dts: add imx7d board dtb

Add i.MX7D 12x12 LPDDR3 ARM2 board and SabreSD board
dtb support.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoMLK-11265-1 ARM: dts: add imx7d soc dtsi support
Anson Huang [Wed, 22 Jul 2015 02:34:02 +0000 (10:34 +0800)]
MLK-11265-1 ARM: dts: add imx7d soc dtsi support

Add new SoC i.MX7D dtsi and pinfunc head file.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoLinux 4.9.88
Greg Kroah-Hartman [Sun, 18 Mar 2018 10:18:56 +0000 (11:18 +0100)]
Linux 4.9.88

7 years agoPCI: dwc: Fix enumeration end when reaching root subordinate
Koen Vandeputte [Wed, 7 Mar 2018 16:46:39 +0000 (10:46 -0600)]
PCI: dwc: Fix enumeration end when reaching root subordinate

commit fc110ebdd014dd1368c98e7685b47789c31fab42 upstream.

The subordinate value indicates the highest bus number which can be
reached downstream though a certain device.

Commit a20c7f36bd3d ("PCI: Do not allocate more buses than available in
parent") ensures that downstream devices cannot assign busnumbers higher
than the upstream device subordinate number, which was indeed illogical.

By default, dw_pcie_setup_rc() inits the Root Complex subordinate to a
value of 0x01.

Due to this combined with above commit, enumeration stops digging deeper
downstream as soon as bus num 0x01 has been assigned, which is always the
case for a bridge device.

This results in all devices behind a bridge bus remaining undetected, as
these would be connected to bus 0x02 or higher.

Fix this by initializing the RC to a subordinate value of 0xff, which is
not altering hardware behaviour in any way, but informs probing function
pci_scan_bridge() later on which reads this value back from register.

The following nasty errors during boot are also fixed by this:

  pci_bus 0000:02: busn_res: can not insert [bus 02-ff] under [bus 01] (conflicts with (null) [bus 01])
  ...
  pci_bus 0000:03: [bus 03] partially hidden behind bridge 0000:01 [bus 01]
  ...
  pci_bus 0000:04: [bus 04] partially hidden behind bridge 0000:01 [bus 01]
  ...
  pci_bus 0000:05: [bus 05] partially hidden behind bridge 0000:01 [bus 01]
  pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 05
  pci_bus 0000:02: busn_res: can not insert [bus 02-05] under [bus 01] (conflicts with (null) [bus 01])
  pci_bus 0000:02: [bus 02-05] partially hidden behind bridge 0000:01 [bus 01]

Fixes: a20c7f36bd3d ("PCI: Do not allocate more buses than available in
parent")
Tested-by: Niklas Cassel <niklas.cassel@axis.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Cc: stable@vger.kernel.org # v4.15+
Cc: Binghui Wang <wangbinghui@hisilicon.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Jianguo Sun <sunjianguo1@huawei.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Minghuan Lian <minghuan.Lian@freescale.com>
Cc: Mingkai Hu <mingkai.hu@freescale.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Richard Zhu <hongxing.zhu@nxp.com>
Cc: Roy Zang <tie-fei.zang@freescale.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Stanimir Varbanov <svarbanov@mm-sol.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Xiaowei Song <songxiaowei@hisilicon.com>
Cc: Zhou Wang <wangzhou1@hisilicon.com>
[fabio: adapted to the file location of 4.9 kernel]
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoearlycon: add reg-offset to physical address before mapping
Greentime Hu [Tue, 13 Feb 2018 09:09:08 +0000 (17:09 +0800)]
earlycon: add reg-offset to physical address before mapping

commit 1f66dd36bb18437397ea0d7882c52f7e3c476e15 upstream.

It will get the wrong virtual address because port->mapbase is not added
the correct reg-offset yet. We have to update it before earlycon_map()
is called

Signed-off-by: Greentime Hu <greentime@andestech.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: stable@vger.kernel.org
Fixes: 088da2a17619 ("of: earlycon: Initialize port fields from DT properties")
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoserial: core: mark port as initialized in autoconfig
Sebastian Andrzej Siewior [Sat, 3 Feb 2018 11:27:23 +0000 (12:27 +0100)]
serial: core: mark port as initialized in autoconfig

commit 714569064adee3c114a2a6490735b94abe269068 upstream.

This is a followup on 44117a1d1732 ("serial: core: mark port as
initialized after successful IRQ change").
Nikola has been using autoconfig via setserial and reported a crash
similar to what I fixed in the earlier mentioned commit. Here I do the
same fixup for the autoconfig. I wasn't sure that this is the right
approach. Nikola confirmed that it fixes his crash.

Fixes: b3b576461864 ("tty: serial_core: convert uart_open to use tty_port_open")
Link: http://lkml.kernel.org/r/20180131072000.GD1853@localhost.localdomain
Reported-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Tested-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoserial: 8250_pci: Add Brainboxes UC-260 4 port serial device
Nikola Ciprich [Tue, 13 Feb 2018 14:04:46 +0000 (15:04 +0100)]
serial: 8250_pci: Add Brainboxes UC-260 4 port serial device

commit 9f2068f35729948bde84d87a40d135015911345d upstream.

Add PCI ids for two variants of Brainboxes UC-260 quad port
PCI serial cards.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agousb: gadget: f_fs: Fix use-after-free in ffs_fs_kill_sb()
Xinyong [Fri, 2 Mar 2018 11:20:07 +0000 (19:20 +0800)]
usb: gadget: f_fs: Fix use-after-free in ffs_fs_kill_sb()

commit 1a087f032111a88e826877449dfb93ceb22b78b9 upstream.

When I debug a kernel crash issue in funcitonfs, found ffs_data.ref
overflowed, While functionfs is unmounting, ffs_data is put twice.

Commit 43938613c6fd ("drivers, usb: convert ffs_data.ref from atomic_t to
refcount_t") can avoid refcount overflow, but that is risk some situations.
So no need put ffs data in ffs_fs_kill_sb, already put in ffs_data_closed.

The issue can be reproduced in Mediatek mt6763 SoC, ffs for ADB device.
KASAN enabled configuration reports use-after-free errro.

BUG: KASAN: use-after-free in refcount_dec_and_test+0x14/0xe0 at addr ffffffc0579386a0
Read of size 4 by task umount/4650
====================================================
BUG kmalloc-512 (Tainted: P        W  O   ): kasan: bad access detected
-----------------------------------------------------------------------------

INFO: Allocated in ffs_fs_mount+0x194/0x844 age=22856 cpu=2 pid=566
    alloc_debug_processing+0x1ac/0x1e8
    ___slab_alloc.constprop.63+0x640/0x648
    __slab_alloc.isra.57.constprop.62+0x24/0x34
    kmem_cache_alloc_trace+0x1a8/0x2bc
    ffs_fs_mount+0x194/0x844
    mount_fs+0x6c/0x1d0
    vfs_kern_mount+0x50/0x1b4
    do_mount+0x258/0x1034
INFO: Freed in ffs_data_put+0x25c/0x320 age=0 cpu=3 pid=4650
    free_debug_processing+0x22c/0x434
    __slab_free+0x2d8/0x3a0
    kfree+0x254/0x264
    ffs_data_put+0x25c/0x320
    ffs_data_closed+0x124/0x15c
    ffs_fs_kill_sb+0xb8/0x110
    deactivate_locked_super+0x6c/0x98
    deactivate_super+0xb0/0xbc
INFO: Object 0xffffffc057938600 @offset=1536 fp=0x          (null)
......
Call trace:
[<ffffff900808cf5c>] dump_backtrace+0x0/0x250
[<ffffff900808d3a0>] show_stack+0x14/0x1c
[<ffffff90084a8c04>] dump_stack+0xa0/0xc8
[<ffffff900826c2b4>] print_trailer+0x158/0x260
[<ffffff900826d9d8>] object_err+0x3c/0x40
[<ffffff90082745f0>] kasan_report_error+0x2a8/0x754
[<ffffff9008274f84>] kasan_report+0x5c/0x60
[<ffffff9008273208>] __asan_load4+0x70/0x88
[<ffffff90084cd81c>] refcount_dec_and_test+0x14/0xe0
[<ffffff9008d98f9c>] ffs_data_put+0x80/0x320
[<ffffff9008d9d904>] ffs_fs_kill_sb+0xc8/0x110
[<ffffff90082852a0>] deactivate_locked_super+0x6c/0x98
[<ffffff900828537c>] deactivate_super+0xb0/0xbc
[<ffffff90082af0c0>] cleanup_mnt+0x64/0xec
[<ffffff90082af1b0>] __cleanup_mnt+0x10/0x18
[<ffffff90080d9e68>] task_work_run+0xcc/0x124
[<ffffff900808c8c0>] do_notify_resume+0x60/0x70
[<ffffff90080866e4>] work_pending+0x10/0x14

Cc: stable@vger.kernel.org
Signed-off-by: Xinyong <xinyong.fang@linux.alibaba.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agousb: usbmon: Read text within supplied buffer size
Pete Zaitcev [Fri, 9 Mar 2018 06:21:14 +0000 (00:21 -0600)]
usb: usbmon: Read text within supplied buffer size

commit a5f596830e27e15f7a0ecd6be55e433d776986d8 upstream.

This change fixes buffer overflows and silent data corruption with the
usbmon device driver text file read operations.

Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agousb: quirks: add control message delay for 1b1c:1b20
Danilo Krummrich [Tue, 6 Mar 2018 08:38:49 +0000 (09:38 +0100)]
usb: quirks: add control message delay for 1b1c:1b20

commit cb88a0588717ba6c756cb5972d75766b273a6817 upstream.

Corsair Strafe RGB keyboard does not respond to usb control messages
sometimes and hence generates timeouts.

Commit de3af5bf259d ("usb: quirks: add delay init quirk for Corsair
Strafe RGB keyboard") tried to fix those timeouts by adding
USB_QUIRK_DELAY_INIT.

Unfortunately, even with this quirk timeouts of usb_control_msg()
can still be seen, but with a lower frequency (approx. 1 out of 15):

[   29.103520] usb 1-8: string descriptor 0 read error: -110
[   34.363097] usb 1-8: can't set config #1, error -110

Adding further delays to different locations where usb control
messages are issued just moves the timeouts to other locations,
e.g.:

[   35.400533] usbhid 1-8:1.0: can't add hid device: -110
[   35.401014] usbhid: probe of 1-8:1.0 failed with error -110

The only way to reliably avoid those issues is having a pause after
each usb control message. In approx. 200 boot cycles no more timeouts
were seen.

Addionaly, keep USB_QUIRK_DELAY_INIT as it turned out to be necessary
to have the delay in hub_port_connect() after hub_port_init().

The overall boot time seems not to be influenced by these additional
delays, even on fast machines and lightweight distributions.

Fixes: de3af5bf259d ("usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard")
Cc: stable@vger.kernel.org
Signed-off-by: Danilo Krummrich <danilokrummrich@dk-develop.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agousbip: vudc: fix null pointer dereference on udc->lock
Colin Ian King [Thu, 22 Feb 2018 17:39:17 +0000 (17:39 +0000)]
usbip: vudc: fix null pointer dereference on udc->lock

commit df3334c223a033f562645712e832ca4cbb326bbf upstream.

Currently the driver attempts to spin lock on udc->lock before a NULL
pointer check is performed on udc, hence there is a potential null
pointer dereference on udc->lock.  Fix this by moving the null check
on udc before the lock occurs.

Fixes: ea6873a45a22 ("usbip: vudc: Add SysFS infrastructure for VUDC")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoUSB: storage: Add JMicron bridge 152d:2567 to unusual_devs.h
Teijo Kinnunen [Thu, 1 Mar 2018 17:34:29 +0000 (19:34 +0200)]
USB: storage: Add JMicron bridge 152d:2567 to unusual_devs.h

commit 5126a504b63d82785eaece3a9c30c660b313785a upstream.

This USB-SATA controller seems to be similar with JMicron bridge
152d:2566 already on the list. Adding it here fixes "Invalid
field in cdb" errors.

Signed-off-by: Teijo Kinnunen <teijo.kinnunen@code-q.fi>
Cc: stable@vger.kernel.org
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ashmem: Fix lockdep issue during llseek
Joel Fernandes [Fri, 16 Feb 2018 19:02:01 +0000 (11:02 -0800)]
staging: android: ashmem: Fix lockdep issue during llseek

commit cb57469c9573f6018cd1302953dd45d6e05aba7b upstream.

ashmem_mutex create a chain of dependencies like so:

(1)
mmap syscall ->
  mmap_sem ->  (acquired)
  ashmem_mmap
  ashmem_mutex (try to acquire)
  (block)

(2)
llseek syscall ->
  ashmem_llseek ->
  ashmem_mutex ->  (acquired)
  inode_lock ->
  inode->i_rwsem (try to acquire)
  (block)

(3)
getdents ->
  iterate_dir ->
  inode_lock ->
  inode->i_rwsem   (acquired)
  copy_to_user ->
  mmap_sem         (try to acquire)

There is a lock ordering created between mmap_sem and inode->i_rwsem
causing a lockdep splat [2] during a syzcaller test, this patch fixes
the issue by unlocking the mutex earlier. Functionally that's Ok since
we don't need to protect vfs_llseek.

[1] https://patchwork.kernel.org/patch/10185031/
[2] https://lkml.org/lkml/2018/1/10/48

Acked-by: Todd Kjos <tkjos@google.com>
Cc: Arve Hjonnevag <arve@android.com>
Cc: stable@vger.kernel.org
Reported-by: syzbot+8ec30bb7bf1a981a2012@syzkaller.appspotmail.com
Signed-off-by: Joel Fernandes <joelaf@google.com>
Acked-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: fix comedi_nsamples_left.
Frank Mori Hess [Thu, 15 Feb 2018 20:13:42 +0000 (15:13 -0500)]
staging: comedi: fix comedi_nsamples_left.

commit a42ae5905140c324362fe5036ae1dbb16e4d359c upstream.

A rounding error was causing comedi_nsamples_left to
return the wrong value when nsamples was not a multiple
of the scan length.

Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Frank Mori Hess <fmh6jj@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>