rpmsg:rpmsg.git
5 years agoomap5: opp: fix fdif clk name in opp tables
Miguel Vadillo [Wed, 15 Feb 2012 22:32:50 +0000 (16:32 -0600)]
omap5: opp: fix fdif clk name in opp tables

OPP table has a wrong name for fdif clock, fixed the same.

Signed-off-by: Miguel Vadillo <vadillo@ti.com>
Acked-by: Vishwanath BS <vishwanath.bs@ti.com>
5 years agoARM: omap5: hwmod_data: split DSP hwmod into two hwmod devices
Miguel Vadillo [Wed, 15 Feb 2012 16:31:33 +0000 (10:31 -0600)]
ARM: omap5: hwmod_data: split DSP hwmod into two hwmod devices

DSP has two reset lines, one for MMU and another for the core
itself. The MMU reset line needs to be deasserted first so that
it can be programmed before deasserting the core reset. There is
a single hwmod device for DSP currently, and this would not allow
the remoteproc code to program and manage the DSP properly. This
device has therefore been split into two different hwmod devices
to allow independent control of the MMU and the processor core.

Signed-off-by: Miguel Vadillo <vadillo@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoARM: omap5: hwmod_data: fix iva flags for proper sl2if setup
Miguel Vadillo [Thu, 16 Feb 2012 01:53:34 +0000 (19:53 -0600)]
ARM: omap5: hwmod_data: fix iva flags for proper sl2if setup

SL2IF is a module within the IVAHD domain, and has no reset
lines of its own. The hwmod setup initialization for SL2IF
requires that the IVA domain be enabled. The HWMOD_INIT_NO_RESET
flag on the iva hwmod keeps the IVA in reset and disabled,
causing the SL2IF to be stuck in transition.

The HWMOD_INIT_NO_IDLE flags are removed from all the IVA
hwmod structures, as when combined with the INIT_NO_RESET
would leave them in an improper hwmod state machine.

The above problems and fixed with the changes made, and also
help in achieving low power states for the device.

Signed-off-by: Miguel Vadillo <vadillo@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoARM: omap5: hwmod: remove INIT_NO_IDLE flag for iss
Miguel Vadillo [Wed, 15 Feb 2012 06:06:22 +0000 (00:06 -0600)]
ARM: omap5: hwmod: remove INIT_NO_IDLE flag for iss

The HWMOD_INIT_NO_IDLE flag has been removed from the ISS
hwmod data. With this flag set, the ISS device is being
enabled and is never idled after the _setup step during
hwmod initialization.

This is not idled until the time ISS has been used and go
through a enable/disable sequence. This causes the chip not
to achieve a low power state after bootup.

Signed-off-by: Miguel Vadillo <vadillo@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap4: hwmod_data: add clock names to iva sequencers
Chandra Sekhar.Anagani [Fri, 17 Feb 2012 05:07:37 +0000 (23:07 -0600)]
omap4: hwmod_data: add clock names to iva sequencers

The IVA sequencer hwmod data for OMAP4 is missing clock names.
This may cause an improper hwmod setup, and would miss out on
the proper reference counting of the modules using the IVA
clock. This has been corrected.

Signed-off-by: Chandra Sekhar.Anagani <chandu@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap4: hwmod_data: add missing fields for sl2if
Chandra Sekhar.Anagani [Fri, 17 Feb 2012 05:05:39 +0000 (23:05 -0600)]
omap4: hwmod_data: add missing fields for sl2if

The SL2IF hwmod data for OMAP4 is missing the chip version and
the clock domain name fields. The absence of chip name caused
the hwmod to be ignored altogether during registration, and
the lack of the clock domain caused the hwmod setup to fail,
rendering ipu pretty-much non-functional, and may lead to a
boot failure.

This has been corrected.

Signed-off-by: Chandra Sekhar.Anagani <chandu@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap4: hwmod_data: add missing fields for fdif
Chandra Sekhar.Anagani [Fri, 17 Feb 2012 04:56:44 +0000 (22:56 -0600)]
omap4: hwmod_data: add missing fields for fdif

The FDIF hwmod data for OMAP4 is missing the chip version and
the clock domain name fields. The absence of chip name caused
the hwmod to be ignored altogether during registration, and
the lack of the clock domain caused the hwmod setup to fail,
rendering fdif use-cases non-functional.

This missing data has been added.

Signed-off-by: Chandra Sekhar.Anagani <chandu@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap4: hwmod_data: add missing clock fields for ipu
Chandra Sekhar.Anagani [Fri, 17 Feb 2012 04:18:26 +0000 (22:18 -0600)]
omap4: hwmod_data: add missing clock fields for ipu

IPU is missing the clock names on the individual processor
pseudo-hwmod data and clock domain on the main ipu hwmod.
Adding the clock names help keep the reference count. The
lack of the clock domain causes the hwmod setup to be
incomplete and may lead to a boot failure.

This data has been added.

Signed-off-by: Chandra Sekhar Anagani <chandu@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agorpmsg: omx: build rpmsg_omx even if TILER is not selected
Cris Jansson [Fri, 23 Sep 2011 21:41:41 +0000 (16:41 -0500)]
rpmsg: omx: build rpmsg_omx even if TILER is not selected

The OMX driver does not need TILER for basic messaging. The
call to tiler_virt2phys() is moved behind a check for
CONFIG_TI_TILER to break the dependency.  If TILER is not
included in the kernel then only mappings of
RPC_OMX_MAP_INFO_NONE are allowed. Others would return an
error back to userspace.

Signed-off-by: Cris Jansson <cjansson@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agorpmsg: omx: re-work buffer lookup to support contiguous NV12
Subramaniam C.A [Thu, 19 Jan 2012 02:24:35 +0000 (20:24 -0600)]
rpmsg: omx: re-work buffer lookup to support contiguous NV12

SGX544 requires Y and UV to be contiguous in SGX virtual address space. This
is done by using single FD for two ion handles.

Change-Id: I33ced876905d74e6293a2c32df0612f01a23d13f
Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
5 years agorpmsg: omx: add return values to the pa to da convert function
Subramaniam C.A [Wed, 18 Jan 2012 23:45:48 +0000 (17:45 -0600)]
rpmsg: omx: add return values to the pa to da convert function

