Commit Graph

602001 Commits

Author SHA1 Message Date
Zheng Yang
6d29956712 drm/rockchip: hdmi: correct 3328 hdmi phy power up timing
According to spec, TMDS driver should power up between PLL
power up and PLL lock.

There is an mistake of pdata en register, the real register
is reg2 bit0, not reg1 bit0.

Change-Id: I9d2b707cbcfd70b63f4a1a277a85f21b62643d2e
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-06-15 16:13:52 +08:00
Mark Yao
fec2638631 drm/rockchip: logo: restore display if show logo failed
Change-Id: I554eaff439b6cd13770fb81ec5c9df6693e17f29
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-06-15 14:30:05 +08:00
Huibin Hong
13dbe2cccd dmaengine: pl330: _loop_cyclic supports unaligned size
Change-Id: If724fb0c414edc13bba94def8da78c28a4cec69a
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2017-06-14 15:16:27 +08:00
Mark Yao
344aecd419 drm/rockchip: vop: correct clk_set_parent return value check
Change-Id: I3da501169739759426c83a3b7e6e255c717e226c
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-06-14 09:33:33 +08:00
Mark Yao
28c41da269 drm/rockchip: vop: get rid of max_output.height check
Actually vop hardware has no output height limit, so no
need limit display with max_output.height

Change-Id: Ide70cb28af9a23c1a12c068168b13aac37041b28
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-06-14 09:33:21 +08:00
Zheng Yang
79300b3d8b ARM64: dts: rk3328-evb: set hdmi ddc clock rate to 50KHz
Change-Id: I59bc54a17d697e742a3753baba692f3541f742e4
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-06-14 09:32:56 +08:00
Zorro Liu
7943fd79ea driver: mpu: to support mpu6881/mpu6880
Change-Id: I731788cd35d27d2aab946ccb22f744aad85f7be3
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2017-06-14 09:29:49 +08:00
Zorro Liu
03078e9fda ARM64: dts: rk3368-p9: set sleep mode config RKPM_SLP_ARMOFF
Change-Id: I65b87a37f029e316cf048bf7da790d51a046cca2
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2017-06-13 15:02:25 +08:00
Zorro Liu
4b173392a9 ARM64: dts: rockchip: enable rockchip_suspend node of rk3368-p9 and rk3368-sheep board
Change-Id: Iff11ec889c372f279cf638ff2f3f2b72824abd4c
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2017-06-13 09:42:57 +08:00
Mark Yao
3be9021fbf arm64: dts: rockchip: enable dp for rk3399 evb rev3 board
Change-Id: I91043fd5caa8a639844658cc0410372785b1c43d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-06-13 09:42:14 +08:00
Mark Yao
0cad3bf680 arm64: dts: rockchip: rk3399: add dclk pll sources
Change-Id: I0e29d67d5e3738b18a7407a049d216f8dcebb8e8
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-06-13 09:22:47 +08:00
Mark Yao
8d15b6afd8 Documentation: dt-bindings: rockchip: introduce dclk_source
Change-Id: Iee4d40ede334f418fd4edb51319b5e03f25467c0
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-06-13 09:22:32 +08:00
Mark Yao
4ac76ab5fc Documentation: dt-bindings: rockchip: introduce display plls
Change-Id: Ifa7129bc5dd625c7f78040b0d506930be24c5aa0
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-06-13 09:21:06 +08:00
Mark Yao
10a90aa97e drm/rockchip: support setting specail pll for hdmi
In order to get lower jitter clock for hdmi tmds, Hardware
design that: direct get tmds clock from vpll, bypass vop.

This design can make hdmi good works, but also limit hdmi's
clock source, the vop which hdmi use need also assign to vpll,
and use same clock rate, it's hardware limitation.

This patch add a mechanism to select dclk's parent pll, then
can allocate correct pll for hdmi.

Change-Id: I9e3b4b6d3756c409782df0605706be4203d69a32
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Suggested-by: Heiko Stuebner <heiko@sntech.de>
2017-06-13 09:20:59 +08:00
Zorro Liu
c9ead04887 driver: sensor: ak09911: to match hal code, compatible with ak8963
Change-Id: Ia5768a4466512063948c48c2139356522a4557ac
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2017-06-12 18:56:03 +08:00
Huibin Hong
5f638786e6 dmaengine: pl330: redefine the cyclic transfer
dmaengine_prep_dma_cyclic, to use buf_addr with size buf_len,
generate an interrupt every period_len. But DMA must restart
every period_len, it may be blocked. If i2s use it, it may
cause sound break. Infiniteloop is helpful to solve this
issue. In infiniteloop mode, when DMA transfers all buf_len
data, it goes back to the start of buf_addr and continue to
transfer endless.

