Commit Graph

1066174 Commits

Author SHA1 Message Date
Shunhua Lan
1ab474fdf8 ASoC: es8323: support fixed and variable both clock rates
This patch supports some type of machine drivers that set 0 to mclk
when sound device goes to idle state. After applied this patch,
sysclk == 0 means there is no constraint of sound rate and other
values will set constraints which is derived by sysclk setting.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Link: https://lore.kernel.org/r/20190903165322.20791-2-katsuhiro@katsuster.ne

Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: If0a478f0cb46fa502cdf0d4e017ac2f36166055a
2021-11-12 16:20:52 +08:00
Wangqiang Guo
2baf8fc47d arm64: dts: rockchip: rk3588-evb: move touch pinctrl to rk3588-evbx.dtsi
Signed-off-by: Wangqiang Guo <kay.guo@rock-chips.com>
Change-Id: I91fb070f4bd09a47db4967ca2bb458179c31f459
2021-11-12 16:14:22 +08:00
David Wu
8cdc87137f arm64: dts: rockchip: Add gmac0 node for rk3588-evb1
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I34f0723dc4b91ed5d13c7f2925da24b56776e217
2021-11-12 16:10:12 +08:00
Shawn Lin
7931e3b934 phy: phy-rockchip-snps-pcie3: Migrate to use bulk clk API
In order to make clock definition more flexible, use bulk
clk API instead.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I5f44c67e9d4c4d812b34a53f9f106cb2134b7199
2021-11-12 15:49:20 +08:00
David Wu
ff20bf6334 net: ethernet: stmmac: dwmac-rk: Disable delayline if it is invalid
If delayline can't get from DTB or invalid, don't enable delayline.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I9769af42d02c67d2ea3fd24de5def45a1ec1cc17
2021-11-12 15:44:33 +08:00
David Wu
b0a0001cdd net: ethernet: stmmac: dwmac-rk: Fix return value for RK3588 speed clock setting
This patch fixes the following log:
  rk_gmac-dwmac fe1b0000.ethernet: unknown speed value for GMAC speed=1000

Fixes: 2627dcd2c9e9("net: ethernet: stmmac: dwmac-rk: Add gmac support for rk3588")

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ifaa4696492f1864acc9d999da7d59f1854e6e320
2021-11-12 15:44:33 +08:00
Tao Huang
d89acabf06 Revert "clk: rockchip: Temporarily fix for rk3588 pll"
This reverts commit fb7d7606a1.

Change-Id: I232636a08a2c034df5ac41d1f628ad55e4e59e36
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-11-12 15:34:24 +08:00
Elaine Zhang
46e88184cc arm64: dts: rockchip: rk3588s: init pll_aupll to 786M
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I2e552dc3a390c273f46d52a55c641697a66a7719
2021-11-12 14:31:26 +08:00
Elaine Zhang
e5277633c6 clk: rockchip: rk3588: add 786M for AUPLL init
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: Ic9b76bc29cf07593a94deaeeaaecd81d5bdbd649
2021-11-12 14:30:30 +08:00
Jianqun Xu
72d54feee5 arm64: rockchip_defconfig: disable ion
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Iaf69c2c61dd3b03fe9a6adfa29196258151e14e0
2021-11-12 14:26:14 +08:00
Jianqun Xu
84bb23a5d3 arm64: dts: rockchip: rk3588-evb default to disable sdmmc
RK3588-evb1 / RK3588-evb4 / RK3588-evb5 have no TF-card support
RK3588-evb2 / RK3588-evb3 support TF-card

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Ie67bdfba5b6e60c1a092dab2af0d1f96c3b9a1ca
2021-11-12 14:16:49 +08:00
Finley Xiao
678be475c7 cpufreq: dt-platdev: Add rk3588 project into blacklist
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ia08b5467b1a41c56afb27a067a3cbcec2c6a6026
2021-11-12 14:11:27 +08:00
Zhen Chen
ee20202c97 arm64: dts: rockchip: rk3588s: gpu: enlarge register space to 0x200000
Valhall device driver expects that it is at least 0x200000.

Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: Ide488624375fdc2b242442bf023040e8ed8358e8
2021-11-12 14:10:09 +08:00
Sugar Zhang
1e94be3e6e ASoC: es8323: Fix NULL pointer dereference when shutdown
Component is null when sound card link failed. So, switch to use regmap
directly in shutdown path.

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000090
Mem abort info:
  ESR = 0x96000005
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
Data abort info:
  ISV = 0, ISS = 0x00000005
  CM = 0, WnR = 0
