Graf commitů

204 Commity

Autor SHA1 Zpráva Datum
Petar Ivanov
6df5f0d8d2 msm: camera: icp: Change frame_found to frm_idx
Resolve possible array out of bounds issue.
Add break in the if for better readibility.

CRs-Fixed: 3298809
Change-Id: I3fb2085df073f4ba0530d3441344cf5b99a83f31
Signed-off-by: Petar Ivanov <quic_pivanov@quicinc.com>
2022-11-18 11:06:08 -08:00
Abhijit Trivedi
7f3c540b78 Catch up diff
Change-Id: Ie11e070d33e9dc83e96f7ae783fcc2e5e0273a40
Signed-off-by: Abhijit Trivedi <quic_abhijitt@quicinc.com>
2022-11-16 14:14:20 -08:00
Sokchetra Eung
df4373f69f msm: camera: icp: Add OFE Kernel Driver
Create OFE HW layer which contains device, soc, and core files.
Device file provides the prob functionality and OFE dev interface
to ICP HW MGR. Core file provides HW related functionalities such
as PC, reset, init/deinit hw, etc. Soc file provides intermediate
functions to utilize camera soc APIs such as DT parsing, Clock
update, etc.

Modify Kbuild to include compilation of the source files. Update
camera main file to invoke ofe init module function during camera
module init. Update camera main header file to allow CRM to match
OFE driver for component bind.

Update OFE HW register addresses such as power status/power ctrl,
reset, irq, etc.

CRs-Fixed: 3266673
Change-Id: I97efe095801b1b42e9de07aeba6f26112cb8f92b
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2022-10-21 16:06:13 -07:00
Karthik Anantha Ram
fe0a275903 msm: camera: icp: Add new HFI property for ram dumps
Add new property to configure FW ram dump level.
It is disabled by default.

CRs-Fixed: 3261717
Change-Id: I58db96929d9887a130ce5d7edb9bb13383a342f8
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2022-10-21 09:06:23 -07:00
Mukund Madhusudan Atre
55f49dc3ab msm: camera: common: Enhance timestamp printing in camera
Add precision to nanosecond part of monotonic timestamps.
Update delimiters between second and nanosecond values.

CRs-Fixed: 3307225
Change-Id: I4e7aab0ea9256c2ff769a87c3873002d715ed3c9
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
2022-10-18 21:36:17 -07:00
Petar Ivanov
c5aa5a71eb msm: camera: icp: Always dump HW Info when requested by LDAR dump
There is a possiblity to enter the function without any currently
active frames to dump. Even though the context info should be dumped.
In this case overwrite frame ts to 0 and dump the HW info.

CRs-Fixed: 3298809
Change-Id: Ide672f0ff8ac3f351fc4be1933bb23afbcf923f2
Signed-off-by: Petar Ivanov <quic_pivanov@quicinc.com>
2022-10-07 16:36:43 -07:00
Sokchetra Eung
c87d8891b9 msm: camera: common: Enhance error injection framework
Update from error injection framework to event injection framework to
support PF event inducement and node event. Different set of user
input parameters are required dependent on which event to injection.

ICP and ISP support error event and page fault event injection. JPEG
supports node event and page fault event injection. However, buf done
error injection is only supported for JPEG and ICP.

Create a query API to check whether PF is fatal for a context bank.
Using the API, if PF is fatal, page fault event injection is not
supported for the device that owns the context bank.

Make change to JPEG context event callback handling to account for
various events including Event Injection event.

CRs-Fixed: 3210139
Change-Id: I582ee0bda8dbf631ece2522a5a8145f38ec71928
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2022-09-29 15:06:49 -07:00
Sokchetra Eung
4e06429fc8 msm: camera: icp: Symbols Renamed to Accommodate for OFE
Rename symbols in ICP driver to accommodate for newly added
OFE driver. Symbols that specifically contain string "ipe_bps"
or "ipebps" are renamed to "dev" or "device" to make the symbol
generic and adaptable to any distinct HW names such as OFE.

CRs-fixed: 3266661
Change-Id: I141342e40d52cbb3c676389a13f1428435054913
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2022-09-29 15:06:41 -07:00
Sokchetra Eung
56cc1d37bc msm: camera: common: Fix invalid packet access
Instead of caching packet address pointer, store packet handle
in page fault req info structutre to obtain packet address through
mem manager to avoid potential access to dangling packet pointer which
resulted from UMD called to free the packet buffer before kernel finishes
handling page fault. If the packet was freed, then querying to get packet
address from memory manager will fail since the mem handle is invalid.
If it is invalid, the page fault handler will return before accessing
the dangling packet.

