Commit Graph

844167 Commits

Author SHA1 Message Date
Wu Liangqing
54ee490c04 arm64: dts: rockchip: rk3399-sapphire-excavator-edp: enable hdmi
Change-Id: I3ffcaa564dae9a56c9e4ee3b496c6a55f688be01
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2019-10-08 10:34:16 +08:00
Ren Jianing
b095510d34 arm64: dts: rockchip: Fix usb host can't connect on rk3399-excavator
The previous dtsi set the wrong vbus control GPIO.

Change-Id: Ie5b4062873483a167b5a6ed47bb9dde209124d3f
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
2019-10-08 10:28:11 +08:00
Sugar Zhang
c8e2fd2ca9 soc: rockchip: power-domain: Fix rockchip_pd_keepon_release crash
Change-Id: I6449e06ec7e8680ce94a197e10b9fa67cc62050e
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2019-09-30 19:37:22 +08:00
Tao Huang
ca50cb058e ASoC: rockchip: pdm: Fix compile warning
sound/soc/rockchip/rockchip_pdm.c: In function 'rockchip_pdm_hw_params':
sound/soc/rockchip/rockchip_pdm.c:179:3: warning: 'clk_out' may be used uninitialized in this function [-Wmaybe-uninitialized]

Change-Id: I10b240781043a61ce365e6349a102b625db433c7
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-09-30 18:17:14 +08:00
Elaine Zhang
d6ecef678c regulator: rk809 & rk817: fix up the is_enable return error
mark rk8xx_is_enabled_wmsk_regmap as is_enable callback func for switch ops.

Change-Id: Id54b6181fd8a39fa51607322c69dc9f5da18593a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-09-30 11:15:17 +08:00
Shengfei Xu
8da4ebf85d arm: dts: rk3288: add rockchip-suspend node
Change-Id: Id5700548a6034248ed5ad3226dd652d0833eec13
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
2019-09-30 11:01:37 +08:00
Shengfei Xu
ebee13ef24 mfd: rk808: adjust sleep pin operation sequence for rk817/rk809
operation sequence of the sleep pin working mode:
1. isable sleep pin function.
2. set sleep pin polarity.
3. enable the mode.

Change-Id: I54b12ac07a64433dbe5c6167658e815c3275d105
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
2019-09-30 10:53:26 +08:00
Sandy Huang
9679919e6f drm/rockchip: vop: fix memory double free when resume
[   58.656266] BUG: KASAN: double-free or invalid-free in
vop_atomic_plane_reset+0x4c/0x90
[   58.656276]
[   58.656297] CPU: 2 PID: 1631 Comm: Binder:269_2 Not tainted 4.19.53
[   58.656308] Hardware name: Rockchip rk3326 evb board (DT)
[   58.656322] Call trace:
[   58.656343]  dump_backtrace+0x0/0x150
[   58.656356]  show_stack+0x14/0x1c
[   58.656376]  dump_stack+0x90/0xb0
[   58.656395]  print_address_description+0x64/0x250
[   58.656409]  kasan_report_invalid_free+0x74/0xb0
[   58.656423]  __kasan_slab_free+0xe4/0x204
[   58.656432]  kasan_slab_free+0x10/0x18
[   58.656446]  kfree+0xfc/0x270
[   58.656460]  vop_atomic_plane_reset+0x4c/0x90
[   58.656477]  drm_mode_config_reset+0x90/0x170
[   58.656491]  drm_atomic_helper_resume+0x54/0x140
[   58.656502]  rockchip_drm_sys_resume+0x6c/0xd0
[   58.656522]  platform_pm_resume+0x2c/0x54
……
[   58.656777] Allocated by task 320:
[   58.656795]  kasan_kmalloc.part.4+0x48/0xf4
[   58.656808]  kasan_kmalloc+0x8c/0xa0
[   58.656821]  kasan_slab_alloc+0x14/0x1c
[   58.656834]  __kmalloc_track_caller+0x1c8/0x2b8
[   58.656850]  kmemdup+0x28/0x50
[   58.656861]  vop_atomic_plane_duplicate_state+0x34/0x84
[   58.656881]  drm_atomic_get_plane_state+0x80/0x114
[   58.656895]  drm_atomic_set_property+0x424/0x6c8
[   58.656909]  drm_mode_atomic_ioctl+0x47c/0xac4
[   58.656929]  drm_ioctl_kernel+0x80/0xe4
[   58.656941]  drm_ioctl+0x26c/0x394
[   58.656958]  drm_compat_ioctl+0x3c/0xd4
……
[   58.657035] Freed by task 1631:
[   58.657050]  __kasan_slab_free+0x140/0x204
[   58.657060]  kasan_slab_free+0x10/0x18
[   58.657072]  kfree+0xfc/0x270
[   58.657088]  drm_atomic_helper_plane_reset+0x24/0x70
[   58.657101]  vop_atomic_plane_reset+0x1c/0x90
[   58.657116]  drm_mode_config_reset+0x90/0x170
[   58.657129]  drm_atomic_helper_resume+0x54/0x140
[   58.657142]  rockchip_drm_sys_resume+0x6c/0xd0
[   58.657159]  platform_pm_resume+0x2c/0x54

