Commit Graph

605448 Commits

Author SHA1 Message Date
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
Xinhuang Li
df50e22c6b arm64: dts: rockchip: rk3328: fix vepu clk define error
1.vepu aclk is ACLK_H264 and hclk is HCLK_H264
2.vepu need clk_core clk define
3.add h264&h265 power domain

Change-Id: I419e544cf86d90b2b8d88dd13dfed49d31a24991
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
2017-12-11 15:13:00 +08:00
Jerry Xu
c38770d2c1 ARM: dts: rk3288-evb: add demo for hdmi
To support HDMI 4K output, hdmi connect to vopb by default.

Change-Id: I7cc184a7399954e47b4f44d02769fd43263e549b
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2017-12-11 14:51:06 +08:00
Zheng Yang
b3b04416a8 drm/rockchip: inno_hdmi: fix phy pre-emphasis and driver setting
Accdording to CTS test result, for tmds clk rate above 140M,
RK3036 pre-emphasis should be 6 and driver is 0xb.

Change-Id: I7d4fed308a200eb4da4af1514c34c0501f551126
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 14:44:01 +08:00
Zheng Yang
90fe82f17e drm/rockchip: inno_hdmi: set avi colorimetry and scan_mode
Accroding to CTA-861, a Source shall set scan_mode = 1 or
scan_mode = 2 if it is confident of the accuracy of those
values. Otherwise, it shall set zero(no data).

By default, an SD Video Format shall be encoded according
to SMPTE 170M [1] color space, an HD Video Format shall be
encoded according to ITU-R BT.709 [7] color space. And a
Source shall be prohibited from setting colorimetry to 1 or
2 when colorspace is RGB.

Change-Id: I0da867cca5b757b3abcac69ff71616f990f2b7bb
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 14:43:20 +08:00
Zheng Yang
c28a16dbd0 drm/rockchip: inno_hdmi: fix audio infoframe
According to HDMI CTS 7-31, audio sample width and frequency
should be zero.

Change-Id: Ida37483e3f58e152e6a1c55d8bb81d0e9e0fb2ed
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 14:40:45 +08:00
Zheng Yang
8eb559f250 drm/rockchip: inno_hdmi: fix rk3036 video timing
RK3036 use grf register to set HSYNC/VSYNC polarity,
and fix hdelay and vdelay setting.

Change-Id: I3146a0a146b09f64c1d875642589d0f1dc6f27df
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 14:40:23 +08:00
Jacob Chen
8149b84093 ARM: dts: rockchip: add dts for rk3288-evb-rk808 board for linux
Change-Id: I80c486cb9f21c8dfb62149e6d10167f209ac4536
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-12-11 14:31:22 +08:00
Huang jianzhi
162aefa91a ARM: dts: rockchip: add dts for rk3288-evb-android-rk808-edp board
Change-Id: I69751d807c248574ce0d07a03b3eacefd883dc64
Signed-off-by: Huang jianzhi <jesse.huang@rock-chips.com>
2017-12-11 14:30:38 +08:00
shengfei Xu
f814345198 pmic: rk808: rk816: fix up the RK816 setting voltage drop make the system crash
Before adjusting voltage, increase clk_cpu div and reduce CPU frequency
Only support for RK312x chips.

Change-Id: Id327da9590f7d9d383450e79acd1b309e05cd024
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-12-11 14:18:04 +08:00
Douglas Anderson
6c7c1372cf UPSTREAM: mmc: dw_mmc: Don't allow Runtime PM for SDIO cards
According to the SDIO standard interrupts are normally signalled in a
very complicated way.  They require the card clock to be running and
require the controller to be paying close attention to the signals
coming from the card.  This simply can't happen with the clock stopped
or with the controller in a low power mode.

To that end, we'll disable runtime_pm when we detect that an SDIO card
was inserted.  This is much like with what we do with the special
"SDMMC_CLKEN_LOW_PWR" bit that dw_mmc supports.

NOTE: we specifically do this Runtime PM disabling at card init time
rather than in the enable_sdio_irq() callback.  This is _different_
than how SDHCI does it.  Why do we do it differently?