CRs-Fixed: 3287554
Change-Id: I02bc0c706b64f1dc0d098d8189f2f129a91efba7
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2022-09-19 18:36:54 -07:00
zhuo
a0ca9a026c msm: camera: common: Fix some compile errors
This change fix unannotated fall-through between switch labels error,
also fix unused label error.

CRs-Fixed: 3247171
Change-Id: Ida29c08eed0cebec05b36e0ebac3d55ce8c6a014
Signed-off-by: zhuo <quic_zhuo@quicinc.com>
2022-09-19 18:36:22 -07:00
Li Sha Lim
53b771ccfe msm: camera: icp: Domain-id support for non secure FW loads
For non secure FW loads, ICP domain mask config registers will
not be protected and is accessible from HLOS, so we are to
program these registers with the correct mask values. These
will then be validated with the domain id value passed over
from userland.

CRs-Fixed: 3249982
Change-Id: I1440dde67f6e7a4b58b482d6c3964d19cdb33967
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
2022-07-29 17:06:43 -07:00
Sokchetra Eung
d2a1f0c968 msm: camera: common: memset usage optimization
Remove unnecessary memsets of the structure variables
whose fields are assigned prior to their usage or they
are dynamically allocated with calls that set the memory
to 0. This memset usage optimization is to improve
performance.

CRs-Fixed: 3228092
Change-Id: Iec68c6d072863627959ce603cff28afd26a1c408
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2022-07-26 11:03:32 -07:00
Suraj Dongre
571fc20e57 msm: camera: icp: Fix non-secure fw load
Correct the reg-base check after icp dtsi reorganization.

CRs-Fixed: 3212166
Change-Id: Ia8c3ffcff60dcd84cd2420d5050a07c9fdf848dc
Signed-off-by: Suraj Dongre <quic_sdongre@quicinc.com>
2022-07-15 16:36:28 -07:00
Suraj Dongre
87759427d8 msm: camera: icp: process one icp frame at a time in presil mode
Added check in presil mode to process icp frames one at a time to
avoid shared memmory buffers and hfi queue corruption.

CRs-Fixed: 3212166
Change-Id: I8eeba4cb34fedf0020c39c1fb3aa221dc26fbb71
Signed-off-by: Suraj Dongre <quic_sdongre@quicinc.com>
2022-07-15 16:36:21 -07:00
Sokchetra Eung
0d74d403bc msm: camera: icp: Compute and log FW avg response time per ctx
Compute and log average firmware response time per context to
measure firmware latency.

CRs-Fixed: 3223208
Change-Id: Iaf27a43259fc2a558fdd59165f8afdd4f8e5f6e7
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2022-07-05 20:36:40 -07:00
Sokchetra Eung
a8f7ac604f msm: camera: common: Add logs in wait for completion wrapper
Create a Macro to wrap around wait_for_completion_timeout to
log start and done wait time, and caller's customary error log
if timeout happens.
Modify all wait_for_completion_timeout in ICP hw mgr to use
this wrapper.

CRs-Fixed: 3227018
Change-Id: Ief2c52e69954c653d9cbced8acd823b436bab086
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2022-07-05 20:36:26 -07:00
Mukund Madhusudan Atre
c73578236c msm: camera: common: Add support for bw update blob v3
Add support for bw update version 3. Add provision to
maintain cpas per path bw info internally in drivers.

CRs-Fixed: 3065551
Change-Id: I65e97c6e41f933818f1211bbc27651842e93c028
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
2022-06-09 12:07:17 -07:00
Sokchetra Eung
4e26ffa4b6 msm: camera: icp: Log all active requests on enomem from FW
Upon Enomem error received from FW, log all active request ids
from all active streams to understand the request traffic pattern
to FW.

CRs-Fixed: 3204850
Change-Id: I450049ab7faa0871880b6511e65ffaf15c570e4e
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2022-06-09 12:07:00 -07:00
Karthik Anantha Ram
f00b977871 msm: camera: icp: Update HFI cmdq/msgq size
Increase cmdq/msgq size to 8K. Update HFI read API to
reflect the bump in size.

CRs-Fixed: 3190507
Change-Id: I70f5ded8e6155534cf2fa0fe94d3fdd1a378b5f7
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2022-06-08 13:06:48 -07:00
Sokchetra Eung
b646e60a24 msm: camera: icp: Add unified dev type field in icp ctx struct
Add a unified dev type field in icp hw ctx struct to store unified
dev type value. The unified dev type is for logical usage in kernel.
UMD sent dev type has more variations (IPE/IPE_RT/IPE_SEMI_RT...)
It's used for debugging/printing.