Change-Id: I46d80ac0d90054dac1c2787a2733d964d253d1fb
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-09-30 10:47:02 +08:00
Lin Jinhan
c1489ff5ae crypto: rockchip - add px30 crypto aes/des support
cipher mode list:
  aes:      ecb/cbc/xts
  des/3des: ecb/cbc

Change-Id: I46e8f698a099dd9d4e9a81afb6f3a992dadfd79f
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-09-30 10:31:07 +08:00
Lin Jinhan
e107ba4be4 arm: configs: rockchip_defconfig: enable crypto rockchip
enable CONFIG_CRYPTO_DEV_ROCKCHIP_V1
enable CONFIG_CRYPTO_DEV_ROCKCHIP_V2

Change-Id: I4f801cb70fca8893fdc70332241f404760c30951
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-09-30 09:28:10 +08:00
Lin Jinhan
afe3180643 arm64: configs: rockchip_defconfig: enable crypto rockchip
enable CONFIG_CRYPTO_DEV_ROCKCHIP_V1
enable CONFIG_CRYPTO_DEV_ROCKCHIP_V2

Change-Id: Idd4a8e0df284348980c54e7bdc36324f5053e19a
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-09-30 09:27:56 +08:00
Lin Jinhan
f4bee32605 arm64: dts: rockchip: px30 add crypto node
Change-Id: Ib8026ce7dd008d303decd61c41ec26b08b8782b1
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-09-30 09:27:09 +08:00
Lin Jinhan
b98e78a05a dt-bindings: crypto: rockchip: add support for px30
Add DT bindings documentation for the px30 crypto drivers.

Change-Id: I15a7ce60cc56c5690d5d2640e78358060f4efa80
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-09-30 09:26:11 +08:00
Lin Jinhan
248a42bbfc ARM: dts: rk3288: default disable crypto node
Change-Id: Ie89f18bb91eed4f04b05253e4e917eaf882139a6
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-09-30 09:25:31 +08:00
Tao Huang
e73b082650 clk: rockchip: Fix build for rv1108
CONFIG_CPU_RV1108 should be CONFIG_CPU_RV110X

Fixes: b7a15f8858 ("clk: rockchip: build depends on CPU config")
Change-Id: I551a27bd8e76fc10fd7df4d558f3a1b04e4f53da
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-09-29 17:22:41 +08:00
Elaine Zhang
e2fd10bcb5 clk: rockchip: rk3288: mark pclk_peri as critical clk
Avoid disable the parent clock after the child clock has disabled.

Change-Id: I1ea91afe0b6bbefd3a5d8e88641e4a3af5a368a4
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-09-29 11:49:37 +08:00
Finley Xiao
379be71085 clk: rockchip: half-divider: Use DIV_ROUND_UP to round divisor values
Some divisor calculations were misrounded, causing higher than requested
rates on some clocks. Fix them up using DIV_ROUND_UP.

