platform/kernel/linux-starfive.git
6 years agoMerge tag 'omap-for-v4.20/ti-sysc-take2-signed' of git://git.kernel.org/pub/scm/linux...
Arnd Bergmann [Thu, 4 Oct 2018 15:16:47 +0000 (17:16 +0200)]
Merge tag 'omap-for-v4.20/ti-sysc-take2-signed' of git://git./linux/kernel/git/tmlind/linux-omap into next/drivers

TI sysc driver changes for v4.20 merge window

This series gets rid of the SYSC_QUIRK_RESOURCE_PROVIDER to make device
detection happen mostly only if #define DEBUG is set. Few core devices still
need to be detected to set legacy quirks.

We also add support for booting am335x, am437x and dra7 SoCs with L4 devices
defined in device tree instead of legacy platform data.

And finally we simplify suspend with just SET_NOIRQ_SYSTEM_SLEEP_PM_OPS
and dropping the custom functions that were attempting to work around
issues that really turned out to be child device driver related issues.

Apologies for a late pull request, debugging the suspend issues took a while
and I did not want to send these changes until that got sorted out.

* tag 'omap-for-v4.20/ti-sysc-take2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  bus: ti-sysc: Just use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS
  bus: ti-sysc: Make some warnings debug only
  bus: ti-sysc: Detect devices for debug on dra7
  bus: ti-sysc: Detect timer and gpio on dra7
  bus: ti-sysc: Detect devices on am335x when DEBUG is enabled
  bus: ti-sysc: Detect more devices on am473x for debugging
  bus: ti-sysc: Update revision masks to support am437x
  bus: ti-sysc: Defer suspend as needed

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
6 years agoMerge tag 'imx-drivers-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/shawngu...
Arnd Bergmann [Tue, 2 Oct 2018 08:15:07 +0000 (10:15 +0200)]
Merge tag 'imx-drivers-4.20' of git://git./linux/kernel/git/shawnguo/linux into next/drivers

i.MX drivers update for 4.20:
 - A couple of patches from Anson to update variable and macro naming
   in GPCv2 driver, as a preparation of reusing the driver on i.MX8.
 - Switch GPC/GPCv2 drivers to use SPDX identifier for licence claiming.
 - Clean up the unnecessary DT node name NULL pointer checking from
   imx-weim driver, since it can never be NULL at all.
 - A couple of improvements on GPC driver from Sven Schmitt to correct
   PDN register and use GPC_PGC_DOMAIN_* indexes for consistency.

* tag 'imx-drivers-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  soc: imx: gpcv2: Switch to SPDX identifier
  soc: imx: gpc: Switch to SPDX identifier
  bus: imx-weim: drop unnecessary DT node name NULL check
  soc: imx: gpcv2: make pgc driver more generic for other i.MX platforms
  soc: imx: gpcv2: use A_CORE instread of A7 for more i.MX platforms
  soc: imx: gpc: use GPC_PGC_DOMAIN_* indexes
  soc: imx: gpc: fix PDN delay

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
6 years agoMerge tag 'qcom-drivers-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Tue, 2 Oct 2018 08:11:05 +0000 (10:11 +0200)]
Merge tag 'qcom-drivers-for-4.20' of git://git./linux/kernel/git/agross/linux into next/drivers

Qualcomm ARM Based Driver Updates for v4.20

* Refactor of SCM compatibles and clock requirements
* SMEM cleanup
* Add LLCC EDAC driver
* Fixes for GENI clocks and macros
* Fix includes for llcc-slice and smem
* String overflow fixes for APR and wcnss_ctrl
* Fixup for COMPILE_TEST of qcom driver Kconfigs
* Cleanup of Kconfig depends of rpmh, smd_rpm, smsm, and smp2p
* Add SCM dependencies to SPM and rmtfs-mem

* tag 'qcom-drivers-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux: (38 commits)
  soc: qcom: geni: geni_se_clk_freq_match() should always accept multiples
  soc: qcom: geni: Don't ignore clk_round_rate() errors in geni_se_clk_tbl_get()
  soc: qcom: geni: Make version macros simpler
  dt-bindings: firmware: scm: Add MSM8998 and SDM845
  firmware: qcom: scm: Refactor clock handling
  dt-bindings: firmware: scm: Refactor compatibles and clocks
  soc: qcom: smem: a few last cleanups
  soc: qcom: smem: verify partition host ids match
  soc: qcom: smem: small change in global entry loop
  soc: qcom: smem: verify partition offset_free_uncached
  soc: qcom: smem: verify partition header size
  soc: qcom: smem: introduce qcom_smem_partition_header()
  soc: qcom: smem: require order of host ids to match
  soc: qcom: smem: verify both host ids in partition header
  soc: qcom: smem: small refactor in qcom_smem_enumerate_partitions()
  soc: qcom: smem: always ignore partitions with 0 offset or size
  soc: qcom: smem: initialize region struct only when successful
  soc: qcom: smem: rename variable in qcom_smem_get_global()
  drivers: qcom: rpmh-rsc: clear wait_for_compl after use
  soc: qcom: rmtfs-mem: Validate that scm is available
  ...

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
6 years agoMerge tag 'actions-drivers+s900-sps-for-4.20' of git://git.kernel.org/pub/scm/linux...
Arnd Bergmann [Tue, 2 Oct 2018 08:02:33 +0000 (10:02 +0200)]
Merge tag 'actions-drivers+s900-sps-for-4.20' of git://git./linux/kernel/git/afaerber/linux-actions into next/drivers

Actions Semi SoC drivers for v4.20 #2

The SPS power domain driver is extended for S900 SoC.
This required merging a topic branch for the new bindings header.

* tag 'actions-drivers+s900-sps-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-actions:
  soc: actions: sps: Add S900 power domains
  dt-bindings: power: Add Actions Semi S900 SPS
  soc: actions: Update SPS help text for S700
  soc: actions: Convert to SPDX license identifiers

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
6 years agoMerge tag 'v4.19-next-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias...
Arnd Bergmann [Tue, 2 Oct 2018 08:00:42 +0000 (10:00 +0200)]
Merge tag 'v4.19-next-soc' of git://git./linux/kernel/git/matthias.bgg/linux into next/drivers

PMIC wrapper:
- sort SoCs and PMICs ascending
- add capabilities
- add support for mt8183 SoC + mt6358 PMIC
- return false instead of 0
- add support for mt6765 SoC + mt6357 PMIC

* tag 'v4.19-next-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux:
  soc: mediatek: pwrap: add mt6357 driver for mt6765 SoCs
  soc: mediatek: pwrap: add pwrap driver for mt6765 SoCs
  dt-bindings: pwrap: mediatek: add pwrap support for MT6765
  soc: mediatek: pwrap: use true and false for boolean values
  soc: mediatek: add mt8183 pwrap support
  soc: mediatek: pwrap: use group of bits for pwrap capability
  soc: mediatek: pwrap: order SoCs and PMICs ascending
  dt-bindings: mediatek: add compatible for mt8183 pwrap

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
6 years agoMerge tag 'sunxi-drivers-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Tue, 2 Oct 2018 07:59:03 +0000 (09:59 +0200)]
Merge tag 'sunxi-drivers-for-4.20' of git://git./linux/kernel/git/sunxi/linux into next/drivers