This patch adds return values to the pa to da conversion function.
This will help in propagation of proper error codes to the calling
functions.

Change-Id: Ie547f7b7e7c51eff4b7998cbd336a61663995708
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agorpmsg: resmgr: add support for OMAP5 auxclk requests
Suman Anna [Wed, 25 Jan 2012 12:24:01 +0000 (13:24 +0100)]
rpmsg: resmgr: add support for OMAP5 auxclk requests

All aux clocks are derived from CORE or PER dpll post divider(m3x2).
However on OMAP5, there are additional OPT clock controls between the
DPLL post divider and the leaf aux clock. This OPT clock control nodes
merely support enabling or disabling the corresponding clock output.
The aux clock requests in rpmsg resmgr have been adapted to request a
desired rate for a aux clock by accounting for this additional OPT
clock control node.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agorpmsg: resmgr: enable camera regulators for omap5
Suman Anna [Tue, 17 Jan 2012 18:55:53 +0000 (19:55 +0100)]
rpmsg: resmgr: enable camera regulators for omap5

Camera requires an additional regulator on OMAP5. Added
the support for requesting this new regulator through rpmsg
resource manager.

The bound check for the regulator id has also been made
robust.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap5: evm: add support for camera regulators
Suman Anna [Tue, 17 Jan 2012 13:42:56 +0000 (14:42 +0100)]
omap5: evm: add support for camera regulators

Add support for cam2pwr and cam2csi regulators to enable
camera functionality on the OMAP5 SEVM board.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoARM: omap5: clockdomain: set iss clk domain to SWSUP
Subramaniam C.A [Wed, 4 Jan 2012 21:54:25 +0000 (15:54 -0600)]
ARM: omap5: clockdomain: set iss clk domain to SWSUP

This patch sets the cam/iss clock domain from HW_AUTO to just
SW_SUP. This patch is based on a similar patch done for OMAP4,

"ARM: OMAP: clockdomain: set iss clk domain to just SWSUP"

This is done because CAM domain has no module wake-up dependency
with any other clock domain of the device and the dynamic
dependency from L3_main_2 is always disabled, the domain needs
to be in force wakeup in order to be able to be used or accessed
for configuration.

Also since there is no clock in the domain managed automatically
by the hardware, so there is no need to configure automatic
clock domain transition. SW should keep the SW_WKUP domain
transition as long as a module in the domain is required to
be functional.

Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap5: hwmod: add softreset delay field
Cris Jansson [Tue, 27 Sep 2011 22:03:52 +0000 (17:03 -0500)]
omap5: hwmod: add softreset delay field

This patch accompanies the omap4 softreset delay patch to include omap5.

See "omap: hwmod: add softreset delay field".

Signed-off-by: Cris Jansson <cjansson@ti.com>
5 years agoARM: omap5: hwmod: correct iva hwmod data
Subramaniam C.A [Thu, 2 Feb 2012 02:44:40 +0000 (03:44 +0100)]
ARM: omap5: hwmod: correct iva hwmod data

Corrected the iva hwmod data to have separate hwmod devices
to deal with multiple processors with associated reset
lines.

The iva sequencers do not need a dedicated sysconfig. Hence,
a separate hwmod class is defined for them.

Signed-off-by: Cris Jansson <cjansson@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoARM: omap5: hwmod: correct and enable iss
Subramaniam C.A [Thu, 2 Feb 2012 02:41:39 +0000 (03:41 +0100)]
ARM: omap5: hwmod: correct and enable iss

Corrected the iss hwmod data, and enabled it.

Signed-off-by: Cris Jansson <cjansson@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoARM: omap5: hwmod: correct ipu hwmod data
Subramaniam C.A [Thu, 2 Feb 2012 02:33:25 +0000 (03:33 +0100)]
ARM: omap5: hwmod: correct ipu hwmod data

Corrected the ipu hwmod data to have the correct
ipu address space, and separate hwmod devices
to deal with multiple processors with associated
reset lines.

Signed-off-by: Cris Jansson <cjansson@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoARM: omap5: hwmod: add sl2if hwmod data
Subramaniam C.A [Thu, 2 Feb 2012 02:16:52 +0000 (03:16 +0100)]
ARM: omap5: hwmod: add sl2if hwmod data

Added hwmod data for sl2if.

Signed-off-by: Cris Jansson <cjansson@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoARM: omap5: hwmod: add fdif hwmod data
Subramaniam C.A [Thu, 2 Feb 2012 02:00:45 +0000 (03:00 +0100)]
ARM: omap5: hwmod: add fdif hwmod data

Added hwmod data for fdif.

Signed-off-by: Cris Jansson <cjansson@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap5: clkdata: added clock data for ipu, iva, iss and sl2if
Subramaniam C.A [Wed, 4 Jan 2012 22:04:59 +0000 (16:04 -0600)]
omap5: clkdata: added clock data for ipu, iva, iss and sl2if

This patch adds clock data for ipu, iva, iss and sl2if
Also corrected fdif clock data.

Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
5 years agoremoteproc: wait until udev and FS are up before loading firmware
Fernando Guzman Lugo [Wed, 7 Dec 2011 08:30:56 +0000 (02:30 -0600)]
remoteproc: wait until udev and FS are up before loading firmware

Calling request_firmware_nowait is just adding a little delay
before requesting the firwmare. Sometimes, it is not enough for
udev or FS to be ready, causing an issue loading ducati firmware.
Now, we make sure udev is up before requesting the firmware and
also retrying when request_firmware returns -ENOENT.

NOTE: This fixes the issue when the kernel boots but there is not
userspace yet (as when charging the phone). As soon as there is
userspace the remoteproc firmware will be requested.

Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
Signed-off-by: Hervé Fache <h-fache@ti.com>
5 years agoomap5: configs: zero out remoteproc dynamic carveout
Cris Jansson [Tue, 27 Sep 2011 19:32:17 +0000 (14:32 -0500)]
omap5: configs: zero out remoteproc dynamic carveout

The ducati text and ipc sections have switched to use the
static carveout, and so there is no need to set-aside the
dynamic carveout memory (IPU - 7MB memory)

Signed-off-by: Cris Jansson <cjansson@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap5: board: reserve memory for Ducati in board file
Hervé Fache [Mon, 29 Aug 2011 12:54:00 +0000 (14:54 +0200)]
omap5: board: reserve memory for Ducati in board file

