Commit Graph

1059057 Commits

Author SHA1 Message Date
Elaine Zhang
37db30fb9d clk: rockchip: support common clks driver build as tristate module
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: Id3e2ea425ce4ad59848ce537f239fba4f135fb78
2021-07-22 16:08:56 +08:00
Elaine Zhang
3151edc8a4 clk: rockchip: Avoid __clk_lookup() calls
clk pointer gets cached in the driver's private data and
can be used later instead of a __clk_lookup() call.

clk provider clk_data.clks[] and we can reference
the clk pointers directly rather than using __clk_lookup()
with global names.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I058413a912e0eaf5bf551d2515ad55ae28709985
2021-07-22 16:08:56 +08:00
Elaine Zhang
938e2f2261 clk: rockchip: drop use of rockchip_clk_protect_critical()
Rockchip common clocks to support GKI,
Avoid __clk_lookup() calls,so needed to replace the
rockchip_clk_protect_critical, and use the flag
CLK_IS_CRITICAL.(but use flag CLK_IS_CRITICAL,
the enable count is always "0")

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: Idfccd72db2abe43d5f3236e7bd065873b62279ea
2021-07-22 16:08:56 +08:00
Yu Qiaowei
ae9dcc9b51 video/rockchip: rga2: Add format support
Add BGR565/BGRA5551/BGRA4444.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I248c739d96afa2ec65a7092c7b584fb4730fb0f3
2021-07-22 11:06:34 +08:00
Yu Qiaowei
afe21ac330 video/rockchip: rga2: Modify blend formula
The maximum alpha is 255, but after the product of color and alpha
in the blend formula, the final result is >> 8 (/256) instead of
/255, which will introduce errors.
This fix is that when alpha is 0x80~0xff, then +1.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ibba964f29a11eb226aa008a0dd5bf89048524b43
2021-07-22 11:06:34 +08:00
Yu Qiaowei
d9a8656672 video/rockchip: rga2: Fix the initialization of RGA2 version number
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ib66a7c09def302ce7ad3c2bbff9be9946175c4c6
2021-07-22 11:06:34 +08:00
Yu Qiaowei
11dc8266de video/rockchip: rga2: Add support for full csc (RGB2YUV/YUV2YUV).
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I72fcbc85a5bc24357d64579dd56b8a20715e59bc
2021-07-22 11:06:34 +08:00
Yu Qiaowei
fd4c04f35d video/rockchip: rga2: support Y400 input.
By making the Y channel and the UV channel's access address equal,
the function of RGA input grayscale image is realized, without
need to allocate extra UV channel memory.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I0110ec6935c7233905e724be3df9f4fba9ef8cf0
2021-07-22 11:06:34 +08:00
Yu Qiaowei
f8a2033273 video/rockchip: rga2: Add new features in compat_ioctl.
Some features are not updated to compat_ioctl, so add them.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Id89a0826a4125af97398200f7ce6e3cc73de4342
2021-07-22 11:06:34 +08:00
Yu Qiaowei
011fb8af04 video/rockchip: rga2: Fix the wrong judgment of err_get_sg.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Iec9ac3492642bb00e212b9c2862bf9fa1d8a964c
2021-07-22 11:06:34 +08:00
Yu Qiaowei
0bc139188f video/rockchip: rga2: Fix YUV output error.
Fix some modes that did not set the U/V address and
cause the output error of the YUV format image.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I41abd364576e0a73fd501f3dfc726eeaa6c9b118
2021-07-22 11:06:34 +08:00
Yu Qiaowei
ae24d87219 video/rockchip: rga2: Support 8G DDR.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I2583cd7f96362803fd57a25f42aad21e23e837d4
2021-07-22 11:06:34 +08:00
Yu Qiaowei
190b684905 video/rockchip: rga2: Support 8K resolution.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Icf7a3aa835560abab1b7d6981952aa1534a4f694
2021-07-22 11:06:34 +08:00
Tao Huang
e59ba88fc6 soc: rockchip: cpuinfo: system_serial_high/low depends on CONFIG_NO_GKI
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I14ff92773131360d933c288b82894a2f41a0c2ef
2021-07-21 19:28:10 +08:00
Elaine Zhang
2e0cbf871b clk: rockchip: rv1126: support driver build as tristate module
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: Ic2607451680d7ba07999e9d18e962005bc92f31a
2021-07-21 10:55:11 +08:00
Tao Huang
6fbbbac945 arm64: rockchip_gki.config: Enable CONFIG_RK_NAND
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ic5424e6ce43ad55b4b152b91f4fb98b87188727b
2021-07-20 20:01:15 +08:00
Yifeng Zhao
e2febb290f drivers: rk_nand: enable rk nand flash support
Here a short summary of the changes:
- Modify the definition of proc ops
- Support mq
- Remove mtd partition support
- Add an independent GC thread to do garbage collection in idle time
- Remove some apis that are no longer used