Allwinner drivers changes for 4.20

The H6 is now supported in our SRAM driver bindings, and we have a small
Makefile change for the SRAM driver to build it without building the
ARCH_SUNXI architecture, especially relevant for the COMPILE_TEST case.

* tag 'sunxi-drivers-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  dt-bindings: sunxi-sram: add binding for Allwinner H6 SRAM C
  drivers: soc: Allow building the sunxi driver without ARCH_SUNXI

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
6 years agobus: ti-sysc: Just use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS
Tony Lindgren [Mon, 1 Oct 2018 16:33:28 +0000 (09:33 -0700)]
bus: ti-sysc: Just use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS

As Grygorii Strashko pointed out, the runtime PM use count of the
children can be whatever at suspend and we should not use it. So
let's just suspend ti-sysc at noirq level and get rid of some code.

Let's also remove the PM_SLEEP ifdef and use __maybe_unused as the
PM code already deals with the ifdefs.

Suggested-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
6 years agosoc: imx: gpcv2: Switch to SPDX identifier
Fabio Estevam [Tue, 18 Sep 2018 17:48:14 +0000 (14:48 -0300)]
soc: imx: gpcv2: Switch to SPDX identifier

Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
6 years agosoc: imx: gpc: Switch to SPDX identifier
Fabio Estevam [Tue, 18 Sep 2018 17:48:13 +0000 (14:48 -0300)]
soc: imx: gpc: Switch to SPDX identifier

Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
6 years agobus: imx-weim: drop unnecessary DT node name NULL check
Rob Herring [Wed, 29 Aug 2018 20:02:58 +0000 (15:02 -0500)]
bus: imx-weim: drop unnecessary DT node name NULL check

Checking the child node names is pointless as the DT node name can
never be NULL, so remove it.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
6 years agosoc: imx: gpcv2: make pgc driver more generic for other i.MX platforms
Anson Huang [Tue, 28 Aug 2018 08:36:46 +0000 (16:36 +0800)]
soc: imx: gpcv2: make pgc driver more generic for other i.MX platforms

i.MX8MQ and i.MX8MM share same gpc module with i.MX7D, they
can reuse gpcv2 pgc driver for power domain control, this
patch renames all functions and structure definitions started
with "imx7" to "imx", and use .data in imx_gpcv2_dt_ids[] to
pass platform specific power domain data for power domain
driver, thus make gpcv2 pgc driver more generic for i.MX
platforms.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
6 years agosoc: imx: gpcv2: use A_CORE instread of A7 for more i.MX platforms
Anson Huang [Tue, 28 Aug 2018 08:36:45 +0000 (16:36 +0800)]
soc: imx: gpcv2: use A_CORE instread of A7 for more i.MX platforms

gpcv2 driver is NOT just used on i.MX7D which has Cortex-A7
cores, but also on i.MX8MQ/i.MX8MM platforms which use Cortex-A53
cores, so let's use A_CORE instread of A7 to avoid confusion.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
6 years agoMerge branch 'drivers-for-4.20' into drivers-for-4.20-final
Andy Gross [Sun, 30 Sep 2018 17:44:33 +0000 (12:44 -0500)]
Merge branch 'drivers-for-4.20' into drivers-for-4.20-final

6 years agoMerge tag 'qcom-geni-immutable-for-mark-brown' into drivers-for-4.20-final
Andy Gross [Sun, 30 Sep 2018 17:44:18 +0000 (12:44 -0500)]
Merge tag 'qcom-geni-immutable-for-mark-brown' into drivers-for-4.20-final

Immutable branch for QCOM Geni patches

6 years agosoc: actions: sps: Add S900 power domains
Manivannan Sadhasivam [Wed, 11 Apr 2018 16:40:35 +0000 (22:10 +0530)]
soc: actions: sps: Add S900 power domains

Add power domains for Actions Semi S900 SoC.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
[AF: Update Kconfig help text]
Signed-off-by: Andreas Färber <afaerber@suse.de>
6 years agoMerge branch 'v4.20/s900-sps-bindings' into v4.20/drivers+s900-sps
Andreas Färber [Sun, 30 Sep 2018 14:42:04 +0000 (16:42 +0200)]
Merge branch 'v4.20/s900-sps-bindings' into v4.20/drivers+s900-sps

This merges the DT binding header for S900 SPS driver.

Signed-off-by: Andreas Färber <afaerber@suse.de>
6 years agodt-bindings: power: Add Actions Semi S900 SPS
Manivannan Sadhasivam [Wed, 11 Apr 2018 16:40:33 +0000 (22:10 +0530)]
dt-bindings: power: Add Actions Semi S900 SPS

Define power domains for Actions Semi S900 SoC Smart Power System (SPS).

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
6 years agobus: ti-sysc: Make some warnings debug only
Tony Lindgren [Fri, 28 Sep 2018 22:21:50 +0000 (15:21 -0700)]
bus: ti-sysc: Make some warnings debug only

We're currently warning about busy children on suspend in
sysc_child_suspend_noirq() but the legacy code omap_device does
not do that. Let's just make it dev_dbg() instead of dev_warn().

Signed-off-by: Tony Lindgren <tony@atomide.com>
6 years agobus: ti-sysc: Detect devices for debug on dra7
Tony Lindgren [Thu, 27 Sep 2018 20:34:27 +0000 (13:34 -0700)]
bus: ti-sysc: Detect devices for debug on dra7

We want to see the names of detected devices when DEBUG is enabled.

Signed-off-by: Tony Lindgren <tony@atomide.com>
6 years agobus: ti-sysc: Detect timer and gpio on dra7
Tony Lindgren [Thu, 27 Sep 2018 20:33:58 +0000 (13:33 -0700)]
bus: ti-sysc: Detect timer and gpio on dra7

We need to detect timer and gpio on dra7 because of the
SYSC_QUIRK_LEGACY_IDLE flag for suspend and resume.

Signed-off-by: Tony Lindgren <tony@atomide.com>
6 years agoMerge commit '4f3530f4a41d49c41015020cd9a5ed5c95b5d2db' into omap-for-v4.20/ti-sysc
Tony Lindgren [Fri, 28 Sep 2018 22:27:21 +0000 (15:27 -0700)]
Merge commit '4f3530f4a41d49c41015020cd9a5ed5c95b5d2db' into omap-for-v4.20/ti-sysc

6 years agoMerge tag 'renesas-drivers-for-v4.20' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Fri, 28 Sep 2018 20:16:47 +0000 (22:16 +0200)]
Merge tag 'renesas-drivers-for-v4.20' of git://git./linux/kernel/git/horms/renesas into next/drivers

Renesas ARM Based SoC Drivers Updates for v4.20

* Convert to SPDX identifiers
* R-Car V3M (r8a77970) and V3H (r8a77980): Document Timer Unit (TMU) bindings
* RZ/G1N (r8a7744) and RZ/G1C (r8a77470) SoCs:
  - Document APMU and SMP enable method