- Unlike SDHCI, dw_mmc uses the standard sdio_irq code in Linux (AKA
  dw_mmc doesn't set MMC_CAP2_SDIO_IRQ_NOTHREAD).
- Because we use the standard sdio_irq code:
  - We see a constant stream of enable_sdio_irq(0) and
    enable_sdio_irq(1) calls.  This is because the standard code
    disables interrupts while processing and re-enables them after.
  - While interrupts are disabled, there's technically a period where
    we could get runtime disabled while processing interrupts.
  - If we are runtime disabled while processing interrupts, we'll
    reset the controller at resume time (see dw_mci_runtime_resume),
    which seems like a terrible idea because we could possibly have
    another interrupt pending.

To fix the above isues we'd want to put something in the standard
sdio_irq code that makes sure to call pm_runtime get/put when
interrupts are being actively being processed.  That's possible to do,
but it seems like a more complicated mechanism when we really just
want the runtime pm disabled always for SDIO cards given that all the
other bits needed to get Runtime PM vs. SDIO just aren't there.

NOTE: at some point in time someone might come up with a fancy way to
do SDIO interrupts and still allow (some) amount of runtime PM.
Technically we could turn off the card clock if we used an alternate
way of signaling SDIO interrupts (and out of band interrupt is one way
to do this).  We probably wouldn't actually want to fully runtime
suspend in this case though--at least not with the current
dw_mci_runtime_resume() which basically fully resets the controller at
resume time.

Change-Id: I29a687b2342b9cb921aad133a538689a8f7d9262
Fixes: e9ed8835e9 ("mmc: dw_mmc: add runtime PM callback")
Cc: <stable@vger.kernel.org>
Reported-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2017-12-11 14:16:23 +08:00
Randy Li
18480946b4 rtc: remove an unused rk808 driver file
This file is not used anymore, and the current driver
for rtc of the rk808 is rtc-rk808.c

Change-Id: I2e21f56c0a24af9452bc113c28f25a8eaec096f0
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-12-07 18:58:32 +08:00
Finley Xiao
3cb6cc8a59 clk: rockchip: rk3066a: Rename i2s hclk id
Change-Id: I0a5ccf1846950353ea6fc6980c1c4a4fb3457fd1
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-07 18:57:44 +08:00
Wen Dingxian
90d186256b camera: rockchip: camsys_drv: v0.0x22.7 camsys_head: v0.e.0
read MRV_MIPI_FRAME register in camsys_mrv_irq, and pass the
value fs_id and fe_id into isp library.

Change-Id: I98c43f1cac25c74c5058b90dbf25937ceb924f84
Signed-off-by: Wen Dingxian <shawn.wen@rock-chips.com>
2017-12-07 15:39:42 +08:00
Elaine Zhang
a4d023c815 clk: rockchip: Fix up the pll setting to support px30 SoC.
add px30 registers offset.
add new pll type pll_px30 for px30 soc APLL.

Change-Id: I321ba0d8dd45b90260cc7f22030ce905949ff762
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-12-07 15:08:11 +08:00
Elaine Zhang
0d451fd04d clk: rockchip: add clock controller for px30
Add the clock tree definition for the new px30 SoC.
Fix up the pll setting to support px30 SoC.

Change-Id: Ib9255094b0fdb58f0a8ba49c5bb9f075c7458940
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-12-07 15:07:35 +08:00
Elaine Zhang
15f1fd6c6a clk: rockchip: add dt-binding header for px30
Add the dt-bindings header for the px30, that gets shared between
the clock controller and the clock references in the dts.
Add softreset ID for px30.

Change-Id: I643f5e40cf77fb5c3aeb41392172da79194d54c1
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-12-07 15:07:03 +08:00
Elaine Zhang
1d07c2a416 dt-bindings: add bindings for px30 clock controller
Add devicetree bindings for Rockchip cru which found on
Rockchip SoCs.

Change-Id: I7f1c862012ce43bfaa1c44c5f44e89354eca5099
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-12-07 15:06:23 +08:00
lkg
6a51b5c5bf arm64: dts: rockchip: rk3399-sapphire: add supply pin for sd card.
Change-Id: I5b8624f63ff05f3d2c8818ca99e20e8b92e3db11
Signed-off-by: Kaige Li <kevin.li@rock-chips.com>
2017-12-07 15:02:57 +08:00
Joseph Chen
af25336271 firmware: rockchip sip: add psci_smp_available check
We shouldn't call SMC if PSCI is not enabled.

Change-Id: I362bea4ecb481b2eadcf6c481f016050e386eee0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-07 15:00:37 +08:00
lihuang
2f8d635767 ARM64: dts: rockchip: enable rga device node for rk3328-evb-android
Change-Id: Iadb6988cbbdfe0835fa4b6c56ec762426ac03192
Signed-off-by: Putin Lee <putin.li@rock-chips.com>
2017-12-07 14:57:08 +08:00
lihuang
3249f70502 ARM64: dts: rockchip: add rga node for rk3328
Change-Id: I8bd8674e1ff43148daef60a296ae729da7480dad
Signed-off-by: Putin Lee <putin.li@rock-chips.com>
2017-12-07 14:56:42 +08:00
David Wu
6a8aaf5f0a PM / AVS: rockchip-io: add io selectors and supplies for px30
This adds the necessary data for handling io voltage domains on the px30.
As interesting tidbit, the px30 contains two separate iodomain areas.
One in the regular General Register Files (GRF) and one in PMUGRF in the
pmu power domain.

Change-Id: Icff058b310e8ffaa4e03b8090443b3a7dba35f1f
Signed-off-by: David Wu <david.wu@rock-chips.com>
2017-12-06 21:18:22 +08:00
David Wu
921a4f7c6f pinctrl: rockchip: Add px30 pinctrl support
The bank0 of px30 pinctrl is in the pmugrf, other banks are in
the grf, the bank1 ~ bank3 are 4-bit width's iomux.

Change-Id: I62cbd74105b6874a9a91f3ab6a7623990205edce
Signed-off-by: David Wu <david.wu@rock-chips.com>
2017-12-06 21:18:22 +08:00
Jianqun Xu
4178a29308 ARM: dts: rockchip: rk312x-android: put device cma to NORMAL zone
NORMAL zone limits at 0x90000000.

The device cma region which is used by camera should be set to
NORMAL zone to avold memory fragment.

The device cma region info:
[    0.000000] Reserved memory: created CMA memory pool at 0x88000000, size 24 MiB
[    0.000000] Reserved memory: initialized node region@8f000000, compatible id shared-dma-pool

The default cma region info:
[    0.000000] cma: Reserved 16 MiB at 0x9f000000

Change-Id: I8b1a099c5fa3a2d90acf709c4272d88b97e0c5bd
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2017-12-06 21:02:22 +08:00
Randy Li
041149c709 arm64: dts: rockchip: remove a stub pin node for rk3399-linux.dtsi
This stub pin node would prevent the whole pinctrl driver
being loading. Then any board files include the common
rk3399 linux would meet the power failure.

Change-Id: Ib223eb517c879b3819e9d8da4c0d5750886897c6
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-12-06 20:58:23 +08:00
Vivek Gautam
35cc344467 UPSTREAM: usb: dwc3: Fix error handling for core init
Fixing the sequence of events in dwc3_core_init() error exit path.
dwc3_core_exit() call is also removed from the error path since,
whatever it's doing is already done.

Change-Id: I71f6aab189df0e5223d490fb6eaeebe1481a6b65
Fixes: c499ff7 usb: dwc3: core: re-factor init and exit paths
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Stable <stable@vger.kernel.org> # 4.8+
Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 9b9d7cdd0a)
2017-12-06 20:56:59 +08:00
Finley Xiao
25b4c025ca clk: rockchip: rk3066a: Fix sclk_smc
Change-Id: I7644465c572758a5237396f47600fbf60ed8835c
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-06 20:55:26 +08:00
Finley Xiao
989b63d3a2 clk: rockchip: rk3066a: Fix spdif_frac
Change-Id: I8bed32dab9364ef4c37c8aee53de17b554c36a81
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-06 20:54:55 +08:00
Finley Xiao
0e78d93f71 arm: dts: rk3066a: Add operating-points-v2 property for cpu
This patch adds a new opp table for cpu.

