Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 684677f9 authored by Mitchel Humpherys's avatar Mitchel Humpherys
Browse files

gpu: ion: Add support for specifying heap type in the device tree



Currently, there is no way to swap out the underlying heap type for a
given heap ID without modifying msm_ion.c and recompiling the
kernel. This is inconsistent with the rest of Ion which is customized
through the device tree. This change eliminates the need to modify and
recompile the kernel for heap type changes (although the boot image
will still need to be regenerated).

Add a device tree binding to specify the heap_type for Ion heaps.

Change-Id: I0a2b48299c829a828764d74a1d8e3c8f97de706d
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent 6badacdb
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -17,6 +17,17 @@ configurations.
Required properties for Ion heaps

- reg: The ID of the ION heap.
- qcom,ion-heap-type: The heap type to use for this heap. Should be one of
  the following:
    - "SYSTEM"
    - "SYSTEM_CONTIG"
    - "CARVEOUT"
    - "CHUNK"
    - "IOMMU"
    - "CP"
    - "DMA"
    - "SECURE_DMA"
    - "REMOVED"

Optional properties for Ion heaps

@@ -34,16 +45,17 @@ Example:
                 #address-cells = <1>;
                 #size-cells = <0>;

                 qcom,ion-heap@30 { /* SYSTEM HEAP */
                 qcom,ion-heap@30 {
                         reg = <30>;
                         qcom,ion-heap-type = "SYSTEM";
                 };

                 qcom,ion-heap@8 { /* CP_MM HEAP */
                         compatible = "qcom,msm-ion-reserve";
                         reg = <8>;
                         qcom,heap-align = <0x1000>;
                         qcom,memory-reservation-type = "EBI1"; /* reserve EBI memory */
                         qcom,memory-reservation-size = <0x7800000>;
                         linux,contiguous-region = <&secure_mem>;
                         qcom,ion-heap-type = "SECURE_DMA";
                 };

                 qcom,ion-heap@29 { /* FIRMWARE HEAP */
@@ -53,5 +65,6 @@ Example:
                         qcom,heap-adjacent = <8>;
                         qcom,memory-reservation-type = "EBI1"; /* reserve EBI memory */
                         qcom,memory-reservation-size = <0xA00000>;

                         qcom,ion-heap-type = "CARVEOUT";
                 };
	};
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
			reg = <23>;
			qcom,heap-align = <0x1000>;
			qcom,memory-fixed = <0x0dc00000 0x1e00000>;
			qcom,ion-heap-type = "CARVEOUT";
		};
	};
};
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
			reg = <23>;
			qcom,heap-align = <0x1000>;
			qcom,memory-fixed = <0x0dc00000 0x1e00000>;
			qcom,ion-heap-type = "CARVEOUT";
		};
	};
};
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
			reg = <23>;
			qcom,heap-align = <0x1000>;
			qcom,memory-fixed = <0x0dc00000 0x1e00000>;
			qcom,ion-heap-type = "CARVEOUT";
		};
	};
};
+9 −3
Original line number Diff line number Diff line
@@ -16,16 +16,19 @@
		#address-cells = <1>;
		#size-cells = <0>;

		qcom,ion-heap@30 { /* SYSTEM HEAP */
		qcom,ion-heap@30 {
			reg = <30>;
			qcom,ion-heap-type = "SYSTEM";
		};

		qcom,ion-heap@21 { /* SYSTEM CONTIG HEAP */
		qcom,ion-heap@21 {
			reg = <21>;
			qcom,ion-heap-type = "SYSTEM_CONTIG";
		};

		qcom,ion-heap@25 { /* IOMMU HEAP */
		qcom,ion-heap@25 {
			reg = <25>;
			qcom,ion-heap-type = "IOMMU";
		};

		qcom,ion-heap@8 { /* CP_MM HEAP */
@@ -33,6 +36,7 @@
			reg = <8>;
			qcom,heap-align = <0x1000>;
			linux,contiguous-region = <&secure_mem>;
			qcom,ion-heap-type = "SECURE_DMA";
		};

		qcom,ion-heap@23 { /* OTHER PIL HEAP */
@@ -40,12 +44,14 @@
			reg = <23>;
			qcom,heap-align = <0x1000>;
			qcom,memory-fixed = <0x0db00000 0x1d00000>;
			qcom,ion-heap-type = "CARVEOUT";
		};

		qcom,ion-heap@27 { /* QSECOM HEAP */
			compatible = "qcom,msm-ion-reserve";
			reg = <27>;
			linux,contiguous-region = <&qsecom_mem>;
			qcom,ion-heap-type = "DMA";
		};
	};
};
Loading