<commit_before>* Memory reservations for MSM targets

Large contiguous allocations (generally sizes greater than 64KB) must be
allocated from a carved out memory pool. The size of the carved out pools
is based on the sizes drivers need. To properly size the pools, devices
must specify the size and type of the memory needed. Any driver wanting to
allocate contiguous memory should indicate this via device tree bindings:

Required parameters:
- qcom,memory-reservation-type: type of memory to be reserved. This is a
string defined in arch/arm/mach-msm/memory.c
- qcom,memory-reservation-size: size of memory to be reserved

Example:

	qcom,a-driver {
		compatible = "qcom,a-driver";
		qcom,memory-reservation-type = "EBI1" /* reserve EBI memory */
		qcom,memory-reservation-size = <0x400000>; /* size 4MB */
	};

Under some circumstances, it may be necessary to remove a chunk of memory
from the kernel completely using memblock remove. Note this is different
than adjusting the memory tags passed in via the bootloader as the virtual
range is not affected. Any driver needing to remove a block of memory should
add the appropriate binding:

Required parameters:
- qcom,memblock-remove: base and size of block to be removed

	qcom,a-driver {
		compatible = "qcom,a-driver";
		/* Remove 4MB at 0x200000*/
		qcom,memblock-remove = <0x200000 0x400000>;
	};

In order to ensure memory is only reserved when a driver is actually enabled,
drivers are required to add EXPORT_COMPAT(<name of compatible string>) some
where in the driver. For the examples above, the driver must add
EXPORT_COMPAT("qcom,a-driver") to the driver, similar to EXPORT_SYMBOL.
The EXPORT_COMPAT is to ensure that memory is only carved out if the
driver is actually enabled, otherwise the memory will not be used.

If a reservation is needed that isn't associated directly with any one
driver, the compatible string "qcom,msm-contig-mem" can be used. For
example:

	qcom,msm-contig-mem {
		compatible = "qcom,msm-contig-mem";
		qcom,memory-reservation-type = "EBI1";
		qcom,memory-reservation-size = <0x280000>; /* 2.5M EBI1 buffer */
	};


In order to specify the size and address of the fixed memory which has
previously been removed the memory-fixed binding can be used. This assumes
that the region has been removed by a separate memblock-remove property
present in the device tree.

Required parameters:
-qcom,memory-fixed: base and size of the fixed memory region

	qcom,a-driver {
		compatible = "qcom,a-driver";
		/* Fixed Memory region of 4MB at 0x200000*/
		qcom,memory-fixed = <0x200000 0x400000>;
	};

This region is assumed to be a part of a separate hole that has been removed
and this binding specifies the fixed location and size of the region within
that hole.<commit_msg>msm: Add bindings for memblock_reserve memory<commit_after>* Memory reservations for MSM targets

Large contiguous allocations (generally sizes greater than 64KB) must be
allocated from a carved out memory pool. The size of the carved out pools
is based on the sizes drivers need. To properly size the pools, devices
must specify the size and type of the memory needed. Any driver wanting to
allocate contiguous memory should indicate this via device tree bindings:

Required parameters:
- qcom,memory-reservation-type: type of memory to be reserved. This is a
string defined in arch/arm/mach-msm/memory.c
- qcom,memory-reservation-size: size of memory to be reserved

Example:

	qcom,a-driver {
		compatible = "qcom,a-driver";
		qcom,memory-reservation-type = "EBI1" /* reserve EBI memory */
		qcom,memory-reservation-size = <0x400000>; /* size 4MB */
	};

Under some circumstances, it may be necessary to remove a chunk of memory
from the kernel completely using memblock remove. Note this is different
than adjusting the memory tags passed in via the bootloader as the virtual
range is not affected. Any driver needing to remove a block of memory should
add the appropriate binding:

Required parameters:
- qcom,memblock-remove: base and size of block to be removed

	qcom,a-driver {
		compatible = "qcom,a-driver";
		/* Remove 4MB at 0x200000*/
		qcom,memblock-remove = <0x200000 0x400000>;
	};

In order to ensure memory is only reserved when a driver is actually enabled,
drivers are required to add EXPORT_COMPAT(<name of compatible string>) some
where in the driver. For the examples above, the driver must add
EXPORT_COMPAT("qcom,a-driver") to the driver, similar to EXPORT_SYMBOL.
The EXPORT_COMPAT is to ensure that memory is only carved out if the
driver is actually enabled, otherwise the memory will not be used.

If a reservation is needed that isn't associated directly with any one
driver, the compatible string "qcom,msm-contig-mem" can be used. For
example:

	qcom,msm-contig-mem {
		compatible = "qcom,msm-contig-mem";
		qcom,memory-reservation-type = "EBI1";
		qcom,memory-reservation-size = <0x280000>; /* 2.5M EBI1 buffer */
	};


In order to specify the size and address of the fixed memory which has
previously been removed the memory-fixed binding can be used. This assumes
that the region has been removed by a separate memblock-remove property
present in the device tree.

Required parameters:
-qcom,memory-fixed: base and size of the fixed memory region

	qcom,a-driver {
		compatible = "qcom,a-driver";
		/* Fixed Memory region of 4MB at 0x200000*/
		qcom,memory-fixed = <0x200000 0x400000>;
	};

This region is assumed to be a part of a separate hole that has been removed
and this binding specifies the fixed location and size of the region within
that hole.


Some drivers may only wish to reserve memory from the system. Reserved memory
is still tracked internally by the Linux page allocator. The memory is reserved
from the buddy allocator at bootup but may be freed back at a later point in
time with memblock_free and free_bootmem_late.

Required parameters:
-qcom,memblock-reserve: base and size of block to be reserved. Drivers should
call memblock_is_reserved before attempting to use the base address to ensure
the memory was completely reserved.

	qcom,a-driver {
		compatible = "qcom,a-driver";
		/* reserve a 4MB region @ 0x200000 for use later */
		qcom,memblock-reserve = <0x200000 0x400000>;
	};
{'fraction_non_alphanumeric': 0.06337687469762941, 'fraction_numerical': 0.0248347040799871, 'mean_word_length': 4.379011274934952, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2274005', 'n_tokens_mistral': 1895, 'n_tokens_neox': 1726, 'n_words': 842}