This patch includes memory carveout changes based off
the original change made for omap4.

Signed-off-by: Hervé Fache <h-fache@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Cris Jansson <cjansson@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
5 years agoomap5: rproc: build rproc misc driver only if rproc is being built
Subramaniam C.A [Thu, 29 Dec 2011 23:30:58 +0000 (17:30 -0600)]
omap5: rproc: build rproc misc driver only if rproc is being built

Else a minimal build (without remoteproc) ends up with build error:
arch/arm/plat-omap/built-in.o: In function `rproc_user_release':
arch/arm/plat-omap/rproc_user.c:63: undefined reference to `rproc_set_secure'
arch/arm/plat-omap/built-in.o: In function `rproc_user_write':
arch/arm/plat-omap/rproc_user.c:123: undefined reference to `rproc_set_secure'
arch/arm/plat-omap/rproc_user.c:114: undefined reference to `rproc_set_secure'

This patch is an extension of the original patch done for omap4

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
5 years agoomap5: rpmsg: added build support for rproc and rpmsg
Cris Jansson [Fri, 27 May 2011 21:31:10 +0000 (16:31 -0500)]
omap5: rpmsg: added build support for rproc and rpmsg

Signed-off-by: Cris Jansson <cjansson@ti.com>
5 years agoomap: mailbox: add support for OMAP5
Subramaniam C.A [Thu, 2 Feb 2012 00:36:56 +0000 (01:36 +0100)]
omap: mailbox: add support for OMAP5

Mailbox in OMAP5 functions the same way as in OMAP4.
Added the necessary macros and compiler options to
add support for OMAP5.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Cris Jansson <cjansson@ti.com>
5 years agoomap: remoteproc: add support for OMAP5
Cris Jansson [Thu, 2 Feb 2012 00:32:11 +0000 (01:32 +0100)]
omap: remoteproc: add support for OMAP5

Added CONFIG_ARCH_OMAP5 and cpu_is_omap54xx() checks
along side those for OMAP4, to enable OMAP5.

Signed-off-by: Cris Jansson <cjansson@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap: iommu: add support for OMAP5
Cris Jansson [Thu, 2 Feb 2012 00:25:24 +0000 (01:25 +0100)]
omap: iommu: add support for OMAP5

Added the necessary macros and compiler options to
add support for OMAP5

Signed-off-by: Cris Jansson <cjansson@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agohwspinlock: added support for omap5
Subramaniam C.A [Wed, 26 Oct 2011 18:18:00 +0000 (13:18 -0500)]
hwspinlock: added support for omap5

Need to enable hwspinlock for omap5. Hence enabled the
dependency for hwspinlock on ARCH_OMAP5.

Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agorpmsg: resmgr: make regulator support conditional
Cris Jansson [Thu, 6 Oct 2011 17:14:59 +0000 (12:14 -0500)]
rpmsg: resmgr: make regulator support conditional

This patch makes regulator support in the resource manager
conditional.  Regulator requests are placed behind a check for
CONFIG_REGULATOR and not compiled if it is not defined.
The list of resource types is not changed in either case to
avoid breaking the API on remote processors.

Signed-off-by: Cris Jansson <cjansson@ti.com>
5 years agorpmsg: resmgr: account for positive return values for constraints
Subramaniam C.A [Wed, 26 Oct 2011 22:20:47 +0000 (17:20 -0500)]
rpmsg: resmgr: account for positive return values for constraints

The per device request returns 1 in case the constraint value is
changed for a new update request. A non-zero return value is
interpreted as an error on the ipu side. Also, it would cause the
constraints to be immediately released, or does not update the
debugfs entries properly. This patch avoids the scenario, and always
returns 0 to ipu if a constraint request is successful.

Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap: rpres: Convert to per-device PM-QOS API
Cris Jansson [Tue, 18 Oct 2011 19:41:55 +0000 (14:41 -0500)]
omap: rpres: Convert to per-device PM-QOS API

Remote Processor RESources is updated to use the new per-device
latency API of PM-QOS.

Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Cris Jansson <cjansson@ti.com>
5 years agoomap: remoteproc: Convert to per-device PM-QOS API
Cris Jansson [Tue, 18 Oct 2011 19:17:56 +0000 (14:17 -0500)]
omap: remoteproc: Convert to per-device PM-QOS API

Remoteproc is updated to use the new per-device latency API of
PM-QOS.

Signed-off-by: Cris Jansson <cjansson@ti.com>
5 years agoomap: iommu: Convert to per-device PM-QOS API
Cris Jansson [Tue, 18 Oct 2011 16:46:23 +0000 (11:46 -0500)]
omap: iommu: Convert to per-device PM-QOS API

IOMMU is updated to use the new per-device latency API of
PM-QOS.

Signed-off-by: Cris Jansson <cjansson@ti.com>
5 years agoomap: mailbox: Convert to per-device PM-QOS API
Cris Jansson [Tue, 18 Oct 2011 15:42:47 +0000 (10:42 -0500)]
omap: mailbox: Convert to per-device PM-QOS API

Mailbox is updated to use the new per-device latency API of
PM-QOS.  Constraints are now placed on each mailbox device
independently.

Signed-off-by: Cris Jansson <cjansson@ti.com>
5 years agoomap: remoteproc: add a notification for loading error
Miguel Vadillo [Tue, 18 Oct 2011 00:19:17 +0000 (19:19 -0500)]
omap: remoteproc: add a notification for loading error

When calling rproc_get for the first time, the loading of
the remoteproc image will be requested using a non-blocking
request_firmware_no_wait, and the caller can continue before
the actual loading is complete.

The loader later can return an error due to a non-existing
or wrong image and there should be a way to notify about this
to users having a rproc handle.

This functionality is added and is leveraged by rpmsg to
release some resources it had already acquired since requesting
a firmware load.

Change-Id: I1d3523efbcfd613bca74d363084791ceaaaa9989
Signed-off-by: Miguel Vadillo <vadillo@ti.com>
5 years agorpmsg: resmgr: disable aux_clk_src in case of error
Miguel Vadillo [Fri, 27 Jan 2012 01:39:59 +0000 (19:39 -0600)]
rpmsg: resmgr: disable aux_clk_src in case of error

If set_rate of aux_clk failed aux_clk_src was being left
enabled affecting the core OFF, fix the same.

Also avoid changing the return value of clk_set_rate.

Change-Id: I897d0669b43bf75ae49e9119ebfadf531bd585d5
Reported-by: Huzefa Kankroliwala <huzefank@ti.com>
Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Miguel Vadillo <vadillo@ti.com>
5 years agoomap: rpmsg: unmap vring memory address
Juan Gutierrez [Mon, 16 Jan 2012 22:01:55 +0000 (16:01 -0600)]
omap: rpmsg: unmap vring memory address

iounmap of the vring memory address was missing during
the deletion stage of the rpmsg-virtqueues causing
a memory leak.

This patch is to fix the memory leak observed during recovery
The signature after around 22745 iterations was:

vmap allocation for size 266240 failed: use vmalloc=<size> to increase size

Change-Id: I208c908e064e3c9cc56e6c21736725836eb2d74d
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
5 years agoomap: rpmsg: sleep while recovering from mbox null situation
Juan Gutierrez [Thu, 8 Dec 2011 20:56:17 +0000 (14:56 -0600)]
omap: rpmsg: sleep while recovering from mbox null situation

Mbox null situation, due to the auto-suspend path happening at the
same time a new message is trying to be sent, was workarounded by
trying to wake up Ducati in a loop. However the loop was not giving
the chance for the suspending path to completes. So, Ducati was never
wake it up again since it is necesary to be in suspended state.

This patch adds an sleep that gives a chance for the suspending path
to completes before trying to wake Ducati up again.

Change-Id: Ic6ecffc40f6651aef482d49da93086445fd391e2
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agorpmsg: resmgr: succeed if pm_runtime_get_sync() returns 1, not only 0
Peter Malkin [Thu, 17 Nov 2011 02:03:24 +0000 (20:03 -0600)]
rpmsg: resmgr: succeed if pm_runtime_get_sync() returns 1, not only 0

If pm_runtime_get_sync() returns 1 is also a success case

Change-Id: I45809aa7d7a830822d98a88579892cdd9818d7e1
Signed-off-by: Peter Malkin <petermalkin@google.com>
Signed-off-by: Vince Kim <vince.kim@ti.com>
5 years agoremoteproc: protect runtime expiration time and last busy
Fernando Guzman Lugo [Tue, 15 Nov 2011 21:27:27 +0000 (15:27 -0600)]
remoteproc: protect runtime expiration time and last busy

In order to avoid a race condition between calling
pm_runtime_mark_last_busy and checking the expiration time using
pm_runtime_autosuspend_expiration, protect both calls using a mutex.
By doing that we can do a safe check inside the runtime suspend
callback for expiration time to detect a possible call to
pm_runtime_mark_last_busy during runtime suspend execution and in that
case abort autosuspend.

Change-Id: I4608c78aefccf9c89866f9dc1ed24055d88c5546
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
5 years agoomap: rpmsg: add mutex to protect mbox handle
Fernando Guzman Lugo [Tue, 15 Nov 2011 22:13:21 +0000 (16:13 -0600)]
omap: rpmsg: add mutex to protect mbox handle

Temporary patch to avoid NULL dereference of the mbox pointer.
Adding a mutex in order to protect the omap_mbox_send function againts
an omap_mbox_put which is done on suspend callback.

Change-Id: I609ac1c2baabbbb8886e621a95a05f5726d329d2
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
5 years agoremoteproc: protect with a mutext runtime expiration time and last busy
Fernando Guzman Lugo [Tue, 15 Nov 2011 21:27:27 +0000 (15:27 -0600)]
remoteproc: protect with a mutext runtime expiration time and last busy

In order to avoid a race condition between calling
pm_runtime_mark_last_busy and checking the expiration time using
pm_runtime_autosuspend_expiration, protect both calls using a mutex.
By doing that we can do a safe check inside the runtime suspend callback
for expiration time to detect a possible call to pm_runtime_mark_last_busy
during runtime suspend execution and in that case abort autosuspend.

Change-Id: I22ca83ed41d137fa878c4daff03cf4ad0f3e11cf
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
5 years agoomap: remoteproc: null pointer checks in trace function
Chandra Sekhar.Anagani [Sat, 12 Nov 2011 01:22:03 +0000 (19:22 -0600)]
omap: remoteproc: null pointer checks in trace function

This patch introduces NULL pointer checks and size validation
before processing the trace buffer.

The debugfs entries for the traces buffers are not valid if the
remoteproc is stopped. A cat on the trace buffer causes a kernel
panic. This patch checks the buffer pointers passed to avoid the
panic.

Change-Id: Idfeffa0d25130351ca0908080e0662a78318ac9a
Signed-off-by: Chandra Sekhar.Anagani <chandu@ti.com>
Signed-off-by: Miguel Vadillo <vadillo@ti.com>
5 years agoomap: rproc: build rproc misc driver only if rproc is being built
Nishanth Menon [Mon, 31 Oct 2011 20:30:16 +0000 (15:30 -0500)]
omap: rproc: build rproc misc driver only if rproc is being built

Else a minimal build (without remoteproc) ends up with build error:
arch/arm/plat-omap/built-in.o: In function `rproc_user_release':
arch/arm/plat-omap/rproc_user.c:63: undefined reference to `rproc_set_secure'
arch/arm/plat-omap/built-in.o: In function `rproc_user_write':
arch/arm/plat-omap/rproc_user.c:123: undefined reference to `rproc_set_secure'
arch/arm/plat-omap/rproc_user.c:114: undefined reference to `rproc_set_secure'

