ARM: fix set_tls for !CONFIG_KUSER_HELPERS

Joachim Eastwood reports that commit fbfb872f5f41 "ARM: 8148/1: flush
TLS and thumbee register state during exec" causes a boot-time crash
on a Cortex-M4 nommu system:

Freeing unused kernel memory: 68K (281e5000 - 281f6000)
Unhandled exception: IPSR = 00000005 LR = fffffff1
CPU: 0 PID: 1 Comm: swapper Not tainted 3.17.0-rc6-00313-gd2205fa30aa7 #191
task: 29834000 ti: 29832000 task.ti: 29832000
PC is at flush_thread+0x2e/0x40
LR is at flush_thread+0x21/0x40
pc : [<2800954a>] lr : [<2800953d>] psr: 4100000b
sp : 29833d60 ip : 00000000 fp : 00000001
r10: 00003cf8 r9 : 29b1f000 r8 : 00000000
r7 : 29b0bc00 r6 : 29834000 r5 : 29832000 r4 : 29832000
r3 : ffff0ff0 r2 : 29832000 r1 : 00000000 r0 : 282121f0
xPSR: 4100000b
CPU: 0 PID: 1 Comm: swapper Not tainted 3.17.0-rc6-00313-gd2205fa30aa7 #191
[<2800afa5>] (unwind_backtrace) from [<2800a327>] (show_stack+0xb/0xc)
[<2800a327>] (show_stack) from [<2800a963>] (__invalid_entry+0x4b/0x4c)

The problem is that set_tls is attempting to clear the TLS location in
the kernel-user helper page, which isn't set up on V7M.

Fix this by guarding the write to the kuser helper page with
a CONFIG_KUSER_HELPERS ifdef.

Reported-by: Joachim Eastwood <manabian@gmail.com>
Fixes: fbfb872f5f41 ARM: 8148/1: flush TLS and thumbee register state during exec
Cc: stable@vger.kernel.org
Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
HACK: Hard code fdt pointer setup.c

Crappy boot loaders suck.
rtc: add rtc-lpc24xx driver

Driver originates from old lpc24xx linux source tree.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
wdt: add lpc2k-wdt driver

Driver originates from old lpc24xx linux source tree.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
i2c: add lpc2k-i2c driver

Taken from Emcraft's GitHub repo.

RT77181. lpc178x i2c: Grab the i2c-lpc2k driver from the EA-2468 Linux port

Copy the I2C bus driver for the NXP LPC2K devices from the Embedded Artists'
EA-2468 Linux port. This driver is expected to be compatible with the I2C
interfaces on the NXP LPC178x/7x MCUs.

RT77920. lpc178x: Fix driver for I2C controller

 * Handle `Arbitration lost` status.
 * Clear the SI flag only after other flags and the data register is
ready, because this SI flag triggers the I2C controller to continue
operation.
 * Send correct ACK/NACK bits to tell the I2C slave where to stop data
transfer when reading from I2C slave.

RT85322. d/i/b/lpc2k-i2c.c bug: disable interrupts in case of read timeout

RT85322. d/i/b/lpc2k-i2c.c: send STOP signal according to documentation

This patch fixes code sending STOP signal to match documentation: to send STOP
signal, one should to setup STO and AA bits in the CONSET register, and then
clear SI flag, i.e., setup SI bit in the CONCLEAR register.  Another change is
that i2c_lpc2k_reset() function was called in the i2c_lpc2k_xfer() function
just after sending STOP signal. Together with the bad bits setup, this leaded
to STOP signal corruption.

RT85322. d/i/b/lpc2k-i2c.c: fix return value of the i2c_lpc2k_xfer() function

In case of success, the i2c_lpc2k_xfer() returns 0. It should return the number
of messages successfully processed instead.

RT85322. lpc18xx: i2c: remove call to the i2c_lpc2k_reset() function

The call to the i2c_lpc2k_reset() function in the i2c_lpc2k_xfer() leaded to
the signal corruption and, therefore, to data lost.

RT #91664: Fixing LPC2K I2C bus register-before-clock bug
ARM: new platform for NXP's LPC18xx/43xx Cortex-M3/4 MCUs

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
ARM: dts: Add DT for NXP LPC18xx/43xx

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
clocksource: add lpc32xx timer driver

Add support for using the NXP LPC timer as clocksource and
clock event. These timers are present on many NXP devices
including LPC32xx, LPC17xx, LPC18xx and LPC43xx.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
doc: dt: add documentation for lpc3250-timer

Add DT bindings documentation for lpc3250-timer. This timer is
used as clocksource on many NXP platforms.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
clk: add table_size member to struct clk_mux

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
clk: add lpc18xx cgu clk driver

Driver for NXP LPC18XX/43XX Clock Generation Unit (CGU).

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
doc: dt: add documentation for lpc1850-cgu

Add DT bindings documentation for lpc1850-cgu. The CGU is a clock
provider used on NXP LPC18xx and LPC43xx parts.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
clk: add lpc18xx ccu clk driver

Driver for NXP LPC18XX/43XX Clock Control Unit (CCU).

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
doc: dt: add documentation for lpc1850-ccu

Add DT bindings documentation for lpc1850-ccu. The CCU is a clock
provider used on NXP LPC18xx and LPC43xx parts.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
mfd: syscon: Decouple syscon interface from platform devices

Currently a syscon entity can be only registered directly through a
platform device that binds to a dedicated syscon driver. However in
certain use cases it is desirable to make a device used with another
driver a syscon interface provider.

For example, certain SoCs (e.g. Exynos) contain system controller
blocks which perform various functions such as power domain control,
CPU power management, low power mode control, but in addition contain
certain IP integration glue, such as various signal masks,
coprocessor power control, etc. In such case, there is a need to have
a dedicated driver for such system controller but also share registers
with other drivers. The latter is where the syscon interface is helpful.

In case of DT based platforms, this patch decouples syscon object from
syscon platform driver, and allows to create syscon objects first time
when it is required by calling of syscon_regmap_lookup_by APIs and keep
a list of such syscon objects along with syscon provider device_nodes
and regmap handles.

For non-DT based platforms, this patch keeps syscon platform driver
structure where is can be probed and such non-DT based drivers can use
syscon_regmap_lookup_by_pdev API and get access to regmap handles.
Once all users of "syscon_regmap_lookup_by_pdev" migrated to DT based,
we can completly remove platform driver of syscon, and keep only helper
functions to get regmap handles.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Tomasz Figa <tomasz.figa@gmail.com>
Tested-by: Vivek Gautam <gautam.vivek@samsung.com>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
clk: add lpc18xx creg clk driver

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
ARM: dts: add clock data to lpc18xx DT

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
gpio: add lpc18xx gpio driver

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
pinctrl: add lpc18xx pinctrl driver

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
rtc-lpc24xx: rework

Signed-off-by: Joachim Eastwood <manabian@gmail.com>