Commit Graph

839349 Commits

Author SHA1 Message Date
Shawn Lin
e944f54685 ARM64: dts: rk3399: assign clk parent and rate for SCLK_EMMC
Let's assign clk parent and rate for SCLK_EMMC to meet the
requiremen.

Change-Id: I3730a2124494da51717b1756f488f9df5bcd6423
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-02-27 19:07:28 +08:00
Xing Zheng
861969884f ARM64: dts: rk3399: assign VOP parent and rate for ACLK/HCLK
Change-Id: Ifcce7764eb709386e40140c58299468ea835fd8c
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-27 19:07:28 +08:00
chenzhen
24eae037d6 ARM64: dts: rk3399: gpu: add subnode for mali-simple-power-model
Change-Id: I0bd03634631ed30556cc45455582b075692cceba
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2019-02-27 19:07:28 +08:00
Tao Huang
1691499f75 soc: rockchip: add CPU_XXX config
For build kernel only support the given CPU.

Change-Id: I3d4790779d0ad0ecff6661ffb0b70e2df287fd5a
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-02-26 18:32:23 +08:00
Caesar Wang
3d4b748dd7 soc: rockchip: power-domain: export idle request
We need to put the power status of HEVC IP into IDLE unless
we can't reset that IP or the SoC would crash down.
rockchip_pmu_idle_request(dev, true)---> enter idle
rockchip_pmu_idle_request(dev, false)---> exit idle

Change-Id: I76733efd2de4f7ee183c1b6bd1545d60038ee31b
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-26 18:27:48 +08:00
Tao Huang
54c9a317b4 soc: rockchip: power-domain: add pm_domains.h
Change-Id: I889a7da10605e70af635e8b7fac26bf26fe6506f
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-02-26 18:21:40 +08:00
Elaine Zhang
4ed1dc1021 regulator: fan53555: fix up the dcdc is disabled when reboot
Before reboot if the DCDC is disabled,
the DCDC is still disabled after restart.
We have an method to workaround:
Use vsel pin to switch the voltage between value in FAN53555_VSEL0
and FAN53555_VSEL1. If VSEL pin is inactive, the voltage of DCDC
are controlled by FAN53555_VSEL0, when we pull vsel pin to active,
they would be controlled by FAN53555_VSEL1.
In this case, we can set FAN53555_VSEL1 to disable dcdc,
So we can make vsel pin to active to disable dcdc,
VSEL pin is inactive to enable DCDC.

Change-Id: I14c823ed11dc3369044ad2ed0b53a6027acbccd0
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-26 18:18:05 +08:00
Elaine Zhang
57fa46b868 regulator: fan53555: add regulator-initial-mode to set default mode
regulator-initial-mode: default mode to set on startup
regulator-initial-mode is set as:
        REGULATOR_MODE_FAST                     0x1
        REGULATOR_MODE_NORMAL                   0x2
Example:
 vdd_cpu_b: syr827@40 {
                compatible = "silergy,syr827";
                reg = <0x40>;
                vin-supply = <&vcc5v0_sys>;
                regulator-compatible = "fan53555-reg";
                regulator-name = "vdd_cpu_b";
                regulator-min-microvolt = <712500>;
                regulator-max-microvolt = <1500000>;
                regulator-ramp-delay = <1000>;
                fcs,suspend-voltage-selector = <1>;
                regulator-always-on;
                regulator-boot-on;
                regulator-initial-state = <3>;
                regulator-initial-mode = <1>;/*1:pwm 2: auto mode*/
                        regulator-state-mem {
                        regulator-off-in-suspend;
                };
        };

Change-Id: I4d3bbd50fd40531113f2cc6fe63905e24888a752
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-26 18:18:05 +08:00
Rocky Hao
14e74181b6 thermal: rockchip: add temperature dump when panic
Change-Id: I8cf3bbaea76d379dcfd1c89482254854df62cfea
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-26 18:12:31 +08:00
Shawn Lin
1d1a1f03f3 mmc: dw_mmc: add xfer timer for avoid DTO without actual data payload
It has proved the controller has a potention broken state with a DTO
interrupt comes while the data payload is missing, which was not
covered by current software state machine. Add a xfer timer to work
around this buggy behaviour introduced by broken design.

