aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
Commit message (Collapse)AuthorAgeFilesLines
* remoteproc: add mutex protection for tracesMiguel Vadillo2012-04-251-27/+56
| | | | | | | | | | | | | | In rproc_put() the buffers used to read remoteproc's traces were being unmapped without any protection. If at the same time a cat on the traces is done, it may access an unmapped buffer leading to a crash. This patch protects the access and unmapping of dump/trace buffers with a mutex. It also fixes some checkpatch issues in the trace functions. Change-Id: I0a6f52e9df691bc1d4ff894febb9a20819b4b7c3 Signed-off-by: Miguel Vadillo <vadillo@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* remoteproc: protect runtime expiration time and last busyFernando Guzman Lugo2011-11-211-16/+25
| | | | | | | | | | | | | | 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>
* omap: remoteproc: null pointer checks in trace functionChandra Sekhar.Anagani2011-11-161-0/+7
| | | | | | | | | | | | | | 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>
* Revert "omap4: remoteproc: wake up clkdm in activate() to access iommu"Iliyan Malchev2011-10-211-12/+10
| | | | This reverts commit dc8f85b6b2e637752829caa706f769e53eb9ef73.
* omap4: remoteproc: wake up clkdm in activate() to access iommuMiguel Vadillo2011-10-211-10/+12
| | | | | | | | | | iommu is part of the domain of each remoteproc; wake the domain in activate function as well. This change was missed in: 61a044d436aa1891d08010d027cc3d13ab2cbf0f Change-Id: Ibe4fcfd9664796b7f60ff4f6d122b4af078de627 Signed-off-by: Miguel Vadillo <vadillo@ti.com>
* remoteproc: disable autosuspend when enter secure modeFernando Guzman Lugo2011-10-211-2/+5
| | | | | | | | | Secure module reads iommu register in order to avoid modification by malicious code. For that reason iommu can not be turned off during secure play back. Change-Id: I2457f538c2f227dca5e6f44c817e4d0faf147e88 Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
* remoteproc: end gracefully in case of a error in rproc_startFernando Guzman Lugo2011-10-191-4/+15
| | | | | | | | 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>
* remoteproc: Add version debugfsJuan Gutierrez2011-10-181-1/+34
| | | | | | | | | 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>
* omap: remoteproc: wake up remoteproc clkdm when accessing iommuFernando Guzman Lugo2011-10-181-0/+18
| | | | | | | | | | | 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>
* remoteproc: create new event to notify when secure mode is enable or disableFernando Guzman Lugo2011-10-171-1/+1
| | | | | | | Adding new event for security notifications. Change-Id: Ib35a5c06377a24e34374b881f1b43bc9672a167b Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
* remoteproc: add mutex protection for secure requestsFernando Guzman Lugo2011-10-171-2/+11
| | | | | | | | 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>
* remoteproc: add protection for crash functionFernando Guzman Lugo2011-10-172-34/+28
| | | | | | | | | | 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>
* remoteproc: combine all the block notify head structures into oneFernando Guzman Lugo2011-10-171-67/+12
| | | | | | | | | | | | | 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>
* omap_remotproc: implement method dump_registersIliyan Malchev2011-10-131-0/+39
| | | | Signed-off-by: Iliyan Malchev <malchev@google.com>
* remoteproc: introduce rproc method dump_registersIliyan Malchev2011-10-131-10/+3
| | | | | | | | | | | | 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>
* remoteproc: move remoteproc register dump before error notificationFernando Guzman Lugo2011-10-061-5/+5
| | | | | | Error notification has to be the last thing when an error happens. Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
* remoteproc: make rproc_set_secure a blocking callSuman Anna2011-10-061-5/+21
| | | | | | | | | | | | | | 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>
* omap: remoteproc: enable setting iommu ttbSuman Anna2011-10-061-6/+22
| | | | | | | | | | 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>
* remoteproc: support loading iommu and secure fw sectionsSuman Anna2011-10-061-15/+26
| | | | | | | | | | 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>
* remoteproc: add infrastructure for requesting secure load/unloadSuman Anna2011-10-061-0/+32
| | | | | | | | | | | | | | | | | | | 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>
* rpres: dev: put ivahd under reset after it is releasedFernando Guzman Lugo2011-09-271-1/+1
| | | | | | | | | | | | | | 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>
* remoteproc: update hard-coded core file attributesIliyan Malchev2011-09-261-12/+7
| | | | | | | 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>
* remoteproc: enable halt-on-crash for core dumpsIliyan Malchev2011-09-231-2/+59
| | | | | | | | | | | | | | | | 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>
* remoteproc: add halt_on_crash flagIliyan Malchev2011-09-231-6/+22
| | | | | | | | 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>
* remoteproc: add register dump to core fileIliyan Malchev2011-09-231-35/+82
| | | | Signed-off-by: Iliyan Malchev <malchev@google.com>
* remoteproc: initial support for remote processor core dumpsIliyan Malchev2011-09-232-0/+295
| | | | | | | | | | | | | | | | | | | | | | | 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>
* remoteproc: make logs world-readableIliyan Malchev2011-09-191-1/+1
| | | | Signed-off-by: Iliyan Malchev <malchev@google.com>
* remoteproc: fix spelling of rproc_errror_notifyIliyan Malchev2011-09-191-2/+2
| | | | Signed-off-by: Iliyan Malchev <malchev@google.com>
* remoteproc: remove debugfs entries on error during resource setupIliyan Malchev2011-09-191-1/+5
| | | | | | | 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>
* remoteproc: add crash-dump bufferShahid Akhtar2011-09-191-1/+64
| | | | | | | | | 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>
* omap4: remoteproc: free wdt interrupt when remoteproc is stoppedFernando Guzman Lugo2011-09-141-0/+5
| | | | | | | | 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>
* remoteproc: fix section-size checkIliyan Malchev2011-09-131-7/+3
| | | | Signed-off-by: Iliyan Malchev <malchev@google.com>
* omap4: remoteproc: call rproc mailbox put/get upon activate/deactivateGilles-Arnaud Bleu-Laine2011-09-131-0/+8
| | | | | | | | 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>
* omap4: export error notify function for remoteprocFernando Guzman Lugo2011-09-091-0/+6
| | | | | | | | | | | 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>
* OMAP: remoteproc: watchdog timer for remote coresShahid Akhtar2011-09-093-5/+95
| | | | | | | | | | Using GP timers as watchdog for M3 cores. The timers are used by both host and M3 cores. The remote cores kick (restart) timer when they reach idle. Change-Id: I8441c78a2c174589d99c7242ffe26694c206e052 Signed-off-by: Shahid Akhtar <sakhtar@ti.com> Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
* drivers: remoteproc: save last traces in sysfs in case of crashMiguel Vadillo2011-09-091-20/+58
| | | | | | | | | | | When an error is detected copy the last trace buffer content of each core to an entry in sysfs, this is to provide a way to see the last ducati traces after a crash. After a recovery the last buffer traces can be cat'ed reading trace0_last and trace1_last. Signed-off-by: Miguel Vadillo <vadillo@ti.com>
* drivers: remoteproc: print traces in a circular wayMiguel Vadillo2011-09-061-6/+36
| | | | | | | | | | | | | | Previosly the traces were printed always from the beginning of the buffer trace till the end causing confusions when trying to identify the last one. Now remoteproc is writing a write_idx and read_idx at the end of the trace buffer to keep track of the traces in the buffer. We read the indices and and print from the read idx to the end and from the beginning of the trace buffer to the write idx. With this we will see the traces in order from the oldest to the newest ones. Signed-off-by: Miguel Vadillo <vadillo@ti.com>
* omap: remoteproc: force clkdm wakeup while enabling procMiguel Vadillo2011-08-301-0/+19
| | | | | | | | | | | | | | | | | | | Some remote processors in omap need the clkdm associated with it to be in force wakeup while their requisite module clocks are being enabled. Once the module clocks are enabled and the processor(s) are taken out of reset, the clock state transition control mode may be changed to HW_AUTO which allows sleep transitions to be managed automatically by the hardware, according to the processor and slave component states. Call clkdm_wakeup and clkdm_allow_idle respectively to ensure above behaviour. Change-Id: I6aa5146fed23713edca3772ad84e4be9db6f31fd Signed-off-by: Miguel Vadillo <vadillo@ti.com> Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
* omap: remoteproc: request a timer(s) for remoteproc usageMiguel Vadillo2011-08-301-14/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | The usage of an external timer for some purposes is a good way to low the power consumption of the remote processor and allow it to go to a lower state. Some processors use their internal timers as ticks, this looks like the right thing to do but this behaviour might not allow it to go to a lower state since the internal timer is running. Provide a way to request a timer(s) to be used by the remoteproc whenever it is enabled and disable them when the remoteproc is disabled. Also for the case of Ducati request gptimer 3/4 to be used as ticks and set the source Ducati is expecting. Note: if those gptimers are already in use by the time Ducati is loaded it will not load. This same mechanism to request a timer(s) can be used for watchdog or any other purpose. Change-Id: I79f89b62fd246f3937cba3eb835c0669ab12897a Signed-off-by: Miguel Vadillo <vadillo@ti.com>
* remoteproc: fix an off-by-one error in static-pool range checkSuman Anna2011-08-111-1/+1
| | | | | | | | | The comparison for checking the range of a carveout section against the remoteproc's static pool is incorrect, and has been fixed. Change-Id: I027c9ea89eb73fa783754ffb1a993663daefa32a Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* omap: rpres: reset device before shutdownFernando Guzman Lugo2011-08-051-1/+12
| | | | | | | | | | | rpres module manages devices that can be used by remote processors. There are some cases where the remote processor crashes and there are interruptions or any other pending actions that avoid clock going off or gated and keep the clock domain in transition state. So avoid those cases by reseting the devices which have softreset before shutdown. Change-Id: If260c621f2669805afc85485679c717fb3f628a0 Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
* remoteproc: block rproc_get after a crashFernando Guzman Lugo2011-08-051-0/+15
| | | | | | | | | | block calls to rproc_get when a crash until all the users have called to rproc_put, which releases the remote processor completely and a reset is made. That way we make sure new rproc_get starts with a clean remote processor initialization. Change-Id: Ie9be54480b2313128b86480bc6420bd946b75776 Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
* remoteproc: reset the memory pool and memory mapsSuman Anna2011-08-031-1/+17
| | | | | | | | | | | | | Reloading of the Ducati binary either during recovery or during modules reinstall requires that the prior memory pool and maps information be reset, to avoid running into out of pool memory and duplicate memory entry storage failures. These are reset therefore when the processor is being stopped. Change-Id: If9923eecf99863c5b529a96efc20481fe32ca549 Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* remoteproc: return -EIO instead of -EFAULT from fault ISRIliyan Malchev2011-08-021-2/+2
| | | | Signed-off-by: Iliyan Malchev <malchev@google.com>
* remoteproc: fix tracing with the new memory map changesSuman Anna2011-08-021-19/+41
| | | | | | | | | | | The remote processor tracing is non-functional with the new memory map changes, due to incorrect physical address. The rproc_da_to_pa information is not available until all the RSC_DEVMEM and RSC_CARVEOUT resources are handled, and as such the trace buffers cannot be setup until the very end. Change-Id: I728345b5ed138a0b6ab492d3724a2fa4eeab3a0b Signed-off-by: Suman Anna <s-anna@ti.com>
* omap: remoteproc: support reading memory maps from firmwareSuman Anna2011-07-281-1/+1
| | | | | | | | Remove support for static memory maps. Rely on the firmware specifying its own layout. Change-Id: I5b62a934ad9606aa1a4d3f776c1e8b2c5d3d4f2c Signed-off-by: Suman Anna <s-anna@ti.com>
* remoteproc: support reading memory maps from firmwareSuman Anna2011-07-281-32/+126
| | | | | | | | | | | | | | | | | | | | | | | | The remoteproc module has been adapted to load the remote processor completely based on the memory map from the firmware image. The following are the main changes: - pass a new memory pool in the platform data, replacing the previous memory maps, so that the firmware loading can use the pool data while processing the different image sections. - the new firmware image is expected to have the firmware section as the first section, so that the memory map data can be retrieved. - the resource table firmware section processing handles the allocation of memory for memory regions without physical addresses. The sections with pre-defined static addresses are also authenticated against the static pool range. - the previous memory maps data is completely removed from the platform data, but rather is localized now to remoteproc driver; the memory map is published during the resource table firmware section processing. Change-Id: I5b62a934ad9606aa1a4d3f776c1e8b2c5d3d4f2c Signed-off-by: Suman Anna <s-anna@ti.com>
* omap: remoteproc: allow loading of new resource_table with memmapG Anthony2011-07-281-8/+21
| | | | | | | | | | | | | | | | | | Updated the fw_resource types and structures to match the new BIOS-side resource table that includes the device memory map. The BIOS version stamp has been updated to reflect the new fw_resource structure, and an appropriate check has been added to detect mismatched versions. A new resource type, RSC_CARVEOUT is added to indicate the memory region is represented by a contiguous memory block. The RSC_SERVICE has been removed since the services are dynamically published, and there is no user for this resource. Change-Id: I28520baffaeb3aa76f9a7de4a7d16286157b08cd Signed-off-by: G Anthony <a0783926@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
* OMAP4: PM: do omap_device_idle() for IVAHDGirish S Ghongdemath2011-07-211-1/+1
| | | | | | | | | | | | | | | | IVAHD doesn't transit to RET when suspend attempted during CAM usecase. When Calling on to *_shutdown messes up the IVA reset sequence. Letting remoteproc to do only device_idle. The observation is: - After the Video playback IVA reset sequence is properly done and IVA transit to RET as expected during suspend. - After CAM usecase, IVA doesn't seem to transit RET. Suspect is the assertion reset lines in shutdown messing up the h/w transition. However, this might need a REVISIT to see the ducati side reset sequence applied for Video Vs Cam usecase is the same. Change-Id: Id2021e4c1e41e358d0fcbdcff07bb80b08395b65 Signed-off-by: Girish S G <girishsg@it.com>
* OMAP4: PM: do omap_device_idle for ISS and fdifGirish S Ghongdemath2011-07-211-2/+2
| | | | | | | | | | | | | | | | | omap_device_shutdown should be called only when module is getting unloaded. Else there can be a chance when standby is getting asserted and forceidle is applied on the module causing interface to lock up on next access. ISS hang: device_shutdown was setting forceidle, this was unconditionally putting the interface to idle. The recommended setting is to call for device_idle which will set smartstdby/smartidle. This makes sure that all the submodules of ISS asserts Mstadby and once ISS acks back interface will be safe to idle. Do omap_device_idle for fdif as well. Change-Id: I94fee16ccc66c60de8c6060745aa1f92c0045dbc Signed-off-by: Girish S G <girishsg@ti.com>