platform/kernel/linux-exynos.git
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>
5 years agodrm: exynos: Use proper macro definition for HDMI_I2S_PIN_SEL_1
Sylwester Nawrocki [Wed, 14 Feb 2018 17:23:56 +0000 (18:23 +0100)]
drm: exynos: Use proper macro definition for HDMI_I2S_PIN_SEL_1

Bit field [2:0] of HDMI_I2S_PIN_SEL_1 corresponds to SDATA_0,
not SDATA_2. This patch removes redefinition of HDMI_I2S_SEL_DATA2
constant and adds missing HDMI_I2S_SEL_DATA0.
The value of bit field selecting SDATA_1 (pin_sel_3) is also changed,
so it is 3 as suggested in the Exynos TRMs.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm: exynos: Add driver for HDMI audio interface
Sylwester Nawrocki [Mon, 23 Oct 2017 12:49:34 +0000 (14:49 +0200)]
drm: exynos: Add driver for HDMI audio interface

The hdmi-codec interface added in this patch is required to properly
support HDMI audio. Currently the audio part of the SoC internal
HDMI transmitter is configured with fixed values, which makes HDMI
audio working by chance, only on boards having an external audio
codec connected in parallel with the HDMI audio transmitter's input
I2S interface.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos/hdmi: add 85.5MHz pixel clock for v14 HDMI PHY
Daniel Drake [Fri, 29 Sep 2017 10:05:42 +0000 (12:05 +0200)]
drm/exynos/hdmi: add 85.5MHz pixel clock for v14 HDMI PHY

Configuration details from Samsung. This enables 1366x768@60Hz,
which also needs the 256px timing hack to work around a mixer
limitation.

Signed-off-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
[a.hajda@samsung.com: rebased onto proposed patchset]
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos/mixer: enable support for 1024x768 and 1280x1024 modes
Andrzej Hajda [Fri, 29 Sep 2017 10:05:41 +0000 (12:05 +0200)]
drm/exynos/mixer: enable support for 1024x768 and 1280x1024 modes

Since HDMI can handle these modes despite of MIXER limitations let's
enable them.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos/hdmi: quirk for support mode timings conversion
Andrzej Hajda [Fri, 29 Sep 2017 10:05:40 +0000 (12:05 +0200)]
drm/exynos/hdmi: quirk for support mode timings conversion

MIXER in SoCs prior to Exynos5420 supports only 4 video modes:
720x480, 720x576, 1280x720, 1920x1080. Support for other modes
can be enabled by manipulating timings of HDMI. To do it
adjusted_mode should contain actual mode set on crtc.
With this patch it is possible to enable 1024x768 and 1280x1024
modes in MIXER.

Suggested-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos/mixer: pass actual mode on MIXER to encoder
Andrzej Hajda [Fri, 29 Sep 2017 10:05:39 +0000 (12:05 +0200)]
drm/exynos/mixer: pass actual mode on MIXER to encoder

MIXER in SoCs prior to Exynos5420 supports only 4 video modes:
720x480, 720x576, 1280x720, 1920x1080. Support for other modes can be
enabled by manipulating timings of HDMI. To allow it MIXER must pass
actual video mode to HDMI, the proper way to do it is to modify
adjusted_mode property in crtc::mode_fixup callback. Adding such callback
allows also to simplify mixer_cfg_scan code - choosing mode is performed
already in crtc::mode_fixup. mode_fixup is also better place to check
interlace flag.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos: add mode_fixup callback to exynos_drm_crtc_ops
Andrzej Hajda [Fri, 29 Sep 2017 10:05:38 +0000 (12:05 +0200)]
drm/exynos: add mode_fixup callback to exynos_drm_crtc_ops

crtc::mode_fixup callback is required by crtcs which internally use
a different mode than requested by user - case of Exynos Mixer.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos/hdmi: remove redundant mode field
Andrzej Hajda [Fri, 29 Sep 2017 10:05:37 +0000 (12:05 +0200)]
drm/exynos/hdmi: remove redundant mode field

Display mode is preserved in CRTC state, there is no need to keep local
copy of it. Moreover since HDMI should configure registers according to
requested mode, use it instead of adjusted_mode, which should contain
mode produced by CRTC - functionally it does not change anything, but
subsequent patches will make the difference.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos/mixer: remove mixer_resources sub-structure
Andrzej Hajda [Fri, 29 Sep 2017 10:05:36 +0000 (12:05 +0200)]
drm/exynos/mixer: remove mixer_resources sub-structure

mixer_resources adds only unnecessary redirection, removing it makes the
code shorter and cleaner.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos/mixer: fix mode validation code
Andrzej Hajda [Fri, 29 Sep 2017 10:05:35 +0000 (12:05 +0200)]
drm/exynos/mixer: fix mode validation code

Mode limitation checked in mixer driver affects only older HW.
Mixer in Exynos542x has no such limitations. While at it patch changes
validation callback to recently introduced mode_valid which is more
suitable for the check. Additionally little cleanup is performed.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos/mixer: move resolution configuration to single function
Andrzej Hajda [Fri, 29 Sep 2017 10:05:34 +0000 (12:05 +0200)]
drm/exynos/mixer: move resolution configuration to single function

Screen resolution configuration depends on HW version, let's put it into
single function to make it consistent and simplify the code.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos/mixer: move mode commit to enable callback
Andrzej Hajda [Fri, 29 Sep 2017 10:05:33 +0000 (12:05 +0200)]
drm/exynos/mixer: move mode commit to enable callback

