Commit Graph

112 Commits

Author SHA1 Message Date
Savita Patted
dd01debce6 Merge "msm: camera: common: Use pdev name for soc dev name" into camera-kernel.lnx.5.0 2021-03-23 18:46:30 -07:00
Pavan Kumar Chilamkurthi
7f750a59f0 msm: camera: common: Use pdev name for soc dev name
Having a global variable and using the same for all devices
will overwrite the name of previous device. Use pdev name
to be consistent and helps in debugging logs.

CRs-Fixed: 2901925
Change-Id: I086f3dbd12e720c5e6497355eae40ca242d3d408
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2021-03-20 19:48:08 -07:00
Karthik Anantha Ram
bcedf8dd86 msm: camera: icp: Increase the max_in and out resource macros
Increase these macros to accommodate MFHDR use-cases involving,
more inputs/outputs.

CRs-Fixed: 2841729
Change-Id: I360f5500c6a9a8e4e0ea3b25cf281187db639b2c
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-03-18 11:49:04 -07:00
Savita Patted
782ae622ba Merge "msm: camera: isp: Fix for disable UBWC case" into camera-kernel.lnx.5.0 2021-03-09 20:19:04 -08:00
Savita Patted
1ee4bca76c Merge "msm: camera: ope: Handle OPE smmu fault with pid info" into camera-kernel.lnx.5.0 2021-03-09 20:18:26 -08:00
Savita Patted
4aef1f4a18 Merge "msm: camera: icp: Update a5 qos values post reset" into camera-kernel.lnx.5.0 2021-03-09 20:16:45 -08:00
Wyes Karny
616fd64c12 msm: camera: isp: Fix for disable UBWC case
Sometimes multiple io cofigs comes before start_dev. Therefore even we
force disable UBWC compression at start_dev time it can be override by
those io configs. Therefore moving disable UBWC comp logic to acquire
time. Acquire time a flag is sent if we have to enable or disable ubwc
compression, based on this we set bus side ubwc_disable flag. When ever
we start the WM or update the WM UBWC config  we check this flag and
based on this flag we override the ubwc_mode_cfg register.

CRs-Fixed: 2833514
Change-Id: I8efc3f7abd53e0757f8e77ac0788e303f7c695b9
Signed-off-by: Wyes Karny <wkarny@codeaurora.org>
2021-03-08 21:28:23 +05:30
Gaurav Jindal
bc400e47fa msm: camera: common: Add common wait and poll interface
In current implementation, each driver call wait_for_completion_timeout
and readl_poll_timeout with own timeout values.
In case of slow environments like presil, lot of hacks are needed to
change the timeouts for each driver. It needs multiple code changes
and compilations, thus consuming time.
This commit implements a common interface to call
wait_for_completion_timeout and readl_poll_timeout.
Debug variable is also introduced to
change the timeout value. This will help to change the timeout
without compilations and changes at multiple places.

Change-Id: Iba51e0805a49ed325147a12688c2fe6619bb68e6
CRs-Fixed: 2830502
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
2021-03-02 14:17:09 +05:30
Vikram Sharma
57bff5aede msm: camera: ope: Handle OPE smmu fault with pid info
Kernel apis provide information fault caused pid and mid data.
Handle the OPE smmu fault using pid and mid data. Based on the
mid data, dump only corresponding port info which caused the
fault. Pid and mid values are target dependent, these values
will be updated on the ope node dt entries.

CRs-Fixed: 2857868
Change-Id: I909f1787e71e67e5ed1d3464dfeb506418d151e4
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
2021-02-24 23:40:40 -08:00
Karthik Anantha Ram
ecc37dabea msm: camera: icp: Update a5 qos values post reset
Update a5 R/W priorities post a5 reset.

CRs-Fixed: 2834780
Change-Id: I81736f780c70a648b81f4cd05db7caa0bdcc5195
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-02-24 10:57:52 -08:00
Karthik Anantha Ram
225eb81a60 msm: camera: icp: Suppress warning messages when requesting FW
Replace request_firmware API so that no warning messages
are generated when the file is not found. sysfs callback
mechanism is enabled if direct filesystem lookup fails.