CRs-Fixed: 3204811
Change-Id: Ic6c93fc6238aab7fe56d6beab55f4bcfcd1f81fb
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2022-06-01 18:42:22 -07:00
Chandan Kumar Jha
c29b985223 msm: camera: icp: Change default clock voting level to SVS
Default clock rate is hardcoded to 400 MHZ.
This change will fill svs clock level from dtsi dynamically.

CRs-Fixed: 3189984
Change-Id: I3ef5a0d119bc4ff97f72aa0389e83b540307993d
Signed-off-by: Chandan Kumar Jha <quic_cjha@quicinc.com>
2022-05-19 14:06:26 -07:00
Karthik Anantha Ram
0b86e7f627 msm: camera: cpas: Enable camnoc slave error irq
Enable camnoc slave error irq to identify address decode
errors. Also change the camnoc irq clear logic. The change
also avoids dumping error logger info. Also remove
any error logging in client callbacks for slave error
if the client intends to not handle it.

CRs-Fixed: 3175797
Change-Id: Iec2c0c3b50a52a4c61ce2d5f6f263327625a8267
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2022-05-05 08:36:23 -07:00
Karthik Anantha Ram
04926cb42a msm: camera: icp: Reorganize ICP V2 driver
Add support to handle a variation of ICP V2 for lanai.
IRQ registers have been moved to a different reg space.
Some registers that are currently used for debug  will
not be accessible by HLOS on lanai, remove usage of them.
The change also removes dependency on the reg base order
populated in the DTSI, irrespective of the order the driver
will parse and find the respective base indexes.
The change also adds register specific info per chipset.

CRs-Fixed: 3175809
Change-Id: I70d768a9c196c23f798f4f98a4be53ce12c7175b
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2022-04-26 17:36:55 -07:00
Karthik Anantha Ram
564ff107fd msm: camera: icp: Update BPS register SWI for lanai
Update register offsets for BPS 880.

CRs-Fixed: 3175809
Change-Id: Idd7583a624126b3aea3ca704904002147f59966e
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2022-04-22 22:07:31 -07:00
sokchetra eung
9c730e3b84 msm: camera: icp: Rename A5 and LX7
Rename all instances of a5 and lx7 to icp_v1 and icp_v2
respectively. Remove all mentions of lx7 or a5 in icp_hw_mgr.
Relocate lx7_hw and a5_hw directories to a new directory -
icp_proc which contains a new file to provide related a5 or lx7
interfaces to icp_hw_mgr. Thus, icp_hw_mgr is agnostic to icp proc.
Place common functions and common global constant into icp_proc_common
file. Remove a5/lx7 soc files and create a common soc file for both.
Modify kbuild file to account for directory or file changes.

CRs-Fixed: 3162183
Change-Id: I7e0cfd2a2917f129097a517af3bd39578f85293d
Signed-off-by: sokchetra eung <quic_eung@quicinc.com>
2022-04-15 16:06:57 -07:00
Tejas Prajapati
2827395809 msm: camera: reqmgr: reader writer locks to avoid memory faults
Shared memory is initialized by CRM and used by
other drivers; with CRM not active other drivers
would fail to access the shared memory if
memory manager is deinit. Reader Writer locks can
prevent the open/close/ioctl calls from other drivers
if CRM open/close is already being processed.

Issue observed with the below sequence if drivers
are opened from UMD directly without this change.
CRM Open successful,ICP open successful,
CRM close in progress, ICP open successful,
mem mgr deinit and CRM close successful,
ICP tries to access HFI memory and result in crash.

This change helps to serialze the calls and prevents
issue.

CRs-Fixed: 3019488
Change-Id: I84d50918713686a067c0e3deb64c9c6ae9edfcb5
Signed-off-by: Tejas Prajapati <quic_tpraja@quicinc.com>
2022-04-13 17:06:43 -07:00
Li Sha Lim
2893f25f15 msm: camera: cpas: Add cpas support for camera v880 platform
Add register and qos header for v880.

CRs-Fixed: 3149361
Change-Id: Iff3f5343b950113b8456dfd43dd4218cd5a4f18b
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
2022-04-07 20:37:22 -07:00
sokchetra eung
c52c83e7ce msm: camera: common: Page Fault notification to userspace
Upon Page Fault, smmu driver invokes faulted client's callback
which looks for faulted buffer and context. The client driver
can be ISP, ICP, JPEG, IFE CDM and CPAS CDM. The driver then
fills PF msg struct, logs related info, and notify PF msg to
userspace. Userspace is expected to abort and calls to shut
down kernel drivers. When Titan powers on next session, CAMSS
undergoes async reset.
This change also ensures the page fault related changes added
to TFE, OPE, CRE do not break the drivers compilation.