* RZ/G2M (r8a74a1), RZ/G1N (r8a7744) and RZ/G2E (r8a774c0) SoCs:
  - Add reset support
  - Add sysc support
* RZ/G2M (r8a774a1), RZ/G2E (r8a774c0) and RZ/A2M (r7s9210) SoCs:
  - Add support for identifying SoC
* RZ/A2M (r7s9210) SoC:
  - Add basic SoC setup support

* tag 'renesas-drivers-for-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: (21 commits)
  dt-bindings: apmu: Document r8a7744 support
  dt-bindings: timer: renesas: tmu: document R8A779{7|8}0 bindings
  dt-bindings: apmu: Document r8a77470 support
  soc: renesas: rcar-rst: Add support for RZ/G1N
  dt-bindings: reset: rcar-rst: Document r8a7744 reset module
  soc: renesas: rcar-sysc: Add r8a7744 support
  dt-bindings: power: rcar-sysc: Add r8a7744 power domain index macros
  dt-bindings: power: rcar-sysc: Document r8a7744 SYSC binding
  soc: renesas: rcar-rst: Add support for RZ/G2E
  dt-bindings: reset: rcar-rst: Document r8a774c0 rst
  soc: renesas: rcar-sysc: Add r8a774c0 support
  dt-bindings: power: rcar-sysc: Document r8a774c0 sysc
  dt-bindings: power: Add r8a774c0 SYSC power domain definitions
  soc: renesas: Identify RZ/G2E
  soc: renesas: convert to SPDX identifiers
  soc: renesas: rcar-rst: Add support for RZ/G2M
  soc: renesas: rcar-sysc: Add r8a774a1 support
  dt-bindings: power: Add r8a774a1 SYSC power domain definitions
  soc: renesas: identify RZ/A2
  ARM: shmobile: Add basic RZ/A2 SoC support
  ...

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
6 years agoMerge tag 'tegra-for-4.20-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra...
Arnd Bergmann [Fri, 28 Sep 2018 19:54:36 +0000 (21:54 +0200)]
Merge tag 'tegra-for-4.20-soc' of git://git./linux/kernel/git/tegra/linux into next/drivers

soc/tegra: Changes for v4.20-rc1

This contains a pinctrl implementation for the pad configuration that
can be controlled from the PMC.

* tag 'tegra-for-4.20-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  soc/tegra: pmc: Implement pad configuration via pinctrl
  soc/tegra: pmc: Remove public pad voltage APIs
  soc/tegra: pmc: Use X macro to generate IO pad tables
  soc/tegra: pmc: Implement tegra_io_pad_is_powered()
  soc/tegra: pmc: Factor out DPD register bit calculation
  soc/tegra: pmc: Fix pad voltage configuration for Tegra186
  soc/tegra: pmc: Fix child-node lookup
  dt-bindings: Add Tegra PMC pad configuration bindings

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
6 years agoMerge tag 'zynqmp-soc-for-v4.20-v2' of https://github.com/Xilinx/linux-xlnx into...
Arnd Bergmann [Wed, 26 Sep 2018 15:18:42 +0000 (17:18 +0200)]
Merge tag 'zynqmp-soc-for-v4.20-v2' of https://github.com/Xilinx/linux-xlnx into next/drivers

arm64: zynqmp: SoC changes for v4.20

- Adding firmware API for SoC with debugfs interface
  Firmware driver communicates to Platform Management Unit (PMU) by using
  SMC instructions routed to Arm Trusted Firmware (ATF). Initial version
  adds support for base firmware driver with query and clock APIs.

  EEMI spec is available here:
  https://www.xilinx.com/support/documentation/user_guides/ug1200-eemi-api.pdf

* tag 'zynqmp-soc-for-v4.20-v2' of https://github.com/Xilinx/linux-xlnx:
  firmware: xilinx: Add debugfs for query data API
  firmware: xilinx: Add debugfs interface
  firmware: xilinx: Add clock APIs
  firmware: xilinx: Add query data API
  firmware: xilinx: Add Zynqmp firmware driver
  dt-bindings: firmware: Add bindings for ZynqMP firmware

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
6 years agofirmware: xilinx: Add debugfs for query data API
Rajan Vaja [Wed, 12 Sep 2018 19:38:40 +0000 (12:38 -0700)]
firmware: xilinx: Add debugfs for query data API

Add debugfs file to query platform specific data from firmware
using debugfs interface.

Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agofirmware: xilinx: Add debugfs interface
Rajan Vaja [Wed, 12 Sep 2018 19:38:39 +0000 (12:38 -0700)]
firmware: xilinx: Add debugfs interface

Firmware-debug provides debugfs interface to all APIs.
Debugfs can be used to call firmware APIs with required
parameters.

Usage:
* Calling firmware API through debugfs:
  # echo "<api-name> <arg1> .. <argn>" > /sys/.../zynqmp-firmware/pm

* Read output of last called firmware API:
  # cat /sys/.../zynqmp-firmware/pm

Refer ug1200 for more information on these APIs:
  * https://www.xilinx.com/support/documentation/user_guides/ug1200-eemi-api.pdf

Add basic debugfs file to get API version.

Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agofirmware: xilinx: Add clock APIs
Rajan Vaja [Wed, 12 Sep 2018 19:38:38 +0000 (12:38 -0700)]
firmware: xilinx: Add clock APIs

Add clock APIs to control clocks through firmware
interface.

Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agofirmware: xilinx: Add query data API
Rajan Vaja [Wed, 12 Sep 2018 19:38:37 +0000 (12:38 -0700)]
firmware: xilinx: Add query data API

Add ZynqMP firmware query data API to query platform
specific information(clocks, pins) from firmware.

Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agofirmware: xilinx: Add Zynqmp firmware driver
Rajan Vaja [Wed, 12 Sep 2018 19:38:36 +0000 (12:38 -0700)]
firmware: xilinx: Add Zynqmp firmware driver

This patch is adding communication layer with firmware.
Firmware driver provides an interface to firmware APIs.
Interface APIs can be used by any driver to communicate to
PMUFW(Platform Management Unit). All requests go through ATF.

Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agodt-bindings: firmware: Add bindings for ZynqMP firmware
Rajan Vaja [Wed, 12 Sep 2018 19:38:35 +0000 (12:38 -0700)]
dt-bindings: firmware: Add bindings for ZynqMP firmware

Add documentation to describe Xilinx ZynqMP firmware driver
bindings. Firmware driver provides an interface to firmware
APIs. Interface APIs can be used by any driver to communicate
to PMUFW (Platform Management Unit).

Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoMerge tag 'at91-4.20-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/at91...
Olof Johansson [Tue, 25 Sep 2018 20:19:52 +0000 (13:19 -0700)]
Merge tag 'at91-4.20-drivers' of git://git./linux/kernel/git/at91/linux into next/drivers

AT91 drivers for 4.20

 - use struct_size in atmel-ebi

* tag 'at91-4.20-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  memory: atmel-ebi: Use struct_size() in devm_kzalloc()

