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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>