* [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
@ 2015-05-18 12:20 Jacob Stiffler
2015-05-18 12:20 ` [PATCH 2/2] linux-ti-staging-3.14: Allow CMEM DT injection Jacob Stiffler
2015-05-18 18:11 ` [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM Denys Dmytriyenko
0 siblings, 2 replies; 17+ messages in thread
From: Jacob Stiffler @ 2015-05-18 12:20 UTC (permalink / raw)
To: meta-ti
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>
---
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"
+
+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
+}
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
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/2] linux-ti-staging-3.14: Allow CMEM DT injection.
2015-05-18 12:20 [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM Jacob Stiffler
@ 2015-05-18 12:20 ` Jacob Stiffler
2015-05-18 18:11 ` [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM Denys Dmytriyenko
1 sibling, 0 replies; 17+ messages in thread
From: Jacob Stiffler @ 2015-05-18 12:20 UTC (permalink / raw)
To: meta-ti
* Disabled by default.
Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
---
recipes-kernel/linux/linux-ti-staging_3.14.bb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/recipes-kernel/linux/linux-ti-staging_3.14.bb b/recipes-kernel/linux/linux-ti-staging_3.14.bb
index eb1ad27..7e67719 100644
--- a/recipes-kernel/linux/linux-ti-staging_3.14.bb
+++ b/recipes-kernel/linux/linux-ti-staging_3.14.bb
@@ -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"
--
1.7.9.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-18 12:20 [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM Jacob Stiffler
2015-05-18 12:20 ` [PATCH 2/2] linux-ti-staging-3.14: Allow CMEM DT injection Jacob Stiffler
@ 2015-05-18 18:11 ` Denys Dmytriyenko
2015-05-18 19:03 ` Jacob Stiffler
1 sibling, 1 reply; 17+ messages in thread
From: Denys Dmytriyenko @ 2015-05-18 18:11 UTC (permalink / raw)
To: Jacob Stiffler; +Cc: meta-ti
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 <j-stiffler@ti.com>
> ---
> 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.
> +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...
> + 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
> +}
> 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
> meta-ti@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-ti
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-18 18:11 ` [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM Denys Dmytriyenko
@ 2015-05-18 19:03 ` Jacob Stiffler
2015-05-18 19:13 ` Denys Dmytriyenko
0 siblings, 1 reply; 17+ messages in thread
From: Jacob Stiffler @ 2015-05-18 19:03 UTC (permalink / raw)
To: Denys Dmytriyenko; +Cc: meta-ti
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 <j-stiffler@ti.com>
>> ---
>> 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...
>
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.
>> + 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
>> +}
>> 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
>> meta-ti@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/meta-ti
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-18 19:03 ` Jacob Stiffler
@ 2015-05-18 19:13 ` Denys Dmytriyenko
2015-05-19 17:23 ` Jacob Stiffler
0 siblings, 1 reply; 17+ messages in thread
From: Denys Dmytriyenko @ 2015-05-18 19:13 UTC (permalink / raw)
To: Jacob Stiffler; +Cc: meta-ti
On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
>
>
> 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 <j-stiffler@ti.com>
> >>---
> >> 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...
> >
>
> 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
> >>+ 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
> >>+}
> >>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
> >>meta-ti@yoctoproject.org
> >>https://lists.yoctoproject.org/listinfo/meta-ti
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-18 19:13 ` Denys Dmytriyenko
@ 2015-05-19 17:23 ` Jacob Stiffler
2015-05-19 17:25 ` Denys Dmytriyenko
0 siblings, 1 reply; 17+ messages in thread
From: Jacob Stiffler @ 2015-05-19 17:23 UTC (permalink / raw)
To: Denys Dmytriyenko; +Cc: meta-ti
On 5/18/2015 3:13 PM, Denys Dmytriyenko wrote:
> On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
>>
>> 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 <j-stiffler@ti.com>
>>>> ---
>>>> 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...
>>>
>> 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"
>>>> + 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
>>>> +}
>>>> 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
>>>> meta-ti@yoctoproject.org
>>>> https://lists.yoctoproject.org/listinfo/meta-ti
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-19 17:23 ` Jacob Stiffler
@ 2015-05-19 17:25 ` Denys Dmytriyenko
2015-05-19 17:26 ` Jacob Stiffler
0 siblings, 1 reply; 17+ messages in thread
From: Denys Dmytriyenko @ 2015-05-19 17:25 UTC (permalink / raw)
To: Jacob Stiffler; +Cc: meta-ti
On Tue, May 19, 2015 at 01:23:06PM -0400, Jacob Stiffler wrote:
>
>
> On 5/18/2015 3:13 PM, Denys Dmytriyenko wrote:
> >On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
> >>
> >>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 <j-stiffler@ti.com>
> >>>>---
> >>>> 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...
> >>>
> >>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"
Will it be called multiple times after each do_configure?
> >>>>+ 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
> >>>>+}
> >>>>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
> >>>>meta-ti@yoctoproject.org
> >>>>https://lists.yoctoproject.org/listinfo/meta-ti
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-19 17:25 ` Denys Dmytriyenko
@ 2015-05-19 17:26 ` Jacob Stiffler
2015-05-19 17:32 ` Denys Dmytriyenko
0 siblings, 1 reply; 17+ messages in thread
From: Jacob Stiffler @ 2015-05-19 17:26 UTC (permalink / raw)
To: Denys Dmytriyenko; +Cc: meta-ti
On 5/19/2015 1:25 PM, Denys Dmytriyenko wrote:
> On Tue, May 19, 2015 at 01:23:06PM -0400, Jacob Stiffler wrote:
>>
>> On 5/18/2015 3:13 PM, Denys Dmytriyenko wrote:
>>> On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
>>>> 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 <j-stiffler@ti.com>
>>>>>> ---
>>>>>> 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...
>>>>>
>>>> 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"
> Will it be called multiple times after each do_configure?
>
Sorry, I had meant do_patch().
>>>>>> + 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
>>>>>> +}
>>>>>> 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
>>>>>> meta-ti@yoctoproject.org
>>>>>> https://lists.yoctoproject.org/listinfo/meta-ti
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-19 17:26 ` Jacob Stiffler
@ 2015-05-19 17:32 ` Denys Dmytriyenko
2015-05-19 17:39 ` Jacob Stiffler
0 siblings, 1 reply; 17+ messages in thread
From: Denys Dmytriyenko @ 2015-05-19 17:32 UTC (permalink / raw)
To: Jacob Stiffler; +Cc: meta-ti
On Tue, May 19, 2015 at 01:26:05PM -0400, Jacob Stiffler wrote:
>
>
> On 5/19/2015 1:25 PM, Denys Dmytriyenko wrote:
> >On Tue, May 19, 2015 at 01:23:06PM -0400, Jacob Stiffler wrote:
> >>
> >>On 5/18/2015 3:13 PM, Denys Dmytriyenko wrote:
> >>>On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
> >>>>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 <j-stiffler@ti.com>
> >>>>>>---
> >>>>>> 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...
> >>>>>
> >>>>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"
> >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...
> >>>>>>+ 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
> >>>>>>+}
> >>>>>>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
> >>>>>>meta-ti@yoctoproject.org
> >>>>>>https://lists.yoctoproject.org/listinfo/meta-ti
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-19 17:32 ` Denys Dmytriyenko
@ 2015-05-19 17:39 ` Jacob Stiffler
2015-05-19 17:47 ` Denys Dmytriyenko
0 siblings, 1 reply; 17+ messages in thread
From: Jacob Stiffler @ 2015-05-19 17:39 UTC (permalink / raw)
To: Denys Dmytriyenko; +Cc: meta-ti
On 5/19/2015 1:32 PM, Denys Dmytriyenko wrote:
> On Tue, May 19, 2015 at 01:26:05PM -0400, Jacob Stiffler wrote:
>>
>> On 5/19/2015 1:25 PM, Denys Dmytriyenko wrote:
>>> On Tue, May 19, 2015 at 01:23:06PM -0400, Jacob Stiffler wrote:
>>>> On 5/18/2015 3:13 PM, Denys Dmytriyenko wrote:
>>>>> On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
>>>>>> 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 <j-stiffler@ti.com>
>>>>>>>> ---
>>>>>>>> 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...
>>>>>>>
>>>>>> 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"
>>> 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?
>>>>>>>> + 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
>>>>>>>> +}
>>>>>>>> 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
>>>>>>>> meta-ti@yoctoproject.org
>>>>>>>> https://lists.yoctoproject.org/listinfo/meta-ti
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-19 17:39 ` Jacob Stiffler
@ 2015-05-19 17:47 ` Denys Dmytriyenko
2015-05-19 17:52 ` Jacob Stiffler
0 siblings, 1 reply; 17+ messages in thread
From: Denys Dmytriyenko @ 2015-05-19 17:47 UTC (permalink / raw)
To: Jacob Stiffler; +Cc: meta-ti
On Tue, May 19, 2015 at 01:39:58PM -0400, Jacob Stiffler wrote:
>
>
> On 5/19/2015 1:32 PM, Denys Dmytriyenko wrote:
> >On Tue, May 19, 2015 at 01:26:05PM -0400, Jacob Stiffler wrote:
> >>
> >>On 5/19/2015 1:25 PM, Denys Dmytriyenko wrote:
> >>>On Tue, May 19, 2015 at 01:23:06PM -0400, Jacob Stiffler wrote:
> >>>>On 5/18/2015 3:13 PM, Denys Dmytriyenko wrote:
> >>>>>On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
> >>>>>>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 <j-stiffler@ti.com>
> >>>>>>>>---
> >>>>>>>> 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...
> >>>>>>>
> >>>>>>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"
> >>>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?
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.
> >>>>>>>>+ 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
> >>>>>>>>+}
> >>>>>>>>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
> >>>>>>>>meta-ti@yoctoproject.org
> >>>>>>>>https://lists.yoctoproject.org/listinfo/meta-ti
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-19 17:47 ` Denys Dmytriyenko
@ 2015-05-19 17:52 ` Jacob Stiffler
2015-05-19 17:58 ` Denys Dmytriyenko
0 siblings, 1 reply; 17+ messages in thread
From: Jacob Stiffler @ 2015-05-19 17:52 UTC (permalink / raw)
To: Denys Dmytriyenko; +Cc: meta-ti
On 5/19/2015 1:47 PM, Denys Dmytriyenko wrote:
> On Tue, May 19, 2015 at 01:39:58PM -0400, Jacob Stiffler wrote:
>>
>> On 5/19/2015 1:32 PM, Denys Dmytriyenko wrote:
>>> On Tue, May 19, 2015 at 01:26:05PM -0400, Jacob Stiffler wrote:
>>>> On 5/19/2015 1:25 PM, Denys Dmytriyenko wrote:
>>>>> On Tue, May 19, 2015 at 01:23:06PM -0400, Jacob Stiffler wrote:
>>>>>> On 5/18/2015 3:13 PM, Denys Dmytriyenko wrote:
>>>>>>> On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
>>>>>>>> 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 <j-stiffler@ti.com>
>>>>>>>>>> ---
>>>>>>>>>> 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...
>>>>>>>>>
>>>>>>>> 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"
>>>>> 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?
> 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()?
>>>>>>>>>> + 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
>>>>>>>>>> +}
>>>>>>>>>> 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
>>>>>>>>>> meta-ti@yoctoproject.org
>>>>>>>>>> https://lists.yoctoproject.org/listinfo/meta-ti
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-19 17:52 ` Jacob Stiffler
@ 2015-05-19 17:58 ` Denys Dmytriyenko
2015-05-19 18:02 ` Jacob Stiffler
0 siblings, 1 reply; 17+ messages in thread
From: Denys Dmytriyenko @ 2015-05-19 17:58 UTC (permalink / raw)
To: Jacob Stiffler; +Cc: meta-ti
On Tue, May 19, 2015 at 01:52:43PM -0400, Jacob Stiffler wrote:
>
>
> On 5/19/2015 1:47 PM, Denys Dmytriyenko wrote:
> >On Tue, May 19, 2015 at 01:39:58PM -0400, Jacob Stiffler wrote:
> >>
> >>On 5/19/2015 1:32 PM, Denys Dmytriyenko wrote:
> >>>On Tue, May 19, 2015 at 01:26:05PM -0400, Jacob Stiffler wrote:
> >>>>On 5/19/2015 1:25 PM, Denys Dmytriyenko wrote:
> >>>>>On Tue, May 19, 2015 at 01:23:06PM -0400, Jacob Stiffler wrote:
> >>>>>>On 5/18/2015 3:13 PM, Denys Dmytriyenko wrote:
> >>>>>>>On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
> >>>>>>>>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 <j-stiffler@ti.com>
> >>>>>>>>>>---
> >>>>>>>>>> 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...
> >>>>>>>>>
> >>>>>>>>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"
> >>>>>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?
> >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...
> Any reason it would be better to make this change after do_configure()?
Nope, nothing specifically depending on do_configure here, AFAICS.
> >>>>>>>>>>+ 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 ^^^^^^^^^^^
> >>>>>>>>>>+ 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
> >>>>>>>>>>meta-ti@yoctoproject.org
> >>>>>>>>>>https://lists.yoctoproject.org/listinfo/meta-ti
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-19 17:58 ` Denys Dmytriyenko
@ 2015-05-19 18:02 ` Jacob Stiffler
2015-05-19 18:06 ` Denys Dmytriyenko
0 siblings, 1 reply; 17+ messages in thread
From: Jacob Stiffler @ 2015-05-19 18:02 UTC (permalink / raw)
To: Denys Dmytriyenko; +Cc: meta-ti
On 5/19/2015 1:58 PM, Denys Dmytriyenko wrote:
> On Tue, May 19, 2015 at 01:52:43PM -0400, Jacob Stiffler wrote:
>>
>> On 5/19/2015 1:47 PM, Denys Dmytriyenko wrote:
>>> On Tue, May 19, 2015 at 01:39:58PM -0400, Jacob Stiffler wrote:
>>>> On 5/19/2015 1:32 PM, Denys Dmytriyenko wrote:
>>>>> On Tue, May 19, 2015 at 01:26:05PM -0400, Jacob Stiffler wrote:
>>>>>> On 5/19/2015 1:25 PM, Denys Dmytriyenko wrote:
>>>>>>> On Tue, May 19, 2015 at 01:23:06PM -0400, Jacob Stiffler wrote:
>>>>>>>> On 5/18/2015 3:13 PM, Denys Dmytriyenko wrote:
>>>>>>>>> On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
>>>>>>>>>> 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 <j-stiffler@ti.com>
>>>>>>>>>>>> ---
>>>>>>>>>>>> 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...
>>>>>>>>>>>
>>>>>>>>>> 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"
>>>>>>> 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?
>>> 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...
>
>
>> 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.
>>>>>>>>>>>> + 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 ^^^^^^^^^^^
>
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?
>>>>>>>>>>>> + 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
>>>>>>>>>>>> meta-ti@yoctoproject.org
>>>>>>>>>>>> https://lists.yoctoproject.org/listinfo/meta-ti
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-19 18:02 ` Jacob Stiffler
@ 2015-05-19 18:06 ` Denys Dmytriyenko
2015-05-19 18:10 ` Jacob Stiffler
0 siblings, 1 reply; 17+ messages in thread
From: Denys Dmytriyenko @ 2015-05-19 18:06 UTC (permalink / raw)
To: Jacob Stiffler; +Cc: meta-ti
On Tue, May 19, 2015 at 02:02:52PM -0400, Jacob Stiffler wrote:
>
>
> On 5/19/2015 1:58 PM, Denys Dmytriyenko wrote:
> >On Tue, May 19, 2015 at 01:52:43PM -0400, Jacob Stiffler wrote:
> >>
> >>On 5/19/2015 1:47 PM, Denys Dmytriyenko wrote:
> >>>On Tue, May 19, 2015 at 01:39:58PM -0400, Jacob Stiffler wrote:
> >>>>On 5/19/2015 1:32 PM, Denys Dmytriyenko wrote:
> >>>>>On Tue, May 19, 2015 at 01:26:05PM -0400, Jacob Stiffler wrote:
> >>>>>>On 5/19/2015 1:25 PM, Denys Dmytriyenko wrote:
> >>>>>>>On Tue, May 19, 2015 at 01:23:06PM -0400, Jacob Stiffler wrote:
> >>>>>>>>On 5/18/2015 3:13 PM, Denys Dmytriyenko wrote:
> >>>>>>>>>On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
> >>>>>>>>>>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 <j-stiffler@ti.com>
> >>>>>>>>>>>>---
> >>>>>>>>>>>> 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...
> >>>>>>>>>>>
> >>>>>>>>>>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"
> >>>>>>>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?
> >>>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...
> >
> >
> >>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.
> >>>>>>>>>>>>+ 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 ^^^^^^^^^^^
> >
>
> 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... :)
> >>>>>>>>>>>>+ 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
> >>>>>>>>>>>>meta-ti@yoctoproject.org
> >>>>>>>>>>>>https://lists.yoctoproject.org/listinfo/meta-ti
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-19 18:06 ` Denys Dmytriyenko
@ 2015-05-19 18:10 ` Jacob Stiffler
2015-05-19 18:16 ` Denys Dmytriyenko
0 siblings, 1 reply; 17+ messages in thread
From: Jacob Stiffler @ 2015-05-19 18:10 UTC (permalink / raw)
To: Denys Dmytriyenko; +Cc: meta-ti
On 5/19/2015 2:06 PM, Denys Dmytriyenko wrote:
> On Tue, May 19, 2015 at 02:02:52PM -0400, Jacob Stiffler wrote:
>>
>> On 5/19/2015 1:58 PM, Denys Dmytriyenko wrote:
>>> On Tue, May 19, 2015 at 01:52:43PM -0400, Jacob Stiffler wrote:
>>>> On 5/19/2015 1:47 PM, Denys Dmytriyenko wrote:
>>>>> On Tue, May 19, 2015 at 01:39:58PM -0400, Jacob Stiffler wrote:
>>>>>> On 5/19/2015 1:32 PM, Denys Dmytriyenko wrote:
>>>>>>> On Tue, May 19, 2015 at 01:26:05PM -0400, Jacob Stiffler wrote:
>>>>>>>> On 5/19/2015 1:25 PM, Denys Dmytriyenko wrote:
>>>>>>>>> On Tue, May 19, 2015 at 01:23:06PM -0400, Jacob Stiffler wrote:
>>>>>>>>>> On 5/18/2015 3:13 PM, Denys Dmytriyenko wrote:
>>>>>>>>>>> On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
>>>>>>>>>>>> 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 <j-stiffler@ti.com>
>>>>>>>>>>>>>> ---
>>>>>>>>>>>>>> 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...
>>>>>>>>>>>>>
>>>>>>>>>>>> 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"
>>>>>>>>> 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?
>>>>> 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...
>>>
>>>
>>>> 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()?
>>>>>>>>>>>>>> + 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 ^^^^^^^^^^^
>>>
>> 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?
>>>>>>>>>>>>>> + 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
>>>>>>>>>>>>>> meta-ti@yoctoproject.org
>>>>>>>>>>>>>> https://lists.yoctoproject.org/listinfo/meta-ti
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
2015-05-19 18:10 ` Jacob Stiffler
@ 2015-05-19 18:16 ` Denys Dmytriyenko
0 siblings, 0 replies; 17+ messages in thread
From: Denys Dmytriyenko @ 2015-05-19 18:16 UTC (permalink / raw)
To: Jacob Stiffler; +Cc: meta-ti
On Tue, May 19, 2015 at 02:10:36PM -0400, Jacob Stiffler wrote:
>
>
> On 5/19/2015 2:06 PM, Denys Dmytriyenko wrote:
> >On Tue, May 19, 2015 at 02:02:52PM -0400, Jacob Stiffler wrote:
> >>
> >>On 5/19/2015 1:58 PM, Denys Dmytriyenko wrote:
> >>>On Tue, May 19, 2015 at 01:52:43PM -0400, Jacob Stiffler wrote:
> >>>>On 5/19/2015 1:47 PM, Denys Dmytriyenko wrote:
> >>>>>On Tue, May 19, 2015 at 01:39:58PM -0400, Jacob Stiffler wrote:
> >>>>>>On 5/19/2015 1:32 PM, Denys Dmytriyenko wrote:
> >>>>>>>On Tue, May 19, 2015 at 01:26:05PM -0400, Jacob Stiffler wrote:
> >>>>>>>>On 5/19/2015 1:25 PM, Denys Dmytriyenko wrote:
> >>>>>>>>>On Tue, May 19, 2015 at 01:23:06PM -0400, Jacob Stiffler wrote:
> >>>>>>>>>>On 5/18/2015 3:13 PM, Denys Dmytriyenko wrote:
> >>>>>>>>>>>On Mon, May 18, 2015 at 03:03:18PM -0400, Jacob Stiffler wrote:
> >>>>>>>>>>>>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 <j-stiffler@ti.com>
> >>>>>>>>>>>>>>---
> >>>>>>>>>>>>>> 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...
> >>>>>>>>>>>>>
> >>>>>>>>>>>>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"
> >>>>>>>>>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?
> >>>>>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...
> >>>
> >>>
> >>>>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...
> >>>>>>>>>>>>>>+ 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 ^^^^^^^^^^^
> >>>
> >>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?
sed should be safe, yes.
> >>>>>>>>>>>>>>+ 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
> >>>>>>>>>>>>>>meta-ti@yoctoproject.org
> >>>>>>>>>>>>>>https://lists.yoctoproject.org/listinfo/meta-ti
>
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2015-05-19 18:16 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 12:20 [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM Jacob Stiffler
2015-05-18 12:20 ` [PATCH 2/2] linux-ti-staging-3.14: Allow CMEM DT injection Jacob Stiffler
2015-05-18 18:11 ` [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM Denys Dmytriyenko
2015-05-18 19:03 ` Jacob Stiffler
2015-05-18 19:13 ` Denys Dmytriyenko
2015-05-19 17:23 ` Jacob Stiffler
2015-05-19 17:25 ` Denys Dmytriyenko
2015-05-19 17:26 ` Jacob Stiffler
2015-05-19 17:32 ` Denys Dmytriyenko
2015-05-19 17:39 ` Jacob Stiffler
2015-05-19 17:47 ` Denys Dmytriyenko
2015-05-19 17:52 ` Jacob Stiffler
2015-05-19 17:58 ` Denys Dmytriyenko
2015-05-19 18:02 ` Jacob Stiffler
2015-05-19 18:06 ` Denys Dmytriyenko
2015-05-19 18:10 ` Jacob Stiffler
2015-05-19 18:16 ` Denys Dmytriyenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.