Change-Id: I1851b9864d5dfd08debe30963f597fe654034f6d
Signed-off-by: Nishanth Menon <nm@ti.com>
5 years agoomap: mailbox: check iomem resource before dereferencing it
Fernando Guzman Lugo [Thu, 3 Nov 2011 20:16:11 +0000 (15:16 -0500)]
omap: mailbox: check iomem resource before dereferencing it

Add a NULL check for iomem resource in mailbox probe functions

Change-Id: Ib277fbe5a69a0070416b9b8c6d0f7094da0a8bda
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoomap: iommu: fix non-void return value in function returning void
Suman Anna [Tue, 11 Oct 2011 17:55:29 +0000 (12:55 -0500)]
omap: iommu: fix non-void return value in function returning void

Fix the following compiler warning introduced in the patch:
ecabdc3 - omap: iommu: do not allow core to lower state while in use

arch/arm/plat-omap/iommu.c: In function 'iommu_put':
arch/arm/plat-omap/iommu.c:906: warning: 'return' with a value, in function returning void

Change-Id: Ia62ad7646524dac1c9edc4fbfa8e0b41dfb1bb11
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap: mailbox: wait for reset completion
Suman Anna [Wed, 19 Oct 2011 18:35:07 +0000 (13:35 -0500)]
omap: mailbox: wait for reset completion

