Commit Graph

1053518 Commits

Author SHA1 Message Date
Finley Xiao
8cb20ca552 soc: rockchip: Add a simple power model for ipa
This patch adds support to calculate the static power in milliwatts
consumed by devices.

Change-Id: Ied4ba5adecea45ff34b372a6e23c70882000aef3
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-04-22 14:13:47 +08:00
Tao Huang
8f6c950a10 arm64: rockchip_defconfig: reorder CONFIG_ROCKCHIP_PVTM
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I840b4cea66f18c775e5c2382b38e8aec976d499f
2021-04-22 14:13:40 +08:00
Finley Xiao
f6fb2a487a soc: rockchip: pvtm: add driver handling Rockchip pvtm
This patch supports acquiring pvtm values.

Change-Id: I20c0c5a5136371880da1c246b0d71c7a2bddc1d6
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-04-22 14:12:18 +08:00
Tao Huang
6fff252f36 arm64: rockchip_defconfig: Enable CONFIG_ROCKCHIP_GRF
default y on 4.19.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I641a95a86c6d3c39b7465895eb2a0237a2476c5d
2021-04-22 10:55:41 +08:00
Huibin Hong
f79786d3b1 soc: rockchip: grf: enable module
Change-Id: I8e9a264f41a8b84e559688a3c0980b01ed061031
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-04-22 10:53:30 +08:00
Huibin Hong
347111763f soc: rockchip: grf: enable swd and uart2 switch for rv1126
Change-Id: Ideee9a80f7e2763ed15fe1ed7ac627f7fa6a9c71
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2021-04-22 10:51:49 +08:00
Shawn Lin
436cb774c7 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>
2021-04-22 10:51:49 +08:00
Huibin Hong
f7079a2411 soc: rockchip: grf: unmask uart dma request for RK3308 Soc
Change-Id: I06d955d92d04785bea3248b82fe99c515d471467
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-04-22 10:51:49 +08:00
Simon Xue
5e4f5a2dca soc: rockchip: hw-decompress: Add support rockchip hardware decompress
Change-Id: Ib882919642a6c72b0292292bc0fd35d7a3d78dee
Signed-off-by: Simon Xue <xxm@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-04-21 20:33:13 +08:00
Tao Huang
0365836557 arm64: rockchip_defconfig: Enable CONFIG_ROCKCHIP_DEBUG
default y on 4.19.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I947ed816e7ede80b3824ffccc52a38f74a5937e5
2021-04-21 19:49:41 +08:00
Huibin Hong
37d39fb8f2 soc: rockchip: debug: print dbgpcsr of cpus when panic
Change-Id: I4a3d60986b0bd23d43fa7fd5479b43cb65662996
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-04-21 19:47:38 +08:00
Elaine Zhang
30ab0ae1d1 soc: rockchip: modify the config ROCKCHIP_PM_DOMAINS to tristate
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I09a067d6842fb0fef3329c4e3eb0701fa6f41968
2021-04-21 19:40:05 +08:00
Tao Huang
ecf95a329a arm64: rockchip_defconfig: Enable CONFIG_ROCKCHIP_CPUINFO
default y on 4.19.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ie2f1555adb43e3eb1b10e04479efb1e771169531
2021-04-21 17:18:59 +08:00
Tao Huang
374a8f27c2 soc: rockchip: add cpuinfo support
Set system_serial_low/high from eFuse ID.
Serial can read from /proc/cpuinfo.

