Commit Graph

598375 Commits

Author SHA1 Message Date
Mark Yao
60f4bf97d6 ARM64: dts: rk3399-android-next: optimize display node
Change-Id: Icbbc34bc375f6b7106966b6ea40047cc8469594d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-12-02 14:12:07 +08:00
Mark Yao
c0f3fdf9a2 drm/rockchip: boot_logo: support logo fullscreen or center display
Change-Id: I2f688b84172de015eb59187d0d3de06e6764346e
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-12-02 14:10:45 +08:00
Huang, Tao
3b31b9444d arm64: rockchip_defconfig: Use ext4 for ext2 file systems
also disable F2FS_FS_POSIX_ACL
save about 40KB size

Change-Id: I2a134966ece2a3f74014c059d2dd5bbccfe52b61
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-12-02 11:45:08 +08:00
Huang, Tao
406b0ea3dc arm64: rockchip_defconfig: remove some ramdisks compressed mode
disable
CONFIG_RD_BZIP2
CONFIG_RD_LZMA
CONFIG_RD_XZ
CONFIG_RD_LZO
CONFIG_RD_LZ4
for save about 20KB size.

Change-Id: I15614e3a300eca6a40c62da5af2ce5cbd0b6994f
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-12-02 11:45:07 +08:00
Huang, Tao
8b0e4d06d9 arm64: rockchip_defconfig: enable HZ_300
Change-Id: I19e780388de746dc8d7b6099663909fb2b20d107
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-12-02 11:45:06 +08:00
Huang Jiachai
3758e9ae07 video: rockchip: fb: update mirror for vr
Change-Id: Ibdd0e60991490115428ed04027cbaef717951d3b
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2016-12-02 11:45:05 +08:00
Huang Jiachai
a9a36e5f2c video: rockchip: fb: fix warning
Change-Id: Id15ac3f4f83fe788c9568f0acc78b8d4260c0579
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2016-12-02 11:45:04 +08:00
Randy Li
2f12c66521 video: rockchip: vpu: change the license to GPL v2
The proprietary license would make some kernel reasouces and
function unavailable.

Change-Id: Ibaea3e3389ab05dbd60adfcc0d7e3bba787415c4
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2016-12-02 11:45:04 +08:00
Randy Li
7211f1afbe video: rockchip: vpu: fix the makefile
Keeping the build result as a single module.

Change-Id: I9f33851d9f309c344804a81375a9417daab152f9
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2016-12-01 19:07:25 +08:00
Randy Li
1cace329a8 video: rockchip: vpu: use device tree to find out target SoC
Although the SoCs before RK3288 may not support device tree,
but it could keep forward compatible.

Change-Id: Id0e4ae3ee29ce7f45c6840cf6db5eb069c9502a5
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2016-12-01 19:04:06 +08:00
Mark Yao
cc5ac765a0 drm/rockchip: boot_logo: encoder atomic_check before enable crtc
We need update encoder output_mode and output_type before enable crtc.

Change-Id: If0c05b4d254dcac2abd6fc024fc3ffc1c5f02323
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-12-01 17:11:46 +08:00
dalong.zhang
8dee825732 camera: rockchip: camsys_drv v0.0x21.7
Change-Id: Id8d254f74b3eeb251d7369dc866f32f026d606df
Signed-off-by: dalong.zhang <dalon.zhang@rock-chips.com>
2016-12-01 10:06:34 +08:00
dalong.zhang
8768af65f5 arm64: dts: rockchip: rk3399-android-next: add isp
Change-Id: I8db91aae4dfd9c1b1ad39adb1e8377aba0c34fca
Signed-off-by: dalong.zhang <dalon.zhang@rock-chips.com>
2016-11-30 21:17:17 +08:00
dalong.zhang
0aa1636f87 ARM64: dts: rockchip: rk3399: add iommu for isp
Change-Id: Ic405ab5877355ed4128e3f473c21acdf5d026d1d
Signed-off-by: dalong.zhang <dalon.zhang@rock-chips.com>
2016-11-30 21:14:50 +08:00
Randy Li
60ff0ef3a1 ARM: dts: rockchip: enable the vpu service for rk3288 evb
Both VPU and HEVC service are enabled.

