Commit Graph

1059000 Commits

Author SHA1 Message Date
Tao Huang
eb3fa68f91 iommu: remove unused rk-iommu/iovmm driver
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ieca1544f10c294303d0d40c6b4c5e1a797e577a2
2021-07-19 14:08:18 +08:00
Simon Xue
75031f75e2 iommu: rockchip: declare iommu_ops to non const
If iommu_ops is const, kernel will crash like following:

Unable to handle kernel write to read-only memory at virtual address ffffffc00903c688
Mem abort info:
  ESR = 0x9600004f
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
Data abort info:
  ISV = 0, ISS = 0x0000004f
  CM = 0, WnR = 1
swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000001b6d000
[ffffffc00903c688] pgd=00000001fffff003, p4d=00000001fffff003, pud=00000001fffff003, pmd=000000000c995003, pte=006000000cb01f83
Internal error: Oops: 9600004f [#1] PREEMPT SMP
Modules linked in: rockchip_iommu(+) rk808 rk808_regulator clk_rk3568 clk_rk808 clk_scmi clk_pwm pm_domains io_domain pinctrl_rk805 pinctrl_rockchip rockchip_cpuinfo
CPU: 2 PID: 1 Comm: init Not tainted 5.10.43 #112
Hardware name: Rockchip RK3566 RK817 TABLET LP4X Board (DT)
pstate: 20400005 (nzCv daif +PAN -UAO -TCO BTYPE=--)
pc : rk_iommu_probe+0x318/0x4a8 [rockchip_iommu]
lr : rk_iommu_probe+0x2f0/0x4a8 [rockchip_iommu]
sp : ffffffc01003b910
x29: ffffffc01003b910 x28: 0000000000000002
x27: ffffffc00903c988 x26: ffffffc00903c000
x25: ffffffc00903c978 x24: ffffff800ca466b0
x23: ffffffc00903c000 x22: 0000000000000000
x21: ffffff800ca46680 x20: ffffff81f0a0a410
x19: ffffff81f0a0a400 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000
x15: ffffffc011ce9d48 x14: ffffff81f0100a1c
x13: ffffffffffffffff x12: 0000000000000004
x11: ffffff81f010027c x10: 7f7f7f7f7f7f7f7f
x9 : 2c6b7173626d686f x8 : 0000000005f5e0ff
x7 : ffffffc01003b730 x6 : 00000000000012e0
x5 : ffffff81f0116c00 x4 : ffffff81f0116c00
x3 : ffffff81f09054b8 x2 : 10a37138512eb400
x1 : ffffffc00903e1c0 x0 : ffffffc00903c530
Call trace:
 rk_iommu_probe+0x318/0x4a8 [rockchip_iommu]
 platform_drv_probe+0x50/0xa8
 really_probe+0x20c/0x3e8
 driver_probe_device+0x54/0xb8
 device_driver_attach+0x6c/0x78
 __driver_attach+0xb0/0xf0
 bus_for_each_dev+0x68/0xc8
 driver_attach+0x20/0x28
 bus_add_driver+0x168/0x1f8
 driver_register+0x60/0x110
 __platform_driver_register+0x40/0x48
 rk_iommu_init+0x1c/0x1000 [rockchip_iommu]
 do_one_initcall+0x48/0x2d8
 do_init_module+0x58/0x3ac
 load_module+0x1dbc/0x2158
 __do_sys_finit_module+0xe4/0x100
 __arm64_sys_finit_module+0x18/0x20
 el0_svc_common.constprop.3+0x64/0x188
 do_el0_svc+0x20/0x98
 el0_svc+0x10/0x18
 el0_sync_handler+0x8c/0xb0
 el0_sync+0x14c/0x180
Code: 54000b09 9109a000 f90022a0 91070021 (f900ac01)

Change-Id: I16089d85a3add6b22047131e62e7bb4919b43a9e
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-07-19 11:17:25 +08:00
Tao Huang
b8373952c2 input: touchscreen: gt1x: Allow building as module
the module will be called gt1x-ts.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: If2b2188d1c9e881af83fd2fee1e6cd2f70e3ca76
2021-07-18 18:14:23 +08:00
Zhen Chen
6a2af737e9 Mali: midgard: Fix a runtime WARNING as below
[    4.128429] WARNING: CPU: 0 PID: 247 at drivers/gpu/arm/midgard/mali_kbase_mem_linux.c:1772 kbase_mmap+0x380/0xa78
...

Treat VM_FAULT_NOPAGE as success of calling vmf_insert_pfn().
Take https://android.googlesource.com/kernel/hikey-modules/+/refs/heads/android12-5.10/midgard/mali_kbase_mem_linux.c as a reference.

Fixes: 970017f88e ("MALI: midgard: Fix all compile errors under kernel 5.10")
Change-Id: Ie0562d8024e58031ba8126aab42dc7005f08b071
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-07-16 20:26:19 +08:00
Finley Xiao
37d5c1a6fd opp: Add a summary tree in debugfs
On rk3568-evb1-ddr4-v10 the opp_summary looks something like as follow.

 device                rate(Hz)    target(uV)    min(uV)    max(uV)
-------------------------------------------------------------------
 platform-fde60000.gpu
                      200000000       825000      825000      825000
                      300000000       825000      825000      825000
                      400000000       825000      825000      825000
                      600000000       825000      825000      825000
                      700000000       900000      900000      900000
                      800000000      1000000     1000000     1000000
 platform-bus-npu
                      900000000            0           0           0
                     1000000000       925000      925000      925000
 cpu0
                      408000000       825000      825000     1150000
                      600000000       825000      825000     1150000
                      816000000       825000      825000     1150000
                     1104000000       825000      825000     1150000
                     1416000000       900000      900000     1150000
                     1608000000       975000      975000     1150000
                     1800000000      1050000     1050000     1150000
                     1992000000      1150000     1150000     1150000

Change-Id: Ia357b4088805cf640dd659f510dd031488bd3ab3
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-16 17:55:24 +08:00
Finley Xiao
3e45580f16 PM / devfreq: rockchip_dmc: Fix rate when enter isp and dulaview statuses
As the frequency can't be changed in isp and dulaview statuses,
the target frequency should be the bigger one, both in isp status
or in dulaview status.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Id9182d591f615304f24ccba5816424a876046dc3
2021-07-16 16:29:11 +08:00
Finley Xiao
823b966dcf PM / devfreq: rockchip_dmc: Fix misused IS_ERR_OR_NULL checks
Fixes the following warning:
drivers/devfreq/rockchip_dmc.c:2914
rockchip_dmcfreq_register_cooling_device() warn: passing zero to 'PTR_ERR'

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ia8b0811d0e27394e420b862305917314189f94be
2021-07-16 16:23:58 +08:00
Liang Chen
a26f8c19dd PM / devfreq: rockchip_bus: support soc bus devfreq
Change-Id: Iba750d4522b99e88c16c8e4a77d3367fbb2a0d82
Signed-off-by: Tony Xie <tony.xie@rock-chips.com>
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-07-16 16:23:54 +08:00
Liang Chen
87e27bcaf0 PM / devfreq: rockchip_bus: add support for rk3568
Add support for rk3568 and init opp-table with rockchip_init_opp_table()
so that rockchip_bus can support pvtm and leakage.

Change-Id: Ief17dba8264906f987d4dac93b2e7344c98bc8fa
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-07-16 16:22:45 +08:00
Finley Xiao
aacc268cae PM / devfreq: rockchip_bus: Fix invalid member dereference of cpufreq_freqs
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I45521ebb19283f3e14a75974b25b8a8d4c64bde1
2021-07-16 16:22:45 +08:00
Tao Huang
fdf8dbe714 regulator: core: Call regulator_init later when CONFIG_ROCKCHIP_THUNDER_BOOT=y
Change-Id: I302079e585f374a7fddd207e6fd740b61b0df52c
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-07-16 15:29:19 +08:00
YouMin Chen
a97e2d456d PM / devfreq: rockchip-dfi: add support lpddr4x
Change-Id: Icd86a458dc9843e80d9206d620a1da6a71adf799
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-15 10:56:20 +08:00
Finley Xiao
f35cf18299 PM / devfreq: event: Add new Rockchip NoC probe driver
This patch adds NoC (Network on Chip) Probe driver which provides
the primitive values to get the performance data. For example, RK3399
has multiple NoC probes to monitor traffic statistics for analyzing
the transaction flow.

Change-Id: I66f6708f0d244488ca08f0f1f1cb36b19c7a2d0a
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-15 10:55:00 +08:00
YouMin Chen
19abbe3ebd dt-bindings: devfreq: rockchip_dfi: add rk3568 support
Change-Id: Id99f60a26f260ba9a4fb037fd0be12355c2d5abd
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-15 10:54:59 +08:00
YouMin Chen
e0603b1c99 PM / devfreq: rockchip-dfi: add support for rk3568 dfi
Change-Id: I62d21e31cd56e82c04de675be502b261ba3740da
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-15 10:54:59 +08:00
YouMin Chen
0369dd4ab2 PM / devfreq: rockchip-dfi: add support for rv1126 dfi
Change-Id: I65a403424b68804022025309f9af82b55c044192
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-15 10:54:59 +08:00
YouMin Chen
d08d38b836 dt-bindings: devfreq: rockchip_dfi: add rv1126 support
Change-Id: Ie210fd8aa9fd686590385d3377540cd02a7dc867
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-15 10:54:59 +08:00
YouMin Chen
354584ddce PM / devfreq: rockchip-dfi: fix lpddr4 calculation error
Fix lpddr4 calculation error about access.
LPDDR4 BL(burst length) = 16,other DDR type BL(burst length) = 8.

Change-Id: Icc1b4f6764fa0b23ec1f7722bda8ffeff1da4ab7
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-15 10:54:59 +08:00
YouMin Chen
b949c38cbd PM / devfreq: rockchip-dfi: add support for rk1808 dfi
Change-Id: Id95eca244c666b103ce4f9676e2abbeb304196ac
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-15 10:54:59 +08:00
YouMin Chen
20b5bce157 dt-bindings: devfreq: rockchip_dfi: Add rk1808 support
Change-Id: I8bd056dcc93f3c9c94b1b490340f8b040bb77d43
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-15 10:54:59 +08:00
YouMin Chen
eefc791ec8 PM / devfreq: event: add support for px30 dfi
Change-Id: Ib6808d961b65d993fea05ab15d648d814d14a4a2
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-15 10:54:59 +08:00
CanYang He
8d4209ee06 PM / devfreq: event: add support for rk3328 dfi
This adds the necessary data for handling dfi on the rk3328.

Change-Id: Id870f78dad3ddd6cb5771674a4e8905322f9e8ef
Signed-off-by: CanYang He <hcy@rock-chips.com>
2021-07-15 10:54:59 +08:00
CanYang He
0873229b24 PM / devfreq: event: make dfi more extension
after modify, rockchip_dfi_ops can apply to other platform use such
version ddr monitor. regardless of channel count, only one channel
of rk3288,rk3399,rk3328 can work. and regardless of monitor clk,
some platform like rk3328 monitor clk is always on.

Change-Id: Ia1c02a89116546ded385c5a6a3e36d020d66b7f3
Signed-off-by: CanYang He <hcy@rock-chips.com>
2021-07-15 10:54:52 +08:00
Liang Chen
7d494650c3 PM / devfreq: event: add support for rk3128 dfi
This adds the necessary data for handling dfi on the rk3128.
Access the dfi via registers provided by GRF (general register
files) module.

Change-Id: Ife9e9987224088434e878102b7d1c3b132e761ad
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-07-15 10:49:09 +08:00
Tang Yun ping
0519cdf40c PM / devfreq: event: add support for rk3288 dfi
This adds the necessary data for handling dfi on the rk3288.
Access the dfi via registers provided by GRF (general register
files) module.

Change-Id: Ic7241af3c20a269ab362055dea04d260e01c50de
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2021-07-15 10:49:09 +08:00
Finley Xiao
b495cbf359 PM / devfreq: event: add support for rk3368 dfi
This adds the necessary data for handling dfi on the rk3368.
Access the dfi via registers provided by GRF (general register
files) module.

Change-Id: I96c2b4dcd34d90731b749ebdbe6922f01559d8e6
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-15 10:49:09 +08:00
Tao Huang
d15b4cd8ed soc: rockchip: ROCKCHIP_THUNDER_BOOT depends on NO_GKI
Fixes: 451b327661 ("soc: rockchip: Add ROCKCHIP_THUNDER_BOOT config")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I372c0c73d3024e7c86620daac5ec30392e0af359
2021-07-14 20:40:58 +08:00
Tao Huang
d5b6ba694d init/Kconfig: INITRD_ASYNC depends on NO_GKI
Fixes: 7be803f0d5 ("init: support init ramfs async")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I7fa7d3cb063fb31faf025d35b23bcb459b01ea8d
2021-07-14 20:37:39 +08:00
Tao Huang
b03830fcbe input: rockchip_pwm_remotectl: Use irq_set_affinity_hint()
Fix build error when build as module by
replace irq_set_affinity() with irq_set_affinity_hint().

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I1ccd70954a5910738bfe4c508046eda2f940a226
2021-07-14 20:17:44 +08:00
Finley Xiao
2761181ab1 arm64: dts: rockchip: rk3399: Add system monitor node
Change-Id: I77d9d047b87702d0633d80dc7f945c6672f2ccd5
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-14 15:11:22 +08:00
Finley Xiao
450b89167b arm64: dts: rockchip: rk3399: add cpu pvtm voltage table
stress test:
1. reboot
2. antutu, use governor performance
3. antutu, use governor interactive
4. Thomas-sRoomIII, use governor interactive
5. Thomas-sRoomIII, use governor userspace and sweep frequency

Change-Id: If12d2bd72ce3bba01021314265eba4f83a0072e1
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-14 14:58:07 +08:00
Finley Xiao
2329033783 arm64: dts: rockchip: rk3399: move opp tables to rk3399-opp.dtsi
Add a new dtsi file - rk3399-opp.dtsi, to configure opp-tables
for cpu, gpu and dmc.

Add rk3399-early-opp.dtsi for board with ES1, which need limit
frequency for cpu, gpu and dmc.

Change-Id: Ib57761fd5f405b0e79039d7a01e6e023d6f5dc2c
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-14 14:57:13 +08:00
Finley Xiao
92e72c556e dt-bindings: rockchip-thermal: Support the RK3568 SoC compatible
Add a new compatible for thermal founding on RK3568 SoC.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I5ec192a380ffb331120fa0fed20df83d5d83e8d9
2021-07-14 10:30:49 +08:00
Tao Huang
92d4c59160 nvmem: core: Call nvmem_init() early when CONFIG_ROCKCHIP_THUNDER_BOOT=y
rockchip_otp_module_init() depends on nvmem_init() to init nvmem_bus_type.
But rockchip_otp_module_init() and nvmem_init() are both in the same
subsys_initcall level.

Change-Id: I58bc66519fb76179be3e6a170048a67c0861b224
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-07-14 10:30:49 +08:00
Finley Xiao
e621ca5fd6 nvmem: rockchip-efuse: Add mutex lock for rk1808 efuse read
The rk1808 efuse read has some issues when several threads start to read
efuse through nvmem file node.

Thread1                                    thread2
1. timing_init
2.  write auto_ctrl
3.    delay                                  timing_init
4.      read status                            write auto_ctrl
5.        if error goto to timing_deinit         delay

The thread1 will read no finish bit and then goto error, the user will
see a "Input/Output Error".

The thread1 do timing deinit will cause thread2 halt on read status, and
the user will never success to do read efuse again.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I3f462afd844686aac153acc0c33215fbd96827a3
2021-07-14 10:30:49 +08:00
Finley Xiao
bd2d7d615f nvmem: rockchip-efuse: Update driver to use clk_bulk array APIs
Change-Id: I0489a992ed7edb3317b1b5a57522df3a5374cec2
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-14 10:30:49 +08:00
Liang Chen
cb4ecc7dc3 nvmem: rockchip-efuse: clear efuse timing after read
Clear efuse timing after read to avoid efuse misoperation.

Change-Id: I459d01af9c9a84ab6c621e5e5cf3f01213b4f7f9
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-07-14 10:30:49 +08:00
Liang Chen
e8b8a27f7e nvmem: rockchip-efuse: add support for rk1808-efuse
This adds the necessary data for handling efuse on the rk1808.

Change-Id: I78b66db1fdc22430ab93b07ad3c7cea3355a7f6e
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-07-14 10:30:49 +08:00
Liang Chen
8e1e4a51bf dt-bindings: nvmem: rockchip-efuse: add description for RK1808 SoCs
Change-Id: I76c56b0c9709d849c87a059d7e67d67ae98ddbb5
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-07-14 10:30:49 +08:00
Liang Chen
abbb4ef963 nvmem: rockchip-efuse: add support for rk3128-efuse
This adds the necessary data for handling efuse on the rk3128.

Change-Id: Ieda973675ff959b3157bb4afe6e1dcdfac65506c
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-07-14 10:30:49 +08:00
Finley Xiao
774fb77ce5 nvmem: rockchip-efuse: add support for rk3288 secure efuse
This adds the necessary data for handling secure efuse on the rk3288.
Need to use secure interface to access efuse when kernel is in no-secure
mode.

Change-Id: I1979f23ed8f85c9eb248de276b32adcbb165bd79
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-14 10:30:49 +08:00
Finley Xiao
d774309f8b nvmem: rockchip-efuse: add rk3368-efuse support
This adds the necessary data for handling efuse on the rk3368.
As efuse of rk3368 is secure, use secure interface to access efuse.

Change-Id: I72c29348b7744b232d75ab51c56dc7de0988c24e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-14 10:30:49 +08:00
Finley Xiao
09743e83d3 dt-bindings: nvmem: rockchip-otp: Make resets as optional property
Change-Id: Icd2e130548e101a41b3030e90cbec9eca43d408e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-14 10:30:49 +08:00
Robin Murphy
2cab89dcae BACKPORT: clk: rockchip: Add appropriate arch dependencies
There's no point offering support for 32-bit platforms to users
configuring a 64-bit kernel - and vice-versa - unless they are
explicitly interested in compile-testing.

Change-Id: I36e9d2c20ba6bb82ae82f12714b14f4fc2dc43f7
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/72abb0f794b8ed77e274e8ee21c22e0bd3223dfd.1603710913.git.robin.murphy@arm.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 6e0781e092)
2021-07-14 10:05:00 +08:00
Tao Huang
eceea1a746 MALI: midgard: Add _mali_profiling_control to rename.h
FATAL: modpost: drivers/gpu/arm/mali400/mali/mali: '_mali_profiling_control'
exported twice. Previous export was in drivers/gpu/arm/midgard/midgard_kbase.ko

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ia75a4edce98dbf5f8d8cbc286c6e5c2faf99c295
2021-07-14 10:03:55 +08:00
Sandy Huang
3ee3c8c01e drm/rockchip: remove drm_atomic_set_property calls
drm_atomic_set_property isn't export function, so we set default prop
vale to instead of it.