CRs-Fixed: 3156671
Change-Id: Icd6c8c9a38cac206fe8260d374d03964fb280879
Signed-off-by: sokchetra eung <quic_eung@quicinc.com>
2022-04-07 20:36:52 -07:00
Pranav Sanwal
1220255b08 msm: camera: common: Add camera error injection utility
Add and implement sysfs parameters to inject errors to
camera HW on demand through UMD for IFE,ICP and JPEG.

CRs-Fixed: 3115857
Change-Id: I4376fe31016cd81ad7e6f04cbc55e8ce010a6154
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
2022-03-24 12:36:48 -07:00
zhuo
8f2d538d47 msm: camera: smmu: Fix misunderstanding buffer handle in smmu log
When smmu page fault happen, buffer handle in smmu log
is always not identified due to using the index defined
in smmu. The index is smmu client index, buffer handle
should use the index defined in memory.

CRs-Fixed: 3096436
Change-Id: I69e5014c88ec507e31c6394564fb1990f5ae2d25
Signed-off-by: zhuo <quic_zhuo@quicinc.com>
2022-03-03 17:06:13 -08:00
Suraj Dongre
9a9c865019 msm: camera: common: hfi presil api change for eva
Added client id param to presil hfi apis.

CRs-Fixed: 2932495
Change-Id: Ibd7d97a882e27782de902ee133faaa422a66e4cd
Signed-off-by: Suraj Dongre <quic_sdongre@quicinc.com>
2022-03-03 14:31:39 -08:00
Li Sha Lim
477dbfc187 msm: camera: icp: Fix HFI error logging
This fix addresses the current problem of ICP communicating through HFI
prior to HFI being set up.

CRs-Fixed: 3130279
Change-Id: I306b6dd85eb08b7c5c6f49f9f2aad05a42b394bc
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
2022-03-03 14:27:11 -08:00
sokchetra eung
1a01a14003 msm: camera: common: Report fence causes and ICP fatal errors
Add support to report causes of fence errors for ICP and IFE.
The change also reports ICP critical failures like WD bark
and system error to userspace.

CRs-Fixed: 3035452
Change-Id: I699621ae71e0f8902cb7b9d42203effd2e2e40de
Signed-off-by: sokchetra eung <quic_eung@quicinc.com>
2022-02-18 13:36:36 -08:00
Karthik Anantha Ram
d2767102cc msm: camera: icp: Dump ICP fault/CSR registers on HFI init failure
If HFI init times out, log ICP status and CSR registers.

CRs-Fixed: 3110947
Change-Id: I611c29ee1b48f210f76750e57f38e260278b6812
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2022-02-14 20:07:20 -08:00
Karthik Anantha Ram
1df78bed63 msm: camera: icp: Improve ICP debug infrastructure
On FW timeouts, dump ICP status registers and HFI queue indices.

CRs-Fixed: 3110947
Change-Id: I74561ce943c027e51b6f8b61e7ebb68d2a89982d
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2022-02-11 17:06:24 -08:00
Karthik Jayakumar
28239ed1e6 msm: camera: core: Control expanded memory patching per caller
Force callers to say if they are using 36 bit address patching or not.

CRs-fixed: 3121782
Change-Id: I4dee25e3f73104a1be043fe18a295cd4f8447821
Signed-off-by: Karthik Jayakumar <quic_kjayakum@quicinc.com>
2022-02-03 23:06:09 -08:00
Tejas Prajapati
6f8e74a1b9 msm: camera: icp: protect timer stop with hw mutex
To avoid concurrent access to the device timers while
stopping them, keep the stop call protected with hw
mutex.

CRs-Fixed: 3080397
Change-Id: If0a5226536e3a3c14738811965511225d1a96f08
Signed-off-by: Tejas Prajapati <quic_tpraja@quicinc.com>
2022-02-02 22:36:28 -08:00
Joshua Florez
5ce71f412e msm: camera: icp: LDAR Dump ICP Extension
Extension of Let's do a reset (LDAR) for ICP to include more info.

CRs-Fixed: 3105929
Change-Id: I5fee181d009a8d69e8d3e673a552b289f72fb4aa
Signed-off-by: Joshua Florez <quic_jflorez@quicinc.com>
2022-02-02 22:36:14 -08:00
Pavan Kumar Chilamkurthi
5fafa34efe msm: camera: icp: Add traces for icp
Add acquire, buf_done traces for icp contexts.