mailbox is being reset during every startup, so wait for
the reset completion confirmation before proceeding
with the context restore or interrupt programming.

Change-Id: I47a5a240f1180100232278f2a6be6125605170d2
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc: end gracefully in case of a error in rproc_start
Fernando Guzman Lugo [Wed, 19 Oct 2011 04:29:15 +0000 (23:29 -0500)]
remoteproc: end gracefully in case of a error in rproc_start

Add error path in rproc_start function in order to clean things up in
case of a error inside rproc_start.

Change-Id: Ie8094e68d91ce91ac8cfd88e44057a80e7372459
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoremoteproc: Add version debugfs
Juan Gutierrez [Mon, 17 Oct 2011 23:07:27 +0000 (18:07 -0500)]
remoteproc: Add version debugfs

Reading the version debugfs file dumps the core0, core1 and
sysbios-rpmsg identifier version of the proper firmware binary

Change-Id: I1dca032d56fb26333499342662d25aa3b9257a6e
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agoomap: mailbox: reset mailbox every startup.
Fernando Guzman Lugo [Tue, 18 Oct 2011 20:09:12 +0000 (15:09 -0500)]
omap: mailbox: reset mailbox every startup.

That way old messages does not affect to the new user.

Change-Id: If0640570924818f3b7a9fe321abdc6086a20aa54
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoomap: remoteproc: wake up remoteproc clkdm when accessing iommu
Fernando Guzman Lugo [Tue, 18 Oct 2011 19:59:34 +0000 (14:59 -0500)]
omap: remoteproc: wake up remoteproc clkdm when accessing iommu

iommu is part of the domain of each remoteproc; in order to access it
to configure it or release it the domain needs to be up specially when
the remoteproc is not running cause hw could detect not activity and turn
the clkdm off. Call clkdm_wakeup to access the registers and then
clkdm_allow_idle to dont affect pm.

Change-Id: Icf0a37e8968d0d0d84c9f984fac2a06ea6b7a5c0
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoremoteproc: create new event to notify when secure mode is enable or disable
Fernando Guzman Lugo [Fri, 7 Oct 2011 20:46:39 +0000 (15:46 -0500)]
remoteproc: create new event to notify when secure mode is enable or disable

Adding new event for security notifications.

Change-Id: Ib35a5c06377a24e34374b881f1b43bc9672a167b
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agorpmsg: suppress rpmsg name service hex dumps
Suman Anna [Fri, 7 Oct 2011 21:19:57 +0000 (16:19 -0500)]
rpmsg: suppress rpmsg name service hex dumps

Change-Id: I2e9a31f54490dc511f146cbeb3307a1eba34637e
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc: add mutex protection for secure requests
Fernando Guzman Lugo [Mon, 17 Oct 2011 21:00:24 +0000 (16:00 -0500)]
remoteproc: add mutex protection for secure requests

secure_* flags cannot change during the secure request, so that
we need to protect them until the secure request has finished.

Change-Id: I69a9dd26e762c8c38571963f72b48b5f12bfec79
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoremoteproc: add protection for crash function
Fernando Guzman Lugo [Sat, 1 Oct 2011 00:30:12 +0000 (19:30 -0500)]
remoteproc: add protection for crash function

Crash function access to buffer which can be mapped in rproc_put
function. In order to avoid a possible race condition this part
need to be protected and check for valid buffer before dereference
them.

Change-Id: I9f68c05c61c7959b272402b32e7557245d7e4428
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoomap: rpmsg: adapt to the rproc_event_register changes
Fernando Guzman Lugo [Fri, 30 Sep 2011 02:02:45 +0000 (21:02 -0500)]
omap: rpmsg: adapt to the rproc_event_register changes

Adapting omap rpmsg to the changes on the rproc_event_* api
changes.

Change-Id: I52abd83a4a15e2865774e40603ab694c261c9c1d
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoremoteproc: combine all the block notify head structures into one
Fernando Guzman Lugo [Fri, 30 Sep 2011 01:54:50 +0000 (20:54 -0500)]
remoteproc: combine all the block notify head structures into one

Previously there was 1 block notify head per each type of event
that remoteproc could generate. That also causes that the users
need one block notify per each event they register for. Now,
everything is combined into one notify block head, with this change
users will register a callback function which will receive all
type of remoteproc events, so it is responsibility of the users to
check for the events they really want.

Change-Id: I206b85536429310a593f5aac6175c110022fb1ff
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoomap: rpmsg: serialize reset of devices per rproc instead of channel
Fernando Guzman Lugo [Mon, 17 Oct 2011 02:00:39 +0000 (21:00 -0500)]
omap: rpmsg: serialize reset of devices per rproc instead of channel

Reset was previously being done per channel, now there is a master channel
which will reset all the channels. That allows a complete serialization of the
reset process. Also, if a new reset request is done when a previous reset is
still in process, wait until previous reset is done.

Change-Id: Id5329ce409b5437d6d51b35acfd18d6f2c2efb15
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoomap: mailbox: call request_irq after mbox queues are allocated
Fernando Guzman Lugo [Mon, 17 Oct 2011 12:51:44 +0000 (07:51 -0500)]
omap: mailbox: call request_irq after mbox queues are allocated

Calling request_irq first could provoke that ISR function is executed
before the mbox queues are allocated causing a kernel panic when they are
dereference inside the ISR.

Change-Id: I5af9b1fc7bb17170e43e177109dd06e0dc950387
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoomap: rpmsg: unmap vring buffers after release mailbox
Fernando Guzman Lugo [Sat, 15 Oct 2011 09:21:05 +0000 (04:21 -0500)]
omap: rpmsg: unmap vring buffers after release mailbox