Change-Id: Id6dc1f0139636e8b2016b9194adddc3f87ec4e19
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2016-11-30 15:58:34 +08:00
Randy Li
6aebfdaedd ARM: dts: rockchip: add hevc vpu service for rk3288
Change-Id: I87a8c9df636e04b92948c87c27e82b43a67de184
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2016-11-30 15:57:16 +08:00
dalong.zhang
308a7ec7b3 camera: camsys_drv: v0.0x21.6 support drm
Change-Id: If0305388c5b445adbcf693504849a6be000e64a9
Signed-off-by: dalong.zhang <dalon.zhang@rock-chips.com>
2016-11-30 14:20:16 +08:00
dalong.zhang
2d41574b80 ARM64: dts: rk3399-evb-rev1-android: enable isp0&isp1
Change-Id: I88dda6f8e90f549ff1bbe791acec94eae30fdd45
Signed-off-by: dalong.zhang <dalon.zhang@rock-chips.com>
2016-11-30 14:19:42 +08:00
Tomeu Vizoso
f5202c54dd UPSTREAM: iommu/rockchip: Don't feed NULL res pointers to devres
If we do, devres prints a "invalid resource" string in the error
loglevel.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
(cherry picked from commit 8d7f2d84ed)

Change-Id: I3849bcaa4ceaea3247a8169b2a123a834011fbc5
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2016-11-30 14:10:39 +08:00
Jeffy Chen
dc7e965076 Revert "iommu/rockchip: fix bool operation error and probe warning"
This reverts commit e0492807e6.

Same issue fixed by upstream(e04928 "iommu/rockchip: fix bool operation
error and probe warning) which picked as (2e7026 "UPSTREAM: iommu/rockchip:
Fix "is stall active" check).

Conflicts:
	drivers/iommu/rockchip-iommu.c

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Change-Id: I56e61894b1da14bce78ae1b3d08158dfb5b027bb
2016-11-30 14:10:02 +08:00
Tomasz Figa
e1b2457124 CHROMIUM: iommu/rockchip: Fix TLB flush of secondary IOMMUs
Due to the bug in current code, only first IOMMU has the TLB lines
flushed in rk_iommu_zap_lines. This patch fixes the inner loop to
execute for all IOMMUs and properly flush the TLB.

BUG=chrome-os-partner:55135
TEST=compile

Change-Id: Ica2d4b0cc3d3cbc88c70ad541dc00883f1b4e90c
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/371098
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2016-11-30 14:09:04 +08:00
Mark Yao
da6e598940 drm/rockchip: vop: fix scale abnormal after window power on/off
Change-Id: Ifcaddf2f2b1c9c031bdf28ceb80468cfb79ce52b
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-11-30 11:57:54 +08:00
dalong.zhang
bd675aa1a3 camera: rockchip: porting ov8858&ov4689&ov2710 driver
Change-Id: Ia9a0a39d347a9fd506f493c6639785267233e0ac
Signed-off-by: dalong.zhang <dalon.zhang@rock-chips.com>
2016-11-30 11:55:35 +08:00
Jianqun Xu
910f9d73a1 ARM64: dts: 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
Reviewed-by: Finley Xiao <finley.xiao@rock-chips.com>
Reviewed-by: Huang, Tao <huangtao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2016-11-30 11:24:23 +08:00
Randy Li
aba4c4996d ARM: dts: rockchip: add vpu service for RK3288
It is not harm to keep both vpu service and vpu v4l2 at the same time,
that the board file choose a driver implementation and interace to
be used.

Change-Id: If79deac5bf19395cfdca821f20486985e3034389
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2016-11-30 10:24:08 +08:00
Randy Li
0ea5e605ec ARM: dts: enable SD and GMAC at rk3288-evb
There is a bug in GMAC IP, it supports RGMII clock but not a speed
mode for it.

