|
@@ -349,6 +349,45 @@ static int cam_cpas_parse_node_tree(struct cam_cpas *cpas_core,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+int cam_cpas_get_hw_features(struct platform_device *pdev,
|
|
|
+ struct cam_cpas_private_soc *soc_private)
|
|
|
+{
|
|
|
+ struct device_node *of_node;
|
|
|
+ void *fuse;
|
|
|
+ uint32_t fuse_addr, fuse_bit;
|
|
|
+ uint32_t fuse_val = 0, feature_bit_pos;
|
|
|
+ int count = 0, i = 0;
|
|
|
+
|
|
|
+ of_node = pdev->dev.of_node;
|
|
|
+ count = of_property_count_u32_elems(of_node, "cam_hw_fuse");
|
|
|
+
|
|
|
+ for (i = 0; (i + 3) <= count; i = i + 3) {
|
|
|
+ of_property_read_u32_index(of_node, "cam_hw_fuse", i,
|
|
|
+ &feature_bit_pos);
|
|
|
+ of_property_read_u32_index(of_node, "cam_hw_fuse", i + 1,
|
|
|
+ &fuse_addr);
|
|
|
+ of_property_read_u32_index(of_node, "cam_hw_fuse", i + 2,
|
|
|
+ &fuse_bit);
|
|
|
+ CAM_INFO(CAM_CPAS, "feature_bit 0x%x addr 0x%x, bit %d",
|
|
|
+ feature_bit_pos, fuse_addr, fuse_bit);
|
|
|
+
|
|
|
+ fuse = ioremap(fuse_addr, 4);
|
|
|
+ if (fuse) {
|
|
|
+ fuse_val = cam_io_r(fuse);
|
|
|
+ if (fuse_val & BIT(fuse_bit))
|
|
|
+ soc_private->feature_mask |= feature_bit_pos;
|
|
|
+ else
|
|
|
+ soc_private->feature_mask &= ~feature_bit_pos;
|
|
|
+ }
|
|
|
+ CAM_INFO(CAM_CPAS, "fuse %pK, fuse_val %x, feature_mask %x",
|
|
|
+ fuse, fuse_val, soc_private->feature_mask);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int cam_cpas_get_custom_dt_info(struct cam_hw_info *cpas_hw,
|
|
|
struct platform_device *pdev, struct cam_cpas_private_soc *soc_private)
|
|
|
{
|
|
@@ -363,6 +402,7 @@ int cam_cpas_get_custom_dt_info(struct cam_hw_info *cpas_hw,
|
|
|
}
|
|
|
|
|
|
of_node = pdev->dev.of_node;
|
|
|
+ soc_private->feature_mask = 0xFFFFFFFF;
|
|
|
|
|
|
rc = of_property_read_string(of_node, "arch-compat",
|
|
|
&soc_private->arch_compat);
|
|
@@ -372,6 +412,8 @@ int cam_cpas_get_custom_dt_info(struct cam_hw_info *cpas_hw,
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
+ cam_cpas_get_hw_features(pdev, soc_private);
|
|
|
+
|
|
|
soc_private->camnoc_axi_min_ib_bw = 0;
|
|
|
rc = of_property_read_u64(of_node,
|
|
|
"camnoc-axi-min-ib-bw",
|