Skip to contentSkip to conversation

linux/cmem.inc: Support reserving memory for CMEM.

PATCH Superseded Jacob Stiffler 2 participants 17 messages May 18, 2015 – May 19, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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.

---
 recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
 recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 recipes-kernel/linux/cmem.inc
 create mode 100644 recipes-kernel/linux/linux/cmem.dtsi
recipes-kernel/linux/cmem.inc new file +22 -0
new file mode 100644
index 0000000..207bdc6
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"
+
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 2/2 linux-ti-staging-3.14: Allow CMEM DT injection.

* Disabled by default.

---
 recipes-kernel/linux/linux-ti-staging_3.14.bb |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
recipes-kernel/linux/linux-ti-staging_3.14.bb +2 -1
index eb1ad27..7e67719 100644
@@ -8,6 +8,7 @@ inherit kernel
 require recipes-kernel/linux/linux-dtb.inc
 require recipes-kernel/linux/setup-defconfig.inc
 require recipes-kernel/linux/multi-kernel.inc
+require recipes-kernel/linux/cmem.inc
 
 # Look in the generic major.minor directory for files
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-3.14:"
@@ -49,7 +50,7 @@ SRCREV = "7763988e04f12b089283e385f3593e7f34a92068"
 PV = "3.14.42"
 
 # Append to the MACHINE_KERNEL_PR so that a new SRCREV will cause a rebuild
-MACHINE_KERNEL_PR_append = "a+gitr${SRCPV}"
+MACHINE_KERNEL_PR_append = "b+gitr${SRCPV}"
 PR = "${MACHINE_KERNEL_PR}"
 
 KERNEL_CONFIG_DIR = "${S}/ti_config_fragments"
Signature · 1 line
1.7.9.5
#2 lore raw
In reply to Jacob Stiffler
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 14 lines
---
 recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
 recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 recipes-kernel/linux/cmem.inc
 create mode 100644 recipes-kernel/linux/linux/cmem.dtsi
recipes-kernel/linux/cmem.inc new file +0 -0
new file mode 100644
index 0000000..207bdc6

recipes-kernel/linux/cmem.inc line 1

Quoted 1 line
recipes-kernel/linux/cmem.inc new file +1 -0
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

recipes-kernel/linux/cmem.inc line 8

Quoted 6 lines
recipes-kernel/linux/cmem.inc new file +6 -0
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

Quoted 52 lines
recipes-kernel/linux/cmem.inc new file +14 -0
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
#3 lore raw
Quoted 19 lines · Denys Dmytriyenko
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 8 lines
---
  recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
  recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
  2 files changed, 46 insertions(+)

create mode 100644 recipes-kernel/linux/cmem.inc create mode 100644 recipes-kernel/linux/linux/cmem.dtsi

Quoted 9 lines

recipes-kernel/linux/cmem.inc line 1

Quoted 7 lines
recipes-kernel/linux/cmem.inc new file +1 -0
new file mode 100644
index 0000000..207bdc6
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines

recipes-kernel/linux/cmem.inc line 8

Quoted 6 lines
recipes-kernel/linux/cmem.inc new file +6 -0
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Quoted 52 lines
Quoted 52 lines
recipes-kernel/linux/cmem.inc new file +14 -0
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
#4 lore raw
Quoted 45 lines · Jacob Stiffler
Quoted 19 lines · Denys Dmytriyenko
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 8 lines
---
 recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
 recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 recipes-kernel/linux/cmem.inc
 create mode 100644 recipes-kernel/linux/linux/cmem.dtsi
Quoted 9 lines

recipes-kernel/linux/cmem.inc line 1

Quoted 7 lines
recipes-kernel/linux/cmem.inc new file +1 -0
new file mode 100644
index 0000000..207bdc6
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines

recipes-kernel/linux/cmem.inc line 8

Quoted 6 lines
recipes-kernel/linux/cmem.inc new file +6 -0
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

Quoted 53 lines
Quoted 52 lines
Quoted 52 lines
recipes-kernel/linux/cmem.inc new file +14 -0
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
#5 lore raw
Quoted 43 lines · Denys Dmytriyenko
Quoted 42 lines · Jacob Stiffler
Quoted 19 lines · Denys Dmytriyenko
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 8 lines
---
  recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
  recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
  2 files changed, 46 insertions(+)

create mode 100644 recipes-kernel/linux/cmem.inc create mode 100644 recipes-kernel/linux/linux/cmem.dtsi

