summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Stiffler <j-stiffler@ti.com>2015-10-29 18:06:06 +0000
committerDenys Dmytriyenko <denys@ti.com>2015-10-29 15:38:21 -0400
commit31e0f4b5aa98481160ea2fb85a51d05b8135cd46 (patch)
tree1d4600f408bd4103d8dd7a3f0a9a0e416cba0c5e
parentb1b013c158dc172dbef850511a8a12e963714715 (diff)
downloadmeta-ti-31e0f4b5aa98481160ea2fb85a51d05b8135cd46.tar.gz
linux: cmem.inc: Implement way to configure more complex CMEM config
* Supply the entire cmem.dtsi per machine - Disabled by default - Currently only supported for dra7xx and k2hk-evm * Enable by setting RESERVE_CMEM = "1" Signed-off-by: Jacob Stiffler <j-stiffler@ti.com> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
-rw-r--r--recipes-kernel/linux/cmem.inc9
-rw-r--r--recipes-kernel/linux/files/cmem.dtsi42
-rw-r--r--recipes-kernel/linux/files/dra7xx/cmem.dtsi26
-rw-r--r--recipes-kernel/linux/files/k2hk-evm/cmem.dtsi54
4 files changed, 110 insertions, 21 deletions
diff --git a/recipes-kernel/linux/cmem.inc b/recipes-kernel/linux/cmem.inc
index 742f3c80..fc0bf48d 100644
--- a/recipes-kernel/linux/cmem.inc
+++ b/recipes-kernel/linux/cmem.inc
@@ -1,17 +1,12 @@
1SRC_URI += "file://cmem.dtsi" 1SRC_URI += "file://cmem.dtsi"
2 2
3CMEM_BASE ?= "" 3RESERVE_CMEM ?= "0"
4CMEM_SIZE ?= ""
5 4
6do_setup_cmem() { 5do_setup_cmem() {
7 if [ ! -z "${CMEM_BASE}" ] 6 if [ "${RESERVE_CMEM}" == "1" ]
8 then 7 then
9 cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi 8 cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
10 9
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} 10 for dtb in ${KERNEL_DEVICETREE}
16 do 11 do
17 dts=`echo $dtb | sed -e 's|dtb$|dts|'` 12 dts=`echo $dtb | sed -e 's|dtb$|dts|'`
diff --git a/recipes-kernel/linux/files/cmem.dtsi b/recipes-kernel/linux/files/cmem.dtsi
index 6b1da990..23119861 100644
--- a/recipes-kernel/linux/files/cmem.dtsi
+++ b/recipes-kernel/linux/files/cmem.dtsi
@@ -1,24 +1,38 @@
1/*
2 * This is a placeholder for CMEM reserved memory declarations. This
3 * is simply an example and does not actually reserve any memory for
4 * CMEM.
5 *
6 * The commented sections below provide an example for how to provide
7 * a reserved memory region for CMEM to use as a buffer pool.
8 */
1/ { 9/ {
2 reserved-memory { 10/*
3 cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ { 11 reserved-memory {
4 reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>; 12 cmem_block_mem_0: cmem_block_mem@a0000000 {
5 no-map; 13 reg = <0x0 0xa0000000 0x0 0x0a000000>;
6 status = "okay"; 14 no-map;
7 }; 15 status = "okay";
8 }; 16 };
17 };
18*/
9 19
10 cmem { 20 cmem {
11 compatible = "ti,cmem"; 21 compatible = "ti,cmem";
12 #address-cells = <1>; 22 #address-cells = <1>;
13 #size-cells = <0>; 23 #size-cells = <0>;
14 24
15 status = "okay"; 25 #pool-size-cells = <2>;
26
27 status = "disabled";
28/*
29 status = "okay";
16 30
17 cmem_block_0: cmem_block@0 { 31 cmem_block_0: cmem_block@0 {
18 reg = <0>; 32 reg = <0>;
19 memory-region = <&cmem_block_mem_0>; 33 memory-region = <&cmem_block_mem_0>;
20 cmem-buf-pools = <1 0x__CMEM_SIZE__>; 34 cmem-buf-pools = <1 0x0 0x0a000000>;
21 }; 35 };
36*/
22 }; 37 };
23
24}; 38};
diff --git a/recipes-kernel/linux/files/dra7xx/cmem.dtsi b/recipes-kernel/linux/files/dra7xx/cmem.dtsi
new file mode 100644
index 00000000..d91faf9c
--- /dev/null
+++ b/recipes-kernel/linux/files/dra7xx/cmem.dtsi
@@ -0,0 +1,26 @@
1/ {
2 reserved-memory {
3 cmem_block_mem_0: cmem_block_mem@a0000000 {
4 reg = <0x0 0xa0000000 0x0 0x0a000000>;
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 #pool-size-cells = <2>;
16
17 status = "okay";
18
19 cmem_block_0: cmem_block@0 {
20 reg = <0>;
21 memory-region = <&cmem_block_mem_0>;
22 cmem-buf-pools = <1 0x0 0x0a000000>;
23 };
24 };
25
26};
diff --git a/recipes-kernel/linux/files/k2hk-evm/cmem.dtsi b/recipes-kernel/linux/files/k2hk-evm/cmem.dtsi
new file mode 100644
index 00000000..7e897abc
--- /dev/null
+++ b/recipes-kernel/linux/files/k2hk-evm/cmem.dtsi
@@ -0,0 +1,54 @@
1/ {
2 reserved-memory {
3 mpm_block_mem_0: mpm_block_mem@820000000 {
4 reg = <0x00000008 0x20000000 0x00000000 0x02000000>;
5 no-map;
6 status = "okay";
7 };
8
9 cmem_block_mem_0: cmem_block_mem@829000000 {
10 reg = <0x00000008 0x29000000 0x00000000 0x57000000>;
11 no-map;
12 status = "okay";
13 };
14
15 cmem_block_mem_1: cmem_block_mem@00c100000 {
16 reg = <0x00000000 0x0c100000 0x00000000 0x00480000>;
17 no-map;
18 status = "okay";
19 };
20
21 cmem_block_mem_2: cmem_block_mem@822000000 {
22 reg = <0x00000008 0x22000000 0x00000000 0x07000000>;
23 no-map;
24 status = "okay";
25 };
26 };
27
28 cmem {
29 compatible = "ti,cmem";
30 #address-cells = <1>;
31 #size-cells = <0>;
32
33 #pool-size-cells = <2>;
34
35 status = "okay";
36
37 cmem_block_0: cmem_block@0 {
38 reg = <0>;
39 memory-region = <&cmem_block_mem_0>;
40 cmem-buf-pools = <1 0x00000000 0x57000000>;
41 };
42
43 cmem_block_1: cmem_block@1 {
44 reg = <1>;
45 memory-region = <&cmem_block_mem_1>;
46 };
47
48 cmem_block_2: cmem_block@2 {
49 reg = <2>;
50 memory-region = <&cmem_block_mem_2>;
51 };
52 };
53
54};