Commit graph

20 commits

Author SHA1 Message Date
Gustavo Solaira
093a4dcddf esoc: Use standard reset time for mdm9x55 atomic reset
The atomic reset command uses mdelay so it should use
the standard reset time of 203ms otherwise the system
can get locked for many seconds.

Change-Id: I476efac0a2244101f0f5e4d046582c5746dbead6
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
2018-04-17 21:47:45 -07:00
Gustavo Solaira
ee837fb633 esoc: Only force power off if the graceful shutdown fails
Force power off should only be used in case the graceful
shutdown fails otherwise the esoc will be resetted even
when not needed.

Change-Id: I2180e36a10bb325e55a8782554c71165fa7a6bee
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
2018-04-17 21:47:44 -07:00
Gustavo Solaira
a026858db0 esoc: Convert timeout for reset and shutdown to device tree option
Convert the timeout and shutdown intervals to be read from
the device tree and set default values in case no option is
provided.

Change-Id: I90efb5910ddf1667db5cde79f46a4a94da1668ec
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
2017-12-05 21:28:06 -08:00
Gustavo Solaira
821ffbefa0 esoc: Bring mdm9x55 in sync with mdm9x45 functionality
Some options available for mdm9x45 esocs were missing from
the mdm9x55 setup hardware function. Add those to bring them
in sync. The way a power down is performed on mdm9x55 is also
changed to be similar to mdm9x45.

Change-Id: I14b0e77d08cb319581cfd02304eba8351c378306
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
2017-11-21 23:11:13 -08:00
Arun KS
51a7468ba0 esoc: Fix irq unbalance wake disable warning
Power management irq wakeup mode is by default disabled.
Calling irq_set_irq_wake() on a disabled irq causes warning.
Remove irq_set_irq_wake() function from mdm_enable/disable_irqs
functions and set it once in probe.

Change-Id: Ib7f49ae101e6dc04790649d408c1722df8da8bd2
Signed-off-by: Arun KS <arunks@codeaurora.org>
2017-07-23 21:39:04 -07:00
Arun KS
383f0f89d0 esoc: mdm-4x: Separate out callback function for 9x45
Reset and power off timing is different. Hence need a
separate callback function.

Change-Id: I9714a4449b1fbeab84017da4be17f5ca2cb6cab6
Signed-off-by: Arun KS <arunks@codeaurora.org>
2017-05-02 10:10:38 +05:30
Arun KS
e704eb5275 esoc: Add provision to handle shutdown request in userspace
In certain scenarios, modem shutdown requests are handled in
userspace. Enhance request engine of esoc driver to send
shutdown requests to userspace.

Also, during a shutdown, avoid setting status to 0, if line is
not a power source. There can be multiple mdms monitoring status
line. This can otherwise be misinterpreted as an unexpected reset
by other mdms.

Change-Id: I9c20a86e76f892cc61dbfb814202b26e5cce3e96
Signed-off-by: Arun KS <arunks@codeaurora.org>
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
2017-05-02 10:10:37 +05:30
Arun KS
b1da6f2225 esoc: Update SSR driver with crash status
During an unexpected reset or error fatal, update the
crash status to SSR. This is important for the drivers
listening at SSR related kernel notifier calls, where
crash status is also passed as a data payload.

Change-Id: Ide0634d0139a84b5988fa87e709877f3028029ef
Signed-off-by: Arun KS <arunks@codeaurora.org>
2017-05-02 10:10:36 +05:30
Arun KS
6a88558416 esoc: mdm-4x: Add support for mdm9x45 and apq8096
Add mdm_ops for mdm9x45 and apq8064.

Change-Id: Iea167175b9bd35a515d15a72897947a889093c03
Signed-off-by: Arun KS <arunks@codeaurora.org>
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
2017-04-30 19:10:38 +05:30
Arun KS
fe1cc57aaf esoc: Add support for autoboot
Some of the external SoC are flash based and can boot independently.
Extend esoc driver to support such auto boot esocs.

This patch also adds support for primary esoc. Primary esoc are
esoc that control secondary esoc such as modems. Primary esoc have
control over reset/poweroff of secondary esoc. Secondary esoc don't
have control over reset/poweroff of primary esoc. In general modems
are considered as secondary esoc while apps processor is considered
as primary esoc.

