Commit Graph

605485 Commits

Author SHA1 Message Date
Chen Liang
a9b598724b arm64: dts: rockchip: add core dtsi file for PX30 and RK3326 SoCs
This patch adds core dtsi file for Rockchip PX30 and RK3326 SoCs.

Change-Id: Iccd663330632fddfed30093303aaec7c7a1b8b13
Signed-off-by: Chen Liang <cl@rock-chips.com>
2017-12-14 09:40:08 +08:00
Finley Xiao
49dda19957 arm: dts: rockchip: Add clock assign for rk3126 and rk3128 cru
Add "assigned-clocks" for rk3126 and rk3128 cru nodes, to intalize
clock rate for plls, bus and peripher.

Change-Id: Ie91c8b194feff5db91af6e9930d5f475175242f9
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-13 20:26:50 +08:00
Rocky Hao
557c1d80b9 ARM: rockchip_defconfig: enable RK_VIRTUAL_THERMAL
Change-Id: I36db5d8e4194c96e8a63be795d6403192ca60d4b
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2017-12-13 18:39:59 +08:00
Rocky Hao
c6cd509617 ARM: dts: rockchip: rk3126-bnd-d708: enable tsadc node
Change-Id: I40a5e8fe4563673d51aa60a99afe21c7b855a177
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2017-12-13 18:39:59 +08:00
Rocky Hao
c581befe92 ARM: dts: rockchip: add tsadc node and thermal config for rk312x
Change-Id: I5d3c5c77ec8e14b26ee7ef02cf4aec4729558d02
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2017-12-13 18:39:59 +08:00
Rocky Hao
2954d5a6db thermal: rockchip: add virtual tsadc support for rk3126
rk previous SOCs such as rk3126 have no tsadc module, so a virtual tsadc is
implemented to control the thermal problem.

the virtual tsadc is designed on considering 2 factors, one is heating
modules' heating time and the working frequences, the other one is current
leval monitored by coulometer.

Change-Id: I0c7d8b952004d4f7918a41c925c50d38aaa65673
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2017-12-13 18:39:59 +08:00
Wenping Zhang
0c3d5875c3 leds: leds-is31fl32xx: enable multi-control mode and solve register failed issue during reboot.
Change-Id: I299ae4c97adde806c10ce74d2b843a82a4956682
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2017-12-13 18:36:20 +08:00
Wenping Zhang
f745a93405 leds: add multi-control for leds's trigger.
userspace can control all leds by one ioctl through file node:
/dev/led_multi_ctrl.

Change-Id: I10ac19b86b46b3dc9a88809f1be5ebc95398212c
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2017-12-13 18:36:20 +08:00
Wenping Zhang
a0505a722c leds: leds-is31fl32xx: merge modifies from develop-3.10.
1. fix cpu stall issue during reboot:
   In previous code, i2c write and read is executed in function
   is31fl32xx_brightness_set,this function may be called in softirq
   context if leds are in timer or oneshot trigger, so there are
   possibilities cpu will be stalled during led operations.
   Here we just move the i2c operation to workqueue to make sure
   not in irq context.
2. fix reboot crash issue.

Change-Id: If8520528b092cf4d5c4f1c7dcf2d353acd1c9b9d
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2017-12-13 18:36:20 +08:00
Wenping Zhang
a5763e48f0 leds: leds-is31fl32xx: add delayed register function.
This function is used for led scrolling, set "default-trigger-delay-ms"
in led dts node to enable this function.

Change-Id: I4dff3ab29d8ef18344df4c3a0f18a595a404154c
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2017-12-13 18:36:20 +08:00
Zheng Yang
a7d17fdc65 drm: bridge: dw-hdmi: fix tmds clk in status show
According to HDMI 2.0 chapter 6.1, for TMDS character Rates
avove 340Mcsc, the TMDS Clock Rate shall be one fourth of
the TMDS Character Rate.

Change-Id: I4cc78aa1a5fbf6cec93e787dde49e482d0b4d342
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-13 18:34:49 +08:00
Finley Xiao
09f340ba86 clk: rockchip: px30: Fix aclk and hclk for vpu, sdcard and crypto
Change-Id: I6f3d77033b493bdaac9d05c2be5eea38290a089e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-13 18:32:21 +08:00
Wenping Zhang
a2ad800c08 leds: leds-is31fl32xx: fix compile errors.
The is32fl32xx led driver from upstream is written for new led
framework, so just modify this driver for some api difference
between our current led framework.

Change-Id: I0fd9af4bc2cd419d3e0bcd1b2348d34d166d652b
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2017-12-13 18:05:58 +08:00
Finley Xiao
feb173722d soc: rockchip: power-domain: Modify power domain driver for px30
This driver is modified to support PX30 SoC.