Change-Id: I4acc6ddd045415aa180d467b45085609408e2447
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2021-07-13 20:34:50 +08:00
Andy Yan
eefa1f67a0 drm/rockchip: vop2: Add uv offset for y mirror
Esmart/Smart should add offset in y mirror mode.

Change-Id: I5299543006c702c1492ee740460d0b7536e7d6e8
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-07-13 20:34:50 +08:00
Finley Xiao
b8976991c9 soc: rockchip: pvtm: Add debugfs support when build as module
Change-Id: Icaf80c17344b9cc30fd3e3e39a8070fcbb4499bd
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-13 20:27:36 +08:00
Finley Xiao
da2cde8541 soc: rockchip_system_monitor: Add a dummy thermal governor
Add support to change thermal governor to dummy, and the system
monitor will manage cooling devices.

This also fixes the following build errors when build as a module.
ERROR: modpost: "__governor_thermal_table_end" [drivers/soc/rockchip/rockchip_system_monitor.ko] undefined!
ERROR: modpost: "__governor_thermal_table" [drivers/soc/rockchip/rockchip_system_monitor.ko] undefined!

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ia68b5bf2b6d94cb13fafc5cde74bc80b32dfac0a
2021-07-13 20:27:30 +08:00
Simon Xue
888b10e41e PCI: rockchip: support building pcie-rockchip-host to module
Change-Id: Ia9d343f523f7f29e3f70d2fbe7d8b9eb55073508
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-07-13 20:25:19 +08:00