Quoted 9 lines

recipes-kernel/linux/cmem.inc line 1

Quoted 7 lines
recipes-kernel/linux/cmem.inc new file +1 -0
new file mode 100644
index 0000000..207bdc6
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines

recipes-kernel/linux/cmem.inc line 8

Quoted 6 lines
recipes-kernel/linux/cmem.inc new file +6 -0
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

Quoted 9 lines
Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

This should be called before do_create_srcipk(). But I suppose it should not be assumed that do_create_srcipk() will be run for a general kernel recipe.

Should do_setup_cmem() be a postfunc of do_configure()? For example:

do_configure[postfuncs] += "do_setup_cmem"

Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
recipes-kernel/linux/cmem.inc new file +14 -0
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
#6 lore raw
Quoted 56 lines · Jacob Stiffler
Quoted 43 lines · Denys Dmytriyenko
Quoted 42 lines · Jacob Stiffler
Quoted 19 lines · Denys Dmytriyenko
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 8 lines
---
 recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
 recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 recipes-kernel/linux/cmem.inc
 create mode 100644 recipes-kernel/linux/linux/cmem.dtsi
Quoted 9 lines

recipes-kernel/linux/cmem.inc line 1

Quoted 7 lines
recipes-kernel/linux/cmem.inc new file +1 -0
new file mode 100644
index 0000000..207bdc6
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines

recipes-kernel/linux/cmem.inc line 8

Quoted 6 lines
recipes-kernel/linux/cmem.inc new file +6 -0
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

Quoted 9 lines
Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

Quoted 7 lines

This should be called before do_create_srcipk(). But I suppose it should not be assumed that do_create_srcipk() will be run for a general kernel recipe.

Should do_setup_cmem() be a postfunc of do_configure()? For example:

do_configure[postfuncs] += "do_setup_cmem"

Will it be called multiple times after each do_configure?

Quoted 53 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
recipes-kernel/linux/cmem.inc new file +14 -0
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
#7 lore raw
Quoted 54 lines · Denys Dmytriyenko
Quoted 53 lines · Jacob Stiffler
Quoted 51 lines · Denys Dmytriyenko
Quoted 41 lines · Jacob Stiffler
Quoted 19 lines · Denys Dmytriyenko
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 8 lines
---
  recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
  recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
  2 files changed, 46 insertions(+)

create mode 100644 recipes-kernel/linux/cmem.inc create mode 100644 recipes-kernel/linux/linux/cmem.dtsi

Quoted 9 lines

recipes-kernel/linux/cmem.inc line 1

Quoted 7 lines
recipes-kernel/linux/cmem.inc new file +1 -0
new file mode 100644
index 0000000..207bdc6
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines

recipes-kernel/linux/cmem.inc line 8

Quoted 6 lines
recipes-kernel/linux/cmem.inc new file +6 -0
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

Quoted 9 lines
Quoted 7 lines

This should be called before do_create_srcipk(). But I suppose it should not be assumed that do_create_srcipk() will be run for a general kernel recipe.

Should do_setup_cmem() be a postfunc of do_configure()? For example:

do_configure[postfuncs] += "do_setup_cmem"

Will it be called multiple times after each do_configure?

Sorry, I had meant do_patch().

Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
recipes-kernel/linux/cmem.inc new file +14 -0
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
#8 lore raw
Quoted 61 lines · Jacob Stiffler
Quoted 58 lines · Denys Dmytriyenko
Quoted 57 lines · Jacob Stiffler
Quoted 42 lines · Denys Dmytriyenko
Quoted 41 lines · Jacob Stiffler
Quoted 19 lines · Denys Dmytriyenko
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 8 lines
---
 recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
 recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 recipes-kernel/linux/cmem.inc
 create mode 100644 recipes-kernel/linux/linux/cmem.dtsi
Quoted 9 lines

recipes-kernel/linux/cmem.inc line 1

Quoted 7 lines
recipes-kernel/linux/cmem.inc new file +1 -0
new file mode 100644
index 0000000..207bdc6
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines

recipes-kernel/linux/cmem.inc line 7

Quoted 6 lines
recipes-kernel/linux/cmem.inc new file +6 -0
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

Quoted 9 lines
Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

This should be called before do_create_srcipk(). But I suppose it should not be assumed that do_create_srcipk() will be run for a general kernel recipe.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Should do_setup_cmem() be a postfunc of do_configure()? For example:

do_configure[postfuncs] += "do_setup_cmem"

