Commit graph

6036 commits

Author SHA1 Message Date
Arnd Bergmann
395cd0e66e Amlogic 64-bit DT updates for v4.14
- add GPIO line names to a few boards
 - MMC regulator settle time updates
 - misc cleanups/fixups
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJZlRZZAAoJEFk3GJrT+8Zl23sQAKSgVMFRKMTvw3MhZ2CT0v3F
 kKCpg4QzBaScA1+tPbbZ2GMMKOfJQmCqVUBushPBNwfavpLPqy0UFj5FB10ELJvq
 yN00Wb5377wEMvAxK/VdTPZRkHhCBgrgaFUUiKfZNMHdvVwP0m6/u8+8e2kETJ2Z
 Bc+xORBEE8ZfR9NuqN9wgjA96ccrxCmb8J96n5aVOu0oyFnQKyM6YHEjK85cB8sh
 5HVcCDd+tbpH/YgDn4OED75n7LlxtyHVOF42Nu2FmJC5w4j/uKY4eid+hILl7TQf
 LRC8CX+fV59n219U/uC8uHluMAMhuRV7z+XfEbDfHn6SKlrt9c9avcoOX+6Wg10/
 XrQuUYyp4fgKt0diCRSJ5ziwz4xgXQPexP9pwqX6U18lBs1cE7Mio2gvDBtsj+zy
 QFsHJrVfZSJ+oSTK39/uiJBuE+NnIL18rH/k1VWsxLVOzg5cActDvmwYhdE7pCLX
 iYmIF7pThFOCQ/KS5F3ghFGykiS3RxTG75yqy7KSjQ7p1N9u20JhkUYlpxpB7sMo
 hjdroT7ZaRokmM295+Kz5vRP3vQ3qZty5UO2Ofz96JW3oLGUWACXnZkfUhCNQHGQ
 roR/hR5ihCsmx9tWvPS/e2mc9bG7WEaDrisO/FvYelkkzRVOJW+Xk9g2lSTGJzCM
 Xk+BPoiw4Bz/aUiTa7nU
 =6xzU
 -----END PGP SIGNATURE-----

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

Pull "Amlogic 64-bit DT updates for v4.14" from Kevin Hilman:

- add GPIO line names to a few boards
- MMC regulator settle time updates
- misc cleanups/fixups

* tag 'amlogic-dt64' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic:
  ARM64: dts: meson-gx: use stable UART bindings with correct gate clock
  ARM64: dts: meson-gxbb-nanopi-k2: Add GPIO lines names
  ARM64: dts: meson-gxl-khadas-vim: Add GPIO lines names
  ARM64: dts: meson-gxbb: p20x: add card regulator settle times
  dt-bindings: amlogic: add unstable statement
  ARM64: dts: meson-gx: Add SoC info register
  ARM64: dts: meson-gx: consistently use the GIC_SPI and IRQ type macros
2017-08-17 11:06:39 +02:00
Yoshihiro Shimoda
1fa0b494f6 arm64: dts: r8a77995: add pfc device node
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-08-17 11:03:44 +02:00
Yoshihiro Shimoda
b953585377 arm64: dts: r8a7796: Add HSUSB device node
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-08-17 11:03:42 +02:00
Yoshihiro Shimoda
834bda65b7 arm64: dts: r8a7796: Add USB-DMAC device nodes
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-08-17 11:03:41 +02:00
Yoshihiro Shimoda
7b39ccbb4b arm64: dts: r8a7796: Add USB3.0 host device node
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-08-17 11:03:40 +02:00
Yoshihiro Shimoda
3e95050a3d arm64: dts: r8a7796: add USB2.0 Host (EHCI/OHCI) device nodes
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-08-17 11:03:39 +02:00
Yoshihiro Shimoda
bf68012373 arm64: dts: r8a7796: add usb2_phy device nodes
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-08-17 11:03:38 +02:00
Simon Horman
c3a937bbdd arm64: dts: r8a7795: correct whitespace of companion property
Fixes: 4dad6dcdae ("arm64: dts: renesas: r8a7795: add usb2.0 host ch3 device nodes")
Fixes: 1c422b4c50 ("arm64: dts: renesas: r8a7795: Add usb companion property in EHCI")
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-08-17 11:03:34 +02:00
Simon Horman
41f148f63b arm64: dts: r8a7795: Use R-Car SATA Gen3 fallback compat string
Use newly added R-Car SATA Gen3 fallback compat string
in the DT of the r8a7795 SoC.

This should have no run-time effect as the driver matches against
the per-SoC compat string before the fallback compat string is considered.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
2017-08-17 11:03:33 +02:00
Laurent Pinchart
111c074476 arm64: dts: salvator-common: Remove extra LVDS port label
The DU LVDS output is on port 3 on R8A7795 but on port 2 on R8A7796. The
lvds_connector label thus can't be defined in salvator-common.dtsi,
common to the two SoCs.

The lvds_connector label is meant for convenience to be referenced from
panel device tree files, such as r8a77xx-aa104xd12-panel.dtsi or
r8a77xx-aa121td01-panel.dtsi.  As those files are not included in any
device tree source, and the label never used elsewhere, we can simply
remove it. Out-of-tree patches that include panel device tree files can
then add a

	#define lvds_connector du_out_lvds0

before including the panel device tree file.

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-08-17 11:03:26 +02:00
Arnd Bergmann
872784bffb Fourth Round of Renesas ARM Based SoC Fixes for v4.13
* Avoid audio_clkout naming conflict for salvator boards using
   Renesas R-Car Gen 3 SoCs
 
   Morimoto-san says "The clock name of "audio_clkout" is used by the
   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 the naming conflict."
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZlVkYAAoJENfPZGlqN0++JKsP/i0hKyjgmvL983609fRwWcq9
 i3nkGw+kxcv0ZBLSjWR++mPsQ3PPTgOk1MpJL3ioL8WZBuaTghCpsGrsVRnNViq8
 RlDhShNPlvqcq9MOoAcc6rgqxron7P97Eykt1IXIDqgPlRNRRlSjil0MovLonzDW
 S2T1W6gRjKKSOdPpZbXhxDeBwv2lEr7+688kU9ZTvzKN4KWdsShuuVSnW786wWgM
 SJ8ZFzI5RzUsqcqvpeEWpe+z5eZo/GFDtmQ3E/ngCzrwbAwbVUeEXjvLLJF9oHSs
 sMU66eOoU7erRqTe6KjpW+qIIRkaAR3rH5vVQB0tCJVl4kORWTVFcUGWiQ3ON3cP
 wPrObeBCzzKamWoH6QJ7oWFvFYOVFOQtm3PaXBuSkWjlldLA9FdhLZJ1mYdrk5i6
 PnIdvJGXRC0nH/+yJkbheG8FRNhz92eCG1u3gUBEGVKMwYDBWlztYVAI32MypKcm
 +2xnR1Fs2uMzD/WxsM/PHaeU2LeTt/pnazgUInwnjDEFUR6fRP1MpkoFcspRk3Ix
 QqF7HmLmn7ezho+Z+PXFYKPJvLHwTyHRI8TQtFzarFWXm+Y/ve5GVdbDLVkw31Aa
 jy/w10dGmh9Q3z3sD2jhQKYuNVE0fhsZC1xkVCIodtYpyULfcLJvGJuUazlqpFZz
 z3hXHslR7p1se40FdP6k
 =meey
 -----END PGP SIGNATURE-----

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

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

* Avoid audio_clkout naming conflict for salvator boards using
  Renesas R-Car Gen 3 SoCs

  Morimoto-san says "The clock name of "audio_clkout" is used by the
  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 the naming conflict."