Change-Id: Ibbc92c416d0a9dd58633e7991176c86300c3da98
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2017-06-12 11:01:10 +08:00
William Wu
01e1edeadc arm64: dts: rockchip: config dr_mode as otg for usb on rk3328-evb
Because we have supported to force otg mode for rk3328 in the commit
2b9b897141f1 ("phy: rockchip-inno-usb2: support to force otg mode"),
so let's config dr_mode as otg for usb otg port, and then user can
use otg peripheral mode and host mode as needed.

Change-Id: I6f55fb2aad1b8c49498af829475a8b59215251e5
Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-06-12 10:57:03 +08:00
William Wu
1c4fdac604 arm: dts: rk322x-android: add otg vbus gpio for usb2 phy0
This patch adds otg vbus gpio for usb2 phy0, and then we
can control otg vbus for otg host mode.

Change-Id: I685060270f9cb0963931a84035cad7286d99a469
Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-06-12 10:56:48 +08:00
William Wu
432166cbd5 phy: rockchip-inno-usb2: support to force otg mode
This patch creates an usb2 phy attribute group and
provides an attribute "otg_mode" for otg port to
force otg mode independently of the voltage of otg
id pin.

In order to implement the force mode function, we can
select otg plug indicator output (AKA iddig) from GRF,
and set GRF USB otg plug indicator to "0" or "1" to
control iddig status.

We only support rk322x/rk3328 to force otg mode for
the time being.

And we need to disable usb auto suspend function if
we want to force otg mode. Add 'usbcore.autosuspend=-1'
in cmdline to disable usb auto suspend.

Usage:
[1] Force host mode
    echo host > /sys/devices/platform/<u2phy dev name>/mode

[2] Force peripheral mode
    echo peripheral > /sys/devices/platform/<u2phy dev name>/mode

[3] Force otg mode
    echo otg > /sys/devices/platform/<u2phy dev name>/mode

Legacy Usage:
[1] Force host mode
    echo 1 > /sys/devices/platform/<u2phy dev name>/mode

[2] Force peripheral mode
    echo 2 > /sys/devices/platform/<u2phy dev name>/mode

[3] Force otg mode
    echo 0 > /sys/devices/platform/<u2phy dev name>/mode

