RK1000 is a digital-analog mixed chip which has tve output function.
RK1000's registers can be written and read through I2C interaface.
Because RK1000's I2C need dclk and mclk, RK1000 TVE should be registered
after RK1000 CORE.
Change-Id: I65b40826bd1dbf07d4fa94ecdf8c75005008731f
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
RK1000's control register block need mclk for i2c communication.
So mclk should be enabled in advance.
RK1000's control register block should be registered before RK1000
TVE.
Change-Id: Iba9a2a410fe927666072f8d246995462a860ec3a
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
This driver is modified to support RK3588 SoCs.
Change-Id: I69aa0607ccac7256d40a5e6c89c8ba5d2155eb53
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
According to a description from TRM, add all the power domains.
Change-Id: I0ab9442b3310b04a8dc8e1a10c30d6754ca3e8f9
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
rk3588 is a full version chip and have more periphral interface base on
rk3588s.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I3280fcacb667f5ed49ca7146f26b7c256147d281
rk3588s is a small package version of rk3588, which have less
peripherial interface, so we use it as base version and rk3588 will be
the full version.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I56418768af54e76db3d751f3151ff056109b7f18
This initialize version support single core cpu, timer, uart and gic.
Add dmac device nodes.
Add cru device node.
Add sdhci node, rk3588 is using dwcmshc controller as eMMC controller.
The controller is different from that of rk3568 and the driver
needs to be identified and handled specially.
Add sdmmc0 node. Use temp xin24m clock, will need to update to smci clock
which is not ready for now.
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I7fadb39ddb1827bdd5a816149f6e129b94ae2395
Add the clock tree definition for the new RK3588 SoC.
Change-Id: I055dafbe1587606c56a5553cbb3d4772bd84f97b
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Add the dt-bindings header for the rk3588, that gets shared between
the clock controller and the clock references in the dts.
Add softreset ID for rk3588.
Change-Id: I9fa9d27a187a6951c5c1cf210b0eff988a41457e
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
In order to improve the main frequency of CPU, the clock path of CPU is
simplified as follows:
|--\
| \ |--\
--apll--|\ | \ | \
| |--apll_core--| \ | \
--24M---|/ |mux1 |--[gate]--|mux2|---clk_core
| / | /
--gpll--|\ | / |------| /
| |--gpll_core--| / | |--/
--24M---|/ |--/ |
|
-------apll_directly--------------|
When the CPU requests high frequency, we want to use MUX2 select the
"apll_directly".
At low frequencies use MUX1 to select “apll_core" and then MUX2 to
select "apll_core_gate".
However, in this way, the CPU frequency conversion needs to be
in the following order:
1. MUX2 select to "apll_core_gate", MUX1 select "gpll_core"
2. Apll sets slow_mode, sets APLL parameters, locks APLL, and then APLL
sets normal_mode
3. MUX1 select "apll_core", MUX2 select "apll_directly"
So add pre_muxs and post_muxs to cover this special requirements.
Change-Id: I944c22f774f5f9c4edaf28099b6c2926076d4749
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
add pll_rk3588 and pll_rk3588_core type for RK3588 Soc.
Change-Id: Ie84adcb1ff8fe59efc212feee3ed872bb318fc8b
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Document the device tree bindings of the rockchip Rk3588 SoC
clock driver in
Documentation/devicetree/bindings/clock/rockchip,rk3588-cru.yaml.
Change-Id: Ic5b5bbb017c477658d3ae0119c8ec22685daa837
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
The cores select parent register is special on RK3588.
Change-Id: I1cfd07064ae7092030a6b9d234049e6cf07a23e8
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Refactor conversion operation to support new saradc, separate
start, read, powerdown in respective hooks.
Change-Id: Iacb043d14f7867b45bf0c4c74c2bedd21d398944
Signed-off-by: Simon Xue <xxm@rock-chips.com>
rkvdec2 link mode use a new serialized work flow.
This process is for link mode decoder in RK356x.
The new flow run async with hardware and use multiple trigger event to
run the work thread. All task operation, power operation and reset
operation are serialzed in one thread with certain order.
This is mainly for runtime debug and it will simplify the system design.
rkvdec2 link mode use two sets of counters to control the hardware io:
1. write / read task for preparing link mode task to ddr.
2. send / recv task for sending / receiving task from hardware.
All the operations are serialized in single work thread. So only a few
of lock and atomic is required.
The decoded counter and total counter are the synchronization method
between driver and hardware.
NOTE:
1. link mode reset should use sip_reset.
2. link mode should not change hardware frequency or power off when
there is still task running.
3. link mode should not access hardware when there is an error happen.
4. link mode should reserve a stuff task for H.264 decode task.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I7736d54a64225089cd6d1b6522f660ce4481d437
1. Remove unused state
The link mode process will be moved to new function.
2. Remove reduce frequency function
The future link mode process should not reduce hardware frequency.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I173912e149e68aca97d5367ce92facf1af05eda7
Add new function pointer for process task, wait task result and task
worker thread.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ib0b23c90083b9acab6a8eec8db0871304dbb72ca
Failed to enable jpeg dec hw when the soft-reset of
the previous frame has not been completed.
So we have to manually trigger to do soft-reset when checking
that the soft-reset of this frame is not completed
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ib4cbb3c8a42af9d7235bcf41194f5b9ea7c9e207
Due to hardware timeout the session may be released before the remaining
task is alll finished. So mpp_free_task could run after mpp_dev_release.
Then the session used in mpp_free_task could be invalid and crash the
thread.
So we attach session to the mpp_taskqueue and let the work thread to
destroy and release session later.
NOTE: the session is created in mpp_dev_open and attached to
corresponding taskqueue on client init. So when we release the session in
mpp_dev_release if the session is not attached to certain taskqueue just
release it immediately.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I9d4b2358154522e6bcde6e688592c0058781529a
The kthread has less context switch overhead comparing to workqueue.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I509d8cd86c0966a2bfee8cb8459753368050b2b3
tips:
for rk356x, when image width less than 512, it may occur very
small probability for sram read and write.
Change-Id: I57bdfeb776dc0762870f3d7a3a6d81a1c146240d
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
tips:
1. If fd has imported, then just copy mem_regiony struct.
2. Task is the unit for running, and mem_region is the
internal element of task.
3. In mem_regions, it can only kref_get once with the same fd,
instead of all fds which the same fd.
Change-Id: I7236803a5a263d6e79256036caf580b5ac2c35e9
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
reason: mem_regions are within a task, and the differ time between
mem_region can be ignore. Thus, it can be remove when attach task fds.
Change-Id: I5986d2dca6eff41d6c6a8fa3f037e183b102e63c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
if rcb_info not change, then the infos will not ioctl from userspace.
thus, it needs to restore infos in session.
Change-Id: I4ff3b5bcc22b033b1d7549866af7c253bf46945c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Enable blending and intra interpolation by default.
Change-Id: I3f304714d630b4aab677ab6d09cfea514b03d7b1
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
if property set, then it will skip get/set/reduce freq.
Change-Id: I56f641807327e9e63b8ebc0c91e79ffb19680b1c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
drivers/video/rockchip/mpp/mpp_rkvdec2.c:1029:16: warning:
format '%llx' expects argument of type 'long long unsigned int',
but argument 3 has type 'resource_size_t {aka unsigned int}' [-Wformat=]
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I5bb3ac3a2d5d2d41c802e42ed6a26efb5219d0aa
reason: when kernel version later than mpp which user space, then
it will meet unknow cmd. however, it should not return error, and
let it continue instead.
Change-Id: I1209c27ef8de98f25b47700bc48dfcff305e0c0e
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
tips: In the whole process, task is the unit, and it can only be
one state. And mem_region is an internal element, so no lock is
required.
Change-Id: I07955d0d7064c3c6aec6968d0d38d6e0ad378289
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
1. Add mpp_dev task capacity and default is 1.
The task capacity is the task queue length that hardware can accept.
Default 1 means normal hardware can only accept one task at once.
2. Attach mpp_dev to mpp_taskqueue for status probe. The task queue
capacity is the minimum task capacity of all the attached mpp_dev.
Change-Id: I8cafe806ec9399902237418d2bbcb088240ed415
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>