Change-Id: I0226327d6d63302627a823bf73a5f8239b70adaf
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-13 18:03:22 +08:00
shengfei Xu
7051792ae3 regulator: rk808: rk816: fix up the DCDC and LDO setting off in sleep mode
Change-Id: I1022a7a8951a3115ac01a43f2165b5eac6202ab4
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-12-13 17:24:55 +08:00
shengfei Xu
1fca941134 ARM: dts: rockchip: rk3126-bnd-d708: set DCDC initial mode
Change-Id: Ibb18ea7605ead33abcddde6690a4ae4016c01974
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-12-13 17:23:32 +08:00
shengfei Xu
14d16c1848 regulator: rk808: maps a hardware mode defined in a DTS to a standard mode
Change-Id: I304e0cbb3544abde112180b6ec459670d91c99ae
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-12-13 17:23:19 +08:00
Tao Huang
cfdb04d8c4 ARM: rockchip: Fix secondary CPU startup in thumb2 kernel
The secondary CPU starts up in ARM mode. When the kernel is compiled in
thumb2 mode we have to explicitly compile the secondary startup
trampoline in ARM mode.

Change-Id: I52d2167ab4c4e1da5ac1a800390ab04ba724dd72
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 17:20:58 +08:00
Xinhuang Li
8abc733872 clk: rockchip: rk3328: modify the wrong clk definition for encoder
Change-Id: I56ef3a201fc57d8ae368a5d1448e9e85e9143703
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
2017-12-13 17:05:54 +08:00
Mark Brown
d8df99ad35 UPSTREAM: regmap: Fix typo in IS_ENABLED() check
Change-Id: If9635a5933d7addea8522ce3b9259faa5b455008
Reported-by: Andreas Ziegler <andreas.ziegler@fau.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit f458e6102c)
2017-12-13 16:14:37 +08:00
Jonas Gorski
434530f363 UPSTREAM: regmap: make LZO cache optional
Commit 2cbbb579bc ("regmap: Add the LZO cache support") added support
for LZO compression in regcache, but there were never any users added
afterwards. Since LZO support itself has its own size, it currently is
rather a deoptimization.

So make it optional by introducing a symbol that can be selected by
drivers wanting to make use of it.

Saves e.g. ~46 kB on MIPS (size of LZO support + regcache LZO code).

Change-Id: I38a5164c2169f889a10f6c47968c1dbd187c6725
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 34a730aa74)
2017-12-13 16:10:16 +08:00
Tao Huang
356bf4e371 ARM: rockchip: pm: fix compilation error for !PM_SLEEP
Fixes: 580ad3d371 ("rockchip: pm: add deep sleep support for rk3288")
Change-Id: I8034cd47f289f51b21c47ee8f68ee1ae125026e7
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 16:00:53 +08:00
Tao Huang
fc5f7f4e52 drm/rockchip: dw-hdmi: fix compilation warning for !PM_SLEEP
Change-Id: I404951709bef35cc2297fcc99002930ded17fe74
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:58:54 +08:00
Tao Huang
e4b484d077 input: sensor-dev: fix compilation warning for !PM_SLEEP
Change-Id: I4f63d7a86ebe3d0015a4d409f0f256b70f7e7cf8
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:56:09 +08:00
Tao Huang
210c1a7480 net: wireless: rockchip_wlan: fix compilation warning for !PM_SLEEP
Change-Id: Ia37c81cc6cabe3bd4ea6048fd9102ea36808dd5b
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:42:42 +08:00
Tao Huang
c8fa9b3b91 staging: iio: imu: inv_mpu: fix compilation warning for !PM_SLEEP
Change-Id: I23ec57a842175ad39cf6a76c87181b36c64e78ca
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:41:57 +08:00
Tao Huang
1629f6ccbc rockchip_sip: add dummy sip_smc_remotectl_config
Change-Id: Ib015b6ed3a3f6c66e34c84e4964b9cfafc8c6501
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:37:03 +08:00
Tao Huang
43c9e54b19 soc: rockchip: rockchip_dmc: fix compilation error for !DRM_ROCKCHIP
Change-Id: I6f02fef9ecf9b74e16b8e35d5f9c23afa1d7ebc7
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:35:13 +08:00
Tao Huang
1d22a86e68 ARM: rockchip: build embedded if PM_SLEEP=y
Change-Id: I182ebf684392aed3a264a9d7f0d729031be210e4
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:12:35 +08:00
Zhang Yunlong
6c6d85b4d1 camera: rockchip: camsys_drv: v0.0x22.8
3399 ISP power management is wrong, correct it.

Change-Id: I6aa4e7a0dd941ec9ff02467c0e1e6b15f1771a2b
Signed-off-by: Zhang Yunlong <dalon.zhang@rock-chips.com>
2017-12-13 14:10:37 +08:00
Zheng Yang
df5711cded drm/rockchip: dw-hdmi: set default color depth to 8 bit
If color depth is automatic, it is same as 8bit.
If tmdsclk > max_tmds_clock, fall back to 8bit.