Change-Id: I2ea7fe6218b32666b91fce54bc17f976feb7f4d2
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
2021-07-20 20:01:10 +08:00
Bian Jin chen
cdbd84b757 rk: .gitignore: ignore lds files.
Fixes: 27eb5ffcb7 ("ANDROID: Add missing CFI jump table symbols to kallsyms")
Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
Change-Id: Ib688ea9db0d434d110d12b893235dedc60e458eb
2021-07-20 19:58:52 +08:00
Yandong Lin
6d15ea1ac3 video: rockchip: mpp: adapt to kernel 5.10
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ie34b851e57c4f80c798117cea026cf7255859423
2021-07-20 19:00:04 +08:00
Huibin Hong
f7382476af serial: 8250: add /dev/ttySx when uart is enable
before the patch:
ls /dev/ttyS
ttyS0 ttyS1 ttyS2 ttyS3 ttyS4 ttyS5  ttyS6 ttyS7

after the patch:
ls /dev/ttyS
ttyS3  ttyS4  ttyS6

Change-Id: I844523408751cb579bbfb50fafb7923d5c2cafdf
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-07-20 18:44:49 +08:00
Finley Xiao
987c3373f8 cpufreq: governor: userspace: Fix frequency error when resume
As policy->cur may be changed by thermal and cpufreq_suspend,
the setspeed may be changed after resume.

Change-Id: I6d4e0672ff39127c522f305719afd52806c31f48
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-20 18:10:44 +08:00
Finley Xiao
d58bcc8c2b soc: rockchip_system_monitor: Add support to limit volt during system startup
Now a regulator device can supply multiple consumers at the same time,
if a consumer starts and set a low voltage, another consumer doesn't
start in kernel but has been set a high frequency in bootloader will
abort.

This patch implements the same function as the commit
d712e9b8d5 ("regulator: core: Add support to limit min_uV during system startup")
in 4.19.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I3266d120c1b9327248a509196c0c32a26c0c355e
2021-07-20 17:58:25 +08:00
Finley Xiao
b3ad66a371 regulator: debugfs: Adding debugfs functions into regulator framework
This change allows the user to read and edit regulator information
in user space through the debugfs file system.

Base on msm work.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I038d2ad43ece4ed927db1ff36c7d1a644c1cf3d1
2021-07-20 16:58:43 +08:00
Andy Yan
e9881c87d7 drm/rockchip: vop2: fix hdr delay number setting when port_mux is not at last
HDR window is fixed(not move in the overlay path with port_mux change)
and is the most slow window. And the bg is the fast. So other windows
and bg need to add delay number to keep align with the most slow window.
The delay number list in the trm is a relative value for port_mux set at
last level.

Change-Id: I731b909c0a3f483be081e16610536b4ce5b9b8b0
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-07-20 16:48:22 +08:00
Andy Yan
355191f0e3 drm/rockchip: vop2: Disable all other multi area when disable area0
When area0 is disabled, all other sub multi area must be
disabled, or the win may run into unexpected situlation:
such as post_buf_empty or iommu fault.

