Explorar o código

Merge "msm: camera: cpas: Update cpas dt parsing" into camera-kernel.lnx.5.0

Haritha Chintalapati %!s(int64=4) %!d(string=hai) anos
pai
achega
9d4ea638ef

+ 6 - 1
drivers/cam_cpas/cam_cpas_hw.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/device.h>
@@ -2015,6 +2015,11 @@ static void cam_cpas_update_monitor_array(struct cam_hw_info *cpas_hw,
 		entry->be_ddr = cam_io_r_mb(rpmh_base + be_ddr_offset);
 		entry->be_mnoc = cam_io_r_mb(rpmh_base + be_mnoc_offset);
 		entry->be_shub = cam_io_r_mb(rpmh_base + be_shub_offset);
+
+		CAM_DBG(CAM_CPAS,
+			"fe_ddr=0x%x, fe_mnoc=0x%x, be_ddr=0x%x, be_mnoc=0x%x",
+			entry->fe_ddr, entry->fe_mnoc, entry->be_ddr,
+			entry->be_mnoc);
 	}
 
 	entry->camnoc_fill_level[0] = cam_io_r_mb(

+ 3 - 3
drivers/cam_cpas/cam_cpas_hw.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 #ifndef _CAM_CPAS_HW_H_
@@ -14,11 +14,11 @@
 #include "cam_soc_bus.h"
 
 #define CAM_CPAS_INFLIGHT_WORKS              5
-#define CAM_CPAS_MAX_CLIENTS                 40
+#define CAM_CPAS_MAX_CLIENTS                 41
 #define CAM_CPAS_MAX_AXI_PORTS               6
 #define CAM_CPAS_MAX_TREE_LEVELS             4
 #define CAM_CPAS_MAX_GRAN_PATHS_PER_CLIENT   32
-#define CAM_CPAS_PATH_DATA_MAX               38
+#define CAM_CPAS_PATH_DATA_MAX               40
 #define CAM_CPAS_TRANSACTION_MAX             2
 
 #define CAM_CPAS_AXI_MIN_MNOC_AB_BW   (2048 * 1024)

+ 11 - 6
drivers/cam_cpas/cam_cpas_soc.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/device.h>
@@ -121,14 +121,16 @@ int cam_cpas_node_tree_cleanup(struct cam_cpas *cpas_core,
 
 static int cam_cpas_util_path_type_to_idx(uint32_t *path_data_type)
 {
-	if (*path_data_type >= CAM_CPAS_PATH_DATA_CONSO_OFFSET)
+	if (*path_data_type >= CAM_CPAS_PATH_DATA_CONSO_OFFSET) {
 		*path_data_type = CAM_CPAS_MAX_GRAN_PATHS_PER_CLIENT +
 			(*path_data_type % CAM_CPAS_MAX_GRAN_PATHS_PER_CLIENT);
-	else
+	}
+	else {
 		*path_data_type %= CAM_CPAS_MAX_GRAN_PATHS_PER_CLIENT;
+	}
 
 	if (*path_data_type >= CAM_CPAS_PATH_DATA_MAX) {
-		CAM_ERR(CAM_CPAS, "index Invalid: %d", path_data_type);
+		CAM_ERR(CAM_CPAS, "index Invalid: %u", *path_data_type);
 		return -EINVAL;
 	}
 
@@ -235,7 +237,7 @@ static int cam_cpas_parse_node_tree(struct cam_cpas *cpas_core,
 			if (curr_node_ptr->cell_idx >=
 				CAM_CPAS_MAX_TREE_NODES) {
 				CAM_ERR(CAM_CPAS, "Invalid cell idx: %d",
-					cell_idx);
+					curr_node_ptr->cell_idx);
 				return -EINVAL;
 			}
 
@@ -380,8 +382,11 @@ static int cam_cpas_parse_node_tree(struct cam_cpas *cpas_core,
 
 				rc = cam_cpas_util_path_type_to_idx(
 					&curr_node_ptr->path_data_type);
-				if (rc)
+				if (rc) {
+					CAM_ERR(CAM_CPAS, "Incorrect path type for client: %s",
+						client_name);
 					return rc;
+				}
 
 				rc = of_property_read_u32(curr_node,
 					"traffic-transaction-type",

+ 2 - 2
drivers/cam_cpas/cam_cpas_soc.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 #ifndef _CAM_CPAS_SOC_H_
@@ -10,7 +10,7 @@
 #include "cam_cpas_hw.h"
 
 #define CAM_REGULATOR_LEVEL_MAX 16
-#define CAM_CPAS_MAX_TREE_NODES 50
+#define CAM_CPAS_MAX_TREE_NODES 56
 #define CAM_CPAS_MAX_FUSE_FEATURE 10
 
 /**

+ 3 - 3
drivers/cam_cpas/cpas_top/cam_cpastop_hw.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/delay.h>
@@ -278,14 +278,14 @@ static int cam_cpastop_get_hw_info(struct cam_hw_info *cpas_hw,
 	reg_value = cam_io_r_mb(soc_info->reg_map[reg_indx].mem_base + 0x8);
 	hw_caps->camera_capability = reg_value;
 
-	CAM_DBG(CAM_FD, "Family %d, version %d.%d.%d, cpas %d.%d.%d, cap 0x%x",
+	CAM_DBG(CAM_CPAS, "Family %d, version %d.%d.%d, cpas %d.%d.%d, cap 0x%x",
 		hw_caps->camera_family, hw_caps->camera_version.major,
 		hw_caps->camera_version.minor, hw_caps->camera_version.incr,
 		hw_caps->cpas_version.major, hw_caps->cpas_version.minor,
 		hw_caps->cpas_version.incr, hw_caps->camera_capability);
 
 	soc_info->hw_version = CAM_CPAS_TITAN_NONE;
-	rc  = cam_cpas_translate_camera_cpas_version_id(cam_version,
+	rc = cam_cpas_translate_camera_cpas_version_id(cam_version,
 		cpas_version, &cam_version_id, &cpas_version_id);
 	if (rc) {
 		CAM_ERR(CAM_CPAS, "Invalid Version, Camera: 0x%x CPAS: 0x%x",