diff options
author | Jacob Stiffler <j-stiffler@ti.com> | 2015-05-20 00:55:27 +0000 |
---|---|---|
committer | Denys Dmytriyenko <denys@ti.com> | 2015-05-19 15:31:05 -0400 |
commit | 3ae905f31e0dcbb86cd79335def95f69b494ff61 (patch) | |
tree | 7417f2ed456cd40887515699c02317bf2f3f9572 /recipes-kernel | |
parent | 8a90b7e9487bcac3e8250c0eaeac35a35d1538fb (diff) | |
download | meta-ti-3ae905f31e0dcbb86cd79335def95f69b494ff61.tar.gz |
linux/cmem.inc: Support reserving memory for CMEM.
To reserve contiguous memory for CMEM:
* include the "recipes-kernel/linux/cmem.inc"
* Set CMEM_BASE and CMEM_SIZE to the physical memory address and size,
respectively, to reserve for CMEM.
Currently limited to reserving a single memory region used to create
a single buffer pool of a single buffer.
Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Diffstat (limited to 'recipes-kernel')
-rw-r--r-- | recipes-kernel/linux/cmem.inc | 23 | ||||
-rw-r--r-- | recipes-kernel/linux/files/cmem.dtsi | 24 |
2 files changed, 47 insertions, 0 deletions
diff --git a/recipes-kernel/linux/cmem.inc b/recipes-kernel/linux/cmem.inc new file mode 100644 index 00000000..742f3c80 --- /dev/null +++ b/recipes-kernel/linux/cmem.inc | |||
@@ -0,0 +1,23 @@ | |||
1 | SRC_URI += "file://cmem.dtsi" | ||
2 | |||
3 | CMEM_BASE ?= "" | ||
4 | CMEM_SIZE ?= "" | ||
5 | |||
6 | do_setup_cmem() { | ||
7 | if [ ! -z "${CMEM_BASE}" ] | ||
8 | then | ||
9 | cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi | ||
10 | |||
11 | sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \ | ||
12 | -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \ | ||
13 | ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi | ||
14 | |||
15 | for dtb in ${KERNEL_DEVICETREE} | ||
16 | do | ||
17 | dts=`echo $dtb | sed -e 's|dtb$|dts|'` | ||
18 | echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/$dts | ||
19 | done | ||
20 | fi | ||
21 | } | ||
22 | |||
23 | do_patch[postfuncs] += "do_setup_cmem" | ||
diff --git a/recipes-kernel/linux/files/cmem.dtsi b/recipes-kernel/linux/files/cmem.dtsi new file mode 100644 index 00000000..6b1da990 --- /dev/null +++ b/recipes-kernel/linux/files/cmem.dtsi | |||
@@ -0,0 +1,24 @@ | |||
1 | / { | ||
2 | reserved-memory { | ||
3 | cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ { | ||
4 | reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>; | ||
5 | no-map; | ||
6 | status = "okay"; | ||
7 | }; | ||
8 | }; | ||
9 | |||
10 | cmem { | ||
11 | compatible = "ti,cmem"; | ||
12 | #address-cells = <1>; | ||
13 | #size-cells = <0>; | ||
14 | |||
15 | status = "okay"; | ||
16 | |||
17 | cmem_block_0: cmem_block@0 { | ||
18 | reg = <0>; | ||
19 | memory-region = <&cmem_block_mem_0>; | ||
20 | cmem-buf-pools = <1 0x__CMEM_SIZE__>; | ||
21 | }; | ||
22 | }; | ||
23 | |||
24 | }; | ||