CRs-Fixed: 3105126
Change-Id: Ic12640b703ae819915eb3df7dc69b3b39f4f10ac
Signed-off-by: Pavan Kumar Chilamkurthi <quic_pchilamk@quicinc.com>
2022-01-21 19:36:33 -08:00
Anand Ravi
af9072bcc6 msm: camera: icp: Add mechanism to verify IRQ lines
IRQ line verification can now be triggerred from ICP HW manager by
writing to a debugfs file as follows:
    echo 1 > /d/camera/icp/test_irq_line

IRQ line verification can also be done at probe if
CONFIG_CAM_TEST_IRQ_LINE_AT_PROBE is set to true during compilation.
Both debugfs and probe-time verifications are only active if
CONFIG_CAM_TEST_IRQ_LINE is set to true during compilation.

CRs-Fixed: 3071027
Change-Id: I386548d1ed817674be8322c8be792e2c57f9d166
Signed-off-by: Anand Ravi <quic_ananravi@quicinc.com>
2022-01-05 11:50:31 -08:00
Haritha Chintalapati
124c3cf6ed Merge "msm: camera: common: create a common root folder for debugfs" into camera-kernel.lnx.6.0 2022-01-04 19:02:17 -08:00
Camera Software Integration
26ed5e38ae Merge "msm: camera: icp: Trigger FW load/unload via debugfs" into camera-kernel.lnx.6.0 2021-12-23 15:56:55 -08:00
Camera Software Integration
8caa69bd58 Merge "msm: camera: icp: Use mbn to load secure FW image" into camera-kernel.lnx.6.0 2021-12-23 15:56:36 -08:00
Camera Software Integration
7d3c727286 Merge "msm: camera: icp: Use blob to pass presil hangdump buffer info" into camera-kernel.lnx.6.0 2021-12-23 15:56:27 -08:00
Camera Software Integration
28e4171670 Merge "msm: camera: icp: Add err logs in failure cases" into camera-kernel.lnx.6.0 2021-12-23 15:56:07 -08:00
Camera Software Integration
de4126c3a8 Merge "msm: camera: icp: hfi adaptation for presil mode" into camera-kernel.lnx.6.0 2021-12-23 15:55:47 -08:00
Anand Ravi
cbe499e9eb msm: camera: common: create a common root folder for debugfs
Create common root folder under debugfs root named camera at probe. Add
utility functions to create subdirectories under the common camera root.

CRs-Fixed: 3093049
Change-Id: Ia4cefb5d2263ecabf1b9d70deefa1ee624b04f07
Signed-off-by: Anand Ravi <quic_ananravi@quicinc.com>
2021-12-22 16:43:42 -08:00
Suraj Dongre
bd411e32c9 msm: camera: icp: Use blob to pass presil hangdump buffer info
Added blob for presil hangdump containing memhandle for buffer.
Added code to copy hangdump from rumi into this buffer.

CRs-Fixed: 3042621
Change-Id: I804f34fdb251c83137c2ee5b9dd8eb082bd43bf7
Signed-off-by: Suraj Dongre <quic_sdongre@quicinc.com>
2021-12-21 12:10:41 -08:00
Karthik Anantha Ram
d7c79a8c98 msm: camera: icp: Use mbn to load secure FW image
Use .mbn as opposed to .mdt to load ICP FW image. mbn is
all the mdt segments put together which improves load time
as a whole.

CRs-Fixed: 3097673
Change-Id: I9d83fb223b1a17e6c041697d4a8fe5cf5932d5ee
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2021-12-21 09:56:53 -08:00
Karthik Anantha Ram
03ec3b418c msm: camera: icp: Trigger FW load/unload via debugfs
Based on compilation flag CONFIG_CAM_TEST_ICP_FW_DOWNLOAD, ICP
FW load/unload sequence can be verified. This change initializes
memory manager for load and de-initializes memmgr during unload.

To trigger FW download-
adb shell "echo "load" > /sys/kernel/debug/camera_icp/icp_fw_load_unload"

FW unload -
adb shell "echo "unload" > /sys/kernel/debug/camera_icp/icp_fw_load_unload"

CONFIG_CAM_TEST_FW_DOWNLOAD needs to be set only for testing
FW loading when camera server is not enabled.

The change also adds protection for repeated memmgr init/deinit calls.

CRs-Fixed: 3097781
Change-Id: Iceb5089793313b086b9d4fc3770a87860237e741
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2021-12-20 16:20:48 -08:00