* tag 'renesas-fixes4-for-v4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  arm64: renesas: salvator-common: avoid audio_clkout naming conflict
2017-08-17 11:00:26 +02:00
Arnd Bergmann
63b5e000a8 Qualcomm ARM64 Updates for v4.14
* Force USB host mode on APQ8016
 * Update coresight nodes on MSM8916
 * Add MSM8996 support for USB, PCIE phy, RPM/GLink, and modem SMP2P
 * Add db820c PM8994 regulator node
 * Add PMI8994 gpios
 * Add assorted MSM8916 nodes including GPU, IOMMU, Venus, and CEC clock.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZlGB6AAoJEFKiBbHx2RXVyw0P/R8Qi/qZFjMa/SU+toBdCH3J
 5b11eVK6gnGmFWi3Duabxufhj5zZ6A4i05VWkgR9eU2bJ2XCAwG+WnmMzQ+vUAp5
 QTj2g//1zrvNr4lBjPvHwD17K/tsjs/7MRBGlaUxUokDP8JpBCvnDtdBpyXSjEdz
 bcctn9sab63R13/wGdfCnc6/UiAo99vTRVlsd2OktbWd7c29KZfHuBO+lJ3bXUPM
 wUnk1Ax25t6uAfLDRPArGO8BH4UoH/a47ZLSjzBON9UAt67KN1qlTiI3MqT1boWH
 W4el/AJYGmyKKACg4Rstfpy41Y1MCMJPUlmGW6yuF5KrFteABuZqH60j/75AFbP7
 pME95qQ7vwJAXg4U8CSi00KjQm/ns0voX9wS4luJKol9mak33HSyNRfcGINrZg5h
 23sdiGbmeq6nDjxgh9lARhOwnWwPCAEjSmYr2OW8m9zWxIPox9ZjuDjLCVVkMnJ4
 cTSnEeG5yIVFiBGg9nWDMEASuTdjfRHe7aHr/JLVNa/Y/Q6nVz1oni0xDyB4fUsR
 /nvUn3mva735D83MpVTuiOqMl2CZTZ3PJwva0ptpsc53EMedaVpt7RApxKjcC+F4
 7Yuf3tS0b3i5mTiFJKi7hlUbhOk9r4neo4GomoLPwOZLkYL2RarYpZ9/WQEmLYzP
 POGSocCfI24EqxcfFx+b
 =8+nf
 -----END PGP SIGNATURE-----

Merge tag 'qcom-arm64-for-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/dt64

Pull "Qualcomm ARM64 Updates for v4.14" from Andy Gross:

* Force USB host mode on APQ8016
* Update coresight nodes on MSM8916
* Add MSM8996 support for USB, PCIE phy, RPM/GLink, and modem SMP2P
* Add db820c PM8994 regulator node
* Add PMI8994 gpios
* Add assorted MSM8916 nodes including GPU, IOMMU, Venus, and CEC clock.

* tag 'qcom-arm64-for-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux:
  arm64: dts: qcom: msm8916: Add IOMMU support
  arm64: dts: qcom: msm8916: Add Venus video codec support
  arm64: dts: qcom: msm8916: Add gpu support
  arm64: dts: qcom: msm8996: Specify smd-edge for ADSP
  arm64: dts: msm8996: Add modem smp2p nodes
  arm64: dts: qcom: db820c: Add pm8994 regulator node
  arm64: dts: qcom: Add RPM glink nodes to msm8996
  arm64: dts: msm8996: Add device node for qcom,dwc3
  arm64: dts: msm8996: Add device node for qcom qmp-phy for pcie
  arm64: dts: msm8996: Add device node for qcom qmp-phy for usb
  arm64: dts: msm8996: Add device node for qcom qusb2 phy
  arm64: dts: qcom: add cec clock for apq8016 board
  arm64: dts: pmi8994: Add device node for pmi8994 gpios
  arm64: dts: qcom-msm8916: dts: Update coresight replicator
  arm64: dts: qcom: Force host mode for USB on apq8016-sbc
2017-08-16 23:52:00 +02:00
Arnd Bergmann
dbc1c5fc15 ARM64: DT: Hisilicon SoC DT updates for 4.14
- Add PCIe node for hip07
 - Add acpu_sctrl node and refine the usb tx fifo size for hi6220
 - Add cpu idle states, L2 cache, PMU, OP-TEE, reboot, pstore,
   k3-dma and watchdog nodes for hi3660 and hikey960
 - Update mmc and bluetooth nodes for hi3660 and hikey960
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZlAPdAAoJEAvIV27ZiWZciyMP/i3WVUXvzzT2FjKdDQ1GscEt
 uM3OlmUdwJjJg/v0xqJ3diO2hCwzL/zwfXHuPnvByXduSDaY9u2s21O4LyNN7pIo
 M85fOHw4+VgTUFN6rcOiAjU0NrDC4EBhCpoX62o2CzDYx2dxbGih76/eDGED1wHn
 oKAnWDz7MiohGzoLCtBVCOOtxSXxkLvFFlL24iQXOoc24zmT3I4iK1iCJ+HpEBGe
 JyylfpRXBfvdbvHHOjPheW2Cb/iwvxYw8U6dx2mEQQI35gmPpE+JYlWvTqIf+6FN
 fU4HbO7XZyT/UQaYrJEzLkd43Nyv8Wwg/it80tHGnQpaqx9b8eJ2qudENWGzdbuL
 gOKXv5agESGodAn4yQ4JklMUXXTt9SxGC7WGutdlcKqXGFccOusSQhL4NO9rouG8
 Ar97vSuRvdOgKse1YvMqp5Sv4Ia1OGM7n/HDEYKISegahcXITT5GGaAlNmeYHEHb
 a1sAnMOWwDhT3K93cuv4pihMNVHvQoxLOZjQ948IwrlapHfV2PisQBkyh+ei2cSk
 9SiAbvqiMyiTkckafyjsaVqcHSs0zjA0cTK0NyjeBc74Eh2ttX5rnOAGrT9/seWn
 OW3VHvnR7H+UqjRfDlE7E6GHH0/ciHi1s6IR/g9CE6RjJ59dFfX92YUXdw6Lk8sx
 TYk0SQWMEEmUiU01z2EV
 =AKPn
 -----END PGP SIGNATURE-----

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

Pull "ARM64: DT: Hisilicon SoC DT updates for 4.14" from Wei Xu:

- Add PCIe node for hip07
- Add acpu_sctrl node and refine the usb tx fifo size for hi6220
- Add cpu idle states, L2 cache, PMU, OP-TEE, reboot, pstore,
  k3-dma and watchdog nodes for hi3660 and hikey960
- Update mmc and bluetooth nodes for hi3660 and hikey960

* tag 'hisi-arm64-dt-for-4.14-v2' of git://github.com/hisilicon/linux-hisi:
  arm64: dts: hi3660: enable watchdog
  arm64: dts: hi3660: add bindings for DMA
  arm64: dts: hikey960: change bluetooth uart max-speed to 3mbps
  arm64: dts: hi3660: Reset the mmc hosts
  arm64: dts: hikey960: Add pstore support
  arm64: dts: hikey960: Add support for syscon-reboot-mode
  arm64: dts: hikey960: Add optee node
  arm64: dts: hi3660: add pmu dt node for hi3660
  arm64: dts: hi3660: add L2 cache topology
  arm64: dts: hi3660: enable idle states
  arm64: dts: hi6220: improve g-tx-fifo-size setting for usb device
  arm64: dts: hi6220: add acpu_sctrl
  arm64: dts: hisi: add PCIe host controller node for hip07 SoC
2017-08-16 23:50:44 +02:00
Arnd Bergmann
029fb7c2e3 UniPhier ARM64 SoC DT updates for v4.14
- add nodes for NAND, Watchdog
 - replace /include/ with #include
 - use #include <arm/...> instead of symlinks
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZk7PTAAoJED2LAQed4NsGe48P/is6ReWScByEo4ZAPviedp+9
 Tk0xEwbvGsVipZ4Zm2HRSwiUOZzdiNEit1pTQvUYUiarYuXri2282n85UNnI6MMP
 hVbv2CRSyO8SSbArR/tS9lMX4yAR0GuZqE8qx4879so+XWtwIP5T5+3QTyPFMEwJ
 nTtz3iX/AYP9VxSr0yT7QSsBqy21F4ax1myVFtbUXWSm44RBuOOCc95NUSvalZMf
 2suY6tDRJRlZug5vA3WtWwf0sncU1+OFgHehwYfgJcFlP0wVSdlztf0uTvNNcJZh
 prgKFr7zrK+6xFaKd2ZYM+dA5RyM1xLDg9NsL/ANPVi5Vc79CWLuumprIJQjfPNM
 m/P/o9yfrWdg5rvstZGii3oHqe2jpmxVol1SBWuRP3SjFpfmiheIwco5vu+/5+0T
 aew9oeZrjKeBoHwx/2/UWjU/ttVlzAl0wIS5mIzonoySMJkvyURGQ0JL9XtUtI4W
 181dXMPS0LKBZZhockHMB9i2RbZnK6ZcSUf434rDrQkct/Km9VvEwwBhKHhRDnCA
 EZ1TzKh2WN2/Kd35ZjR16iBowJx1h2qQOuzP2J3dhXzcQGSE8SI7EFUYhW/luK+2
 RlTUGM4YoEcG8hkHEGrLfxvIkjJX/gakeGZJLoc0wx36ToO06rk3Zjdo2rcZqIxI
 1GxtTd3q2cyrMZx/Kfys
 =DyTg
 -----END PGP SIGNATURE-----

Merge tag 'uniphier-dt64-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier into next/dt64