Change-Id: I5019c5ba0cdeb59adcdd3a5231a2000b448762bc
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-02-26 18:08:18 +08:00
Joseph Chen
2f03855b44 firmware: rockchip: add compile option for rockchip sip
Change-Id: I996a90b3f6cb471f255566dfab0059a55da8866d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-02-26 17:32:24 +08:00
Joseph Chen
8f8663b6ed firmware: rockchip: fix implicit declaration of function 'local_clock'
Change-Id: Ic109d0b2f9160931ab190e05eb25a0752e16a7fb
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-02-26 16:40:59 +08:00
Tao Huang
3936ea811f arm64: cpuinfo: add system serial support
Change-Id: I4542f07226e47e67be1f2792cffaa71fd6401442
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-02-26 11:49:06 +08:00
Tao Huang
49cc695712 arm64: cpuinfo: compat task get hwcap from compat_hwcap_str
backport 3.10 patch

Change-Id: Ice8b552450f34772ece0a56f04ba758886c955e2
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-02-26 11:26:30 +08:00
Tao Huang
6b938051ff HACK: lib/kobject_uevent.c: ignore thermal uevent when suspend
Android healthd try to listen power_supply subsystem uevent,
but which will block system from suspend on big.LITTLE system
because thermal_cooling_device_unregister will called when
cpufreq_exit. So ignore this uevent when suspend.

Change-Id: I35948498916560d5ec75fe561c9e9d588663ad22
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-02-26 11:26:07 +08:00
Zain Wang
346fd0aa53 regulator: mp8865: add regulator driver for MP8865
Change-Id: I5fa8423e5d1e301a008dcdfd60f93c442f6211a8
Signed-off-by: Zain Wang <wzz@rock-chips.com>
2019-02-26 11:21:42 +08:00
Arve Hjønnevåg
3460073ee9 PM / Sleep: Add wake lock api wrapper on top of wakeup sources
Change-Id: Icaad02fe1e8856fdc2e4215f380594a5dde8e002
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2019-02-26 11:21:22 +08:00
Tao Huang
4bd3b4f152 pinctrl: rockchip: better show irq chip name
When call irq_alloc_domain_generic_chips, pass the name of the irq
chip with bank name instead of just rockchip_gpio_irq.
So we can know the irq belong to which gpio by read /proc/interrupts.

cat /proc/interrupts

before:
 56:        435  rockchip_gpio_irq   3 Level     bcmsdh_sdmmc
 58:          0  rockchip_gpio_irq   5 Edge      power
 87:          2  rockchip_gpio_irq   2 Level     fusb302
105:         36  rockchip_gpio_irq  20 Level     gt9xx
106:          0  rockchip_gpio_irq  21 Level     rk808
109:          0  rockchip_gpio_irq  24 Level     fusb302
209:         42  rockchip_gpio_irq  28 Edge      es8316_interrupt

after:
 56:        401     gpio0   3 Level     bcmsdh_sdmmc
 58:          0     gpio0   5 Edge      power
 87:          2     gpio1   2 Level     fusb302
105:         39     gpio1  20 Level     gt9xx
106:          0     gpio1  21 Level     rk808
109:          0     gpio1  24 Level     fusb302
209:         37     gpio4  28 Edge      es8316_interrupt

Change-Id: Iff7afda770e8493dc4c105c1d251aeae0f69f639
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-26 11:20:46 +08:00
Elaine Zhang
eaa3e7f6ab ARM64: dts: rockchip: rk3399: add cpul/cpub assingment clk rate
set clk_cpul:816M clk_cpub:1008M when clk tree init

