Pārlūkot izejas kodu

msm: camera: icp: Fix HFI init sequence

As part of HFI INIT ensure all CSR registers are configured prior
to setting INIT_REQUEST. Also monitor the INIT RESPONSE status
for 32 bits as opposed to 1 bit which will result in reading
a false value for FW error codes > 1.

CRs-Fixed: 3070374
Change-Id: Ib32f1cdf05c524072e5d6e55773351e95c9082a8
Signed-off-by: Karthik Anantha Ram <[email protected]>
Karthik Anantha Ram 3 gadi atpakaļ
vecāks
revīzija
bd10cccbc4
1 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 4 4
      drivers/cam_icp/hfi.c

+ 4 - 4
drivers/cam_icp/hfi.c

@@ -682,7 +682,7 @@ int cam_hfi_resume(struct hfi_mem_info *hfi_mem)
 	if (cam_common_read_poll_timeout(icp_base +
 		    HFI_REG_ICP_HOST_INIT_RESPONSE,
 		    HFI_POLL_DELAY_US, HFI_POLL_TIMEOUT_US,
-		    0x1, ICP_INIT_RESP_SUCCESS, &status)) {
+		    (uint32_t)UINT_MAX, ICP_INIT_RESP_SUCCESS, &status)) {
 	    CAM_ERR(CAM_HFI, "response poll timed out: status=0x%08x",
 		    status);
 	    return -ETIMEDOUT;
@@ -916,8 +916,6 @@ int cam_hfi_init(struct hfi_mem_info *hfi_mem, const struct hfi_ops *hfi_ops,
 		icp_base + HFI_REG_SECONDARY_HEAP_PTR);
 	cam_io_w_mb((uint32_t)hfi_mem->sec_heap.len,
 		icp_base + HFI_REG_SECONDARY_HEAP_SIZE);
-	cam_io_w_mb((uint32_t)ICP_INIT_REQUEST_SET,
-		icp_base + HFI_REG_HOST_ICP_INIT_REQUEST);
 	cam_io_w_mb((uint32_t)hfi_mem->qdss.iova,
 		icp_base + HFI_REG_QDSS_IOVA);
 	cam_io_w_mb((uint32_t)hfi_mem->qdss.len,
@@ -934,6 +932,8 @@ int cam_hfi_init(struct hfi_mem_info *hfi_mem, const struct hfi_ops *hfi_ops,
 		icp_base + HFI_REG_FWUNCACHED_REGION_IOVA);
 	cam_io_w_mb((uint32_t)hfi_mem->fw_uncached.len,
 		icp_base + HFI_REG_FWUNCACHED_REGION_SIZE);
+	cam_io_w_mb((uint32_t)ICP_INIT_REQUEST_SET,
+		icp_base + HFI_REG_HOST_ICP_INIT_REQUEST);
 
 	CAM_DBG(CAM_HFI, "IO1 : [0x%x 0x%x] IO2 [0x%x 0x%x]",
 		hfi_mem->io_mem.iova, hfi_mem->io_mem.len,
@@ -954,7 +954,7 @@ int cam_hfi_init(struct hfi_mem_info *hfi_mem, const struct hfi_ops *hfi_ops,
 	if (cam_common_read_poll_timeout(icp_base +
 		    HFI_REG_ICP_HOST_INIT_RESPONSE,
 		    HFI_POLL_DELAY_US, HFI_POLL_TIMEOUT_US,
-		    0x1, ICP_INIT_RESP_SUCCESS, &status)) {
+		    (uint32_t)UINT_MAX, ICP_INIT_RESP_SUCCESS, &status)) {
 		CAM_ERR(CAM_HFI, "response poll timed out: status=0x%08x",
 			status);
 		rc = -ETIMEDOUT;