Change-Id: I8e68282ccfc9c46302913c0946196260ccef0701
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-09-29 11:49:21 +08:00
Elaine Zhang
49fb63bac7 clk: rockchip: rk3399: fix up the FRAC_MAX_PRATE limit for i2s and uart
I2S and UART may be application requirements higher than 30M frequency,
So increase the input frequency limit of the frac divider.
IC back-end emulation 800M is safety.

Change-Id: Ida63505b5124799ad8a64d70af4403eae121cbb8
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-09-29 11:49:02 +08:00
Wyon Bi
2cc41492f6 clk: rockchip: px30: Add CLK_SET_RATE_PARENT for clk_i2s1_out_pre
Change-Id: Ie01e78ecf49cbbc3101c7ff0fafff11d3428b271
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-09-29 11:48:39 +08:00
Finley Xiao
4a9e89e94a clk: rockchip: rk3308: Fix input rate of vop frac clock
Change-Id: Iec4e8464cb05b35c2a9493fc4907ef9b9946899e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-09-29 11:48:08 +08:00
Elaine Zhang
82c191700f clk: rockchip: rk3399: Use MUXTBL to cover Mux selects priorities
add CLK_SET_RATE_PARENT for clk_uartx_frac.

Change-Id: Ide6eab4bd76b9900a8a55f2dc3c79563fc8feda3
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-09-29 11:47:34 +08:00
Elaine Zhang
35f541c5a7 clk: rockchip: rk3308: Use MUXTBL to cover Mux selects priorities
Change-Id: I14d08f3b98b1dcaf1c9e4b9114ebd103e2dc51c9
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-09-29 11:47:12 +08:00
Elaine Zhang
2c6bab0663 clk: rockchip: add COMPOSITE_MUXTBL and MUXTBL variant
A clock branch consisting of a mux with non-standard
select values.
The parent in Mux table is sorted by priority.

Change-Id: Ibcaa35541cf8bc255175a62c7950b2241aac2f55
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-09-29 11:46:02 +08:00
Elaine Zhang
a5ba41ceff Revert "clk: rockchip: Modify uart frac divider rule"
This reverts commit aa34d0fe71.
This rule does not cover the parent priority selection problem.

Change-Id: Id75d46548e28da378420f614b45a6b71c6601843
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-09-29 11:41:42 +08:00
Elaine Zhang
abfc038343 clk: rockchip: rk1808: Fixed incorrect parameter configuration
fix up the 1G pll vco,
fix up the sdmmc gating bit.

Change-Id: I91ccc7a864e6fd1458e40965b8e5677887b8e055
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-09-29 11:41:12 +08:00
Wyon Bi
91c4d7f635 clk: rockchip: rk3128: mark the hclk_vio_h2p as critical clk
Change-Id: Ib4eb985b1c3aacf6e51d593fcf71cd46e1dc0b82
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-09-29 11:38:44 +08:00
Sandy Huang
1b5406f5db drm/rockchip: add a debug node to dump buf from application
dump path: /data/vop_buf
debug nod: d/dri/0/ff900000.vop/vop_dump/dump
echo dump    > dump to dump one frame
echo dumpon  > dump to start vop keep dumping
echo dumpoff > dump to stop keep dumping
echo dumpn   > dump n is the number of dump times
if fd err -3 try rm -r /data/vopbuf echo dump1 > dump can fix it
if fd err -28 save needed data try rm -r /data/vopbuf

Change-Id: Id5fefa428db1b5669ceae418cd8bddfa52e52f61
Signed-off-by: Shixiang Zheng <shixiang.zheng@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-09-29 10:14:56 +08:00
Huibin Hong
7b7d9ba50d spi/rockchip: add pinctrl state high_speed
Change-Id: I2c81fabab31cf5cc07590f38ae517eccd5fa93f2
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2019-09-29 09:34:26 +08:00
Yifeng Zhao
0070056a94 spi: rockchip: config spi rx dma burst size depend on xfer length
Change-Id: I54c855fc2ed4ccfbed6c011ae10bebc9829dc4d7
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-09-29 09:25:58 +08:00
Yi Liu
2c2acee8f8 spi: rockchip: support to set lsb into ROCKCHIP_SPI_CTRLR0
Change-Id: I55421b4685c88fe55c928ac7d102abb7d39e902f
Signed-off-by: Yi Liu <liuyi@rock-chips.com>
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-09-29 09:25:58 +08:00
Huibin Hong
2ed90ab27d spi: rockchip: init rxconf and txconf to 0
Dmac pl330 adds src_interlace_size of dma_slave_config rxconf.
If rxconf is local variable, src_interlace_size may be non zero,
which causes wrong process.