Change-Id: I8f493ce8479fc670aa05d651db5be354d6870c98
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-26 09:00:47 +08:00
Elaine Zhang
87488bd467 clk: rockchip: rk3399: add cru regs dump for panic
Add cru and pmucru regs dump when system panic.
It's just for debug.

Change-Id: I3f837f2941054129d20c2355d86f575d6ee84665
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:09 +08:00
Jeffy Chen
584af33d04 clk: rockchip: rk3036: add ACLK_VCODEC
Change-Id: I36f6b23139345941656c127718cc4ff01c6d629f
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:09 +08:00
Xing Zheng
e4569523c2 clk: rockchip: rk3399: add 106.5MHz clock configuration for 1440x900
Change-Id: I49331fdbf595b731f64f34beb25e817c502984fe
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:09 +08:00
Elaine Zhang
319c8f111c soc: rockchip: power-domain: fix up the PMU_GPU_PWRDW/UP_CNT for RK3399
According to the advice of the IC,
setting the PMU_GPU_PWRDW/PWRUP_CNT regs 6 cycel(250ns) for RK3399 SOC.

Change-Id: I0449069a3b5035bd0442fcd74b645de9480a1d89
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:09 +08:00
Xing Zheng
a03fdb2b0d clk: rockchip: rk3399: Add support frac mode frequencies for independent VPLL
These clock rate are used for HDMI display.

Change-Id: I4742dcfe8ddedfa6b86c38ce03bcaa5c28b34c4e
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:09 +08:00
Elaine Zhang
2dc8409772 regulator: rockchip: lp8752: support lp8752 regulator
updata lp8752 driver.
add devicetree bindings for lp8752.

Change-Id: I21cdbde985d4663862b56c28429c41d9d3c38c36
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:08 +08:00
Xing Zheng
3293573dd5 clk: rockchip: rk3399: keep the pclk_vio is CLK_IGNORE_UNUSED and critical
When we use the MIPI screen, the driver will unprepare and disable
the phy_cfg, it will diable its parent pclk_vio:
dw_mipi_dsi_phy_init
  --> clk_disable_unprepare
    --> clk_disable
      --> clk_core_disable(core->parent)

The pclk_vio supply power for pclk_vio_grf, hence, disable pclk_vio_grf will
cause other drivers failed to operate GRF.

Change-Id: I6d5bd27b9478da09209130f1fd5a62c0d4bb1785
Reported-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:08 +08:00
Xing Zheng
bddc5d99ff clk: rockchip: rk3399: Add CLK_SET_RATE_PARENT for main VOP0
We recommend, VOP0 is the main screen, VOP1 is a sub screen,
only VOP0 is able to re-set parent (VPLL) rate.

Change-Id: If40f95ce18e73477df8f7f031013333a603d5eb2
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:08 +08:00
Xing Zheng
9de0a00291 clk: rockchip: rk3399: Modify dummy clock for VOP dclks
Because frac div need to more than 20 multiple between the numerator
and denominator, but we need to be fit many HDMI/DP freqs and may
bring serious jitter when the dclk_vopx below the dclk_vopx_frac.

Therefore, we can select dclk_vopx below the dclk_vopx_div directly.

Change-Id: If3d9051211f0b160a507f0942667796f043f4ec2
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:08 +08:00
Xing Zheng
28fb9c8f98 clk: rockchip: rk3399: move VOP clock to other PLLs
We hope to be able to HDMI/DP can obtain better signal quality,
therefore, we move VOP pwm and aclk clocks to other PLLs, let
HDMI/DP phyclock can monopolize VPLL.

Change-Id: Ib715f9d29c0743d113f9f74886ff3921c9e0a327
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:08 +08:00
Elaine Zhang
a9d4d52892 clk: rockchip: rk3399: remove unnecessary CLK_IGNORE_UNUSED flags
remove unnecessary CLK_IGNORE_UNUSED flags for m0.

