During noirq suspend phase, mailbox MU irq will be masked
but many drivers still need to communicate with system
controller firmware via mailbox, if MU irq is masked, it
will cause RPC timeout as below:
[ 23.372103] imx-scu scu: RPC send msg timeout
Setting MU irq to be wakeup source is NOT working as GIC
driver does NOT have .irq_set_wake implemented, so to
support suspend/resume, just make imx mailbox driver NOT
suspend, since MU is always a wakeup source on i.MX platforms
with system controller inside, and its power/clock is
maintained by system controller, mailbox driver no need
to manage them.
Signed-off-by: Anson Huang <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
This patch is to introduce ZynqMP IPI mailbox controller driver
to use the ZynqMP IPI block as mailboxes.
Signed-off-by: Wendy Liang <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
If the "wakeup-source" property does not exist there is no need to call
device_init_wakeup("false") at probe.
Signed-off-by: Fabien Dessenne <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
By default do not enable the wakeup source.
This lets the userspace application decide whether the wakeup source
shall be enabled or not.
Signed-off-by: Fabien Dessenne <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Create one debug entry directory per instance to support the multi
instantiation.
Signed-off-by: Ludovic Barre <[email protected]>
Signed-off-by: Fabien Dessenne <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
We get a warning about this being unused when CONFIG_PM is disabled:
drivers/mailbox/tegra-hsp.c:782:12: error: 'tegra_hsp_resume' defined but not used [-Werror=unused-function]
Fixes: 9a63f0f405 ("mailbox: tegra-hsp: Add suspend/resume support")
Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
RING_CONTROL reg was not written due to wrong address, hence all
the subsequent ring flush was timing out.
Fixes: a371c10ea4 ("mailbox: bcm-flexrm-mailbox: Fix FlexRM ring flush sequence")
Signed-off-by: Rayagonda Kokatanur <[email protected]>
Signed-off-by: Ray Jui <[email protected]>
Reviewed-by: Scott Branden <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
The mbox_flush() function can be used by drivers that are built as
modules, so the function needs to be exported.
Reported-by: Mark Brown <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
In order to get rid of a lot of cleanup boilerplate code, use the
device-managed registration API.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Use devm_kstrdup_const() in the tegra-hsp driver. This mostly serves as
an example of how to use this new routine to shrink driver code.
Also use devm_kzalloc() instead of regular kzalloc() to shrink the
driver even more.
Doorbell objects are only removed in the driver's remove callback so
it's safe to convert all memory allocations to devres.
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Upon resuming from a system sleep state, the interrupts for all active
shared mailboxes need to be reenabled, otherwise they will not work.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
The Tegra HSP block supports 'shared mailboxes' that are simple 32-bit
registers consisting of a FULL bit in MSB position and 31 bits of data.
The hardware can be configured to trigger interrupts when a mailbox
is empty or full. Add support for these shared mailboxes to the HSP
driver.
The initial use for the mailboxes is the Tegra Combined UART. For this
purpose, we use interrupts to receive data, and spinning to wait for
the transmit mailbox to be emptied to minimize unnecessary overhead.
Based on work by Mikko Perttunen <[email protected]>.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Look through the whole controller list when mapping device tree
phandles to controllers instead of stopping at the first one.
Each controller is intended to only contain one kind of mailbox,
but some devices (like Tegra HSP) implement multiple kinds and use
the same device tree node for all of them. As such, we need to allow
multiple mbox_controllers per device tree node.
Signed-off-by: Mikko Perttunen <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
The mailbox framework supports blocking transfers via completions for
clients that can sleep. In order to support blocking transfers in cases
where the transmission is not permitted to sleep, add a new ->flush()
callback that controller drivers can implement to busy loop until the
transmission has been completed. A new mbox_flush() function can be
called by mailbox consumers in atomic context to make sure a transfer
has completed.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Reviewed-by: Caesar Wang <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Acked-by: Neil Armstrong <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Memory allocated through device-managed functions doesn't need to be
explicitly freed, so these calls can be removed.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Acked-by: Lee Jones <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Reviewed-by: Leo Yan <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Tested-by: Leo Yan <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Signed-off-by: Thierry Reding <[email protected]>
Acked-by: Scott Branden <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Reviewed-by: Eric Anholt <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Add device-managed equivalents of the mbox_controller_register() and
mbox_controller_unregister() functions that can be used to have the
devres infrastructure automatically unregister mailbox controllers on
driver probe failure or driver removal. This can help remove a lot of
boiler plate code from drivers.
Reviewed-by: Bjorn Andersson <[email protected]>
Reviewed-by: Sudeep Holla <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
The > comparison should be >= or we access one element beyond the end
of the array.
(The inst->qinsts[] array is allocated in the ti_msgmgr_probe() function
and it has ->num_valid_queues elements.)
Fixes: a2b79838b8 ("mailbox: ti-msgmgr: Add support for Secure Proxy")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Nishanth Menon <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Current mailbox driver of Hi3660 release the mailbox directly
before sending a new message which may cause last message lost
and next message sending doesn't take effect actually.
This patch fixs this issue by following the right progress below,
each time before sending a message, mailbox driver will check
whether the mailbox is in ready state, if last message has been
acknowledged, the mailbox driver will clear the ack state to turn
the mailbox to ready state again.
Signed-off-by: Kevin Wangtao <[email protected]>
Reviewed-and-tested-by: Leo Yan <[email protected]>
Tested-by: Valentin Schneider <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
The mbox_chan_ops structure can be const as it is only stored in the
ops field of an mbox_controller structure and this field is const.
Done with the help of Coccinelle.
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Pull mailbox updates from Jassi Brar:
- convert print users to use the %pOFn format specifier
- enable ti-msgmr driver for the K3 platform as well
- add QCS404 to compatible list of QCOM's APCS IPC driver
- minor spelling fixes toogle -> toggle
- kzalloc failure catch in Mediatek driver
* tag 'mailbox-v4.20' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
mailbox: mediatek: Add check for possible failure of kzalloc
mailbox: bcm-flexrm-mailbox: fix spelling mistake "toogle" -> "toggle"
mailbox: qcom: Add QCS404 APPS Global compatible
drivers: mailbox: Make ti-msgmr driver depend on ARCH_K3
mailbox: Convert to using %pOFn instead of device_node.name
Trivial fix to spelling mistake in function name flexrm_flip_header_toogle,
rename it to flexrm_flip_header_toggle.
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.
Signed-off-by: Rob Herring <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
acpi_pcc_probe() calls acpi_table_parse_entries_array() but fails
to check for an error return. This in turn can result in calling
kcalloc() with a negative count as well as emitting the following
misleading erorr message:
[ 2.642015] Could not allocate space for PCC mbox channels
Fixes: 8f8027c5f9 (mailbox: PCC: erroneous error message when parsing ACPI PCCT)
Signed-off-by: David Arcari <[email protected]>
Reviewed-by: Al Stone <[email protected]>
Cc: 4.18+ <[email protected]> # 4.18+
Signed-off-by: Rafael J. Wysocki <[email protected]>
The i.MX Messaging Unit is a two side block which allows applications
implement communication over this sides.
The MU includes the following features:
- Messaging control by interrupts or by polling
- Four general-purpose interrupt requests reflected to the other side
- Three general-purpose flags reflected to the other side
- Four receive registers with maskable interrupt
- Four transmit registers with maskable interrupt
Reviewed-by: Vladimir Zapolskiy <[email protected]>
Reviewed-by: Dong Aisheng <[email protected]>
Signed-off-by: Oleksij Rempel <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
This patch is first version of Mediatek Command Queue(CMDQ) driver. The
CMDQ is used to help write registers with critical time limitation,
such as updating display configuration during the vblank. It controls
Global Command Engine (GCE) hardware to achieve this requirement.
Currently, CMDQ only supports display related hardwares, but we expect
it can be extended to other hardwares for future requirements.
Signed-off-by: Houlong Wei <[email protected]>
Signed-off-by: HS Liao <[email protected]>
Signed-off-by: CK Hu <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Secure Proxy is another communication scheme in Texas Instrument's
devices intended to provide an unique communication path from various
processors in the System on Chip(SoC) to a central System Controller.
Secure proxy is, in effect, an evolution of current generation Message
Manager hardware block found in K2G devices. However the following
changes have taken place:
Secure Proxy instance exposes "threads" or "proxies" which is
primary representation of "a" communication channel. Each thread is
preconfigured by System controller configuration based on SoC usage
requirements. Secure proxy by itself represents a single "queue" of
communication but allows the proxies to be independently operated.
Each Secure proxy thread can uniquely have their own error and threshold
interrupts allowing for more fine control of IRQ handling.
Provide the driver support for Secure Proxy and thread instances.
NOTE: Secure proxy configuration is only done by System Controller,
hence these are assumed to be pre-configured instances.
See AM65x Technical Reference Manual (SPRUID7, April 2018)
for further details: http://www.ti.com/lit/pdf/spruid7
Signed-off-by: Nishanth Menon <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
For newer generation of the hardware, the naming of the region is
decided at integration level and there could be additional regions
as well. Hence move the region naming to be described from compatible
descriptor.
Signed-off-by: Nishanth Menon <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>