Change-Id: I8a92e45849cfc31af029ba0e86562751be92ddbd
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-07-20 16:48:12 +08:00
Andy Yan
e1c6772ef9 drm/rockchip: vop2: No register mirror win when only one vp used
when only one vp(crtc) is registered to drm, all the
plane->possible_crtc will be force set to this crtc.
this make current hwc think that all these planes can be
assigned to this crtc, but the mirror plane(rk3566 feature)
cant't be activated on the same crtc with source plane.

So if some boards only use one vp(crtc), don't register
mirror plane.

Change-Id: Ib25246cf44a0fc4caf98e7c6d21ebba18f1a6c88
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-07-20 16:47:59 +08:00
Sandy Huang
23110bdcf0 drm/rockchip: vop2: rk356x three vp share one gamma
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Iddaf85a902feaa1c2a6004a1b8c2f419135cd039
2021-07-20 16:47:28 +08:00
Sandy Huang
4d56f3cc51 drm/rockchip: vop2: Add vcnt event
Change-Id: If00eeee975d8f073d27ae584c096e6a7de1df95b
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2021-07-20 16:41:43 +08:00
Sandy Huang
c0b956d7c7 drm/rockchip: drv: Add vcnt event
The vcnt event is similar to vblank event, but userspace can set the
time(which scan line) when the event occur.

This add a new event type: DRM_EVENT_ROCKCHIP_CRTC_VCNT userspace create
this event by ioctl DRM_IOCTL_ROCKCHIP_GET_VCNT_EVENT

Change-Id: If3da4bb29469ac7dc379e9462994aeda3202d3d2
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2021-07-20 16:22:24 +08:00
Sandy Huang
2e79c5086d drm/rockchip: drv: add open/close function
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I5adad7f8ac7a03391c08b53ef8a931086520f2e9
2021-07-20 16:09:20 +08:00
Sandy Huang
e2355b4b8b drm/rockchip: drv: add iommu fault handler
move rockchip_register_crtc_funcs/rockchip_unregister_crtc_funcs
position by the way for easy to compare with linux 4.19

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I7959f654d9a0d3ea24bb747446f36c649797e2e0
2021-07-20 16:09:16 +08:00
Sandy Huang
4f8318d63e drm/rockchip: drv: add rockchip_drm_get_sub_dev_type
before this commit, the DMC driver use drm_device_get_by_name() to get drm
connector info, now we use rockchip_drm_get_sub_dev_type() to instead of
it.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ief6546d933fbb49e46e6e8d2a99464eb5951e069
2021-07-20 14:52:51 +08:00
Sandy Huang
b441d298c9 drm/rockchip: drv: add rockchip_drm_add_modes_noedid
rockchip_drm_add_modes_noedid() used to get the following
recommend modes at rockchip platform when get edid failed:

the recommend modes is: 480p60, 576p50, 720p50, 720p60, 768p60,
1080p50, 1080p60 and 720p60 is the preferred mode.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I9c82b3949506a616e8c98bfa2d77532bdb870390
2021-07-20 14:52:51 +08:00
Sandy Huang
a430ff906a drm/rockchip: gem: Add GEM create ioctl support
Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313a
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2021-07-20 14:52:51 +08:00
Huibin Hong
116c907ea3 serial: 8250: add line error log
Change-Id: I69fe6f0c0857ade25e777be388fcab6261f1a533
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-07-20 10:43:29 +08:00
Huibin Hong
cb6de0208d serial: 8250: reset uart when set baud rate
If external device sends data continuously, then uart is
always busy, and baud rate can't be set. It is useful
to reset uart and set loop back mode to make sure it is
idle.

