|
@@ -3987,6 +3987,10 @@ static int cam_smmu_get_memory_regions_info(struct device_node *of_node,
|
|
|
int rc = 0;
|
|
|
struct device_node *mem_map_node = NULL;
|
|
|
struct device_node *child_node = NULL;
|
|
|
+ dma_addr_t region_start = 0;
|
|
|
+ size_t region_len = 0;
|
|
|
+ uint32_t region_id;
|
|
|
+ uint32_t qdss_region_phy_addr;
|
|
|
const char *region_name;
|
|
|
int num_regions = 0;
|
|
|
|
|
@@ -4010,12 +4014,10 @@ static int cam_smmu_get_memory_regions_info(struct device_node *of_node,
|
|
|
}
|
|
|
|
|
|
for_each_available_child_of_node(mem_map_node, child_node) {
|
|
|
- uint32_t region_start;
|
|
|
- uint32_t region_len;
|
|
|
- uint32_t region_id;
|
|
|
- uint32_t qdss_region_phy_addr = 0;
|
|
|
+ qdss_region_phy_addr = 0;
|
|
|
|
|
|
num_regions++;
|
|
|
+
|
|
|
rc = of_property_read_string(child_node,
|
|
|
"iova-region-name", ®ion_name);
|
|
|
if (rc < 0) {
|
|
@@ -4024,24 +4026,40 @@ static int cam_smmu_get_memory_regions_info(struct device_node *of_node,
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
- rc = of_property_read_u32(child_node,
|
|
|
- "iova-region-start", ®ion_start);
|
|
|
- if (rc < 0) {
|
|
|
- of_node_put(mem_map_node);
|
|
|
- CAM_ERR(CAM_SMMU, "Failed to read iova-region-start");
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
+ if (iommu_cb_set.is_expanded_memory) {
|
|
|
+ rc = of_property_read_u64(child_node, "iova-region-start", ®ion_start);
|
|
|
+ if (rc < 0) {
|
|
|
+ of_node_put(mem_map_node);
|
|
|
+ CAM_ERR(CAM_SMMU, "Failed to read iova-region-start");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
|
|
|
- rc = of_property_read_u32(child_node,
|
|
|
- "iova-region-len", ®ion_len);
|
|
|
- if (rc < 0) {
|
|
|
- of_node_put(mem_map_node);
|
|
|
- CAM_ERR(CAM_SMMU, "Failed to read iova-region-len");
|
|
|
- return -EINVAL;
|
|
|
+ rc = of_property_read_u64(child_node, "iova-region-len",
|
|
|
+ (uint64_t *)®ion_len);
|
|
|
+ if (rc < 0) {
|
|
|
+ of_node_put(mem_map_node);
|
|
|
+ CAM_ERR(CAM_SMMU, "Failed to read iova-region-len");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ rc = of_property_read_u32(child_node, "iova-region-start",
|
|
|
+ (uint32_t *)®ion_start);
|
|
|
+ if (rc < 0) {
|
|
|
+ of_node_put(mem_map_node);
|
|
|
+ CAM_ERR(CAM_SMMU, "Failed to read iova-region-start");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ rc = of_property_read_u32(child_node, "iova-region-len",
|
|
|
+ (uint32_t *)®ion_len);
|
|
|
+ if (rc < 0) {
|
|
|
+ of_node_put(mem_map_node);
|
|
|
+ CAM_ERR(CAM_SMMU, "Failed to read iova-region-len");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- rc = of_property_read_u32(child_node,
|
|
|
- "iova-region-id", ®ion_id);
|
|
|
+ rc = of_property_read_u32(child_node, "iova-region-id", ®ion_id);
|
|
|
if (rc < 0) {
|
|
|
of_node_put(mem_map_node);
|
|
|
CAM_ERR(CAM_SMMU, "Failed to read iova-region-id");
|