Change-Id: Iba9daf76980c969b90700c175bfa5fec044f3524
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:08 +08:00
Xing Zheng
5d9eb4d549 clk: rockchip: rk3399: remove unnecessary critical clocks
Change-Id: If1f3cf9eb91f89ad38f034b5a9d90571c486efc9
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:07 +08:00
Xing Zheng
f93674de17 clk: rockchip: rk3399: add all of NOCs into critical clocks
We need to declare that we enable all NOCs which are critical clocks
always and clearly and explicitly show that we have enabled them at
clk_summary.

Change-Id: I859664692b4d1bb0dda0ee38295dfcbc3cc70019
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:07 +08:00
Xing Zheng
4a7d40f806 clk: rockchip: rk3399: Keep DMAC1 enable always for SPI5
Change-Id: I4b2b8bdf7649b0c5209852160597ad2737ed5a7b
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-25 17:20:07 +08:00
Cliff Chen
3f399ec8bb f2fs: add a new limit for reserve root
The reserved root blocks is not enough for booting Android due to
the limit of 0.2% if the fs size too small. so we add a new mini-
mum limit is 128MB.

Change-Id: I5af3b182001d27e4d18b4090c5270bbb2ac6253b
Signed-off-by: Cliff Chen <cliff.chen@rock-chips.com>
2019-02-25 16:39:12 +08:00
Cliff Chen
b992ad3197 f2fs: modify f_blocks for statfs
The f_blocks of statfs include file system overhead,it is not normal
usage of Posix.

Change-Id: If481626b08c05290626938586e2dc721690f1a91
Signed-off-by: Cliff Chen <cliff.chen@rock-chips.com>
2019-02-25 16:31:50 +08:00
Tao Huang
78c2dd49b2 power: reset: reboot-mode: fix normal mode setup
If cmd is empty in get_reboot_mode_magic, we should return normal magic.

Change-Id: I10931adc49e33f72ae73d9471159f82cc02ff0c0
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-02-25 16:30:58 +08:00
William Wu
98465bfad1 usb: ohci-platform: disable ohci for rk3288
rk3288 ohci doesn't actually work on hardware, so we
need to disable it in ohci-platform driver.

Change-Id: I72750edda67358ff1e8fe66047bf60420500997e
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2019-02-25 16:20:35 +08:00
William Wu
fa4da63174 usb: host: ehci-platform: Add basic runtime PM support
Like the runtime PM support patch of ohci-platform, we
add the same basic runtime PM for ehci-platform.

Conflicts:
        drivers/usb/host/ehci-platform.c

Change-Id: I84cbb15dd393e6af69b4cf6887f1628e2cba4999
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2019-02-25 16:20:35 +08:00
William Wu
4e5b4527dd USB: ehci-platform: support EHCIs with usic phy
Some EHCI controllers use usic phy (e.g rk3399/rk3288),
in order to enable these controllers, we need to set
some additional EHCI vendor-specific registers.

Support this feature in device tree when using the ehci
platform driver by adding a new property for it.

Conflicts:
        drivers/usb/host/ehci-platform.c