Signed-off-by: Olof Johansson <olof@lixom.net>
6 years agoMerge tag 'soc-fsl-next-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/leo...
Olof Johansson [Tue, 25 Sep 2018 19:48:47 +0000 (12:48 -0700)]
Merge tag 'soc-fsl-next-v4.20' of git://git./linux/kernel/git/leo/linux into next/drivers

NXP/FSL SoC driver updates for v4.20

- Use of_get_child_by_name helper for QE driver
- Remove redundant pointer 'priv' for dpio driver

* tag 'soc-fsl-next-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux:
  soc: fsl: dpio: remove redundant pointer 'priv'
  soc: fsl/qe: Use of_get_child_by_name helper

Signed-off-by: Olof Johansson <olof@lixom.net>
6 years agoMerge tag 'drivers_soc_for_4.20' of git://git.kernel.org/pub/scm/linux/kernel/git...
Olof Johansson [Tue, 25 Sep 2018 19:26:52 +0000 (12:26 -0700)]
Merge tag 'drivers_soc_for_4.20' of git://git./linux/kernel/git/ssantosh/linux-keystone into next/drivers

soc: driver soc update for v4.20

  - Enable host-id as an optional dt property
  - Fix minor typo in knav driver

* tag 'drivers_soc_for_4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone:
  soc: ti: fix spelling mistake "instace" -> "instance"
  firmware: ti_sci: Provide host-id as an optional dt parameter
  Documentation: dt: keystone: ti-sci: Add optional host-id parameter

Signed-off-by: Olof Johansson <olof@lixom.net>
6 years agoMerge tag 'scmi-updates-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep...
Olof Johansson [Tue, 25 Sep 2018 18:31:00 +0000 (11:31 -0700)]
Merge tag 'scmi-updates-4.20' of git://git./linux/kernel/git/sudeep.holla/linux into next/drivers

SCMI updates for v4.20

1. Addition of interface to fetch estimated power from the firmware
   corresponding to each OPP of a device

2. Cleanup using strlcpy to ensure NULL-terminated strings for name
   strings instead of relying on the firmware to do the same

* tag 'scmi-updates-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  firmware: arm_scmi: add a getter for power of performance states
  firmware: arm_scmi: use strlcpy to ensure NULL-terminated strings

Signed-off-by: Olof Johansson <olof@lixom.net>
6 years agoMerge tag 'v4.19-rc3' into next/drivers
Olof Johansson [Tue, 25 Sep 2018 18:30:47 +0000 (11:30 -0700)]
Merge tag 'v4.19-rc3' into next/drivers

Linux 4.19-rc3

6 years agoMerge tag 'amlogic-drivers' of https://git.kernel.org/pub/scm/linux/kernel/git/khilma...
Olof Johansson [Tue, 25 Sep 2018 18:16:12 +0000 (11:16 -0700)]
Merge tag 'amlogic-drivers' of https://git./linux/kernel/git/khilman/linux-amlogic into next/drivers

Amlogic ARM64 driver updates for v4.20
- add meson-canvas driver and bindings
- firmware: Add serial number sysfs entry

* tag 'amlogic-drivers' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic:
  soc: amlogic: add meson-canvas driver
  dt-bindings: soc: amlogic: add meson-canvas documentation
  firmware: meson_sm: Add serial number sysfs entry

Signed-off-by: Olof Johansson <olof@lixom.net>
6 years agosoc: mediatek: pwrap: add mt6357 driver for mt6765 SoCs
Argus Lin [Tue, 4 Sep 2018 12:31:54 +0000 (20:31 +0800)]
soc: mediatek: pwrap: add mt6357 driver for mt6765 SoCs

MT6357 is a new power management IC and it is used for mt6765 SoCs.
To define mt6357_regs for pmic register mapping and pmic_mt6357
for accessing register.

Signed-off-by: Argus Lin <argus.lin@mediatek.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
6 years agosoc: mediatek: pwrap: add pwrap driver for mt6765 SoCs
Argus Lin [Tue, 4 Sep 2018 12:31:53 +0000 (20:31 +0800)]
soc: mediatek: pwrap: add pwrap driver for mt6765 SoCs

mt6765 is a highly integrated SoCs, it uses mt6357 for power management.
This patch adds pwrap driver to access mt6357. Pwrap of mt6765 support
dynamic priority meichanism, sequence monitor and starvation mechanism
to make transaction more reliable.

Signed-off-by: Argus Lin <argus.lin@mediatek.com>
[mb: change has_bridge to capabilities]
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
6 years agodt-bindings: pwrap: mediatek: add pwrap support for MT6765
Argus Lin [Tue, 4 Sep 2018 12:31:52 +0000 (20:31 +0800)]
dt-bindings: pwrap: mediatek: add pwrap support for MT6765

Add binding document of pwrap for MT6765 SoCs.

Signed-off-by: Argus Lin <argus.lin@mediatek.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
6 years agosoc: mediatek: pwrap: use true and false for boolean values
Gustavo A. R. Silva [Sun, 5 Aug 2018 01:02:01 +0000 (20:02 -0500)]
soc: mediatek: pwrap: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
6 years agosoc: mediatek: add mt8183 pwrap support
Hsin-Hsiung Wang [Wed, 19 Sep 2018 07:26:00 +0000 (15:26 +0800)]
soc: mediatek: add mt8183 pwrap support

MT6358 is a new power management IC and it is used for
mt8183 SoCs. To define mt6358_regs for pmic register
mapping and pmic_mt6358 for accessing register.
Adding one more interrupt and wdt source.

Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
6 years agosoc: mediatek: pwrap: use group of bits for pwrap capability
Hsin-Hsiung Wang [Tue, 25 Sep 2018 13:48:39 +0000 (15:48 +0200)]
soc: mediatek: pwrap: use group of bits for pwrap capability

Use group of bits for pwrap capability instead of
elements of structure.
This patch is preparing for adding mt8183 pwrap support.

Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
6 years agosoc: mediatek: pwrap: order SoCs and PMICs ascending
Matthias Brugger [Tue, 25 Sep 2018 13:46:59 +0000 (15:46 +0200)]
soc: mediatek: pwrap: order SoCs and PMICs ascending

Order SoC and PMIC numbers ascending to make the code more
readable.

Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
6 years agodt-bindings: mediatek: add compatible for mt8183 pwrap
Hsin-Hsiung Wang [Wed, 19 Sep 2018 07:25:58 +0000 (15:25 +0800)]
dt-bindings: mediatek: add compatible for mt8183 pwrap

This adds dt-binding documentation of pwrap for Mediatek MT8183 SoC
Platform.

Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
6 years agosoc: ti: fix spelling mistake "instace" -> "instance"
Colin King [Mon, 24 Sep 2018 19:43:21 +0000 (12:43 -0700)]
soc: ti: fix spelling mistake "instace" -> "instance"

Trivial fix to spelling mistake in dev_err messages and comments

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
6 years agobus: ti-sysc: Detect devices on am335x when DEBUG is enabled
Tony Lindgren [Mon, 24 Sep 2018 19:17:09 +0000 (12:17 -0700)]
bus: ti-sysc: Detect devices on am335x when DEBUG is enabled