Pull "UniPhier ARM64 SoC DT updates for v4.14" from Masahiro Yamada:

- add nodes for NAND, Watchdog
- replace /include/ with #include
- use #include <arm/...> instead of symlinks

* tag 'uniphier-dt64-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier:
  arm64: dts: uniphier: add Denali NAND controller nodes
  arm64: dts: uniphier: use cross-arch include instead of symlinks
  arm64: dts: uniphier: use #include instead of /include/
  arm64: dts: uniphier: add watchdog node for LD11 and LD20
2017-08-16 23:46:59 +02:00
Arnd Bergmann
23f8f601d2 ARMv8 Vexpress/Juno DT updates for v4.14
1. Replaces old coresight ATB programmable replicator compatible with
    new and more generic one
 
 2. Replaces incorrect usage of underscores for device node names in the
    device tree with hyphen
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJZjbz8AAoJEABBurwxfuKY+JkP/1xDAZBQHLGbr2p9x6Za/Ozs
 N8+5p4o2c07K8Gc8YsmcruxtdrtXIgCZk2cp+m0jTaO6ox68TuMMwIF69BR12SaK
 oqxxmk8VNSU5SaOr3KrdQDpGTFrBm9yq0PZkBtGyzlxeWgbSOLmcrFDP2jc9NbQ3
 0fvKzybF/8VvzdaO9CNUO9oYXLZeZdLKAjcOIkaUWqVmX12/D+akTXEVt8eTgEik
 w56qP4RYYOywb3v2qqyD+0oPB59pAjyjW/QOjokPCb8YLat3pR6VH9FKtmYr44hU
 JpHw4bl/CdYSgS1e8ZT1RSy14GqcTOJ4yPJGgChPVWf//ue4impvAldR0tm9gOS6
 ooc9PCsz22FxlfPAoNpG0TEvC/tzYYyiagBCb/hFQqnN/lqbVs9RcTG6lbyLb5KE
 DnTPVNapt5Eqn74TBwUvr1J7z4q9LqyuhBNAl12QUeHtfTPp9KVrntiLadpYk5Lh
 0qFavNAI9Q9FZRN11G0IuEMHm2PNl3XjEpQE/oVGHGTiHVmClIwiWOinMB9AmRrJ
 K2XF/nKS6+/wqsWxezXO6RvJPkO1thkBpVkgImlPNRXY2FvzUSXeLu9c3ImL13K5
 BsXAmuU4nnhH1Oe6WWFbhQ6lCitUAfq2l3HS+8SH0hPw2J8iMX6tNLAK+i3FQY5Z
 LAvjk2l3n/QLkXnZA2CO
 =jaSe
 -----END PGP SIGNATURE-----

Merge tag 'juno-updates-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into next/dt64

Pull "ARMv8 Vexpress/Juno DT updates for v4.14" from Sudeep Holla:

1. Replaces old coresight ATB programmable replicator compatible with
   new and more generic one

2. Replaces incorrect usage of underscores for device node names in the
   device tree with hyphen

* tag 'juno-updates-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  arm64: dts: juno: replace underscores with hyphen in device node names
  arm64: dts: juno: Use the new coresight replicator string
2017-08-16 23:43:49 +02:00
Arnd Bergmann
9bbf339030 Allwinner arm64 DT changes for 4.14
The usual improvement patches:
 
   - R_INTC interrupt controller enabled for the A64 SoC
 
   - AXP803 PMIC added and enabled on the Pine64 and SoPine boards
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCgAsFiEE2nN1m/hhnkhOWjtHOJpUIZwPJDAFAlmH2GYOHHdlbnNAY3Np
 ZS5vcmcACgkQOJpUIZwPJDC7IhAAji5wcYjwiRSBD042AvatWWRvNKvzvtbcUxVZ
 W1NmQBGfrFDDDZ2eipRfct/xGViAmnAPt2F5YnDY1CtcNOZDJOi1NmThC9qMUawO
 qfIAIo7Ay59JehImq+cxzN0vovUKtNLxY8DDFRgqhNzCgooQN8a0an5Zv51BtQhP
 wqAyJJDleS8OLLVHUZjQ/+cwFgQvt1mFp4ctkgK8vNsWjGjUYqIFzbxmQDmpi6WX
 yvUQmyK9sB7tCC/UYaQKOuqNIiidsstRpKHAdPR7K3yJaSu5F4980cNGVizdP8Zv
 9F2toU6gfzT8kXUUG7bC0Op+O+2bukFcbl/rDpjKGNQGMPZWtPIO+z+r6+Np60xm
 zpyfJGI72oq0LrJwwHwFqYBecr/94ACf+IJf/arOhBflhQWndgLo0ZklfXIJu9do
 FjLYaIR65ZP1A/d8HTIlJwI+FPqGV9gSLwyHSkud0CAe/EqugazXq4eWg19nG/e/
 gplOr+pZQsmQeIbWFXDqi4wDyKnM5PAkaM9yMm6HXbEqa54a3peE73cZfDNHiA8n
 ccg42U/p9sueX9+2lAoR0WamnvO6gP2RAF28Z2UN/oN5zz7gbLde+dBE0vAWKYQC
 G1ECV04h7KjWQrZJHdKWVUSTsrZsImwG6looV4vhNPsu5uvQnegaudDNnDf0PBKV
 VnXL6Uc=
 =9oen
 -----END PGP SIGNATURE-----

Merge tag 'sunxi-dt64-for-4.14' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt64

Pull "Allwinner arm64 DT changes for 4.14" from Chen-Yu Tsai:

The usual improvement patches:

  - R_INTC interrupt controller enabled for the A64 SoC

  - AXP803 PMIC added and enabled on the Pine64 and SoPine boards

* tag 'sunxi-dt64-for-4.14' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  arm64: allwinner: a64: add AXP803 PMIC support to SoPine and the baseboard
  arm64: allwinner: a64: enable AXP803 regulators for Pine64
  arm64: allwinner: a64: add DTSI file for AXP803 PMIC
  arm64: allwinner: a64: add AXP803 node to Pine64 device tree
  arm64: allwinner: a64: add NMI (R_INTC) controller on A64
2017-08-16 23:42:28 +02:00
Arnd Bergmann
4fda1e7387 64bit Rockchip devicetree changes containing fixes for pinctrl typos
and the use of keep-power-in-suspend in non-sdio nodes as well as the
 removal of the deprecated num-slots property from dwmmc nodes.
 
 rk3328 gets support for spdif, io-domains and usb (including enablement
 of usb on the evaluation board), while rk3368 gains support for spdif.
 
 The biggest chunk of course aims for the rk3399 with a number of pcie
 changes, support for the mali gpu, a new power-domain, sdmmc support
 on the firefly board and dynamic-power-coefficients.
 
 The gru family also gets support for their quite central pwm regulators
 using the newly introduced vctrl regulator types.
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCAAuFiEE7v+35S2Q1vLNA3Lx86Z5yZzRHYEFAlmET9EQHGhlaWtvQHNu
 dGVjaC5kZQAKCRDzpnnJnNEdgZbjCACKFO9Hp8Xwwg2nEM8DL3i+MlGaqxjIrcsb
 WskuVOJjkAA4hMnrd7XvbpzJJusAquGqMd042ZCWtrNa1AwzCy0ZkYjDFNL27rXH
 DqrHmJZowSoTHxlo8QKaevXH3ZZnp8TDz4IqaD0+UZx7DgZSOjR1a+feseh1Jn/V
 9WBUJhNAFtKMiJBkTIpaDUk0E6OxIspdvlJurYmwUvDbfZKlpZrXHYKXSuUhFS9s
 JX4Dqi5eF96Mctpi8GhaHGf7awPQf4oQBZfsXxhhS/efzX/v0HWqUPt40o2THi0F
 ZbFFE3xAFaWisA+cbg8xnzJc8ZAwz2UmS6FgQ9lrqKyGN74buwgP
 =spNi
 -----END PGP SIGNATURE-----

Merge tag 'v4.14-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into next/dt64

Pull "Rockchip dts64 changes for 4.14" from Heiko Stübner:

64bit Rockchip devicetree changes containing fixes for pinctrl typos
and the use of keep-power-in-suspend in non-sdio nodes as well as the
removal of the deprecated num-slots property from dwmmc nodes.

rk3328 gets support for spdif, io-domains and usb (including enablement
of usb on the evaluation board), while rk3368 gains support for spdif.

The biggest chunk of course aims for the rk3399 with a number of pcie
changes, support for the mali gpu, a new power-domain, sdmmc support
on the firefly board and dynamic-power-coefficients.

The gru family also gets support for their quite central pwm regulators
using the newly introduced vctrl regulator types.

