All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Stiffler <j-stiffler@ti.com>
To: Denys Dmytriyenko <denys@ti.com>
Cc: meta-ti@yoctoproject.org
Subject: Re: [PATCH 1/2] linux/cmem.inc: Support reserving memory for CMEM.
Date: Mon, 18 May 2015 15:03:18 -0400	[thread overview]
Message-ID: <555A3776.8090705@ti.com> (raw)
In-Reply-To: <20150518181119.GG31845@edge>



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



  reply	other threads:[~2015-05-18 19:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=555A3776.8090705@ti.com \
    --to=j-stiffler@ti.com \
    --cc=denys@ti.com \
    --cc=meta-ti@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.