platform/kernel/linux-exynos.git
5 years agoRevert "pinctrl: samsung: Add LPDDR3_PAD_RETENTION to top domain"
Marek Szyprowski [Tue, 20 Mar 2018 13:39:55 +0000 (14:39 +0100)]
Revert "pinctrl: samsung: Add LPDDR3_PAD_RETENTION to top domain"

This reverts commit 15fdfc13e005f7b8adb252eab5d03830a45eaf59.
It breaks ARM Exynos builds.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agoRevert "soc: samsung: pmu: Add the PMU data of exynos5433 to support low-power state"
Marek Szyprowski [Tue, 20 Mar 2018 12:43:52 +0000 (13:43 +0100)]
Revert "soc: samsung: pmu: Add the PMU data of exynos5433 to support low-power state"

This reverts commit 932a23cc8835867017747fc3bdbe8a460fe55974.
It breaks ARM Exynos builds.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agoRevert "soc: samsung: Add generic power-management driver for Exynos"
Marek Szyprowski [Tue, 20 Mar 2018 12:43:24 +0000 (13:43 +0100)]
Revert "soc: samsung: Add generic power-management driver for Exynos"

This reverts commit c5d72878df67345efecfd86820030ea4835c9c2f.
It breaks ARM Exynos builds.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agoRevert "soc: samsung: pm: Add support for suspend-to-ram of Exynos5433"
Marek Szyprowski [Tue, 20 Mar 2018 12:43:11 +0000 (13:43 +0100)]
Revert "soc: samsung: pm: Add support for suspend-to-ram of Exynos5433"

This reverts commit 1f4846014401dda74ae79cb56961bcff24648803.
It breaks ARM Exynos builds.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agotizen_tm2_defconfig: enable proper touchkey driver
Marek Szyprowski [Mon, 12 Mar 2018 14:58:35 +0000 (15:58 +0100)]
tizen_tm2_defconfig: enable proper touchkey driver

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agoarm64: dts: exynos: Add flash led dt node for TM2 board
Ingi Kim [Mon, 11 Dec 2017 05:15:38 +0000 (14:15 +0900)]
arm64: dts: exynos: Add flash led dt node for TM2 board

This patch adds Kinetic ktd2692 flash led device node for TM2 board.

Signed-off-by: Ingi Kim <ingi2.kim@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agomedia: s5p-mfc: Add support for V4L2_MEMORY_DMABUF type
Marek Szyprowski [Fri, 20 Oct 2017 09:33:47 +0000 (11:33 +0200)]
media: s5p-mfc: Add support for V4L2_MEMORY_DMABUF type

MFC driver supports only MMAP operation mode mainly due to the hardware
restrictions of the addresses of the DMA buffers (MFC v5 hardware can
access buffers only in 128MiB memory region starting from the base address
of its firmware). When IOMMU is available, this requirement is easily
fulfilled even for the buffers located anywhere in the memory - typically
by mapping them in the DMA address space as close as possible to the
firmware. Later hardware revisions don't have this limitations at all.

The second limitation of the MFC hardware related to the memory buffers
is constant buffer address. Once the hardware has been initialized for
operation on given buffer set, the addresses of the buffers cannot be
changed.

With the above assumptions, a limited support for USERPTR and DMABUF
operation modes can be added. The main requirement is to have all buffers
known when starting hardware. This has been achieved by postponing
hardware initialization once all the DMABUF or USERPTR buffers have been
queued for the first time. Once then, buffers cannot be modified to point
to other memory area.

This patch also removes unconditional USERPTR operation mode from encoder
video node, because it doesn't work with v5 MFC hardware without IOMMU
being enabled.

In case of MFC v5 a bidirectional queue flag has to be enabled as a
workaround of the strange hardware behavior - MFC performs a few writes
to source data during the operation.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
[mszyprow: adapted to v4.14 code base, rewrote and extended commit message,
 added checks for changing buffer addresses, added bidirectional queue
 flags and comments]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agoPCI: exynos: Remove deprecated PHY initialization code
Jaehoon Chung [Wed, 27 Dec 2017 09:43:27 +0000 (18:43 +0900)]
PCI: exynos: Remove deprecated PHY initialization code

Exynos platforms have a PCI PHY driver in the PHY framework that can be
used by the PCI host bridge drivers to initialize and manage the PHY.

