Enable RPM SMD Driver that implements the protocol to communicate with
RPM processor for clock, regulator and power related voting.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
This snapshot is taken as of msm-3.18 commit e70ad0cd (Promotion of
kernel.lnx.3.18-151201.)
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
G-Link is a generic link-layer transport similar to SMD that supports a
plug-in layer for the physical transport. This allows it to adapt to
different physical transports such as shared memory, UARTs, buses, and DMA.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Enable the SMD communication protocol between apps and other processors
in the SoC.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Enable remote spinlocks to facilitate locking between the various
processors in the SoC.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
The __raw_writel_no_log and __raw_readl_no_log APIs have been deprecated.
Use the alternate IO Read/Write APIs.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
This snapshot is taken as of msm-3.18 commit e70ad0cd (Promotion of
kernel.lnx.3.18-151201.)
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
The __raw_writel_no_log and __raw_readl_no_log APIs have been deprecated.
Use the alternate IO Read/Write APIs.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
This snapshot is taken as of msm-3.18 commit e70ad0cd (Promotion of
kernel.lnx.3.18-151201.)
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
This snapshot is taken as of msm-3.18 commit e70ad0cd (Promotion of
kernel.lnx.3.18-151201)
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
This snapshot is taken as of msm-3.18 commit e70ad0cd (Promotion of
kernel.lnx.3.18-151201.)
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
This snapshot is taken as of msm-3.18 commit e70ad0cd (Promotion of
kernel.lnx.3.18-151201.)
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
The ioread* and the iowrite* functions and not inlined and hence
the RTB logs end up containing the ioread and iowrite functions
themselves and not the ones invoking them.
Add RTB support to the ioread*and iowrite* functions so that we can
get meaningful RTB logs.
Note that to avoid multiple RTB logs for ioread* and iowrite*
functions, read*_no_log and write*_no_log macros are added.
Change-Id: I2315d44c4dfbeee6be4a52f21bf4a20dd9508597
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Conflicts:
arch/arm64/include/asm/io.h
As the priority of RTB panic notifier was zero, it was
not guaranteed to disable RTB right after kernel panic.
So RTB log buffer could be flooded with some I/O operations
after panic. By setting the priority of RTB panic notifier
to the highest value, make sure RTB is disabled right after
a kernel panic.
Change-Id: If9efc2ec31efa6aa17e92b2b01e81ab4df6d1730
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
RTB logging currently doesn't log the time
at which the logging was done. This can be
useful to compare with dmesg during debug.
The bytes for timestamp are taken by reducing
the sentinel array size to three from eleven
thus giving the extra 8 bytes to store time.
This maintains the size of the layout at 32.
Change-Id: Ifc7e4d2e89ed14d2a97467891ebefa9515983630
Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
This snapshot is taken as of msm-3.10 commit:
78c36fa0ef (Merge "msm: mdss: Prevent backlight update during
continuous splash")
RTB support captures system events such as register writes to a
small uncached region. This is designed to aid in debugging, where
it may be useful to know the last events that occurred prior to a
device reset.
Change-Id: Idc51e618380f58a6803f40c47f2b3d29033b3196
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
[spjoshi@codeaurora.org: fix merge conflict]
Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
Use memcpy_toio() to write 64-bit address to imem instead of
writel_relaxed which is causing truncation as its a 32-bit api.
Change-Id: I0c0922e1eeff72bacb788bd70e6381e9c1dcf7fd
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Use the right command ID for the core-debug-unlock scm_call
and add support for the new scm_call2 API. This new API
is more aligned to the ARMv8 SMC calling convention.
Change-Id: Ida76f2dc5ea67066e49ffe1e0e04c2056134f381
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
This is a snapshot of the memory_dump driver as of msm-3.10
commit:
acdce027751d5a7488b283f0ce3111f873a5816d (Merge "defconfig: arm64: Enable
ONESHOT_SYNC for msm8994")
Change-Id: I296a57ab1c491b29911413fdb4abb82fa15137c3
Signed-off-by: Andy Gross <agross@codeaurora.org>
[abhimany: resolve trivial merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
The amount of time we wait for a reset following an attempted
forced watchdog bite was recently increased from 1ms to 2s. As
it turns out, this is not enough when certain debug features
(ex. cache dumping are enabled) as the secure software executing
in EL3 may take close to 10 seconds to complete collection of
dumps. Therefore, increase the wait to 10s.
Change-Id: I98ae1bfa49eb236ca56b91dadb6c3a78ee962a74
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Though we configure the watchdog timeout to be only one
tick when deliberately trying to force a watchdog bite,
the watchdog bite interrupt may be processed asynchronously
by the secure environment on a different CPU. Therefore, we
need to increase the amount of time we spend waiting for
the watchdog bite to happen before falling back on other
reset methods, to avoid a race condition between the
fallback reset code and the secure environment itself.
Change-Id: I73de0abbf8cdd77f22374886f4a89b25743b86eb
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Currently we disable Non secure watchdog during suspend and
re-enable it during resume. This leaves suspend / resume path
unprotected by Non secure watchdog. There is a feature in
hardware where watchdog freezes automatically when all online
cores are in suspend and unfreezes watchdog upon wakeup event
from low power mode. Set the bit in watchdog control register to
enable this feature and protect suspend / resume path by Non
secure watchdog.
Change-Id: Ibca425a661c74bd1d46513783780ea213a51f87f
Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
Virtual and physical memory allocators may return buffers
that are at physical addresses higher than 4GB. When
passing addresses to TZ, don't assume otherwise. Fix the
code to not truncate down to 32 bits (the assignment operation
u64 = u32 = u64 truncates down 64 bit addresses to 32 bits)
unnecessarily; perform the assignment in two discrete steps
to allow the desc.args[X] field to store the full 64 bit
address.
Change-Id: I7f3139dee27f22c5b713ba8b6221bc3551699f32
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
The scm library has added support for a new secure world
interface that is more aligned to the ARMv8 SMC calling
convention. Use the new API while maintaining backward
compatibility.
Change-Id: Id5a75936f6c1881add09b3dc9b07abecbda694eb
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
This is a snapshot of the watchdog_v2 driver as of msm-3.10 commit
acdce027751d5a7488b283f0ce3111f873a5816d (Merge "defconfig: arm64:
Enable ONESHOT_SYNC for msm8994")
Change-Id: I8cd7a84e0cbb45c3ac20d4c84f5603ab5df1edae
Signed-off-by: Andy Gross <agross@codeaurora.org>
[abhimany: resolve trivial merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
To disable and enable Kryo hardware errata 76 workaround at
runtime, expose a debugfs interface. Wrote codes using e74/e76
API and data as a starting point.
/sys/kernel/debug/scm_errata/kryo_e76
This allows Kryo errata 76 workaround to be toggled
off or on (on affected devices) by echoing 0 or 1 to the file.
Change-Id: I3d682021aa98eef5421ac2e7578da02f2ea98081
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
Currently, when deciding which version of scm call to make in scm_call2,
we check the scm_version variable. However, the scm_version variable is
only initialized as a side-effect of calling is_scm_armv8, which isn't
called anywhere in scm_call2. So if someone makes an scm_call2 before
is_scm_armv8 has been called then they could get the wrong scm version.
Fix this by calling is_scm_armv8 at the top of the scm_call2
function (and bailing out if it's not v8 since scm_call2 only supports
v8 forward). Similarly for scm_call2_atomic.
Since is_scm_armv8 caches its result the performance overhead of calling
on every invocation of scm_call2 should be negligible.
Change-Id: I46d2423ae2e4b5204fc5eefa1c6660c3c95a95b0
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
This driver exposes a debugfs interface intended for advanced
system debugging/profiling usecases where it may be desirable
to enable or disable certain hardware errata workarounds at
runtime, via an scm call.
Presently, a single debugfs node is implemented:
/sys/kernel/debug/scm_errata/kryo_e74_e75
This allows Kryo errata 74 and 75 workarounds to be toggled
off or on (on affected devices) by echoing 0 or 1 to the file.
Change-Id: I6edf39757416130a7b716dcdab1a601f27dfac5a
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
The existing scm-xpu implementation makes an unconditional scm
call at boot. The assumption was that such errors would be non-
fatal by default, and so a desired behavior could be achieved
by controlling whether the driver was compiled.
On recent targets like msm8996, XPU errors are treated as
fatal by default. To support cases where it may be desirable
to treat them as non-fatal, the driver must be changed to
make the appropriate scm call based on a new Kconfig choice.
Change-Id: Ibb55c062937f130c13538f049582575d9a6f52ad
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
This snapshot is taken as of msm-3.10 commit:
e3a3f66e47 ("Merge "soc: qcom: pil-q6v5-mss: Do not free memory
allocated to modem pil")
When compiled, the scm-xpu driver makes a single scm call at boot
to enable treatment of XPU errors as fatal.
Change-Id: Id33c2b73f4ed7ba8a07c5affebbe66eb5eba7951
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Non-atomic scm call which could be interrupted, trustzone will store
the session id in a register(x6) which will be used when trustzone resumes
the call.
To avoid x6 being used by compiler, HLOS now uses it to send a zero before
making scm call.
This is the same change as in the 32bit scm call.
Change-Id: If7a3ee28bdbf22acf447531603819a6f4f1603ca
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
It is required on some hardware that the Limits Management
secure API be executed in mutual exclusion with certain
other hardware-accessing drivers. Provide a mutex to achieve
this.
Change-Id: Ie0db516e335c29b79e959a0a6e6fb76231af6bf4
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
This is a snapshot of the scm driver as of
msm-3.14 commit:
3bc54cf86bdc7affa7cd4bf7faa3c57fe8f8819d (Merge "msm:
camera: Add dummy sub module in sensor pipeline")
Change-Id: Ida15e7da1a8c92e96b4f59feecb4d9dbaf667273
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
This reverts the upstream commit 68234df.
This is required internally for certain use-cases like flushing cache
before reboot to ensure all the data is available in the ramdump.
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Fix control register offsets for SDC1 and SDC2 pingroups
Change-Id: Ib373d17d512aeed64c16b5831ac20e03ab43ffe0
Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
The GPLv2 copyright statement includes an attribution
to Sony which was accidentally copied from another file.
Since the 8996 pinctrl driver does not leverage code
from sources besides the Linux Foundation,
clean-up the copyright text accordingly.
Change-Id: I324088aea2abde4fe34769a63d4ab55b35e13b81
Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
Based on the upstream change add gpio functions and
pingroups to msm8996 soc file
Change-Id: Iffc92a84d31b02efe29319dbdbb65c870c959cfd
Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
Use appropriate SOC name. Also replace all
instances of thulia with kryo.
Change-Id: Idd9acaae0688b7c125b85462bd99d01a3303fd09
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
The APIs __dma_inv_range() and __dma_clean_range() were
not exported by the third party patch. Since the functions
starting with underscores are not to be directly used by drivers,
related functions without the underscores are provided
which have the same name and functionality as the 32 bit APIs.
Change-Id: Ie0e681614307d9d9a19e58cacfb9b5dff4528977
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
arm64: add defines for dmac_*_range for compatibility with arm32
An earlier patch created defines for dma_*_range APIs to be
compatible with arm 32 bit, however it appears
these API names have not (at least yet) appeared there, so
revise the names to dmac_*_range, which is defined
for arm 32 bit so that there is one name defined
for both architectures.
Change-Id: I6456c02bad73fb54a874dc9925d3d43d9b8be2f2
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit 0930bab0db67cc0d91e52e385e3e061871c6be05)