ARM: SAMSUNG: Move samsung-time to drivers/clocksource

This patch moves the Samsung PWM-based high resolution timer support
code from arch/arm/plat-samsung to drivers/clocksource.

This is a prerequisite for further work on making the driver more
multiplatform and Device Tree friendly.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
clocksource: samsung-time: Drop useless defines from public header

This patch cleans up public header from useless definitions.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
clocksource: samsung-time: Use local register definitions

This patch copies PWM timer register definitions to samsung-time.c. The
original header in plat is being kept for now, since it is also used by
other code that also needs to be reworked to be multiplatform-friendly.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
mfd: Add Samsung PWM/timer master driver

This patch adds master driver for PWM/timer block available on many
Samsung SoCs providing clocksource and PWM output capabilities.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
ARM: SAMSUNG: Unify base address definitions of timer block

This patch makes all defintions of timer block base address use the same
prefix to allow using the common name to define platform device
resource.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
ARM: SAMSUNG: Add new PWM platform device

This patch adds new samsung_device_pwm platform device that represents
the whole PWM/timer block and includes memory and IRQ resources.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
ARM: SAMSUNG: Set PWM platform data

This patch adds PWM platform data needed for legacy (non-DT) platforms
to handle SoC-specific bits of the PWM/timer block.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
clocksource: samsung-time: Use Samsung PWM/timer master driver

This patch modifies the samsung-time clocksource driver to use the
interface provided by Samsung PWM/timer master driver to get platform
data.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
clocksource: samsung-time: Use variant data to get SoC-specific bits

This patch modifies the driver to calculate SoC-specific parameters from
variant data received from PWM/timer master driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
clocksource: samsung-time: Use master driver to configure dividers

This patch modifies the driver to use functions provided by master
driver to configure PWM frequency dividers.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
clocksource: samsung-time: Use clk_prepare_enable

This patch modifies the driver to use clk_prepare_enable instead of
clk_enable, as required to be compliant with Common Clock Framework.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
clocksource: samsung-time: Use master driver to control PWM channels

This patch modifies the driver to use functions provided by the master
driver to control status of PWM channels instead of modifying shared
registers directly.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
clocksource: samsung-time: Move IRQ mask/ack handling to the driver

Since the clocksource driver is the only user of PWM timer interrupts,
there is no need to create an IRQ chip for handling them.

This patch the way of PWM timer interrupt handling to use real VIC/GIC
interrupt signals and handle PWM mask/ack register internally in
samsung-time driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
ARM: SAMSUNG: Remove unused PWM timer IRQ chip code

As the need for an IRQ chip handling PWM timer interrupt chaining is
gone now, this patch removes all the code made unnecessary.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
ARM: common: vic: Parse interrupt and resume masks from device tree

This patch extends vic_of_init to parse valid interrupt sources
and resume sources masks from device tree.

If mask values are not specified in device tree, all sources
are assumed to be valid, as before this patch.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
clocksource: samsung-time: Allow initialization using clocksource_of_init

This patch adds CLOCKSOURCE_OF_DECLARE macro to allow instantation from
device tree using clocksource_of_init.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: s3c64xx: Add board file for boot using Device Tree

This patch adds board file that will be used to boot S3C64xx-based boards
using Device Tree.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs

This patch adds basic device tree definitions for Samsung S3C64xx SoCs.

Since all the SoCs in the series are very similar, the files are created
hierarchically - one file for the whole series and then separate files
for particular SoCs including the common one.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: dts: Add dts file for S3C6410-based Mini6410 board

This patch adds basic device tree sources for FriendlyARM Mini6410 board
based on Samsung S3C6410 SoC.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
pinctrl: samsung: Protect bank registers with a spinlock

Certain pin control registers can be accessed from different contexts,
i.e. pinctrl, gpio and irq functions. This makes the locking provided by
pin control core insufficient.

This patch adds necessary locking using a per bank spinlock as it was
done in the old Samsung GPIO driver.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>