user pgtable: 4k pages, 39-bit VAs, pgdp=0000000005ff2000
[0000000000000090] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
Internal error: Oops: 96000005 [#1] PREEMPT SMP
Modules linked in:
CPU: 2 PID: 1 Comm: init Not tainted 5.10.43 #110
Hardware name: Rockchip RK3588 EVB1 LP4 V10 Board (DT)
pstate: 20400009 (nzCv daif +PAN -UAO -TCO BTYPE=--)
pc : mutex_lock+0x2c/0x64
lr : snd_soc_component_write+0x30/0xd0
sp : ffffffc011e2bc10
x29: ffffffc011e2bc10 x28: ffffff8002200000
x27: 0000000000000000 x26: ffffffc011cf1000
x25: ffffffc011dac000 x24: ffffff80046128c0
x23: ffffff8004612828 x22: 0000000000000001
x21: 0000000000000058 x20: 0000000000000000
x19: 0000000000000090 x18: ffffffc011e25058
x17: 000000000000000a x16: 0000000000000001
x15: 0000000000000000 x14: 0000000000000400
x13: 000000000000276a x12: 0000000029aaaaf0
x11: 0000000001000c2b x10: 0000000007ae1850
x9 : 0000000000000000 x8 : 0000000000000090
x7 : 0000000000000000 x6 : 0000000000000000
x5 : ffffffc011e2bb40 x4 : 0000000000000000
x3 : 0000000000000000 x2 : ffffff8002200000
x1 : 0000000000000000 x0 : 0000000000000090
Call trace:
 mutex_lock+0x2c/0x64
 snd_soc_component_write+0x30/0xd0
 es8323_i2c_shutdown+0x13c/0x1f0
 i2c_device_shutdown+0x44/0x54
 device_shutdown+0x174/0x214
 kernel_restart+0x44/0x110
 __arm64_sys_reboot+0x148/0x21c
 el0_svc_common+0xa4/0x180
 do_el0_svc+0x28/0x88
 el0_svc+0x14/0x24
 el0_sync_handler+0x88/0xec
 el0_sync+0x1a8/0x1c0

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I978764678bd36321d0e3f8ac8e487c328eb7a720
2021-11-12 11:34:31 +08:00
Tao Huang
52cbc3ce90 arm64: rockchip_defconfig: Enable CONFIG_PRINTK_TIME_FROM_ARM_ARCH_TIMER
For get boot time better.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Idcde84f57c29c81587e1c0b51c3308f031f1f2e6
2021-11-12 11:23:51 +08:00
Tao Huang
4214832392 printk: Introduce CONFIG_PRINTK_TIME_FROM_ARM_ARCH_TIMER
Some examples for console output:

Starting kernel ...

[    1.956071][    T0] Booting Linux on physical CPU 0x0000000000 [0x412fd050]

Change-Id: I0ab5914349ad3e0028954c831c5e79d46fe2d420
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-11-12 11:21:16 +08:00
Todd Kjos
a4eacf3227 ANDROID: binder: fix regression in sender_euid
A recent change to use proc->cred instead of proc->tsk as the source
for sender_euid caused a failure in the CredentialsTest#CaptureLayersTest
test. Revert 1 line of the patch to fix the test. The rest of the patch
needs to remain since the subsequent patches rely on it.

Before fixing upstream, we need to investigate more since the code looks
correct so the issue may be a latent userspace bug.

Bug: 205938623
Fixes: d65efd5b73 ("UPSTREAM: binder: use euid from cred instead of using task")
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I16543a50f43f79131234995fb0813de00795bd3d
2021-11-11 19:05:25 -08:00
Tao Huang
f4f5c36bc6 arm64: dts: rockchip: Add reboot mode for rk3588
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I56f1ff125d8ec627fa774690764d9e9a99e57ff4
2021-11-12 10:11:30 +08:00
Sugar Zhang
b161f411c3 ASoC: rockchip: i2s-tdm: Make property 'grf' optional
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: If50451ec8e4e7b872e4101551bc4c5063ac4e3b8
2021-11-12 09:35:16 +08:00
Finley Xiao
e4899cdc78 Revert "arm64: dts: rockchip: rk3588: Add pd vdpu before pd rkvdec"
This reverts commit 24627eab36.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I8308cffccadcb7f585ee19b39f2575477ae0d62b
2021-11-12 09:23:06 +08:00
Finley Xiao
9adc296fc7 soc: rockchip: power-domain: Only don't power down pd when enable always on
Fixes: ad7e570f0d ("soc: rockchip: power-domain: Add support to keep domains power on")
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I68a96cec47bd17c9e5f777a21a1b25b86f888715
2021-11-12 09:22:40 +08:00
Eric Biggers
6b7c37f6c4 ANDROID: fips140: use UTS_RELEASE as FIPS version
Use the standard auto-generated kernel version string instead of a
manually assigned version number that will get out-of-date.  There was
discussion of custom version numbers being needed for certification
purposes, but it appears that they won't be needed after all.

This will produce a version string like
"5.10.66-android12-9-00017-g0b8a0a4df237".

Bug: 188620248
Change-Id: Ia369e91e4a18f489418123c672686e05ca99063d
Signed-off-by: Eric Biggers <ebiggers@google.com>
(cherry picked from commit 4e0c104075)
2021-11-11 21:20:25 +00:00
Todd Kjos
11db2de0af BACKPORT: binder: use cred instead of task for getsecid
Use the 'struct cred' saved at binder_open() to lookup
the security ID via security_cred_getsecid(). This
ensures that the security context that opened binder
is the one used to generate the secctx.

Cc: stable@vger.kernel.org # 5.4+
Fixes: ec74136ded ("binder: create node flag to request sender's security context")
Signed-off-by: Todd Kjos <tkjos@google.com>
Suggested-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Bug: 200688826
(cherry picked from commit 4d5b553974)
[ refactored to avoid changing KMI: struct binder_proc ]
Change-Id: Ie023be3190caf20ca3901560455e9f027c9426cd
2021-11-11 19:18:41 +00:00
Todd Kjos
3af7a2f610 BACKPORT: binder: use cred instead of task for selinux checks
Since binder was integrated with selinux, it has passed
'struct task_struct' associated with the binder_proc
to represent the source and target of transactions.
The conversion of task to SID was then done in the hook
implementations. It turns out that there are race conditions
which can result in an incorrect security context being used.

Fix by using the 'struct cred' saved during binder_open and pass
it to the selinux subsystem.

Cc: stable@vger.kernel.org # 5.14 (need backport for earlier stables)
Fixes: 79af73079d ("Add security hooks to binder and implement the hooks for SELinux.")
Suggested-by: Jann Horn <jannh@google.com>
Signed-off-by: Todd Kjos <tkjos@google.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Bug: 200688826
(cherry picked from commit 52f8869337)
[ refactored to avoid changing KMI: struct binder_proc ]
Change-Id: I1664c1f0c2142c17e9ca0d6790bb94de79f531e3
2021-11-11 19:18:33 +00:00
Todd Kjos
d492977395 BACKPORT: binder: use euid from cred instead of using task
Save the 'struct cred' associated with a binder process
at initial open to avoid potential race conditions
when converting to an euid.

Set a transaction's sender_euid from the 'struct cred'
saved at binder_open() instead of looking up the euid
from the binder proc's 'struct task'. This ensures
the euid is associated with the security context that
of the task that opened binder.

Cc: stable@vger.kernel.org # 4.4+
Fixes: 457b9a6f09 ("Staging: android: add binder driver")
Signed-off-by: Todd Kjos <tkjos@google.com>
Suggested-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Suggested-by: Jann Horn <jannh@google.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Bug: 200688826
(cherry picked from commit 29bc22ac5e)
[ refactored to avoid changing KMI: struct binder_proc ]
Change-Id: Icaf996a7f5543b7d6943dff3cbe89bfc3614044c
2021-11-11 19:18:25 +00:00
Liujie Xie
7e2fbdaeab ANDROID: vendor_hooks: Add hooks for frequency optimization
These hooks will do the following works:
a) Record the number of times when target_freq being clamped
b) Record the number of times when target_freq is greater than policy->cur
c) Make corresponding optimization strategies in different hooks