Mode commit should not be called for every plane separately. It is enough
to call it once in enable callback. The change also requires that
the interlace check is moved to mixer_commit. It should be done in
the same patch to avoid regression.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/exynos/mixer: abstract out output mode setup code
Andrzej Hajda [Fri, 29 Sep 2017 10:05:32 +0000 (12:05 +0200)]
drm/exynos/mixer: abstract out output mode setup code

Mode setup code is called from video plane update and mixer plane update.
Let's group it together in mixer_commit function like in case of other
Exynos CRTCs.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 years agodrm/bridge/sii8620: add DVI mode support
Maciej Purski [Thu, 9 Nov 2017 10:53:42 +0000 (11:53 +0100)]
drm/bridge/sii8620: add DVI mode support

If the sink device is in HDMI mode, enable infoframe interrupt in scdt
irq handle function else call start_video function immediately, because
in DVI mode, there is no infoframe interrupt provided.

Rename start_hdmi function to start_video and get rid of the old
start_video function. In start_video, if the sink is DVI and mode is
MHL1 or MHl2, write appropriate values to registers else the path
should remain the same as in HDMI mode.

Signed-off-by: Maciej Purski <m.purski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1510224822-7732-1-git-send-email-m.purski@samsung.com
5 years agodrm/bridge/sii8620: filter unsupported modes
Marek Szyprowski [Thu, 9 Nov 2017 10:28:31 +0000 (11:28 +0100)]
drm/bridge/sii8620: filter unsupported modes

The maximum pixel clock depends on the version of the connected MHL
adapter. Add mode_valid callback to filter out modes with too high pixel
clock to avoid failure in mode_fixup later.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171109102831.19844-1-m.szyprowski@samsung.com
5 years agodrm/bridge/sii8620: add remote control support
Maciej Purski [Thu, 24 Aug 2017 08:58:07 +0000 (10:58 +0200)]
drm/bridge/sii8620: add remote control support

MHL specification defines Remote Control Protocol(RCP) to
send input events between MHL devices.
The driver now recognizes RCP messages and reacts to them
by reporting key events to input subsystem, allowing
a user to control a device using TV remote control.

Signed-off-by: Maciej Purski <m.purski@samsung.com>
Acked-by: Sean Young <sean@mess.org>
Acked-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1503565087-19730-1-git-send-email-m.purski@samsung.com
5 years agophy: exynos5-usbdrd: Calibrate LOS levels for exynos5420/5800
Vivek Gautam [Mon, 9 Oct 2017 12:00:51 +0000 (14:00 +0200)]
phy: exynos5-usbdrd: Calibrate LOS levels for exynos5420/5800

Adding phy calibration sequence for USB 3.0 DRD PHY present on
Exynos5420/5800 systems.
This calibration facilitates setting certain PHY parameters viz.
the Loss-of-Signal (LOS) Detector Threshold Level, as well as
Tx-Vboost-Level for Super-Speed operations.
Additionally we also set proper time to wait for RxDetect measurement,
for desired PHY reference clock, so as to solve issue with enumeration
of few USB 3.0 devices, like Samsung SUM-TSB16S 3.0 USB drive
on the controller.

We are using CR_port for this purpose to send required data
to override the LOS values.

On testing with USB 3.0 devices on USB 3.0 port present on
SMDK5420, and peach-pit boards should see following message:
usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd

and without this patch, should see below shown message:
usb 1-1: new high-speed USB device number 2 using xhci-hcd

[Also removed unnecessary extra lines in the register macro definitions]

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
[adapted to use phy_calibrate as entry point]
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
5 years agodrivers: phy: add calibrate method
Andrzej Pietrasiewicz [Mon, 9 Oct 2017 12:00:50 +0000 (14:00 +0200)]
drivers: phy: add calibrate method

Some quirky UDCs (like dwc3 on Exynos) need to have their phys calibrated e.g.
for using super speed. This patch adds a new phy_calibrate() method.
When the calibration should be used is dependent on actual chip.

In case of dwc3 on Exynos the calibration must happen after usb_add_hcd()
(while in host mode), because certain phy parameters like Tx LOS levels
and boost levels need to be calibrated further post initialization of xHCI
controller, to get SuperSpeed operations working. But an hcd must be
prepared first in order to pass it to usb_add_hcd(), so, in particular, dwc3
registers must be available first, and in order for the latter to happen
the phys must be initialized. This poses a chicken and egg problem if
the calibration were to be performed in phy_init(). To break the circular
dependency a separate method is added which can be called at a desired
moment after phy intialization.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
5 years agoextcon: max77843: Add support for SmartDock accessory
Marek Szyprowski [Wed, 18 Oct 2017 09:56:22 +0000 (11:56 +0200)]
extcon: max77843: Add support for SmartDock accessory

SmartDock uses ADC_RESERVED_ACC_3 (0x10) ADC ID type and provides following
features:
1. USB host with embedded USB hub (2-4 ports) for mice, keyboard, etc,
2. MHL for video output,
3. charging.

Tested with Unitek Y-2165 MHL+OTG Hub Smart Phone Dock.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agoextcon: max77843: Add OTG power control to the MUIC driver
Marek Szyprowski [Wed, 18 Oct 2017 09:56:21 +0000 (11:56 +0200)]
extcon: max77843: Add OTG power control to the MUIC driver

Enabling power on VBUS micro-usb pin is required only when passive OTG
cable is connected. Initially OTG VBUS power control was planned to be
done in charger driver. However such information is not really available
from the extcon notifications, so VBUS power control has to be done
directly in MUIC driver, which has all information about the attached
accessory.

For example SmartDock is externally powered accessory, provides OTG
(USB HOST) functionality and use VBUS pin for charging a device battery,
so the VBUS charging pump should be disabled in such case.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>