* tag 'v4.14-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  arm64: dts: rockchip: update dynamic-power-coefficient for rk3399
  arm64: dts: rockchip: add rk3328 spdif node
  arm64: dts: rockchip: add rk3368 spdif node
  arm64: dts: rockchip: enable sdmmc controller on rk3399-firefly
  arm64: dts: rockchip: Add rk3328 io-domain node
  arm64: dts: rockchip: kill pcie_clkreqn and pcie_clkreqnb for rk3399
  arm64: dts: rockchip: change clkreq mode for rk3399-firefly
  arm64: dts: rockchip: enable the GPU for RK3399-GRU
  arm64: dts: rockchip: add ARM Mali GPU node for RK3399 SoCs
  dt-bindings: gpu: add the RK3399 mali for rockchip specifics
  arm64: dts: rockchip: remove abused keep-power-in-suspend
  arm64: dts: rockchip: remove num-slots from all platforms
  arm64: dts: rockchip: change clkreq mode for rk3399-evb
  arm64: dts: rockchip: add SdioAudio pd control for rk3399
  arm64: dts: rockchip: enable usb2 for RK3328 evaluation board
  arm64: dts: rockchip: add usb2 nodes for RK3328 SoCs
  arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients
  arm64: dts: rockchip: Use vctrl regulators for dynamic CPU voltages on Gru/Kevin
  arm64: dts: rockchip: Update CPU regulator voltage ranges for Gru
  arm64: dts: rockchip: fix typo in mmc pinctrl
2017-08-16 23:41:03 +02:00
Arnd Bergmann
77dcb02f0d mvebu dt64 for 4.14 (part 1)
For Armada 37xx:
 - GIC improvement
 - Add PMUv3
 - Enable USB2 on EspressoBin
 
 For Armada 7K/8K:
 - add GPIO interrupts for CP110
 - add pinctrl nodes to describe the CPM I2C0 and CPS SPI1
 - re-order RTC nodes in Marvell CP110 description
 - on MacchiatoBin
     - fix USB3 regulator definition
     - add support for i2c mux
     - add support for PCIe
     - add an stdout-path
 -----BEGIN PGP SIGNATURE-----
 
 iIEEABECAEEWIQQYqXDMF3cvSLY+g9cLBhiOFHI71QUCWYHiAiMcZ3JlZ29yeS5j
 bGVtZW50QGZyZWUtZWxlY3Ryb25zLmNvbQAKCRALBhiOFHI71RsVAJ0dqcviWx9o
 loO7hhNUuQOuLhFIYwCfXT2jCC39lYBukGzo7iA5+7Iqk64=
 =ue29
 -----END PGP SIGNATURE-----

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

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

For Armada 37xx:
- GIC improvement
- Add PMUv3
- Enable USB2 on EspressoBin

For Armada 7K/8K:
- add GPIO interrupts for CP110
- add pinctrl nodes to describe the CPM I2C0 and CPS SPI1
- re-order RTC nodes in Marvell CP110 description
- on MacchiatoBin
    - fix USB3 regulator definition
    - add support for i2c mux
    - add support for PCIe
    - add an stdout-path

* tag 'mvebu-dt64-4.14-1' of git://git.infradead.org/linux-mvebu:
  arm64: dts: marvell: re-order RTC nodes in Marvell CP110 description
  arm64: dts: marvell: mcbin: add an stdout-path
  arm64: dts: marvell: mcbin: add support for PCIe
  arm64: dts: marvell: mcbin: add support for i2c mux
  arm64: dts: marvell: fix USB3 regulator definition on MacchiatoBin
  arm64: dts: marvell: mcbin: add pinctrl nodes
  arm64: dts: marvell: cp110: add GPIO interrupts
  ARM64: dts: marvell: armada-37xx: Enable USB2 on espressobin
  ARM64: dts: marvell: armada-37xx: Wire PMUv3
  ARM64: dts: marvell: armada-37xx: Enable memory-mapped GIC CPU interface
  ARM64: dts: marvell: armada-37xx: Fix GIC maintenance interrupt
2017-08-16 23:39:19 +02:00
Arnd Bergmann
6421d89fab Renesas ARM64 Based SoC DT Updates for v4.14
* Add usb2.0 for R-Car H3 (r8a7795) ES2.0 SoC
 
 * Add R-Car D3 (r8a77995) SoC and Draak board support
 
   Adds minimal support for the R-Car D3 SoC and the Draak development
   board, allowing to boot from a ramdisk using a serial console.
 
 * Add Add VC6 clock generator to R-Car H3 (r8a7795)/Salvator-XS board
 
   The VC6 is an I2C-controlled programmable clock generator, used on the
   board to provide a display dot clock. Add it to DT.
 
 * Add missing second pair of DMA names to MSIOF nodes to
   R-Car M3-W (r8a7796) SoC
 
   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.
 
 * Add support for the DU to R-Car H3 (r8a7795) SoC
 
   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.
 
 * Enable HDMI on R-Car H3 (r8a7795) and M3-W (r8a7796) ULCB boards
 
 * Enable DU on R-Car M3-W (r8a7796) Salvator-X board
 
 * Enable I2C for DVFS on R-Car H3 (r8a7795) and M3-W (r8a7796) ULCB boards
 
 * Add Add DRIF support to R-Car H3 (r8a7795) and M3-W (r8a7796) SoCs
 
   Ramesh Shanmugasundaram says, "R-Car Gen3 DRIF is a SPI like receive only
   slave device."
 
 * Move CPG_AUDIO_CLK_I from board to soc files
 
   Geert Uytterhoeven says, "The definition of CPG_AUDIO_CLK_I is
   SoC-specific, not board-specific."
 
 * Add IMR-LX4 support to R-Car H3 (r8a7795) and M3-W (r8a7796) SoCs
 
   Sergei Shtylyov says, "The image renderer light extended 4 (IMR-LX4) or
   the distortion correction engine is a drawing processor with a simple
   instruction system capable of referencing data on an external memory as
   2D texture data and performing texture mapping and drawing with respect
   to any shape that is split into triangular objects."
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZfzd9AAoJENfPZGlqN0++Sv0QAKHcf5jviX3oYKnriTvK3G44
 f2M5joczCbKagS26RO769bCHQHuylD4t6sa3gLyWsg2Ir8QXwmdNpIcx0DUmErf2
 mFp07tuCe2JlGmLuN1N8zq/0mL0TFX7L7OR38vg4D7WGpyuAkLeVZdAwVqcefNJX
 h6ANpkF2VX/CZJZTWLIFbe8LdxcJoJc7Usu0ElFcwBg6XdaBxWDBieJevg+1I7pP
 vCjGozbuGx8cvZmKUp+KUtLuL7muhX6hVu6E2pQ4vnmGGYZFJCwAsf5en5nZyJfu
 vbDC2ja2OIo9vQORJFboFvZOhzzmH2kTHUpO26DwTLLMoCLiqeB9Es3grD0rHP/y
 8BNlj6JYcCOCwTMlSuKCcbLWUQedn50EtfSjS/3R9sV5ZG3149Cf+ls3yz2OtAsX
 aFWExRyS2OJaq06uHK+oxsSd+tEbQuDJtY83ohGYyY/WzdFUNCEJHEseSVg5uOID
 +as9uOTdSn0a+mJT4eQPMWKinQfElmUoe6tK7SV5Enz0e3TgSuNw0GdtAgJ2rNZr
 XqOeUzNpY+s85bW6rYqrv44Si9haMik/jJqMzI4fGV9/GoKCYVfn7DZCrm1N5k+o
 py377mcp078BBnmaFefp20skcqWN7Qy66R3eJ7S7v6zLI5jUphT89Z0y4lNj1hAy
 5+j7l7Y0vvAYGlZiT0bb
 =ehXW
 -----END PGP SIGNATURE-----

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

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

* Add usb2.0 for R-Car H3 (r8a7795) ES2.0 SoC

* Add R-Car D3 (r8a77995) SoC and Draak board support

  Adds minimal support for the R-Car D3 SoC and the Draak development
  board, allowing to boot from a ramdisk using a serial console.

* Add Add VC6 clock generator to R-Car H3 (r8a7795)/Salvator-XS board

  The VC6 is an I2C-controlled programmable clock generator, used on the
  board to provide a display dot clock. Add it to DT.

* Add missing second pair of DMA names to MSIOF nodes to
  R-Car M3-W (r8a7796) SoC

  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.

* Add support for the DU to R-Car H3 (r8a7795) SoC

  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.

* Enable HDMI on R-Car H3 (r8a7795) and M3-W (r8a7796) ULCB boards

* Enable DU on R-Car M3-W (r8a7796) Salvator-X board