Bug: 205906618

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I8eba66fd0c6d36393ca39045cf228b659834e0ae
Signed-off-by: xieliujie <xieliujie@oppo.com>
2021-11-11 18:50:16 +00:00
xieliujie
054a3c228a ANDROID: GKI: Update symbols to symbol list
Update get_wchan to symbol list externed by oem modules.

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function unsigned long int get_wchan(task_struct*)'

Bug: 205684022
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I2c1f5821a7ab354552a87ad4aa6aaa2336d74424
2021-11-11 18:45:15 +00:00
xieliujie
0db6925868 ANDROID: vendor_hooks: export get_wchan
Export get_wchan to get the block reason

Bug: 205684022
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I7b65bb502b805e7dac13e5f9d725da1ff70fe306
2021-11-11 18:45:03 +00:00
Finley Xiao
10f14bf944 soc: rockchip: power-domain: Fix repair status
Fixes: 57db7e6ba5 ("soc: rockchip: power-domain: Add support to repair memory when power up")

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Id0e8c3a1da54174101626f4e722913ed2e5d5b70
2021-11-11 23:26:05 +08:00
Andy Yan
03335fc9ad arm64: dts: rockchip: rk3588: Assign ACLK_VOP to 500MHZ
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I11dc0260bda92bf9870f641f8ca966395d834ce5
2021-11-11 22:57:45 +08:00
Jianqun Xu
fc3a2449a7 gpio: rockchip: add support for rk3588
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I6beb25cdcb58eae4b7af74b0990857d9288e5bc0
2021-11-11 22:48:23 +08:00
Liujie Xie
a61d61bab7 ANDROID: vendor_hooks: Add hooks to record the time of the process in various states
These hooks will do the following works:
a) record the time of the process in various states
b) Make corresponding optimization strategies in different hooks