Change-Id: I8e5cca355c30920db37400901d3411eebca711ae
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2016-11-30 10:22:30 +08:00
dalong.zhang
8bffe04905 isp10: rockchip: v0.1.6
Change-Id: I1b702fb51d1baabd47f190fdafd79ecd22e18be0
Signed-off-by: dalong.zhang <dalon.zhang@rock-chips.com>
2016-11-29 21:11:43 +08:00
dalong.zhang
7bfa334454 ARM64: dts: rk3399-evb-rev3-android: enable isp0&isp1
Change-Id: Ib2d4f304e2fc4589d55e60d452571ed46e5dae4d
Signed-off-by: dalong.zhang <dalon.zhang@rock-chips.com>
2016-11-29 21:06:31 +08:00
dalong.zhang
0857d9c18f ARM64: dts: rk3399-evb-rev2-android: enable isp0&isp1
Change-Id: Ibd5244985eb707ca9119191cf019b56ae9055eb4
Signed-off-by: dalong.zhang <dalon.zhang@rock-chips.com>
2016-11-29 21:05:35 +08:00
dalong.zhang
dedd9545a1 ARM64: dts: rk3399-android: add isp0 node for isp10
Change-Id: I1324bd021ec87f10ad4b5fd200bdf83efd1dab66
Signed-off-by: dalong.zhang <dalon.zhang@rock-chips.com>
2016-11-29 21:05:25 +08:00
Finley Xiao
55d7dcc796 devfreq: rockchip: dmc: support sharing regulator with other devices
If the regulator is shared between several devices then the lowest
request voltage that meets the system constraints will be used.

Change-Id: I9645f3f81004c7203769a92367513d9d177504b2
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-29 14:18:28 +08:00
Finley Xiao
85b4e1dffa MALI: midgard: support sharing regulator with other devices
If the regulator is shared between several devices then the lowest
request voltage that meets the system constraints will be used.

Change-Id: I7dda43b24c7e19098db65b51ae0c4386b46ee0b7
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-29 14:18:22 +08:00
Finley Xiao
b8a2dcfd13 devfreq: rockchip: avoid DDR voltage domain keeping the initial voltage
If there is only one opp whose frequency is equal to the initial value
in opp table list, the DDR voltage domain will keep the initial voltage,
it may be too large.

Change-Id: I9e75d54bdc7d909baa72667821ff30beb4d62e27
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-29 14:17:51 +08:00
Finley Xiao
57984d5318 MALI: midgard: avoid GPU voltage domain keeping the initial voltage
If there is only one opp whose frequency is equal to the initial value
in opp table list, the GPU voltage domain will keep the initial voltage,
it may be too large.

Change-Id: I87a5fb82eaac8466123b61e39a5d7587da3066da
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-29 14:17:41 +08:00
Finley Xiao
e0a9d95a74 PM / AVS: rockchip-cpu-avs: support adjusting initial frequency and voltage
Change-Id: I377b7fccb90ecf350a37e4609bdc8f51c4e15e7a
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-29 14:17:30 +08:00
Finley Xiao
4e2c20e1e6 cpufreq: dt: delete flag CPUFREQ_NEED_INITIAL_FREQ_CHECK
As there are still some limitations, we prefer to implement it ourselves.

Change-Id: Ic801ed0a137b025296144cb3d8e47bcb0f8c0567
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-29 14:17:04 +08:00
Finley Xiao
8ad93d71d3 PM / OPP: Add dev_pm_opp_check_initial_rate()
Bootloader or kernel sets CPU frequency to an initial value before cpufreq
starts on rockchip platform, if cpu's opp table is modified to a specified
value, it will cause an issue.