Change-Id: If412fc5a89a5e5092b510452fc5a126fdd374ac2
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-04-21 17:17:52 +08:00
Yifeng Zhao
a97ecd3b34 soc: rockchip: disable loader update vi vendor storage
The note /dev/vendor_storage include api to update loader,
this node must config root user access only, but some
project set this node`s owner as bluetooth ,it is a high
risk that the loader data will be corrupted.

Disable this api by default.

Change-Id: I6beb1b3cf51bffebd0ae05368d8c266439a61f91
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2021-04-20 21:35:15 +08:00
Yifeng Zhao
537dce547b soc: rockchip: support mtd vendor storage
This patch is used to support vendor storage for SPI NAND
and SLC NAND via mtd interface.

Change-Id: I6f011cb9052a014845629e103976b36adb5fa589
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2021-04-20 21:29:21 +08:00
Dingqiang Lin
23ad2d5063 soc: rockchip: add flash vendor storage support
Change-Id: I0261e652161e6a20a4d988c4ddfd7f186ad2200e
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2021-04-20 21:22:41 +08:00
Tao Huang
7f2c096357 soc: rockchip: sdmmc_vendor_storage: Include rk_sdmmc_ops.h
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I6ab2cc7741f47f175f1a3e429a9ebfafcf3cf7ad
2021-04-20 21:22:41 +08:00
Tao Huang
1ebc797453 mmc: host: rk_sdmmc_ops depends on CONFIG_ROCKCHIP_MMC_VENDOR_STORAGE
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I03a003343dec9ffb7610aa2690467d53e0bd300d
2021-04-20 21:22:40 +08:00
Tao Huang
d1c6b54ea3 arm64: rockchip_defconfig: Enable emmc vendor storage
+CONFIG_ROCKCHIP_VENDOR_STORAGE=y
+CONFIG_ROCKCHIP_MMC_VENDOR_STORAGE=y

default y on 4.19.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I0cc09457466f65485e705ce539cf48e02473468f
2021-04-20 21:22:40 +08:00
Yifeng Zhao
6f05d54b63 soc: rockchip: mmc: add emmc vendor storage
Change-Id: I3996cccaed265af2295dbc1ee77746928e1beec5
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2021-04-20 21:22:40 +08:00
Tao Huang
644a09599f 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>
2021-04-20 20:26:46 +08:00
Lin Jinhan
e12e07ff48 hwrng: rockchip - add support for Rockchip HW RNG
Change-Id: Ia14bd624716eb6531ef8674843ccfbada3197d8e
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2021-04-20 19:02:38 +08:00
Joseph Chen
6c14d5d76c firmware: rockchip: add compile option for rockchip sip
Change-Id: I996a90b3f6cb471f255566dfab0059a55da8866d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2021-04-16 19:24:42 +08:00
Tao Huang
c75dc801f4 arm64: rockchip_defconfig: Enable CONFIG_ROCKCHIP_FIQ_DEBUGGER
Which default y on 4.19

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I437ec5402b1a5802b9cdf8498bbb9321b39d1e20
2021-04-16 15:41:24 +08:00
Huibin Hong
8a4d1d8f1f soc: rockchip: add rk fiq debugger platform driver
Change-Id: Ibb32efc190ce49d657973133a30632c71f0d806c
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-04-16 15:39:25 +08:00
Huibin Hong
67ab450d38 staging: android: Add generic fiq serial debugger
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Change-Id: I6c0e1a17c45f077b45cb29287648e901b62abab0
2021-04-16 15:08:11 +08:00
Shawn Lin
b03bca5eae mmc: dw_mmc-rockchip: Just set default sample value for legacy mode
.set_ios() is called from .resume() as well. For SDIO device which sets
keep-power-in-suspend, nothing should be changed after resuming, as well
as sample tuning value, since this value is tuned already. So we should
not overwrite it with the default value.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I18974f28d7a2253fd151817a5a3e4105c2e976b3
2021-04-16 14:22:36 +08:00
Tao Huang
a21e820a5a arm64: cpuinfo: add system serial support
Change-Id: I4542f07226e47e67be1f2792cffaa71fd6401442
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-04-15 20:47:17 +08:00
Tao Huang
4efaa99002 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>
2021-04-15 20:47:17 +08:00
Tao Huang
d4d46e45d5 arm64: dts: rockchip: Add rk356x boards to Makefile
This reverts part of commit 251c226c35 ("rk: revert to v4.19").

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ie2742038ee35cb4ff89ba3abc6a2e8f900461e6f
2021-04-15 18:54:50 +08:00
Tao Huang
eae9461bbd arm64: dts: rockchip: Fix the warnings caused by i2c_bus_reg
Fix the following warnings:
arch/arm64/boot/dts/rockchip/rk3566-evb2-lp4x-v10-eink.dts:274.18-285.4:
ERROR (i2c_bus_reg): /i2c@fe5c0000/wacom@09: I2C bus unit address format error, expected "9"
arch/arm64/boot/dts/rockchip/rk3566-rk817-eink.dts:551.18-562.4:
ERROR (i2c_bus_reg): /i2c@fe5b0000/wacom@09: I2C bus unit address format error, expected "9"
arch/arm64/boot/dts/rockchip/rk3566-rk817-eink.dts:678.17-690.4:
ERROR (i2c_bus_reg): /i2c@fe5e0000/kxtj3@0e: I2C bus unit address format error, expected "e"
arch/arm64/boot/dts/rockchip/rk3566-rk817-eink-w103.dts:698.18-710.4:
ERROR (i2c_bus_reg): /i2c@fe5a0000/wacom@09: I2C bus unit address format error, expected "9"

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ia116424ecbb3285d77274ef19b6b93ef5f0f1480
2021-04-15 18:54:50 +08:00
Wu Liangqing
bdf1b69b38 mmc: dw_mmc-rockchip: set xfer timer 100ms
Fixes: 1d1a1f03f3 ("mmc: dw_mmc: add xfer timer for avoid DTO without actual data payload")
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I00ae095cff35b3960e1f9189d03f9908fed0aa33
2021-04-15 15:15:19 +08:00
Tao Huang
33bae277f6 gpu: remove unused rogue_m driver
Change-Id: I2d38df29926bc7c2e7e618b777cd36768cab0d0e
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-04-13 18:55:57 +08:00
Tao Huang
b72885a1c1 gpu: remove unused rogue driver
Change-Id: I067a96e88b4a389470b12446dea573134b835018
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-04-13 18:46:13 +08:00
Shawn Lin
78f9ac0daa treewide: Migrate rockchip dts file to use new host type tags
supports-* stuff were used for rockchip platforms to speed up booting
if we know what exactly the host was used for. As we have upstreamed all
these with some very similar ways, now it's the time we migrate our dts
files to use new properties.

They were converted by:

sed -i "s/supports-emmc;/no-sdio;\n\tno-sd;/g" `grep supports-emmc -rl arch/*`
sed -i "s/supports-sd;/no-sdio;\n\tno-mmc;/g" `grep supports-sd -rl arch/*`
sed -i "s/supports-sdio;/no-sd;\n\tno-mmc;/g" `grep supports-sdio -rl arch/*`

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I33e5317ee5c7305803cf18ff4a370658abf555b0
2021-04-13 14:40:36 +08:00
Shawn Lin
34c9946891 mmc: sdhci-of-dwcmshc: Initial support for rockchip platform
Change-Id: I25a54059a56f939996de89076550e6a0bb8404e0
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-04-12 20:15:16 +08:00
Shawn Lin
af02b05e59 mmc: add thunder boot support
Remove unnecessary initialization process from core as possible, such
as remove some idle process, shorten delay, remove parsing ext_csd,
remove post-delay for power and so on. All these stuffs are enabled
by CONFIG_ROCKCHIP_THUNDER_BOOT.

Change-Id: I0e2326dd79d938eb82c8cfac9db09e34d6c08987
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-04-12 20:15:16 +08:00
Shawn Lin
70f84526ba 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>
2021-04-12 20:15:16 +08:00
Shawn Lin
795e052cc8 mmc: dw_mmc-rockchip: add v2 tuning support
v2 tuning will inherit pre-stage loader's phase
settings for the first time, and do re-tune if
necessary. Re-tune will still try the rough degrees,
for instance, 90, 180, 270, 360 but continue to do the
fine tuning if sample window isn't good enough.

Change-Id: I593384ee381d09df5b9adfc29a18eb22517b2764
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-04-12 20:15:16 +08:00
Shawn Lin
a95ce73bf7 mmc: core: Add mmc_sd_shutdown support for SD
The ROM code for Rockchip platform never support detecting
SD 3.0 mode, so if the SD card contains system image running
into SD 3.0 mode in kernel, it will fails to reboot.

The problem is SD 3.0 mode is using 1.8V signal and could only
be switched back into 2.0 mode by power cycle. If the customed
board could not switch off its power rail, the ROM code can't
soft reset the SD.

Add mmc_sd_shutdown to workaround this special case and don't
bother normal SD cards used as external disk by checking the
RESTRICT_CARD_TYPE_MMC flag.

Conflicts:
	drivers/mmc/core/sd.c

Change-Id: I4c3d3111c0bce0ad3cd4f0c6592ff595d7015afe
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-04-12 20:15:15 +08:00
Shawn Lin
94728f4382 mmc: sdhci-of-arasan: Parse disable-cqe
Add support to disable cqe function if disable-cqe
is assigned by firmware.

Change-Id: Iac2826c4b986c122510af1594c971c4135bafc34
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-04-12 20:15:15 +08:00
Shawn Lin
9d76cd58bf mmc: core: Set clock after changing timing immediately for mmc_select_hs400es()
This's what mmc_select_hs400() or mmc_select_hs() did,
since mmc_set_clock() will let sdhci_arasan_set_clock()
update the PHY clock to match the timing, otherwise
the following mmc_switch_status() will be failed.

Change-Id: Ic1a0178ec209ec71d904f7212a84da6665904007
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-04-12 20:15:15 +08:00
Shawn Lin
4734c45258 mmc: core: don't check card status when flushing cache
It's meaningless to check the card's status which execute
the on-going flush. As the status been responded make no
any sense here.

Change-Id: I34197d1c93c01337dd2e68ec22e3ce8dd195c424
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-04-12 20:15:15 +08:00
Shawn Lin
a03fec2ff6 mmc: dw_mmc: bypass RPM for native CD
Otherwise now the RPM core will gate the clk and power domain,
so that the hotplug will be broken.

Change-Id: I9104ff1beb2db5ef2752179eb91730f48f3089d7
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-04-12 20:15:15 +08:00
Shawn Lin
976ea163ad 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>
2021-04-12 20:15:15 +08:00
Shawn Lin
8c7548af80 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>
2021-04-12 20:15:15 +08:00
Shawn Lin
4f0afb8a55 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>
2021-04-12 20:15:15 +08:00
Shawn Lin
22ddcf4e49 mmc: porting legacy tactices into 5.10
Change-Id: Ieb0e609f5cad4e889be6194f8fd8a54057a1174b
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-04-12 20:15:15 +08:00
Tao Huang
f3155b19d7 rk: get rid of legacy 'get_ds()' function
According to commit 736706bee3 ("get rid of legacy 'get_ds()' function")

Every in-kernel use of this function defined it to KERNEL_DS (either as
an actual define, or as an inline function).  It's an entirely
historical artifact, and long long long ago used to actually read the
segment selector valueof '%ds' on x86.

Which in the kernel is always KERNEL_DS.

Inspired by a patch from Jann Horn that just did this for a very small
subset of users (the ones in fs/), along with Al who suggested a script.
I then just took it to the logical extreme and removed all the remaining
gunk.

Roughly scripted with

   git grep -l '(get_ds())' -- :^tools/ | xargs sed -i 's/(get_ds())/(KERNEL_DS)/'
   git grep -lw 'get_ds' -- :^tools/ | xargs sed -i '/^#define get_ds()/d'

plus manual fixups to remove a few unusual usage patterns, the couple of
inline function cases and to fix up a comment that had become stale.

The 'get_ds()' function remains in an x86 kvm selftest, since in user
space it actually does something relevant.

Change-Id: I4b8e3436c958b7745059ea7ef4367f3fd4a0ebbe
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-04-12 19:56:40 +08:00