If the buffer is unmapped first there could be a message send from
the remoteproc and a kick (mailbox message) in that case the host will
access to the vring region in order to read the message but that region
is already unmaped. Now, the order is:

omap_mbox_put
rproc_put
iounmap

Which is the right order to do it.

Change-Id: Ifad91199fbdfdcd9228698ca2e32a005380e4802
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoomap: rproc: user: add multiple user support for rproc user driver
Fernando Guzman Lugo [Thu, 13 Oct 2011 08:08:52 +0000 (03:08 -0500)]
omap: rproc: user: add multiple user support for rproc user driver

Now, multiple users can request to enter secure mode, and once we
enter secure mode it will be exited only after all the users request
to exit secure mode.

An additional check is also added in the release function to exit
secure mode (or decrease ref counter) if the particular user has
requested to enter secure mode.

Change-Id: I809cc33b61d6aae0255424575ac91807480dc7df
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap_remotproc: implement method dump_registers
Iliyan Malchev [Fri, 14 Oct 2011 01:20:36 +0000 (18:20 -0700)]
omap_remotproc: implement method dump_registers

Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agoremoteproc: introduce rproc method dump_registers
Iliyan Malchev [Fri, 14 Oct 2011 01:15:49 +0000 (18:15 -0700)]
remoteproc: introduce rproc method dump_registers

This patch introduces method dump_registers() in rproc_ops and replaces the
default function dump_remoteproc_regs() with one implemented by each remoteproc
(if defined.)  Function dump_remoteproc_regs() called __show_regs(), which
attemps to print the registers given to it as if they belong to local SMPs
and further attempts to dump memory around the addresses pointed by some of
them.  This is incorrect, as the memory in question does not necessarily even
belong to the local SMPs.

Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agoomap: remoteproc: update suspend flag address
Fernando Guzman Lugo [Wed, 28 Sep 2011 01:42:21 +0000 (20:42 -0500)]
omap: remoteproc: update suspend flag address

PM_DATA region in Ducati side was moved, so the physical address
of the suspend flag was also changed and needs to be updated.

Change-Id: I5b608401770ee055bf427bb7dde4cfffa2ed0441
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoomap: rpmsg: remove call to rproc_last_busy from mbox callback
Fernando Guzman Lugo [Tue, 4 Oct 2011 21:42:30 +0000 (16:42 -0500)]
omap: rpmsg: remove call to rproc_last_busy from mbox callback

Now, the mbox handle is freed in case of a remoteproc suspend.
Therefore, we cannot call rproc_last_busy inside the rpmsg mbox
callback because rproc_last_busy can call pm_runtime resume
for the remoteproc device, but if there is a pm_runtime already
running, the resume call will wait until the suspend finishes.
However, in the rproc suspend callback function, it sends suspend
notification to omap rpmsg, which releasing the mbox, but the
omap_mbox_put functions then calls blocking_notifier_chain_unregister
and inside this function it tries to get a semaphore, but that
semaphore is already held by the mbox framework (calling
blocking_notifier_call_chain) creating a deadlock.

Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoremoteproc: move remoteproc register dump before error notification
Fernando Guzman Lugo [Sat, 1 Oct 2011 19:38:08 +0000 (14:38 -0500)]
remoteproc: move remoteproc register dump before error notification

Error notification has to be the last thing when an error happens.

Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoremoteproc: make rproc_set_secure a blocking call
Suman Anna [Thu, 11 Aug 2011 05:22:38 +0000 (00:22 -0500)]
remoteproc: make rproc_set_secure a blocking call

rproc_set_secure call is now made into a blocking call.
It will be blocked till the cleanup is complete and a
restart is being attempted.

THe function will return the status based on whether the
intended operation (secure reload or normal reload) has
succeeded. Note that this doesn't return the status of
the rpmsg channels creation.

Change-Id: Ia0a02d261ba67f06235cd6bd5826a47319592956
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap4: add a new misc driver for setting secure mode
Suman Anna [Thu, 11 Aug 2011 03:22:35 +0000 (22:22 -0500)]
omap4: add a new misc driver for setting secure mode

A small minimal driver, rproc_user, is added and provides interfaces
to the user-space to be able to start/stop the secure mode. This
driver currently supports setting the mode only on IPU.

The user is expected to set back the processor into normal mode if
the secure mode fails.

Change-Id: I84f4b0c6cad38ce1dd4f4125271d7b012ba6002c
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap: remoteproc: enable setting iommu ttb
Suman Anna [Fri, 5 Aug 2011 02:29:19 +0000 (21:29 -0500)]
omap: remoteproc: enable setting iommu ttb

Adapt the omap remoteproc to set the proper mode and required data
in iommu drivers based on its secure state mode. This information
will be used by the iommu driver for its init, and block any
API that might tend program the L2MMU at runtime.

Change-Id: Ibe080bcab6047f4d6b7ce27589fb6eaf31cc3a69
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap: iommu: add support for secure mode
Suman Anna [Sat, 6 Aug 2011 17:17:13 +0000 (12:17 -0500)]
omap: iommu: add support for secure mode

The iommu module has been enhanced to provide the support for starting
a remote processor in a mode suitable for running secure applications.

An API, iommu_set_secure, is provided to set the iommu in a secure
mode or the regular mode. This API needs to be called before enabling
the iommu. In this mode, all iommu operations to program a PTE entry
or TLB entry are blocked. The TTB is configured to a pre-determined
L1 table which is firewalled, and the sanity of TTB is continuously
checked in the secure code.

Change-Id: I2bbd5279e8793575a78dce7a8dc6e7ed985056f9
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc: support loading iommu and secure fw sections
Suman Anna [Thu, 4 Aug 2011 05:56:42 +0000 (00:56 -0500)]
remoteproc: support loading iommu and secure fw sections

iommu and secure fw sections are part of the signed binary,
and are loaded into memory only when the secure flag is
set. Otherwise, there is no difference in the firmware
loading process.

Change-Id: I189eba2b88c71ca1f7fe5575867ff4f187dcd556
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc: add infrastructure for requesting secure load/unload
Suman Anna [Fri, 5 Aug 2011 00:18:35 +0000 (19:18 -0500)]
remoteproc: add infrastructure for requesting secure load/unload

