summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux')
-rw-r--r--recipes-kernel/linux/cmem.inc23
-rw-r--r--recipes-kernel/linux/files/cmem.dtsi24
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 @@
1SRC_URI += "file://cmem.dtsi"
2
3CMEM_BASE ?= ""
4CMEM_SIZE ?= ""
5
6do_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
23do_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};