* Enable I2C for DVFS on R-Car H3 (r8a7795) and M3-W (r8a7796) ULCB boards

* Add Add DRIF support to R-Car H3 (r8a7795) and M3-W (r8a7796) SoCs

  Ramesh Shanmugasundaram says, "R-Car Gen3 DRIF is a SPI like receive only
  slave device."

* Move CPG_AUDIO_CLK_I from board to soc files

  Geert Uytterhoeven says, "The definition of CPG_AUDIO_CLK_I is
  SoC-specific, not board-specific."

* Add IMR-LX4 support to R-Car H3 (r8a7795) and M3-W (r8a7796) SoCs

  Sergei Shtylyov says, "The image renderer light extended 4 (IMR-LX4) or
  the distortion correction engine is a drawing processor with a simple
  instruction system capable of referencing data on an external memory as
  2D texture data and performing texture mapping and drawing with respect
  to any shape that is split into triangular objects."

* tag 'renesas-arm64-dt-for-v4.14' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: (31 commits)
  arm64: dts: renesas: r8a7795: add hsusb ch3 device node
  arm64: dts: renesas: r8a7795: add usb-dmac ch2 and ch3 device nodes
  arm64: dts: renesas: r8a7795: add usb2.0 host ch3 device nodes
  arm64: dts: renesas: r8a7795: add usb2_phy ch3 device node
  arm64: dts: renesas: r8a7795: Add usb companion property in EHCI
  arm64: dts: renesas: Add Renesas Draak board support
  arm64: dts: renesas: Add Renesas R8A77995 SoC support
  arm64: renesas: Add Renesas R8A77995 Kconfig support
  arm64: dts: r8a7795: salvator-xs: Connect DU dot clocks 0 and 3
  arm64: dts: salvator-xs: Add VC6 clock generator
  arm64: dts: r8a7796: Add missing second pair of DMA names to MSIOF nodes
  arm64: dts: r8a7795: Add all MSIOF nodes
  arm64: dts: r8a7795: Add support for the DU
  arm64: dts: ulcb: Enable HDMI output
  arm64: dts: ulcb: Add HDMI output connector
  arm64: dts: r8a7796: m3ulcb: Add DU external dot clocks
  arm64: dts: r8a7795: h3ulcb: Add DU external dot clocks
  arm64: dts: ulcb: Add DU external dot clock sources
  arm64: dts: r8a7796: salvator-x: Enable HDMI output
  arm64: dts: r8a7796: salvator-x: Add DU external dot clocks
  ...
2017-08-16 23:37:28 +02:00
Arnd Bergmann
34a39ff1db Samsung DTS ARM64 changes for v4.14
1. Remove deprecated and unneeded properties from Exynos boards.
 2. Implement proper (working) support for USB On-The-Go on Exynos5433
    TM2/TM2E boards.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJZdj1rAAoJEME3ZuaGi4PX+goP/1F2rvi5nRu/IAPwpm7iplMx
 IbTtEYHH6IfL4Qhp2TPbxBNc3VKpL1Nc/e0DM60GWyFqevZXjDsiP6UhwyqTx61m
 eHX19+LkKEyCifUoce4c3Z5Y/lI3k1oLYTSWp3DvmVd5JS+y1AAMAojnh2O4wWve
 0RA3BlLMPfaydjVD44CKOjJiKdT90B/Qdgpy36OkgX2i0t7pZeuenMbZSKwW8jvs
 rgFjD9iN5oQWFrXPDscFc/oL46aaD9Xll3QWBe70eUvrkum+4+RXCmdMxhIr8Rs2
 NHzmuDZTezUPHjdCOvgNpmYPSN5dcWeeck3HvVQQaXFztqGr8RZ8Wk3gDnc9Xbfy
 OUBreQquFew62nMhbUsglgl+umoIw+fdzphjxp50mvq22YpsoGEShN3HU4ZiUHul
 9ISPZspAevk/2Al/McY85wqLrofcTpoUydsja46hxmAQrjuGzJqLt9HI7azG4JLZ
 iIXZK6+comEqxK3ei7P4q1D82/Hwy5nLStSEdYQU7mUMcLIl+HDWaq80RzebImoh
 oldBkRPqayU51vDOG9RiVm7vSH6gHCSEVdMgjdOTOoQMq9UN/CqLVe60VL6R1m3e
 U5Kh0QcxNVFnxzOeVwikPN1s35sw4JEyHofu3rqIeBTxnckCjQvE6JSdYJqipCYD
 jrNMAHC1cknv+FhSPzND
 =hQn1
 -----END PGP SIGNATURE-----

Merge tag 'samsung-dt64-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/dt64

Pull "Samsung DTS ARM64 changes for v4.14" from Krzysztof Kozłowski:

1. Remove deprecated and unneeded properties from Exynos boards.
2. Implement proper (working) support for USB On-The-Go on Exynos5433
   TM2/TM2E boards.

* tag 'samsung-dt64-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
  arm64: dts: exynos: Remove num-slots from exynos platforms
  arm64: dts: exynos: Add extcon property for TM2 and TM2E
  arm64: dts: exynos: Fix wrong label for USB 3.0 controller node
  arm64: dts: exynos: Remove the OF graph from DSI node
2017-08-16 23:36:22 +02:00
Rob Clark
6a6729f384 arm64: dts: qcom: msm8916: Add IOMMU support
This patch adds the IOMMU node for the IOMMU that resides on the
Qualcomm MSM8916 platforms.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-16 10:09:03 -05:00
Stanimir Varbanov
16bd6c8205 arm64: dts: qcom: msm8916: Add Venus video codec support
This patch adds the Qualcomm Venus video codec node for the video
codec hardware residing on MSM8916 platforms.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-16 10:08:55 -05:00
Leo Yan
487f00d4b9 arm64: dts: hi3660: enable watchdog
This patch is to add watchdog binding for Hi3660 on Hikey960 board.

Cc: Guodong Xu <guodong.xu@linaro.org>
Cc: Zhong Kaihua <zhongkaihua@huawei.com>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-16 09:32:12 +01:00
Wang Ruyi
0b507e91de arm64: dts: hi3660: add bindings for DMA
Add bindings for DMA.

Signed-off-by: Wang Ruyi <wangruyi@huawei.com>
Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-16 09:32:11 +01:00
Guodong Xu
bf1ff5328a arm64: dts: hikey960: change bluetooth uart max-speed to 3mbps
Update bluetooth UART max-speed to 3Mbps

Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-16 09:32:11 +01:00
Guodong Xu
996707d765 arm64: dts: hi3660: Reset the mmc hosts
Add reset-names = "reset" into mmc nodes.

Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-16 09:32:10 +01:00
Guodong Xu
9c24dc9d00 arm64: dts: hikey960: Add pstore support
This patch reserves some memory in the DTS and sets up a
pstore device tree node to enable pstore support on HiKey960.

Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-16 09:32:09 +01:00
Guodong Xu
b6b681c144 arm64: dts: hikey960: Add support for syscon-reboot-mode
Add support to hikey960 dts for the syscon-reboot-mode driver.

Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-16 09:32:09 +01:00
Victor Chong
313aebda84 arm64: dts: hikey960: Add optee node
This patch adds op-tee node for hikey960

Signed-off-by: Victor Chong <victor.chong@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-16 09:32:08 +01:00
YiPing Xu
f8054fb8a7 arm64: dts: hi3660: add pmu dt node for hi3660
Add pmu dt node for hi3660

Signed-off-by: YiPing Xu <xuyiping@hisilicon.com>
Signed-off-by: Zhong Kaihua <zhongkaihua@huawei.com>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Tested-by: Jumana Mundichipparakkal <jumana.mp@arm.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-16 09:32:07 +01:00
Leo Yan
a6d083441c arm64: dts: hi3660: add L2 cache topology
This patch adds the L2 cache topology on 96boards Hikey960.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-16 09:32:06 +01:00
Leo Yan
30fec8268c arm64: dts: hi3660: enable idle states
There are two clusters on the Hi3660, the first one is Cortex-A53 based
and the other one is Cortex-A73 based. These two clusters have different
idle states.

Thanks to Daniel Lezcano's recent changes, the generic ARM cpuidle
driver can now support several clusters with different idle states, thus
supporting the big.Little architecture.

In addition to the WFI idle state which is the default shallowest state
for all ARM cpus, the Hi3660 supports the following states:

 - CA53 CPUs:
        - CPU_SLEEP:       CPU power off state
        - CLUSTER_SLEEP_0: Cluster power off state

 - CA73 CPUs:
        - CPU_NAP:         CPU retention state
        - CPU_SLEEP:       CPU power off state
        - CLUSTER_SLEEP_1: Cluster power off state