For example, the initial frequency is 816MHz and voltage set by hardware
is 900mV:
1. there is only one opp whose frequency is 816MHz and voltage is 850mV
in opp table list, as they frequency is equal, the voltage will not be
changed, it is still 900mV and a little too large relative to 850mV.
2. there is only one opp whose frequency is 1200MHz and voltage is 1100mV
in opp table list, as it doesn't set voltage to 1100mV before set frequency
to 1200MHz in the dev_pm_opp_set_rate function, the initial voltage 900mV
cann't supply for 1200MHz, the system crash.

Change-Id: Id8c5efc34d9c94ff37921b33f5a76e059240d368
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-29 14:13:37 +08:00
Shunqian Zheng
7d48c31926 UPSTREAM: iommu/rockchip: Prepare to support generic DMA mapping
Set geometry for allocated domains and fix .domain_alloc() callback to
work with IOMMU_DOMAIN_DMA domain type, which is used for implicit
domains on ARM64.

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
(cherry picked from commit a93db2f22b)

Change-Id: Ib04827afadbfb32ca52c6842cd056952269cbe93
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2016-11-28 20:45:39 +08:00
Jeffy Chen
5faeb3ebb4 UPSTREAM: iommu/rockchip: Use DMA API to manage coherency
Use DMA API instead of architecture internal functions like
__cpuc_flush_dcache_area() etc.

The biggest difficulty here is that dma_map and _sync calls require some
struct device, while there is no real 1:1 relation between an IOMMU
domain and some device. To overcome this, a simple platform device is
registered for each allocated IOMMU domain.

With this patch, this driver can be used on both ARM and ARM64
platforms, such as RK3288 and RK3399 respectively.

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
(cherry picked from commit 4f0aba6767)

Conflicts:
	drivers/iommu/rockchip-iommu.c

Change-Id: I0424318ed0cea947e7c8f8d3b52f716f6cc98ce0
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2016-11-28 20:45:31 +08:00
Shunqian Zheng
4ba9328836 UPSTREAM: iommu/rockchip: Fix allocation of bases array in driver probe
In .probe(), devm_kzalloc() is called with size == 0 and works only
by luck, due to internal behavior of the allocator and the fact
that the proper allocation size is small. Let's use proper value for
calculating the size.

Fixes: cd6438c5f8 ("iommu/rockchip: Reconstruct to support multi slaves")

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
(cherry picked from commit 3d08f434bd)

Change-Id: I78db8fbf3cb781745a05f8bee492dd7e8ac784c5
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2016-11-28 20:42:24 +08:00
John Keeping
2c0c5d4368 UPSTREAM: iommu/rockchip: Fix zap cache during device attach
rk_iommu_command() takes a struct rk_iommu and iterates over the slave
MMUs, so this is doubly wrong in that we're passing in the wrong pointer
and talking to MMUs that we shouldn't be.

Fixes: cd6438c5f8 ("iommu/rockchip: Reconstruct to support multi slaves")
Cc: stable@vger.kernel.org
Signed-off-by: John Keeping <john@metanate.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
(cherry picked from commit ae8a7910fb)