Will it be called multiple times after each do_configure?

Sorry, I had meant do_patch().

BTW, are you sure you want it before create_srcipk? It won't package the changes then...

Quoted 53 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
recipes-kernel/linux/cmem.inc new file +14 -0
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
#9 lore raw
Quoted 60 lines · Denys Dmytriyenko
Quoted 59 lines · Jacob Stiffler
Quoted 57 lines · Denys Dmytriyenko
Quoted 56 lines · Jacob Stiffler
Quoted 42 lines · Denys Dmytriyenko
Quoted 41 lines · Jacob Stiffler
Quoted 19 lines · Denys Dmytriyenko
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 8 lines
---
  recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
  recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
  2 files changed, 46 insertions(+)

create mode 100644 recipes-kernel/linux/cmem.inc create mode 100644 recipes-kernel/linux/linux/cmem.dtsi

Quoted 9 lines

recipes-kernel/linux/cmem.inc line 1

Quoted 7 lines
recipes-kernel/linux/cmem.inc new file +1 -0
new file mode 100644
index 0000000..207bdc6
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines

recipes-kernel/linux/cmem.inc line 7

Quoted 6 lines
recipes-kernel/linux/cmem.inc new file +6 -0
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

Quoted 9 lines
Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

This should be called before do_create_srcipk(). But I suppose it should not be assumed that do_create_srcipk() will be run for a general kernel recipe.

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Should do_setup_cmem() be a postfunc of do_configure()? For example:

do_configure[postfuncs] += "do_setup_cmem"

Will it be called multiple times after each do_configure?

Sorry, I had meant do_patch().

BTW, are you sure you want it before create_srcipk? It won't package the changes then...

I thought it would have to be done before create_srcipk, since create_srcipk pulls the ${S} directory into the sourceipk. If this is done after create_srcipk, then there will not be any way for these changes to be packaged, correct?

Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
recipes-kernel/linux/cmem.inc new file +14 -0
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
#10 lore raw
Quoted 69 lines · Jacob Stiffler
Quoted 66 lines · Denys Dmytriyenko
Quoted 65 lines · Jacob Stiffler
Quoted 53 lines · Denys Dmytriyenko
Quoted 52 lines · Jacob Stiffler
Quoted 51 lines · Denys Dmytriyenko
Quoted 41 lines · Jacob Stiffler
Quoted 19 lines · Denys Dmytriyenko
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 8 lines
---
 recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
 recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 recipes-kernel/linux/cmem.inc
 create mode 100644 recipes-kernel/linux/linux/cmem.dtsi
Quoted 9 lines

recipes-kernel/linux/cmem.inc line 1

Quoted 7 lines
recipes-kernel/linux/cmem.inc new file +1 -0
new file mode 100644
index 0000000..207bdc6
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines

recipes-kernel/linux/cmem.inc line 7

Quoted 6 lines
recipes-kernel/linux/cmem.inc new file +6 -0
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

Quoted 9 lines
Quoted 7 lines

This should be called before do_create_srcipk(). But I suppose it should not be assumed that do_create_srcipk() will be run for a general kernel recipe.

Should do_setup_cmem() be a postfunc of do_configure()? For example:

do_configure[postfuncs] += "do_setup_cmem"

Will it be called multiple times after each do_configure?

Sorry, I had meant do_patch().

Quoted 8 lines
Quoted 3 lines

BTW, are you sure you want it before create_srcipk? It won't package the changes then...

I thought it would have to be done before create_srcipk, since create_srcipk pulls the ${S} directory into the sourceipk. If this is done after create_srcipk, then there will not be any way for these changes to be packaged, correct?

Oops, you are correct. I was thinking backwards...
So, do_create_srcipk is also being re-called in do_compile_prepend, so it would pick up those changes.

Quoted 53 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
recipes-kernel/linux/cmem.inc new file +14 -0
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
#11 lore raw
Quoted 71 lines · Denys Dmytriyenko
Quoted 70 lines · Jacob Stiffler
Quoted 68 lines · Denys Dmytriyenko
Quoted 58 lines · Jacob Stiffler
Quoted 57 lines · Denys Dmytriyenko
Quoted 56 lines · Jacob Stiffler
Quoted 42 lines · Denys Dmytriyenko
Quoted 41 lines · Jacob Stiffler
Quoted 19 lines · Denys Dmytriyenko
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 8 lines
---
  recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
  recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
  2 files changed, 46 insertions(+)