This patch adds the idle states description for the Hi3660 to the device
tree.

Cc: Kevin Wang <jean.wangtao@linaro.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-16 09:32:06 +01:00
Shawn Guo
341b26b719 arm64: dts: hi6220: improve g-tx-fifo-size setting for usb device
The current usb device g-tx-fifo-size setting in DT causes two problems
for kernel driver.

1. On hi6220, there are 15 tx_fifo dedicated for all EPs except EP0,
   while DT only provides tx_fifo settings for 6 EPs.  It results in the
   following annoying complaints from kernel.

[    4.451623] dwc2 f72c0000.usb: dwc2_check_param_tx_fifo_sizes: Invalid parameter g_tx_fifo_size[7]=0
[    4.461303] dwc2 f72c0000.usb: dwc2_check_param_tx_fifo_sizes: Invalid parameter g_tx_fifo_size[8]=0
[    4.470969] dwc2 f72c0000.usb: dwc2_check_param_tx_fifo_sizes: Invalid parameter g_tx_fifo_size[9]=0
[    4.480632] dwc2 f72c0000.usb: dwc2_check_param_tx_fifo_sizes: Invalid parameter g_tx_fifo_size[10]=0
[    4.490385] dwc2 f72c0000.usb: dwc2_check_param_tx_fifo_sizes: Invalid parameter g_tx_fifo_size[11]=0
[    4.500140] dwc2 f72c0000.usb: dwc2_check_param_tx_fifo_sizes: Invalid parameter g_tx_fifo_size[12]=0
[    4.509892] dwc2 f72c0000.usb: dwc2_check_param_tx_fifo_sizes: Invalid parameter g_tx_fifo_size[13]=0
[    4.519646] dwc2 f72c0000.usb: dwc2_check_param_tx_fifo_sizes: Invalid parameter g_tx_fifo_size[14]=0
[    4.529399] dwc2 f72c0000.usb: dwc2_check_param_tx_fifo_sizes: Invalid parameter g_tx_fifo_size[15]=0
[    4.539244] dwc2 f72c0000.usb: EPs: 16, dedicated fifos, 1920 entries in SPRAM

   Besides of that, the total 1920 fifo entries isn't fully utilized.
   Endpoint Info Control block consumes 128 entries, g-rx-fifo-size
   is 512, and g-np-tx-fifo-size is 128.  So the fifi entries available
   for tx_fifo is: 1920 - 128 - 512 - 128 = 1152.  Considering that
   the minimal valid tx_fifo size for each EP is 16, it should be
   reasonable to allocate 1152 entries as: 128 x 8 + 16 x 7 = 1136 (only
   16 entries unused).  With this new setting, we can get more EPs to
   use while removing the above warning messages in the meantime.

2. Another consequence of above invalid g_tx_fifo_size parameter is that
   kernel driver will use values read from hardware register as the
   fall-back.  The value is 2048 for each EP fifo.  That's obviously
   invalid either, because even fifo entries for one EP exceeds the
   total entries 1920.  That's why we see the following fat warning from
   function dwc2_hsotg_init_fifo().  The new g-tx-fifo-size settings
   help to remove the warning as well.

[   65.431634] dwc2 f72c0000.usb: Do port resume before switching to device mode
[   65.624176] insufficient fifo memory
[   65.624369] ------------[ cut here ]------------
[   65.633633] WARNING: CPU: 0 PID: 5 at drivers/usb/dwc2/gadget.c:330 dwc2_hsotg_init_fifo+0x164/0x1ac
[   65.643808] CPU: 0 PID: 5 Comm: kworker/u16:0 Not tainted 4.13.0-rc1-00022-g50861cf9dc1b-dirty #81
[   65.653769] Hardware name: HiKey Development Board (DT)
[   65.659624] Workqueue: dwc2 dwc2_conn_id_status_change
[   65.665377] task: ffffffc005f73400 task.stack: ffffffc005f98000
[   65.671987] PC is at dwc2_hsotg_init_fifo+0x164/0x1ac
[   65.677633] LR is at dwc2_hsotg_init_fifo+0x164/0x1ac
[   65.683275] pc : [<ffffff8008638044>] lr : [<ffffff8008638044>] pstate: 600001c5
[   65.691504] sp : ffffffc005f9bce0
[   65.695218] x29: ffffffc005f9bce0 x28: ffffffc005f6ac00
[   65.701172] x27: ffffffc005f73400 x26: 0000000008000580
[   65.707124] x25: ffffff8008bb4af0 x24: ffffff8008d02b70
[   65.713074] x23: 0000003fcc831084 x22: ffffffc0337cf0bc
[   65.719024] x21: 0000000000000580 x20: ffffffc0337cf018
[   65.724976] x19: ffffffc0337cf098 x18: 0000000000000000
[   65.730926] x17: 0000000000000000 x16: 0000000000000000
[   65.736873] x15: 0000000000000000 x14: ffffff8008ca8900
[   65.742825] x13: 0000004035299000 x12: 0000000034d5d91d
[   65.748775] x11: 0000000000000000 x10: 00000000000008d0
[   65.754726] x9 : ffffffc005f9bce0 x8 : 00000000000001b5
[   65.760674] x7 : 66696620746e6569 x6 : ffffff8008d60050
[   65.766623] x5 : 0000000000000000 x4 : 0000000000000000
[   65.772573] x3 : 0000000000000002 x2 : 0000000000000002
[   65.778521] x1 : 0000000000000001 x0 : 0000000000000018
[   65.784469] Call trace:
[   65.787236] Exception stack(0xffffffc005f9bb10 to 0xffffffc005f9bc40)
[   65.794420] bb00:                                   ffffffc0337cf098 0000008000000000
[   65.803145] bb20: ffffffc005f9bce0 ffffff8008638044 ffffff8008bb4af0 0000000008000580
[   65.811870] bb40: ffffffc005f73400 ffffffc005f6ac00 0000000000000000 ffffff8008da2998
[   65.820595] bb60: ffffffc005f9bce0 ffffffc005f9bce0 ffffffc005f9bca0 00000000ffffffc8
[   65.829315] bb80: ffffffc005f9bbb0 ffffff80081046a0 ffffffc005f9bce0 ffffffc005f9bce0
[   65.838038] bba0: ffffffc005f9bca0 00000000ffffffc8 0000000000000018 0000000000000001
[   65.846761] bbc0: 0000000000000002 0000000000000002 0000000000000000 0000000000000000
[   65.855485] bbe0: ffffff8008d60050 66696620746e6569 00000000000001b5 ffffffc005f9bce0
[   65.864207] bc00: 00000000000008d0 0000000000000000 0000000034d5d91d 0000004035299000
[   65.872928] bc20: ffffff8008ca8900 0000000000000000 0000000000000000 0000000000000000
[   65.900856] [<ffffff8008638044>] dwc2_hsotg_init_fifo+0x164/0x1ac
[   65.927195] [<ffffff800863b390>] dwc2_hsotg_core_init_disconnected+0x80/0x3c0
[   65.954736] [<ffffff800862fef0>] dwc2_conn_id_status_change+0xfc/0x21c
[   65.981561] [<ffffff80080d1ca8>] process_one_work+0x124/0x294
[   66.007419] [<ffffff80080d1e70>] worker_thread+0x58/0x3c8
[   66.023243] [<ffffff80080d79a0>] kthread+0x100/0x12c
[   66.032455] [<ffffff8008082ec0>] ret_from_fork+0x10/0x50
[   66.041987] ---[ end trace 7079dcaa2d9e46fa ]---

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-16 09:32:05 +01:00
Zhangfei Gao
94d2d94b40 arm64: dts: hi6220: add acpu_sctrl
Add acpu_sctrl clock node

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Li Pengcheng <lipengcheng8@huawei.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
2017-08-16 09:31:01 +01:00
Rob Clark
61b83be911 arm64: dts: qcom: msm8916: Add gpu support
This patch adds the Qualcomm Adreno GPU node that exists in the
MSM8916.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-15 14:07:51 -05:00
Catalin Marinas
df5b95bee1 Merge branch 'arm64/vmap-stack' of git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux into for-next/core
* 'arm64/vmap-stack' of git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux:
  arm64: add VMAP_STACK overflow detection
  arm64: add on_accessible_stack()
  arm64: add basic VMAP_STACK support
  arm64: use an irq stack pointer
  arm64: assembler: allow adr_this_cpu to use the stack pointer
  arm64: factor out entry stack manipulation
  efi/arm64: add EFI_KIMG_ALIGN
  arm64: move SEGMENT_ALIGN to <asm/memory.h>
  arm64: clean up irq stack definitions
  arm64: clean up THREAD_* definitions
  arm64: factor out PAGE_* and CONT_* definitions
  arm64: kernel: remove {THREAD,IRQ_STACK}_START_SP
  fork: allow arch-override of VMAP stack alignment
  arm64: remove __die()'s stack dump