Fixes: ddd2e87ad4 ("dmaengine: pl330: add support for interlace size config")
Change-Id: Ib301c7ca4a1175bafd0631cb4deea4baa60eebc7
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-09-29 09:25:58 +08:00
Huibin Hong
7c15863913 spi: rockchip: set dma tx burst 8
If it is 16, and DMATDLR is 15, it would cause tx fifo
overflow.

Change-Id: I14592492be2ebd65ee47e916e25a60f0905d3eca
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-09-29 09:25:58 +08:00
Huibin Hong
87dbea63d5 spi: rockchip: set higher io driver when sclk higher than 24MHz
Change-Id: I963c92eab7f7bff0b32e2ac262aa79f0667f39ee
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-09-29 09:25:58 +08:00
Huibin Hong
e13191bf15 spi: spidev: Add rockchip spidev compatible string
Change-Id: I0ba866f7f17be3063bbe405ac9d62f83e54443a4
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-09-29 09:25:58 +08:00
Huibin Hong
269e83b6fe spi: rockchip: add compatible rockchip,px30-spi for px30
Change-Id: Ibe406477b3912b482d07e5c0e7f8e2e99a51bd4a
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-09-29 09:25:53 +08:00
Nickey Yang
62a29500ee media: rockchip: isp1: increase isp clk margin
"rkisp1: MIPI mis error:" may occur when data_rate equal
to clk_rate_tbl table and actually isp clk is less
than clk rate we set.
So increase margin to fix it.

Change-Id: Icbca32cf02fb522ad74b40adc8253863b80eaec0
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2019-09-27 16:35:24 +08:00
Shunqian Zheng
4318ff8e62 media: rockchip: rkisp1: cleanup buffers if start stream failed
This fix the warning:
[  109.292738] WARNING: at drivers/media/v4l2-core/videobuf2-core.c:1313
if start streaming failed.

Change-Id: Ieaff518836382121d0c79c86c57e90a8e6b97296
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
2019-09-27 16:35:01 +08:00
Shunqian Zheng
9533520782 media: rockchip: rkisp1: add framesizes and frmintervals ioctl
Callbacks .vidioc_enum_frameintervals() and .vidioc_enum_framesizes()
are required for applications to obtain the frame intervals and
resolutions the driver/sensor supported.

For the frame intervals, it reads the minimum one from
current linked sensor, and set maximum to 1s.
For the frame size, it's stepwise with step equals 8,
and maximum is the isp sub-device output size.

Change-Id: I840b12a165855e7275c2fbd6f28db364ca7105d8
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
2019-09-27 16:34:42 +08:00
Hu Kejun
cc8f3ee26a media: rockchip: isp1: change readx_poll_timeout to readx_poll_timeout_atomic
rkisp1_isp_stop() is called in rkisp1_isp_isr() now,
so change readx_poll_timeout in rkisp1_isp_stop() to readx_poll_timeout_atomic

Change-Id: If4cb8628e38d2c774f30d7200b0804f22d4ccc4c
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-09-27 14:54:59 +08:00
Sandy Huang
6788d8d093 drm/rockchip: rgb: Add support for Rockchip Soc RGB output interface
Some Rockchip CRTCs, like rv1108, can directly output parallel and
serial RGB data to panel or conversion chip, so we add this driver to
probe encoder and connector.