The remoteproc loading and starting infrastructure has been enhanced
to support both secure loading and regular loading in the same
flow.

An API, rproc_set_secure, is provided to request the remote processor
to be shutdown and restarted in either a secure mode or the regular
normal mode. This API would need to be called by the secure driver
whenever starting or stopping a secure application.

The API will always cause a reload of the remote processor while
transitioning between secure and regular boot in both directions.
The reload mechanism works very much in the same way as a MMU
fault or any other fatal error on the remote processor.

Change-Id: Iffa73111567457d58c14b7a13c5f405ece0541d5
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap: mbox: save, restore and off support
Miguel Vadillo [Mon, 12 Sep 2011 21:32:33 +0000 (16:32 -0500)]
omap: mbox: save, restore and off support

- Fix an issue related with the offsets of the registers
- Each user (Ducati, Tesla ...) should not have its own ctx
memory since the mbox module is one for all of them. A share
ctx is created to store the needed registers when saving.
- save_context function is saving just the irqs per user
currently that is the only thing needed.
- restore_context function is restoring just the irqs per user.
mbox_startup function is setting all the rest of the register
to the original state.
- Add a pm_qos constraint when calling the first get and release
it when the last put is calling, this is to support off mode.

Change-Id: I90cd5a8baa2c6343b6f3701a6accf14d5fcc3cf9
Signed-off-by: Miguel Vadillo <vadillo@ti.com>
5 years agodrivers: hwspinlock: use mutex instead of spinlock
Christina Warren [Wed, 10 Aug 2011 21:55:24 +0000 (16:55 -0500)]
drivers: hwspinlock: use mutex instead of spinlock

We cannot call functions which sleep when we hold a
software spinlock. To avoid the warnings, we use a
mutex instead. The mutex is initialized when we
register the hwspinlock.

Change-Id: Ifa331eb431552b29e1e6aafbb5a3469018909e9c
Signed-off-by: Christina Warren <cawarren@ti.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
5 years agohwspinlock/core: use a mutex to protect the radix tree
Juan Gutierrez [Fri, 16 Sep 2011 19:16:46 +0000 (14:16 -0500)]
hwspinlock/core: use a mutex to protect the radix tree

Since we're using non-atomic radix tree allocations, we
should be protecting the tree using a mutex and not a
spinlock.

Non-atomic allocations and process context locking is good enough,
as the tree is manipulated only when locks are registered/
unregistered/requested/freed.

The locks themselves are still protected by spinlocks of course,
and mutexes are not involved in the locking/unlocking paths.

Change-Id: Id904d21294ed46fbe5c088fd985a8cb59c80d93e
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
5 years agorpmsg: clean up error codes
Cris Jansson [Tue, 4 Oct 2011 19:17:01 +0000 (14:17 -0500)]
rpmsg: clean up error codes

Do not return -EFAULT to user space for non copy_to/from_user errors.
This patch adds the remainder of the clean up from Iliyan Malchev's
original patch.

Signed-off-by: Cris Jansson <cjansson@ti.com>
5 years agorpres: dev: put ivahd under reset after it is released
Fernando Guzman Lugo [Tue, 27 Sep 2011 01:23:09 +0000 (20:23 -0500)]
rpres: dev: put ivahd under reset after it is released

Sometimes the remote processor crashes leaving the ivahd with
pending transitions then the rpres module put it into idle but
the ivahd cannot go to idle and ended up in transition state.

Since the ivahd does not have softreset call omap_device_shutdown
instead of omap_device_idle, that way it is put under hardreset
and it is functional when other request is done since the interrupts
are cleared.

Change-Id: I2211bb7d37931b6c795fda0fbab664061b2616d0
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoremoteproc: update hard-coded core file attributes
Iliyan Malchev [Mon, 26 Sep 2011 20:19:09 +0000 (13:19 -0700)]
remoteproc: update hard-coded core file attributes

TODO:  This needs to be extracted from the actual target, or be encoded in the
       board file.

Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agoomap: rpmsg: unregister events in omap_rpmsg_del_vqs function
Fernando Guzman Lugo [Fri, 23 Sep 2011 23:32:25 +0000 (18:32 -0500)]
omap: rpmsg: unregister events in omap_rpmsg_del_vqs function

There is event registration for RPROC_POS_SUSPEND and RPROC_RESUME,
but it is missing the unregistration for those events. This patch
is fixing that.

Change-Id: I0a7f6a936bd06697203dd3a533530bf66007c5d6
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoremoteproc: enable halt-on-crash for core dumps
Iliyan Malchev [Fri, 16 Sep 2011 00:04:16 +0000 (17:04 -0700)]
remoteproc: enable halt-on-crash for core dumps

This patch allows you to cause the respecive remoteproc instance to halt when
crashing by writing the string "enable" to the core file:

echo enable > /<debugfs>/remoteproc/<remoteproc>/core.

After this, if the remoteproc crashes, you can extract the core by reading the
same file.  You can then resume crash recovery by writing "continue" to the
file.  The halt-on-crash will remain enabled, so that subsequent crashes can be
analyzed by pulling the core file again.  Writing "disable" will turn off
halt-on-crash so that crash recovery happens immediately. (This means copying
of trace{0,1} to trace{0,1}_last, and resetting the remoteproc.)

Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agoremoteproc: add halt_on_crash flag
Iliyan Malchev [Fri, 23 Sep 2011 18:08:32 +0000 (11:08 -0700)]
remoteproc: add halt_on_crash flag

Add a flag to struct rproc that tells us whether to pause crash recovery (when
true), or to recover from the crash immediately (when false--the default),
usually by resetting the remoteproc.

Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agoremoteproc: add register dump to core file
Iliyan Malchev [Mon, 19 Sep 2011 06:16:29 +0000 (23:16 -0700)]
remoteproc: add register dump to core file

Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agoremoteproc: initial support for remote processor core dumps
Iliyan Malchev [Wed, 14 Sep 2011 06:24:41 +0000 (23:24 -0700)]
remoteproc: initial support for remote processor core dumps

This patch exports a core dump file at e.g. /d/remoteproc/omap-rproc.1/core.
The core can be pulled at any time and analyzed using gdb.  At this state, the
patch allows you to inspect all global variables.  You can walk the heaps
manually, inspect global objects, etc.  You cannot yet analyze the current
state of the processor, as we do not save the current registers.  This will be
addressed with subsequent patches.