CRs-Fixed: 2841729
Change-Id: I6dd892690ca9d38a90a6e0623d87421e889dbeca
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-02-16 23:09:19 -08:00
Karthik Anantha Ram
5c6e3c3d91 msm: camera: icp: Reset secure pil flag after shutdown
Reset the flag post shutdown, instead of resetting it prior
to calling into HYP.

CRs-Fixed: 2841729
Change-Id: If0bed24a22e1084135df81dc5a72b395e92adb2c
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-02-11 14:55:45 -08:00
Karthik Anantha Ram
3f2ab61c3b msm: camera: icp: Use paddr when loading FW elf segments
Use paddr when loading FW elf segments to support TCM.

CRs-Fixed: 2722486
Change-Id: I5ab9805d44ede38c8163df73f09eea49c44eab82
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-02-08 15:09:59 -08:00
Haritha Chintalapati
83817bb001 Merge "msm: camera: common: Add HW version checks for v680 hardware" into camera-kernel.lnx.5.0 2021-01-25 14:14:41 -08:00
Haritha Chintalapati
36765f7683 Merge "msm: camera: icp: Add support for non secure FW load" into camera-kernel.lnx.5.0 2021-01-25 14:12:14 -08:00
Mukund Madhusudan Atre
4a7b5e3a9b msm: camera: common: Add HW version checks for v680 hardware
Add support for v680 HW.

CRs-Fixed: 2841729
Change-Id: I8348cc43eb0a6b0b6a7b1ee2a88cf26a7791e625
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2021-01-22 17:41:29 -08:00
Karthik Anantha Ram
a503554e2f msm: camera: icp: Add support for non secure FW load
Starting from waipio, ICP [lx7] FW is to loaded using
secure PIL. For debug purposes also added support for
non secure image loading for lx7.

CRs-Fixed: 2722486
Change-Id: I30026fb8e65f323ab73336e0ae787a2359bc934f
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-01-22 09:26:04 -08:00
Pavan Kumar Chilamkurthi
fa9be8c725 msm: camera: icp: Add fw uncached region support in icp smmu
Use fw_uncached region instead of secondary heap region. Pass
this region information to FW through CSR registers.
Allocate Qtlb, cmd_q, msg_q, dbg_q from fw_uncached region
instead of shared mem region. Allocate Sec heap also from
fw uncached region instead of its own dedicated region.

CRs-Fixed: 2722486
Change-Id: Ib88b2202ca1b610946c712fcca936b72d4eecd15
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-01-20 17:13:30 -08:00
Camera Software Integration
131c340861 Merge "msm: camera: icp: Fix FW load sequence issues" into camera-kernel.lnx.5.0 2021-01-20 16:24:36 -08:00
Camera Software Integration
42c032daea Merge "msm: camera: icp: Enable full LX7 boot/load sequence" into camera-kernel.lnx.5.0 2021-01-20 16:24:23 -08:00
Camera Software Integration
0f5d8cede1 Merge "msm: camera: icp: Support devices iface alloc/free for any proc" into camera-kernel.lnx.5.0 2021-01-20 16:24:09 -08:00
Camera Software Integration
cfdfcbe84a Merge "msm: camera: icp: Add LX7 driver" into camera-kernel.lnx.5.0 2021-01-20 16:23:52 -08:00
Karthik Anantha Ram
923b5ea86c msm: camera: icp: Fix FW load sequence issues
Address and enhance ICP FW load sequence using
secure PIL.

CRs-Fixed: 2722486
Change-Id: I812915c001819d477fd315c46c46b7aaffdda5f2
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-01-19 10:18:21 -08:00
Karthik Anantha Ram
96485688d6 msm: camera: icp: Enable full LX7 boot/load sequence
The LX7 firmware loading sequence will rely on the
Peripheral Image Loader (PIL) framework to load and
authenticate the image. Enable the driver to utilize
the framework.

