Proposal for enabling CMEM
cover Proposal for enabling CMEM
This is a proposal for adding a CMEM region in the device tree.
I wanted to get comments on the following:
* implementation of using an inc file to enable this.
* Whether the actual configuration belongs in the kernel recipe, or if this is something that should be handled at the distro or branding level. (RFC sets the configuration in kernel recipe).
- I have verified that this configuration may also be set in the branding file using, for example,
CMEM_BASE_pn-linux-ti-staging_omap-a15 = "a0000000" CMEM_SIZE_pn-linux-ti-staging_omap-a15 = "20000000"
Jacob Stiffler (2):
linux/cmem.inc: Support reserving memory for CMEM. linux-ti-staging_3.14: Add CMEM region for omap-a15.
recipes-kernel/linux/cmem.inc | 22 ++++++++++++++++++++++ recipes-kernel/linux/linux-ti-staging_3.14.bb | 6 +++++- recipes-kernel/linux/linux/cmem.dtsi | 24 ++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 recipes-kernel/linux/cmem.inc create mode 100644 recipes-kernel/linux/linux/cmem.dtsi
Signature · 1 line
1.7.9.5
RFC 1/2 linux/cmem.inc: Support reserving memory for CMEM.
To reserve contiguous memory for CMEM:
* include the "recipes-kernel/linux/cmem.inc"
* Set CMEM_BASE and CMEM_SIZE to the physical memory address and size, respectively, to reserve for CMEM.
Currently limited to reserving a single memory region used to create a single buffer pool of a single buffer.
--- recipes-kernel/linux/cmem.inc | 22 ++++++++++++++++++++++ recipes-kernel/linux/linux/cmem.dtsi | 24 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 recipes-kernel/linux/cmem.inc create mode 100644 recipes-kernel/linux/linux/cmem.dtsi
recipes-kernel/linux/cmem.inc new file +22 -0
@@ -0,0 +1,22 @@ +FILESEXTRAPATHS_append = ":${THISDIR}/linux" + +SRC_URI += "file://cmem.dtsi" + +CMEM_BASE ?= "" +CMEM_SIZE ?= "" + +do_compileconfigs_prepend() { + if [ ! -z "${CMEM_BASE}" ] + then + cp ${WORKDIR}/cmem.dtsi ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi + + sed -i -e "s|__CMEM_BASE__|${CMEM_BASE}|g" \ + -e "s|__CMEM_SIZE__|${CMEM_SIZE}|g" \ + ${S}/arch/arm/boot/dts/${MACHINE}-cmem.dtsi + + for dts in ${KERNEL_DEVICETREE} + do + echo "#include \"${MACHINE}-cmem.dtsi\"" >> ${S}/arch/arm/boot/dts/${dts%.dtb}.dts + done + fi +}
recipes-kernel/linux/linux/cmem.dtsi new file +24 -0
@@ -0,0 +1,24 @@ +/ { + reserved-memory { + cmem_block_mem_0: cmem_block_mem@__CMEM_BASE__ { + reg = <0x__CMEM_BASE__ 0x__CMEM_SIZE__>; + no-map; + status = "okay"; + }; + }; + + cmem { + compatible = "ti,cmem"; + #address-cells = <1>; + #size-cells = <0>; + + status = "okay"; + + cmem_block_0: cmem_block@0 { + reg = <0>; + memory-region = <&cmem_block_mem_0>; + cmem-buf-pools = <1 0x__CMEM_SIZE__>; + }; + }; + +};
Signature · 1 line
1.7.9.5
RFC 2/2 linux-ti-staging_3.14: Add CMEM region for omap-a15.
In reply to Jacob Stiffler* This region can be used by applications to enable shared contiguous memory in user space for data transfer between the ARM and DSP.
--- recipes-kernel/linux/linux-ti-staging_3.14.bb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
recipes-kernel/linux/linux-ti-staging_3.14.bb +5 -1
@@ -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 = "5e342e186fcd9834fff09f6335b344599042be88" PV = "3.14.39" # 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"
@@ -57,6 +58,9 @@ KERNEL_CONFIG_DIR = "${S}/ti_config_fragments" KERNEL_CONFIG_FRAGMENTS_append_ti33x = " ${KERNEL_CONFIG_DIR}/am33xx_only.cfg" KERNEL_CONFIG_FRAGMENTS_append_ti43x = " ${KERNEL_CONFIG_DIR}/am43xx_only.cfg" +CMEM_BASE_omap-a15 = "a0000000" +CMEM_SIZE_omap-a15 = "20000000" + MULTI_CONFIG_BASE_SUFFIX = "" KERNEL_GIT_URI = "git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git"
Signature · 1 line
1.7.9.5
Quoted 11 lines · Jacob Stiffler
This is a proposal for adding a CMEM region in the device tree.
I wanted to get comments on the following:
* implementation of using an inc file to enable this.
* Whether the actual configuration belongs in the kernel recipe, or if this is something that should be handled at the distro or branding level. (RFC sets the configuration in kernel recipe).
- I have verified that this configuration may also be set in the branding file using, for example,
Quoted 2 lines
CMEM_BASE_pn-linux-ti-staging_omap-a15 = "
a0000000" CMEM_SIZE_pn-linux-ti-staging_omap-a15 = "20000000"
Hmm, on one hand I don't like this change being so invasive. But on the other hand, I'm not sure there's a better cleaner way to do a dts injection like that. Let me think about it...
Quoted 19 lines
Jacob Stiffler (2):
linux/cmem.inc: Support reserving memory for CMEM. linux-ti-staging_3.14: Add CMEM region for omap-a15.recipes-kernel/linux/cmem.inc | 22 ++++++++++++++++++++++ recipes-kernel/linux/linux-ti-staging_3.14.bb | 6 +++++- recipes-kernel/linux/linux/cmem.dtsi | 24 ++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 recipes-kernel/linux/cmem.inc create mode 100644 recipes-kernel/linux/linux/cmem.dtsiSignature · 7 lines
1.7.9.5 -- _______________________________________________ meta-ti mailing list [email protected] https://lists.yoctoproject.org/listinfo/meta-ti
Quoted 12 lines · Denys Dmytriyenko
Quoted 11 lines · Jacob Stiffler
This is a proposal for adding a CMEM region in the device tree.
I wanted to get comments on the following:
* implementation of using an inc file to enable this.
* Whether the actual configuration belongs in the kernel recipe, or if this is something that should be handled at the distro or branding level. (RFC sets the configuration in kernel recipe).
- I have verified that this configuration may also be set in the branding file using, for example,
Quoted 5 lines
Quoted 2 lines
CMEM_BASE_pn-linux-ti-staging_omap-a15 = "a0000000" CMEM_SIZE_pn-linux-ti-staging_omap-a15 = "20000000"Hmm, on one hand I don't like this change being so invasive. But on the other hand, I'm not sure there's a better cleaner way to do a dts injection like that. Let me think about it...
Any thoughts on this yet?
Quoted 20 lines
Quoted 20 lines
Jacob Stiffler (2):
linux/cmem.inc: Support reserving memory for CMEM. linux-ti-staging_3.14: Add CMEM region for omap-a15.recipes-kernel/linux/cmem.inc | 22 ++++++++++++++++++++++ recipes-kernel/linux/linux-ti-staging_3.14.bb | 6 +++++- recipes-kernel/linux/linux/cmem.dtsi | 24 ++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-)create mode 100644 recipes-kernel/linux/cmem.inc create mode 100644
recipes-kernel/linux/linux/cmem.dtsiSignature · 7 lines
1.7.9.5 -- _______________________________________________ meta-ti mailing list [email protected] https://lists.yoctoproject.org/listinfo/meta-ti
Quoted 15 lines · Jacob Stiffler
Quoted 12 lines · Denys Dmytriyenko
Quoted 11 lines · Jacob Stiffler
This is a proposal for adding a CMEM region in the device tree.
I wanted to get comments on the following:
* implementation of using an inc file to enable this.
* Whether the actual configuration belongs in the kernel recipe, or if this is something that should be handled at the distro or branding level. (RFC sets the configuration in kernel recipe).
- I have verified that this configuration may also be set in the branding file using, for example,
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
CMEM_BASE_pn-linux-ti-staging_omap-a15 = "a0000000" CMEM_SIZE_pn-linux-ti-staging_omap-a15 = "20000000"Hmm, on one hand I don't like this change being so invasive. But on the other hand, I'm not sure there's a better cleaner way to do a dts injection like that. Let me think about it...
Any thoughts on this yet?
Jake,
After discussing this matter internally, since cmem is something that LCPD currently doesn't support being an out-of-tree module and so on, I can accept the patchset, but it will be disabled by default and not tested by us. All the testing will be on you to make sure it's not broken by future changes in the kernel. Will that be sufficient?
Signature · 1 line
Denys
Quoted 20 lines
Quoted 19 lines
Quoted 19 lines
Jacob Stiffler (2):
linux/cmem.inc: Support reserving memory for CMEM. linux-ti-staging_3.14: Add CMEM region for omap-a15.recipes-kernel/linux/cmem.inc | 22 ++++++++++++++++++++++ recipes-kernel/linux/linux-ti-staging_3.14.bb | 6 +++++- recipes-kernel/linux/linux/cmem.dtsi | 24 ++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 recipes-kernel/linux/cmem.inc create mode 100644 recipes-kernel/linux/linux/cmem.dtsiSignature · 7 lines
1.7.9.5 -- _______________________________________________ meta-ti mailing list [email protected] https://lists.yoctoproject.org/listinfo/meta-ti
Quoted 20 lines · Denys Dmytriyenko
Quoted 19 lines · Jacob Stiffler
Quoted 17 lines · Denys Dmytriyenko
Quoted 11 lines · Jacob Stiffler
This is a proposal for adding a CMEM region in the device tree.
I wanted to get comments on the following:
* implementation of using an inc file to enable this.
* Whether the actual configuration belongs in the kernel recipe, or if this is something that should be handled at the distro or branding level. (RFC sets the configuration in kernel recipe).
- I have verified that this configuration may also be set in the branding file using, for example,Quoted 2 lines
CMEM_BASE_pn-linux-ti-staging_omap-a15 = "
a0000000" CMEM_SIZE_pn-linux-ti-staging_omap-a15 = "20000000"Hmm, on one hand I don't like this change being so invasive. But on the other hand, I'm not sure there's a better cleaner way to do a dts injection like that. Let me think about it...
Quoted 9 lines
Quoted 1 line
Any thoughts on this yet?
Jake,
After discussing this matter internally, since cmem is something that LCPD currently doesn't support being an out-of-tree module and so on, I can accept the patchset, but it will be disabled by default and not tested by us. All the testing will be on you to make sure it's not broken by future changes in the kernel. Will that be sufficient?
This should be fine, but to be clear, is it OK to have the kernel recipe include the cmem include file? And, with CMEM being disabled by default for core sdk builds, would the CMEM configuration go into the branding file?
Quoted 32 lines · Jacob Stiffler
Quoted 20 lines · Denys Dmytriyenko
Quoted 19 lines · Jacob Stiffler
Quoted 17 lines · Denys Dmytriyenko
Quoted 11 lines · Jacob Stiffler
This is a proposal for adding a CMEM region in the device tree.
I wanted to get comments on the following:
* implementation of using an inc file to enable this.
* Whether the actual configuration belongs in the kernel recipe, or if this is something that should be handled at the distro or branding level. (RFC sets the configuration in kernel recipe).
- I have verified that this configuration may also be set in the branding file using, for example,Quoted 2 lines
CMEM_BASE_pn-linux-ti-staging_omap-a15 = "
a0000000" CMEM_SIZE_pn-linux-ti-staging_omap-a15 = "20000000"Hmm, on one hand I don't like this change being so invasive. But on the other hand, I'm not sure there's a better cleaner way to do a dts injection like that. Let me think about it...
Quoted 9 lines
Quoted 1 line
Any thoughts on this yet?
Jake,
After discussing this matter internally, since cmem is something that LCPD currently doesn't support being an out-of-tree module and so on, I can accept the patchset, but it will be disabled by default and not tested by us. All the testing will be on you to make sure it's not broken by future changes in the kernel. Will that be sufficient?
Quoted 4 lines
This should be fine, but to be clear, is it OK to have the kernel recipe include the cmem include file? And, with CMEM being disabled by default for core sdk builds, would the CMEM configuration go into the branding file?
Jake,
The point is to not mangle standard dts files with CMEM related setup in CoreSDK. The way your patch works, as long as CMEM_BASE is not set, it won't do that. I'm fine with recipe having that logic via cmem.inc. You are welcome to enable it in your SDK config/branding, yes.
In other words, patch #1 can go in w/o changes and patch #2 should rather go into your branding config file.
Signature · 1 line
Denys
Quoted 37 lines · Denys Dmytriyenko
Quoted 30 lines · Jacob Stiffler
Quoted 19 lines · Denys Dmytriyenko
Quoted 18 lines · Jacob Stiffler
Quoted 17 lines · Denys Dmytriyenko
Quoted 11 lines · Jacob Stiffler
This is a proposal for adding a CMEM region in the device tree.
I wanted to get comments on the following:
* implementation of using an inc file to enable this.
* Whether the actual configuration belongs in the kernel recipe, or if this is something that should be handled at the distro or branding level. (RFC sets the configuration in kernel recipe).
- I have verified that this configuration may also be set in the branding file using, for example,Quoted 2 lines
CMEM_BASE_pn-linux-ti-staging_omap-a15 = "
a0000000" CMEM_SIZE_pn-linux-ti-staging_omap-a15 = "20000000"Hmm, on one hand I don't like this change being so invasive. But on the other hand, I'm not sure there's a better cleaner way to do a dts injection like that. Let me think about it...
Quoted 9 lines
Quoted 1 line
Any thoughts on this yet?
Jake,
After discussing this matter internally, since cmem is something that LCPD currently doesn't support being an out-of-tree module and so on, I can accept the patchset, but it will be disabled by default and not tested by us. All the testing will be on you to make sure it's not broken by future changes in the kernel. Will that be sufficient?
Quoted 4 lines
This should be fine, but to be clear, is it OK to have the kernel recipe include the cmem include file? And, with CMEM being disabled by default for core sdk builds, would the CMEM configuration go into the branding file?
Jake,
Quoted 8 lines
The point is to not mangle standard dts files with CMEM related setup in CoreSDK. The way your patch works, as long as
CMEM_BASEis not set, it won't do that. I'm fine with recipe having that logic via cmem.inc. You are welcome to enable it in your SDK config/branding, yes.In other words, patch #1 can go in w/o changes and patch #2 should rather go into your branding config file.
I'm fine with that. I'll work on these changes and resubmit as an actual patch.
Thank you.