create mode 100644 recipes-kernel/linux/cmem.inc create mode 100644 recipes-kernel/linux/linux/cmem.dtsi

Quoted 9 lines

recipes-kernel/linux/cmem.inc line 1

Quoted 7 lines
recipes-kernel/linux/cmem.inc new file +1 -0
new file mode 100644
index 0000000..207bdc6
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines

recipes-kernel/linux/cmem.inc line 7

Quoted 6 lines
recipes-kernel/linux/cmem.inc new file +6 -0
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

Quoted 9 lines
Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

This should be called before do_create_srcipk(). But I suppose it should not be assumed that do_create_srcipk() will be run for a general kernel recipe.

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Should do_setup_cmem() be a postfunc of do_configure()? For example:

do_configure[postfuncs] += "do_setup_cmem"

Will it be called multiple times after each do_configure?

Sorry, I had meant do_patch().

BTW, are you sure you want it before create_srcipk? It won't package the changes then...

Quoted 8 lines
Quoted 4 lines

I thought it would have to be done before create_srcipk, since create_srcipk pulls the ${S} directory into the sourceipk. If this is done after create_srcipk, then there will not be any way for these changes to be packaged, correct?

Oops, you are correct. I was thinking backwards...
So, do_create_srcipk is also being re-called in do_compile_prepend, so it would pick up those changes.

But that is only for the case with the meta-arago bbappend, through copy-defconfig.inc.

Any reason it would be better to make this change after do_configure()?

Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
Quoted 52 lines
recipes-kernel/linux/cmem.inc new file +14 -0
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
#12 lore raw
Quoted 78 lines · Jacob Stiffler
Quoted 75 lines · Denys Dmytriyenko
Quoted 74 lines · Jacob Stiffler
Quoted 59 lines · Denys Dmytriyenko
Quoted 58 lines · Jacob Stiffler
Quoted 57 lines · Denys Dmytriyenko
Quoted 56 lines · Jacob Stiffler
Quoted 42 lines · Denys Dmytriyenko
Quoted 41 lines · Jacob Stiffler
Quoted 19 lines · Denys Dmytriyenko
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 8 lines
---
 recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
 recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 recipes-kernel/linux/cmem.inc
 create mode 100644 recipes-kernel/linux/linux/cmem.dtsi
Quoted 9 lines

recipes-kernel/linux/cmem.inc line 1

Quoted 7 lines
recipes-kernel/linux/cmem.inc new file +1 -0
new file mode 100644
index 0000000..207bdc6
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines

recipes-kernel/linux/cmem.inc line 7

Quoted 6 lines
recipes-kernel/linux/cmem.inc new file +6 -0
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

Quoted 9 lines
Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

This should be called before do_create_srcipk(). But I suppose it should not be assumed that do_create_srcipk() will be run for a general kernel recipe.

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Should do_setup_cmem() be a postfunc of do_configure()? For example:

do_configure[postfuncs] += "do_setup_cmem"

Will it be called multiple times after each do_configure?

Sorry, I had meant do_patch().

BTW, are you sure you want it before create_srcipk? It won't package the changes then...

I thought it would have to be done before create_srcipk, since create_srcipk pulls the ${S} directory into the sourceipk. If this is done after create_srcipk, then there will not be any way for these changes to be packaged, correct?

Quoted 7 lines
Quoted 4 lines

Oops, you are correct. I was thinking backwards...
So, do_create_srcipk is also being re-called in do_compile_prepend, so it would pick up those changes.

But that is only for the case with the meta-arago bbappend, through copy-defconfig.inc.

And srcipk is specific to meta-arago as well...

Quoted 1 line

Any reason it would be better to make this change after do_configure()?

Nope, nothing specifically depending on do_configure here, AFAICS.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

recipes-kernel/linux/cmem.inc line 18

Quoted 11 lines
recipes-kernel/linux/cmem.inc new file +11 -0
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts

BTW, is that bashism at the end of the line ^^^^^^^^^^^

Quoted 42 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
recipes-kernel/linux/cmem.inc new file +3 -0
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
#13 lore raw
Quoted 81 lines · Denys Dmytriyenko
Quoted 80 lines · Jacob Stiffler
Quoted 78 lines · Denys Dmytriyenko
Quoted 65 lines · Jacob Stiffler
Quoted 64 lines · Denys Dmytriyenko
Quoted 63 lines · Jacob Stiffler
Quoted 62 lines · Denys Dmytriyenko
Quoted 52 lines · Jacob Stiffler
Quoted 42 lines · Denys Dmytriyenko
Quoted 41 lines · Jacob Stiffler
Quoted 19 lines · Denys Dmytriyenko
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 8 lines
---
  recipes-kernel/linux/cmem.inc        |   22 ++++++++++++++++++++++
  recipes-kernel/linux/linux/cmem.dtsi |   24 ++++++++++++++++++++++++
  2 files changed, 46 insertions(+)