Change-Id: Ia8cbf5206831ef99456ae59add94c6f8b5a33380
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-13 14:09:48 +08:00
Zorro Liu
79d6c71215 arm64: dts: rockchip: change logo mode to center for rk3399-android.dtsi
Change-Id: Ibb7f9bd5575937a1e9b227156e195058e285bd1e
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2017-12-13 11:33:45 +08:00
Jianqun Xu
024bde41c3 drm/rockchip: use __GFP_DMA32 for shmem-backed gem
Rockchip requires bo-pages to be in the DMA32 zone. Explicitly request this
by setting __GFP_DMA32 as mapping-gfp-mask during shmem initialization.
This drops HIGHMEM from the gfp-mask and uses DMA32 instead. shmem-core
takes care to relocate pages during swap-in in case they have been loaded
into the wrong zone.

It is _not_ possible to pass __GFP_DMA32 to shmem_read_mapping_page_gfp()
as the page might have already been swapped-in at that time. The zone-mask
must be set during initialization and be kept constant for now.

Change-Id: I6db4f9e8ed716a1f7c90c7d92920122a484bf45d
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2017-12-13 09:41:02 +08:00
Jacob Chen
bbea8b144e clk: rockchip: do not register ddrclk if PSCI is not enabled on arm32
ARM32 system can run without trustos,
we should prevent arm_smccc_smc being called in such system.

Change-Id: Ic87b78107b464e3ab8dc72a3ca1fa9a64e358580
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-12-12 20:10:47 +08:00
Meng Dongyang
20694a9e4b usb: dwc2: modify host_nperio_tx_fifo_size for rockchip platform
According to DWC2 datasheet, the reset value of NPTxFDep in GNPTXFSIZ
register is OTG_TX_HNPERIO_DFIFO_DEPTH parameter,it specifies the Maximum
Non-Periodic TxFIFO depth and the memory allocation for the host when the
controller is in host mode. Software init host_nperio_tx_fifo_size with
the value of NPTxFDep during dwc2 probe.

But in some platform such as rk3126c, it must delay at least 100ms to wait
the controller change to host mode, it will increase usb controller probe
time, this patch modifies the host nperio_tx_fifo_size directly after valiate
parameter to speed up boot kernel.

Change-Id: Ia7d0f4f2cc1d80742d764807a8ee44cbc03c43ce
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2017-12-12 20:10:13 +08:00
Chris Zhong
3e2f8da104 ASoC: support ES8328 I2C driver
Change-Id: I7bc2d9a1796443dc61cf80498c1c016cea698a7a
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
2017-12-12 19:06:44 +08:00
Chris Zhong
5a19c7f8e0 ASoC: es8328: Enabling support for 12Mhz sysclk
Change-Id: If9dea6039ab562023c81c2394c9286b7adc4a8c5
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
2017-12-12 19:06:31 +08:00
Yankun Zheng
fb0938d89f ARM: dts: rockchip: Modify pinctrl configuration for android things SOM.
fix the pinctrl default state is repeatedly defined
between rk3229-at-gva.dts and rk3229-at-som.dtsi

Change-Id: I117b3d97d446899ad7f35234df7c8dc0da60634e
Signed-off-by: Yankun Zheng <zyk@rock-chips.com>
2017-12-12 19:03:20 +08:00
Douglas Anderson
c25b6442b4 FROMLIST: phy: rockchip-typec: Try to turn the PHY on several times
Bind / unbind stress testing of the USB controller on rk3399 found
that we'd often end up with lots of failures that looked like this:

  phy phy-ff800000.phy.9: phy poweron failed --> -110
  dwc3 fe900000.dwc3: failed to initialize core
  dwc3: probe of fe900000.dwc3 failed with error -110

Those errors were sometimes seen at bootup too, in which case USB
peripherals wouldn't work until unplugged and re-plugged in.

I spent some time trying to figure out why the PHY was failing to
power on but I wasn't able to.  Possibly this has to do with the fact
that the PHY docs say that the USB controller "needs to be held in
reset to hold pipe power state in P2 before initializing the Type C
PHY" but that doesn't appear to be easy to do with the dwc3 driver
today.  Messing around with the ordering of the reset vs. the PHY
initialization in the dwc3 driver didn't seem to fix things.

I did, however, find that if I simply retry the power on it seems to
have a good chance of working.  So let's add some retries.  I ran a
pretty tight bind/unbind loop overnight.  When I did so, I found that
I need to retry between 1% and 2% of the time.  Overnight I found only
a small handful of times where I needed 2 retries.  I never found a
case where I needed 3 retries.