2017-08-15 18:40:58 +01:00
Mark Rutland
872d8327ce arm64: add VMAP_STACK overflow detection
This patch adds stack overflow detection to arm64, usable when vmap'd stacks
are in use.

Overflow is detected in a small preamble executed for each exception entry,
which checks whether there is enough space on the current stack for the general
purpose registers to be saved. If there is not enough space, the overflow
handler is invoked on a per-cpu overflow stack. This approach preserves the
original exception information in ESR_EL1 (and where appropriate, FAR_EL1).

Task and IRQ stacks are aligned to double their size, enabling overflow to be
detected with a single bit test. For example, a 16K stack is aligned to 32K,
ensuring that bit 14 of the SP must be zero. On an overflow (or underflow),
this bit is flipped. Thus, overflow (of less than the size of the stack) can be
detected by testing whether this bit is set.

The overflow check is performed before any attempt is made to access the
stack, avoiding recursive faults (and the loss of exception information
these would entail). As logical operations cannot be performed on the SP
directly, the SP is temporarily swapped with a general purpose register
using arithmetic operations to enable the test to be performed.

This gives us a useful error message on stack overflow, as can be trigger with
the LKDTM overflow test:

[  305.388749] lkdtm: Performing direct entry OVERFLOW
[  305.395444] Insufficient stack space to handle exception!
[  305.395482] ESR: 0x96000047 -- DABT (current EL)
[  305.399890] FAR: 0xffff00000a5e7f30
[  305.401315] Task stack:     [0xffff00000a5e8000..0xffff00000a5ec000]
[  305.403815] IRQ stack:      [0xffff000008000000..0xffff000008004000]
[  305.407035] Overflow stack: [0xffff80003efce4e0..0xffff80003efcf4e0]
[  305.409622] CPU: 0 PID: 1219 Comm: sh Not tainted 4.13.0-rc3-00021-g9636aea #5
[  305.412785] Hardware name: linux,dummy-virt (DT)
[  305.415756] task: ffff80003d051c00 task.stack: ffff00000a5e8000
[  305.419221] PC is at recursive_loop+0x10/0x48
[  305.421637] LR is at recursive_loop+0x38/0x48
[  305.423768] pc : [<ffff00000859f330>] lr : [<ffff00000859f358>] pstate: 40000145
[  305.428020] sp : ffff00000a5e7f50
[  305.430469] x29: ffff00000a5e8350 x28: ffff80003d051c00
[  305.433191] x27: ffff000008981000 x26: ffff000008f80400
[  305.439012] x25: ffff00000a5ebeb8 x24: ffff00000a5ebeb8
[  305.440369] x23: ffff000008f80138 x22: 0000000000000009
[  305.442241] x21: ffff80003ce65000 x20: ffff000008f80188
[  305.444552] x19: 0000000000000013 x18: 0000000000000006
[  305.446032] x17: 0000ffffa2601280 x16: ffff0000081fe0b8
[  305.448252] x15: ffff000008ff546d x14: 000000000047a4c8
[  305.450246] x13: ffff000008ff7872 x12: 0000000005f5e0ff
[  305.452953] x11: ffff000008ed2548 x10: 000000000005ee8d
[  305.454824] x9 : ffff000008545380 x8 : ffff00000a5e8770
[  305.457105] x7 : 1313131313131313 x6 : 00000000000000e1
[  305.459285] x5 : 0000000000000000 x4 : 0000000000000000
[  305.461781] x3 : 0000000000000000 x2 : 0000000000000400
[  305.465119] x1 : 0000000000000013 x0 : 0000000000000012
[  305.467724] Kernel panic - not syncing: kernel stack overflow
[  305.470561] CPU: 0 PID: 1219 Comm: sh Not tainted 4.13.0-rc3-00021-g9636aea #5
[  305.473325] Hardware name: linux,dummy-virt (DT)
[  305.475070] Call trace:
[  305.476116] [<ffff000008088ad8>] dump_backtrace+0x0/0x378
[  305.478991] [<ffff000008088e64>] show_stack+0x14/0x20
[  305.481237] [<ffff00000895a178>] dump_stack+0x98/0xb8
[  305.483294] [<ffff0000080c3288>] panic+0x118/0x280
[  305.485673] [<ffff0000080c2e9c>] nmi_panic+0x6c/0x70
[  305.486216] [<ffff000008089710>] handle_bad_stack+0x118/0x128
[  305.486612] Exception stack(0xffff80003efcf3a0 to 0xffff80003efcf4e0)
[  305.487334] f3a0: 0000000000000012 0000000000000013 0000000000000400 0000000000000000
[  305.488025] f3c0: 0000000000000000 0000000000000000 00000000000000e1 1313131313131313
[  305.488908] f3e0: ffff00000a5e8770 ffff000008545380 000000000005ee8d ffff000008ed2548
[  305.489403] f400: 0000000005f5e0ff ffff000008ff7872 000000000047a4c8 ffff000008ff546d
[  305.489759] f420: ffff0000081fe0b8 0000ffffa2601280 0000000000000006 0000000000000013
[  305.490256] f440: ffff000008f80188 ffff80003ce65000 0000000000000009 ffff000008f80138
[  305.490683] f460: ffff00000a5ebeb8 ffff00000a5ebeb8 ffff000008f80400 ffff000008981000
[  305.491051] f480: ffff80003d051c00 ffff00000a5e8350 ffff00000859f358 ffff00000a5e7f50
[  305.491444] f4a0: ffff00000859f330 0000000040000145 0000000000000000 0000000000000000
[  305.492008] f4c0: 0001000000000000 0000000000000000 ffff00000a5e8350 ffff00000859f330
[  305.493063] [<ffff00000808205c>] __bad_stack+0x88/0x8c
[  305.493396] [<ffff00000859f330>] recursive_loop+0x10/0x48
[  305.493731] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.494088] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.494425] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.494649] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.494898] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.495205] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.495453] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.495708] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.496000] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.496302] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.496644] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.496894] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.497138] [<ffff00000859f358>] recursive_loop+0x38/0x48
[  305.497325] [<ffff00000859f3dc>] lkdtm_OVERFLOW+0x14/0x20
[  305.497506] [<ffff00000859f314>] lkdtm_do_action+0x1c/0x28
[  305.497786] [<ffff00000859f178>] direct_entry+0xe0/0x170
[  305.498095] [<ffff000008345568>] full_proxy_write+0x60/0xa8
[  305.498387] [<ffff0000081fb7f4>] __vfs_write+0x1c/0x128
[  305.498679] [<ffff0000081fcc68>] vfs_write+0xa0/0x1b0
[  305.498926] [<ffff0000081fe0fc>] SyS_write+0x44/0xa0
[  305.499182] Exception stack(0xffff00000a5ebec0 to 0xffff00000a5ec000)
[  305.499429] bec0: 0000000000000001 000000001c4cf5e0 0000000000000009 000000001c4cf5e0
[  305.499674] bee0: 574f4c465245564f 0000000000000000 0000000000000000 8000000080808080
[  305.499904] bf00: 0000000000000040 0000000000000038 fefefeff1b4bc2ff 7f7f7f7f7f7fff7f
[  305.500189] bf20: 0101010101010101 0000000000000000 000000000047a4c8 0000000000000038
[  305.500712] bf40: 0000000000000000 0000ffffa2601280 0000ffffc63f6068 00000000004b5000
[  305.501241] bf60: 0000000000000001 000000001c4cf5e0 0000000000000009 000000001c4cf5e0
[  305.501791] bf80: 0000000000000020 0000000000000000 00000000004b5000 000000001c4cc458
[  305.502314] bfa0: 0000000000000000 0000ffffc63f7950 000000000040a3c4 0000ffffc63f70e0
[  305.502762] bfc0: 0000ffffa2601268 0000000080000000 0000000000000001 0000000000000040
[  305.503207] bfe0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[  305.503680] [<ffff000008082fb0>] el0_svc_naked+0x24/0x28
[  305.504720] Kernel Offset: disabled
[  305.505189] CPU features: 0x002082
[  305.505473] Memory Limit: none
[  305.506181] ---[ end Kernel panic - not syncing: kernel stack overflow

This patch was co-authored by Ard Biesheuvel and Mark Rutland.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
2017-08-15 18:36:18 +01:00
Mark Rutland
12964443e8 arm64: add on_accessible_stack()
Both unwind_frame() and dump_backtrace() try to check whether a stack
address is sane to access, with very similar logic. Both will need
updating in order to handle overflow stacks.

Factor out this logic into a helper, so that we can avoid further
duplication when we add overflow stacks.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
2017-08-15 18:36:12 +01:00
Mark Rutland
e3067861ba arm64: add basic VMAP_STACK support
This patch enables arm64 to be built with vmap'd task and IRQ stacks.

As vmap'd stacks are mapped at page granularity, stacks must be a multiple of
PAGE_SIZE. This means that a 64K page kernel must use stacks of at least 64K in
size.

To minimize the increase in Image size, IRQ stacks are dynamically allocated at
boot time, rather than embedding the boot CPU's IRQ stack in the kernel image.

This patch was co-authored by Ard Biesheuvel and Mark Rutland.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
2017-08-15 18:36:04 +01:00
Mark Rutland
f60fe78f13 arm64: use an irq stack pointer
We allocate our IRQ stacks using a percpu array. This allows us to generate our
IRQ stack pointers with adr_this_cpu, but bloats the kernel Image with the boot
CPU's IRQ stack. Additionally, these are packed with other percpu variables,
and aren't guaranteed to have guard pages.

When we enable VMAP_STACK we'll want to vmap our IRQ stacks also, in order to
provide guard pages and to permit more stringent alignment requirements. Doing
so will require that we use a percpu pointer to each IRQ stack, rather than
allocating a percpu IRQ stack in the kernel image.

This patch updates our IRQ stack code to use a percpu pointer to the base of
each IRQ stack. This will allow us to change the way the stack is allocated
with minimal changes elsewhere. In some cases we may try to backtrace before
the IRQ stack pointers are initialised, so on_irq_stack() is updated to account
for this.

In testing with cyclictest, there was no measureable difference between using
adr_this_cpu (for irq_stack) and ldr_this_cpu (for irq_stack_ptr) in the IRQ
entry path.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
2017-08-15 18:35:54 +01:00
Ard Biesheuvel
8ea41b11ef arm64: assembler: allow adr_this_cpu to use the stack pointer
Given that adr_this_cpu already requires a temp register in addition
to the destination register, tweak the instruction sequence so that sp
may be used as well.

This will simplify switching to per-cpu stacks in subsequent patches. While
this limits the range of adr_this_cpu, to +/-4GiB, we don't currently use
adr_this_cpu in modules, and this is not problematic for the main kernel image.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[Mark: add more commit text]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
2017-08-15 18:35:47 +01:00
Mark Rutland
b11e5759bf arm64: factor out entry stack manipulation
In subsequent patches, we will detect stack overflow in our exception
entry code, by verifying the SP after it has been decremented to make
space for the exception regs.

This verification code is small, and we can minimize its impact by
placing it directly in the vectors. To avoid redundant modification of
the SP, we also need to move the initial decrement of the SP into the
vectors.

As a preparatory step, this patch introduces kernel_ventry, which
performs this decrement, and updates the entry code accordingly.
Subsequent patches will fold SP verification into kernel_ventry.

There should be no functional change as a result of this patch.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[Mark: turn into prep patch, expand commit msg]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
2017-08-15 18:35:40 +01:00
Mark Rutland
170976bcab efi/arm64: add EFI_KIMG_ALIGN
The EFI stub is intimately coupled with the kernel, and takes advantage
of this by relocating the kernel at a weaker alignment than the
documented boot protocol mandates.

However, it does so by assuming it can align the kernel to the segment
alignment, and assumes that this is 64K. In subsequent patches, we'll
have to consider other details to determine this de-facto alignment
constraint.

This patch adds a new EFI_KIMG_ALIGN definition that will track the
kernel's de-facto alignment requirements. Subsequent patches will modify
this as required.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
2017-08-15 18:35:32 +01:00
Mark Rutland
8018ba4edf arm64: move SEGMENT_ALIGN to <asm/memory.h>
Currently we define SEGMENT_ALIGN directly in our vmlinux.lds.S.

This is unfortunate, as the EFI stub currently open-codes the same
number, and in future we'll want to fiddle with this.

This patch moves the definition to our <asm/memory.h>, where it can be
used by both vmlinux.lds.S and the EFI stub code.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
2017-08-15 18:35:22 +01:00
Mark Rutland
f60ad4edcf arm64: clean up irq stack definitions
Before we add yet another stack to the kernel, it would be nice to
ensure that we consistently organise stack definitions and related
helper functions.

This patch moves the basic IRQ stack defintions to <asm/memory.h> to
live with their task stack counterparts. Helpers used for unwinding are
moved into <asm/stacktrace.h>, where subsequent patches will add helpers
for other stacks. Includes are fixed up accordingly.

This patch is a pure refactoring -- there should be no functional
changes as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
2017-08-15 18:35:14 +01:00
Mark Rutland
dbc9344a68 arm64: clean up THREAD_* definitions
Currently we define THREAD_SIZE and THREAD_SIZE_ORDER separately, with
the latter dependent on particular CONFIG_ARM64_*K_PAGES definitions.
This is somewhat opaque, and will get in the way of future modifications
to THREAD_SIZE.

This patch cleans this up, defining both in terms of a common
THREAD_SHIFT, and using PAGE_SHIFT to calculate THREAD_SIZE_ORDER,
rather than using a number of definitions dependent on config symbols.
Subsequent patches will make use of this to alter the stack size used in
some configurations.

At the same time, these are moved into <asm/memory.h>, which will avoid
circular include issues in subsequent patches. To ensure that existing
code isn't adversely affected, <asm/thread_info.h> is updated to
transitively include these definitions.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
2017-08-15 18:35:07 +01:00
Mark Rutland
b6531456ba arm64: factor out PAGE_* and CONT_* definitions
Some headers rely on PAGE_* definitions from <asm/page.h>, but cannot
include this due to potential circular includes. For example, a number
of definitions in <asm/memory.h> rely on PAGE_SHIFT, and <asm/page.h>
includes <asm/memory.h>.

This requires users of these definitions to include both headers, which
is fragile and error-prone.

This patch ameliorates matters by moving the basic definitions out to a
new header, <asm/page-def.h>. Both <asm/page.h> and <asm/memory.h> are
updated to include this, avoiding this fragility, and avoiding the
possibility of circular include dependencies.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
2017-08-15 18:35:00 +01:00
Ard Biesheuvel
34be98f494 arm64: kernel: remove {THREAD,IRQ_STACK}_START_SP
For historical reasons, we leave the top 16 bytes of our task and IRQ
stacks unused, a practice used to ensure that the SP can always be
masked to find the base of the current stack (historically, where
thread_info could be found).

However, this is not necessary, as:

* When an exception is taken from a task stack, we decrement the SP by
  S_FRAME_SIZE and stash the exception registers before we compare the
  SP against the task stack. In such cases, the SP must be at least
  S_FRAME_SIZE below the limit, and can be safely masked to determine
  whether the task stack is in use.

* When transitioning to an IRQ stack, we'll place a dummy frame onto the
  IRQ stack before enabling asynchronous exceptions, or executing code
  we expect to trigger faults. Thus, if an exception is taken from the
  IRQ stack, the SP must be at least 16 bytes below the limit.

* We no longer mask the SP to find the thread_info, which is now found
  via sp_el0. Note that historically, the offset was critical to ensure
  that cpu_switch_to() found the correct stack for new threads that
  hadn't yet executed ret_from_fork().

Given that, this initial offset serves no purpose, and can be removed.
This brings us in-line with other architectures (e.g. x86) which do not
rely on this masking.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[Mark: rebase, kill THREAD_START_SP, commit msg additions]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
2017-08-15 18:34:53 +01:00
Mark Rutland
c5bc503cbe arm64: remove __die()'s stack dump
Our __die() implementation tries to dump the stack memory, in addition
to a backtrace, which is problematic.

For contemporary 16K stacks, this can be a lot of data, which can take a
long time to dump, and can push other useful context out of the kernel's
printk ringbuffer (and/or a user's scrollback buffer on an attached
console).

Additionally, the code implicitly assumes that the SP is on the task's
stack, and tries to dump everything between the SP and the highest task
stack address. When the SP points at an IRQ stack (or is corrupted),
this makes the kernel attempt to dump vast amounts of VA space. With
vmap'd stacks, this may result in erroneous accesses to peripherals.

This patch removes the memory dump, leaving us to rely on the backtrace,
and other means of dumping stack memory such as kdump.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
2017-08-15 18:34:39 +01:00
Markus Mayer
d551250771 arm64: defconfig: add CONFIG_BRCMSTB_THERMAL
Turn on CONFIG_BRCMSTB_THERMAL as module.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-08-15 10:21:37 -07:00
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