create mode 100644 recipes-kernel/linux/cmem.inc create mode 100644 recipes-kernel/linux/linux/cmem.dtsi

Quoted 9 lines

recipes-kernel/linux/cmem.inc line 1

Quoted 7 lines
recipes-kernel/linux/cmem.inc new file +1 -0
new file mode 100644
index 0000000..207bdc6
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines

recipes-kernel/linux/cmem.inc line 7

Quoted 6 lines
recipes-kernel/linux/cmem.inc new file +6 -0
+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

Quoted 9 lines
Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

Quoted 7 lines

This should be called before do_create_srcipk(). But I suppose it should not be assumed that do_create_srcipk() will be run for a general kernel recipe.

Should do_setup_cmem() be a postfunc of do_configure()? For example:

do_configure[postfuncs] += "do_setup_cmem"

Will it be called multiple times after each do_configure?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Sorry, I had meant do_patch().

BTW, are you sure you want it before create_srcipk? It won't package the changes then...

I thought it would have to be done before create_srcipk, since create_srcipk pulls the ${S} directory into the sourceipk. If this is done after create_srcipk, then there will not be any way for these changes to be packaged, correct?

Oops, you are correct. I was thinking backwards...
So, do_create_srcipk is also being re-called in do_compile_prepend, so it would pick up those changes.

Quoted 8 lines
Quoted 2 lines

But that is only for the case with the meta-arago bbappend, through copy-defconfig.inc.

And srcipk is specific to meta-arago as well...

Quoted 1 line

Any reason it would be better to make this change after do_configure()?

Nope, nothing specifically depending on do_configure here, AFAICS.

Then it seems that having as a do_patch() postfunc would be safest.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
recipes-kernel/linux/cmem.inc new file +4 -0
+    if [ ! -z "${CMEM_BASE}" ]
+    then
+        cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
Quoted 9 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

recipes-kernel/linux/cmem.inc line 18

Quoted 7 lines
recipes-kernel/linux/cmem.inc new file +7 -0
+        sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+               -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+               ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+        for dts in ${KERNEL_DEVICETREE}
+        do
+            echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts

BTW, is that bashism at the end of the line ^^^^^^^^^^^

The "${dts%.dtb}"? Yes. I am doing this to remove the .dtb extension and then append the .dts extension, since KERNEL_DEVICE tree contains the dtb extended filenames.

Is this an issue?

Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
recipes-kernel/linux/cmem.inc new file +3 -0
+        done
+    fi
+}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
new file mode 100644
index 0000000..6b1da99
@@ -0,0 +1,24 @@
+/ {
+        reserved-memory {
+                cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+                        reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+                        no-map;
+                        status = "okay";
+                };
+        };
+
+        cmem {
+                compatible = "ti,cmem";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                status = "okay";
+
+                cmem_block_0: cmem_block@0 {
+                        reg = <0>;
+                        memory-region = <&cmem_block_mem_0>;
+                        cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+                };
+        };
+
+};
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
#14 lore raw
Quoted 86 lines · Jacob Stiffler
Quoted 83 lines · Denys Dmytriyenko
Quoted 82 lines · Jacob Stiffler
Quoted 70 lines · Denys Dmytriyenko
Quoted 69 lines · Jacob Stiffler
Quoted 68 lines · Denys Dmytriyenko
Quoted 58 lines · Jacob Stiffler
Quoted 57 lines · Denys Dmytriyenko
Quoted 56 lines · Jacob Stiffler
Quoted 42 lines · Denys Dmytriyenko
Quoted 41 lines · Jacob Stiffler
Quoted 19 lines · Denys Dmytriyenko
Quoted 7 lines · Jacob Stiffler

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.

Looks good. 2 comments below.

Quoted 8 lines

Signed-off-by: Jacob Stiffler <[email protected]>
---
recipes-kernel/linux/cmem.inc | 22 ++++++++++++++++++++++
recipes-kernel/linux/linux/cmem.dtsi | 24 ++++++++++++++++++++++++
2 files changed, 46 insertions(+)
create mode 100644 recipes-kernel/linux/cmem.inc
create mode 100644 recipes-kernel/linux/linux/cmem.dtsi