Remove the deprecated PHY initialization code in the Exynos PCI host
bridge driver by updating the driver to use the PHY framework API;
modify the DT binding documentation accordingly.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
[lorenzo.pieralisi@arm.com: updated commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
5 years agommc: dw_mmc: exynos: fix the suspend/resume issue for exynos5433
Jaehoon Chung [Fri, 9 Mar 2018 06:10:21 +0000 (15:10 +0900)]
mmc: dw_mmc: exynos: fix the suspend/resume issue for exynos5433

Before enabling the clock, dwmmc exynos driver is trying to access the
register. Then the kernel panic can be occurred.

Change-Id: I99a859ab167307eede06dba52a15138424254fa1
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agoPM / devfreq: Define the constant governor name
Chanwoo Choi [Mon, 23 Oct 2017 01:32:12 +0000 (10:32 +0900)]
PM / devfreq: Define the constant governor name

Prior to that, the devfreq device uses the governor name when adding
the itself. In order to prevent the mistake used the wrong governor name,
this patch defines the governor name as a constant and then uses them
instead of using the string directly.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
5 years agoPM / devfreq: Remove unneeded conditional statement
Chanwoo Choi [Mon, 23 Oct 2017 01:32:11 +0000 (10:32 +0900)]
PM / devfreq: Remove unneeded conditional statement

The freq_table array of each devfreq device is always not NULL.
In result, it is unneeded to check whether profile->freq_table
is NULL or not.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
5 years agoPM / devfreq: Show the all available frequencies
Chanwoo Choi [Mon, 23 Oct 2017 01:32:10 +0000 (10:32 +0900)]
PM / devfreq: Show the all available frequencies

The commit a76caf55e5b35 ("thermal: Add devfreq cooling") allows
the devfreq device to use the cooling device. When the cooling down
are required, the devfreq_cooling.c disables the OPP entry with
the dev_pm_opp_disable(). In result, 'available_frequencies'[1]
sysfs node never came to show the all available frequencies.
[1] /sys/class/devfreq/.../available_frequencies

So, this patch uses the 'freq_table' in the 'struct devfreq_dev_profile'
in order to show the all available frequencies.
- If 'freq_table' is NULL, devfreq core initializes them by using OPP values.
- If 'freq_table' is initialized, devfreq core just uses the 'freq_table'.

And this patch adds some comment about the sort way of 'freq_table'.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
5 years agoPM / devfreq: Change return type of devfreq_set_freq_table()
Chanwoo Choi [Mon, 23 Oct 2017 01:32:09 +0000 (10:32 +0900)]
PM / devfreq: Change return type of devfreq_set_freq_table()

This patch changes the return type of devfreq_set_freq_table()
from 'void' to 'int' in order to check whether it fails or not.

And This patch just removes the 'devfreq' prefix and the description
of function. Because the helper functions are only used by the devfreq.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
5 years agoPM / devfreq: Use the available min/max frequency
Chanwoo Choi [Mon, 23 Oct 2017 01:32:08 +0000 (10:32 +0900)]
PM / devfreq: Use the available min/max frequency

The commit a76caf55e5b35 ("thermal: Add devfreq cooling") is able
to disable OPP as a cooling device. In result, both update_devfreq()
and {min|max}_freq_show() have to consider the 'opp->available'
status of each OPP.

So, this patch adds the 'scaling_{min|max}_freq' to struct devfreq
in order to indicate the available mininum and maximum frequency
by adjusting OPP interface such as dev_pm_opp_{disable|enable}().
The 'scaling_{min|max}_freq' are used for on both update_devfreq()
and {min|max}_freq_show().

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
5 years agoRevert "PM / devfreq: Add show_one macro to delete the duplicate code"
Chanwoo Choi [Mon, 23 Oct 2017 01:32:07 +0000 (10:32 +0900)]
Revert "PM / devfreq: Add show_one macro to delete the duplicate code"

This reverts commit 3104fa3081126c9bda35793af5f335d0ee0d5818.

The {min|max}_freq_show() show the stored value of the struct devfreq.
But, if the drivers/thermal/devfreq_cooling.c disables the specific
frequency value, {min|max}_freq_show() have to check this situation
before showing the stored value. So, this patch revert the macro
in order to add the additional codes.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
5 years agoPM / devfreq: Set min/max_freq when adding the devfreq device
Chanwoo Choi [Mon, 23 Oct 2017 01:32:06 +0000 (10:32 +0900)]
PM / devfreq: Set min/max_freq when adding the devfreq device

Prior to that, the min/max_freq of the devfreq device are always zero
before the user changes the min/max_freq through sysfs entries.
It might make the confusion for the min/max_freq.

This patch initializes the available min/max_freq by using the OPP
during adding the devfreq device.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
5 years agoLOCAL / tools: add tools for making the image and build script
Chanwoo Choi [Fri, 6 Jan 2017 07:28:07 +0000 (16:28 +0900)]
LOCAL / tools: add tools for making the image and build script

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agoLOCAL / arm64: dts: TM2: Add tizen-tm2.its file for using the u-boot
Chanwoo Choi [Fri, 6 Jan 2017 08:15:28 +0000 (17:15 +0900)]
LOCAL / arm64: dts: TM2: Add tizen-tm2.its file for using the u-boot

This patch just adds the .its file for TM2/TM2E. This file is used for
u-boot bootloader.

Change-Id: I177fcc9ae7e83b795dcfe7d151804de6e598d91d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agopinctrl: samsung: Add LPDDR3_PAD_RETENTION to top domain
Chanwoo Choi [Thu, 11 Jan 2018 02:42:32 +0000 (11:42 +0900)]
pinctrl: samsung: Add LPDDR3_PAD_RETENTION to top domain

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agoarm64: dts: exynos: Add cpu topology information for Exynos5433 SoC
Chanwoo Choi [Tue, 2 Jan 2018 02:23:20 +0000 (11:23 +0900)]
arm64: dts: exynos: Add cpu topology information for Exynos5433 SoC

Add the 'cpu-map' for the cpu topology information of Exynos5433
which has the following two clusters.
- cluster0 contains the four LITTLE cores (cpu0-3).
- cluster1 contains the four big cores (cpu4-7).

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agoarm64: dts: exynos: Add cpu_suspend property of PSCI for exynos5433
Chanwoo Choi [Tue, 29 Aug 2017 01:09:16 +0000 (10:09 +0900)]
arm64: dts: exynos: Add cpu_suspend property of PSCI for exynos5433

The ARM64 Exynos5433 supports PSCI(Power State Coordinate Interface)[1] v0.1.
When PSCI v0.1 is used, the device-tree should contain the specific entry
point such as cpu_suspend. Add the 'cpu_suspend' property in order to
support the cpuidle and suspend execution on Exynos5433 SoC.

The 'cpu_suspend' of psci is originally intended for use in idle subsystems.
Although the cpuidle and suspend-to-RAM framework have separate routine
in order to enter the low-power state, PSCI v0.1 doesn't support
the separate the entry point such as 'system_suspend' on PSCI v1.0.

So, the 'cpu_suspend' of PSCI v0.1 on Exynos5433 is used for both
cpuidle and suspend-to-RAM.

[1] http://infocenter.arm.com/help/topic/com.arm.doc.den0022d/Power_State_Coordination_Interface_PDD_v1_1_DEN0022D.pdf

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agoarm64: dts: exynos: Add iRAM device-tree node for Exynos5433
Chanwoo Choi [Tue, 9 Jan 2018 06:23:04 +0000 (15:23 +0900)]
arm64: dts: exynos: Add iRAM device-tree node for Exynos5433

Add the iRAM device-tree node of Exynos5433 which defines the memory map
of iRAM as following and it is used for suspend.
- address: 0x0202_0000 ~ 0x3000_0000

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agosoc: samsung: pm: Add support for suspend-to-ram of Exynos5433
Chanwoo Choi [Mon, 8 Jan 2018 06:24:51 +0000 (15:24 +0900)]
soc: samsung: pm: Add support for suspend-to-ram of Exynos5433

Add the specific exynos_pm_data instance for Exynos5433 in order to
support the suspend-to-ram. Exynos5433 SoC need to write the 'cpu_resume'
poiter address and the specific magic number for suspend mode.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agosoc: samsung: Add generic power-management driver for Exynos
Chanwoo Choi [Fri, 9 Mar 2018 07:17:12 +0000 (16:17 +0900)]
soc: samsung: Add generic power-management driver for Exynos

To enter suspend, Exynos SoC requires the some machine dependent procedures.
Introduce the generic power-management driver to support those requirements
and generic interface for power state management.

Change-Id: I585b9538e50f27310b860a8ccbc3776dec756a6a
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agosoc: samsung: pmu: Add the PMU data of exynos5433 to support low-power state
Chanwoo Choi [Tue, 9 Jan 2018 06:20:32 +0000 (15:20 +0900)]
soc: samsung: pmu: Add the PMU data of exynos5433 to support low-power state

Add the PMU (Power Management Unit) data of exynos5433 SoC
in order to support the various power modes. Each power mode has
the different value for reducing the power-consumption.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agoclk: samsung: exynos5433: Add clock flag to support suspend-to-ram
Chanwoo Choi [Fri, 22 Dec 2017 03:16:21 +0000 (12:16 +0900)]
clk: samsung: exynos5433: Add clock flag to support suspend-to-ram

Add the CLK_IS_CRITICAL and CLK_IGNORE_UNUSED flag
to some clocks in order to avoid the hang-out in the suspend mode.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agodefconfig: add tizen_tm2_defconfig
Marek Szyprowski [Fri, 2 Mar 2018 15:47:33 +0000 (16:47 +0100)]
defconfig: add tizen_tm2_defconfig

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agoLOCAL / ARM64: mm: increase default coherent pool size to 2 MiB
Marek Szyprowski [Wed, 7 Mar 2018 11:39:43 +0000 (12:39 +0100)]
LOCAL / ARM64: mm: increase default coherent pool size to 2 MiB

xhci drivers use a lot coherent allocations and default 256 KiB is
sometimes not enough to register xhci usb host properly.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agoLOCAL / temporary workaround for i2s/prepare_lock deadlock
Marek Szyprowski [Wed, 7 Mar 2018 11:31:50 +0000 (12:31 +0100)]
LOCAL / temporary workaround for i2s/prepare_lock deadlock

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agoLOCAL / GPU: ARM: Update MALI MIDGARD driver to v4.14 kernel base
Marek Szyprowski [Mon, 5 Mar 2018 14:55:25 +0000 (15:55 +0100)]
LOCAL / GPU: ARM: Update MALI MIDGARD driver to v4.14 kernel base

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agoLOCAL / GPU: ARM: add MALI R12P0_04REL0 drivers
Marek Szyprowski [Mon, 5 Mar 2018 14:53:32 +0000 (15:53 +0100)]
LOCAL / GPU: ARM: add MALI R12P0_04REL0 drivers

Copy 12p0_04rel0 midgard MALI driver from linux-exynos v4.1 Tizen kernel.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agoLOCAL / ARM: dts: exynos: Add MALI MIDGARD device to Exynos5433
Marek Szyprowski [Mon, 5 Mar 2018 14:54:44 +0000 (15:54 +0100)]
LOCAL / ARM: dts: exynos: Add MALI MIDGARD device to Exynos5433

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agoLOCAL / mmc: dw_mmc: exynos: skip the specific sample value
Jaehoon Chung [Wed, 6 May 2015 08:05:44 +0000 (17:05 +0900)]
LOCAL / mmc: dw_mmc: exynos: skip the specific sample value

When card is tuning, skip the specific value(0x4).
This patch is workaround.
Until find the optimal solution and root problem, use this workaround.

Change-Id: I60881de6294eab9ba4a2cbf363c3a082987350a3
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
5 years agoLOCAL / clocksource: arm_arch_timer: Don't register clockevent for Per-CPU
Chanwoo Choi [Tue, 19 Sep 2017 09:12:52 +0000 (18:12 +0900)]
LOCAL / clocksource: arm_arch_timer: Don't register clockevent for Per-CPU

The arm64 architecture enabled the arm_arch_timer always
even if arm_arch_timer is not stable. When Exynos5433 uses the
arm_arch_timer, it fails to enable/disble the secondary cpu.

To fix the hotplug issue of secondary cpu, if Exynos's MCT timer
is enabled, arm_arch_timer doesn't register the clockevent for Per-CPU.

Change-Id: Ia41f9c13889c4637391168dbc828a0bdbc7cdfff
Reported-by: Wook Song <wook16.song@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agoLOCAL / clocksource/ arch_timer: Use phy timer instead of virt timer
Chanwoo Choi [Fri, 9 Sep 2016 08:22:47 +0000 (17:22 +0900)]
LOCAL / clocksource/ arch_timer: Use phy timer instead of virt timer

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agoARM64: dts: exynos: Add mem-2-mem Scaler devices
Andrzej Pietrasiewicz [Tue, 17 Oct 2017 10:35:00 +0000 (12:35 +0200)]
ARM64: dts: exynos: Add mem-2-mem Scaler devices

There are two Scaler devices in Exynos5433 SoCs. Add nodes for them and
their SYSMMU controllers.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
ARM64: dts: exynos: Add Scaler device to MSCL power domain

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agoARM: dts: exynos: Add mem-2-mem Scaler devices
Andrzej Pietrasiewicz [Thu, 28 Sep 2017 10:28:38 +0000 (12:28 +0200)]
ARM: dts: exynos: Add mem-2-mem Scaler devices

There are 3 scaler devices in Exynos5420 SoCs, all are a part of MSCL
power domain. MSCL power domain and SYSMMU controllers (two per each
scaler device) have been already added to exynos5420.dtsi earlier,
so bind them to newly added devices.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agodrm/exynos: Add driver for Exynos Scaler module
Andrzej Pietrasiewicz [Thu, 9 Nov 2017 08:11:54 +0000 (09:11 +0100)]
drm/exynos: Add driver for Exynos Scaler module

Exynos Scaler is a hardware module, which processes graphic data fetched
from memory and transfers the resultant dato another memory buffer.
Graphics data can be up/down-scaled, rotated, flipped and converted color
space. Scaler hardware modules are a part of Exynos5420 and newer Exynos
SoCs.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos: fimc: Convert driver to IPP v2 core API
Marek Szyprowski [Thu, 9 Nov 2017 08:11:53 +0000 (09:11 +0100)]
drm/exynos: fimc: Convert driver to IPP v2 core API

This patch adapts Exynos DRM FIMC driver to new IPP v2 core API.
The side effect of this conversion is a switch to driver component API
to register properly in the Exynos DRM core.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos: gsc: Convert driver to IPP v2 core API
Marek Szyprowski [Thu, 9 Nov 2017 08:11:52 +0000 (09:11 +0100)]
drm/exynos: gsc: Convert driver to IPP v2 core API

This patch adapts Exynos DRM GScaler driver to new IPP v2 core API.
The side effect of this conversion is a switch to driver component API
to register properly in the Exynos DRM core. During the conversion
driver has been adapted to support more specific compatible strings
to distinguish between Exynos5250 and Exynos5420 (different hardware
limits). Support for Exynos5433 variant has been added too
(different limits table, removed dependency on ARCH_EXYNOS5).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos: rotator: Convert driver to IPP v2 core API
Marek Szyprowski [Thu, 9 Nov 2017 08:11:51 +0000 (09:11 +0100)]
drm/exynos: rotator: Convert driver to IPP v2 core API

This patch adapts Exynos DRM rotator driver to new IPP v2 core API.
The side effect of this conversion is a switch to driver component API
to register properly in the Exynos DRM core.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos: ipp: Add IPP v2 framework
Marek Szyprowski [Thu, 9 Nov 2017 08:11:50 +0000 (09:11 +0100)]
drm/exynos: ipp: Add IPP v2 framework

This patch adds Exynos IPP v2 subsystem and userspace API.

New userspace API is focused ONLY on memory-to-memory image processing.
The two remainging IPP operation modes (framebuffer writeback and
local-path output with image processing) can be implemented using
standard DRM features: writeback connectors and additional DRM planes with
scaling features.

V2 IPP userspace API is not compatible with old IPP ioctls. This is a
significant change, but the old IPP subsystem in mainline Linux kernel was
partially disfunctional anyway and not used in any open-source project.

V2 IPP userspace API is based on stateless approach, which much better fits
to memory-to-memory image processing model. It also provides support for
all image formats, which are both already defined in DRM API and supported
by the existing IPP hardware modules.

The API consists of the following ioctls:
- DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES: to enumerate all available image
  processing modules,
- DRM_IOCTL_EXYNOS_IPP_GET_CAPS: to query capabilities and supported image
  formats of given IPP module,
- DRM_IOCTL_EXYNOS_IPP_GET_LIMITS: to query hardware limitiations for
  selected image format of given IPP module,
- DRM_IOCTL_EXYNOS_IPP_COMMIT: to perform operation described by the
  provided structures (source and destination buffers, operation rectangle,
  transformation, etc).

The proposed userspace API is extensible. In the future more advanced image
processing operations can be defined to support for example blending.

Userspace API is fully functional also on DRM render nodes, so it is not
limited to the root/privileged client.

Internal driver API also has been completely rewritten. New IPP core
performs all possible input validation, checks and object life-time
control. The drivers can focus only on writing configuration to hardware
registers. Stateless nature of DRM_IOCTL_EXYNOS_IPP_COMMIT ioctl simplifies
the driver API. Minimal driver needs to provide a single callback for
starting processing and an array with supported image formats.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agoInput: stmfts - force async driver probe to avoid 2s delay on boot
Marek Szyprowski [Wed, 7 Mar 2018 10:20:18 +0000 (11:20 +0100)]
Input: stmfts - force async driver probe to avoid 2s delay on boot

Executing stmfts_power_on() function lasts over 2 seconds, what
significantly slows down the boot process if driver is compiled in.
Avoid this delay by forcing this driver to be probed asynchronously.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agodrm/bridge/sii8620: use micro-USB cable detection logic to detect MHL
Maciej Purski [Tue, 27 Feb 2018 07:11:34 +0000 (08:11 +0100)]
drm/bridge/sii8620: use micro-USB cable detection logic to detect MHL

Currently MHL chip must be turned on permanently to detect MHL cable. It
duplicates micro-USB controller's (MUIC) functionality and consumes
unnecessary power. Lets use extcon attached to MUIC to enable MHL chip
only if it detects MHL cable.

Signed-off-by: Maciej Purski <m.purski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agoextcon: add possibility to get extcon device by OF node
Andrzej Hajda [Tue, 27 Feb 2018 07:11:33 +0000 (08:11 +0100)]
extcon: add possibility to get extcon device by OF node

Since extcon property is not allowed in DT, extcon subsystem requires
another way to get extcon device. Lets try the simplest approach - get
edev by of_node.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agodt-bindings: add bindings for Samsung micro-USB 11-pin connector
Andrzej Hajda [Tue, 27 Feb 2018 07:11:30 +0000 (08:11 +0100)]
dt-bindings: add bindings for Samsung micro-USB 11-pin connector

Samsung micro-USB 11-pin connector beside standard micro-USB pins,
has pins dedicated to route MHL traffic.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agodt-bindings: add bindings for USB physical connector
Andrzej Hajda [Tue, 27 Feb 2018 07:11:29 +0000 (08:11 +0100)]
dt-bindings: add bindings for USB physical connector

These bindings allow to describe most known standard USB connectors
and it should be possible to extend it if necessary.
USB connectors, beside USB can be used to route other protocols,
for example UART, Audio, MHL. In such case every device passing data
through the connector should have appropriate graph bindings.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agoarm64: dts: exynos: add OF graph between MHL and USB connector
Andrzej Hajda [Tue, 27 Feb 2018 07:11:32 +0000 (08:11 +0100)]
arm64: dts: exynos: add OF graph between MHL and USB connector

OF graph describes MHL data lanes between MHL and respective USB
connector.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoarm64: dts: exynos: add micro-USB connector node to TM2 platforms
Andrzej Hajda [Tue, 27 Feb 2018 07:11:31 +0000 (08:11 +0100)]
arm64: dts: exynos: add micro-USB connector node to TM2 platforms

Since USB connector bindings are available we can describe it on TM2(e).

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Add missing interrupts property to PMIC on Trats board
Marek Szyprowski [Mon, 26 Feb 2018 14:45:41 +0000 (15:45 +0100)]
ARM: dts: exynos: Add missing interrupts property to PMIC on Trats board

PMIC node requires external interrupts for proper operation, but property
defining them was missing. This was probably caused by a limited support
for interrupts from more than one parent, which was not possible to define
when support for this board was added. Fix this by adding
'interrupt-extended' property and properly define interrupt lines for PMIC
node.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Cleanup power domain nodes in exynos3250.dtsi
Marek Szyprowski [Wed, 21 Feb 2018 10:25:15 +0000 (11:25 +0100)]
ARM: dts: exynos: Cleanup power domain nodes in exynos3250.dtsi

Device nodes in device tree should use generic names, so rename
all existing power domains to "power-domain". To keep readable domain
names in debug logs, use label property, which has been introduce by
commit b13b2330aab5 ("soc: samsung: pm_domains: Read domain name from
the new label property");

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Add support for HDMI audio on Exynos 5433 TM2 board
Sylwester Nawrocki [Mon, 12 Feb 2018 16:31:47 +0000 (17:31 +0100)]
ARM: dts: exynos: Add support for HDMI audio on Exynos 5433 TM2 board

This patch updates the sound node of the exynos5433-tm2 board
and adds clock tree configuration in order to support HDMI sound.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Update I2S0 device node in exynos5433
Sylwester Nawrocki [Mon, 12 Feb 2018 16:31:46 +0000 (17:31 +0100)]
ARM: dts: exynos: Update I2S0 device node in exynos5433

The i2s0 node name is changed to a more generic "i2s" and missing
(optional) properties are added. The #sound-dai-cells property is
required for HDMI audio support on TM2 board.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Add I2S1 device node to exynos5433
Sylwester Nawrocki [Mon, 12 Feb 2018 16:31:45 +0000 (17:31 +0100)]
ARM: dts: exynos: Add I2S1 device node to exynos5433

Add DT node for the second I2S controller available
on Exynos 5433 SoC.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoASoC: samsung: Add support for HDMI audio on TM2 board
Sylwester Nawrocki [Mon, 12 Feb 2018 16:15:37 +0000 (17:15 +0100)]
ASoC: samsung: Add support for HDMI audio on TM2 board

This patch defines I2S1 - HDMI DAI link and implements related
hw_params callback. The AUD PLL frequency is configured through
the CLK_SCLK_I2S1 leaf clock, the exynos5433 clock tree
definitions are updated in a separate patch.

The device tree parsing part is changed is a way it supports older
DTBs with just a single CPU DAI specified, without the HDMI link.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: i2s: Define the parameters list for SAMSUNG_I2S_OPCLK
Sylwester Nawrocki [Mon, 12 Feb 2018 16:15:35 +0000 (17:15 +0100)]
ASoC: samsung: i2s: Define the parameters list for SAMSUNG_I2S_OPCLK

The SAMSUNG_I2S_OPCLK is not currently used by any card driver thus we can
safely change semantics of 'dir' argument of the I2S set_sysclk() callback.
Now an enumeration is exported instead of directly using register bit field
values.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: i2s: Prevent external abort on exynos5433 I2S1 access
Sylwester Nawrocki [Mon, 12 Feb 2018 16:15:34 +0000 (17:15 +0100)]
ASoC: samsung: i2s: Prevent external abort on exynos5433 I2S1 access

It seems both PCLK_I2S1 and SCLK_I2S1 clocks need to be enabled before
I2S1 control registers can be accessed on exynos5433. If SCLK clock
is disabled an exception is triggered. To fix this parent clock of
the RCLK_SRC clock is assigned to pri_dai->op_clk so required gate
clock is handled by the runtime PM ops.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: i2s: Ensure names of supplied clocks are unique
Sylwester Nawrocki [Mon, 12 Feb 2018 16:15:33 +0000 (17:15 +0100)]
ASoC: samsung: i2s: Ensure names of supplied clocks are unique

In order to support multiple instances of the I2S IP block the platform
device name is prepended to each clock registered by the driver.
The clock-output-names property is now not used, this should not cause
any issues as, for example, CDCLK clock is referenced through DT 'clocks'
property, not by name.

This change allows to have both I2S0 and I2S1 enabled simultaneously
on exynos5433 and working properly when #clock-cells property is specified
in respective DT nodes.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: clean makefile about inexistant files
Corentin Labbe [Mon, 29 Jan 2018 12:26:16 +0000 (12:26 +0000)]
ASoC: samsung: clean makefile about inexistant files

Clean makefile rules about inexistant files.
Thoses files were removed in commit a076d418235f ("ASoC: samsung: Drop AC97 drivers")

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: Use 'samsung-i2s' cpu_dai for dai_links
Jaechul Lee [Wed, 6 Sep 2017 01:04:14 +0000 (10:04 +0900)]
ASoC: samsung: Use 'samsung-i2s' cpu_dai for dai_links

Add specific cpu_dai_name to dai_link because samsung i2s driver registers
two dais and components. Selecting one of them clearly is needed more
information like cpu_dai_name, of_node. The reason why the dai_links have
to use 'samsung-i2s' for cpu_dai is that 'samsung-i2s-sec' doesn't have a
capture functionality.

Without this code, cpu_dai will be selected the first one of the
component_list. For example, if I describe nothing to cpu_dai_name,
'samsung-i2s-sec' might be selected to HiFi Primay.

Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: i2s: Use specific name for i2s dais
Jaechul Lee [Wed, 6 Sep 2017 01:04:13 +0000 (10:04 +0900)]
ASoC: samsung: i2s: Use specific name for i2s dais

Add specific dais name when components are registered. Component and dai
name will follow their parent dev name, if the name isn't described.  In
case of this driver, each dais will have same name like '11440000.i2s0' by
fmt_single_name function.

The problem having same name is that TM2 machine driver can't detect
capture devices correctly. Machine driver doesn't know which one is proper
to use for cpu dai. The driver just selects to use 'samsung-i2c-sec' that
doesn't have capture functionality because the component of
samsung-i2s-sec is located in the first of the component_list.

I add dai name like 'samsung-i2s', 'samsung-i2s-sec' for each dais. The
reason why adding dai id to 1 is that it doesn't allow to use particular
dai name in case of when I use 0 for dai id.

Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoi2c: exynos5: rework HSI2C_MASTER_ST_LOSE state handling
Andrzej Hajda [Tue, 27 Feb 2018 07:19:00 +0000 (08:19 +0100)]
i2c: exynos5: rework HSI2C_MASTER_ST_LOSE state handling

HSI2C_MASTER_ST_LOSE state is not documented properly, extensive tests
show that hardware is usually able to recover from this state without
interrupting the transfer. Moreover documentation says that
such state can be caused by slave clock stretching, and should not be
treated as an error during transaction. The only place it indicates
an error is just before starting transaction. In such case bus recovery
procedure should be performed - master should pulse SCL line nine times
and then send STOP condition, it can be repeated until SDA goes high.
The procedure can be performed using manual commands HSI2C_CMD_READ_DATA
and HSI2C_CMD_SEND_STOP.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
5 years agoi2c: exynos5: change internal transmission timeout to 100ms
Andrzej Hajda [Thu, 30 Nov 2017 14:30:05 +0000 (15:30 +0100)]
i2c: exynos5: change internal transmission timeout to 100ms

Exynos-I2C uses default timeout of 1 second for the whole transaction,
including re-transmissions due to arbitration lost errors (-EAGAIN).
To allow re-transmissions driver's internal timeout should be significantly
lower, 100ms seems to be good candidate.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
5 years agoARM: exynos_defconfig: Enable CONFIG_EXYNOS_IOMMU
Shuah Khan [Tue, 12 Dec 2017 21:31:10 +0000 (14:31 -0700)]
ARM: exynos_defconfig: Enable CONFIG_EXYNOS_IOMMU

EXYNOS_IOMMU is disabled in exynos_defconfig since it was known to cause
boot failures on Exynos Chromebooks. The recommendation was for IOMMU to
be enabled manually on systems as needed.

A recent exynos_drm change added a warning message when EXYNOS_IOMMU is
disabled. It is necessary to enable it to avoid the warning messages.
A few initial tests have shown that enabling EXYNOS_IOMMU might be safe
on Exynos Chrome-books.

Due to some other changes in the order of operations during boot
process, power domains are initialized very early and because of the
temporary lack of devices (which are not yet added to the system), are
turned off.

This practically stops FIMD for scanning framebuffer very early during
boot, before IOMMU gets initialized and "solves" the issue, which was
the reason to disable Exynos IOMMU by default on Exynos Snow Chromebooks.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
[krzk: Extend message with Marek Szyprowski's explanation]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: exynos_defconfig: Enable missing drivers for supported Exynos boards
Marek Szyprowski [Thu, 30 Nov 2017 09:10:03 +0000 (10:10 +0100)]
ARM: exynos_defconfig: Enable missing drivers for supported Exynos boards

Enable following drivers for recently merged devices:
- perf events and ARM PMU (Performance Measurement Unit) driver for all
  Exynos boards
- CEC and S5P CEC driver for all Exynos4 and Exynos5 boards with HDMI
- Sii9234 DRM HDMI-MHL bridge for Trats2
- dedicated Odroid ASoC machine driver for Odroid XU3/XU4

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoarm64: dts: exynos: Fix typo in MSCL clock controller unit address of Exynos5433
Krzysztof Kozlowski [Wed, 20 Dec 2017 19:27:02 +0000 (20:27 +0100)]
arm64: dts: exynos: Fix typo in MSCL clock controller unit address of Exynos5433

Fix typo in unit address of MSCL clock controller (the reg entry is
correct) of Exynso5433.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoarm64: dts: exynos: Use lower case hex addresses in node unit addresses
Krzysztof Kozlowski [Wed, 20 Dec 2017 19:27:01 +0000 (20:27 +0100)]
arm64: dts: exynos: Use lower case hex addresses in node unit addresses

Convert all hex addresses in node unit addresses to lower case to
fix warnings like:
    arch/arm64/boot/dts/exynos/exynos5433-tm2e.dtb: Warning (simple_bus_reg):
      Node /soc/video-scaler@13C00000 simple-bus unit address format error, expected "13c00000"

Conversion was done using sed:
    $ sed -e 's/@\([a-zA-Z0-9_-]*\) {/@\L\1 {/' -i arch/arm64/boot/dts/exynos/*.dts*

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agoarm64: dts: exynos: Increase bus frequency for MHL chip
Andrzej Hajda [Fri, 1 Dec 2017 11:33:51 +0000 (12:33 +0100)]
arm64: dts: exynos: Increase bus frequency for MHL chip

sii8620 supports 1 MHz clock, it allows faster transmissions and according
to extensive tests allows to mitigate some obscure bugs in I2C client
logic of the chip.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoarm64: dts: exynos: Add remaining power domains to Exynos5433 SoC
Marek Szyprowski [Wed, 29 Nov 2017 11:26:38 +0000 (12:26 +0100)]
arm64: dts: exynos: Add remaining power domains to Exynos5433 SoC

This patch adds support for G2D, G3D, CAM0, CAM1, ISP, HVEC power domains
to Exynos5433 SoCs. Currently only clock controllers for those domains are
defined. CAM1 is a parent of CAM0 power domain and CAM0 is a parent of ISP
power domain.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoarm64: dts: exynos: Add AUD power domain to Exynos5433 SoC
Marek Szyprowski [Wed, 29 Nov 2017 11:26:37 +0000 (12:26 +0100)]
arm64: dts: exynos: Add AUD power domain to Exynos5433 SoC

This patch adds support for AUD power domain to Exynos5433 SoCs, which
contains following devices: a clock controller, a pin controller, LPASS
module, I2S controller, ADMA PL330 engine and UART #3 device.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoarm64: dts: exynos: Add MFC power domain to Exynos 5433 SoC
Marek Szyprowski [Wed, 29 Nov 2017 11:26:36 +0000 (12:26 +0100)]
arm64: dts: exynos: Add MFC power domain to Exynos 5433 SoC

This patch adds support for MFC power domain to Exynos 5433 SoCs, which
contains following devices: a clock controller, MFC codec device and its
SYSMMUs.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoarm64: dts: exynos: Add MSCL power domain to Exynos 5433 SoC
Marek Szyprowski [Wed, 29 Nov 2017 11:26:35 +0000 (12:26 +0100)]
arm64: dts: exynos: Add MSCL power domain to Exynos 5433 SoC

This patch adds support for MSCL power domain to Exynos 5433 SoCs, which
contains following devices: a clock controller, JPEG codec device and its
SYSMMU.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoarm64: dts: exynos: Add DISP power domain to Exynos 5433 SoC
Marek Szyprowski [Wed, 29 Nov 2017 11:26:34 +0000 (12:26 +0100)]
arm64: dts: exynos: Add DISP power domain to Exynos 5433 SoC

This patch adds support for DISP power domain to Exynos 5433 SoCs, which
contains following devices: a clock controller, two display controllers
(DECON and DECON TV), their SYSMMUs, MIC, DSI and HDMI video devices.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoarm64: dts: exynos: Add GSCL power domain to Exynos 5433 SoC
Marek Szyprowski [Wed, 29 Nov 2017 11:26:33 +0000 (12:26 +0100)]
arm64: dts: exynos: Add GSCL power domain to Exynos 5433 SoC

This patch adds support for GSCL power domain to Exynos 5433 SoCs, which
contains following devices: a clock controller, three GSCL video scalers and
their SYSMMUs.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoarm64: dts: exynos: Add support for S3FWRN5 NFC chip to TM2(e) boards
Marek Szyprowski [Wed, 29 Nov 2017 11:13:20 +0000 (12:13 +0100)]
arm64: dts: exynos: Add support for S3FWRN5 NFC chip to TM2(e) boards

Add device tree node with S3FWRN5 NFC chip to TM2(e) boards. The chip is
connected through HS-I2C bus #4.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
[mszyprow: rebased onto v4.15-rc1, moved node to exynos5433-tm2-common.dtsi,
 rephrased commit message]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoarm64: dts: exynos: Add CPU performance counters to Exynos5433 boards
Marek Szyprowski [Thu, 23 Nov 2017 14:34:31 +0000 (15:34 +0100)]
arm64: dts: exynos: Add CPU performance counters to Exynos5433 boards

Enable support for ARM Performance Monitoring Units available in
Cortex-A53 and Cortex-A57 CPU cores for Exynos5433 SoCs.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Use lower case hex addresses in node unit addresses
Krzysztof Kozlowski [Thu, 14 Dec 2017 20:54:30 +0000 (21:54 +0100)]
ARM: dts: exynos: Use lower case hex addresses in node unit addresses

Convert all hex addresses in node unit addresses to lower case to fix warnings
like:
    arch/arm/boot/dts/exynos5422-odroidhc1.dtb: Warning (simple_bus_reg):
      Node /soc/nocp@10CA1000 simple-bus unit address format error, expected "10ca1000"

Conversion was done using sed:

    $ sed -e 's/@\([a-zA-Z0-9_-]*\) {/@\L\1 {/' -i arch/arm/boot/dts/exynos*.dts*

Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Add nodes for True Random Number Generator
Łukasz Stelmach [Tue, 12 Dec 2017 12:09:02 +0000 (13:09 +0100)]
ARM: dts: exynos: Add nodes for True Random Number Generator

Add nodes for the True Random Number Generator found in Samsung Exynos
5250+ SoCs.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Add DT nodes for PRNG in Exynos5 SoCs
Łukasz Stelmach [Mon, 11 Dec 2017 08:54:15 +0000 (09:54 +0100)]
ARM: dts: exynos: Add DT nodes for PRNG in Exynos5 SoCs

Add nodes for Pseudo Random Number Generator in dts files describing
Exynos5 chips.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Add G3D power domain to Exynos5250
Marek Szyprowski [Fri, 8 Dec 2017 14:53:56 +0000 (15:53 +0100)]
ARM: dts: exynos: Add G3D power domain to Exynos5250

Add support for G3D power domain, which contains ARM Mali-600MP
graphics accelerator device (not yet instantiated).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Add audio power domain to Exynos5250
Marek Szyprowski [Fri, 8 Dec 2017 14:53:55 +0000 (15:53 +0100)]
ARM: dts: exynos: Add audio power domain to Exynos5250

Audio power domain includes following hardware modules: Pin controller
for GPZ bank, AudioSS clock controller and three Exynos I2S controller.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Fix power domain node names for Exynos5250
Marek Szyprowski [Fri, 8 Dec 2017 14:53:54 +0000 (15:53 +0100)]
ARM: dts: exynos: Fix power domain node names for Exynos5250

Device nodes in device tree should use generic names, so rename
all existing domains to "power-domain".

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Add audio power domain support to Exynos542x SoCs
Marek Szyprowski [Wed, 29 Nov 2017 11:35:14 +0000 (12:35 +0100)]
ARM: dts: exynos: Add audio power domain support to Exynos542x SoCs

Audio power domain includes following hardware modules: Pin controller
for GPZ bank, AudioSS clock controller, PL330 ADMA device and Exynos I2S
controller.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Fix property values of LDO15/17 for Odroid XU3/XU4
Dongjin Kim [Tue, 28 Nov 2017 00:15:01 +0000 (19:15 -0500)]
ARM: dts: exynos: Fix property values of LDO15/17 for Odroid XU3/XU4

Looking at the schematic, LDO15 and LDO17 are tied as a power source of a
builtin network chipset. Correct voltage on LDO15 to 3.3V and the name
of LDO17 to "vdd_ldo17".

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Add Exynos4412 ISP clock controller
Marek Szyprowski [Wed, 11 Oct 2017 09:25:14 +0000 (11:25 +0200)]
ARM: dts: exynos: Add Exynos4412 ISP clock controller

Exynos4412 ISP clock controller is located in the SOC area, which belongs
to ISP power domain. This patch instantiates a separate clock driver
for those clocks, updates all clients of ISP clocks and ensures that the
driver is properly integrated in ISP power domin.

This finally solves all the mysterious freezes in accessing ISP clocks
when ISP power domain is disabled.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Move G2D node to exynos5.dtsi
Tobias Jakobi [Wed, 29 Nov 2017 11:42:34 +0000 (12:42 +0100)]
ARM: dts: exynos: Move G2D node to exynos5.dtsi

Current the node is only defined in the exynos5250 DT, while
the corresponding SYSMMUs are also to be found in the exynos5420
DT. Move the node to exynos5 and only setup the SYSMMUs in the
corresponding DT.

Disable the node by default, since exynos5410 also includes
the dtsi, but currently does not define the G2D clock.

Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
[mszyprow: rephrased commit message]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Add CPU perf counters to Exynos54xx boards
Marian Mihailescu [Thu, 23 Nov 2017 14:34:30 +0000 (15:34 +0100)]
ARM: dts: exynos: Add CPU perf counters to Exynos54xx boards

Enable support for ARM Performance Monitoring Units available in Cortex-A7
and Cortex-A15 CPU cores for Exynos54xx SoCs (5410, 5420 and 5422/5800).

The PMUs interrupts are defined in the common exynos54xx.dtsi device tree,
but the PMUs are enabled and have their interrupt CPU affinity defined
next to each SoC's cpus node.

Tested with perf on Odroid XU4 (Exynos5422):
armv7_cortex_a7 PMU driver: 5 counters available
armv7_cortex_a15 PMU driver: 7 counters available

Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Marian Mihailescu <mihailescu2m@gmail.com>
Signed-off-by: Willy Wolff <willy.mh.wolff@gmail.com>
[mszyprow: reordered nodes according to krzk request, fixed typos]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Remove duplicate definitions of SSS nodes for Exynos5
Łukasz Stelmach [Mon, 27 Nov 2017 12:37:11 +0000 (13:37 +0100)]
ARM: dts: exynos: Remove duplicate definitions of SSS nodes for Exynos5

Move Security Subsystem nodes common for Exynos5250 and Exynos54xx
to exynos5.dtsi to avoid duplication.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Add bcm4334 device node to Trats2
Simon Shields [Mon, 13 Nov 2017 00:52:03 +0000 (11:52 +1100)]
ARM: dts: exynos: Add bcm4334 device node to Trats2

This patch allows the bcm4334 to power on and enables WiFi functionality
on Trats2.

Signed-off-by: Simon Shields <simon@lineageos.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Add sound support for Odroid XU4
Sylwester Nawrocki [Fri, 3 Nov 2017 16:54:46 +0000 (17:54 +0100)]
ARM: dts: exynos: Add sound support for Odroid XU4

This patch adds support for Odroid XU4 audio. The main difference
comparing to Odroid XU3 is a missing on-board audio CODEC, only
HDMI output is supported on Odroid XU4. External CODEC could be
optionally connected to the I2S port connector.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Switch to dedicated Odroid XU3 sound card binding
Sylwester Nawrocki [Fri, 3 Nov 2017 16:54:45 +0000 (17:54 +0100)]
ARM: dts: exynos: Switch to dedicated Odroid XU3 sound card binding

The new sound card DT binding is used for Odroid XU3 in order
to properly support the HDMI audio path.  Clocks configuration is
changed so the I2S controller is now the bit clock and the frame clock
master.  The EPLL output clock is now the audio root clock adjusted to
each audio sample rate.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoARM: dts: exynos: Enable Mixer node for Exynos5800 Peach Pi machine
Javier Martinez Canillas [Tue, 12 Dec 2017 07:42:08 +0000 (08:42 +0100)]
ARM: dts: exynos: Enable Mixer node for Exynos5800 Peach Pi machine

Commit 1cb686c08d12 ("ARM: dts: exynos: Add status property to Exynos 542x
Mixer nodes") disabled the Mixer node by default in the DTSI and enabled
for each Exynos 542x DTS. But unfortunately it missed to enable it for the
Exynos5800 Peach Pi machine, since the 5800 is also an 542x SoC variant.

Fixes: 1cb686c08d12 ("ARM: dts: exynos: Add status property to Exynos 542x Mixer nodes")
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoarm: dts: fix unit-address leading 0s
Rob Herring [Fri, 13 Oct 2017 17:54:51 +0000 (12:54 -0500)]
arm: dts: fix unit-address leading 0s

Fix dtc warnings for 'simple_bus_reg' due to leading 0s. Converted using
the following command:

perl -p -i -e 's/\@0+([0-9a-f])/\@$1/g' `find arch/arm/boot/dts -type -f -name '*.dts*'

Dropped changes to ARM, Ltd. boards LED nodes and manually fixed up some
occurrences of uppercase hex.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agodrm/exynos: ipp: Remove Exynos DRM IPP subsystem
Marek Szyprowski [Thu, 14 Dec 2017 15:10:15 +0000 (16:10 +0100)]
drm/exynos: ipp: Remove Exynos DRM IPP subsystem

Exynos DRM IPP subsystem is in fact non-functional and frankly speaking
dead-code. This patch clearly marks that Exynos DRM IPP subsystem is
broken and never really functional. It will be replaced by a completely
rewritten API.

Exynos DRM IPP user-space API can be obsoleted for the following
reasons:

1. Exynos DRM IPP user-space API can be optional in Exynos DRM, so
userspace should not rely that it is always available and should have
a software fallback in case it is not there.

2. The only mode which was initially semi-working was memory-to-memory
image processing. The remaining modes (LCD-"writeback" and "output")
were never operational due to missing code (both in mainline and even
vendor kernels).

3. Exynos DRM IPP mainline user-space API compatibility for
memory-to-memory got broken very early by commit 083500baefd5 ("drm:
remove DRM_FORMAT_NV12MT", which removed the support for tiled formats,
the main feature which made this API somehow useful on Exynos platforms
(video codec that time produced only tiled frames, to implement xvideo
or any other video overlay, one has to de-tile them for proper
display).

4. Broken drivers. Especially once support for IOMMU has been added,
it revealed that drivers don't configure DMA operations properly and in
many cases operate outside the provided buffers trashing memory around.

5. Need for external patches. Although IPP user-space API has been used
in some vendor kernels, but in such cases there were additional patches
applied (like reverting mentioned 083500baefd5 patch) what means that
those userspace apps which might use it, still won't work with the
mainline kernel version.

We don't have time machines, so we cannot change it, but Exynos DRM IPP
extension should never have been merged to mainline in that form.

Exynos IPP subsystem and user-space API will be rewritten, so remove
current IPP core code and mark existing drivers as BROKEN.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos/decon: Add include guard to the Exynos7 header
Krzysztof Kozlowski [Tue, 26 Dec 2017 13:07:19 +0000 (14:07 +0100)]
drm/exynos/decon: Add include guard to the Exynos7 header

Although header is included only once but still having an include guard
is a good practice.  To avoid confusion, add SoC prefix to existing
Exynos5433 header include guard.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos/decon: Move headers from global to local place
Krzysztof Kozlowski [Tue, 26 Dec 2017 13:07:18 +0000 (14:07 +0100)]
drm/exynos/decon: Move headers from global to local place

The DECON headers contain only defines for registers.  There are no
other drivers using them so this should be put locally to the Exynos DRM
driver.  Keeping headers local helps managing the code.

Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos: decon5433: Remove unnecessary platform_get_resource() error check
Fabio Estevam [Mon, 18 Dec 2017 13:02:25 +0000 (11:02 -0200)]
drm/exynos: decon5433: Remove unnecessary platform_get_resource() error check

devm_ioremap_resource() already checks if the resource is NULL, so
remove the unnecessary platform_get_resource() error check.

Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos: remove unnecessary function declaration
Inki Dae [Thu, 23 Nov 2017 09:27:57 +0000 (18:27 +0900)]
drm/exynos: remove unnecessary function declaration

Removed exynos_drm_get_dma_device funtion declaration on top
of exynos_drm_drv.c file.

We can remove this declaration by moving the implementation
of this function upwards.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos: remove unnecessary descrptions
Inki Dae [Thu, 23 Nov 2017 09:32:06 +0000 (18:32 +0900)]
drm/exynos: remove unnecessary descrptions

Removed two descriptions to 'da_start' and 'da_space_size'
from exynos_drm_private structure.

These members don't exist anymore.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos: Fix dma-buf import
Marek Szyprowski [Mon, 30 Oct 2017 07:28:09 +0000 (08:28 +0100)]
drm/exynos: Fix dma-buf import

When IOMMU support was enabled, dma-buf import in Exynos DRM was broken
since commit f43c35966a5a ("drm/exynos: use real device for DMA-mapping
operations") due to using wrong struct device in drm_gem_prime_import()
function. This patch fixes following kernel BUG caused by incorrect buffer
mapping to DMA address space:

exynos-sysmmu 14650000.sysmmu: 14450000.mixer: PAGE FAULT occurred at 0xb2e00000
------------[ cut here ]------------
kernel BUG at drivers/iommu/exynos-iommu.c:449!
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.14.0-rc4-next-20171016-00033-g990d723669fd #3165
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
task: c0e0b7c0 task.stack: c0e00000
PC is at exynos_sysmmu_irq+0x1d0/0x24c
LR is at exynos_sysmmu_irq+0x154/0x24c
------------[ cut here ]------------

Reported-by: Marian Mihailescu <mihailescu2m@gmail.com>
Fixes: f43c35966a5a ("drm/exynos: use real device for DMA-mapping operations")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>