Change-Id: Ieab9271205cace962b7e871becaf903b9abebd94
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-09-27 14:14:05 +08:00
Wu Liangqing
9784385761 arm64: dts: rockchip: Add rk3399-evb-ind-lpddr4-android board
Change-Id: I3e1ff707053447244b5f39c29095ca9a729543d1
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-09-27 12:23:52 +08:00
Wu Liangqing
202a61841b arm64: dts: rockchip: rk3399: sapphire-excavator: android10 adapter
Change-Id: I74e11d8520cc23053978768a613145e545ae7311
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2019-09-27 11:29:03 +08:00
Rafael David Tinoco
ba0401694b FROMLIST: mm/zsmalloc.c: fix zsmalloc ARM LPAE support
Since commit 02390b87a9 ("mm/zsmalloc: Prepare to variable
MAX_PHYSMEM_BITS"), an architecture has to define this value in order to
guarantee that zsmalloc will be able to encode and decode the obj value
properly.

Similar to that change, this one sets the value for ARM LPAE, fixing a
possible null-ptr-deref in zs_map_object() when using ARM LPAE and
HIGHMEM pages located above the 4GB watermark.

Link: https://bugs.linaro.org/show_bug.cgi?id=3765#c17
Signed-off-by: Rafael David Tinoco <rafael.tinoco@linaro.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(am https://patchwork.kernel.org/patch/10655319/)

Change-Id: I67a1a0b71235b23f67bc350064a5e94aebbab2be
2019-09-27 10:16:06 +08:00
Biswajit Paul
9c23eefd23 ANDROID: kernel: Restrict permissions of /proc/iomem.
The permissions of /proc/iomem currently are -r--r--r--. Everyone can
see its content. As iomem contains information about the physical memory
content of the device, restrict the information only to root.

Change-Id: If0be35c3fac5274151bea87b738a48e6ec0ae891
CRs-Fixed: 786116
Signed-off-by: Biswajit Paul <biswajitpaul@codeaurora.org>
Signed-off-by: Avijit Kanti Das <avijitnsec@codeaurora.org>
(cherry picked from https://android.googlesource.com/kernel/msm
 commit 3b1ac3a37ce5e6c31c82ca85604705575cb570d6)
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-09-26 20:00:46 +08:00
Tao Huang
bd67d49f2b mfd: rk808: avoid NULL pointer dereferencing when shutdown
rk808->pins maybe NULL.

Fixes: cfe40315e8 ("pinctrl: support pinctrl driver for the RK817&RK809 PMIC")
Change-Id: Ia2c25f2717498c06d0707f17d27b0a85ee23f229
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-09-26 20:00:21 +08:00
Tao Huang
8ace8303d0 ipv6: ip6_output: fix for Android 7.1 CTS
After commit 23287661af ("ipv6: Inhibit IPv4-mapped src address on the wire.")
Android failed to pass DatagramSocketTest#test_getRemoteSocketAddress:
fail: java.net.ConnectException: Address family not supported by protocol

Android side has patch "Fix DatagramSocketTest#test_getRemoteSocketAddress".
Unfortunately, which may not merge to Android 7.1 branch, so we have to fixes
it on kernel side.

Change-Id: I7444c7636f02485abf6ddd4d7b9cad1f4e6d06e1
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-09-26 18:54:17 +08:00
Shengfei Xu
e9684a4a18 arm64: configs: rockchip_defconfig: enable CONFIG_INPUT_RK805_PWRKEY
Change-Id: Ieec6f382f644ebc6da1c01eaea7b003b2d5b0ec8
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
2019-09-26 17:48:51 +08:00
Shengfei Xu
8c7cc3c1e8 mfd: rk808: replace power key driver for rk809/rk816/rk817
remove the rk8xx-pwrkey.c file, it's function is same as rk805-pwerkey.c.

Change-Id: Ie8a0559c3a105ec9806f170d0c4d32c2691558c6
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
2019-09-26 17:41:05 +08:00
Liang Chen
1a5744c324 arm64: dts: rockchip: rk3399: add power-domains for iep_mmu node
It will cause kernel halt if power-domains is not set in iep_mmu node.

Change-Id: I8752a6b777f579dfc214c5034005387d5f759aad
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-09-26 15:11:58 +08:00
Alex Zhao
2929d06045 net: rkwifi: initialize code to support rkwifi
Change-Id: Ia0724ebc628ba40afed947275d34ff5c47a410b4
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2019-09-25 15:46:49 +08:00