CRs-Fixed: 2842016
Change-Id: I3351fd843baf096ac57257a88b7e78325a10a3bf
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-01-19 10:17:24 -08:00
Karthik Anantha Ram
cdb09aa64b msm: camera: icp: Support devices iface alloc/free for any proc
The devices interface allocation flow assumes that there is only
one possible processor. This will no longer be the case and
we must update the flow to support any choice of processor.

CRs-Fixed: 2842016
Change-Id: I7f7767a5b5f9e8c9de08f0692014e3f84d69e3d1
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-01-15 16:32:51 -08:00
Karthik Jayakumar
2c67e897da msm: camera: common: Add cam_free_clear to cam_compat
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>
2021-01-15 08:55:04 -08:00
Pavan Kumar Chilamkurthi
d1ff12582e msm: camera: cpas: Add more cpas log event triggers
Add cpas log events to capture IPE, BPS, JPEG frame submit,
frame done events and ipe, bps clk update events and
IFE EPOCH event.

CRs-Fixed: 2851720
Change-Id: I94d1023b8878934e50f21a1a55fe3ce561cce869
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2021-01-13 01:30:52 -08:00
Karthik Anantha Ram
4e25fa702e msm: camera: icp: Add LX7 driver
Add initial support for the LX7 processor.
Support for firmware loading and processor boot are
still pending. Note this also cleans up some descriptions
in struct cam_icp_hw_mgr that were left over when the
debugfs entries were renamed.

CRs-Fixed: 2722486
Change-Id: I626cc27e26e1ebac8ec6b4509ab5da2a013457b1
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-01-12 19:00:56 -08:00
Gaurav Jindal
1a5797c6a8 msm: camera: common: Optimize cam context memory
In current implementation, cam_ctx_req has a array of
hw_update_entries, in_map_entries and out_map_entries. Each
context has array of N requests. Memory for all contexts is
allocated during probe. This causes a huge memory remaining
unutilized.
This commit moves the memory allocation to context acquire time
and freeing this memory during context release. In place
of using array, now dynamic allocation is used.
A top level calculation shows a memory reduction of around 2M-
2.5M with this change including all the camera drivers.

CRs-Fixed: 2830502
Change-Id: Id63cf2a52272e2a419704dc95100694e384330c3
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
2021-01-06 06:53:08 -08:00
Karthik Anantha Ram
f7c65899fc msm: camera: icp: Introduce processor boot/shutdown sequence
Abstract the firmware loading and processor boot/shutdown
mechanisms. The device interface is best suited to dealing
with the sequence.

Note this also cleans up some descriptions in struct cam_icp_hw_mgr
that were left over when the debugfs entries were renamed.

CRs-Fixed: 2842016
Change-Id: I1574c799a2b023c02137b32572f8284fe7523188
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-12-21 11:46:36 -08:00
Vikram Sharma
da8fdb3095 msm: camera: icp: Fetch the firmware name from soc info
Use the a5 firmware name from soc info instead of hard coding.

CRs-Fixed: 2825675
Change-Id: Ifb089857777ae4d48c1c7ab6f12259a711c46152
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
2020-12-07 19:48:57 -08:00
Karthik Anantha Ram
ddfe75dc7a msm: camera: icp: Check HW state prior to IRQ processing
Check ICP HW state before processing any IRQ to avoid
any unclocked access.

CRs-Fixed: 2816854
Change-Id: I31fc03f655b1068f5d171385891eba7d281bd4fd
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-11-19 18:19:36 -08:00
Camera Software Integration
5a2fb767ac Merge "msm: camera: icp: Support NRT ipe clock bump-up" into camera-kernel.lnx.4.0 2020-10-29 15:36:07 -07:00
Camera Software Integration
a7a72f3fae Merge "msm: camera: icp: Tidy up hfi queue dump" into camera-kernel.lnx.4.0 2020-10-28 13:28:44 -07:00
Alok Chauhan
60ad5470c2 msm: camera: icp: Support NRT ipe clock bump-up
Whenever there are NRT request then bump-up ipe clock
to max. Clock will get reduced as part of context timer expires.