I'm completely aware of the fact that this is quite an ugly hack and I
wish I didn't have to resort to it, but I have no other real idea how
to make this hardware reliable.  If Rockchip in the future can come up
with a solution we can always revert this hack.  Until then, let's at
least have something that works.

This patch is tested atop Enric's latest dwc3 patch series ending at:
  https://patchwork.kernel.org/patch/10095527/
...but it could be applied independently of that series without any
bad effects.

For some more details on this bug, you can refer to:
  https://bugs.chromium.org/p/chromium/issues/detail?id=783464

Change-Id: I7909731247739694f56bf89ab3064889f2b34d3c
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(am from https://patchwork.kernel.org/patch/10105833/)
2017-12-12 18:28:33 +08:00
xxh
c7719f844b arm64: dts: rk3328: fix string error for sdio 3.0
Change-Id: Id2d63cf4c3edb645985265d06930bbc56f7bf66c
Signed-off-by: Xu Xuehui <xxh@rock-chips.com>
2017-12-12 14:22:48 +08:00
William Wu
ddfb482c0b usb: dwc2: gadget: config GAHBCFG from core parameter
The ahbcfg of dwc2_core_params can be used to overwrite
the default value of the GAHBCFG register. But the current
code don't use this parameter for dwc2 gadget, and always
set the burst length of GAHBCFG to INCR4. This patch sets
the the burst length of GAHBCFG to INCR4 only if ahbcfg is
-1, otherwise, overwrite the GAHBCFG with the ahbcfg value.

Change-Id: I78ed8f797a4b94b34f610789ee3bd61bcc8ed985
Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-12-12 10:06:52 +08:00
Finley Xiao
93b078afc2 arm: dts: rk3066a-rayeager: Enable cpu and gpu opp table
Change-Id: I7c4a6ce9d9ba81e37a05462ccfc34dd4697492d7
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-12 10:04:25 +08:00
Tao Huang
1be021d3fd sched/fair: fix push_task uninitialized in active_load_balance_cpu_stop
Fixes: a80b8c7559 ("sched: Extend active balance to accept 'push_task' argument")
Change-Id: I002bd443c1dbb1d63f195f4b8cb7e9998987a6af
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-11 19:18:52 +08:00
Zhen Chen
aaa43b14a5 MALI Utgard: RK: only prepare clk_gpu not enable it in mali_probe()
Change-Id: I53b2b9e0a277bedc4a15899ae680ed944219f7bf
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2017-12-11 18:49:22 +08:00
Peng Zhou
711af44ea8 camera: rockchip: cif: rm redundant cif driver
Only register cif platform_driver on rk30_camera_oneframe.c
Remove redundant code.

Change-Id: I70b8b65da6e5869ba1f94917442c40fcf5fa805f
Signed-off-by: Peng Zhou <benjo.zhou@rock-chips.com>
2017-12-11 15:30:02 +08:00
Zheng Yang
f8fbbc4520 drm: bridge: dw-hdmi: introduce mpll_cfg_420
RK3368/RK3399 mpll input clock rate is twice of mpll output
in YCBCR420 mode. This patch introduce mpll_cfg_420 to get
the platform YCBCR420 phy setting. If mpll_cfg_420 is not
exist, use mpll_cfg.

Change-Id: I7910a75394cf371a8008f8a83e3ab9ec14e9a68a
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 15:27:58 +08:00
Zheng Yang
1d2df5571a drm: bridge: dw-hdmi: fix VP_PR_CD pixel repetition factor configuration
The configured value sets H13T PHY PLL to multiply pixel clock by the
factor in order to obtain the desired repetition clock. For the CEA
modes some are already defined with pixel repetition in the input video.
So for CEA modes this shall be always 0.

Change-Id: Iea4a00247f25c134dbd67ba77c00eb4393622385
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 15:27:05 +08:00
Zheng Yang
27b2871f98 drm: bridge: dw-hdmi: Implement connector atomic_begin
To avoid screen flash when updating CSC, we introduce connector
atomic_begin. Before flush crtc and connector, it's need to send
AVMUTE flag to make screen black, and clear flag after CSC updated.

AVMUTE -> Update CRTC -> Update HDMI -> Clear AVMUTE

Change-Id: Id47caac1e25fcce5a5aa7b879da4a6b9a9bab8a1
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 15:17:31 +08:00
Zheng Yang
773d508df7 drm: introduce atomic_begin for connector
atomic_begin is used to prepare for update flush.

Change-Id: I1d3a2afaea4022c065bda2b4c0746464cc0c1303
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 15:17:24 +08:00
Xinhuang Li
d534e6ca79 driver: video: rockchip: fix vepu build fail and can not work
1.vepu need core_clk define
2.there is no ION_HEAP function,replace it with the same definition

Change-Id: I7cf02c9e446976f0424d9489e081c9614b7e7e0c
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
2017-12-11 15:13:23 +08:00