When debug is enabled, we want to see what devices we're detecting
to make things a bit easier for us.

Signed-off-by: Tony Lindgren <tony@atomide.com>
6 years agobus: ti-sysc: Detect more devices on am473x for debugging
Tony Lindgren [Mon, 24 Sep 2018 19:17:05 +0000 (12:17 -0700)]
bus: ti-sysc: Detect more devices on am473x for debugging

When debug is enabled, we want to see what devices we're detecting
to make things a bit easier for us. Many of these devices will also
be available on am335x and dra7, and some just need updating the
revision register mask.

Signed-off-by: Tony Lindgren <tony@atomide.com>
6 years agobus: ti-sysc: Update revision masks to support am437x
Tony Lindgren [Mon, 24 Sep 2018 19:16:59 +0000 (12:16 -0700)]
bus: ti-sysc: Update revision masks to support am437x

We need to detect few new devices to tag for noirq_suspend and
pm_runtime_irq_safe to avoid causing regressions compared to
legacy platform data booting.

Let's update i2c, gpio, uart and wdt revision masks to detect
them on am437x. Note that we can remove the second wdt entry
with the updated mask. Note that we also have some uarts with
a different revision register.

Signed-off-by: Tony Lindgren <tony@atomide.com>
6 years agobus: ti-sysc: Defer suspend as needed
Tony Lindgren [Mon, 24 Sep 2018 19:16:54 +0000 (12:16 -0700)]
bus: ti-sysc: Defer suspend as needed

We don't care when we suspend but some our children do. In order to
avoid tagging various modules with SYSC_QUIRK_RESOURCE_PROVIDER, let's
do it automatically by tagging modules that are busy on suspend for
noirq suspend. This way we can just do module detection on define DEBUG.

Note that we still need to keep SYSC_QUIRK_LEGACY_IDLE flag around so
the our legacy single-child devices that set pm_runtime_irq_safe() can
manage the interconnect target module themselves.

Signed-off-by: Tony Lindgren <tony@atomide.com>
6 years agodt-bindings: apmu: Document r8a7744 support
Biju Das [Fri, 21 Sep 2018 15:52:58 +0000 (16:52 +0100)]
dt-bindings: apmu: Document r8a7744 support

Document APMU and SMP enable method for RZ/G1N (R8A7744) SoC.

Signed-off-by: Biju Das <biju.das@bp.renesas.com>
Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agosoc: qcom: geni: geni_se_clk_freq_match() should always accept multiples
Douglas Anderson [Thu, 6 Sep 2018 22:49:06 +0000 (15:49 -0700)]
soc: qcom: geni: geni_se_clk_freq_match() should always accept multiples

The geni_se_clk_freq_match() has some strange semantics.  Specifically
it is defined with two modes:
1. It can find a clock that's an exact multiple of the requested rate
2. It can find a non-exact match but it can't handle multiples then

...but callers should always be able to handle a clock that is a
multiple of the requested clock so mode #2 doesn't really make sense.
Let's change the semantics so that the non-exact match can also accept
multiples and then change the code to handle that.

The only caller of this code is the unlanded SPI driver [1] which
currently passes "exact = True", thus it should be safe to change the
semantics in this way.  ...and, in fact, the SPI driver should likely
be modified to pass "exact = False" (with the new semantics) since
that will allow it to work with SPI devices that request a clock rate
that doesn't exactly match a rate we can make.

[1] https://lkml.kernel.org/r/1535107336-2214-1-git-send-email-dkota@codeaurora.org

Fixes: eddac5af0654 ("soc: qcom: Add GENI based QUP Wrapper driver")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: geni: Don't ignore clk_round_rate() errors in geni_se_clk_tbl_get()
Douglas Anderson [Thu, 6 Sep 2018 22:49:05 +0000 (15:49 -0700)]
soc: qcom: geni: Don't ignore clk_round_rate() errors in geni_se_clk_tbl_get()

The function clk_round_rate() is defined to return a "long", not an
"unsigned long".  That's because it might return a negative error
code.  Change the call in geni_se_clk_tbl_get() to check for errors.

While we're at it, get rid of a useless init of "freq".

NOTE: overall the idea that we should iterate over clk_round_rate() to
try to reconstruct a table already present in the clock driver is
questionable.  Specifically:
- This method relies on "clk_round_rate()" rounding up.
- This method only works if the table is sorted and has no duplicates.
...this patch doesn't try to fix those problems, it just makes the
error handling more correct.

Fixes: eddac5af0654 ("soc: qcom: Add GENI based QUP Wrapper driver")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: geni: Make version macros simpler
Stephen Boyd [Fri, 18 May 2018 22:47:50 +0000 (15:47 -0700)]
soc: qcom: geni: Make version macros simpler

This macro doesn't work, because it hides a local variable inside of the
macro to hold the version and that variable name is called 'ver' and
'version' sometimes.

Let's change this to be more explicit. Introduce three macros for the
major, minor, and step of the version, and require callers to pass the
version in to get the part of the version out. This way we don't hide
local variables inside macros and things are less evil overall.

Cc: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Cc: Sagar Dharia <sdharia@codeaurora.org>
Cc: Girish Mahadevan <girishm@codeaurora.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: actions: Update SPS help text for S700
Andreas Färber [Sun, 24 Jun 2018 13:46:30 +0000 (15:46 +0200)]
soc: actions: Update SPS help text for S700

Commit 3ad85b08f7789d51e6aad0f535296d1c31e319b9 (soc: actions: sps: Add S700)
added S700 support to the SPS driver but forget to update Kconfig help.

Add missing S700 mention, in preparation for further SoCs.

Fixes: 3ad85b08f778 ("soc: actions: sps: Add S700")
Reported-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
6 years agosoc: actions: Convert to SPDX license identifiers
Andreas Färber [Sun, 21 Jan 2018 16:50:33 +0000 (17:50 +0100)]
soc: actions: Convert to SPDX license identifiers

Replace textual license notices with SPDX-License-Identifier lines.
Add an SPDX-License-Identifier for the Makefile.

Signed-off-by: Andreas Färber <afaerber@suse.de>
6 years agodt-bindings: timer: renesas: tmu: document R8A779{7|8}0 bindings
Sergei Shtylyov [Fri, 7 Sep 2018 20:02:53 +0000 (23:02 +0300)]
dt-bindings: timer: renesas: tmu: document R8A779{7|8}0 bindings

Document the R-Car V3{M|H} (R8A779{7|8}0) SoC in the Renesas TMU bindings;
the TMU hardware in those is the Renesas standard 3-channel timer unit.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agodt-bindings: apmu: Document r8a77470 support
Fabrizio Castro [Mon, 17 Sep 2018 08:44:09 +0000 (09:44 +0100)]
dt-bindings: apmu: Document r8a77470 support

Document APMU and SMP enable method for RZ/G1C (also known as
r8a77470) SoC.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Biju Das <biju.das@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agosoc: renesas: rcar-rst: Add support for RZ/G1N
Biju Das [Tue, 11 Sep 2018 10:12:46 +0000 (11:12 +0100)]
soc: renesas: rcar-rst: Add support for RZ/G1N