Change-Id: I5d6f5dd49ad0f79facee8d345c5058af80226f83
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2016-11-28 20:42:23 +08:00
Jeffy Chen
2e70264d33 UPSTREAM: iommu/rockchip: Fix "is stall active" check
Since commit cd6438c5f8 ("iommu/rockchip: Reconstruct to support multi
slaves") rk_iommu_is_stall_active() always returns false because the
bitwise AND operates on the boolean flag promoted to an integer and a
value that is either zero or BIT(2).

Explicitly convert the right-hand value to a boolean so that both sides
are guaranteed to be either zero or one.

rk_iommu_is_paging_enabled() does not suffer from the same problem since
RK_MMU_STATUS_PAGING_ENABLED is BIT(0), but let's apply the same change
for consistency and to make it clear that it's correct without needing
to lookup the value.

Fixes: cd6438c5f8 ("iommu/rockchip: Reconstruct to support multi slaves")
Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
(cherry picked from commit fbedd9b990)

Conflicts:
	drivers/iommu/rockchip-iommu.c

Change-Id: I5a43eb19d515eba7daf1dc4b1592ac692c115df0
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2016-11-28 20:42:22 +08:00
Jeffy Chen
183f198ab7 UPSTREAM: arm64: dts: rockchip: add gmac needed pclk for rk3399 pd
This patch fixes that sometimes hang at start-up time of the system.
As the below log:
...
[   11.136543] calling  pm_genpd_debug_init+0x0/0x60 @ 1
[   11.141602] initcall pm_genpd_debug_init+0x0/0x60 returned 0 after 11 usecs
[   11.148558] calling  genpd_poweroff_unused+0x0/0x84 @ 1
<hang>

In some cases, the rk3399 should turn off the gmac power domain to save
power if some boards didn't register the gmac device node for rk3399.
Then, rk3399 need to make sure the gmac's pclk enabled if we need
operate the gmac power domain. (Due to the NOC had enabled always)

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(am from git/mmind/linux-rockchip.git branch for-next
 commit 2afc1db0c5)

Change-Id: I8425b83e617de9eafaa093c3342b8e6082eb4112
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2016-11-28 17:58:08 +08:00
Mark Yao
939aa1c509 drm/rockchip: vop: fix display flash when switch to iommu mapping
Do iommu mapping with looping vop vblank register have a problem, when
iommu attach take too long time or vblank time is too short, the display
would flash.

This patch use another method to fix this problem:
  Use standby and dsp_hold interrupt to enter vblank time, when iommu
  mapping is finish, exit vop standby, then vop would start scanout
  immediately,
      vop enter standby    -> |
      dsp_hold irq         -> |--------- vblank start
      do iommu mapping     -> | vblank time
      exit standby         -> |--------- vblank end

We try add 20ms delay to iommu attach, display also looks good, that
means this method have higher compatibility.

Change-Id: I59d57c9085631d0c42174ea18890c80e26b42d22
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-11-28 11:52:35 +08:00
Jacob Chen
078f5873cf drm: rockchip: sync rga driver from 3.14
Change-Id: I503006eea09a9352186eeac645f03f513213c148
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2016-11-28 11:50:02 +08:00
Chen Liang
8ab24059e3 ARM64: dts: rk3399: add clock-latency-ns for each opp
We may miss clock-latency-ns when disable some opps, then cpufreq
will fallback to performance governor, so add clock-latency-ns for
each opp to make disable opp easy.

code as below:
drivers/cpufreq/cpufreq.c:2010
if (policy->governor->max_transition_latency &&
    policy->cpuinfo.transition_latency >
    policy->governor->max_transition_latency) {
	if (!gov)
        	return -EINVAL;
	else {
      		pr_warn("%s governor failed, too long transition latency of HW,
			fallback to %s governor\n",
                	policy->governor->name, gov->name);
        	policy->governor = gov;
	}
}

Change-Id: I93cff667deb487baa0115b7af0206f0803010d37
Signed-off-by: Chen Liang <cl@rock-chips.com>
2016-11-24 16:48:13 +08:00
Chen Liang
fd7cc6839d cpufreq: cpufreq_interactive: avoid NULL point access
Change-Id: Id21a45eff24575ade7786a88d076ddd50cba6520
Signed-off-by: Chen Liang <cl@rock-chips.com>
2016-11-24 16:35:50 +08:00
Mark Yao
d6a5afc432 drm/rockchip: add rk3399 vop big csc support
Change-Id: I61df68291467edfd030166b3074b44c6fdca5ffb
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-11-24 13:00:07 +08:00
Mark Yao
931337c856 drm/rockchip: support 10bit yuv format
Change-Id: I7c1f9c3b0a4b8e711d8ce198af9b94bd7639bf17
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-11-24 12:59:41 +08:00
Mark Yao
a98cfbe2de drm: add 10bit support for yuv format
drm_format_plane_cpp use byte size, not works for 10bit
format, use drm_format_plane_bpp instead.

Change-Id: If1a6ca1c286747fdc868184cebe75eb0af0a746d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-11-24 12:59:29 +08:00