Update the API of the mdf assign memory to subsys for cases
when the scm driver is not compiled. The current API has an
extra parameter.
Change-Id: I50c100d2ee260a14fe754a8497727b5d37d20610
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Add support for other drivers to manage download mode by exposing
qcom_scm_set_download_mode (such as in commit: "power: reset:
msm-poweroff: Manage download mode"). Also, change the function to
support changing to different download modes with enum
qcom_download_mode, instead of only either "full dump mode" or "normal
restart".
Change-Id: Ic79d8dda97c17df70bd2cef5d9ce12ecb4c06d00
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
The secure world allows for changing the ownership of multiple
(not necessarily physically contiguous) memory regions in one
secure call. Thus, expose an interface for clients to assign more
than one memory region per secure call.
Change-Id: Ic444627daee9d735b8b039ae3965e861cdcd110a
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Add memory protection API for MultiDSP framework as scm_call2
is depreciated on latest kernel.
Change-Id: I935f29bf958e57498fd115022d9f6352adbab861
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Add secure world call to protect memory for video.
Change-Id: I27a82d31054b8a2459738d3c7a2785abd357504f
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Migrate secure world calls to qcom_scm driver in synaptics_dsx_core.c.
Change-Id: Ie339dcad416658a0f1227b9a9ee995799695dc94
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
- Add SCM API to notify secure world that a LUT should be secure.
- Add SCM API to notify secure world that camera should be secure.
Change-Id: I31b0ce2c58182f809d0875c64116436a30ce8f62
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Migrate scm_call2 usage to new SCM driver in remoteqdss.
Change-Id: Idd25aab0c5fb7cc55ee81c8f685981b8362a7b45
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Adding APIs to create, delete, and enable shmbridge.
Migrating SCM calls in qtee_shmbridge to use the new APIs.
Change-Id: I038e7950d11cbf6bb38a8824a576f2d92f879454
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Adding APIs to change smmu pagetable format, and to prepare atos id.
Migrating SCM calls in msm_tz_smmu to use the new APIs.
Change-Id: I3aed64cd524e94cfa6d6ea168031eda62fd14fb0
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Adding APIs to check if KGSL SMMU is available, and programming the
SMMU Aperture size. Migrating SCM calls in the KGSL IOMMU driver.
Change-Id: I77178f3e300112fa47a8ca6861acb08d547c9875
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Adding API to upstream driver to get secure dump state and protect
memory regions. Migrating SCM calls used in the IPA driver.
Change-Id: Ia61436d8c18ddda49c411e06f147cdae345a23af
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Adding API to upstream driver to get JTAG ETM feat id.
Migrating SCM calls used in the JTAG driver.
Change-Id: I60cd57d5c6aae62ec089e960b55ac221f0474f64
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Migrating all SCM calls made to the old driver to now be made
through the backported upstream driver.
Change-Id: Ic77d315c5a55859f0cc58d7bbf05c0c24d1ef155
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Migrate SCM IO read calls in the smmu driver to use new SCM driver.
Add support for io-pgtable-msm-secure map and unmap in SCM driver.
Change-Id: If1ce054b9cfcfdcdab3aecc6752fcd4765197a05
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Add support for SCM call to deactivate secure watchdog on Qualcomm
devices.
Change-Id: I4008792e45d2c264b98ca954ea37a94093ea771e
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Definitions throughout qcom_scm are loosely grouped and loosely ordered.
Sort all the functions/definitions by service ID/command ID to improve
sanity when needing to add new functionality to this driver.
Change-Id: I698443e8e650d4bc9e65ac27d68c46d1e45ba8e3
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
There are some questionable coding styles in this function. It looks
quite odd to deref a pointer with array indexing that only uses the
first element. Also, destroying an input/output variable halfway through
the function and then overwriting it on success is not clear. It's
better to use a local variable and the kernel macros to step through
each bit set in a bitmask and clearly show where outputs are set.
Cc: Ian Jackson <ian.jackson@citrix.com>
Cc: Julien Grall <julien.grall@arm.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
[bjorn: Changed for_each_set_bit() size to BITS_PER_LONG]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Based on 1 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 and
only version 2 as published by the free software foundation this
program is distributed in the hope that it will be useful but
without any warranty without even the implied warranty of
merchantability or fitness for a particular purpose see the gnu
general public license for more details
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 294 file(s).
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141900.825281744@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Since commit e6f6d63ed1 ("drm/msm: add headless gpu device for imx5")
the DRM_MSM symbol can be selected by SOC_IMX5 causing the following
error when building imx_v6_v7_defconfig:
In file included from ../drivers/gpu/drm/msm/adreno/a5xx_gpu.c:17:0:
../include/linux/qcom_scm.h: In function 'qcom_scm_set_cold_boot_addr':
../include/linux/qcom_scm.h:73:10: error: 'ENODEV' undeclared (first use in this function)
return -ENODEV;
Include the <linux/err.h> header file to fix this problem.
Reported-by: kernelci.org bot <bot@kernelci.org>
Fixes: e6f6d63ed1 ("drm/msm: add headless gpu device for imx5")
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
This fixes the case when CONFIG_QCOM_SCM is not enabled, and linux/errno.h
has not been included previously.
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Add a dummy qcom_scm_assign_mem() to enable building drivers when
CONFIG_COMPILE_TEST=y && CONFIG_QCOM_SCM=n.
All other qcom_scm_* functions already have a dummy version.
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>
qcom_scm.h makes heavy use of <linux/types.h> and <linux/cpumask.h>.
Add the dependent header files so that users of SCM don't need to
include header files they don't otherwise use.
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Pull remoteproc updates from Bjorn Andersson:
"This adds an interface for configuring Qualcomm's "secure SMMU" and
adds support for booting the modem Hexagon on MSM8996.
Two new debugfs entries are added in the remoteproc core to introspect
the list of memory carveouts and the loaded resource table"
* tag 'rproc-v4.15' of git://github.com/andersson/remoteproc:
remoteproc: qcom: Fix error handling paths in order to avoid memory leaks
remoteproc: qcom: Drop pr_err in q6v5_xfer_mem_ownership()
remoteproc: debug: add carveouts list dump feature
remoteproc: debug: add resource table dump feature
remoteproc: qcom: Add support for mss remoteproc on msm8996
remoteproc: qcom: Make secure world call for mem ownership switch
remoteproc: qcom: refactor mss fw image loading sequence
firmware: scm: Add new SCM call API for switching memory ownership
Two different processors on a SOC need to switch memory ownership
during load/unload. To enable this, second level memory map table
need to be updated, which is done by secure layer.
This patch adds the interface for making secure monitor call for
memory ownership switching request.
Acked-by: Andy Gross <andy.gross@linaro.org>
Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
[bjorn: Minor style and kerneldoc updates]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The secure IO service provides operations for reading and writing secure
memory from non-secure mode, expose this API through SCM.
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
This patch adds a set remote state SCM API. This will be used by the
Venus and GPU subsystems to set state on the remote processors.
This work was based on two patch sets by Jordan Crouse and Stanimir
Varbanov.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
This adds the Peripheral Authentication Service (PAS) interface to the
Qualcomm SCM interface. The API is used to authenticate and boot a range
of external processors in various Qualcomm platforms.
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
HDCP driver needs to check if secure environment supports HDCP. If it's
supported, then it requires to program some registers through SCM.
Add qcom_scm_hdcp_available and qcom_scm_hdcp_req to support these
requirements.
Signed-off-by: Jilai Wang <jilaiw@codeaurora.org>
Signed-off-by: Kumar Gala <galak@codeaurora.org>