Bug: 205938967

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: Ia3c47bbf0aadd17337ce18fd910343b1b8c3ef93
2021-11-11 22:15:49 +08:00
Liang Chen
7ecec4c49e arm64: dts: rockchip: rk3588: init ARMCLK_B23 to 1008MHz
Change-Id: I79625ee71b67a1bc8e86c17832f6331dca8c53d6
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-11-11 22:10:28 +08:00
Finley Xiao
24627eab36 arm64: dts: rockchip: rk3588: Add pd vdpu before pd rkvdec
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ia19222e78ec772b3f37121f128055f83a5b6094b
2021-11-11 22:08:29 +08:00
Sugar Zhang
314a46420e arm64: dts: rockchip: rk3588-evb: Fix config for es8388 sound
Fixes: ea6ea2ba87 ("arm64: dts: rockchip: adjust sound cards for rk3588-evbx and rk3588s-evbx")

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I7acedc41e1a34820166ec752990693546dc99064
2021-11-11 22:06:54 +08:00
Jianqun Xu
448cbad345 pinctrl: rockchip: fix rk3588 drive strength to level
Fixes: 7c357cd7cf ("pinctrl: rockchip: add rk3588 support")

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I48fd9510aebbc107fa23e502ab73779689b70197
2021-11-11 22:05:00 +08:00
Jianqun Xu
2bb4f7ee43 pinctrl: rockchip: fix rk3588 pinctrl gpio4 pin number
Fixes: 7c357cd7cf ("pinctrl: rockchip: add rk3588 support")

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I76a67d159e0974543538c9a3ff0b61328102e6dd
2021-11-11 22:05:00 +08:00
Sugar Zhang
a7143c71a5 ASoC: es8323: Fix headphone irq err
It's optional, so, do nothing when this gpio-irq omitted.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: If82c6ef3610aa47e1be3266b485305514bb1717d
2021-11-11 21:44:18 +08:00
Andy Yan
4cb725e255 arm64: dts: rockchip: rk3588: Reference pmu for vop
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I659a7aac3812cc6f12ed19108581be61defbd666
2021-11-11 20:21:41 +08:00
Andy Yan
8854c8ef52 drm/rockchip: vop2: Add submem power gate support
RK3588 VOP2 has power gates for VP0/1/2/3, DB0/1/2
and WB.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: Ie3d67aa804282834949d6950470ba960ea51fcdb
2021-11-11 20:21:41 +08:00
Yunfei Wang
6cf4b65244 FROMGIT: dma-buf: acquire name lock before read/write dma_buf.name
Because dma-buf.name can be freed in func: "dma_buf_set_name",
so, we need to acquire lock first before we read/write dma_buf.name
to prevent Use After Free(UAF) issue.