Signed-off-by: Biju Das <biju.das@bp.renesas.com>
Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agodt-bindings: reset: rcar-rst: Document r8a7744 reset module
Biju Das [Tue, 11 Sep 2018 10:12:45 +0000 (11:12 +0100)]
dt-bindings: reset: rcar-rst: Document r8a7744 reset module

Document bindings for the RZ/G1N (R8A7744) reset module.

Signed-off-by: Biju Das <biju.das@bp.renesas.com>
Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agosoc: renesas: rcar-sysc: Add r8a7744 support
Biju Das [Tue, 11 Sep 2018 10:12:44 +0000 (11:12 +0100)]
soc: renesas: rcar-sysc: Add r8a7744 support

Add support for RZ/G1N (R8A7744) SoC power areas to the R-Car SYSC driver.

Signed-off-by: Biju Das <biju.das@bp.renesas.com>
Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agodt-bindings: power: rcar-sysc: Add r8a7744 power domain index macros
Biju Das [Tue, 11 Sep 2018 10:12:43 +0000 (11:12 +0100)]
dt-bindings: power: rcar-sysc: Add r8a7744 power domain index macros

Add power domain indices for RZ/G1N (R8A7744) SoC.

Signed-off-by: Biju Das <biju.das@bp.renesas.com>
Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agodt-bindings: power: rcar-sysc: Document r8a7744 SYSC binding
Biju Das [Tue, 11 Sep 2018 10:12:42 +0000 (11:12 +0100)]
dt-bindings: power: rcar-sysc: Document r8a7744 SYSC binding

Add binding documentation for the RZ/G1N (R8A7744) SYSC block.

Signed-off-by: Biju Das <biju.das@bp.renesas.com>
Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agosoc: renesas: rcar-rst: Add support for RZ/G2E
Fabrizio Castro [Mon, 10 Sep 2018 15:09:41 +0000 (16:09 +0100)]
soc: renesas: rcar-rst: Add support for RZ/G2E

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Biju Das <biju.das@bp.renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agodt-bindings: reset: rcar-rst: Document r8a774c0 rst
Fabrizio Castro [Mon, 10 Sep 2018 15:09:40 +0000 (16:09 +0100)]
dt-bindings: reset: rcar-rst: Document r8a774c0 rst

Document bindings for the RZ/G2E (a.k.a. R8A774C0) reset
module.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Biju Das <biju.das@bp.renesas.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agosoc: renesas: rcar-sysc: Add r8a774c0 support
Fabrizio Castro [Mon, 10 Sep 2018 14:41:27 +0000 (15:41 +0100)]
soc: renesas: rcar-sysc: Add r8a774c0 support

Add support for the RZ/G2E (R8A774C0) SoC power areas to the
R-Car SYSC driver.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Biju Das <biju.das@bp.renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agodt-bindings: power: rcar-sysc: Document r8a774c0 sysc
Fabrizio Castro [Mon, 10 Sep 2018 14:41:28 +0000 (15:41 +0100)]
dt-bindings: power: rcar-sysc: Document r8a774c0 sysc

Document bindings for the RZ/G2E (a.k.a. R8A774C0) system
controller.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Biju Das <biju.das@bp.renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agodt-bindings: power: Add r8a774c0 SYSC power domain definitions
Fabrizio Castro [Mon, 10 Sep 2018 14:41:26 +0000 (15:41 +0100)]
dt-bindings: power: Add r8a774c0 SYSC power domain definitions

This patch adds power domain indices for RZ/G2E.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Biju Das <biju.das@bp.renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
6 years agodt-bindings: firmware: scm: Add MSM8998 and SDM845
Bjorn Andersson [Wed, 29 Aug 2018 23:15:05 +0000 (16:15 -0700)]
dt-bindings: firmware: scm: Add MSM8998 and SDM845

Now that the compatible/clock handling is reworked add compatibles for
MSM8998 and SDM845 to the SCM binding.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agofirmware: qcom: scm: Refactor clock handling
Bjorn Andersson [Wed, 29 Aug 2018 23:15:04 +0000 (16:15 -0700)]
firmware: qcom: scm: Refactor clock handling

At one point in time all "future" platforms required three clocks, so
the binding and driver was written to treat this as the default case.
But new platforms has no clock requirements, which currently makes them
all a special case, causing the need for a patch in the binding and
driver for each new platform added.

This patch reworks the driver logic so that it will attempt to acquire
all three clocks and fail based on the given compatible. This allow us
to drop the clock requirement from "qcom,scm", in a way that will remain
backwards compatible with existing DT files.

Specific compatibles are added for apq8084, msm8916 and msm8974 to match
the updated binding and although equivalent to qcom,scm both ipq4019 and
msm8996 are kept as these have been used without fallback to qcom,scm.

The result of this patch is that new platforms, that require no clocks,
can be use the fallback compatible of "qcom,scm".

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agodt-bindings: firmware: scm: Refactor compatibles and clocks
Bjorn Andersson [Wed, 29 Aug 2018 23:15:03 +0000 (16:15 -0700)]
dt-bindings: firmware: scm: Refactor compatibles and clocks

When the binding was written all "future" platforms required three
clocks, so the default compatible (qcom,scm) was defined to require
this. But as history shows all "future" platforms actually lack required
clocks. Given how the binding is written these compatibles have to be
added as an exception to the default.

Refactor the description of compatible to define that a platform
compatible should be given, followed by the fallback of qcom,scm. Also
refactor the description of the clocks in a way that this does not need
to be updated as new platform specific compatibles are added.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: a few last cleanups
Alex Elder [Tue, 26 Jun 2018 00:58:56 +0000 (19:58 -0500)]
soc: qcom: smem: a few last cleanups

This patch contains several small cleanups:
  - In qcom_smem_enumerate_partitions(), change the "local_host"
    argument to have 16 bit unsigned type
  - Also in qcom_smem_enumerate_partitions(), change the type of
    the "host0" and "host1" local variables to be u16
  - Fix error messages reporting host ids to use the right format
    specifier
  - Shorten the error messages as well, to fit on one line
  - Add a compile-time check to ensure the local host value passed
    to qcom_smem_enumerate_partitions() is in range

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: verify partition host ids match
Alex Elder [Tue, 26 Jun 2018 00:58:55 +0000 (19:58 -0500)]
soc: qcom: smem: verify partition host ids match

Add verification in qcom_smem_partition_header() that the host ids
found in a partition's header structure match those in its partition
table entry.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: small change in global entry loop
Alex Elder [Tue, 26 Jun 2018 00:58:54 +0000 (19:58 -0500)]
soc: qcom: smem: small change in global entry loop

Change the logic in the loop that finds that global host entry in
the partition table not require the host0 and host1 local variables.
The next patch will remove them.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: verify partition offset_free_uncached
Alex Elder [Tue, 26 Jun 2018 00:58:53 +0000 (19:58 -0500)]
soc: qcom: smem: verify partition offset_free_uncached