Change-Id: I236fd158efc404c3d3611e3e7d1860cdf534aa57
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-06 20:54:30 +08:00
Zhen Chen
c97fcdffb0 ARM: dts: rockchip: rk3066a: correct and add settings of gpu node
Change-Id: I969ced5b48b470868558f19088b8413e1fb99226
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2017-12-06 20:53:29 +08:00
David Wu
49b7c5f959 ARM: dts: rk3066a-rayeager: Make hdmi regulator always on
Change-Id: I9bca56928f6f9c12579107f430f8cd0eedd69665
Signed-off-by: David Wu <david.wu@rock-chips.com>
2017-12-06 20:53:05 +08:00
Jianqun Xu
9ed7b34d60 ARM: dts: rockchip: rk312x-android remove ion node
Change-Id: I08feb4bc74482e7dec885ab74898e3a238c834ff
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2017-12-06 15:53:29 +08:00
Putin Lee
eb8fe01c96 video/rockchip: rga: Fixup some situation will cause memory leak
Change-Id: I2ec424e09149c5b4c1d6a2f141e0359e197abe35
Signed-off-by: Putin Lee <putin.li@rock-chips.com>
2017-12-06 09:27:20 +08:00
Cody Xie
50713bede6 arm: Bump COMMAND_LINE_SIZE to 2048.
The current limit is small for Android Things Verity Boot args.
Bump it.

Change-Id: I091c7f6d4912fec57ecca7dcab38cc99c5b6dfb5
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-12-06 09:19:31 +08:00
Finley Xiao
6ad0044b05 arm: dts: rockchip: rk3288: Assigned i2s_src parent to GPLL
The default parent of i2s_src is 200MHz CPLL, it doesn't meet
the constraint of fractional divider that denominator must be
20 times larger than numerator.

Change-Id: I986525ca7a92cb5883facd1b6e89079398302856
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-05 17:40:00 +08:00
Finley Xiao
e62d8931ec clk: rockchip: rk3288: Add id for i2s_src
Change-Id: I0d15dd656e96a3905012d42fef6640e152838888
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-05 17:40:00 +08:00
David Wu
815879abb6 ARM: dts: rk3066a-rayeager: Enable vop0 at dts level
Change-Id: Ie3fe65d6d4d59b24a5fa22772e39496914bb0f13
Signed-off-by: David Wu <david.wu@rock-chips.com>
2017-12-05 17:31:11 +08:00