Change-Id: I279ccfdb5866df49828825bfd41b39fcd58a2832
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2019-02-25 16:20:35 +08:00
Frank Wang
a03c5f1ef5 usb: amend ehci no-relinquish-port for rk3288 platform
For the hardware bug of RK3288 OHCI, we use commit cfe6f1dd57
("usb: ehci: add rockchip relinquishing port quirk support") to fix
it previously. However, it have been ineffective after upstream commit
94c43b9897 ("USB: Check for dropped connection before switching to
full speed") was merged due to the condition of relinquishing port was
changed.

This patch adds an additional condition for the previous commit to ensure
no relinquish port quirk can take effect for RK3288 EHCI.

Change-Id: I0630265e101afb349816955e069e1c121745ac08
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2019-02-25 16:20:35 +08:00
William Wu
2815b3d1d9 usb: ehci-platform: use no relinquish port quirk only for rk3288
rk3288 and rk3288w use the same dts which includes no relinquish
port quirk, however rk3288w ohci can work well, so we need to add
an additional condition to disable ohci only for rk3288.

Change-Id: Ic2bd0ce577cbebe7ae2cf1b153f9e46935022f77
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2019-02-25 16:20:35 +08:00
Frank Wang
f79a9edb89 usb: ehci: add rockchip relinquishing port quirk support
Add a quirk to support rockchip relinquishing port from abnormal ohci
to ehci when FS/LS devices plug in.

To support this function, the rockchip-relinquish-port property must be
specified in ehci node of dt.

Conflicts:
        drivers/usb/host/ehci-platform.c

Change-Id: I91b58905132282ef2a836d54a1c7ace1e334d119
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2019-02-25 16:20:35 +08:00
Shawn Lin
83681e60ed mmc: dw_mmc: initialize zero for dma_slave_config
This fixes uninitialized variable introduced by commit ddd2e87ad4
("dmaengine: pl330: add support for interlace size config")

Change-Id: Ib1bbec21053fbcccf85a339d8ed7eec0bbe77727
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-02-25 16:17:34 +08:00
Shawn Lin
d86ffdff59 mmc: core: export retune_enable/disable api for wifi drivers
Change-Id: I084e155ed71057fa7f39e160a4f3fde964557185
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-02-25 16:14:18 +08:00
Shawn Lin
5ffbedd300 r8169: add new device ID support
It's found a new r8169 ethernet card with a device ID of
0x0000 read from its config header which wasn't in the
ID tables of r8169. Add it in order to probe this card.

Change-Id: I27c542a10cc571a6e1a4e7a8af62ce560b8b1fc4
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-02-25 16:10:22 +08:00
Shawn Lin
10e85e8d4c soc: rockchip: grf: postpone jtag switching for PX30 Soc
PX30_GRF_SOC_CON5 is intended for postponing the auto switch
of pinmux from SDMMC to JTAG after removing the SD cards.
However, the default value is too small to meet the actual
requirement. Increase this value to 5 seconds currently.

Change-Id: I18fafe07822b81d9cd448ab71c1f0e49a75db357
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-02-25 16:05:27 +08:00
Shawn Lin
7347f7084d phy: rockchip-emmc: improve calpad busy trimming
Change-Id: I31302c7468879d244cbf1c74976596312e826c6a
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-02-25 15:37:29 +08:00
Shawn Lin
c8b3f1fe1c mmc: block: add dependency of emmc_disk flag
Rockchip platform now not only use dw_mmc but also
the sdhci-of-arasan could be used as emmc. So we need
to add its dependency when setting emmc_disk flag.

Change-Id: I84f99657b874a15e60063b1b4ff94fd90cc191c3
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-02-25 15:37:16 +08:00
Shawn Lin
5a9f535177 FROMLIST: mmc: core: fall back host->f_init if failing to init mmc card after resume
We observed the failure of initializing card after resume
accidentally. It's hard to reproduce but we did get report from
the suspend/resume test of our RK3399 mp test farm .Unfortunately,
we still fail to figure out what was going wrong at that time.
Also we can't achieve it by retrying the host->f_init without falling
back it. But this patch will solve the problem as we could add some log
there and see that we resume the mmc card successfully after falling
back the host->f_init. There is no obviousside effect found, so it seems
this patch will improve the stability.

[   93.405085] mmc1: unexpected status 0x800900 after switch
[   93.408474] mmc1: switch to bus width 1 failed
[   93.408482] mmc1: mmc_select_hs200 failed, error -110
[   93.408492] mmc1: error -110 during resume (card was removed?)
[   93.408705] PM: resume of devices complete after 213.453 msecs

Change-Id: I5b24cb84a223394392450a1f10d8bbacb9e1006e
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-02-25 15:35:45 +08:00
Shawn Lin
3b9fac1a1b mmc: sdhci-of-arasan: wakeup genpd in probe
Let's keep genpd for sdhci alive while entering deep
sleep which gte me out of yapping around.

Change-Id: I0da20b417621d277745bafd53d1ee461aae72e11
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-02-25 15:30:33 +08:00