Change-Id: I87286711870ff685ea29e36e61c97d45be5a6d08
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-07-20 10:35:12 +08:00
Huibin Hong
81c6726b7d serial: 8250: modify warning log about dma request fail
Change-Id: Ib26ef05bb04542ff8d4527a8e7a79cae4dcaa31d
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-07-20 09:55:25 +08:00
Huibin Hong
4833eaec1b serial: 8250: set fifo rx trigger 1/2 of fifo
To reduce the uart interrupts, which may cause:

serial8250: too much work for irq xx

Change-Id: I89e0d990677e4cffae431e60521b3e16e8381f05
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-07-20 09:23:50 +08:00
Huibin Hong
9019ec4fcd serial: 8250_dw: set CPR 0x00023ff2 if it is 0
The UART CPR may be 0 of some rockchip soc,
but it supports fifo and AFC, fifo entry is 32 default.

Change-Id: I44f420c556f703c2848c38dc8449546274ef887d
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-07-20 09:23:50 +08:00
Bian Jin chen
d2573a1eaa arm64: configs: Add rockchip_gki.config
convert from rockchip_defconfig to rockchip_gki.config by this script:

make gki_defconfig
cp .config gki.config

scripts/kconfig/merge_config.sh -m arch/arm64/configs/gki_defconfig arch/arm64/configs/rockchip_defconfig
make olddefconfig