Add verification in qcom_smem_partition_header() that the
offset_free_uncached field in a partition's header structure does
not exceed the partition's size.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: verify partition header size
Alex Elder [Tue, 26 Jun 2018 00:58:52 +0000 (19:58 -0500)]
soc: qcom: smem: verify partition header size

Add verification in qcom_smem_partition_header() that the size in a
partition's header structure matches the size in its partition table
entry.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: introduce qcom_smem_partition_header()
Alex Elder [Tue, 26 Jun 2018 00:58:51 +0000 (19:58 -0500)]
soc: qcom: smem: introduce qcom_smem_partition_header()

Create a new function qcom_smem_partition_header() to encapsulate
validating locating a partition header and validating information
found within it.  This will be built up over a few commits to make
it more obvious how the common function is replacing duplicated code
elsewhere.  Initially it just verifies the header has the right
magic number.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: require order of host ids to match
Alex Elder [Tue, 26 Jun 2018 00:58:50 +0000 (19:58 -0500)]
soc: qcom: smem: require order of host ids to match

In qcom_smem_enumerate_partitions(), we find all partitions that
have a given local host id in either its host0 or its host1 field
in the partition table entry.  We then verify that the header
structure at the start of each partition also contains the same two
host ids as is found in the table of contents.

There is no requirement that the order of the two host ids be the
same in the table of contents and in the partition header.

This patch changes that, requiring host0 to in the partition table
entry to equal host0 in the partition header structure (and similar
for the host1 values).

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: verify both host ids in partition header
Alex Elder [Tue, 26 Jun 2018 00:58:49 +0000 (19:58 -0500)]
soc: qcom: smem: verify both host ids in partition header

The global partition is indicated by having both host values in its
table of contents entry equal SMEM_GLOBAL_HOST=0xfffe.

In qcom_smem_set_global_partition(), we check whether the header
structure at the beginning of the partition contains that host
value, but the check only verifies *one* of them.  Change the check
so the partition header must have SMEM_GLOBAL_HOST for *both* its
host fields.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: small refactor in qcom_smem_enumerate_partitions()
Alex Elder [Tue, 26 Jun 2018 00:58:48 +0000 (19:58 -0500)]
soc: qcom: smem: small refactor in qcom_smem_enumerate_partitions()

Combine the code that checks whether a partition table entry is
associated with the local host with the assignment of the remote
host id value.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: always ignore partitions with 0 offset or size
Alex Elder [Tue, 26 Jun 2018 00:58:47 +0000 (19:58 -0500)]
soc: qcom: smem: always ignore partitions with 0 offset or size

In qcom_smem_enumerate_partitions(), any partition table entry
having a zero offset or size field is ignored.  Move those checks
earlier in the loop, because there's no sense in examining the
host fields for those entries.

Add the same checks in qcom_smem_set_global_partition(), so the
scan for the global partition skips over these invalid entries.
This allows a later check for zero size or offset once the global
entry is found to be eliminated.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: initialize region struct only when successful
Alex Elder [Tue, 26 Jun 2018 00:58:46 +0000 (19:58 -0500)]
soc: qcom: smem: initialize region struct only when successful

Hold off initializing anything for the array entry representing a
memory region in qcom_smem_map_memory() until we know we've
successfully mapped it.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: rename variable in qcom_smem_get_global()
Alex Elder [Tue, 26 Jun 2018 00:58:45 +0000 (19:58 -0500)]
soc: qcom: smem: rename variable in qcom_smem_get_global()

Rename the variable "area" to be "region" in qcom_smem_get_global(),
so its name better matches its type.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agodrivers: qcom: rpmh-rsc: clear wait_for_compl after use
Lina Iyer [Wed, 5 Sep 2018 20:14:38 +0000 (14:14 -0600)]
drivers: qcom: rpmh-rsc: clear wait_for_compl after use

The wait_for_compl register ensures the request sequence is maintained
when sending requests from the TCS. Clear the register after sending
active request and during invalidate of the sleep and wake TCS.

Reported-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: rmtfs-mem: Validate that scm is available
Bjorn Andersson [Tue, 28 Aug 2018 05:05:48 +0000 (22:05 -0700)]
soc: qcom: rmtfs-mem: Validate that scm is available

The scm device must be present in order for the rmtfs driver to
configure memory permissions for the rmtfs memory region, so check that
it is probed before continuing.

Cc: stable@vger.kernel.org
Fixes: fa65f8045137 ("soc: qcom: rmtfs-mem: Add support for assigning memory to remote")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: spm: add SCM probe dependency
Felix Fietkau [Mon, 23 Jul 2018 14:17:35 +0000 (16:17 +0200)]
soc: qcom: spm: add SCM probe dependency

Check for SCM availability before attempting to use SPM. SPM probe will
fail otherwise.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: Allow COMPILE_TEST of qcom SoC Kconfigs
Niklas Cassel [Wed, 29 Aug 2018 07:57:23 +0000 (09:57 +0200)]
soc: qcom: Allow COMPILE_TEST of qcom SoC Kconfigs

Since commit cab673583d96 ("soc: Unconditionally include qcom Makefile"),
we unconditionally include the soc/qcom/Makefile.

This opens up the possibility to compile test the code even when building
for other architectures.

Allow COMPILE_TEST for all qcom SoC Kconfigs, except for two Kconfigs
that depend on QCOM_SCM, since that triggers lots of build errors in
qcom_scm.

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: apr: Avoid string overflow
Niklas Cassel [Wed, 29 Aug 2018 07:57:22 +0000 (09:57 +0200)]
soc: qcom: apr: Avoid string overflow

'adev->name' is used as a NUL-terminated string, but using strncpy() with the
length equal to the buffer size may result in lack of the termination:

In function 'apr_add_device',
    inlined from 'of_register_apr_devices' at drivers//soc/qcom/apr.c:264:7,
    inlined from 'apr_probe' at drivers//soc/qcom/apr.c:290:2:
drivers//soc/qcom/apr.c:222:3: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
   strncpy(adev->name, np->name, APR_NAME_SIZE);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This changes it to use the safer strscpy() instead.

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: wcnss_ctrl: Avoid string overflow
Niklas Cassel [Wed, 29 Aug 2018 07:57:21 +0000 (09:57 +0200)]
soc: qcom: wcnss_ctrl: Avoid string overflow

'chinfo.name' is used as a NUL-terminated string, but using strncpy() with
the length equal to the buffer size may result in lack of the termination:

drivers//soc/qcom/wcnss_ctrl.c: In function 'qcom_wcnss_open_channel':
drivers//soc/qcom/wcnss_ctrl.c:284:2: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
  strncpy(chinfo.name, name, sizeof(chinfo.name));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This changes it to use the safer strscpy() instead.

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: Remove depends on OF from QCOM_RPMH
Niklas Cassel [Wed, 29 Aug 2018 07:57:20 +0000 (09:57 +0200)]
soc: qcom: Remove depends on OF from QCOM_RPMH

QCOM_RPHM already selects ARM64, which always selects OF.

Additionally, the rpmh driver only uses linux/of.h, which has dummy
definitions for all functions, in order for code to to be able to
build without CONFIG_OF set.