Quoted 9 lines
Quoted 7 lines

diff --git a/recipes-kernel/linux/cmem.inc b/recipes-kernel/linux/cmem.inc
new file mode 100644
index 0000000..207bdc6
--- /dev/null
+++ b/recipes-kernel/linux/cmem.inc
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"

Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines
Quoted 6 lines

+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {

Should this be do_configure_append() instead? It would probably be safer, as do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes may not include it...

Quoted 9 lines
Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

This should be called before do_create_srcipk(). But I suppose it should not be assumed that do_create_srcipk() will be run for a general kernel recipe.

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Should do_setup_cmem() be a postfunc of do_configure()? For example:

do_configure[postfuncs] += "do_setup_cmem"

Will it be called multiple times after each do_configure?

Sorry, I had meant do_patch().

BTW, are you sure you want it before create_srcipk? It won't package the changes then...

Quoted 8 lines
Quoted 4 lines

I thought it would have to be done before create_srcipk, since create_srcipk pulls the ${S} directory into the sourceipk. If this is done after create_srcipk, then there will not be any way for these changes to be packaged, correct?

Oops, you are correct. I was thinking backwards...
So, do_create_srcipk is also being re-called in do_compile_prepend, so it would pick up those changes.

But that is only for the case with the meta-arago bbappend, through copy-defconfig.inc.

Quoted 8 lines
Quoted 6 lines

And srcipk is specific to meta-arago as well...

Quoted 1 line

Any reason it would be better to make this change after do_configure()?

Nope, nothing specifically depending on do_configure here, AFAICS.

Then it seems that having as a do_patch() postfunc would be safest.

Or addtask between do_patch and do_configure should be fine also.

Quoted 14 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

+ if [ ! -z "${CMEM_BASE}" ]
+ then
+ cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+

Quoted 9 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

+ sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+ -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+ ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+ for dts in ${KERNEL_DEVICETREE}
+ do
+ echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts

BTW, is that bashism at the end of the line ^^^^^^^^^^^

Quoted 5 lines

The "${dts%.dtb}"? Yes. I am doing this to remove the .dtb extension and then append the .dts extension, since KERNEL_DEVICE tree contains the dtb extended filenames.

Is this an issue?

Yes, I understand what's it's doing, but using bashisms is not safe - we've been trying to eliminate bashisms in upstream and our layers for some time. Shouldn't be adding more... :)

Quoted 42 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines

+ done
+ fi
+}
diff --git a/recipes-kernel/linux/linux/cmem.dtsi b/recipes-kernel/linux/linux/cmem.dtsi
new file mode 100644
index 0000000..6b1da99
--- /dev/null
+++ b/recipes-kernel/linux/linux/cmem.dtsi
@@ -0,0 +1,24 @@
+/ {
+ reserved-memory {
+ cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+ reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+ no-map;
+ status = "okay";
+ };
+ };
+
+ cmem {
+ compatible = "ti,cmem";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ status = "okay";
+
+ cmem_block_0: cmem_block@0 {
+ reg = <0>;
+ memory-region = <&cmem_block_mem_0>;
+ cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+ };
+ };
+
+};
--
1.7.9.5

--
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti

#15 lore raw
Quoted 85 lines · Denys Dmytriyenko
Quoted 84 lines · Jacob Stiffler
Quoted 82 lines · Denys Dmytriyenko
Quoted 81 lines · Jacob Stiffler
Quoted 70 lines · Denys Dmytriyenko
Quoted 69 lines · Jacob Stiffler
Quoted 68 lines · Denys Dmytriyenko
Quoted 58 lines · Jacob Stiffler
Quoted 57 lines · Denys Dmytriyenko
Quoted 56 lines · Jacob Stiffler
Quoted 42 lines · Denys Dmytriyenko
Quoted 41 lines · Jacob Stiffler
Quoted 28 lines · Denys Dmytriyenko

On Mon, May 18, 2015 at 08:20:58AM -0400, Jacob Stiffler wrote:
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.
Looks good. 2 comments below.

Signed-off-by: Jacob Stiffler <[email protected]>
---
recipes-kernel/linux/cmem.inc | 22 ++++++++++++++++++++++
recipes-kernel/linux/linux/cmem.dtsi | 24 ++++++++++++++++++++++++
2 files changed, 46 insertions(+)
create mode 100644 recipes-kernel/linux/cmem.inc
create mode 100644 recipes-kernel/linux/linux/cmem.dtsi