CRs-Fixed: 2793751
Change-Id: I28a0b32bd52b58e293439042008711ea454a64f3
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2020-10-27 22:14:25 +05:30
Fernando Pacheco
593ababe3a msm: camera: icp: Tidy up hfi queue dump
Two changes packed as one: refactor queue dump code and reformat
dump output. The first should be self-explanatory.

For the second, displaying one double word per line places an
unnecessary burden on the reader. We can balance the vertical
and horizontal space utilized for the dump by printing
four double words at a time.

Example:
word[0000]: 0x00000008 0x00010001 0x00000008 0x00010002
word[0004]: 0x00000014 0x00010003 0x00000001 0x00000008
word[0008]: 0x00000001 0x00000020 0x00010003 0x00000001
word[0012]: 0x00000009 0x00007083 0x0001620f 0x00007083
word[0016]: 0x0001620f 0x00000018 0x00010003 0x00000001
word[0020]: 0x00000005 0x00000001 0x00010000 0x00000010
word[0024]: 0x00010005 0x84f07c60 0xffffffd8 0x0000001c
word[0028]: 0x01010008 0x00000002 0x84f07c60 0xffffffd8
...

CRs-Fixed: 2805272
Change-Id: Ibc0ef955b5120ca2265cd1262fd91c124843dac0
Signed-off-by: Fernando Pacheco <fpacheco@codeaurora.org>
2020-10-26 11:33:19 -07:00
Ravikishore Pampana
353c16eb68 msm: camera: icp: remove the ioconfig dump during the error
If io config send failure happens, currently dumping the
io configuration for debug purpose. If more io configuration
data is there, it will cause excessive logs. So removed
io configuration dump in icp driver. On acquire failure,
acquire node can dump the same.

CRs-Fixed: 2800304
Change-Id: I4c6a7973eb789de8c3384311bce033070e07692f
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
2020-10-23 17:57:02 +05:30
Wyes Karny
21feb1f651 msm: camera: isp: Add UBWC compression disable support
Adding UBWC compression disable support.

CRs-Fixed: 2789618
Change-Id: I994e6698ce945b7bed2a1207d4b52e4f10b99df1
Signed-off-by: Wyes Karny <wkarny@codeaurora.org>
2020-10-04 22:12:46 -07:00
Fernando Pacheco
033864b04f msm: camera: icp: Fix potential deadlock scenario in cam_hfi_init
Make sure we perform the necessary unlock operations before we return
on an invalid HFI state.

CRs-Fixed: 2783934
Change-Id: I7c611fb98d245952f2f4e9a57dc5fcb249572a40
Signed-off-by: Fernando Pacheco <fpacheco@codeaurora.org>
2020-09-23 14:10:33 -07:00
Fernando Pacheco
f1d47bfd71 msm: camera: icp: Rename debugfs entries to be proc hw agnostic
Drop references to A5 within the debugfs entries so that they
may be reused with other processors.

CRs-Fixed: 2722486
Change-Id: I2680a98dd3d38906e616712da3d6e2835ebb9a85
Signed-off-by: Fernando Pacheco <fpacheco@codeaurora.org>
2020-09-15 16:36:30 -07:00
Fernando Pacheco
1bd8f23dd5 msm: camera: icp: Generalize proc references within hw manager
The A5 references sprinkled throughout the hw manager will no
longer make sesne within the context of two possible processors.
We will instead prefer the more generic "icp" term to reference
the processor in use e.g. icp_dev instead of a5_dev.

Note that some references to A5 remain and will be cleaned up
when LX7 is introduced.