scripts/diffconfig -m gki.config .config | sed -e "s/ is not set/=n/" -e "s/# //" > d.config
sed -e "s/ is not set/=n/" -e "s/# CONFIG_/CONFIG_/" -e "/#.*/d" -e "/^$/d" gki.config > g.config
> r.config
for i in $(cat d.config); do
	c=${i%%=*};
	v=${i##*=};
	if grep -q "$c=n" g.config; then
		if [ "$v" == "y" -o "$v" == "m" ]; then
			echo $c=m >> r.config;
		fi
	elif ! grep -q "$c=" g.config; then
		if [ "$v" == "n" ]; then
			echo "# $c is not set" >> r.config;
		elif [ "$v" == "y" ]; then
			echo $c=m >> r.config;
		else
			echo $c=$v >> r.config;
		fi
	fi
done
sed -i 's/CONFIG_ARCH_ROCKCHIP=m/CONFIG_ARCH_ROCKCHIP=y/' r.config

scripts/kconfig/merge_config.sh -m arch/arm64/configs/gki_defconfig r.config
make olddefconfig 2>&1 | grep invalid | sed "s/.*symbol value 'm' invalid for /CONFIG_/" > nm.config

> r.config
for i in $(cat d.config); do
	c=${i%%=*};
	v=${i##*=};
	if grep -q "$c=n" g.config; then
		if ! grep -q "$c$" nm.config; then
			if [ "$v" == "y" ]; then
				echo $c=m >> r.config;
			fi
		fi
	elif ! grep -q "$c=" g.config; then
		if [ "$v" == "n" ]; then
			echo "# $c is not set" >> r.config;
		elif [ "$v" == "y" ]; then
			if grep -q "$c$" nm.config; then
				echo $c=y >> r.config;
			else
				echo $c=m >> r.config;
			fi
		else
			echo $c=$v >> r.config;
		fi
	fi
done

sed -i 's/CONFIG_ARCH_ROCKCHIP=m/CONFIG_ARCH_ROCKCHIP=y/' r.config

scripts/kconfig/merge_config.sh -m arch/arm64/configs/gki_defconfig r.config

scripts/config -d CONFIG_BRIDGE_NETFILTER
scripts/config -d CONFIG_BRIDGE_NF_EBTABLES
scripts/config -d CONFIG_USB_MON

scripts/config -e CONFIG_ION
scripts/config -e CONFIG_ION_SYSTEM_HEAP
scripts/config -e CONFIG_SW_SYNC
make olddefconfig

make savedefconfig
scripts/diffconfig -m arch/arm64/configs/gki_defconfig defconfig > arch/arm64/configs/rockchip_gki.config
echo "# CONFIG_USB_DUMMY_HCD is not set" >> arch/arm64/configs/rockchip_gki.config

Test: make gki_defconfig rockchip_gki.config
Status: mounted/console/adb/tp ok
TODO: check configs

Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ifecf0a0cd836cbb1510704f9d120715ff7b01b35
2021-07-19 20:20:20 +08:00
Jianqun Xu
1bfe742257 UPSTREAM: kernel/irq: export irq_gc_set_wake
Module driver may use irq_gc_set_wake.

Change-Id: I52f43e1dff15d987532395e5151e65419b5904b2
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210305080658.2422114-1-jay.xu@rock-chips.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 024c79520f)
2021-07-19 20:19:08 +08:00
Tao Huang
866525fd9f usb: gadget: transfer_type depends on CONFIG_NO_GKI
'struct dwc3_ep at core.h:704:1' changed (indirectly):
  type size changed from 1792 to 1856 (in bits)
  there are data member changes:
    type 'struct usb_ep' of 'dwc3_ep::endpoint' changed:
      type size changed from 576 to 640 (in bits)
      1 data member insertion:
        'u8 transfer_type', at offset 576 (in bits) at gadget.h:246:1
      93 impacted interfaces
    21 ('list_head cancelled_list' .. 'u64 android_kabi_reserved2') offsets changed (by +64 bits)
  2 impacted interfaces

Fixes: bcf7606d61 ("usb: gadget: add transfer_type in struct usb_ep for rockchip")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: If7b276a054a18e6f49e59def6a4edf5ce4f3b694
2021-07-19 19:57:22 +08:00
Tao Huang
e6fca31a8c clk: CONFIG_COMMON_CLK_PROCFS depends on ARCH_ROCKCHIP
Make sure this bool config do not affected by gki_defconfig.

Fixes: 9ec5db66aa ("clk: add COMMON_CLK_PROCFS to support clk debug")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Idda0c054110c8587a8b1649cf65f045242b680d7
2021-07-19 16:13:47 +08:00
Tao Huang
3e2dae58e3 fiq_debugger: CONFIG_RK_CONSOLE_THREAD depends on ARCH_ROCKCHIP
Make sure this bool config do not affected by gki_defconfig.

Fixes: 44f5b21367 ("fiq_debugger: print log by console thread")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ied79a8b68580bacc4ec27cd98d38400e48de58ba
2021-07-19 16:08:11 +08:00
Tao Huang
861b88568a of: CONFIG_DTC_SYMBOLS depends on ARCH_ROCKCHIP
Make sure this bool config do not affected by gki_defconfig.

Fixes: 2943395673 ("rk: kbuild: Introduce CONFIG_DTC_SYMBOLS")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I202378445d901e1bef20161483edc957b23d9fa1
2021-07-19 16:04:37 +08:00
Tao Huang
36040e7744 arm64: rockchip_defconfig: Disable CONFIG_CLK_RK1808/CONFIG_CLK_RK3308
RK1808/RK3308 are not supported by Android.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ieb2271c973efd249d1d99f23b92621b6ec618104
2021-07-19 15:22:03 +08:00
Elaine Zhang
3b3d17ae81 clk: rockchip: rk1808: support driver build as tristate module
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I798e59971594f7691f1ad2b3a3e67cdd37736883
2021-07-19 15:09:19 +08:00
Elaine Zhang
02e6224599 clk: rockchip: px30: support driver build as tristate module
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: Ibe09ff07f2c0182cea03e41b56afedcd94e88a44
2021-07-19 15:09:14 +08:00
Elaine Zhang
b218253046 clk: rockchip: rv1108: support driver build as tristate module
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: Ie65251277283e3770b05107b35c5516386d88a64
2021-07-19 15:09:04 +08:00
Elaine Zhang
24f8496691 clk: rockchip: rk3368: support driver build as tristate module
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I2c3c40aa80343b98377676f8e721c70c1218db42
2021-07-19 15:09:04 +08:00