The ARM EABI is EF_ARM_EABI_VER2.  This is what's emitted by TI's ARM toolchain.

TODO:

-- Need to implement a notes section and set the register state
-- ELF type is ELFOSABI_NONE.  This is probably OK, but need to verify.
-- The Ducati does not report read/write/execute flags to the A9.
-- We rely on the resource-request type of RSC_CARVEOUT to count a Ducati
   section as part of the core dump.  However, the ION carveout is reported
   this way, and we do not want to include it.  We filter it out based on its
   physical address.

Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agoremoteproc: make logs world-readable
Iliyan Malchev [Mon, 19 Sep 2011 23:37:16 +0000 (16:37 -0700)]
remoteproc: make logs world-readable

Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agoremoteproc: fix spelling of rproc_errror_notify
Iliyan Malchev [Thu, 15 Sep 2011 23:40:13 +0000 (16:40 -0700)]
remoteproc: fix spelling of rproc_errror_notify

Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agoremoteproc: remove debugfs entries on error during resource setup
Iliyan Malchev [Fri, 16 Sep 2011 00:11:37 +0000 (17:11 -0700)]
remoteproc: remove debugfs entries on error during resource setup

If rproc_handle_resources() detects an error, we remove the debugfs entries.
Otherwise you can crash the kernel by trying to access one of the files.

Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agoremoteproc: add crash-dump buffer
Shahid Akhtar [Thu, 18 Aug 2011 18:10:33 +0000 (13:10 -0500)]
remoteproc: add crash-dump buffer

The crash-dump buffer is used for saving context of
remote cores in case of exceptions or other crashes.

Change-Id: Idbe93b61963f36ecee47752065f550a27f09f0b3
Signed-off-by: Shahid Akhtar <sakhtar@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap4: remoteproc: free wdt interrupt when remoteproc is stopped
Fernando Guzman Lugo [Tue, 13 Sep 2011 20:10:34 +0000 (15:10 -0500)]
omap4: remoteproc: free wdt interrupt when remoteproc is stopped

When we stop the remoteproc the ISR for the WDT interrupt must be
freed too.

Change-Id: I366d54dbf0ef4b39fbd5949b8637a0c737f2b0c0
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoremoteproc: fix section-size check
Iliyan Malchev [Wed, 14 Sep 2011 06:06:29 +0000 (23:06 -0700)]
remoteproc: fix section-size check

Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agoomap4: remoteproc: call rproc mailbox put/get upon activate/deactivate
Gilles-Arnaud Bleu-Laine [Mon, 12 Sep 2011 22:07:00 +0000 (17:07 -0500)]
omap4: remoteproc: call rproc mailbox put/get upon activate/deactivate

Once the remote proc is deactivated, it is safe to drop the mailbox.
The mailbox is restarted upon activation.

Change-Id: I3e18144dc5e1ff3bd56cc6879711956caf981dab
Signed-off-by: Gilles-Arnaud Bleu-Laine <gilles@ti.com>
5 years agoomap4: rpmsg: restart rpmsg mailbox upon suspend/resume notifications
Gilles-Arnaud Bleu-Laine [Mon, 12 Sep 2011 22:05:46 +0000 (17:05 -0500)]
omap4: rpmsg: restart rpmsg mailbox upon suspend/resume notifications

Register for remote proc post_suspend and resume notifications.
Once the remote proc is suspended, it is safe to drop the mailbox.
The mailbox is restarted upon resume notification.

Change-Id: Ie82dd057e332f4d271299cef2ebecba8ac8fb665
Signed-off-by: Gilles-Arnaud Bleu-Laine <gilles@ti.com>
5 years agoomap: rpmsg: reset rpmsg devices after fatal error
Fernando Guzman Lugo [Mon, 18 Jul 2011 22:11:03 +0000 (17:11 -0500)]
omap: rpmsg: reset rpmsg devices after fatal error

Reseting the rpmsg devices after a fatal error will reset the
remote processor, and a new channels will be created, causing
a recovery of the error. Keep in mind that the remote processor
is reset and the code is executed from the beginning.

Change-Id: I2457a93fc0f99ec6e906610d4857c72f9db0c5f4
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
5 years agoOMAP4: SDP/Panda: increase ION 1D carveout by 60MB
Subramaniam C.A [Wed, 28 Dec 2011 23:51:45 +0000 (17:51 -0600)]
OMAP4: SDP/Panda: increase ION 1D carveout by 60MB

The ION 1D carveout is increased by 60MB to a total of 90MB to
accomodate additional use-cases such as video editor, thumbnails
etc.

Change-Id: I5c0ece40961de43303b14ebc0dd3255c88e1f5c8
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoomap: iommu: do not allow core to lower state while in use
Miguel Vadillo [Fri, 9 Sep 2011 22:40:03 +0000 (17:40 -0500)]
omap: iommu: do not allow core to lower state while in use

Once the iommu is enabled and configured since its part of the core the domain
can go to idle and iommu can lose the configuration. Use pm_qos to put a
constraint in core.

Also, prevernt unbalanced iommu_put() calls from turning the refcount negative.

Signed-off-by: Miguel Vadillo <vadillo@ti.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
5 years agorpmsg: Change the address used by rpmsg for suspend
Sarthak Aggarwal [Thu, 8 Sep 2011 03:37:19 +0000 (09:07 +0530)]
rpmsg: Change the address used by rpmsg for suspend

Change it according to the new carveout locations.

Signed-off-by: Sarthak Aggarwal <sarthak@ti.com>
5 years agorpmsg: Change ION carveout start address in rpmsg driver
Sarthak Aggarwal [Thu, 8 Sep 2011 03:34:12 +0000 (09:04 +0530)]
rpmsg: Change ION carveout start address in rpmsg driver

Signed-off-by: Sarthak Aggarwal <sarthak@ti.com>
5 years agoomap4: export error notify function for remoteproc
Fernando Guzman Lugo [Fri, 9 Sep 2011 03:13:14 +0000 (20:13 -0700)]
omap4: export error notify function for remoteproc

create rproc_error_notify, so that remoteproc user can use it
to notify about error which remoteproc module does not defect
by itself.

Now omap_rpmsg is calling this function in case of receiving
crash message from remoteproc.

Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>