Change-Id: Id02417fcd122ac108cf75d3381ee7955f0f8f783
Signed-off-by: Arun KS <arunks@codeaurora.org>
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
2017-04-30 19:08:54 +05:30
Arun KS
5c846e4f7c esoc: Add err_fatal signal status to clink_ops
Auto_boot esoc devices can boot and crash before
esoc driver comes up. But there is no way for the
user space code to know that it has crashed by looking
at status line alone. Hence, create a new ioctl entry
to export status of err_fatal line to user space.

Change-Id: Ie7d6115c749d4c63f06aefca29ba457d38eccc7f
Signed-off-by: Arun KS <arunks@codeaurora.org>
2017-04-30 11:21:18 +05:30
Arun KS
98bc7be821 esoc: Fix integration with SSR driver
SSR driver expects subsystem descriptor device type to be
struct platform_device, whereas esoc driver is passing a
struct device instead. This results in a NULL pointer crash
during platform_get_irq in subsystem_restart.c. Fix esoc
driver to pass platform_device.

Change-Id: I93d02623cb7ac14ea3171c3792a4c52c73a74dea
Signed-off-by: Arun KS <arunks@codeaurora.org>
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
2017-04-30 11:04:28 +05:30
Mohammed Khajapasha
cd52d68bef esoc: remove reduntant return_esoc_udev() fn call
Remove reduntant return_esoc_udev() function call
while deleting a esoc device from an esoc clink.

Change-Id: Id2e812addb1bd8af0e23c4182427adbee9731a58
Signed-off-by: Mohammed Khajapasha <mkhaja@codeaurora.org>
2017-04-26 11:19:40 +05:30
Arun KS
2e139766ca esoc: Fix user space corruption due to wrong data type
ESOC IOCTL was designed to transfer data of type unsigned int, but
was pushing data of unsigned long type. Hence causing data corruption
in user space. Fix this by changing put user to use unsigned int.

Change-Id: Ia233eedd76f1ca1ec3036889d6764e568ee975dd
Signed-off-by: Arun KS <arunks@codeaurora.org>
2017-03-29 17:25:35 -07:00
Satya Durga Srinivasu Prabhala
090a6c0e90 esoc: add support for additonal physical link info
Some of the device configurations support multiple external SOCs.
To differentiate physical links, add support for additonal info
about the physical link.

CRs-Fixed: 2024578
Change-Id: If71bf23d798f8bf0b6594a686415fe9b806e4226
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2017-03-24 13:22:26 -07:00
Satya Durga Srinivasu Prabhala
e86e2573c2 esoc: Fix potential NULL pointer dereferences
Update checks to avoid potential NULL pointer dereferences
which are reported in static analysis.

Change-Id: Ibb9db8fb44f9e27da9e531b762dfddd9725c1b4f
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2017-03-15 11:32:10 -07:00
Hanumant Singh
f452381305 esoc: Add check for possible null pointer returns
The call to kasprintf() can fail, with a failure to
allocate memory. Handle the condition appropriately.

CRs-Fixed: 1014400
Change-Id: I83d3a6c8bdfd7a104b88a3bedd50f49faeecd97a
Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>
2017-02-27 12:17:05 -08:00
Hanumant Singh
fcf1fb679f esoc: mdm-dbg: Add a debug request engine for external mdm
Add a stub request engine for debugging external modem.

Change-Id: I6360831f21f83fcd25df72492b1d57b30a7d2197
Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>
Signed-off-by: Bruce Levy <blevy@codeaurora.org>
[satyap@codeaurora.org: fix checkpatch issue]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2017-02-27 12:10:42 -08:00
Hanumant Singh
8134147547 esoc: Add debug engine for external modems.
Modifies the behavior of the command engine
to mask out certain commands/notifications sent to the
external mdm, for the purposes of debugging the external
mdm.

Change-Id: Iff35fd87f6d66849f6ec7d2924e1547400967c4e
Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>
Signed-off-by: Bruce Levy <blevy@codeaurora.org>
2016-03-25 16:03:40 -07:00
Abhimanyu Kapur
5d8ee90e7f esoc: Snapshot esoc drivers
Snapshot esoc components, headers and UAPI headers from
msm-3.18@0922caf50f22e751a05e
(Merge "usb: dwc3-msm: Fix incorrect roles with
multiple instances")

Change-Id: I55e7ea4359c1f5b855f082e66d5816316da2fd48
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2016-03-22 11:16:34 -07:00