Change-Id: I875b60b0390e3bd9af34b740cba8f5d53e1df752
Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-06-12 10:56:37 +08:00
WeiYong Bi
d0c7b9b0a7 dt-bindings: display: screen-timing: add physical size for h546dlb01
Change-Id: I51ba6c2bdacddbc16dbf79df1f36ef6f09340989
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
2017-06-09 15:45:11 +08:00
William Wu
39ba832e83 phy: rockchip-inno-usb2: fix possibe deadlock
The commit 611ec35fa1 ("phy: rockchip-inno-usb2: fix some
race conditions") use mutex lock to protect charger detect
work, but it will cause the following possible deadlock.

[ INFO: possible circular locking dependency detected ]
4.4.66 #563 Not tainted
-------------------------------------------------------
kworker/3:1/145 is trying to acquire lock:
(&rport->mutex){+.+...}, at: [<ffffff80083f286c>] rockchip_chg_detect_work+0x6c/0x3d0

but task is already holding lock:
((&(&rport->chg_work)->work)){+.+...}, at: [<ffffff80080be6e4>] process_one_work+0x1c4/0x6ac

which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:

-> #1 ((&(&rport->chg_work)->work)){+.+...}:
[<ffffff80080fda40>] __lock_acquire+0x15c0/0x195c
[<ffffff80080fe5e8>] lock_acquire+0x190/0x250
[<ffffff80080bf534>] flush_work+0x4c/0x274
[<ffffff80080bf944>] __cancel_work_timer+0x130/0x1c0
[<ffffff80080bf9fc>] cancel_delayed_work_sync+0x10/0x18
[<ffffff80083f17a8>] rockchip_usb2phy_exit+0x54/0x6c
[<ffffff80083f07ac>] phy_exit+0x64/0xb4
[<ffffff8008772810>] dwc3_core_exit+0x44/0x98
[<ffffff80087728b0>] dwc3_suspend_common+0x4c/0x5c
[<ffffff8008772a68>] dwc3_runtime_suspend+0x38/0x5c
[<ffffff8008571784>] pm_generic_runtime_suspend+0x28/0x38
[<ffffff8008573464>] __rpm_callback+0x40/0x74
[<ffffff80085734f4>] rpm_callback+0x5c/0x80
[<ffffff8008573bc4>] rpm_suspend+0x31c/0x688
[<ffffff80085751ec>] __pm_runtime_suspend+0x58/0xa4
[<ffffff800877efc0>] dwc3_rockchip_probe+0x3f8/0x574
[<ffffff800856bcd0>] platform_drv_probe+0x58/0xa4
[<ffffff8008569bb0>] driver_probe_device+0x118/0x2b0
[<ffffff8008569e9c>] __device_attach_driver+0x88/0x98
[<ffffff8008567f4c>] bus_for_each_drv+0x7c/0xac
[<ffffff80085699e4>] __device_attach+0xa8/0x128
[<ffffff800856a00c>] device_initial_probe+0x10/0x18
[<ffffff8008569000>] bus_probe_device+0x2c/0x90
[<ffffff800856948c>] deferred_probe_work_func+0x78/0xa8
[<ffffff80080be858>] process_one_work+0x338/0x6ac
[<ffffff80080bfd54>] worker_thread+0x300/0x428
[<ffffff80080c5758>] kthread+0x104/0x10c
[<ffffff8008083080>] ret_from_fork+0x10/0x50

-> #0 (&rport->mutex){+.+...}:
[<ffffff80080faacc>] print_circular_bug+0x64/0x2c4
[<ffffff80080fd70c>] __lock_acquire+0x128c/0x195c
[<ffffff80080fe5e8>] lock_acquire+0x190/0x250
[<ffffff8008c67ac0>] mutex_lock_nested+0x80/0x3d0
[<ffffff80083f286c>] rockchip_chg_detect_work+0x6c/0x3d0
[<ffffff80080be858>] process_one_work+0x338/0x6ac
[<ffffff80080bfd54>] worker_thread+0x300/0x428
[<ffffff80080c5758>] kthread+0x104/0x10c
[<ffffff8008083080>] ret_from_fork+0x10/0x50

other info that might help us debug this:

Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock((&(&rport->chg_work)->work));
                                lock(&rport->mutex);
                                lock((&(&rport->chg_work)->work));
   lock(&rport->mutex);

  *** DEADLOCK ***

2 locks held by kworker/3:1/145:

stack backtrace:
CPU: 3 PID: 145 Comm: kworker/3:1 Not tainted 4.4.66 #563
Hardware name: Rockchip RK3399 Evaluation Board v3 (Android) (DT)
Workqueue: events rockchip_chg_detect_work
Call trace:
[<ffffff800808a814>] dump_backtrace+0x0/0x1c8
[<ffffff800808a9f0>] show_stack+0x14/0x1c
[<ffffff80083c1fa0>] dump_stack+0xb0/0xec
[<ffffff80080fad10>] print_circular_bug+0x2a8/0x2c4
[<ffffff80080fd70c>] __lock_acquire+0x128c/0x195c
[<ffffff80080fe5e8>] lock_acquire+0x190/0x250
[<ffffff8008c67ac0>] mutex_lock_nested+0x80/0x3d0
[<ffffff80083f286c>] rockchip_chg_detect_work+0x6c/0x3d0
[<ffffff80080be858>] process_one_work+0x338/0x6ac
[<ffffff80080bfd54>] worker_thread+0x300/0x428
[<ffffff80080c5758>] kthread+0x104/0x10c
[<ffffff8008083080>] ret_from_fork+0x10/0x50

Change-Id: I4289afb05d334bf79000090f9071cf428817a583
Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-06-08 10:47:10 +08:00
Hans Yang
3d61b6578e arm64: rockchip_linux_defconfig: enable MPP_SERVICE
Change-Id: I12cb15a44e31f768bac960e3a5e6b9371d221ed3
Signed-off-by: Hans Yang <yhx@rock-chips.com>
2017-06-07 20:48:48 +08:00
Mark Yao
333b831b9e drm/rockchip: limit gem buffer to 32bit mapping
Change-Id: I64537668aa10a2e26bdd19ac79bc417aa6c4a437
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-06-07 14:15:16 +08:00
Mark Yao
7330eff972 drm: support loader protect for panel
Change-Id: Ie9330e3380a4925a4b7603e7206f1e0d186d2156
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-06-07 14:13:35 +08:00
Jung Zhao
8079a0e4f9 ARM64: dts: rk3328-evb: enable vepu & h265e default
Change-Id: I94685dbeea3ceffa106593ff597f50404f58f34a
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-06-07 12:06:03 +08:00
Jung Zhao
18661920f9 ARM64: dts: rk3328: add vepu & h265e dts node
Change-Id: I2990ac7e43d4b2d2efbf5e9cf3abe124e8767648
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-06-07 12:05:39 +08:00
Jung Zhao
fbf80c017b driver: video: rockchip: add new driver of vpu
this driver only support h264e & h265e. if you want to
enable the driver, you must modify the menuconfig and
turn on MPP_SERVICE & MPP_DEVICE.

Change-Id: I7f1c6e473eaf7aedb4fa86791412b5fbcb2c531d
Signed-off-by: buluess.li <buluess.li@rock-chips.com>
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-06-07 12:05:34 +08:00
Huang, Tao
ad2fc3b29a LSK 17.05 v4.4-android
-----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlkwRwUTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0JgUB/9BulgrQKBSNWNtaqmvqiY/YmzSvBLd
 F+PBqy+1Gywy7vlXUNg9/y1gyCVewBgw7scIQ//cW6cJeu1cwsG50qoaWm9GsuNz
 eQXRKwvLx7y9rG4qdIJm2DV+uhEi3Yv8+AXBfVf8LlRGdgo6kyvNBvG9Fx+diXQg
 LqpqcG+wFsIe+nqFVoGn4yHB/1EHovRGWrOJHoPOsr9vzeDQOZwxJN73Z087ZYa9
 OWcwGngv5BNQcybt3GG71hmBgzTeA3lnayVM9heT6zPl5xpx+boTzv6CxuLMD8cs
 +8i1c3jTin9xvS8hh3qSNh9y8lLNjdNX8D/5ZvoYnGLCRRMeHylUJP7W
 =dKU9
 -----END PGP SIGNATURE-----

Merge tag 'lsk-v4.4-17.05-android' of git://git.linaro.org/kernel/linux-linaro-stable.git

LSK 17.05 v4.4-android

* tag 'lsk-v4.4-17.05-android': (266 commits)
  BACKPORT: mm/slab: clean up DEBUG_PAGEALLOC processing code
  Linux 4.4.70
  UPSTREAM: arm64: hibernate: Support DEBUG_PAGEALLOC
  BACKPORT: arm64: vmlinux.ld: Add mmuoff data sections and move mmuoff text into idmap
  BACKPORT: arm64: Create sections.h
  ANDROID: uid_sys_stats: defer io stats calulation for dead tasks
  ANDROID: AVB: Fix linter errors.
  ANDROID: AVB: Fix invalidate_vbmeta_submit().
  drivers: char: mem: Check for address space wraparound with mmap()
  nfsd: encoders mustn't use unitialized values in error cases
  drm/edid: Add 10 bpc quirk for LGD 764 panel in HP zBook 17 G2
  PCI: Freeze PME scan before suspending devices
  PCI: Fix pci_mmap_fits() for HAVE_PCI_RESOURCE_TO_USER platforms
  tracing/kprobes: Enforce kprobes teardown after testing
  osf_wait4(): fix infoleak
  genirq: Fix chained interrupt data ordering
  uwb: fix device quirk on big-endian hosts
  metag/uaccess: Check access_ok in strncpy_from_user
  metag/uaccess: Fix access_ok()
  iommu/vt-d: Flush the IOTLB to get rid of the initial kdump mappings
  ...
2017-06-07 10:03:03 +08:00
Huang, Tao
d7f4e179e3 Revert "UPSTREAM: pinctrl: rockchip: avoid hardirq-unsafe functions in irq_chip"
This reverts commit a8b4e18cf1.

Which will cause such error:

BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620
in_atomic(): 1, irqs_disabled(): 128, pid: 141, name: irq/95-fusb302
1 lock held by irq/95-fusb302/141:
 #0:  (&(&chip->irq_lock)->rlock){......}, at: [<ffffff800859e3a0>] fusb_irq_disable+0x20/0x68
irq event stamp: 52
hardirqs last  enabled at (51): [<ffffff80080bcc30>] queue_work_on+0x68/0x80
hardirqs last disabled at (52): [<ffffff8008c6f41c>] _raw_spin_lock_irqsave+0x20/0x60
softirqs last  enabled at (0): [<ffffff800809e9ec>] copy_process.isra.54+0x390/0x1728
softirqs last disabled at (0): [<          (null)>]           (null)
Preemption disabled at:[<ffffff800859e3a0>] fusb_irq_disable+0x20/0x68

CPU: 5 PID: 141 Comm: irq/95-fusb302 Not tainted 4.4.70 #30
Hardware name: Rockchip RK3399 Evaluation Board v3 (Android) (DT)
Call trace:
[<ffffff800808a82c>] dump_backtrace+0x0/0x1c4
[<ffffff800808aa04>] show_stack+0x14/0x1c
[<ffffff80083c3b90>] dump_stack+0xa8/0xe0
[<ffffff80080cf560>] ___might_sleep+0x214/0x224
[<ffffff80080cf5e4>] __might_sleep+0x74/0x84
[<ffffff8008c6c1ac>] mutex_lock_nested+0x48/0x3cc
[<ffffff80083fe2b0>] rockchip_irq_bus_lock+0x28/0x34
[<ffffff800810b680>] __irq_get_desc_lock+0x68/0x88
[<ffffff800810d558>] __disable_irq_nosync+0x28/0x70
[<ffffff800810d5ac>] disable_irq_nosync+0xc/0x14
[<ffffff800859e3b4>] fusb_irq_disable+0x34/0x68
[<ffffff800859e410>] cc_interrupt_handler+0x28/0x38
[<ffffff800810cd48>] irq_thread_fn+0x28/0x68
[<ffffff800810cf80>] irq_thread+0x130/0x234
[<ffffff80080c58e8>] kthread+0x104/0x10c
[<ffffff8008083080>] ret_from_fork+0x10/0x50

or

BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620
in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper/0
INFO: lockdep is turned off.
irq event stamp: 111558
hardirqs last  enabled at (111557): [<ffffff8008116cdc>] rcu_idle_exit+0x70/0x80
hardirqs last disabled at (111558): [<ffffff80080f1078>] cpu_startup_entry+0xc0/0x42c
softirqs last  enabled at (111554): [<ffffff80080a6794>] _local_bh_enable+0x3c/0x44
softirqs last disabled at (111553): [<ffffff80080a7000>] irq_enter+0x28/0x64
Preemption disabled at:[<ffffff80080f1308>] cpu_startup_entry+0x350/0x42c

CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.70 #30
Hardware name: Rockchip RK3399 Evaluation Board v3 (Android) (DT)
Call trace:
[<ffffff800808a82c>] dump_backtrace+0x0/0x1c4
[<ffffff800808aa04>] show_stack+0x14/0x1c
[<ffffff80083c3b90>] dump_stack+0xa8/0xe0
[<ffffff80080cf560>] ___might_sleep+0x214/0x224
[<ffffff80080cf5e4>] __might_sleep+0x74/0x84
[<ffffff8008c6c1ac>] mutex_lock_nested+0x48/0x3cc
[<ffffff80083fe2b0>] rockchip_irq_bus_lock+0x28/0x34
[<ffffff800810b680>] __irq_get_desc_lock+0x68/0x88
[<ffffff800810d558>] __disable_irq_nosync+0x28/0x70
[<ffffff800810d5ac>] disable_irq_nosync+0xc/0x14
[<ffffff8008621f20>] bcmsdh_oob_intr_set+0x4c/0x6c
[<ffffff8008621f5c>] wlan_oob_irq+0x1c/0x38
[<ffffff800810bd28>] handle_irq_event_percpu+0x150/0x3e8
[<ffffff800810c004>] handle_irq_event+0x44/0x74
[<ffffff800810f53c>] handle_level_irq+0xe4/0x11c
[<ffffff800810b228>] generic_handle_irq+0x1c/0x2c
[<ffffff80083fe068>] rockchip_irq_demux+0xe0/0x188
[<ffffff800810b228>] generic_handle_irq+0x1c/0x2c
[<ffffff800810b5b0>] __handle_domain_irq+0xb0/0xec
[<ffffff8008080f70>] gic_handle_irq+0xbc/0x154

Change-Id: I7cfbeaf7df17fc4e923e89917199b7f1c773455a
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-06-06 20:52:45 +08:00
Huibin Hong
246c0c358b arm64: dts: rk3328: dmac: add peripherals-req-type-burst
Change-Id: I097e13f3e9e88c5624bcd67eaaf66d773465939b
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2017-06-06 18:41:52 +08:00
Huibin Hong
fb0701f288 ARM: dts: rk3xxx: dmac: add peripherals-req-type-burst
Change-Id: Iab3df00b2d228498d059ef2ede8d2ed0e598f408
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2017-06-06 18:41:16 +08:00
Huibin Hong
0bdbf07305 ARM: dts: rk322x: dmac: add peripherals-req-type-burst
Change-Id: I2a748a2a7a5b00a2c7ff116bac7358d6267cb45f
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2017-06-06 18:40:48 +08:00
Huibin Hong
3ba912a65a ARM: dts: rk312x: dmac: add quirks
1. arm,pl330-broken-no-flushp
2. peripherals-req-type-burst

Change-Id: I33a357e10a011b5c22fb8aa7c8362fa20f051d66
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2017-06-06 18:39:56 +08:00
Sugar Zhang
e5c89b56c9 ASoC: rockchip: i2s: fixup clk div
we found mclk maybe not precise as required because of PLL,
but it still can be used and no side effect. for example, if we
require mclk 11289600, but get 11289598, it doesn't matter.
so using DIV_ROUND_CLOSEST to fix it.

Change-Id: If8453a7a08b319da81b07d572b02247bd7e7bd27
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2017-06-06 17:53:12 +08:00
Randy Li
dc10d872c6 arm64: dts: rockchip: enable video decoder for RK3328 EVB
This commit would enable the VDPU and RKVDEC devices.
The VDPU works in the non combo mode.

Change-Id: I643350d5a2ac17759984fda2e95fb2b82701e7cf
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-06-06 17:45:31 +08:00
Randy Li
027e3c027c video: rockchip: vpu: introduce safe reset method
Even the same type video IP would request a different numbers
of reset control.

From the RK3328 times, the video IP also request decrease the
frequency of the clock to lower than 300 MHZ before resetting.
It seems no hard to apply it into the previous platform.

Change-Id: Iacf1accf24c8776bb8b425b613e6e34215380203
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-06-06 17:44:31 +08:00
Randy Li
c1ac5c0b58 arm64: dts: rockchip: add video decoder nodes on rk3328
Jung and I meet some problem the video decoder, so
we just release the VDPU standalone this time.

It seems that the iommu can't attach to two different
IP at the same time.

Change-Id: I24d73cd5ab2c3d32da6ef29661061c7fda9186f2
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-06-06 17:42:08 +08:00
Shawn Lin
4b69e38ee1 ARM: dts: rockchip: enable sdmmc and sdio for rk322x-android
Change-Id: Ibed59e1bded5e81dd2f84438d3fa16a3dc0a1ba1
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2017-06-06 17:26:39 +08:00
Shawn Lin
5719cafede ARM: dts: rockchip: add sdmmc and sdio nodes for rk3228 SoC
Change-Id: I50309e972b9c606782195b91d1f034f1336af0cd
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2017-06-06 17:22:19 +08:00
Shawn Lin
b3fded18f0 ARM: dts: rockchip: fix compatible string for eMMC node of rk3228 SoC
Change-Id: I2ee59491c79dd0e8a201f6478c6ca40cb8437e42
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2017-06-06 17:17:31 +08:00
Shawn Lin
6949ac7ae1 Documentation: rockchip-dw-mshc: add description for rk3228
Add "rockchip,rk3228-dw-mshc", "rockchip,rk3288-dw-mshc" for
dwmmc on rk322x platform.

Change-Id: I8217d237260a33ce5b115080cf4d41ad4a5733e8
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2017-06-06 17:15:15 +08:00
wlq
f14eb450b1 arm64: dts: rk3399: sapphire: enabled dp default
Change-Id: Icfdea500e35164c90c75c9b538285a2a9691cbb6
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2017-06-06 15:09:09 +08:00
WeiYong Bi
1f10be20b7 clk: rockchip: rk3228: add more flags for dclk_vop
Change-Id: Ie5838b20f419d667831e7d99f4b95856731ef0ef
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
2017-06-06 15:08:27 +08:00
WeiYong Bi
7df0bff9b6 clk: rockchip: rk3228: export hdmiphy clock
Change-Id: Ib7acd4c2f576ad320e069ab2bd9137156062e2d9
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
2017-06-06 15:08:21 +08:00
Sugar Zhang
e20f9f299f arm64: dts: rk3328-evb: enable hdmi audio
Change-Id: Ic67744ac5554b90b6d9f85eeedf4721562f8155f
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2017-06-06 15:01:53 +08:00
William Wu
611ec35fa1 phy: rockchip-inno-usb2: fix some race conditions
There are some race conditions related to phy power on/off
and otg charger detection work, otg sm work. I can find at
least three race conditions at present.

Race condition[1]:
The first race condition involving phy power on/off which
may be caused by the following case.

Test on rk3399 evaluation board Type-C0, connect to PC usb
port with Type-C cable, then phy power on/off operation may
be done twice because of race condition between phy driver
and usb controller driver.

CPU 0:
- rockchip_usb2phy_bvalid_irq()
 - rockchip_usb2phy_otg_sm_work()
  - detect connect to PC usb, do phy power on
   - rockchip_usb2phy_power_on()

CPU 1:
- dwc3 driver do runtime resume process
 - dwc3_runtime_resume()
  - dwc3_core_init()
   - phy_power_on()
    - rockchip_usb2phy_power_on()

Although we use a suspended flag in rockchip_usb2phy_power_on()
to avoid doing the same things twice, but it's not enough to
prevent race condition if phy driver and usb controller driver
access the rockchip_usb2phy_power_on() at the same time. This
race condition may cause clk management unbalanced.

Race condition[2]:
The second race condition related to phy power on/off and otg
charger detection work. We need to keep the usb phy staying in
suspend mode when do usb charger detection. But now it don't
have any protection to prevent the other threads to operate phy
during charger detection.

The problem can also be easily reproduced on rk3399 evaluation
board Type-C0 when connect to PC usb port with Type-C cable.

CPU 0:
- rockchip_chg_detect_work()
 - power off phy and start to do charge detection work

CPU 1:
- dwc3 driver do runtime resume process
 - dwc3_runtime_resume()
  - dwc3_core_init()
   - phy_power_on()
    - power on phy again

This race condition may cause charger detection and later usb
enumeration abnormally.

Race condition[3]:
The third race condition involving otg sm work. The otg sm
work can be interrupted by bvalid irq, and the bvalid irq
handler rockchip_usb2phy_bvalid_irq() will do otg sm work,
which may cause unknown error.

This patch uses mutex lock to protect the phy operations,
otg charger detection work and otg sm work.

Change-Id: Ic6845a10b3e69fe9ae6cf0b2d4e2beb098232abd
Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-06-06 10:57:13 +08:00
Mark Yao
422cba4c87 Revert "drm/rockchip: vop: round_up pitches to word align"
This reverts commit 7e705c4974eaa8abaf44cb1542d3ec49d520fde8.

Change-Id: I498ade43de012f65ea39624bd2982b4a84bcbf54
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-06-05 18:36:29 +08:00
Mark Yao
bfdc50442e drm/rockchip: logo: round_up pitches to word align
Change-Id: I836193ca37fb62c72c61aa47a807959c3c189925
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-06-05 18:36:07 +08:00
Mark Yao
e6205bfe9b drm/rockchip: logo: use unique plane property logo mirror
The logo framework use state->rotation may conflict to common drm
update, cause display abnormal

Change-Id: I09b6b898a7606cd05371af1f4b25254945923d0d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-06-05 18:35:57 +08:00
Elaine Zhang
a688f6ff44 UPSTREAM: clk: rockchip: mark some special clk as critical on rk3368
The jtag clk no driver to handle them.
But this clk need enable,so make it as critical.

The ddrphy/ddrupctl clks no driver to handle them,
Chip design requirements for these clock to always on,

The pmu_hclk_otg0 is Chip design defect, must be always on,

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git.kernel.org mmind/linux-rockchip.git v4.13-clk/next
 commit 223c24be74)

Conflicts:
	drivers/clk/rockchip/clk-rk3368.c

Change-Id: I31c1c7efb7a83652501a7f53ff5931d9f308f736
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-06-05 16:12:36 +08:00