This change is needed for domain id feature support.
When a PHY and its lanes for a particular CSID are
protected in a secure session, the same for other
unused CSIDs are to be protected as well. This is
to prevent other CSIDs from tapping the data streaming
onto those lanes if they share the same PHY.
For this, the clocks for other CSIDs (eg CSID-Lite)
need to be turned on. Given that the existing driver
turns on the clocks for the CSID in use, and that
this clock information is embedded within the CSID
hw blocks, these clocks are now exposed as optional
clocks to CPAS to enable the PHY driver to turn them
on during streamon for secure session.
CRs-Fixed: 3304650
Change-Id: I1415e78467208b6b4a74223521d964a199288857
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
With more restricted compilation flags, void parameter is
needed in funciton prototype if no other args exist.
CRs-Fixed: 3306362
Change-Id: I7cdc7d56ff0a5bf5e626ff964dd284faae424bc1
Signed-off-by: Pavan Kumar Chilamkurthi <quic_pchilamk@quicinc.com>
Add support to create, release, signal and import a synx object
using the existing generic fence operations. Handle signaling of
underlying synx object when a sync object is signaled & vice versa.
CRs-Fixed: 3317280
Change-Id: Ia6fac6eb732ed7091ec62f04875bdb30d88c8676
Signed-off-by: Petar Nedev <quic_pnedev@quicinc.com>
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>
Add separate log mask for sensor util. Update i3c device id
logs to show device node name as well.
CRs-Fixed: 3258478
Change-Id: I5bdacc17fc39ee4b2491907ddb02234af2edd767
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
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>
Currently, we are checking the clock struct pointer for NULL
returned from clk_get functions. certain critical clocks might
have NULL returned for clk pointer, since they are enabled during
boot itself. Update return check condition for err only and ignore
NULL value and skip its usage.
CRs-Fixed: 3296865
Change-Id: I5c1852f2348ae8aeeb0508a2f4a052a8c4f1989e
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
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>
Spi driver remove function signature changed between kernel version
5.15 and 5.18.
CRs-Fixed: 3245727
Change-Id: I0352e8b9b5f5990a89b082df9f9ca4000bcd5da0
Signed-off-by: zhuo <quic_zhuo@quicinc.com>
Due to dma-buf symbols into the dma_buf module namespace,
when use them, need to import dma-buf name space.
CRs-Fixed: 3245719
Change-Id: I57bb808c675105bf567f7a628fb88c3259512721
Signed-off-by: zhuo <quic_zhuo@quicinc.com>
Add debug drv flag to enable info logging for drv.
CRs-Fixed: 3065551
Change-Id: Ief9e2a84a379b9f0261567bcf13e2405f3c97d15
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
In function cam_ife_mgr_acquire_dev, will assign
cdm_reg_map to base_array according to index, but
the array length of base_array is less than
CAM_IFE_HW_NUM_MAX now, so it may cause to array
index out of bounds. If we acquire 8 IFEs, we
need to send cdm the reg_base for all 8.
CRs-Fixed: 3250612
Change-Id: I791659e1ad72d301de89fb374d37720ce58f102b
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
This change adds a checking for regulator count,
since the regulator array has fixed length, so
add a protection to avoid meeting index ouf of
bounds issue.
CRs-Fixed: 3250328
Change-Id: I123ffa993ee7b1deb06e3789fa4add6ca5ce6b9f
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
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>
This change uses half frame interval as workqueue congestion
detection threshold and record the last trigger time before
sending req, we can get correct last tirgger time in this way.
CRs-Fixed: 3237172
Change-Id: I2d583f7758062340fe6b0c598bfa7e90f49211c2
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
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>
Add support for 32 bits wide sensor ID for CCI hw during sensor
match ID operation.
CRs-Fixed: 3210196
Change-Id: Idef7f5cd3d7199198d0c6aa06ce54415a409d147
Signed-off-by: Jigar Agrawal <quic_jigar@quicinc.com>
Add support to create, release, signal and import
a dma fence. When a sync object is imported for a dma fence
signal the dma fence when signaling the sync object with
appropriate status. This is achieved by implementing
generic fence scheme. The change also adds support
for batched fences.
CRs-Fixed: 3207212
Change-Id: I23fbc0992281cfee0303e213a30bce138ae7bdff
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
For dma buffer profiling,we don't konw the owner of one dma
buffer. So we add it's name to show it's owner.
If you use v1 struct to alloc/map dma buffer it will use
default buffer name "UNKNOWN". For v2 struct you can set dma
buffer name at UMD side.
CRs-Fixed: 3131442
Change-Id: I24ce6aa1d97cd9fc26d9bd8796ab2367607008f6
Signed-off-by: Fengjie Chen <quic_fengjiec@quicinc.com>
Fix the sensor code failure for i3cdev_to_dev API
which is missing the symbol in the kernel allow list.
CRs-Fixed: 3200508
Change-Id: I99f1ae98e322ae4116cccb9cc7ba42fcc7b8a89a
Signed-off-by: Jigar Agrawal <quic_jigar@quicinc.com>
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
Signed-off-by: Abhijit Trivedi <quic_abhijitt@quicinc.com>
Add i3c bus support for qup i3c based
I3C target.
CRs-Fixed: 3169593
Change-Id: I0209f799d800daf9afe7a846310a3d4f4f2ee420
Signed-off-by: Jigarkumar Zala <quic_jzala@quicinc.com>
Signed-off-by: Jigar Agrawal <quic_jigar@quicinc.com>
Add debugfs to invoke kernel panic on Page Fault for specified
context bank index upon encountering Page Fault on non-fatal
property.
CRs-Fixed: 3190298
Change-Id: I0b68d70ec893c93d1ba0df4ee6b6484fba8e31d1
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
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>
Currently we allocate the memory for CDM GENIRQ command
within the Kernel on every stream on. Presil framework
do not have an ability to transfer the kernel only buffers
to the user daemon. For that reason we need to add support
to use the user allocated command buffer instead of the
kernel generated memory to add the GenIRQ cdm command
while submitting BLs. This change also helps to reduce
the stream on and stream off latency by not having to
allocate and free the GENIRQ memory on every stream on and
stream off respectively.
CRs-Fixed: 3115399
Change-Id: Ic159efd56fb9c4480ed1eb25cf2c058cbb914332
Signed-off-by: Jigar Agrawal <quic_jigar@quicinc.com>
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>
Add back in check for ddr memory type to distinguish between DDR4/5
memory types.
CRs-fixed: 3136181
Change-Id: Ia152cde2786bf6e3da172d2b7046f9871d4f8e3c
Signed-off-by: Karthik Jayakumar <quic_kjayakum@quicinc.com>
Signed-off-by: Wasim Khan <quic_wasikhan@quicinc.com>
For some chipsets, qchannel handshake needs icp clk to be
enabled. Add support to enable icp clk while qchannel
handshake by adding as optional clk in cpas node. Whether
to enable icp clk or not is controlled through workaround
list populated for each chipset.
Add mechanism to retry qchannel acceptance if the first
auto try has failed, by explicity writing 0x1 to qchannel
ctrl register. This will bring back qchannel to good state.
CRs-Fixed: 3131613
Change-Id: Ie39a9789b2eb1bf9c0f6adb26fe6d6e1823eff70
Signed-off-by: Pavan Kumar Chilamkurthi <quic_pchilamk@quicinc.com>
When set, buffers will be mapped within 32-bit region
address space and in patching, if Shared or CmdBUffer is
not set for such buffers - patch the value with right shift
by 8. kmd does as below.
Map:
Shared or CmdBuffer : Mapped within 32bit.
HwAndCDMOrShared : Mapped within 32bit
others(HwAccess) : Mapped within 40bit
Patching:
Shared or CmdBuffer : as is
HwAndCDMOrShared : iova >> 8
others (HwAccess) : iova >> 8
Shared/CmdBuffer takes precedence over HwAndCDMOrShared.
CRs-Fixed: 3128094
Change-Id: Ifd9f5beaf2659f77544cd0722ef7f60d6c0684a7
Signed-off-by: Pavan Kumar Chilamkurthi <quic_pchilamk@quicinc.com>
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>
To configure CP mask correct version check needs to be
used against CPAS hw version. Currently csiphy driver
is checking platform version to make the decision.
This change update this check with CPAS hw version check.
CRs-Fixed: 3048249
Change-Id: Id023f5cc0252b47c274dfed9d93e7f49a3d0ab49
Signed-off-by: Jigarkumar Zala <quic_jzala@quicinc.com>
Signed-off-by: Jigar Agrawal <quic_jigar@quicinc.com>
Extension of Lets do a reset (LDAR) to include more information
in dump with more dump output enhancements.
CRs-Fixed: 3068971
Change-Id: I6b61bcf546e32c096e45c511faf64514ff391e62
Signed-off-by: Joshua Florez <quic_jflorez@quicinc.com>
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>
dma_buf_vunmap function signature changed between kernel version
5.10 and 5.15.
CRs-Fixed: 3088126
Change-Id: If6ef72aa7839e358bc6d7a384e628b760ecaf265
Signed-off-by: zhuo <quic_zhuo@quicinc.com>
Sometimes, i2c driver will be probed earlier than CRM
driver ready, then we can't register the subdev for
this i2c driver. This change adds the component support
for i2c driver.
CRs-Fixed: 3073284
Change-Id: I5ee176497a667729d964758ac0909f6902877094
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
Targets which use same SPF with CONFIG_MMRM enabled - but one
chipset need to use mmrm, other doesn't need. In such cases,
calling this mmrm API helps to differentiate the flow.
Returns false if mmrm is not supported and true if mmrm is
supported.
CRs-Fixed: 3066104
Change-Id: I11ad3c02e66575905a01e1eb0b6a8e053acfbe46
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
Moves custom smmu API's to cam_compat as some of them are legacy and
will not be supported in newer kernel versions.
CRs-Fixed: 3048249
Change-Id: Ic9db5d9d295eb02e8bd2d593721b65e30d605f72
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
dma_buf_vmap function signature changed between kernel version
5.10 and 5.15.
CRs-Fixed: 3048249
Change-Id: I4c8dc951cc383c3dc888fca1d0b1becf92f4662c
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
Starting with kernel 5.14+ callbacks using list_head structs need to
be const qualified.
CRs-Fixed: 3048249
Change-Id: I80611317b5a69fee8bb0901697d8a6df1bd4aab8
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>