CRs-Fixed: 2722486
Change-Id: I9af73cc2af27a2aed2f4d7baaead89a20442e9ed
Signed-off-by: Fernando Pacheco <fpacheco@codeaurora.org>
2020-09-15 16:36:30 -07:00
Fernando Pacheco
528d44a312 msm: camera: icp: Support processor-specific HFI register offsets
The HFI interface registers will have a different base address
on the LX7 processor. We can utilize the newly added HFI ops to
abstract the calculation of the address by kicking that info out
to the device interface. The HFI register definitions have been
tweaked to support offsets based on the calculated addresses.

CRs-Fixed: 2722486
Change-Id: I93b9b2827ec0820eaac6ee2e6a611363b96a3223
Signed-off-by: Fernando Pacheco <fpacheco@codeaurora.org>
2020-09-15 15:44:19 -07:00
Camera Software Integration
6272ed41ba Merge "msm: camera: icp: Adapt HFI to processor specific irq management" into camera-kernel.lnx.4.0 2020-09-14 12:44:50 -07:00
Fernando Pacheco
f42f7b1e9a msm: camera: icp: Adapt HFI to processor specific irq management
The steps to enable and send interrupts will differ between processors.
Pull this logic out of the HFI and out to the devices, so that we can
adapt to the specific irq management of any processor.

CRs-Fixed: 2722486
Change-Id: I2a889b91ec13295aa14bb2b16252332482a1225a
Signed-off-by: Fernando Pacheco <fpacheco@codeaurora.org>
2020-09-03 15:44:15 -07:00
Karthik Anantha Ram
c14978cb20 msm: camera: icp: Increase request queue depth and frame cmd bitmap
Increase the queue depth to support EIS3 use-cases.

CRs-Fixed: 2768737
Change-Id: I02ef9da1a0d37208d2b3fd27092e9e03d38e4346
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-09-02 18:17:51 -07:00
Fernando Pacheco
ecd191e638 msm: camera: icp: Teach A5 to power resume/collapse via its hw_ops
The LX7 processor will require a new mechanism to resume/collapse.
Make the current mechanism transparent to the ICP HW manager in
preparation for the new proc. By going through the hw_ops we let
the device interface decide which mechanism to use.

CRs-Fixed: 2722486
Change-Id: I719314b3f505270a33892cb247082e43dad2e92d
Signed-off-by: Fernando Pacheco <fpacheco@codeaurora.org>
2020-08-26 16:50:43 -07:00
Camera Software Integration
73fd4e6bef Merge "msm: camera: core: Send event on smmu page fault" into camera-kernel.lnx.4.0 2020-08-21 14:07:01 -07:00
Camera Software Integration
03c35dd086 Merge "msm: camera: core: Handle event failure reason propagation" into camera-kernel.lnx.4.0 2020-08-20 15:03:00 -07:00
Ravikishore Pampana
b746c4f527 msm: camera: core: Send event on smmu page fault
Currently when page fault happen, iommu driver callers camera
handler with CB details and iova address which caused the page
fault. With iommu iova address cam smmu driver finds the
closest mapping address for that cb and call the
corresponding driver to find the which port caused page fault.
This has limitation has page fault address always not mapped.
New approach is get the page fault ids from iommu driver.
Based on the Pid and Mid values, get the HW id and port ids,
go through all context which has this hw id and port id and log
the data. Once context id is identified, log the acquire data and
last consumed client address details. Dump the hw register data
in the given buffer. Send the smmu page fault event through
v4l2 queue to user.

CRs-Fixed: 2750690
Change-Id: I87c809b3229992c7c95655a4f3c6c70ebc035ae8
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
2020-08-19 14:16:38 +05:30
Vikram Sharma
55944b0201 msm: camera: cpas: read and pass fuse information to user space
This change extract the fuse info from DTSI and reads the fuse
value then communicate the same to user space using query_cpas_v2
ioctl.

CRs-Fixed: 2749665
Change-Id: Ie161dc58a7eab3e7b74a5c406ab696af0e7b546e
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
2020-08-17 09:50:13 +05:30