Commit Graph

16 Commits

Author SHA1 Message Date
Jeevan Shriram
04664d5d69
drivers: soc: spss_utils: Handle error return from copy_to_user
Handle error return value from copy_to_user() in ioctls to avoid
following compilation failure.

"error: ignoring return value of function declared with 'warn_unused_result'
 attribute".

Change-Id: I92944ade7fb88e0543ca4254fab226da5777def7
Signed-off-by: Jeevan Shriram <quic_jshriram@quicinc.com>
2024-05-18 18:07:43 +00:00
Santosh Dronamraju
a2c83dbd48 soc: qcom: spss_utils: Add support for legacy SPSS
The spss-util driver provides utilities required for the Secure
Processor Subsystem (SPSS). It provides the fuse state for key
selection and the SPSS HW version.
Legacy spss not support load spss by UEFI and also not support
CMAC/IAR feature.

Change-Id: Iea0d66ed66a2817850f99f74bf716d33db956812
Signed-off-by: Santosh Dronamraju <sdronamr@codeaurora.org>
2021-03-02 20:12:15 -08:00
Amir Samuelov
9872707b31 soc: qcom: spss_utils: fix SPU SSR during IAR-sw-update
Fix buffer overflow on memcpy().
memcpy size of u32 on bool variable.
memcpy() to "is_ssr_disabled" overwrites "is_iar_active" to zero.

Change-Id: If7b9ca9149feb54a37fbb0eef7300fa8021d4e54
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2020-10-12 10:13:52 +03:00
Amir Samuelov
e0e663e321 soc: qcom: spss_utils: fix IAR-DB-Recovery
Read calculated cmacs on SUBSYS_AFTER_POWERUP event.
Allow user space to get the calc cmac regardless of ioctl.

Change-Id: I91d87c657a2217f467d3630e0dce41c98497d8bd
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2020-10-07 09:38:44 -07:00
Amir Samuelov
f19ffc2867 soc: qcom: spss_utils: IAR 3rd party uefi app
Set saved cmac on ioctl from user space.
Write saved cmac to shared memory on SSR.
Read calculated cmac from shared memory.
Provide calculated cmac to user space via sysfs.
Cleanup unused IAR-STATE fuses.
Cleanup unused IAR-FEATURE-ENABLED fuse.
Read actual PIL area size from register.
pbl_cmac_show() returns binary rather than string.
Change IOCTL to use variable-size-array.

Change-Id: Ic4ea38685f6b9d1100a28bd958e44f513373fea9
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2020-09-18 04:46:02 -07:00
Konstantin Dorfman
8005d59933 soc: qcom: add disable/enable SPSS SSR ioctl()
During SPSS firmware update by fota, SPSS SSR causes cryptographic erase
of Secure Processor user data. To mitigate this, instead of related
SSR, platform reboot requested during fota update. In the end of fota
update, SPSS SSR re-enabled.

This change adds ioctl() to update internal driver configuration
(functionally disable or enable SSR).

Change-Id: I1d8362b4691e1a335f7f1f29bc2358d3f9b1cb21
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Nurit Lichtenstein <nuritl@codeaurora.org>
2020-09-05 23:24:43 -07:00
Konstantin Dorfman
e63f3e7c16 soc: qcom: spss_utils: fix driver module remove
.remove need to remove apps_cmac attribute.

Change-Id: Ic636ee707e831d67059841f1d59cc00e9149ce8c
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2020-05-24 12:22:22 -07:00
Amir Samuelov
a50479ab2e soc: qcom: spss_utils: protect from event signaled twice
avoid event signaled twice.
add ioctl to check if event was signaled.

Change-Id: Ie75b9db86f2badddc08d65eee30ecd6a15795256
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2020-05-12 12:43:25 +03:00
Amir Samuelov
09c2045118 soc: qcom: spss_utils: add spss events support
Add IOCTL for wait/signal spss events.

Change-Id: Ia8ad37a1632de21e6ae4e70013ca72b4b35c68ba
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2020-05-11 03:00:06 -07:00
qctecmdr
114be2591f Merge "soc: qcom: spss_utils: Modify memory unmapping scheme for cmac_mem" 2020-04-26 19:14:56 -07:00
Nurit Lichtenstein
5571c4ad86 soc: qcom: spss_utils: Modify memory unmapping
scheme for cmac_mem

IAR maps cmac_mem once and assumes it is mapped
from this moment onward. Therefore, move the
the call to iounmap(cmac_mem) to the remove() function.

Change-Id: I5afa3de900e4766520c106882e2485d6c335c54d
Signed-off-by: Nurit Lichtenstein <nuritl@codeaurora.org>
2020-04-25 21:43:32 +03:00
Nurit Lichtenstein
3a7b9a6034 soc: qcom: spss_utils: Port IAR spss_utils code to Lahaina
Integrate IAR spss_utils code to Lahaina. this is a manual
integration of 06ef7b7b.

Change-Id: Ib3e6665de625e696643b055cfcde022e65b5cee7
Signed-off-by: Nurit Lichtenstein <nuritl@codeaurora.org>
2020-04-25 21:40:26 +03:00
Konstantin Dorfman
39778e8bb7 soc: qcom: Add module dependence for spss_utils
The spss_utils driver has a functional dependence on subsys-pil-tz module.
When subsys-pil-tz module not yet registered into PIL framework, need to
defer spss_utils probe.

Also redundant input parameters sanity checks are removed.

Change-Id: I48a934b0477d5d781c041243cc8b28dacd343375
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2020-01-16 21:22:35 +02:00
Konstantin Dorfman
f25439f0d9 soc: qcom: spss_utils: fix emulation logic for lahaina rumi
This change updates bits for testing on emulation platform.
Also, the change fixes spss_utils probe dependency on subsys-pil-tz.

Change-Id: I6924f73b3b69d3d4d57c989a1f8fd2217a2553ef
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2019-11-25 16:29:14 +02:00
Konstantin Dorfman
78200d8ba0 soc: qcom: spss_utils: add spss_utils as DLKM for GKI
This change converts statically compiled platform driver into kernel
module.

Change-Id: Iee2c47dd895931f6c8f1982bc34b868287b994f6
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2019-10-28 14:39:26 +02:00
Konstantin Dorfman
d50cfdc312 soc: qcom: add secure processor subsystem (spss) utils driver
The spss-util driver provides utilities required for the Secure
Processor Subsystem (SPSS). It provides the fuse state for key selection
and the SPSS HW version.

Add snapshot for spss-util driver from msm-4.19 commit a7793b40172f
("soc: qcom: spss_utils: fix spss SSR when IAR not active").

Change-Id: I6531cae56cec9d062fa03c573bcd70207d10f1a2
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2019-10-28 13:29:59 +02:00