diff --git a/recipes-kernel/linux/cmem.inc b/recipes-kernel/linux/cmem.inc
new file mode 100644
index 0000000..207bdc6
--- /dev/null
+++ b/recipes-kernel/linux/cmem.inc
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"
Move the file into standard "files" directory and drop above line.

Ok.

Quoted 10 lines

+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {
Should this be do_configure_append() instead? It would probably be safer, as
do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes
may not include it...

Quoted 9 lines
Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

This should be called before do_create_srcipk(). But I suppose it should not be assumed that do_create_srcipk() will be run for a general kernel recipe.

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Should do_setup_cmem() be a postfunc of do_configure()? For example:

do_configure[postfuncs] += "do_setup_cmem"

Will it be called multiple times after each do_configure?

Sorry, I had meant do_patch().

BTW, are you sure you want it before create_srcipk? It won't package the changes then...

Quoted 8 lines
Quoted 4 lines

I thought it would have to be done before create_srcipk, since create_srcipk pulls the ${S} directory into the sourceipk. If this is done after create_srcipk, then there will not be any way for these changes to be packaged, correct?

Oops, you are correct. I was thinking backwards...
So, do_create_srcipk is also being re-called in do_compile_prepend, so it would pick up those changes.

But that is only for the case with the meta-arago bbappend, through copy-defconfig.inc.

Quoted 9 lines
Quoted 7 lines
Quoted 6 lines

And srcipk is specific to meta-arago as well...

Quoted 1 line

Any reason it would be better to make this change after do_configure()?

Nope, nothing specifically depending on do_configure here, AFAICS.

Then it seems that having as a do_patch() postfunc would be safest.

Or addtask between do_patch and do_configure should be fine also.

Then how can you be sure create_srcipk() will not run before before setup_cmem()?

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

+ if [ ! -z "${CMEM_BASE}" ]
+ then
+ cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+ sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+ -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+ ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+ for dts in ${KERNEL_DEVICETREE}
+ do
+ echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts

BTW, is that bashism at the end of the line ^^^^^^^^^^^

Quoted 9 lines
Quoted 5 lines

The "${dts%.dtb}"? Yes. I am doing this to remove the .dtb extension and then append the .dts extension, since KERNEL_DEVICE tree contains the dtb extended filenames.

Is this an issue?

Yes, I understand what's it's doing, but using bashisms is not safe - we've been trying to eliminate bashisms in upstream and our layers for some time. Shouldn't be adding more... :)

Would you suggest an dts=echo $dtb | sed ... form of command to change the extension?

Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines

+ done
+ fi
+}
diff --git a/recipes-kernel/linux/linux/cmem.dtsi b/recipes-kernel/linux/linux/cmem.dtsi
new file mode 100644
index 0000000..6b1da99
--- /dev/null
+++ b/recipes-kernel/linux/linux/cmem.dtsi
@@ -0,0 +1,24 @@
+/ {
+ reserved-memory {
+ cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+ reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+ no-map;
+ status = "okay";
+ };
+ };
+
+ cmem {
+ compatible = "ti,cmem";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ status = "okay";
+
+ cmem_block_0: cmem_block@0 {
+ reg = <0>;
+ memory-region = <&cmem_block_mem_0>;
+ cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+ };
+ };
+
+};
--
1.7.9.5

--
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti

#16 lore raw
Quoted 91 lines · Jacob Stiffler
Quoted 88 lines · Denys Dmytriyenko
Quoted 87 lines · Jacob Stiffler
Quoted 85 lines · Denys Dmytriyenko
Quoted 75 lines · Jacob Stiffler
Quoted 74 lines · Denys Dmytriyenko
Quoted 73 lines · Jacob Stiffler
Quoted 59 lines · Denys Dmytriyenko
Quoted 58 lines · Jacob Stiffler
Quoted 57 lines · Denys Dmytriyenko
Quoted 56 lines · Jacob Stiffler
Quoted 42 lines · Denys Dmytriyenko
Quoted 41 lines · Jacob Stiffler

On 5/18/2015 2:11 PM, Denys Dmytriyenko wrote:
On Mon, May 18, 2015 at 08:20:58AM -0400, Jacob Stiffler wrote:
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.
Looks good. 2 comments below.

