This change add name to dma_buf, it's difficult to debug kernel
dma_buf users as until now as we could not set it at kernel side.
dma_buf_set_name function is exported by Android kernel. So in future if
it is exported for any kernel version then based on that we need
to support.
CRs-Fixed: 3728228
Signed-off-by: Soumen Ghosh <quic_soumeng@quicinc.com>
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
Change-Id: I556992cb4fd4cbedb820dae5b976f3a77dd6022e
Integer pointer passed as a parameter to function
cam_irq_controller_register_dependent is used as an
array iterating over num_registers. This might corrupt
or misinterpret adjacent memory locations causing out
of bound access issues.
This change fixes this issue by passing an array of
size num_registers as a parameter to
cam_irq_controller_register_dependent. Also, initializes
struct dma_buf_map to 0.
CRs-Fixed: 3658797
Change-Id: I18260c9be4df77716f00c3f5980aeb506e35dcdc
Signed-off-by: Shivakumar Malke <quic_smalke@quicinc.com>
Use MINK API for all the targets that support domain ID and
use legacy API for all other targets. In addition, use a
target based macro to not compile the MINK API for the
older targets where those APIs are not defined.
Change-Id: I0d8f05df6ca8126db1e3ad8456fe78aa77a33ebf
CRs-Fixed: 3529425
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
This change creates a sysfs entry(subparts_info) which
has info about number of IFEs, IFE-LITEs, SFEs & CUSTOM,
whose values are populated in their respective drivers.
Also, validates whether a particular IFE, SFE and CUSTOM
is supported or not. Based on this, probe of IFE, SFE and
CUSTOM drivers will happen accordingly.
CRs-Fixed: 3482745
Change-Id: Iff6e79a7793b14b1f368f215020617f10dbd4bb5
Signed-off-by: Karthik Dillibabu <quic_kard@quicinc.com>
Address the inconsistency in a function prototype
across multiple kernel versions.
Change-Id: Ib5d3c3df74a89a019b0f1f858746888ce0101512
CRs-Fixed: 3509086
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
Signed-off-by: wasikhan <quic_wasikhan@quicinc.com>
Use SCM 7 call during the process shutdown. This is to
workaround a race condition between the close of camera FD
and the invoke driver FD that leads to a device crash.
Additionally, keep the Domain ID clocks on only during
protect or unprotect operations.
CRs-Fixed: 3509086
Change-Id: Ic091aa737df10bb2b41190c2f850c31fd17af9b2
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
problem:
scm calls to enable/disable SAFE signal introduced due to HW limitation
in some targets from ife causing overall system delay whenever
camera starts and other HW components also making scm calls.
solution:
prevent redundant SCM calls for SAFE signal.
CRs-Fixed: 3511194
Change-Id: Ib6692d599e9ec9e9182a9e6eb0aef52322cbfdef
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
Query the CSF version in use from SMMU proxy driver and
use noncontiguous system heap in case of CSF 2.5
instead of the contiguous secure display heap.
In addition, do not lend the buffer in CSF 2.5.
CRs-Fixed: 3424427
Change-Id: I3d5f2402034dd455c304d5726eb9aa8ee2080dcc
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
Currently, the IFE FD port is configured to be secure by TZ and the
camera software allocates secure buffers to be consumed by EFA FD
module. However, as we are moving to the software based DLFD, this
port needs to be configured as non secure by TZ and camera should
treat so and allocate non secure buffers.
CRs-Fixed: 3443139
Change-Id: I2fcc89d4d61bd944969bfe854584960c10648f6c
Signed-off-by: Suraj Dongre <quic_sdongre@quicinc.com>
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
Update SOC util to be able to parse multiple irq names from DT and,
request, enable, disable multiple irq lines per soc.
All IRQ lines per SOC will have the same handler but different data,
so ISR will have their own private data to differentiate source of irq
in the same handling function.
CRs-Fixed: 3395596
Change-Id: Id9ca1cd3ef105d732a82decd7c8078bd29668326
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
Some dead code was removed and a memory leak issue was resolved
This solves issues related to VA_UNUSED.GEN and MLK.MIGHT.
CRs-Fixed: 3394193
Change-Id: I387587a3e359df9ad44a15e3e3f58b3422c81ad9
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
Enable config for clock update calls that vote the cesta hw client
votes. Update existing ddr drv flags to include spectra for camera
specific flags.
CRs-Fixed: 3315013
Change-Id: I63e0107a517d3c71f8fac7f2d631e2c37f62f8b3
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
Signed-off-by: Pavan Kumar Chilamkurthi <quic_pchilamk@quicinc.com>
The current secure camera implementation suffers with a few
issues in terms of typecasting, error handling and in
populating the information in the right data structures when
the new SCM API is used on the targets without domain ID support.
In addition, we needed to be explicit in failing to acquire
if dual IFE is required in secure camera use cases as it is
not a supported feature as of now.
CRs-Fixed: 3317248
Change-Id: Idb762158b0ff0e0a0d6d51de4770fc3d9d9072c8
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
Adds support for new mink call to configure secure
camera sessions. This new mink call takes in additional
parameters to support the new domain-id based
security scheme. The additional parameters are in the
form of csid_hw_idx_mask, cdm_hw_idx_mask and
vc_mask. These are in addition to the existing PHY idx
and CPHY/DPHY lanes info.
The introduction of this new mink call deprecates the
existing SCM call used to service secure camera sessions.
What this means is that on all subsequent versions of this
driver, all secure camera sessions will be serviced by this
mink call, which is able to accommodate older and newer targets,
and their programming of different register sets.
This design enables the cam_csiphy_notify_secure_mode
wrapper to remain the same, with the underlying mink call
made in the cam_compat layer, depending on camera driver
version.
CRs-Fixed: 3317248
Change-Id: I05511f4380ce5467b104675c07c9c8faa5318af8
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
External dependency has been reverted, change not ready.
This reverts commit b76d66be06cb035886ddebbf7671e02c93fdd1af.
CRs-Fixed: 3317248
Change-Id: If82504f1eb22b1c908d08d256f3b4c4cbad60bc9
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
Adds support for new mink call to configure secure
camera sessions. This new mink call takes in additional
parameters to support the new domain-id based
security scheme. The additional parameters are in the
form of csid_hw_idx_mask, cdm_hw_idx_mask and
vc_mask. These are in addition to the existing PHY idx
and CPHY/DPHY lanes info.
The introduction of this new mink call deprecates the
existing SCM call used to service secure camera sessions.
What this means is that on all subsequent versions of this
driver, all secure camera sessions will be serviced by this
mink call, which is able to accommodate older and newer targets,
and their programming of different register sets.
This design enables the cam_csiphy_notify_secure_mode
wrapper to remain the same, with the underlying mink call
made in the cam_compat layer, depending on camera driver
version.
CRs-Fixed: 3317248
Change-Id: I575f4b85097c81f047f398216d0190b249e6b200
Signed-off-by: Li Sha Lim <quic_lishlim@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>
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 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>
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>
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>
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>
Deprecates legacy api of_fdt_get_ddrtype() as new targets only have
LPDDR5 for platforms that support linux kernel 5.15 and newer.
CRs-Fixed: 3048249
Change-Id: I8e7f3274eadc597870118956b964fb87d69549ee
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
global-out-of-bounds issue on:
msm_cam_hw_cdm_dt_match
Due to no null-terminating struct in the array.
CRs-Fixed: 2883523
Change-Id: I36e4811f239993e1e6de158df959157217c28bfe
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
Need to update API's provided by memory team for retreiving fault id's when an
SMMU translation fault occurs for the new kernel version.
CRs-Fixed: 2835738
Change-Id: I061914ce01196fd1271c8a466f6a4ef8e6dce28f
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
Kernel 5.10 and up have renamed kzfree to kfree_secure. As such,
we have added a cam_free_clear function to redirect all uses of kzfree
uses to the appropriate function depending on the kernel version the
driver is built against.
CRs-Fixed: 2835738
Change-Id: I72d191c9fb0454a4dbb1392894a909e81fe07caa
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
Currently lane enablement is happening as a part of lanemask
field, which is send by UMD. Lane enablement should be purely
depends on laneCnt and laneAssign attributes. Also, combo mode
sensors needs to come with combo mode flag set from the UMD.
This change updates the logic for lane enablement with respect
to laneAssign and laneCnt, and also covers all combomode selection
as per the request. This change also enables the sensors to acquire
and streamon/streamoff at anytime in session.
CRs-Fixed: 2677450
Change-Id: I4f0d3ffd7245a931c273611c9c4b7e503c038664
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
For secure mode, csiphy driver ask for secure stream. Currently
this call always return success. This change return the appropriate
result of failure/success.
CRs-Fixed: 2673418
Change-Id: Ib425ad77e6481888acefdaf843256602aa759cf3
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Creates a function to match expectant types for platform device
comparisons during component registration.
CRs-Fixed: 2584631
Change-Id: Ib07160b8d8f1a370ba535ffdbbc6adbe391c68d5
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
When loading the camera FW, use the appropriate APIs
depending on the kernel version to map the FW region.
CRs-Fixed: 2564857
Change-Id: I2104b63b54bce799c8e44f36c49042de86f78c7e
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>