Signed-off-by: Guangming Cao <Guangming.Cao@mediatek.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/lkml/20211029021541.101157-1-guangming.cao@mediatek.com/T/

Bug: 205102180
(cherry picked from commit 8c0fd12626
 https://cgit.freedesktop.org/drm/drm-misc)
Change-Id: I4ba911137ad9dae7682230245d2fa2a19f7c209f
Signed-off-by: Yunfei Wang <yf.wang@mediatek.com>
2021-11-11 12:19:16 +00:00
Jianqun Xu
3df95bb0b9 pinctrl: rockchip: fix rk3588 iomux setting
Fixes: 7c357cd7cf ("pinctrl: rockchip: add rk3588 support")

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: If81e84796da50627497044184d11e5d15784d7e1
2021-11-11 20:13:17 +08:00
Huibin Hong
01f8963021 arm64: dts: rockchip: rk3588-linux: add debug and cspmu node
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Change-Id: I5b07ac30bb887edd36a7805bacfa7e1a47649665
2021-11-11 19:42:12 +08:00
Huibin Hong
763c97523d arm64: dts: rockchip: rk3588-android: add debug and cspmu node
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Change-Id: If8102c4f08a0fe4f578129b040212c88cad314e0
2021-11-11 19:40:48 +08:00
William Wu
603ce88ca3 HACK: arm64: dts: rockchip: rk3588-evb: set max-speed to hs for usb3
This patch sets the maximum speed to high speed for
USB 3.0 OTG on rk3588 and rk3588s evbs. It's used to
support USB 2.0 ADB during bring up stage.

In the future, if the USB 3.0 PHY driver is ready, we
can revert this patch.

Change-Id: I654894a894e38c39104dc6efe0446867f6894b7b
Signed-off-by: William Wu <william.wu@rock-chips.com>
2021-11-11 18:17:19 +08:00
Tao Huang
04264f596c arm64: dts: rockchip: rk3588-linux: Remove debug node
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I91e24e7c4c5240956a175b3683dd3c4e187bc028
2021-11-11 18:03:23 +08:00
Tao Huang
f27234ade9 arm64: dts: rockchip: rk3588-linux: Enable clk/pd always on
Debug only.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Id45fc1641fd07998ea8498c6e18013a6c54af5dd
2021-11-11 18:03:23 +08:00
Tao Huang
fb7d7606a1 clk: rockchip: Temporarily fix for rk3588 pll
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I15819f3611556e140ec80126b990408edf260c18
2021-11-11 17:18:31 +08:00
Tao Huang
e0e8de4a77 arm64: dts: rockchip: rk3588: Disable set PLL_CPLL
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I1e6d9e26ad56da0e328bf1fb4b8656e5acf7248d
2021-11-11 17:17:45 +08:00
Tao Huang
a0a7792bbe arm64: dts: rockchip: rk3588-android: Remove debug node
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I4c4a312c22b362605dc9362cdeddb71ef38c4637
2021-11-11 17:16:52 +08:00