Remove the superfluous depends on OF.

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: Remove bogus depends on OF from QCOM_SMD_RPM
Niklas Cassel [Wed, 29 Aug 2018 07:57:19 +0000 (09:57 +0200)]
soc: qcom: Remove bogus depends on OF from QCOM_SMD_RPM

QCOM_SMD_RPM builds perfectly fine without CONFIG_OF set.
Remove the bogus depends on OF.

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smsm: Add select IRQ_DOMAIN
Niklas Cassel [Wed, 29 Aug 2018 07:57:18 +0000 (09:57 +0200)]
soc: qcom: smsm: Add select IRQ_DOMAIN

Since we are using irq_domain_add_linear(), add a select on IRQ_DOMAIN.
This is needed in order to be able to remove the depends on ARCH_QCOM.

drivers/soc/qcom/smsm.c: In function ‘smsm_inbound_entry’:
drivers/soc/qcom/smsm.c:411:18: error: implicit declaration of function
  ‘irq_domain_add_linear’
  entry->domain = irq_domain_add_linear(node, 32, &smsm_irq_ops, entry);
                  ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smp2p: Add select IRQ_DOMAIN
Niklas Cassel [Wed, 29 Aug 2018 07:57:17 +0000 (09:57 +0200)]
soc: qcom: smp2p: Add select IRQ_DOMAIN

Since we are using irq_domain_add_linear(), add a select on IRQ_DOMAIN.
This is needed in order to be able to remove the depends on ARCH_QCOM.

drivers/soc/qcom/smp2p.c: In function ‘qcom_smp2p_inbound_entry’:
drivers/soc/qcom/smp2p.c:317:18: error: implicit declaration of function
  ‘irq_domain_add_linear’
  entry->domain = irq_domain_add_linear(node, 32, &smp2p_irq_ops, entry);
                  ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: llcc-slice: Add missing include of sizes.h
Niklas Cassel [Wed, 29 Aug 2018 07:57:16 +0000 (09:57 +0200)]
soc: qcom: llcc-slice: Add missing include of sizes.h

Add missing include of sizes.h.

drivers/soc/qcom/llcc-slice.c: In function ‘llcc_update_act_ctrl’:
drivers/soc/qcom/llcc-slice.c:41:44: error: ‘SZ_4K’ undeclared
 #define LLCC_TRP_ACT_CTRLn(n)         (n * SZ_4K)
                                            ^~~~~

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: smem: Add missing include of sizes.h
Niklas Cassel [Wed, 29 Aug 2018 07:57:15 +0000 (09:57 +0200)]
soc: qcom: smem: Add missing include of sizes.h

Add missing include of sizes.h.

drivers/soc/qcom/smem.c: In function ‘qcom_smem_get_ptable’:
drivers/soc/qcom/smem.c:666:64: error: ‘SZ_4K’ undeclared
  ptable = smem->regions[0].virt_base + smem->regions[0].size - SZ_4K;
                                                                ^~~~~

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: apr: fix spelling mistake: "paket" -> "packet"
Colin Ian King [Mon, 11 Jun 2018 08:38:38 +0000 (09:38 +0100)]
soc: qcom: apr: fix spelling mistake: "paket" -> "packet"

Trivial fix to spelling mistake in dev_err message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: geni: geni_se_clk_freq_match() should always accept multiples
Douglas Anderson [Thu, 6 Sep 2018 22:49:06 +0000 (15:49 -0700)]
soc: qcom: geni: geni_se_clk_freq_match() should always accept multiples

The geni_se_clk_freq_match() has some strange semantics.  Specifically
it is defined with two modes:
1. It can find a clock that's an exact multiple of the requested rate
2. It can find a non-exact match but it can't handle multiples then

...but callers should always be able to handle a clock that is a
multiple of the requested clock so mode #2 doesn't really make sense.
Let's change the semantics so that the non-exact match can also accept
multiples and then change the code to handle that.

The only caller of this code is the unlanded SPI driver [1] which
currently passes "exact = True", thus it should be safe to change the
semantics in this way.  ...and, in fact, the SPI driver should likely
be modified to pass "exact = False" (with the new semantics) since
that will allow it to work with SPI devices that request a clock rate
that doesn't exactly match a rate we can make.

[1] https://lkml.kernel.org/r/1535107336-2214-1-git-send-email-dkota@codeaurora.org

Fixes: eddac5af0654 ("soc: qcom: Add GENI based QUP Wrapper driver")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: geni: Don't ignore clk_round_rate() errors in geni_se_clk_tbl_get()
Douglas Anderson [Thu, 6 Sep 2018 22:49:05 +0000 (15:49 -0700)]
soc: qcom: geni: Don't ignore clk_round_rate() errors in geni_se_clk_tbl_get()

The function clk_round_rate() is defined to return a "long", not an
"unsigned long".  That's because it might return a negative error
code.  Change the call in geni_se_clk_tbl_get() to check for errors.

While we're at it, get rid of a useless init of "freq".

NOTE: overall the idea that we should iterate over clk_round_rate() to
try to reconstruct a table already present in the clock driver is
questionable.  Specifically:
- This method relies on "clk_round_rate()" rounding up.
- This method only works if the table is sorted and has no duplicates.
...this patch doesn't try to fix those problems, it just makes the
error handling more correct.

Fixes: eddac5af0654 ("soc: qcom: Add GENI based QUP Wrapper driver")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agosoc: qcom: geni: Make version macros simpler
Stephen Boyd [Fri, 18 May 2018 22:47:50 +0000 (15:47 -0700)]
soc: qcom: geni: Make version macros simpler

This macro doesn't work, because it hides a local variable inside of the
macro to hold the version and that variable name is called 'ver' and
'version' sometimes.

Let's change this to be more explicit. Introduce three macros for the
major, minor, and step of the version, and require callers to pass the
version in to get the part of the version out. This way we don't hide
local variables inside macros and things are less evil overall.

Cc: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Cc: Sagar Dharia <sdharia@codeaurora.org>
Cc: Girish Mahadevan <girishm@codeaurora.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agodt-bindings: msm: Update documentation of qcom,llcc
Venkata Narendra Kumar Gutta [Wed, 12 Sep 2018 18:06:35 +0000 (11:06 -0700)]
dt-bindings: msm: Update documentation of qcom,llcc

Add reg-names and interrupts for LLCC documentation and the usage
examples. llcc broadcast base is added in addition to llcc base,
which is used for llcc broadcast writes.

Signed-off-by: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
6 years agodrivers: edac: Add EDAC driver support for QCOM SoCs
Channagoud Kadabi [Wed, 12 Sep 2018 18:06:34 +0000 (11:06 -0700)]
drivers: edac: Add EDAC driver support for QCOM SoCs

Add error reporting driver for Single Bit Errors (SBEs) and Double Bit
Errors (DBEs). As of now, this driver supports error reporting for
Last Level Cache Controller (LLCC) of Tag RAM and Data RAM. Interrupts
are triggered when the errors happen in the cache, the driver handles
those interrupts and dumps the syndrome registers.

Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
Signed-off-by: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
Co-developed-by: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Andy Gross <andy.gross@linaro.org>