Signed-off-by: Jacob Stiffler <[email protected]>
---
recipes-kernel/linux/cmem.inc | 22 ++++++++++++++++++++++
recipes-kernel/linux/linux/cmem.dtsi | 24 ++++++++++++++++++++++++
2 files changed, 46 insertions(+)
create mode 100644 recipes-kernel/linux/cmem.inc
create mode 100644 recipes-kernel/linux/linux/cmem.dtsi

diff --git a/recipes-kernel/linux/cmem.inc b/recipes-kernel/linux/cmem.inc
new file mode 100644
index 0000000..207bdc6
--- /dev/null
+++ b/recipes-kernel/linux/cmem.inc
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/linux"
Move the file into standard "files" directory and drop above line.

Ok.

+SRC_URI += "file://cmem.dtsi"
+
+CMEM_BASE ?= ""
+CMEM_SIZE ?= ""
+
+do_compileconfigs_prepend() {
Should this be do_configure_append() instead? It would probably be safer, as
do_compileconfigs() is specific to multi-kernel.inc and some kernel recipes
may not include it...

Quoted 9 lines
Quoted 3 lines

I had noticed that do_configure() gets invoked multiple times.

I'll try it as a do_configure_append() and make sure it will work.

Ah, you are right. Then you'd need to call this function uniquely like do_setup_cmem() and then addtask it after do_patch before do_configure. It looks like it should be safe to do it even before do_configure. It would be nice to do it after do_configure, but it needs to be before do_compile and also do_compileconfigs, while the latter one is only defined by multi-kernel

This should be called before do_create_srcipk(). But I suppose it should not be assumed that do_create_srcipk() will be run for a general kernel recipe.

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Should do_setup_cmem() be a postfunc of do_configure()? For example:

do_configure[postfuncs] += "do_setup_cmem"

Will it be called multiple times after each do_configure?

Sorry, I had meant do_patch().

BTW, are you sure you want it before create_srcipk? It won't package the changes then...

I thought it would have to be done before create_srcipk, since create_srcipk pulls the ${S} directory into the sourceipk. If this is done after create_srcipk, then there will not be any way for these changes to be packaged, correct?

Quoted 6 lines
Quoted 4 lines

Oops, you are correct. I was thinking backwards...
So, do_create_srcipk is also being re-called in do_compile_prepend, so it would pick up those changes.

But that is only for the case with the meta-arago bbappend, through copy-defconfig.inc.

And srcipk is specific to meta-arago as well...

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Quoted 1 line

Any reason it would be better to make this change after do_configure()?

Nope, nothing specifically depending on do_configure here, AFAICS.

Then it seems that having as a do_patch() postfunc would be safest.

Or addtask between do_patch and do_configure should be fine also.

Then how can you be sure create_srcipk() will not run before before setup_cmem()?

Ok, let's do a postfunc then. I was thinking of adding another python check to srcipk, but that would be more complicated...

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

+ if [ ! -z "${CMEM_BASE}" ]
+ then
+ cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+

Quoted 9 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

+ sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \
+ -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \
+ ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi
+
+ for dts in ${KERNEL_DEVICETREE}
+ do
+ echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts

BTW, is that bashism at the end of the line ^^^^^^^^^^^

The "${dts%.dtb}"? Yes. I am doing this to remove the .dtb extension and then append the .dts extension, since KERNEL_DEVICE tree contains the dtb extended filenames.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Is this an issue?

Yes, I understand what's it's doing, but using bashisms is not safe - we've been trying to eliminate bashisms in upstream and our layers for some time. Shouldn't be adding more... :)

Would you suggest an dts=echo $dtb | sed ... form of command to change the extension?

sed should be safe, yes.

Quoted 42 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 41 lines

+ done
+ fi
+}
diff --git a/recipes-kernel/linux/linux/cmem.dtsi b/recipes-kernel/linux/linux/cmem.dtsi
new file mode 100644
index 0000000..6b1da99
--- /dev/null
+++ b/recipes-kernel/linux/linux/cmem.dtsi
@@ -0,0 +1,24 @@
+/ {
+ reserved-memory {
+ cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ {
+ reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>;
+ no-map;
+ status = "okay";
+ };
+ };
+
+ cmem {
+ compatible = "ti,cmem";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ status = "okay";
+
+ cmem_block_0: cmem_block@0 {
+ reg = <0>;
+ memory-region = <&cmem_block_mem_0>;
+ cmem-buf-pools = <1 0x__CMEM_SIZE__>;
+ };
+ };
+
+};
--
1.7.9.5

--
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti