Commit Graph

6036 Commits

Author SHA1 Message Date
Arnd Bergmann
4d3ae0d173 ARM64: hisilicon: defconfig updates for 4.14
- Enable Kirin PCIe host, hi6421v530 mfd and regulator,
   syscon reboot mode, serdev bus, OP-TEE and K3 DMA support
   for hikey and hikey960
 
 - Enable pcie based sas controller support for hip08 SoC
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZkc7VAAoJEAvIV27ZiWZcud0QAK6Pi/oB8qLy0xUCdkcIYHhI
 XJD+PKMkZNdgWccW9bTqxVjb7iecEBA3IO1KqKvAOlQ9psjDZYuY7pJlXxhlNgmP
 ulYvZpMQeKosUB/cT4ZjcTNQ/OB1Z+GNmP/HbWC6vGFyZH8ZDbXpd195+q4KKi+c
 fs53ULbu5bJ22i6WYMId7fufRDXFwZoJHZWQaDUVYsmOOeFKHoS0m+NeEwZHXB2k
 ruoJKF117t3xScp2GCfBIJH28cfRcmirNv6UKconX7IpuQqhZqBiYi3xYrM3bfsd
 xqH9iY+SX6xb1J/gvP4zyPVrcMAB24eJI/1jSf9ipjpPBFA1iAECsVgnZ0xR8SUI
 U62JGV+w/qOq/5A5En9izUY+TSmxqTsmBp5/sj7uQqM8MBIkUvD98i9PAC5fdNBh
 rqKGl2qwa+VJLdfrI7U1fNJiwWCJrFWGytCTWEF0A+8ZKVVbIBvcl8pkz76kaTb6
 PfQzSUSuL6sqZXXzQqVfJ89llu31C5kkIyUdaMd0JgqVnZ9NKUaOhkVlTIOKsbTl
 Nrf9fta2g6xXjVjU7NEeacrtN4+kUKzARfzzAWNi5AumKuL/dhjP98QO5LF/87SC
 UbVWeb2fftV5g8Yv9tFVA0vWRRJKGnBzRxwJw7ext7fKOesVnnQntwX5bl55KRqa
 3lC8l/KnXp95x3z5ZrSF
 =AEey
 -----END PGP SIGNATURE-----

Merge tag 'hisi-defconfig-for-4.14' of git://github.com/hisilicon/linux-hisi into next/arm64

Pull "ARM64: hisilicon: defconfig updates for 4.14" from Wei Xu:

- Enable Kirin PCIe host, hi6421v530 mfd and regulator,
  syscon reboot mode, serdev bus, OP-TEE and K3 DMA support
  for hikey and hikey960

- Enable pcie based sas controller support for hip08 SoC

* tag 'hisi-defconfig-for-4.14' of git://github.com/hisilicon/linux-hisi:
  arm64: defconfig: enable DMA driver for hi3660
  arm64: defconfig: enable OP-TEE
  arm64: defconfig: enable support for serial port connected device
  arm64: defconfig: enable CONFIG_SYSCON_REBOOT_MODE
  arm64: defconfig: enable support hi6421v530 PMIC
  arm64: defconfig: enable Kirin PCIe
  arm64: defconfig: enable SCSI_HISI_SAS_PCI
2017-08-15 18:06:32 +02:00
Ard Biesheuvel
f736eb382b arm64: defconfig: add recently added crypto drivers as modules
Add the arm64 crypto drivers that have been added over the past
couple of kernel releases to its defconfig as modules.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2017-08-15 18:05:09 +02:00
Arnd Bergmann
4c28f1958a mvebu arm64 for 4.14 (part 1)
Enabling nop-xceiv PHY driver in the defconfig, needed for USB support
 on A8K SoC based board.
 
 Enabling fine-grained task level IRQ time accounting for ARMv8 as it was
 already done for x86
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iEYEABECAAYFAlmNg88ACgkQCwYYjhRyO9UgWwCeLnJikdCOF4YoN3fxw6NxNivN
 cAwAn0z2IYh42j7UoBwxINih2byehBL8
 =ZHwt
 -----END PGP SIGNATURE-----

Merge tag 'mvebu-arm64-4.14-1' of git://git.infradead.org/linux-mvebu into next/arm64

Pull "mvebu arm64 for 4.14 (part 1)" from Gregory CLEMENT:

Enabling nop-xceiv PHY driver in the defconfig, needed for USB support
on A8K SoC based board.

Enabling fine-grained task level IRQ time accounting for ARMv8 as it was
already done for x86

* tag 'mvebu-arm64-4.14-1' of git://git.infradead.org/linux-mvebu:
  arm64: defconfig: enable fine-grained task level IRQ time accounting
  arm64: defconfig: enable nop-xceiv PHY driver
2017-08-15 18:04:01 +02:00
Keiji Hayashibara
6920c36d2b arm64: defconfig: enable CONFIG_UNIPHIER_WATCHDOG
Enable the watchdog driver for UniPhier SoC

Signed-off-by: Keiji Hayashibara <hayashibara.keiji@socionext.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2017-08-15 18:02:44 +02:00
Arnd Bergmann
01d1cddb20 Renesas ARM64 Based SoC Defconfig Updates for v4.14
* compile ak4613 and renesas sound as modules
 
   This is intended to reduce the size of a kernel image compiled
   using the defconfig. This is timely as it brings the kernel image
   back below the size that can be booted in my environment, a limit
   it crept over in v4.13-rc1.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZfziqAAoJENfPZGlqN0++yFIQAIHtAfEpIKff7ELoEGgNOzs2
 8F89igteIxumVy5to1XNVvWksoYSakWzjrOMV3dzj+llYxsjg5d7Mfc+oadNsfWy
 40dFQw84QHzobqJ0I2NbhV8+1M0K4DslfzphFjB6KQK/WfDa9iw4G/GeoahX/SHP
 smNd/etE0YULwnO0rujzhC3dcGiusU7u80D8yc/VlDLgAGalZP5HYP0QZ3cwBf0P
 ONwjkBO6rU8e+HRYLbQkAKR9UWKXZHruM1KUrPhxkDk/+KNaEOfTDQWSuIUFokxl
 bU+LV750nT8hIXXLBlX4WtkaT5uaHJoUfHXEpQnEKjXaPC4u2zVqhofZxcaIFW5R
 0c/MhRmC4e8BnPQLljZqU5180qCKKXWAejYX3dRT9yUvTnHzZU8LVSn1QY4+Pvrf
 CixTdXjLQOcn9G8WpInZ63xCT1j9aVY28KOVSLtUtVl/08LbEuD66PxNje45MEpp
 yvi8khhvaWzpY2wPK7I3hmFIO55IYMNBfqmnNlGnuBkxNn1j1ZXSl+4P8Q41Q2GD
 jXqu8cK9mJlyxwf0OSUQJQNY5c+uzcX2rKtDbf9Lkb9OnUBv8gqtvDVdaHKJzpTg
 gRpvVs3mEEuT8sntECONBqsTfOEziZofwOgOSPiXoQqRHaY0NnUVW7TlBHQY4xAA
 zLpnjzlpgkw6sJNU3t0h
 =PAs6
 -----END PGP SIGNATURE-----

Merge tag 'renesas-arm64-defconfig-for-v4.14' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/arm64

Pull "Renesas ARM64 Based SoC Defconfig Updates for v4.14" from Simon Horman:

* compile ak4613 and renesas sound as modules

  This is intended to reduce the size of a kernel image compiled
  using the defconfig. This is timely as it brings the kernel image
  back below the size that can be booted in my environment, a limit
  it crept over in v4.13-rc1.

* tag 'renesas-arm64-defconfig-for-v4.14' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  arm64: defconfig: compile ak4613 and renesas sound as modules
2017-08-15 18:00:40 +02:00
Viresh Kumar
e675ac4767 arm64: defconfig: Enable CONFIG_WQ_POWER_EFFICIENT_DEFAULT
commit cee22a1505 ("workqueues: Introduce new flag WQ_POWER_EFFICIENT
for power oriented workqueues") introduced the concept of power
efficient workqueues (4 years back), but it was never enabled in
upstream kernel configs.

Power efficient workqueues are simply marked as "unbound," so that jobs
queued to them can run on any CPU in the system. It leaves the target
CPU selection to the scheduler, which is the best place for such
decision making. This improves power efficiency for workqueues which are
otherwise pinned to a CPU.

Enable it for ARM64 platforms as ARM platforms were the main target for
the introduction of power efficient workqueues.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2017-08-15 18:00:22 +02:00
Dou Liyang
969ff73e72 arm64: numa: Remove the unused parent_node() macro
Commit a7be6e5a7f ("mm: drop useless local parameters of
__register_one_node()") removes the last user of parent_node().

The parent_node() macro in ARM64 platform is unnecessary.

Remove it for cleanup.

Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-15 14:37:45 +01:00
Jagan Teki
4969efb28b arm64: allwinner: a64: Add A64-OLinuXino initial support
OLimex A64-OLinuXino is an open-source hardware board
using the Allwinner A64 SOC.

OLimex A64-OLinuXino has
- A64 Quad-core Cortex-A53 64bit
- 1GB or 2GB RAM DDR3L @ 672Mhz
- microSD slot and 4/8/16GB eMMC
- Debug TTL UART
- HDMI
- LCD
- IR receiver
- 5V DC power supply

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2017-08-15 12:07:11 +08:00
Jagan Teki
bf39721453 arm64: allwinner: a64: Add initial NanoPi A64 support
NanoPi A64 is a new board of high performance with low cost
designed by FriendlyElec., using the Allwinner A64 SOC.

Nanopi A64 features
- Allwinner A64, 64-bit Quad-core Cortex-A53@648MHz to 1.152GHz, DVFS
- 1GB DDR3 RAM
- MicroSD
- Gigabit Ethernet (RTL8211E)
- Wi-Fi 802.11b/g/n
- IR receiver
- Audio In/Out
- Video In/Out
- Serial Debug Port
- microUSB 5V 2A DC power-supply

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2017-08-15 12:07:10 +08:00
Wang Ruyi
4bd68d6038 arm64: defconfig: enable DMA driver for hi3660
enable DMA driver for hi3660.

Signed-off-by: Wang Ruyi <wangruyi@huawei.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-14 16:14:16 +01:00
Victor Chong
e5e489fb46 arm64: defconfig: enable OP-TEE
This patch enables configs for Trusted Execution Environment (TEE) and
OP-TEE.

+CONFIG_TEE=y
+CONFIG_OPTEE=y

Signed-off-by: Victor Chong <victor.chong@linaro.org>
Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-14 16:14:14 +01:00
Guodong Xu
9a713a529b arm64: defconfig: enable support for serial port connected device
This patch enables these configs:

+CONFIG_SERIAL_DEV_BUS=y
+CONFIG_SERIAL_DEV_CTRL_TTYPORT=y

As example, a bluetooth device connected to UART port can be supported by
this.

Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-14 16:14:12 +01:00
Guodong Xu
a0d62c70e3 arm64: defconfig: enable CONFIG_SYSCON_REBOOT_MODE
Enable CONFIG_SYSCON_REBOOT_MODE

Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-14 16:14:10 +01:00
Guodong Xu
24dec0d532 arm64: defconfig: enable support hi6421v530 PMIC
Enable configs for hi6421v530 mfd and regulator driver
 + CONFIG_MFD_HI6421_PMIC=y
 + CONFIG_REGULATOR_HI6421V530=y

Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-14 16:14:08 +01:00
Xiaowei Song
9133e4fb37 arm64: defconfig: enable Kirin PCIe
Enable HiSilicon Kirin series SoCs PCIe controllers

Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Xiaowei Song <songxiaowei@hisilicon.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-14 15:50:05 +01:00
John Garry
904353e0b6 arm64: defconfig: enable SCSI_HISI_SAS_PCI
Enable HiSilicon SAS controller based on PCI device,
which is included in hip08 SoC.

Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-14 15:49:00 +01:00
Grzegorz Jaszczyk
0ea62502a5 ARM64: dts: marvell: enable USB host on Armada-8040-DB
Enable USB host on Armada-8040-DB by adding USB PHY nodes for the
following ports:
  - host 0 and 1 of CPM
  - host 0 of CPS

These PHY are enabled by lanes coming from regulators based on two
I2C expanders.

Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-14 16:30:43 +02:00
Hanna Hawa
915c71da13 ARM64: dts: marvell: enable USB host on Armada-7040-DB
Add I2C expander and USB host PHY (host 0 and host 1) to enable
USB VBUS on USB ports of type A on Armada-7040-DB.

Signed-off-by: Hanna Hawa <hannah@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-14 16:30:34 +02:00
Gregory CLEMENT
40118824c5 ARM64: dts: marvell: add NAND support on the CP110
The NAND controller used in A7K/A8K is present on the CP110. It is
compatible with the pxa-nand driver.

However, due to the limiation of the pins available this controller is
only usable on the CPM for A7K and on the CPS for A8K.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-14 16:28:58 +02:00
Zhou Wang
9f5ce88de8 arm64: dts: hisi: add PCIe host controller node for hip07 SoC
Add one PCIe host controller node for HiSilicon Hip07 SoC and enable it in
D05 board.

Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-14 15:25:39 +01:00
Jagan Teki
908d10b02b arm64: defconfig: Enable REGULATOR_AXP20X
The Allwinner A64 SoC is paired with the X-Powers AXP803 PMIC over the
Reduced Serial Bus (RSB). The regulators of this PMIC supply all power
rails of the SoC and many external peripherals.

Enable the driver for the regulators of this PMIC.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
[wens@csie.org: refined commit message]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2017-08-14 15:26:09 +08:00
Jagan Teki
88e96d58ad arm64: defconfig: Enable MFD_AXP20X_RSB
The Allwinner A64 SoC is paired with the X-Powers AXP803 PMIC over the
Reduced Serial Bus (RSB).

Enable the driver for this PMIC.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
[wens@csie.org: Refined commit message]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2017-08-14 15:23:09 +08:00
Icenowy Zheng
d86e63e1f0 arm64: allwinner: h5: fix pinctrl IRQs
The pin controller of H5 has three IRQs at the chip's GIC, which
represents three banks of pinctrl IRQs. However, the device tree used to
miss the third IRQ of the pin controller, which makes the PG bank IRQ
not usable.

Add the missing IRQ to the pinctrl node.

Fixes: 4e36de179f ("arm64: allwinner: h5: add Allwinner H5 .dtsi")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2017-08-14 14:18:21 +08:00
Shawn Guo
5470964f8c arm64: dts: zte: add initial zx296718-pcbox board support
It adds the initial zx296718-pcbox board support with devices like
storage, audio and VGA output enabled.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2017-08-14 09:51:16 +08:00
Shawn Guo
e419a9a010 arm64: dts: zx296718-evb: add I2S sound card support
It enables the I2S sound card support, which is used to drive audio
through aud96p22 codec in case of TV output.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2017-08-14 09:51:15 +08:00
Shawn Guo
6285fccee5 arm64: dts: zx296718-evb: use audio-graph-card for HDMI audio
Instead of simple-audio-card, audio-graph-card is recommended for audio
bindings.  Let's change to it, so that the HDMI/SPDIF audio card can
align with the new I2S/Codec card which will be added later.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2017-08-14 09:51:15 +08:00
Shawn Guo
a9aa280a5c arm64: dts: zx296718: add irdec device for remote control
Add irdec device for remote control support.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2017-08-14 09:51:15 +08:00
Shawn Guo
2b31230aa0 arm64: dts: zx296718: add PWM device support
It adds PWM device support which will be used to control voltage of core
supply on some boards.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2017-08-14 09:51:15 +08:00
Shawn Guo
dceb9491c6 arm64: dts: zx296718: add voltage data into OPP table
We will enable PWM device to control voltage through pwm-regulator
support.  So let's add voltage data into OPP table.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2017-08-14 09:51:15 +08:00
Shawn Guo
41ec0d50e2 arm64: dts: zx296718: set a better parent clock for I2S0
The default I2S0 parent clock AUDIO_24M can not be divided into required
sample rate in some cases, for example when 48KHz is needed.  Change the
parent clock to AUDIO_99M which works for most sample rates.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2017-08-14 09:51:14 +08:00
Shawn Guo
9e5edc8271 arm64: dts: zx296718: add pinctrl and gpio devices
It adds pinctrl and gpio devices for zx296718 SoC support.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2017-08-14 09:51:14 +08:00
Shawn Guo
391752fbaa arm64: dts: zx296718: add I2S and I2C audio codec
It adds I2S and I2C audio codec devices for zx296718 SoC support.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2017-08-14 09:51:14 +08:00
Shawn Guo
0d348d53e6 arm64: dts: zx296718: add VGA device support
It adds VGA device in zx296718.dtsi, so that boards with VGA connector
can enable the support by changing 'status' in board DTS file.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2017-08-14 09:51:14 +08:00
Shawn Guo
03d95c264a arm64: select PINCTRL for ZTE platform
Select PINCTRL for ZTE platform, so that we can have ZX pinctrl driver
options available for enabling.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2017-08-14 09:50:24 +08:00
Ashish Kumar
f83de4f008 arm64: dts: ls1088: Correction in Board name from "L1088A" to "LS1088A"
Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2017-08-14 09:39:45 +08:00
Yuantian Tang
39a71db1e2 arm64: dts: ls208xa: add cpu idle support
ls208xa supports another cpu idle state which is pw20 which saves
more power when cpu is idle.
It was implemented through psci firmware.

Signed-off-by: Tang Yuantian <andy.tang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2017-08-14 09:14:19 +08:00
Yuantian Tang
5334e1a249 arm64: dts: ls1088a: add cpu idle support
ls1088a supports another cpu idle state which is ph20 which saves
more power when cpu is idle.
It was implemented through psci firmware.

Signed-off-by: Tang Yuantian <andy.tang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2017-08-14 09:14:14 +08:00
Heiko Stuebner
ed562b2f39 arm64: dts: rockchip: remove num-slots property from rk3399-sapphire
When adding the rk3399 sapphire som, two more of the recently removed
num-slots properties of dw-mmc nodes slipped in.
Remove them again.

Fixes: 8164a84cca ("arm64: dts: rockchip: Add support for rk3399 sapphire SOM")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-13 13:56:30 +02:00
Ingo Molnar
b60bf53abc Merge branch 'clockevents/4.13-fixes' of http://git.linaro.org/people/daniel.lezcano/linux into timers/urgent
Pull clockevents fixes from Daniel Lezcano:

" - Fix error check against IS_ERR() instead of NULL for the timer-of code (Dan Carpenter)
  - Fix infinite recusion with ftrace for the ARM architected timer (Ding Tianhong)
  - Fix the error code return in the em_sti's probe function (Gustavo A. R.  Silva)
  - Fix Kconfig dependency for the pistachio driver (Matt Redfearn)
  - Fix mem frame loop initialization for the ARM architected timer (Matthias Kaehlcke)"

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-08-13 11:39:45 +02:00
Masahiro Yamada
e5aefb380e arm64: dts: uniphier: add Denali NAND controller nodes
Add NAND controller node to LD11 and LD20.  Neither of them supports
the CS1 line, so pinctrl is set up for a single CS line.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-08-13 08:43:27 +09:00
David Wu
4b05bc6157 ARM64: dts: rockchip: Enable gmac2phy for rk3328-evb
Enable the gmac2phy, make the gmac2phy work on
the rk3328-evb board.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-08-11 14:28:59 -07:00
David Wu
9c4cc910fe ARM64: dts: rockchip: Add gmac2phy node support for rk3328
The gmac2phy controller of rk3328 is connected to integrated PHY
directly inside, add the node for the integrated PHY support.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-08-11 14:28:59 -07:00
David Wu
6b49668e17 arm64: defconfig: Enable CONFIG_ROCKCHIP_PHY
Make the rockchip PHY driver built into the kernel.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-08-11 14:28:58 -07:00
Rocky Hao
ab78718bda arm64: dts: rockchip: Enable tsadc module on RK3328 eavluation board
enable tsadc module on RK3328 eavluation board

Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-11 17:15:02 +02:00
Rocky Hao
87e0d607e5 arm64: dts: rockchip: add thermal nodes for rk3328 SoC
add thermal zone and dynamic CPU power coefficients for rk3328

Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-11 17:14:20 +02:00
Rocky Hao
20590de280 arm64: dts: rockchip: add tsadc node for rk3328 SoC
add tsadc needed main information for rk3328 SoC.
50000Hz is the max clock rate supported by tsadc module.

Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-11 17:13:34 +02:00
Ding Tianhong
adb4f11e0a clocksource/drivers/arm_arch_timer: Avoid infinite recursion when ftrace is enabled
On platforms with an arch timer erratum workaround, it's possible for
arch_timer_reg_read_stable() to recurse into itself when certain
tracing options are enabled, leading to stack overflows and related
problems.

For example, when PREEMPT_TRACER and FUNCTION_GRAPH_TRACER are
selected, it's possible to trigger this with:

$ mount -t debugfs nodev /sys/kernel/debug/
$ echo function_graph > /sys/kernel/debug/tracing/current_tracer

The problem is that in such cases, preempt_disable() instrumentation
attempts to acquire a timestamp via trace_clock(), resulting in a call
back to arch_timer_reg_read_stable(), and hence recursion.

This patch changes arch_timer_reg_read_stable() to use
preempt_{disable,enable}_notrace(), which avoids this.

This problem is similar to the fixed by upstream commit 96b3d28bf4
("sched/clock: Prevent tracing recursion in sched_clock_cpu()").

Fixes: 6acc71ccac ("arm64: arch_timer: Allows a CPU-specific erratum to only affect a subset of CPUs")
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2017-08-11 16:01:43 +02:00
Kevin Brodsky
82d24d114f arm64: compat: Remove leftover variable declaration
Commit a1d5ebaf8c ("arm64: big-endian: don't treat code as data when
copying sigret code") moved the 32-bit sigreturn trampoline code from
the aarch32_sigret_code array to kuser32.S. The commit removed the
array definition from signal32.c, but not its declaration in
signal32.h. Remove the leftover declaration.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-10 18:17:32 +01:00
Arnd Bergmann
caf5ef7d15 arm64: fix pmem interface definition
Defining the two functions as 'static inline' and exporting them
leads to the interesting case where we can use the interface
from loadable modules, but not from built-in drivers, as shown
in this link failure:

vers/nvdimm/claim.o: In function `nsio_rw_bytes':
claim.c:(.text+0x1b8): undefined reference to `arch_invalidate_pmem'
drivers/nvdimm/pmem.o: In function `pmem_dax_flush':
pmem.c:(.text+0x11c): undefined reference to `arch_wb_cache_pmem'
drivers/nvdimm/pmem.o: In function `pmem_make_request':
pmem.c:(.text+0x5a4): undefined reference to `arch_invalidate_pmem'
pmem.c:(.text+0x650): undefined reference to `arch_invalidate_pmem'
pmem.c:(.text+0x6d4): undefined reference to `arch_invalidate_pmem'

This removes the bogus 'static inline'.

Fixes: d50e071fda ("arm64: Implement pmem API support")
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-10 18:13:59 +01:00
Julien Thierry
e884f80cf2 arm64: perf: add support for Cortex-A35
The Cortex-A35 uses some implementation defined perf events.

The Cortex-A35 derives from the Cortex-A53 core, using the same event mapings
based on Cortex-A35 TRM r0p2, section C2.3 - Performance monitoring events
(pages C2-562 to C2-565).

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-08-10 17:46:49 +01:00
Julien Thierry
5561b6c5e9 arm64: perf: add support for Cortex-A73
The Cortex-A73 uses some implementation defined perf events.

This patch sets up the necessary mapping for Cortex-A73.

Mappings are based on Cortex-A73 TRM r0p2, section 11.9 Events
(pages 11-457 to 11-460).

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-08-10 17:46:44 +01:00
Will Deacon
d0d09d4d99 arm64: perf: Remove redundant entries from CPU-specific event maps
Now that the event mapping code always looks into the PMUv3 events
before any extended mappings, the extended mappings can be reduced to
only those events that are not discoverable through the PMCEID registers.

Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-08-10 17:45:07 +01:00
Julien Thierry
5cf7fb26ea arm64: perf: Connect additional events to pmu counters
Last level caches and node events were almost never connected in current
supported cores.

We connect last level caches to the actual last level within the core and
node events are connected to bus accesses.

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-08-10 17:44:58 +01:00
Masami Hiramatsu
229a718605 irq: Make the irqentry text section unconditional
Generate irqentry and softirqentry text sections without
any Kconfig dependencies. This will add extra sections, but
there should be no performace impact.

Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: David S . Miller <davem@davemloft.net>
Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: linux-arch@vger.kernel.org
Cc: linux-cris-kernel@axis.com
Cc: mathieu.desnoyers@efficios.com
Link: http://lkml.kernel.org/r/150172789110.27216.3955739126693102122.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-08-10 16:28:53 +02:00
Peter Zijlstra
a9668cd6ee locking: Remove smp_mb__before_spinlock()
Now that there are no users of smp_mb__before_spinlock() left, remove
it entirely.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-08-10 12:29:03 +02:00
Peter Zijlstra
d89e588ca4 locking: Introduce smp_mb__after_spinlock()
Since its inception, our understanding of ACQUIRE, esp. as applied to
spinlocks, has changed somewhat. Also, I wonder if, with a simple
change, we cannot make it provide more.

The problem with the comment is that the STORE done by spin_lock isn't
itself ordered by the ACQUIRE, and therefore a later LOAD can pass over
it and cross with any prior STORE, rendering the default WMB
insufficient (pointed out by Alan).

Now, this is only really a problem on PowerPC and ARM64, both of
which already defined smp_mb__before_spinlock() as a smp_mb().

At the same time, we can get a much stronger construct if we place
that same barrier _inside_ the spin_lock(). In that case we upgrade
the RCpc spinlock to an RCsc.  That would make all schedule() calls
fully transitive against one another.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-08-10 12:29:02 +02:00
Robin Murphy
21cfa0e96d arm64: uaccess: Add the uaccess_flushcache.c file
The uaccess_flushcache.c file was inadvertently dropped by the
maintainer in a previous commit. Add it back.

Fixes: 5d7bdeb1ee ("arm64: uaccess: Implement *_flushcache variants")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-10 10:49:21 +01:00
Icenowy Zheng
3bc1de8c75 arm64: allwinner: a64: add proper support for the Wi-Fi on BPi M64
BPi M64 has an AP6212 Wi-Fi/Bluetooth combo module, and the Wi-Fi SDIO
card is connected to the mmc1 controller.

The pwrseq of the mmc1 (used to reset the card) used to missing, and the
out-of-band interrupt line of the card is not specified.

Fix these issues for proper Wi-Fi support of BPi M64.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2017-08-10 15:23:46 +08:00
Icenowy Zheng
0ff75efbc9 arm64: allwinner: a64: enable AXP803 for Banana Pi M64
Banana Pi M64 board uses an AXP803 PMIC.

Enable the PMIC and its regulators.

As we have now proper regulators support, missing or dummy regulators
are changed to the correct ones.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2017-08-10 15:19:32 +08:00
Icenowy Zheng
15ec959872 arm64: allwinner: a64: enable USB host controller for BPi M64
Banana Pi M64 connects the USB host-only controller on A64 SoC to a USB
hub, which provided the two USB Type-A ports on the board.

Enable the USB host controller.

The OTG function of the Micro-USB port needs the drivevbus function of
the AXP803 driver implemented, so it's not enabled now.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2017-08-10 15:17:26 +08:00
Icenowy Zheng
56a9155074 arm64: allwinner: a64: sopine: add missing ethernet0 alias
The EMAC Ethernet controller was enabled, but an accompanying alias
was not added. This results in unstable numbering if other Ethernet
devices, such as a USB dongle, are present. Also, the bootloader uses
the alias to assign a generated stable MAC address to the device node.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Fixes: 96219b0048 ("arm64: allwinner: a64: add device tree for SoPine
		      with baseboard")
[wens@csie.org: Rewrite commit log as fixing a previous patch with Fixes]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2017-08-10 14:02:38 +08:00
Icenowy Zheng
dff751c689 arm64: allwinner: a64: pine64: add missing ethernet0 alias
The EMAC Ethernet controller was enabled, but an accompanying alias
was not added. This results in unstable numbering if other Ethernet
devices, such as a USB dongle, are present. Also, the bootloader uses
the alias to assign a generated stable MAC address to the device node.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Fixes: 9702394374 ("arm64: allwinner: pine64: Enable dwmac-sun8i")
[wens@csie.org: Rewrite commit log as fixing a previous patch with Fixes]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2017-08-10 14:01:38 +08:00
Icenowy Zheng
7dc88d2afb arm64: allwinner: a64: bananapi-m64: add missing ethernet0 alias
The EMAC Ethernet controller was enabled, but an accompanying alias
was not added. This results in unstable numbering if other Ethernet
devices, such as a USB dongle, are present. Also, the bootloader uses
the alias to assign a generated stable MAC address to the device node.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Fixes: e729549990 ("arm64: allwinner: bananapi-m64: Enable dwmac-sun8i")
[wens@csie.org: Rewrite commit log as fixing a previous patch with Fixes]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2017-08-10 14:00:10 +08:00
Daniel Borkmann
c362b2f34e bpf, arm64: implement jiting of BPF_J{LT, LE, SLT, SLE}
This work implements jiting of BPF_J{LT,LE,SLT,SLE} instructions
with BPF_X/BPF_K variants for the arm64 eBPF JIT.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-08-09 16:53:56 -07:00
Masahiro Yamada
6b8b062ead arm64: dts: uniphier: use cross-arch include instead of symlinks
On UniPhier platform, some DTSI files are shared between arm and arm64.
Recently, inclusion of DT material of different architectures has been
supported by the build system level.  Use #include <arm/...>, which
will work without relying on the exact same hierarchy as the kernel.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-08-10 01:47:52 +09:00
Masahiro Yamada
5740ea4e7b arm64: dts: uniphier: use #include instead of /include/
To include dt-bindings headers.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-08-10 01:47:48 +09:00
Catalin Marinas
0553896787 Merge branch 'arm64/exception-stack' of git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux into for-next/core
* 'arm64/exception-stack' of git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux:
  arm64: unwind: remove sp from struct stackframe
  arm64: unwind: reference pt_regs via embedded stack frame
  arm64: unwind: disregard frame.sp when validating frame pointer
  arm64: unwind: avoid percpu indirection for irq stack
  arm64: move non-entry code out of .entry.text
  arm64: consistently use bl for C exception entry
  arm64: Add ASM_BUG()
2017-08-09 15:37:49 +01:00
Dave Martin
66c3ec5a71 arm64: neon: Forbid when irqs are disabled
Currently, may_use_simd() can return true if IRQs are disabled.  If
the caller goes ahead and calls kernel_neon_begin(), this can
result in use of local_bh_enable() in an unsafe context.

In particular, __efi_fpsimd_begin() may do this when calling EFI as
part of system shutdown.

This patch ensures that callers don't think they can use
kernel_neon_begin() in such a context.

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-09 15:05:59 +01:00
Ard Biesheuvel
31e43ad3b7 arm64: unwind: remove sp from struct stackframe
The unwind code sets the sp member of struct stackframe to
'frame pointer + 0x10' unconditionally, without regard for whether
doing so produces a legal value. So let's simply remove it now that
we have stopped using it anyway.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
2017-08-09 14:10:29 +01:00
Ard Biesheuvel
7326749801 arm64: unwind: reference pt_regs via embedded stack frame
As it turns out, the unwind code is slightly broken, and probably has
been for a while. The problem is in the dumping of the exception stack,
which is intended to dump the contents of the pt_regs struct at each
level in the call stack where an exception was taken and routed to a
routine marked as __exception (which means its stack frame is right
below the pt_regs struct on the stack).

'Right below the pt_regs struct' is ill defined, though: the unwind
code assigns 'frame pointer + 0x10' to the .sp member of the stackframe
struct at each level, and dump_backtrace() happily dereferences that as
the pt_regs pointer when encountering an __exception routine. However,
the actual size of the stack frame created by this routine (which could
be one of many __exception routines we have in the kernel) is not known,
and so frame.sp is pretty useless to figure out where struct pt_regs
really is.

So it seems the only way to ensure that we can find our struct pt_regs
when walking the stack frames is to put it at a known fixed offset of
the stack frame pointer that is passed to such __exception routines.
The simplest way to do that is to put it inside pt_regs itself, which is
the main change implemented by this patch. As a bonus, doing this allows
us to get rid of a fair amount of cruft related to walking from one stack
to the other, which is especially nice since we intend to introduce yet
another stack for overflow handling once we add support for vmapped
stacks. It also fixes an inconsistency where we only add a stack frame
pointing to ELR_EL1 if we are executing from the IRQ stack but not when
we are executing from the task stack.

To consistly identify exceptions regs even in the presence of exceptions
taken from entry code, we must check whether the next frame was created
by entry text, rather than whether the current frame was crated by
exception text.

To avoid backtracing using PCs that fall in the idmap, or are controlled
by userspace, we must explcitly zero the FP and LR in startup paths, and
must ensure that the frame embedded in pt_regs is zeroed upon entry from
EL0. To avoid these NULL entries showin in the backtrace, unwind_frame()
is updated to avoid them.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[Mark: compare current frame against .entry.text, avoid bogus PCs]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
2017-08-09 14:07:13 +01:00
Dmitry Safonov
739586951b arm64/vdso: Support mremap() for vDSO
vDSO VMA address is saved in mm_context for the purpose of using
restorer from vDSO page to return to userspace after signal handling.

In Checkpoint Restore in Userspace (CRIU) project we place vDSO VMA
on restore back to the place where it was on the dump.
With the exception for x86 (where there is API to map vDSO with
arch_prctl()), we move vDSO inherited from CRIU task to restoree
position by mremap().

CRIU does support arm64 architecture, but kernel doesn't update
context.vdso pointer after mremap(). Which results in translation
fault after signal handling on restored application:
https://github.com/xemul/criu/issues/288

Make vDSO code track the VMA address by supplying .mremap() fops
the same way it's done for x86 and arm32 by:
commit b059a453b1 ("x86/vdso: Add mremap hook to vm_special_mapping")
commit 280e87e98c ("ARM: 8683/1: ARM32: Support mremap() for sigpage/vDSO").

Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Cc: Christopher Covington <cov@codeaurora.org>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-09 12:16:28 +01:00
Robin Murphy
5d7bdeb1ee arm64: uaccess: Implement *_flushcache variants
Implement the set of copy functions with guarantees of a clean cache
upon completion necessary to support the pmem driver.

Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-09 12:16:26 +01:00
Robin Murphy
d50e071fda arm64: Implement pmem API support
Add a clean-to-point-of-persistence cache maintenance helper, and wire
up the basic architectural support for the pmem driver based on it.

Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
[catalin.marinas@arm.com: move arch_*_pmem() functions to arch/arm64/mm/flush.c]
[catalin.marinas@arm.com: change dmb(sy) to dmb(osh)]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-09 12:15:45 +01:00
Robin Murphy
e1bc5d1b8e arm64: Handle trapped DC CVAP
Cache clean to PoP is subject to the same access controls as to PoC, so
if we are trapping userspace cache maintenance with SCTLR_EL1.UCI, we
need to be prepared to handle it. To avoid getting into complicated
fights with binutils about ARMv8.2 options, we'll just cheat and use the
raw SYS instruction rather than the 'proper' DC alias.

Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-09 11:00:43 +01:00
Robin Murphy
7aac405ebb arm64: Expose DC CVAP to userspace
The ARMv8.2-DCPoP feature introduces persistent memory support to the
architecture, by defining a point of persistence in the memory
hierarchy, and a corresponding cache maintenance operation, DC CVAP.
Expose the support via HWCAP and MRS emulation.

Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-09 11:00:35 +01:00
Robin Murphy
d46befef4c arm64: Convert __inval_cache_range() to area-based
__inval_cache_range() is already the odd one out among our data cache
maintenance routines as the only remaining range-based one; as we're
going to want an invalidation routine to call from C code for the pmem
API, let's tweak the prototype and name to bring it in line with the
clean operations, and to make its relationship with __dma_inv_area()
neatly mirror that of __clean_dcache_area_poc() and __dma_clean_area().
The loop clearing the early page tables gets mildly massaged in the
process for the sake of consistency.

Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-09 11:00:23 +01:00
Robin Murphy
09c2a7dc4c arm64: mm: Fix set_memory_valid() declaration
Clearly, set_memory_valid() has never been seen in the same room as its
declaration... Whilst the type mismatch is such that kexec probably
wasn't broken in practice, fix it to match the definition as it should.

Fixes: 9b0aa14e31 ("arm64: mm: add set_memory_valid()")
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-09 10:59:52 +01:00
Helmut Klein
f72d6f6037 ARM64: dts: meson-gx: use stable UART bindings with correct gate clock
This patch switches to the stable UART bindings but also add the correct
gate clock to the non-AO UART nodes for GXBB and GXL SoCs.

Acked-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Helmut Klein <hgkr.klein@gmail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2017-08-08 14:48:56 -07:00
Bjorn Andersson
cadcd35ffa arm64: dts: qcom: msm8996: Specify smd-edge for ADSP
Add the smd-edge node for the adsp, to allow SMD communication with the
ADSP.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-08 16:29:55 -05:00
Bjorn Andersson
a147eda711 arm64: dts: msm8996: Add modem smp2p nodes
This patch adds the SMP2P nodes for the modem.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-08 16:29:54 -05:00
Rajendra Nayak
660a9763c6 arm64: dts: qcom: db820c: Add pm8994 regulator node
Add PM8994 RPM regulators with their min/max voltages to DB820c.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-08 16:29:54 -05:00
Bjorn Andersson
f742f8788f arm64: dts: qcom: Add RPM glink nodes to msm8996
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-08 16:29:53 -05:00
Vivek Gautam
1e39255ed2 arm64: dts: msm8996: Add device node for qcom,dwc3
Adding required device node for couple of DWC3 controllers
present on msm8996 chipset to enable High speed and Super
speed USB support.

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-08 16:29:52 -05:00
Vivek Gautam
12c67fe688 arm64: dts: msm8996: Add device node for qcom qmp-phy for pcie
Add required device node for QMP phy based 3-lane PCIe phy
present on msm8996 chipset to enable support for the same.

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-08 16:29:52 -05:00
Vivek Gautam
42bd05442e arm64: dts: msm8996: Add device node for qcom qmp-phy for usb
Adding required device node for USB3 QMP phy present on
msm8996 chipset to enable support for the same. This phy
provides super speed usb functionality for dwc3 controller
on msm8996.

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-08 16:29:51 -05:00
Vivek Gautam
6785fa95fc arm64: dts: msm8996: Add device node for qcom qusb2 phy
Adding device node for QUSB2 phy and the required infrastructure
to enable support for the same. This phy is used by dwc3 controller
present on msm8996.

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-08 16:29:50 -05:00
Hans Verkuil
5a125b63df arm64: dts: qcom: add cec clock for apq8016 board
The adv7533 on this board needs a cec clock. Hook it up in the dtsi
to enable CEC for the HDMI transmitters.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-08 16:29:50 -05:00
Vivek Gautam
133767d94a arm64: dts: pmi8994: Add device node for pmi8994 gpios
Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-08 16:29:49 -05:00
Suzuki K. Poulose
8e0b000921 arm64: dts: qcom-msm8916: dts: Update coresight replicator
Replace the obsolete compatible string for Coresight programmable
replicator with the new one.

Cc: Andy Gross <andy.gross@linaro.org>
Cc: David Brown <david.brown@linaro.org>
Cc: linux-arm-msm@vger.kernel.org
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-08 16:29:49 -05:00
Stephen Boyd
2691cb4e42 arm64: dts: qcom: Force host mode for USB on apq8016-sbc
Commit ed75d6a969 ("arm64: dts: qcom: Collapse usb support into
one node") breaks host mode support on apq8016-sbc boards. This
is because the mux driver (tc7usb40mu) hasn't been merged.
Without that driver, we can't toggle the GPIO going to the mux to
route out the D+/D- lines to the USB hub that's on the board.

One solution would be to totally revert this change, but that
opens us up to other problems when two USB drivers are operating
the same hardware block at the same time. Let's modify the DT so
that the USB controller is always in host mode and connected to
the hub so that things like USB keyboards and mouses work. This
is the mode that most people prefer anyway with these devices. We
also delete the usb-switch node because the binding was never
accepted upstream.

In the future, we can add muxing support and then update the DT
to support both modes at runtime. Patches to support this are
already on the mailing list.

Fixes: ed75d6a969 ("arm64: dts: qcom: Collapse usb support into one node")
Reported-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-08 16:29:48 -05:00
Will Deacon
6c833bb924 arm64: perf: Allow standard PMUv3 events to be extended by the CPU type
Rather than continue adding CPU-specific event maps, instead look up by
default in the PMUv3 event map and only fallback to the CPU-specific maps
if either the event isn't described by PMUv3, or it is described but
the PMCEID registers say that it is unsupported by the current CPU.

Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-08-08 17:12:34 +01:00
Ard Biesheuvel
c736533075 arm64: unwind: disregard frame.sp when validating frame pointer
Currently, when unwinding the call stack, we validate the frame pointer
of each frame against frame.sp, whose value is not clearly defined, and
which makes it more difficult to link stack frames together across
different stacks. It is far better to simply check whether the frame
pointer itself points into a valid stack.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
2017-08-08 16:28:26 +01:00
Mark Rutland
096683724c arm64: unwind: avoid percpu indirection for irq stack
Our IRQ_STACK_PTR() and on_irq_stack() helpers both take a cpu argument,
used to generate a percpu address. In all cases, they are passed
{raw_,}smp_processor_id(), so this parameter is redundant.

Since {raw_,}smp_processor_id() use a percpu variable internally, this
approach means we generate a percpu offset to find the current cpu, then
use this to index an array of percpu offsets, which we then use to find
the current CPU's IRQ stack pointer. Thus, most of the work is
redundant.

Instead, we can consistently use raw_cpu_ptr() to generate the CPU's
irq_stack pointer by simply adding the percpu offset to the irq_stack
address, which is simpler in both respects.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
2017-08-08 16:28:25 +01:00
Mark Rutland
ed84b4e958 arm64: move non-entry code out of .entry.text
Currently, cpu_switch_to and ret_from_fork both live in .entry.text,
though neither form the critical path for an exception entry.

In subsequent patches, we will require that code in .entry.text is part
of the critical path for exception entry, for which we can assume
certain properties (e.g. the presence of exception regs on the stack).

Neither cpu_switch_to nor ret_from_fork will meet these requirements, so
we must move them out of .entry.text. To ensure that neither are kprobed
after being moved out of .entry.text, we must explicitly blacklist them,
requiring a new NOKPROBE() asm helper.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
2017-08-08 16:28:25 +01:00
Mark Rutland
2d0e751a47 arm64: consistently use bl for C exception entry
In most cases, our exception entry assembly branches to C handlers with
a BL instruction, but in cases where we do not expect to return, we use
B instead.

While this is correct today, it means that backtraces for fatal
exceptions miss the entry assembly (as the LR is stale at the point we
call C code), while non-fatal exceptions have the entry assembly in the
LR. In subsequent patches, we will need the LR to be set in these cases
in order to backtrace reliably.

This patch updates these sites to use a BL, ensuring consistency, and
preparing for backtrace rework. An ASM_BUG() is added after each of
these new BLs, which both catches unexpected returns, and ensures that
the LR value doesn't point to another function label.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
2017-08-08 16:28:24 +01:00
Mark Rutland
db44e9c5ec arm64: Add ASM_BUG()
Currently. we can only use BUG() from C code, though there are
situations where we would like an equivalent mechanism in assembly code.

This patch refactors our BUG() definition such that it can be used in
either C or assembly, in the form of a new ASM_BUG().

The refactoring requires the removal of escape sequences, such as '\n'
and '\t', but these aren't strictly necessary as we can use ';' to
terminate assembler statements.

The low-level assembly is factored out into <asm/asm-bug.h>, with
<asm/bug.h> retained as the C wrapper.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dave Martin <dave.martin@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
2017-08-08 16:28:13 +01:00
Pratyush Anand
1031a15929 arm64: perf: Allow more than one cycle counter to be used
Currently:
$ perf stat -e cycles:u -e cycles:k  true

 Performance counter stats for 'true':

          2,24,699      cycles:u
     <not counted>      cycles:k	(0.00%)

       0.000788087 seconds time elapsed

We can not count more than one cycle counter in one instance,because we
allow to map cycle counter into PMCCNTR_EL0 only. However, if I did not
miss anything then specification do not prohibit to use PMEVCNTR<n>_EL0
for cycle count as well.

Modify the code so that it still prefers to use PMCCNTR_EL0 for cycle
counter, however allow to use PMEVCNTR<n>_EL0 if PMCCNTR_EL0 is already
in use.

After this patch:

$ perf stat -e cycles:u -e cycles:k   true

 Performance counter stats for 'true':

          2,17,310      cycles:u
          7,40,009      cycles:k

       0.000764149 seconds time elapsed

Signed-off-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-08-08 14:33:13 +01:00
Longpeng(Mike)
f01fbd2fad KVM: arm: implements the kvm_arch_vcpu_in_kernel()
This implements the kvm_arch_vcpu_in_kernel() for ARM, and adjusts
the calls to kvm_vcpu_on_spin().

Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-08 10:57:43 +02:00
Longpeng(Mike)
199b5763d3 KVM: add spinlock optimization framework
If a vcpu exits due to request a user mode spinlock, then
the spinlock-holder may be preempted in user mode or kernel mode.
(Note that not all architectures trap spin loops in user mode,
only AMD x86 and ARM/ARM64 currently do).

But if a vcpu exits in kernel mode, then the holder must be
preempted in kernel mode, so we should choose a vcpu in kernel mode
as a more likely candidate for the lock holder.

This introduces kvm_arch_vcpu_in_kernel() to decide whether the
vcpu is in kernel-mode when it's preempted.  kvm_vcpu_on_spin's
new argument says the same of the spinning VCPU.

Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-08 10:57:43 +02:00
Sugar Zhang
d80ef50a13 arm64: dts: rockchip: add rk3328 i2s nodes
This patch add the i2s dt nodes for rk3328.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-07 23:29:46 +02:00
Anup Patel
63b2ff6aa6 arm64: dts: Add SBA-RAID DT nodes for Stingray SoC
This patch adds Broadcom SBA-RAID DT nodes for Stingray SoC.

The Stingray SoC has total 32 SBA-RAID FlexRM rings and it has
8 CPUs so we create 8 SBA-RAID instances (one for each CPU).
This way Linux DMAENGINE will have one SBA-RAID DMA device for
each CPU.

Signed-off-by: Anup Patel <anup.patel@broadcom.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-08-07 10:30:14 -07:00
Anup Patel
c6e9559869 arm64: dts: Add FlexRM DT nodes for Stingray
We have two instances of FlexRM on Stingray. One for SBA RAID
offload engine and another for SPU2 Crypto offload engine.

This patch adds FlexRM mailbox controller DT nodes for Stingray.

Signed-off-by: Anup Patel <anup.patel@broadcom.com>
Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-08-07 10:30:06 -07:00
Srinath Mannam
344a2e5141 arm64: dts: Add SATA DT nodes for Stingray SoC
Add DT nodes for SATA host controllers and SATA PHYs
on Stingray SoC

Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-08-07 10:30:01 -07:00
Abhishek Shah
80e2cbc136 arm64: dts: Add DT node to enable BGMAC driver on Stingray
This patch adds DT node to enable BGMAC driver on Stingray

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Oza Oza <oza.oza@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-08-07 10:29:53 -07:00
Anup Patel
567b3b0a5b arm64: dts: Add sp804 DT nodes for Stingray SoC
We have 8 instances of sp804 in Stingray SoC. Let's enable
it in Stingray DT.

Signed-off-by: Anup Patel <anup.patel@broadcom.com>
Reviewed-by: Ray Jui <rjui@broadcom.com>
Reviewed-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-08-07 10:29:48 -07:00
Srinath Mannam
fd898f75da arm64: dts: Add MDIO multiplexer DT node for Stingray
Added MDIO multiplexer iproc DT node for Stingray, which contains
the child nodes of PCIe serdes, RGMII, SATA and USB phy MDIO slaves.

Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-08-07 10:29:07 -07:00
Velibor Markovski
5ace353397 arm64: dts: Enable stats for CCN-502 interconnect on Stingray
This patch enables stats for CCN-502 interconnect on Stingray.

Signed-off-by: Velibor Markovski <velibor.markovski@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-08-07 10:28:53 -07:00
Catalin Marinas
11cefd5ac2 arm64: neon: Export kernel_neon_busy to loadable modules
may_use_simd() can be invoked from loadable modules and it accesses
kernel_neon_busy. Make sure that the latter is exported.

Fixes: cb84d11e16 ("arm64: neon: Remove support for nested or hardirq kernel-mode NEON")
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-07 12:36:35 +01:00
Julien Thierry
1f9b8936f3 arm64: Decode information from ESR upon mem faults
When receiving unhandled faults from the CPU, description is very sparse.
Adding information about faults decoded from ESR.

Added defines to esr.h corresponding ESR fields. Values are based on ARM
Archtecture Reference Manual (DDI 0487B.a), section D7.2.28 ESR_ELx, Exception
Syndrome Register (ELx) (pages D7-2275 to D7-2280).

New output is of the form:
[   77.818059] Mem abort info:
[   77.820826]   Exception class = DABT (current EL), IL = 32 bits
[   77.826706]   SET = 0, FnV = 0
[   77.829742]   EA = 0, S1PTW = 0
[   77.832849] Data abort info:
[   77.835713]   ISV = 0, ISS = 0x00000070
[   77.839522]   CM = 0, WnR = 1

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
[catalin.marinas@arm.com: fix "%lu" in a pr_alert() call]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-07 09:58:33 +01:00
Dave Martin
17c2895860 arm64: Abstract syscallno manipulation
The -1 "no syscall" value is written in various ways, shared with
the user ABI in some places, and generally obscure.

This patch attempts to make things a little more consistent and
readable by replacing all these uses with a single #define.  A
couple of symbolic helpers are provided to clarify the intent
further.

Because the in-syscall check in do_signal() is changed from >= 0 to
!= NO_SYSCALL by this patch, different behaviour may be observable
if syscallno is set to values less than -1 by a tracer.  However,
this is not different from the behaviour that is already observable
if a tracer sets syscallno to a value >= __NR_(compat_)syscalls.

It appears that this can cause spurious syscall restarting, but
that is not a new behaviour either, and does not appear harmful.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-07 09:58:33 +01:00
Dave Martin
35d0e6fb4d arm64: syscallno is secretly an int, make it official
The upper 32 bits of the syscallno field in thread_struct are
handled inconsistently, being sometimes zero extended and sometimes
sign-extended.  In fact, only the lower 32 bits seem to have any
real significance for the behaviour of the code: it's been OK to
handle the upper bits inconsistently because they don't matter.

Currently, the only place I can find where those bits are
significant is in calling trace_sys_enter(), which may be
unintentional: for example, if a compat tracer attempts to cancel a
syscall by passing -1 to (COMPAT_)PTRACE_SET_SYSCALL at the
syscall-enter-stop, it will be traced as syscall 4294967295
rather than -1 as might be expected (and as occurs for a native
tracer doing the same thing).  Elsewhere, reads of syscallno cast
it to an int or truncate it.

There's also a conspicuous amount of code and casting to bodge
around the fact that although semantically an int, syscallno is
stored as a u64.

Let's not pretend any more.

In order to preserve the stp x instruction that stores the syscall
number in entry.S, this patch special-cases the layout of struct
pt_regs for big endian so that the newly 32-bit syscallno field
maps onto the low bits of the stored value.  This is not beautiful,
but benchmarking of the getpid syscall on Juno suggests indicates a
minor slowdown if the stp is split into an stp x and stp w.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-07 09:58:33 +01:00
Kuninori Morimoto
8cd7b51ff5 arm64: renesas: salvator-common: avoid audio_clkout naming conflict
clock name of "audio_clkout" is used by Renesas sound driver.
This duplicated naming breaks its clock registering/unregistering.
Especially, when unbind/bind it can't handle clkout correctly.
This patch renames "audio_clkout" to "audio-clkout" to avoid
naming conflict.

Fixes: 8a8f181d2c ("arm64: renesas: salvator-x: use CS2000 as AUDIO_CLK_B")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-08-07 09:50:10 +02:00
Jacob Chen
0a3c78e251 arm64: dts: rockchip: Add support for rk3399 excavator main board
Add support for the rk3399 excavator main board.
This board works in a combination with the sapphire SOM.

This board have been sold as the rk3399 evaluation board for commercial customers.
You can get more info from below link:
http://opensource.rock-chips.com/wiki_Excavator_sapphire_board

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-06 17:38:36 +02:00
Jacob Chen
8164a84cca arm64: dts: rockchip: Add support for rk3399 sapphire SOM
Add support for the rk3399 sapphire SOM board.
This board works in a combination with the excavator main board.

You can get more info from below link:
http://opensource.rock-chips.com/wiki_Excavator_sapphire_board

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-06 17:35:19 +02:00
Jacob Chen
81e923ddb8 arm64: dts: rockchip: add rk3399 hdmi nodes
Add an hdmi node, and also add hdmi endpoints to vopb and vopl
output port nodes.

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-06 17:35:16 +02:00
Jacob Chen
d3f51f4982 arm64: dts: rockchip: add rk3399 mipi nodes
Add an mipi node, and also add mipi endpoints to vopb and vopl
output port nodes.

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-06 17:35:11 +02:00
Yakir Yang
f7a29e30f8 arm64: dts: rockchip: add rk3399 edp nodes
Add an edp node, and also add edp endpoints to vopb and vopl
output port nodes.

Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-06 17:35:00 +02:00
Elaine Zhang
3cf04a4e60 arm64: dts: rockchip: add pd_edp node for rk3399
1. add pd node for RK3399 Soc
2. create power domain tree
3. add qos node for domain

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-06 15:48:12 +02:00
Mark Yao
fbd4cc0e7c arm64: dts: rockchip: Add rk3399 vop and display-subsystem
Add devicetree nodes for rk3399 VOP (Video Output Processors), and the
top level display-subsystem root node.

Later patches add endpoints (eDP, HDMI, MIPI, etc) that attach to the
VOPs' output ports.

Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-06 15:47:53 +02:00
Jianqun Xu
bc911f2590 arm64: dts: rockchip: include opp dtsi for rk3399 firefly
Add opp tables for cpu cluster0 and cluster1 by including
rk3399-opp.dtsi.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-06 12:25:22 +02:00
Finley Xiao
e997a6a4b2 arm64: dts: rockchip: Add cpu operating points for RK3328 SoC
This patch adds basic OPP entries for RK3328 SoC.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-06 12:21:31 +02:00
Horia Geantă
1e09dec932 arm64: dts: freescale: ls1088a: add crypto node
LS1088A has a SEC v5.3 security engine.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2017-08-05 09:55:16 +08:00
Horia Geantă
a51532308f arm64: dts: freescale: ls208xa: add crypto node
LS208xA has a SEC v5.1 security engine.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2017-08-05 09:55:14 +08:00
Horia Geantă
90034d1bbc arm64: dts: freescale: ls208xa: share aliases node
aliases node is identical for all boards, thus move it
to the common file ls208xa.dtsi.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2017-08-05 09:55:09 +08:00
Linus Torvalds
6999507416 KVM fixes for v4.13-rc4
ARM:
  - Yet another race with VM destruction plugged
  - A set of small vgic fixes
 
 x86:
  - Preserve pending INIT
  - RCU fixes in paravirtual async pf, VM teardown, and VMXOFF emulation
  - nVMX interrupt injection and dirty tracking fixes
  - initialize to make UBSAN happy
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABCAAGBQJZhNZ2AAoJEED/6hsPKofoKDEH/iIw1pcgdEW2NP/kFtKXSMCK
 josdFwGPQMjBGzx6No4tfMCNDOjW2FKYXapN6CASAqMJo5H2krj8VHMVwm0h3lUl
 4RdbbkFTdfl/Znp8M39efFheWrjX+L37AltKV7xAgA7n8cO39KV4RReimzSc7aVq
 5dDt4k0dbF9/zXHxkGiKEhwaSSbZEEznQQ/09annSoOVe6om5esUrUtnUF5P99uz
 IhAsmJbZxE5VmowjT5MjaR1mXSLLNL55HWKvkf3B3ZGnyxQU+3Vz7IGf2Ma2j+jV
 IrdXA11NHDY1anDYgDhFlr3rTCPu9CBmTv4O8zsDRlX9TGpr8bBX2dvjRKl7uOo=
 =KM80
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull KVM fixes from Radim Krčmář:
 "ARM:

   - Yet another race with VM destruction plugged

   - A set of small vgic fixes

  x86:

   - Preserve pending INIT

   - RCU fixes in paravirtual async pf, VM teardown, and VMXOFF
     emulation

   - nVMX interrupt injection and dirty tracking fixes

   - initialize to make UBSAN happy"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: arm/arm64: vgic: Use READ_ONCE fo cmpxchg
  KVM: nVMX: Fix interrupt window request with "Acknowledge interrupt on exit"
  KVM: nVMX: mark vmcs12 pages dirty on L2 exit
  kvm: nVMX: don't flush VMCS12 during VMXOFF or VCPU teardown
  KVM: nVMX: do not pin the VMCS12
  KVM: avoid using rcu_dereference_protected
  KVM: X86: init irq->level in kvm_pv_kick_cpu_op
  KVM: X86: Fix loss of pending INIT due to race
  KVM: async_pf: make rcu irq exit if not triggered from idle task
  KVM: nVMX: fixes to nested virt interrupt injection
  KVM: nVMX: do not fill vm_exit_intr_error_code in prepare_vmcs12
  KVM: arm/arm64: Handle hva aging while destroying the vm
  KVM: arm/arm64: PMU: Fix overflow interrupt injection
  KVM: arm/arm64: Fix bug in advertising KVM_CAP_MSI_DEVID capability
2017-08-04 15:18:27 -07:00
Linus Torvalds
65f4740e72 ARM: SoC fixes for 4.13
This comes a bit later than I planned, and as a consequence is a larger
 than it should be.
 
 Most of the changes are devicetree fixes, across lots of platforms:
 Renesas, Samsung Exynos, Marvell EBU, TI OMAP, Rockchips, Amlogic Meson,
 Sigma Desings Tango, Allwinner SUNxi and TI Davinci.
 
 Also across many platforms, I applied an older series of simple randconfig
 build fixes. This includes making the CONFIG_MTD_XIP option compile again,
 which had been broken for many years and probably has not been missed, but
 it felt wrong to just remove it completely.
 
 The only other changes are:
 
  - We enable HWSPINLOCK in defconfig to get some Qualcomm boards
    to work out of the box.
 
  - A few regression fixes for Texas Instruments OMAP2+.
 
  - A boot regression fix for the Renesas regulator quirk.
 
  - A suspend/resume fix for Uniphier SoCs, fixing the resume of the
    system bus.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIVAwUAWYTonGCrR//JCVInAQJTrw/+Kv+Y1EybtFFJuMgVqH0FserTKAonNv25
 OJxby86GQQTKkju9U7jYM4MmpufBEMKnY9kn83rviUKfiuVDsJcRWp2jMynJtE5m
 W1aIFCu1L8TsKAQJpmBPe8G/cSG7SRH2OoX9Ee5ozii0cBUTOCy6UGDYJqsY0MKy
 8KPUWcHqYhLCT+0F0raf1+F5LqJlDh44q1+UVDPphqO4pbguio7PfXA+ut8VMHS7
 YSDgiXb3UoXy8tSXRX4JcYJfFG+jIqg0vWpkOW9mlLc5e/+Ndmj5CWlDZPt4hWaR
 3Us5VVkI8SXq7VGcJV/mA6JO7M4L4oP1caTATxzDdK1C2u/SuhdnMcenOy8LtRLi
 gImdeZLK7+RFPS+Sp/mhQQ0UtULw0kQ5BEzpN0jVI1CKybK4TN2+GrJdZLR9Usas
 TkavAUl0X5E7YXws7yb8qTJqDLXxTxyN8H4gMaTh+rCssh9+I8bvChoJ0gpGRIMl
 iAHodqGFBvlVQWtUefc4BfDCqj7sVmtfBcAeOK7LVQPjb9D+hPvHJ50yfN3qMpMa
 eVvEz4l91W4k/vxI5HsA/r7RybDujTLvgR/BGU0kLZAsEP/FpkrIKgmi5yuzyf1u
 Sd3OiK8V7FXB3dBPf0i0wagaBjuEUcEuE0GQU+bM7qX5aW8flLxbEhj4SEv0NqvL
 bHiaTEi9uAU=
 =a2dO
 -----END PGP SIGNATURE-----

Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Arnd Bergmann:
 "This comes a bit later than I planned, and as a consequence is a
  larger than it should be.

  Most of the changes are devicetree fixes, across lots of platforms:
  Renesas, Samsung Exynos, Marvell EBU, TI OMAP, Rockchips, Amlogic
  Meson, Sigma Desings Tango, Allwinner SUNxi and TI Davinci.

  Also across many platforms, I applied an older series of simple
  randconfig build fixes. This includes making the CONFIG_MTD_XIP option
  compile again, which had been broken for many years and probably has
  not been missed, but it felt wrong to just remove it completely.

  The only other changes are:

   - We enable HWSPINLOCK in defconfig to get some Qualcomm boards to
     work out of the box.

   - A few regression fixes for Texas Instruments OMAP2+.

   - A boot regression fix for the Renesas regulator quirk.

   - A suspend/resume fix for Uniphier SoCs, fixing the resume of the
     system bus"

* tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (43 commits)
  ARM: dts: tango4: Request RGMII RX and TX clock delays
  bus: uniphier-system-bus: set up registers when resuming
  ARM64: dts: marvell: armada-37xx: Fix the number of GPIO on south bridge
  ARM: shmobile: rcar-gen2: Fix deadlock in regulator quirk
  arm64: defconfig: enable missing HWSPINLOCK
  ARM: pxa: select both FB and FB_W100 for eseries
  ARM: ixp4xx: fix ioport_unmap definition
  ARM: ep93xx: use ARM_PATCH_PHYS_VIRT correctly
  ARM: mmp: mark usb_dma_mask as __maybe_unused
  ARM: omap2: mark unused functions as __maybe_unused
  ARM: omap1: avoid unused variable warning
  ARM: sirf: mark sirfsoc_init_late as __maybe_unused
  ARM: ixp4xx: use normal prototype for {read,write}s{b,w,l}
  ARM: omap1/ams-delta: warn about failed regulator enable
  ARM: rpc: rename RAM_SIZE macro
  ARM: w90x900: normalize clk API
  ARM: ep93xx: normalize clk API
  ARM: dts: sun8i: a83t: Switch to CCU device tree binding macros
  arm64: allwinner: sun50i-a64: Correct emac register size
  ARM: dts: sunxi: h3/h5: Correct emac register size
  ...
2017-08-04 15:12:15 -07:00
Catalin Marinas
174dfb1286 arm64: neon: Temporarily add a kernel_mode_begin_partial() definition
The crypto code currently relies on kernel_mode_begin_partial() being
available. Until the corresponding crypto patches are merged, define
this macro temporarily, though with different semantics as it cannot be
called in interrupt context.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-04 15:10:12 +01:00
Nick Desaulniers
82cd588052 arm64: avoid overflow in VA_START and PAGE_OFFSET
The bitmask used to define these values produces overflow, as seen by
this compiler warning:

arch/arm64/kernel/head.S:47:8: warning:
      integer overflow in preprocessor expression
  #elif (PAGE_OFFSET & 0x1fffff) != 0
         ^~~~~~~~~~~
arch/arm64/include/asm/memory.h:52:46: note:
      expanded from macro 'PAGE_OFFSET'
  #define PAGE_OFFSET             (UL(0xffffffffffffffff) << (VA_BITS -
1))
                                      ~~~~~~~~~~~~~~~~~~  ^

It would be preferrable to use GENMASK_ULL() instead, but it's not set
up to be used from assembly (the UL() macro token pastes UL suffixes
when not included in assembly sources).

Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Suggested-by: Yury Norov <ynorov@caviumnetworks.com>
Suggested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-08-04 15:06:35 +01:00
Dave Martin
cb84d11e16 arm64: neon: Remove support for nested or hardirq kernel-mode NEON
Support for kernel-mode NEON to be nested and/or used in hardirq
context adds significant complexity, and the benefits may be
marginal.  In practice, kernel-mode NEON is not used in hardirq
context, and is rarely used in softirq context (by certain mac80211
drivers).

This patch implements an arm64 may_use_simd() function to allow
clients to check whether kernel-mode NEON is usable in the current
context, and simplifies kernel_neon_{begin,end}() to handle only
saving of the task FPSIMD state (if any).  Without nesting, there
is no other state to save.

The partial fpsimd save/restore functions become redundant as a
result of these changes, so they are removed too.

The save/restore model is changed to operate directly on
task_struct without additional percpu storage.  This simplifies the
code and saves a bit of memory, but means that softirqs must now be
disabled when manipulating the task fpsimd state from task context:
correspondingly, preempt_{en,dis}sable() calls are upgraded to
local_bh_{en,dis}able() as appropriate.  fpsimd_thread_switch()
already runs with hardirqs disabled and so is already protected
from softirqs.

These changes should make it easier to support kernel-mode NEON in
the presence of the Scalable Vector extension in the future.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-04 15:00:57 +01:00
Dave Martin
4328825d4f arm64: neon: Allow EFI runtime services to use FPSIMD in irq context
In order to be able to cope with kernel-mode NEON being unavailable
in hardirq/nmi context and non-nestable, we need special handling
for EFI runtime service calls that may be made during an interrupt
that interrupted a kernel_neon_begin()..._end() block.  This will
occur if the kernel tries to write diagnostic data to EFI
persistent storage during a panic triggered by an NMI for example.

EFI runtime services specify an ABI that clobbers the FPSIMD state,
rather than being able to use it optionally as an accelerator.
This means that EFI is really a special case and can be handled
specially.

To enable EFI calls from interrupts, this patch creates dedicated
__efi_fpsimd_{begin,end}() helpers solely for this purpose, which
save/restore to a separate percpu buffer if called in a context
where kernel_neon_begin() is not usable.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-04 15:00:54 +01:00
Dave Martin
504641859e arm64: fpsimd: Consistently use __this_cpu_ ops where appropriate
__this_cpu_ ops are not used consistently with regard to this_cpu_
ops in a couple of places in fpsimd.c.

Since preemption is explicitly disabled in
fpsimd_restore_current_state() and fpsimd_update_current_state(),
this patch converts this_cpu_ ops in those functions to __this_cpu_
ops.  This doesn't save cost on arm64, but benefits from additional
assertions in the core code.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-04 15:00:52 +01:00
Dave Martin
0fc9179ad0 arm64: neon: Add missing header guard in <asm/neon.h>
asm/neon.h doesn't have a header inclusion guard, but it should
have one for consistency with other headers.

This patch adds a suitable guard.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-04 15:00:50 +01:00
Ard Biesheuvel
f960181d5d arm64: neon: replace generic definition of may_use_simd()
In preparation of modifying the logic that decides whether kernel mode
NEON is allowable, which is required for SVE support, introduce an
implementation of may_use_simd() that reflects the current reality, i.e.,
that SIMD is allowed in any context.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-08-04 15:00:47 +01:00
Catalin Marinas
6d332747fa arm64: Fix potential race with hardware DBM in ptep_set_access_flags()
In a system with DBM (dirty bit management) capable agents there is a
possible race between a CPU executing ptep_set_access_flags() (maybe
non-DBM capable) and a hardware update of the dirty state (clearing of
PTE_RDONLY). The scenario:

a) the pte is writable (PTE_WRITE set), clean (PTE_RDONLY set) and old
   (PTE_AF clear)
b) ptep_set_access_flags() is called as a result of a read access and it
   needs to set the pte to writable, clean and young (PTE_AF set)
c) a DBM-capable agent, as a result of a different write access, is
   marking the entry as young (setting PTE_AF) and dirty (clearing
   PTE_RDONLY)

The current ptep_set_access_flags() implementation would set the
PTE_RDONLY bit in the resulting value overriding the DBM update and
losing the dirty state.

This patch fixes such race by setting PTE_RDONLY to the most permissive
(lowest value) of the current entry and the new one.

Fixes: 66dbd6e61a ("arm64: Implement ptep_set_access_flags() for hardware AF/DBM")
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Steve Capper <steve.capper@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-08-04 13:26:11 +01:00
Arnd Bergmann
ae119859a1 Allwinner fixes for 4.13
Two fixes to correct the EMAC blocks memory region size to match the
 datasheet. One that converts raw A83T clock indices to macros from the
 clk dt-binding header, completing the A83T sunxi-ng clk driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCgAsFiEE2nN1m/hhnkhOWjtHOJpUIZwPJDAFAll566wOHHdlbnNAY3Np
 ZS5vcmcACgkQOJpUIZwPJDBBhw//RK8UpKhviq1kdn6yDNKe3dVYxRTGtISvpjJL
 oPXpstt1b28DdbVjeIzh6jqF2HjjNmfFlLphOoOj1H7qKqhobr9+Cll05BNWbCmH
 CIL6qL8FT7QyK8yw5sPLcdlNLkNil+KfgnrBf76Crdw0R1HXGENsw+gVE2lVX+tJ
 yRqhguaQjWNLA5v+nfK4la+Ip1ddgKgiBmkpkq9tuR8hUDe33LHFZxur28EChHb/
 P1HXL1DHUn2uO/tyk1TDhpYkNbOGiER4neOeQt21uaKLDaRMmkRlaNHgGg4CQ/fR
 OYs24Sm0XB9oFVKzz2GttkIkdWTOqRI99VlXHEd3bU3Rc2PdClrdky615qkDn/90
 CCjz7ibhnkri5+1/MWVC1iF/sotYnlCKjptXMZNRmqoyC2ol+tkNy84MoHvuWBCU
 /IzCNuU8sGqC5/PjGNo2LwQNmzkFsk78s0MQAUyxG0isJwMrGQaSXGtOpSLJzUPv
 MRBqYyK2CQk7gZtDyeZPepUUeQta/bAFIUROeozgTstvib86ywYrflrjkBTEyPar
 Q+ptcoEgw1FVZZ4cQCGQWkg16dtFPSBMbGAbjlh/9DJXbZU/DVF5XRpTj8FthWm7
 Vw/QQx4A18O+oS5/CkBjdltAb4RZIcF2ijAupRbwPIG+pzNVJVJ7JN7BzdVAFAyF
 cf/Btkw=
 =aFvT
 -----END PGP SIGNATURE-----

Merge tag 'sunxi-fixes-for-4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into fixes

Pull "Allwinner fixes for 4.13" from Chen-Yu Tsai:

Two fixes to correct the EMAC blocks memory region size to match the
datasheet. One that converts raw A83T clock indices to macros from the
clk dt-binding header, completing the A83T sunxi-ng clk driver.

* tag 'sunxi-fixes-for-4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  ARM: dts: sun8i: a83t: Switch to CCU device tree binding macros
  arm64: allwinner: sun50i-a64: Correct emac register size
  ARM: dts: sunxi: h3/h5: Correct emac register size
2017-08-04 13:04:42 +02:00
Arnd Bergmann
3d8db0a889 Qualcomm ARM64 based defconfig Fixes for v4.13-rc2
* Enable missing HWSPINLOCK
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZerrIAAoJEFKiBbHx2RXVMFMQAKrBeXhmKtlqyVbq4/LWTVt+
 uSTbRGOwzQKPpZaaXPZAddL508zNKw/aVyOrWGth7WmAAEHbCsywWLlIie6YhyK0
 gck0d6FI2f2U0lG7QrYrGKktQgB8YhFg5XYzuol97jYL7W/NzkXcpOv3NFIGzu2S
 nyYIO0MeTNinYuQylalbyY5ifT6ckxYgoYc4gvHXoDkIKg8beDYGrEZq5s/l15sO
 tXEcfJLqd2FL6/jkKQsZCoLtPAUKJBl4ziKCJkQIh2Cm8nikjtRXzSIY5WJC5dNG
 uE53FMdYdo4yiRU8hqrItXKUh2RyraiNQdWufP3VjOULN2ffVkckMPB7tzLjes24
 Ah0joCA1tlpiIEtu1rKM8e4Opn/EgKXXrwr1oxEM12HME/Ph5DX8I5D6g8LhmxB4
 9ZI3Lox1dnfr+Rr9xR19hbOG5vF2fQQlneMb5QDmg9kT7+xgQnponCZBSCBtS1rL
 0EbpN/qb0+N+/aUTj/1Lvmhi9AY/4+aD5tOWN8XanIahhWKyDRKbT9zELdr80e4z
 wPK4uPNNaJcFTrCvsOT4C6DBoNE46Ii9GOexGvdK75NoTspe92L/IIGGMLk6l32g
 eksX9EOyYLs9WZEAX4kYjf5umJvbIMkFQToD0gnA2xsrft5z+xoa5Rgw2CxVaI0w
 rTHgJbPQ1gyHAlInrBHv
 =dA4+
 -----END PGP SIGNATURE-----

Merge tag 'qcom-arm64-defconfig-fixes-for-4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into fixes

Pull "Qualcomm ARM64 based defconfig Fixes for v4.13-rc2" from Andy Gross:

* Enable missing HWSPINLOCK

* tag 'qcom-arm64-defconfig-fixes-for-4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux:
  arm64: defconfig: enable missing HWSPINLOCK
2017-08-04 13:03:24 +02:00
Arnd Bergmann
48cb953e6d mvebu fixes for 4.13 (part 2)
All the fixes are for ARM64 mvebu:
 
  - Fix the RTC interrupt on A7K/A8K which was missed when switching
    from GIC to ICU
  - Mark the A7K/A8K crypto engine as dma coherent
  - Fix the number of GPIO on south bridge on Armada 3700
 -----BEGIN PGP SIGNATURE-----
 
 iIEEABECAEEWIQQYqXDMF3cvSLY+g9cLBhiOFHI71QUCWYHbmCMcZ3JlZ29yeS5j
 bGVtZW50QGZyZWUtZWxlY3Ryb25zLmNvbQAKCRALBhiOFHI71ZhfAJ9Z9aMBG1xd
 vbRYBDdqPdntruTudwCcDtM9jS2nL+207JfeMD0WMs7sDdU=
 =XwFM
 -----END PGP SIGNATURE-----

Merge tag 'mvebu-fixes-4.13-2' of git://git.infradead.org/linux-mvebu into fixes

Pull "mvebu fixes for 4.13 (part 2)" from Gregory CLEMENT:

All the fixes are for ARM64 mvebu:

 - Fix the RTC interrupt on A7K/A8K which was missed when switching
   from GIC to ICU
 - Mark the A7K/A8K crypto engine as dma coherent
 - Fix the number of GPIO on south bridge on Armada 3700

* tag 'mvebu-fixes-4.13-2' of git://git.infradead.org/linux-mvebu:
  ARM64: dts: marvell: armada-37xx: Fix the number of GPIO on south bridge
  arm64: dts: marvell: mark the cp110 crypto engine as dma coherent
  arm64: dts: marvell: use ICU for the CP110 slave RTC
2017-08-04 12:53:21 +02:00
Arnd Bergmann
b99bba09a5 Amlogic fixes for v4.13-rc
- 2 minor DT fixes
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJZf0PMAAoJEFk3GJrT+8ZlJskP/0JXcJt1I4myJv9A9z/+t0nh
 7vT8H/ZwSyvK+/Iq1ccrf0Abe/c3445yHCwnF0T87R14A+oVVML5+uDolHIRZjlf
 Wka34OoZFR9qTjphsFfQdZ0YcId7+a3BXNyvdkIWytWB+tzy/gpvlExBd54wJy0c
 rceTEJsdmyObBFTmMTdlTzKQYLvurWoZ7d/N+T81UD3g0Xmq0EIOk0pEHSThK4SS
 yQQWfRu7PCWDfXVu7qImalniaSa6wriHFC8hnrmaLfm2a9axfrTpvVknYuZUROlj
 3T0Hgq3YHYe+BpS1P1Wryh60Yc8umbGy5JYg4GFOlNEGT9lBflk7nyG25aAbtwXY
 BUU/r1cA1K+wR3XbUK9dpxW0GeCDTsQkHY9SA6+Aj5utNcMVhlnmGAHxJX9j1a8n
 OhZtk339oCuBaf2Eg67OLvNGCPN21LAr2PL22LEGWkKSEUI61/1ZP1jjuCjN8Yk0
 spXdFshdkYJyMqA4VuR05R5sBgqO25hXVDB2RYE4OuKINvAOfckgY9XpUhndxuYx
 VVfX1up4bwoAUzVR+7XIsVrHaDR8pNS/Uv6kbhfB3X2c/jyPD1/Rc3T8p5DYirt7
 DUPv8MJm/cwEC6uinQyqHTgB0tYLTWEY2+sv8NI2u8geYoJZO+Kt/12f3gcx296e
 82LIlHnYKfYqUaqFwRRJ
 =Z5d3
 -----END PGP SIGNATURE-----

Merge tag 'amlogic-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into fixes

Pull "Amlogic fixes for v4.13-rc" from Kevin Hilman:

- 2 minor DT fixes

* tag 'amlogic-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic:
  ARM64: dts: meson-gxl-s905x-libretech-cc: fixup board definition
  ARM64: dts: meson-gx: use specific compatible for the AO pwms
2017-08-04 12:50:52 +02:00
Ard Biesheuvel
7c83d689c7 crypto: arm64/aes - avoid expanded lookup tables in the final round
For the final round, avoid the expanded and padded lookup tables
exported by the generic AES driver. Instead, for encryption, we can
perform byte loads from the same table we used for the inner rounds,
which will still be hot in the caches. For decryption, use the inverse
AES Sbox directly, which is 4x smaller than the inverse lookup table
exported by the generic driver.

This should significantly reduce the Dcache footprint of our code,
which makes the code more robust against timing attacks. It does not
introduce any additional module dependencies, given that we already
rely on the core AES module for the shared key expansion routines.
It also frees up register x18, which is not available as a scratch
register on all platforms, which and so avoiding it improves
shareability of this code.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:26 +08:00
Ard Biesheuvel
03c9a333fe crypto: arm64/ghash - add NEON accelerated fallback for 64-bit PMULL
Implement a NEON fallback for systems that do support NEON but have
no support for the optional 64x64->128 polynomial multiplication
instruction that is part of the ARMv8 Crypto Extensions. It is based
on the paper "Fast Software Polynomial Multiplication on ARM Processors
Using the NEON Engine" by Danilo Camara, Conrado Gouvea, Julio Lopez and
Ricardo Dahab (https://hal.inria.fr/hal-01506572), but has been reworked
extensively for the AArch64 ISA.

On a low-end core such as the Cortex-A53 found in the Raspberry Pi3, the
NEON based implementation is 4x faster than the table based one, and
is time invariant as well, making it less vulnerable to timing attacks.
When combined with the bit-sliced NEON implementation of AES-CTR, the
AES-GCM performance increases by 2x (from 58 to 29 cycles per byte).

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:25 +08:00
Ard Biesheuvel
537c1445ab crypto: arm64/gcm - implement native driver using v8 Crypto Extensions
Currently, the AES-GCM implementation for arm64 systems that support the
ARMv8 Crypto Extensions is based on the generic GCM module, which combines
the AES-CTR implementation using AES instructions with the PMULL based
GHASH driver. This is suboptimal, given the fact that the input data needs
to be loaded twice, once for the encryption and again for the MAC
calculation.

On Cortex-A57 (r1p2) and other recent cores that implement micro-op fusing
for the AES instructions, AES executes at less than 1 cycle per byte, which
means that any cycles wasted on loading the data twice hurt even more.

So implement a new GCM driver that combines the AES and PMULL instructions
at the block level. This improves performance on Cortex-A57 by ~37% (from
3.5 cpb to 2.6 cpb)

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:23 +08:00
Ard Biesheuvel
ec808bbef0 crypto: arm64/aes-bs - implement non-SIMD fallback for AES-CTR
Of the various chaining modes implemented by the bit sliced AES driver,
only CTR is exposed as a synchronous cipher, and requires a fallback in
order to remain usable once we update the kernel mode NEON handling logic
to disallow nested use. So wire up the existing CTR fallback C code.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:22 +08:00
Ard Biesheuvel
611d5324f4 crypto: arm64/chacha20 - take may_use_simd() into account
To accommodate systems that disallow the use of kernel mode NEON in
some circumstances, take the return value of may_use_simd into
account when deciding whether to invoke the C fallback routine.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:22 +08:00
Ard Biesheuvel
e211506979 crypto: arm64/aes-blk - add a non-SIMD fallback for synchronous CTR
To accommodate systems that may disallow use of the NEON in kernel mode
in some circumstances, introduce a C fallback for synchronous AES in CTR
mode, and use it if may_use_simd() returns false.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:21 +08:00
Ard Biesheuvel
5092fcf349 crypto: arm64/aes-ce-ccm: add non-SIMD generic fallback
The arm64 kernel will shortly disallow nested kernel mode NEON.

So honour this in the ARMv8 Crypto Extensions implementation of
CCM-AES, and fall back to a scalar implementation using the generic
crypto helpers for AES, XOR and incrementing the CTR counter.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:21 +08:00
Ard Biesheuvel
b8fb993a83 crypto: arm64/aes-ce-cipher: add non-SIMD generic fallback
The arm64 kernel will shortly disallow nested kernel mode NEON, so
add a fallback to scalar code that can be invoked in that case.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:20 +08:00
Ard Biesheuvel
f402e3115e crypto: arm64/aes-ce-cipher - match round key endianness with generic code
In order to be able to reuse the generic AES code as a fallback for
situations where the NEON may not be used, update the key handling
to match the byte order of the generic code: it stores round keys
as sequences of 32-bit quantities rather than streams of bytes, and
so our code needs to be updated to reflect that.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:19 +08:00
Ard Biesheuvel
da1793312f crypto: arm64/sha2-ce - add non-SIMD scalar fallback
The arm64 kernel will shortly disallow nested kernel mode NEON, so
add a fallback to scalar code that can be invoked in that case.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:19 +08:00
Ard Biesheuvel
0771f3234d crypto: arm64/sha1-ce - add non-SIMD generic fallback
The arm64 kernel will shortly disallow nested kernel mode NEON, so
add a fallback to scalar C code that can be invoked in that case.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:18 +08:00
Ard Biesheuvel
15c7d8f8a2 crypto: arm64/crc32 - add non-SIMD scalar fallback
The arm64 kernel will shortly disallow nested kernel mode NEON, so
add a fallback to scalar C code that can be invoked in that case.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:17 +08:00
Ard Biesheuvel
2dde374e1f crypto: arm64/crct10dif - add non-SIMD generic fallback
The arm64 kernel will shortly disallow nested kernel mode NEON, so
add a fallback to scalar C code that can be invoked in that case.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:16 +08:00
Ard Biesheuvel
6d6254d728 crypto: arm64/ghash-ce - add non-SIMD scalar fallback
The arm64 kernel will shortly disallow nested kernel mode NEON, so
add a fallback to scalar C code that can be invoked in that case.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:16 +08:00
Ard Biesheuvel
45fe93dff2 crypto: algapi - make crypto_xor() take separate dst and src arguments
There are quite a number of occurrences in the kernel of the pattern

  if (dst != src)
          memcpy(dst, src, walk.total % AES_BLOCK_SIZE);
  crypto_xor(dst, final, walk.total % AES_BLOCK_SIZE);

or

  crypto_xor(keystream, src, nbytes);
  memcpy(dst, keystream, nbytes);

where crypto_xor() is preceded or followed by a memcpy() invocation
that is only there because crypto_xor() uses its output parameter as
one of the inputs. To avoid having to add new instances of this pattern
in the arm64 code, which will be refactored to implement non-SIMD
fallbacks, add an alternative implementation called crypto_xor_cpy(),
taking separate input and output arguments. This removes the need for
the separate memcpy().

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-08-04 09:27:15 +08:00
Radim Krčmář
53a5abd839 KVM/ARM Fixes for v4.13-rc4
- Yet another race with VM destruction plugged
 - A set of small vgic fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEn9UcU+C1Yxj9lZw9I9DQutE9ekMFAlmDOZ4VHG1hcmMuenlu
 Z2llckBhcm0uY29tAAoJECPQ0LrRPXpDnwQP/ji7d7bbWybmeuWKXm8TYt6CNPBr
 JC57OQHytU1+ccagjeUPaAgUAqWSQWOwfbqPuS1afshJu1ZZsN851QNmcr5W6bXQ
 EwjICGWcAdKSMLnhRDdf+uXQbFSkkcaxsXnJWjmD0EE8ylaXCCkdV278xhTx0hVO
 yiov/xWNzLMa3O3W/l4SIKQ4UNyeQ7f+Od1Vkf7iUpaaFcz6s3RNsPAOwc7Thq7L
 eLk4SgXMLDNHz5HwdLoOp3RwQsNe9A7uh05z9VOav0YAyLG5vf29JhMroCO/4P/x
 1HgWvpGwzxAUqUcHbW4FSOsbydEltlWMdfSoAF7BtPCLudmmsxfMJJlK3FKLvV+P
 MsO2FdXiz6/ZLI9/ds7YJDOfc1cGSVK07Efx+SLXD5FAnkFYq4SElmI4sK8BWc5U
 Dugw3j8u9M6jTiVKBioFo7yRT5iHG9O0A+6DtsMQ0iREfLolC7EEzpfGB/vWpKk5
 BbdwDUiu6JxXEBJJqyP948iGfuIrikAx2mcf3dmEHVKhEnKi+MN/H5c9BKGAJ3sf
 Fm1xF99IG+m3L3zXiukQ11OqsCx32kqLiXaejVttscFg/C33OYmGOhsk066hHCzx
 LtoxrHUl7rwF+ssnKHq4Az2mYzZtquEq13O5tgleQcVwH/2+6EgWDf3mDSy1em0h
 5IXgqk+PsaQ5n0jL
 =TMR9
 -----END PGP SIGNATURE-----

Merge tag 'kvm-arm-for-v4.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm

KVM/ARM Fixes for v4.13-rc4

- Yet another race with VM destruction plugged
- A set of small vgic fixes
2017-08-03 17:59:58 +02:00
Marcin Wojtas
a168f2a804 arm64: defconfig: enable fine-grained task level IRQ time accounting
Tests showed, that under certain conditions, the summary number of jiffies
spent on softirq/idle, which are counted by system statistics can be even
below 10% of expected value, resulting in false load presentation.

The issue was observed on the quad-core Marvell Armada 8k SoC, whose two
10G ports were bound into L2 bridge. Load was controlled by bidirectional
UDP traffic, produced by a packet generator. Under such condition,
the dominant load is softirq. With 100% single CPU occupation or without
any activity (all CPUs 100% idle), total number of jiffies is 10000 (2500
per each core) in 10s interval. Also with other kind of load this was
true.

However below a saturation threshold it was observed, that with CPU which
was occupied almost by softirqs only, the statistic were awkward. See
the mpstat output:

CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
all 0.00  0.00 0.13    0.00 0.00  0.55   0.00   0.00   0.00 99.32
  0 0.00  0.00 0.00    0.00 0.00 23.08   0.00   0.00   0.00 76.92
  1 0.00  0.00 0.40    0.00 0.00  0.00   0.00   0.00   0.00 99.60
  2 0.00  0.00 0.00    0.00 0.00  0.00   0.00   0.00   0.00 100.00
  3 0.00  0.00 0.00    0.00 0.00  0.00   0.00   0.00   0.00 100.00

Above would mean basically no total load, debug CPU0 occupied in 25%.
Raw statistics, printed every 10s from /proc/stat unveiled a root
cause - summary idle/softirq jiffies on loaded CPU were below 200,
i.e. over 90% samples lost. All problems were gone after enabling
fine granulity IRQ time accounting.

This patch fixes possible wrong statistics processing by enabling
CONFIG_IRQ_TIME_ACCOUNTING for arm64 platfroms, which is by
default done on other architectures, e.g. x86 and arm. Tests
showed no noticeable performance penalty, nor stability impact.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-03 14:25:52 +02:00
Marcin Wojtas
9be778f6c6 ARM64: dts: marvell: armada-37xx: Enable uSD on ESPRESSObin
The ESPRESSObin board exposes one of the SDHCI interfaces
via J1 uSD slot. This patch enables it.

Tested-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Signed-off-by: Zbigniew Bodek <zbodek@gmail.com>
[gregory.clement@free-electrons.com:  removed "no-1-8-v"]
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-03 14:16:14 +02:00
Gregory CLEMENT
994a8e8a54 arm64: dts: marvell: Fully re-order nodes in Marvell CP110 dtsi files
Since the introduction of the CP110 dt files, the sata node was
misplaced. Move it at the right place. Thanks to this, the files are
completely ordered.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-03 14:14:43 +02:00
Palmer Dabbelt
ecf677c8dc PCI: Add a generic weak pcibios_align_resource()
Multiple architectures define this as a trivial function, and I'm adding
another one as part of the RISC-V port.  Add a __weak version of
pcibios_align_resource() and delete the now-obselete ones in a handful of
ports.

The only functional change should be that a handful of ports used to export
pcibios_fixup_bus().  Only some architectures export this, so I just
dropped it.

Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2017-08-02 14:53:16 -05:00
Palmer Dabbelt
bccf90d6e0 PCI: Add a generic weak pcibios_fixup_bus()
Multiple architectures define this as an empty function, and I'm adding
another one as part of the RISC-V port.  Add a __weak version of
pcibios_fixup_bus() and delete the now-obselete ones in a handful of
ports.

The only functional change should be that microblaze used to export
pcibios_fixup_bus().  None of the other architectures exports this, so I
just dropped it.

Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2017-08-02 14:43:38 -05:00
Thomas Petazzoni
249112cef2 arm64: dts: marvell: re-order RTC nodes in Marvell CP110 description
In both the CP110 master and slave description, the node describing
the RTC was at the wrong place when taking into account increasing
register addresses. Interestingly, it was not even at the same (wrong)
place in both files.

This commit adjusts that, making the master and slave descriptions
more aligned.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-02 16:07:38 +02:00
Antoine Tenart
f8c19a8813 arm64: dts: marvell: mcbin: add an stdout-path
This patch adds an stdout-path to the mcbin device tree. This allows to
use earlycon.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-02 16:07:38 +02:00
Russell King
b83e1669ad arm64: dts: marvell: mcbin: add support for PCIe
Add support for PCIe with the the PCIe reset signal wired up to the
appropriate GPIO pin.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
(excepted the reset part)
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-02 16:07:38 +02:00
Russell King
8a91e1580b arm64: dts: marvell: mcbin: add support for i2c mux
The MACCHIATOBin board has a PCA9548 I2C mux for the SFP ports on
CP100 master I2C bus 1.  Add the DT description for it.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-02 16:07:38 +02:00
Russell King
45df70cbd1 arm64: dts: marvell: fix USB3 regulator definition on MacchiatoBin
Due to the lack of GPIO support, the USB3 regulator definition was
left unfinished in the MacchiatoBin DT description. Now that GPIO
support is available, this commit adjusts the Device Tree to properly
describe the USB3 regulator.

[gregory.clement@free-electrons.com: use commit log from Thomas]

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-02 16:07:38 +02:00
Russell King
31ec18e02a arm64: dts: marvell: mcbin: add pinctrl nodes
Add pinctrl nodes to describe the CPM I2C0 and CPS SPI1 settings.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-02 16:07:38 +02:00
Russell King
2188b396d5 arm64: dts: marvell: cp110: add GPIO interrupts
Add the GPIO interrupts for the CP110.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-02 16:07:38 +02:00
Marc Zyngier
48907d0ccb ARM64: dts: marvell: armada-37xx: Enable USB2 on espressobin
The Espressobin SBC has a USB2 interface available on J8. Let's
enable it.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-02 16:07:38 +02:00
Marc Zyngier
395e66ba07 ARM64: dts: marvell: armada-37xx: Wire PMUv3
The Cortex-A53s that power the Armada-37xx SoCs are equipped with
a PMUv3, just like most ARMv8 cores.

Advertise the PMUv3 presence in the device tree, and wire its
interrupt. This allows the perf subsystem to work correctly.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-02 16:07:38 +02:00
Marc Zyngier
5f926e889f ARM64: dts: marvell: armada-37xx: Enable memory-mapped GIC CPU interface
The Cortex-A53s that power the Armada-37xx SoCs are equipped with
a GIC CPU interface that gets enabled when coupled with a GICv3
interrupt controller, such as the GIC-500 on the this SoC.

Advertise the MMIO ranges provided by the CPUs, which enables
(among other things) GICv2 guests to run under a hypervisor such
as KVM.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-02 16:07:38 +02:00
Marc Zyngier
95696d292e ARM64: dts: marvell: armada-37xx: Fix GIC maintenance interrupt
The GIC-500 integrated in the Armada-37xx SoCs is compliant with
the GICv3 architecture, and thus provides a maintenance interrupt
that is required for hypervisors to function correctly.

With the interrupt provided in the DT, KVM now works as it should.
Tested on an Espressobin system.

Fixes: adbc3695d9 ("arm64: dts: add the Marvell Armada 3700 family and
a development board")
Cc: <stable@vger.kernel.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-02 16:07:38 +02:00
Gregory CLEMENT
d7a65c4905 ARM64: dts: marvell: armada-37xx: Fix the number of GPIO on south bridge
The number of pins in South Bridge is 30 and not 29. There is a fix for
the driver for the pinctrl, but a fix is also need at device tree level
for the GPIO.

Fixes: afda007fed ("ARM64: dts: marvell: Add pinctrl nodes for Armada
3700")
Cc: <stable@vger.kernel.org>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-08-02 16:00:00 +02:00
Sudeep Holla
207b6e6b5c arm64: dts: juno: replace underscores with hyphen in device node names
Since underscores('_') are not allowed in the device tree nodes names,
replace all of them with hyphen('-') in device node names. Note that
underscores are however allowed in labels.

Reported-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2017-08-02 11:32:14 +01:00
Suzuki K. Poulose
20e00b5d72 arm64: dts: juno: Use the new coresight replicator string
Use the new compatible for ATB programmable replicator in Juno.

Cc: Mike Leach <mike.leach@linaro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2017-08-02 11:27:35 +01:00
Neil Armstrong
12ada0513d ARM64: dts: meson-gxbb-nanopi-k2: Add GPIO lines names
This patch describes the GPIO lines usage on the Nanopi K2 board.

This is useful in the debugfs gpio file and using the cdev gpio API.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2017-08-01 12:57:41 -07:00
Neil Armstrong
60795933b7 ARM64: dts: meson-gxl-khadas-vim: Add GPIO lines names
This patch describes the GPIO lines usage on the Khadas VIM board.

This is useful in the debugfs gpio file and using the cdev gpio API.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
[khilman: minor whitespace fix]
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2017-08-01 12:57:26 -07:00
Jerome Brunet
5149616e7a ARM64: dts: meson-gxbb: p20x: add card regulator settle times
Changing the card voltage on the p200 is not instantaneous, especially
when switching from 3.3v to 1.8v.

I take at least 70ms for the regulator to go from 3.3v to 1.8v. Add
margin to that to make sure we don't upset the sdcard during the voltage
switch

Fixes: ef8d2ffedf ("ARM64: dts: meson-gxbb: add MMC support")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2017-08-01 12:46:45 -07:00
Marc Zyngier
c6f97add0f arm64: Use arch_timer_get_rate when trapping CNTFRQ_EL0
In an ideal world, CNTFRQ_EL0 always contains the timer frequency
for the kernel to use. Sadly, we get quite a few broken systems
where the firmware authors cannot be bothered to program that
register on all CPUs, and rely on DT to provide that frequency.

So when trapping CNTFRQ_EL0, make sure to return the actual rate
(as known by the kernel), and not CNTFRQ_EL0.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-08-01 12:14:06 +01:00
Caesar Wang
45a995c054 arm64: dts: rockchip: update dynamic-power-coefficient for rk3399
This patch updates the dynamic-power-coefficient for big cluster on
rk3399 SoCs.

The dynamic power consumption of the CPU is proportional to the square of
the Voltage (V) and the clock frequency (f). The coefficient is used to
calculate the dynamic power as below -
Pdyn = dynamic-power-coefficient * V^2 * f
Where Voltage is in uV, frequency is in MHz.

As the following is the tested data on rk3399's big cluster.
frequency(MHz)  Voltage(V)  Current(mA) Dynamic-power-coefficient
24              0.8         15
48              0.8         23          ~417
96              0.8         40          ~443
216             0.8         82          ~438
312             0.8         115         ~430
408             0.8         150         ~455
So the dynamic-power-coefficient average value is about 436.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-01 01:00:55 +02:00
Sugar Zhang
fc982e0bc3 arm64: dts: rockchip: add rk3328 spdif node
This patch add the spdif dt node for rk3328.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-07-29 23:11:00 +02:00
Sugar Zhang
0328d68ea7 arm64: dts: rockchip: add rk3368 spdif node
This patch add the spdif dt node for rk3368 soc.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-07-29 23:03:51 +02:00
Eric Anholt
3bfe25fa9f ARM: dts: bcm283x: Move the BCM2837 DT contents from arm64 to arm.
BCM2837 is somewhat unusual in that we build its DT on both arm32 and
arm64.  Most devices are being run in arm32 mode.

Having the body of the DT for 2837 separate from 2835/6 has been a
source of pain, as we often need to make changes that span both
directories simultaneously (for example, the thermal changes for 4.13,
or anything that changes the name of a node referenced by '&' from
board files).  Other changes are made more complicated than they need
to be, such as the SDHOST enabling, because we have to split a single
logical change into a 283[56] half and a 2837 half.

To fix this, make the stub board include file live in arm64 instead of
arm32, and keep all of BCM283x's contents in arm32.  From here on, our
changes to DT contents can be submitted through a single tree.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-07-28 16:54:15 -07:00
Scott Branden
63a913c157 arm64: dts: move ns2 into northstar2 directory
Place northstar2 into its own subdirectory.  This helps as the number
of Broadcom boards grow and we can separate them per SoC.

Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-07-28 16:30:44 -07:00
Linus Torvalds
3d9d7405c0 arm64 fixes:
- Ensure we have a guard page after the kernel image in vmalloc
 
 - Fix incorrect prefetch stride in copy_page
 
 - Ensure irqs are disabled in die()
 
 - Fix for event group validation in QCOM L2 PMU driver
 
 - Fix requesting of PMU IRQs on AMD Seattle
 
 - Minor cleanups and fixes
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABCgAGBQJZey1iAAoJELescNyEwWM0w/0H/1RaHFUSoFUIoL+qFD0eGXcp
 hORI0sIHrUlHRONTFYMTyNko7kxELz5aDm6pc87dzBUNoUq3gxhqeEa0zsmwOPsQ
 m4iDa7r9xXT+nBITe2auAg6miEMX7Ym448dDrIyKNcRK+2SyZoFqS0vr8UVqs1P/
 NwdFGgpKHbV4r1Jeoosom+n7VnuyE0vYBKo8TlRks6NvQJoh2duiPkL+AsBgCfBq
 fznck7jIPL4z4kf4Fp/Yz1QsmMhkDSidPmGD/m97Bj4wvEbMwf0u8Dnv1tySK5wx
 NwKeN0Dn7JphtL5c5j+OGiri7gTcswjxHJ9f6d0Ez+2TwnjWFM6JNQ+xdVqFcxc=
 =EpS9
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon:
 "I'd been collecting these whilst we debugged a CPU hotplug failure,
  but we ended up diagnosing that one to tglx, who has taken a fix via
  the -tip tree separately.

  We're seeing some NFS issues that we haven't gotten to the bottom of
  yet, and we've uncovered some issues with our backtracing too so there
  might be another fixes pull before we're done.

  Summary:

   - Ensure we have a guard page after the kernel image in vmalloc

   - Fix incorrect prefetch stride in copy_page

   - Ensure irqs are disabled in die()

   - Fix for event group validation in QCOM L2 PMU driver

   - Fix requesting of PMU IRQs on AMD Seattle

   - Minor cleanups and fixes"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: mmu: Place guard page after mapping of kernel image
  drivers/perf: arm_pmu: Request PMU SPIs with IRQF_PER_CPU
  arm64: sysreg: Fix unprotected macro argmuent in write_sysreg
  perf: qcom_l2: fix column exclusion check
  arm64/lib: copy_page: use consistent prefetch stride
  arm64/numa: Drop duplicate message
  perf: Convert to using %pOF instead of full_name
  arm64: Convert to using %pOF instead of full_name
  arm64: traps: disable irq in die()
  arm64: atomics: Remove '&' from '+&' asm constraint in lse atomics
  arm64: uaccess: Remove redundant __force from addr cast in __range_ok
2017-07-28 13:29:36 -07:00
Neil Armstrong
c9fe1cfe4e ARM64: dts: meson-gx: Add SoC info register
Add node for the Amlogic Meson GX SoC information register.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2017-07-28 09:23:28 -07:00
Will Deacon
92bbd16e50 arm64: mmu: Place guard page after mapping of kernel image
The vast majority of virtual allocations in the vmalloc region are followed
by a guard page, which can help to avoid overruning on vma into another,
which may map a read-sensitive device.

This patch adds a guard page to the end of the kernel image mapping (i.e.
following the data/bss segments).

Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-07-28 10:32:14 +01:00
Georgi Djakov
3ac8093cf5 arm64: defconfig: enable missing HWSPINLOCK
The hardware spinlock drivers now depend on HWSPINLOCK (instead of
selecting it), so we need to explicitly enable it after commit
35fc8a07d7 ("Make HWSPINLOCK a menuconfig to ease disabling")

Without HWSPINLOCK, various drivers are left with unsatisfied
dependencies and Qcom boards using shared memory based communication
to request regulators are failing to boot and mount rootfs.

Fix this by explicitly enabling HWSPINLOCK in defconfig.

Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-07-27 23:09:54 -05:00
Yoshihiro Shimoda
4725f2b880 arm64: dts: renesas: r8a7795: add hsusb ch3 device node
This patch adds support for hsusb ch3 device nodes for R-Car H3 ES2.0.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 17:19:05 +02:00
Yoshihiro Shimoda
62f40bcfa9 arm64: dts: renesas: r8a7795: add usb-dmac ch2 and ch3 device nodes
This patch adds support for usb-dmac ch2 and ch3 device nodes for
R-Car H3 ES2.0.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 17:18:51 +02:00
Yoshihiro Shimoda
4dad6dcdae arm64: dts: renesas: r8a7795: add usb2.0 host ch3 device nodes
This patch adds support for usb2.0 host ch3 device nodes for R-Car
H3 ES2.0.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 17:18:33 +02:00
Yoshihiro Shimoda
ac29cc445c arm64: dts: renesas: r8a7795: add usb2_phy ch3 device node
This patch adds support for usb3_phy ch3 device node for R-Car H3 ES2.0.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 17:18:07 +02:00
Kazuya Mizuguchi
1c422b4c50 arm64: dts: renesas: r8a7795: Add usb companion property in EHCI
This patch adds the "companion" property in the EHCI ch0, ch1 and
ch2 nodes to wait for the usb companion controller startup at resume.

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
[remove ch3 node and revise the commit log]
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 17:17:53 +02:00
Geert Uytterhoeven
c550443f08 arm64: dts: renesas: Add Renesas Draak board support
Basic support for the Renesas Draak board based on R-Car D3:
  - Memory,
  - Main crystal,
  - Serial console,
  - Watchdog.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 17:14:06 +02:00
Geert Uytterhoeven
d917e0b248 arm64: dts: renesas: Add Renesas R8A77995 SoC support
Basic support for the R-Car D3 SoC:
  - PSCI,
  - CPU,
  - Cache controller,
  - Main clocks and controller,
  - Interrupt controller,
  - Timer,
  - Watchdog,
  - PMU,
  - Reset controller,
  - Product register,
  - System controller,
  - UART for console.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 17:13:31 +02:00
Geert Uytterhoeven
a4b68d283b arm64: renesas: Add Renesas R8A77995 Kconfig support
Add a configuration option for the R-Car D3 SoC.

Note that r8a77995 is the first Renesas "r8a<n>" SoC using a 5 digit
number in its Kconfig symbol, as r8a77990 will be a different SoC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 17:11:17 +02:00
Laurent Pinchart
20b9911c40 arm64: dts: r8a7795: salvator-xs: Connect DU dot clocks 0 and 3
The DU dot clocks 0 and 3 are provided by the programmable VC6 clock
generator. Connect them to the clock source node.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 16:00:25 +02:00
Laurent Pinchart
b127daecc7 arm64: dts: salvator-xs: Add VC6 clock generator
The VC6 is an I2C-controlled programmable clock generator, used on the
board to provide a display dot clock. Add it to DT.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 16:00:18 +02:00
Geert Uytterhoeven
71adc330aa arm64: dts: r8a7796: Add missing second pair of DMA names to MSIOF nodes
MSIOF0 and MSIOF1 are tied to two DMA controllers through two pairs of
DMA specifiers.  However, the second pair of corresponding DMA names was
missing.

Fixes: 80fab06e25 ("arm64: dts: r8a7796: Add all MSIOF nodes")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 16:00:16 +02:00
Geert Uytterhoeven
ecad187f69 arm64: dts: r8a7795: Add all MSIOF nodes
Add the device nodes for all MSIOF SPI controllers, incl. clocks, power
domain, dma, and reset properties.

Due to a hardware erratum on R-Car H3 ES1.x, using MSIOF for SPI is only
supported on ES2.0 and later.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 16:00:14 +02:00
Laurent Pinchart
f0499b9fe1 arm64: dts: r8a7795: Add support for the DU
Add a compatible string and VSP links to the DU node. The H3 ES1.x and
H3 ES2.0 are compatible save for the links to the VSPs that are
described explicitly in DT, so there's no need for a new ES2-specific
compatible string.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 16:00:13 +02:00
Vladimir Barinov
2a50b40fa4 arm64: dts: ulcb: Enable HDMI output
Enable the HDMI encoder for ULCB board and hook it up to the HDMI connector.

The HDMI encoder and connector are available on both the H3 and M3-W ULCB boards.
Add them to the ulcb.dtsi file.

Signed-off-by: Vladimir Barinov <vladimir.barinov+renesas@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 16:00:09 +02:00
Vladimir Barinov
9f9b22e8c0 arm64: dts: ulcb: Add HDMI output connector
The ULCB board has one HDMI output connector.

This connector is available on both the H3 and M3-W ULCB boards.
Add this to the ulcb.dtsi file.

Signed-off-by: Vladimir Barinov <vladimir.barinov+renesas@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 16:00:04 +02:00
Vladimir Barinov
d6e381673d arm64: dts: r8a7796: m3ulcb: Add DU external dot clocks
The DU0/DU1/DU2 external dot clocks are provided by the programmable
Versaclock5 clock generator.

Signed-off-by: Vladimir Barinov <vladimir.barinov+renesas@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:59:54 +02:00
Vladimir Barinov
6d81daf306 arm64: dts: r8a7795: h3ulcb: Add DU external dot clocks
The DU0/DU1/DU2/DU3 external dot clocks are provided by the programmable
Versaclock5 clock generator.

Signed-off-by: Vladimir Barinov <vladimir.barinov+renesas@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:59:45 +02:00
Vladimir Barinov
8cb6898c3e arm64: dts: ulcb: Add DU external dot clock sources
The DU0/DU1/DU2/DU3 external dot clocks are generated by an I2C-controlled
programmable clock generator.

Clock generator is available on both the H3 and M3-W ULCB boards.
Add this to the ulcb.dtsi file.

Signed-off-by: Vladimir Barinov <vladimir.barinov+renesas@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:59:38 +02:00
Laurent Pinchart
3b390386d7 arm64: dts: r8a7796: salvator-x: Enable HDMI output
Enable the HDMI encoder for the M3-W Salvator-X board and hook it up to
the HDMI connector.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:59:28 +02:00
Laurent Pinchart
5bd1cc7255 arm64: dts: r8a7796: salvator-x: Add DU external dot clocks
The DU1 external dot clock is provided by the fixed frequency clock
generator X21, while the DU0 and DU2 clocks are provided by the
programmable Versaclock5 clock generator.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:59:11 +02:00
Laurent Pinchart
565f5b6f01 arm64: dts: r8a7796: Add HDMI encoder instance
Add the HDMI encoder to the R8A7796 DT in disabled state.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:59:07 +02:00
Laurent Pinchart
af413f6581 arm64: dts: r8a7796: Add DU device to DT
Add the DU device to r8a7796.dtsi in a disabled state.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:59:01 +02:00
Laurent Pinchart
f06ffdfbdd arm64: dts: r8a7796: Add VSP instances
The r8a7796 has 5 VSP instances.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:58:56 +02:00
Laurent Pinchart
41dbbf0c5b arm64: dts: r8a7796: Add FCPF and FCPV instances
The FCPs handle the interface between various IP cores and memory. Add
the instances related to the FDPs and VSP2s.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:58:50 +02:00
Vladimir Barinov
476b2e4f71 arm64: dts: ulcb: Enable I2C4
This enables I2C4 for ULCB board

Signed-off-by: Vladimir Barinov <vladimir.barinov+renesas@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:58:43 +02:00
Vladimir Barinov
a4fedb3a4a arm64: dts: ulcb: Enable I2C for DVFS device
This enables I2C for DVFS device for ULCB board

Signed-off-by: Vladimir Barinov <vladimir.barinov+renesas@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:57:35 +02:00
Ramesh Shanmugasundaram
91662b1b93 arm64: dts: r8a7795: Add DRIF support
Adds the DRIF controller nodes for r8a7795.

Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:53:59 +02:00
Ramesh Shanmugasundaram
1a8e5f8435 arm64: dts: r8a7796: Add DRIF support
Adds the DRIF controller nodes for r8a7796.

Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:53:59 +02:00
Geert Uytterhoeven
6fad293ddb arm64: dts: renesas: Move CPG_AUDIO_CLK_I from board to soc files
The definition of CPG_AUDIO_CLK_I is SoC-specific, not board-specific.
Hence move it from the board-specific .dts files to the SoC-specific
.dtsi files.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:53:58 +02:00
Sergei Shtylyov
e8f2ed72f4 arm64: dts: r8a7796: add IMR-LX4 support
Describe the IMR-LX4 devices in the R8A7796 device tree.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:53:58 +02:00
Sergei Shtylyov
24604cd36c arm64: dts: r8a7795: add IMR-LX4 support
Describe the IMR-LX4 devices in the R8A7795 device tree.

Based on the original (and large) patch by Konstantin Kozhevnikov
<Konstantin.Kozhevnikov@cogentembedded.com>.

Signed-off-by: Konstantin Kozhevnikov <Konstantin.Kozhevnikov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:53:57 +02:00
Kuninori Morimoto
140cb4111a arm64: defconfig: compile ak4613 and renesas sound as modules
Compile the renesas sound and ak4613 drivers as modules to reduce the ARM64
kernel size. These modules are currently only used by Renesas platforms so
there should little risk of negative impact of this change on other users.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[simon: consolidated two patches into one]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-07-27 15:51:58 +02:00
Corentin Labbe
3a4bae5fd4 arm64: allwinner: sun50i-a64: Correct emac register size
The datasheet said that emac register size is 0x10000 not 0x100

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
[wens@csie.org: Fixed commit subject prefix]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2017-07-27 21:18:43 +08:00
Arnd Bergmann
b2e58cbee3 Second Round of Renesas ARM Based SoC Fixes for v4.13
Correct order of sound clock frequencies for ULCB boards
 used by r8a7795 and r8a7796 SoCs.
 
 These sounds clock frequencies are used as the ADG clock (output clocks
 for audio module) initial setting and sound codec's initial system clock
 which needs the maximum clock frequency. Thus, descending order is
 required.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZaHmuAAoJENfPZGlqN0++XmQP/i7HumkEn4LPeyEQ/ePTwOHs
 zz6CNekfmW0aJe4lceRmZ/xMkIuzrwma+EsQj3xj35cl1iK3MvjkguVYAFeYVhJb
 w0X0qJp/0Opz0RNlKo4Pufj0yWy1ZyAQ9ci3UZELTik1sJI/7LG9eyjrXfaxRywo
 OrYq3l41t9Y3/5e9MThUP4oxLO5B8YaJDtGGVYOoVk7cIs0PM9ffG8GVz0IPbrmF
 wFEbVr/EohjpQL0SJ5GO2+NJhUbJFRuLOBWZOTyBQiZ3GByloRXzDR6gU/XSczHB
 vElss4KZiWp2k7xRaBgaHK88u8wSOKdDkXrl6pto+aw1gAlFtOgWArKNQtkrp0vd
 +VHk7Emhdnsw9SWTz0N+Oq7fyA2QIWo1sBr16AkmgB/JStlOXklJWjKgtyK0+mLj
 FZAhOz5qO9ctr0WO87gbVvTz9xcs81g/K0D9rFTlmEIF8GEuDZxrX43LlIDl7I9r
 nbfBj/HFtXqQXLIzS2OR9ah2F5DFWMym2/+mYuSkOt883PrbyjBq2xNdDD+QYcnO
 +p6xCHAY/xiT953NBs/2z0kAXp6bWMjEOO7Lsv3SnPUss7Nng6RU2wbJepZd05Lo
 ZH0k1L7IJtq2UVduHFYkEwKzTGCycW4mmposVNHZm42FOw19nR6Xd3khU57fMAni
 ZH59p+Q/lFxcddwDZ0T1
 =bjUb
 -----END PGP SIGNATURE-----

Merge tag 'renesas-fixes2-for-v4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into fixes

Pull "Second Round of Renesas ARM Based SoC Fixes for v4.13" from Simon Horman:

Correct order of sound clock frequencies for ULCB boards
used by r8a7795 and r8a7796 SoCs.

These sounds clock frequencies are used as the ADG clock (output clocks
for audio module) initial setting and sound codec's initial system clock
which needs the maximum clock frequency. Thus, descending order is
required.

* tag 'renesas-fixes2-for-v4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  arm64: dts: renesas: ulcb: sound clock-frequency needs descending order
2017-07-27 12:51:28 +02:00
Arnd Bergmann
2f9227c798 Renesas ARM Based SoC Fixes for v4.13
Correct order of sound clock frequencies for Salvator boards
 used by r8a7795 and r8a7796 SoCs.
 
 These sounds clock frequencies are used as the ADG clock (output clocks
 for audio module) initial setting and sound codec's initial system clock
 which needs the maximum clock frequency. Thus, descending order is
 required.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZVhaCAAoJENfPZGlqN0++/zkP/1aHxFA560O3cb4SebIeJKQd
 TQFd7YocK1lsqD6DP1ZLQI7ytPfpyAKPctKLRe2NSwr+kf5N8rbYUfZ88pBXe7ez
 y9mbFBYcKHvDLrGHtW5hebBGB6HAh2Ll9DMW6Hqdsv8qG1/EqlLwBkA10/VSjaYk
 Xfp4XnbyXsWCxbllU04We0uel945rg6tQy6VBszW5QEwMEX4zhaOsmi6z8nCv11E
 k8Q6xl2/+FWc/zfivJSzBn59XjQSo+E54yRkmaYcteTY2+8Y787QMvVKkbUAvnHi
 DrVplSPdbQPeZInqDiw97fvUNDTIzYatskMF3Lv6HFZ+u8YHTrW6yq2CShWtecUx
 7BP8GgwfkLHt8J5PADMpNejzfE5lz+7EPm8+2jhGeoHd0BNjojaFvbyL01pJntwp
 nJrSKlLmRB1CDEiubVPUUrY+EWcx7wxK0V8eliWTAn/o1ijJTErbRF91Z/U9BACF
 PQUToBZ8MJKbjbrFXmelswkTwORV7au0KwY6Jzm2Vue7TiCZU4BXwyxZ1hmH3dI1
 GLOWo5mtlXWcUnHLrPv44x6povNQDCtPGowTyKkqo2vXIAlAkMaG4V5D2tV9ykr7
 d0UDWA44fF7QYcgW8hEd1eY0ILnYuX7Zanh0xvb5OBjqLEwsf+FvLel6/eMzg4Pj
 tNB+iosh5YumUfCIue0D
 =t800
 -----END PGP SIGNATURE-----

Merge tag 'renesas-fixes-for-v4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into fixes

Pull "Renesas ARM Based SoC Fixes for v4.13" from Simon Horman:

Correct order of sound clock frequencies for Salvator boards
used by r8a7795 and r8a7796 SoCs.

These sounds clock frequencies are used as the ADG clock (output clocks
for audio module) initial setting and sound codec's initial system clock
which needs the maximum clock frequency. Thus, descending order is
required.

* tag 'renesas-fixes-for-v4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  arm64: renesas: salvator-common: sound clock-frequency needs descending order
2017-07-27 12:48:50 +02:00
Dave Martin
d0153c7ff9 arm64: sysreg: Fix unprotected macro argmuent in write_sysreg
write_sysreg() may misparse the value argument because it is used
without parentheses to protect it.

This patch adds the ( ) in order to avoid any surprises.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
[will: same change to write_sysreg_s]
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-07-26 09:28:18 +01:00
Linus Torvalds
cef55b518c dma mapping fixes for 4.13-rc2:
- split the global dma coherent pool from the per-device pool.
    This fixes a regression in the earlier 4.13 pull requests where the
    global pool would override a per-device CMA pool. (Vladimir Murzin).
 -----BEGIN PGP SIGNATURE-----
 
 iQI/BAABCAApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAll3l1sLHGhjaEBsc3Qu
 ZGUACgkQD55TZVIEUYN8BhAAqFxy2CrpEBk7gD2byOi9M4kTeXDYCESEoEAwuvTG
 Fesbw5zumliBR2cjt/qk/uIDZ93fP4BuHn89NtIfcGOD1LqYOyIPwUTpmb9AgicD
 y4eO1Gy/3DrG2haZcWYmDvq8yfSuR01H3ecY1KNsX1Y2kXxeBQfVKaUDR6fuix4+
 uCf98LzIWs3TYmj7h48LVB/oNnigvs0oljrB2dWrWVJHbgGYEpmdPjBEe6r95e5U
 5cHtPno5JA1lbBFt/nvsZl/NmzSd745SL3QwJsaVmSTf7oYnAuwyPI+5gqaoeQT6
 24947e8hJjuLhBpO7RiqnJY9QdPxT0XKclkCcjnRb5j3dB9KL09f9Dz60exyJzSe
 18V8+8+1m1BgvPsAOS/pLKYxKr9Kgzl9LFrFQaBkA5+7SPlywfV7HqaCkN/mKB4F
 XJoQyRDLlZiDStDKbrhGEAHG6oYaZXnkpQ5xDitSXcSkh9/2a/elsG3caUBRI5qP
 vKC0qvfBPjnHa/3lYNNoLgADB4tZCE3rRrVP6tqdHQbjuNUNK1wLNT7PiMfeoUVj
 Oqql4le0AKlsxO4vRjavOrtaW1bVT+eAYLEtdQfXWQDvhffriEW6r6I8PGqIOiCO
 OzxemCG2M6fcD9ho/VDpjo3Ei6tZylrxdTbrsm7ogQmo/U3ID9cfs452vIOYtCcB
 9so=
 =fJWP
 -----END PGP SIGNATURE-----

Merge tag 'dma-mapping-4.13-2' of git://git.infradead.org/users/hch/dma-mapping

Pull dma mapping fixes from Christoph Hellwig:
 "split the global dma coherent pool from the per-device pool.

  This fixes a regression in the earlier 4.13 pull requests where the
  global pool would override a per-device CMA pool (Vladimir Murzin)"

* tag 'dma-mapping-4.13-2' of git://git.infradead.org/users/hch/dma-mapping:
  ARM: NOMMU: Wire-up default DMA interface
  dma-coherent: introduce interface for default DMA pool
2017-07-25 17:17:18 -07:00
Shawn Lin
687ef7f260 arm64: dts: rockchip: enable sdmmc controller on rk3399-firefly
This allows basic support for SD highspeed cards but no UHS-I mode
got ready due to the propagated defer-probe error from RK805.

Cc: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-07-25 21:35:10 +02:00
David Wu
cc51f503f0 arm64: dts: rockchip: Add rk3328 io-domain node
Add the core grf subnode for the io-domain controller.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-07-25 21:34:48 +02:00
Andrew Jones
d9f89b4e92 KVM: arm/arm64: PMU: Fix overflow interrupt injection
kvm_pmu_overflow_set() is called from perf's interrupt handler,
making the call of kvm_vgic_inject_irq() from it introduced with
"KVM: arm/arm64: PMU: remove request-less vcpu kick" a really bad
idea, as it's quite easy to try and retake a lock that the
interrupted context is already holding. The fix is to use a vcpu
kick, leaving the interrupt injection to kvm_pmu_sync_hwstate(),
like it was doing before the refactoring. We don't just revert,
though, because before the kick was request-less, leaving the vcpu
exposed to the request-less vcpu kick race, and also because the
kick was used unnecessarily from register access handlers.

Reviewed-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
2017-07-25 14:18:01 +01:00
Ard Biesheuvel
288be97cc7 arm64/lib: copy_page: use consistent prefetch stride
The optional prefetch instructions in the copy_page() routine are
inconsistent: at the start of the function, two cachelines are
prefetched beyond the one being loaded in the first iteration, but
in the loop, the prefetch is one more line ahead. This appears to
be unintentional, so let's fix it.

While at it, fix the comment style and white space.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-07-25 10:04:42 +01:00
Ran Wang
9f15dd4156 arm64: dts: ls1012a: add USB host controller nodes
LS1012A has one USB 3.0(DWC3) controller and
one USB 2.0 controller.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2017-07-25 16:03:09 +08:00
Andy Shevchenko
6c9a58e84e ACPI / boot: Correct address space of __acpi_map_table()
Sparse complains about wrong address space used in __acpi_map_table()
and in __acpi_unmap_table().

arch/x86/kernel/acpi/boot.c:127:29: warning: incorrect type in return expression (different address spaces)
arch/x86/kernel/acpi/boot.c:127:29:    expected char *
arch/x86/kernel/acpi/boot.c:127:29:    got void [noderef] <asn:2>*
arch/x86/kernel/acpi/boot.c:135:23: warning: incorrect type in argument 1 (different address spaces)
arch/x86/kernel/acpi/boot.c:135:23:    expected void [noderef] <asn:2>*addr
arch/x86/kernel/acpi/boot.c:135:23:    got char *map

Correct address space to be in align of type of returned and passed
parameter.

Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-07-24 22:47:56 +02:00
Eric W. Biederman
cc731525f2 signal: Remove kernel interal si_code magic
struct siginfo is a union and the kernel since 2.4 has been hiding a union
tag in the high 16bits of si_code using the values:
__SI_KILL
__SI_TIMER
__SI_POLL
__SI_FAULT
__SI_CHLD
__SI_RT
__SI_MESGQ
__SI_SYS

While this looks plausible on the surface, in practice this situation has
not worked well.

- Injected positive signals are not copied to user space properly
  unless they have these magic high bits set.

- Injected positive signals are not reported properly by signalfd
  unless they have these magic high bits set.

- These kernel internal values leaked to userspace via ptrace_peek_siginfo

- It was possible to inject these kernel internal values and cause the
  the kernel to misbehave.

- Kernel developers got confused and expected these kernel internal values
  in userspace in kernel self tests.

- Kernel developers got confused and set si_code to __SI_FAULT which
  is SI_USER in userspace which causes userspace to think an ordinary user
  sent the signal and that it was not kernel generated.

- The values make it impossible to reorganize the code to transform
  siginfo_copy_to_user into a plain copy_to_user.  As si_code must
  be massaged before being passed to userspace.

So remove these kernel internal si codes and make the kernel code simpler
and more maintainable.

To replace these kernel internal magic si_codes introduce the helper
function siginfo_layout, that takes a signal number and an si_code and
computes which union member of siginfo is being used.  Have
siginfo_layout return an enumeration so that gcc will have enough
information to warn if a switch statement does not handle all of union
members.

A couple of architectures have a messed up ABI that defines signal
specific duplications of SI_USER which causes more special cases in
siginfo_layout than I would like.  The good news is only problem
architectures pay the cost.

Update all of the code that used the previous magic __SI_ values to
use the new SIL_ values and to call siginfo_layout to get those
values.  Escept where not all of the cases are handled remove the
defaults in the switch statements so that if a new case is missed in
the future the lack will show up at compile time.

Modify the code that copies siginfo si_code to userspace to just copy
the value and not cast si_code to a short first.  The high bits are no
longer used to hold a magic union member.

Fixup the siginfo header files to stop including the __SI_ values in
their constants and for the headers that were missing it to properly
update the number of si_codes for each signal type.

The fixes to copy_siginfo_from_user32 implementations has the
interesting property that several of them perviously should never have
worked as the __SI_ values they depended up where kernel internal.
With that dependency gone those implementations should work much
better.

The idea of not passing the __SI_ values out to userspace and then
not reinserting them has been tested with criu and criu worked without
changes.

Ref: 2.4.0-test1
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2017-07-24 14:30:28 -05:00
Icenowy Zheng
78c3cbc80f arm64: allwinner: a64: add AXP803 PMIC support to SoPine and the baseboard
The SoPine SoM has an AXP803 PMIC connected to the RSB bus of the A64
SoC, and the regulators of the PMIC are used both on the SoM itself and
on the official baseboard

Add related device tree parts to the SoPine SoM DTSI file and the
baseboard DT.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-07-24 09:56:00 +02:00
Icenowy Zheng
2f005b4407 arm64: allwinner: a64: enable AXP803 regulators for Pine64
Add support of AXP803 regulators in the Pine64 device tree.

The phy-supply regulator is also set in EMAC device node, in order to
prevent Ethernet regression by regulator get disabled by regulator
framework.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-07-24 09:55:57 +02:00
Shawn Lin
461a00bb9d arm64: dts: rockchip: kill pcie_clkreqn and pcie_clkreqnb for rk3399
Kill these two pinctrl reference totally from rk3399 as it
never work indeed.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-07-23 00:03:07 +02:00
Shawn Lin
75ea96deec arm64: dts: rockchip: change clkreq mode for rk3399-firefly
pcie_clkreqn actually doesn't work at all, so replace it with
pcie_clkreqn_cpm.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-07-23 00:02:58 +02:00
Caesar Wang
813b04f758 arm64: dts: rockchip: enable the GPU for RK3399-GRU
This patch enables the gpu and adds the mali-supply power for RK3399-GRU
devices.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-07-22 23:39:48 +02:00
Caesar Wang
68d19331af arm64: dts: rockchip: add ARM Mali GPU node for RK3399 SoCs
Add Mali GPU device tree node for the RK3399 SoCs, with devfreq
opp table.

RK3399 and RK3399-OP1 SoCs have a different recommendation table with
gpu opp. Also, the ARM's mali driver found on
https://developer.arm.com/products/software/mali-drivers/midgard-kernel.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-07-22 23:36:37 +02:00
Shawn Lin
0bd6213f8e arm64: dts: rockchip: remove abused keep-power-in-suspend
keep-power-in-suspend was invented for SDIO only, so it should
not be used for eMMC node.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-07-22 22:48:41 +02:00
Martin Blumenstingl
5e3465f63d ARM64: dts: meson-gx: consistently use the GIC_SPI and IRQ type macros
the mailbox and ethmac nodes used the magic number "0" instead of the
GIC_SPI preprocessor macro. Additionally the ethmac used the magic
number "1" instead of IRQ_TYPE_EDGE_RISING.
Fix this to make the .dtsi easier to read.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2017-07-22 08:30:51 -07:00
Linus Torvalds
0a6109fd1b Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core fixes from Ingo Molnar:
 "A fix to WARN_ON_ONCE() done by modules, plus a MAINTAINERS update"

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  debug: Fix WARN_ON_ONCE() for modules
  MAINTAINERS: Update the PTRACE entry
2017-07-21 10:41:19 -07:00
Jerome Brunet
72fb2c8521 ARM64: dts: meson-gxl-s905x-libretech-cc: fixup board definition
The libretech CC derives less from the p212 than initially thought.
Several voltage regulators are different and the capabilities of the
sdcard and emmc also differ.

Deriving from the p212 is not convient anymore so the libretech is now
derived from s905x definition directly.

Fixes: cd84aff1d9 ("ARM64: dts: meson-gxl: Add Libre Technology CC support")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2017-07-20 17:50:22 -07:00
Jerome Brunet
6620f14684 ARM64: dts: meson-gx: use specific compatible for the AO pwms
Use the specific compatible for AO pwms so the pwms input can
be correctly set

FDIV4 is not present on the pwm A0, so change kadhas vim input
clocks to xtal.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2017-07-20 17:43:48 -07:00
Punit Agrawal
ece4b206be arm64/numa: Drop duplicate message
When booting linux on a system without CONFIG_NUMA enabled, the
following messages are printed during boot -

NUMA: Faking a node at [mem 0x0000000000000000-0x00000083ffffffff]
NUMA: Adding memblock [0x8000000000 - 0x8000e7ffff] on node 0
NUMA: Adding memblock [0x8000e80000 - 0x83f65cffff] on node 0
NUMA: Adding memblock [0x83f65d0000 - 0x83f665ffff] on node 0
NUMA: Adding memblock [0x83f6660000 - 0x83f676ffff] on node 0
NUMA: Adding memblock [0x83f6770000 - 0x83f678ffff] on node 0
NUMA: Adding memblock [0x83f6790000 - 0x83fb82ffff] on node 0
NUMA: Adding memblock [0x83fb830000 - 0x83fbc0ffff] on node 0
NUMA: Adding memblock [0x83fbc10000 - 0x83fbdfffff] on node 0
NUMA: Adding memblock [0x83fbe00000 - 0x83fbffffff] on node 0
NUMA: Adding memblock [0x83fc000000 - 0x83fffbffff] on node 0
NUMA: Adding memblock [0x83fffc0000 - 0x83fffdffff] on node 0
NUMA: Adding memblock [0x83fffe0000 - 0x83ffffffff] on node 0
NUMA: Initmem setup node 0 [mem 0x8000000000-0x83ffffffff]
NUMA: NODE_DATA [mem 0x83fffec500-0x83fffedfff]

The information is then duplicated by core kernel messages right after
the above output.

Early memory node ranges
  node   0: [mem 0x0000008000000000-0x0000008000e7ffff]
  node   0: [mem 0x0000008000e80000-0x00000083f65cffff]
  node   0: [mem 0x00000083f65d0000-0x00000083f665ffff]
  node   0: [mem 0x00000083f6660000-0x00000083f676ffff]
  node   0: [mem 0x00000083f6770000-0x00000083f678ffff]
  node   0: [mem 0x00000083f6790000-0x00000083fb82ffff]
  node   0: [mem 0x00000083fb830000-0x00000083fbc0ffff]
  node   0: [mem 0x00000083fbc10000-0x00000083fbdfffff]
  node   0: [mem 0x00000083fbe00000-0x00000083fbffffff]
  node   0: [mem 0x00000083fc000000-0x00000083fffbffff]
  node   0: [mem 0x00000083fffc0000-0x00000083fffdffff]
  node   0: [mem 0x00000083fffe0000-0x00000083ffffffff]
Initmem setup node 0 [mem 0x0000008000000000-0x00000083ffffffff]

Remove the duplication of memblock layout information printed during
boot by dropping the messages from arm64 numa initialisation.

Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-07-20 17:03:53 +01:00
Vladimir Murzin
43fc509c3e dma-coherent: introduce interface for default DMA pool
Christoph noticed [1] that default DMA pool in current form overload
the DMA coherent infrastructure. In reply, Robin suggested [2] to
split the per-device vs. global pool interfaces, so allocation/release
from default DMA pool is driven by dma ops implementation.

This patch implements Robin's idea and provide interface to
allocate/release/mmap the default (aka global) DMA pool.

To make it clear that existing *_from_coherent routines work on
per-device pool rename them to *_from_dev_coherent.

[1] https://lkml.org/lkml/2017/7/7/370
[2] https://lkml.org/lkml/2017/7/7/431

Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Suggested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Andras Szemzo <sza@esh.hu>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2017-07-20 16:09:10 +02:00
Michal Simek
26db4d8bc7 arm64: zynqmp: Remove leading 0s from mtd table for spi flashes
Warnings:
arch/arm64/boot/dts/xilinx/zynqmp-ep108.dtb: Warning
(unit_address_format): Node
/amba/spi@ff040000/spi0_flash0@0/spi0_flash0@00000000 unit name should
not have leading 0s
arch/arm64/boot/dts/xilinx/zynqmp-ep108.dtb: Warning
(unit_address_format): Node
/amba/spi@ff050000/spi1_flash0@0/spi1_flash0@00000000 unit name should
not have leading 0s

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2017-07-20 14:06:35 +02:00
Rob Herring
d15c56cad0 arm64: dts: xilinx: fix PCI bus dtc warnings
dtc recently added PCI bus checks. Fix these warnings.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2017-07-20 13:31:28 +02:00
Sean Wang
472c7e6d7e arm64: dts: mt7622: add dts file for MT7622 reference board variant 1
Add the support for the MT7622 reference board variant 1 from
MediaTek.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
2017-07-20 12:52:55 +02:00
Sean Wang
c4629c3479 arm64: dts: mt7622: add basic nodes to the mt7622.dtsi file
add basic nodes into the mt7622.dtsi for the system
bring-up which includes ARM CPU, GIC, timer, MediaTek
UART, SYSIRQ and one reserved memory region for ATF.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
2017-07-20 12:52:55 +02:00
Josh Poimboeuf
325cdacd03 debug: Fix WARN_ON_ONCE() for modules
Mike Galbraith reported a situation where a WARN_ON_ONCE() call in DRM
code turned into an oops.  As it turns out, WARN_ON_ONCE() seems to be
completely broken when called from a module.

The bug was introduced with the following commit:

  19d436268d ("debug: Add _ONCE() logic to report_bug()")

That commit changed WARN_ON_ONCE() to move its 'once' logic into the bug
trap handler.  It requires a writable bug table so that the BUGFLAG_DONE
bit can be written to the flags to indicate the first warning has
occurred.

The bug table was made writable for vmlinux, which relies on
vmlinux.lds.S and vmlinux.lds.h for laying out the sections.  However,
it wasn't made writable for modules, which rely on the ELF section
header flags.

Reported-by: Mike Galbraith <efault@gmx.de>
Tested-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 19d436268d ("debug: Add _ONCE() logic to report_bug()")
Link: http://lkml.kernel.org/r/a53b04235a65478dd9afc51f5b329fdc65c84364.1500095401.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-07-20 12:31:04 +02:00
Rob Herring
a270f32735 arm64: Convert to using %pOF instead of full_name
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-07-20 10:28:41 +01:00
Qiao Zhou
6f44a0bacb arm64: traps: disable irq in die()
In current die(), the irq is disabled for __die() handle, not
including the possible panic() handling. Since the log in __die()
can take several hundreds ms, new irq might come and interrupt
current die().

If the process calling die() holds some critical resource, and some
other process scheduled later also needs it, then it would deadlock.
The first panic will not be executed.

So here disable irq for the whole flow of die().

Signed-off-by: Qiao Zhou <qiaozhou@asrmicro.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-07-20 10:21:06 +01:00