1
0
mirror of https://git.yoctoproject.org/meta-ti synced 2026-04-20 11:42:57 +00:00

cmem-mod: Remove CMEM kernel module

CMEM has been deprecated for removal for some time now. All users should
have migrated to the Linux upstream DMA-BUF Heaps framework. Remove CMEM.

We only remove the kernel module part in this patch to prevent builds
from breaking in the meta-arago layer due to dependencies on the CMEM
library. These packages should either be updated or disabled. After
that we will remove the library.

Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
This commit is contained in:
Andrew Davis
2022-11-04 22:46:52 +00:00
committed by Ryan Eatmon
parent 1c52b0f117
commit 48841468a4
13 changed files with 0 additions and 431 deletions

View File

@@ -1,18 +0,0 @@
DESCRIPTION = "Kernel module for contiguous memory allocation from userspace"
include cmem.inc
# This package builds a kernel module, use kernel PR as base and append a local
MACHINE_KERNEL_PR:append = "a"
PR = "${MACHINE_KERNEL_PR}"
inherit module
EXTRA_OEMAKE += '-f lu.mak KERNEL_INSTALL_DIR="${STAGING_KERNEL_DIR}" TOOLCHAIN_PREFIX="${TOOLCHAIN_PREFIX}" EXEC_DIR="${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/extra"'
MAKE_TARGETS = "module"
KERNEL_MODULE_AUTOLOAD += "cmemk"
do_install:prepend() {
cp ${B}/src/cmem/module/Module.symvers ${B}/ || true
}

View File

@@ -2,8 +2,6 @@ DESCRIPTION = "The cmem component supports contiguous memory allocation from use
include cmem.inc
RDEPENDS:${PN} = "cmem-mod"
PR = "r0"
PACKAGES =+ "${PN}-test"

View File

@@ -1,96 +0,0 @@
# Add concept of machine variants to split DTBs into subsets
#
# Use these for temporary overrides
CMEM_MACHINE = "${MACHINE}"
CMEM_MACHINE:am57xx-evm = "am571x am572x am572idk am5729-beagleboneai am574x"
CMEM_MACHINE:am57xx-hs-evm = "am571x am572x am572idk am5729-beagleboneai am574x"
CMEM_MACHINE:dra7xx-evm = "dra71x dra72x dra74x dra76x"
CMEM_MACHINE:dra7xx-hs-evm = "dra71x dra72x dra74x dra76x"
# Set cmem.dtsi per machine or machine variant
CMEM_DTSI = "cmem.dtsi"
CMEM_DTSI_am571x = "cmem-am571x.dtsi"
CMEM_DTSI_am572idk = "cmem-am572idk.dtsi"
CMEM_DTSI_am5729-beagleboneai = "cmem-am5729-beagleboneai.dtsi"
CMEM_DTSI_am574x = "cmem-am574x.dtsi"
CMEM_DTSI_dra71x = "cmem-dra71x.dtsi"
CMEM_DTSI_dra72x = "cmem-dra72x.dtsi"
CMEM_DTSI_dra76x = "cmem-dra76x.dtsi"
# Split device trees between variants
CMEM_DEVICETREE = "${KERNEL_DEVICETREE}"
CMEM_DEVICETREE_am571x = "am571x-idk.dtb am571x-idk-lcd-osd101t2045.dtb am571x-idk-lcd-osd101t2587.dtb"
CMEM_DEVICETREE_am572x = "am57xx-beagle-x15.dtb am57xx-beagle-x15-revc.dtb"
CMEM_DEVICETREE_am572idk = "am572x-idk.dtb am572x-idk-lcd-osd101t2045.dtb am572x-idk-lcd-osd101t2587.dtb"
CMEM_DEVICETREE_am5729-beagleboneai = "am5729-beagleboneai.dtb"
CMEM_DEVICETREE_am574x = "am574x-idk.dtb am574x-idk-lcd-osd101t2587.dtb"
CMEM_DEVICETREE_dra71x = "dra71-evm.dtb"
CMEM_DEVICETREE_dra72x = "dra72-evm.dtb dra72-evm-lcd-osd101t2045.dtb dra72-evm-lcd-osd101t2587.dtb \
dra72-evm-revc.dtb dra72-evm-revc-lcd-osd101t2045.dtb dra72-evm-revc-lcd-osd101t2587.dtb"
CMEM_DEVICETREE_dra74x = "dra7-evm.dtb dra7-evm-lcd-osd101t2045.dtb dra7-evm-lcd-osd101t2587.dtb"
CMEM_DEVICETREE_dra76x = "dra76-evm.dtb dra76-evm-tfp410.dtb"
# Flag to enable CMEM injection
RESERVE_CMEM ?= "0"
# Variables which influence setup_cmem
CMEM_VARS = "RESERVE_CMEM CMEM_MACHINE"
CMEM_VARS += "CMEM_DTSI ${@' '.join(map(lambda s: 'CMEM_DTSI_' + s, (d.getVar('CMEM_MACHINE') or '').split()))}"
CMEM_VARS += "CMEM_DEVICETREE ${@' '.join(map(lambda s: 'CMEM_DEVICETREE_' + s, (d.getVar('CMEM_MACHINE') or '').split()))}"
# Add correct cmem.dtsi to SRC_URI for each variant for a given machine
python do_unpack() {
old_overrides = d.getVar('OVERRIDES', False)
# Initialize with empty string to simplify logic to append to SRC_URI
cmem_dtsi = set([''])
for cmem_machine in (d.getVar('CMEM_MACHINE') or '').split():
# Create copy of data for additional override
localdata = bb.data.createCopy(d)
localdata.setVar('OVERRIDES', '%s:%s' % (cmem_machine, old_overrides))
bb.data.update_data(localdata)
cmem_dtsi.add(localdata.getVar('CMEM_DTSI'))
d.appendVar('SRC_URI', ' file://'.join(cmem_dtsi))
bb.build.exec_func('base_do_unpack', d)
}
python do_setup_cmem() {
import shutil
old_overrides = d.getVar('OVERRIDES', False)
if d.getVar('RESERVE_CMEM') is '1':
for cmem_machine in (d.getVar('CMEM_MACHINE') or '').split():
# Create copy of data for additional override
localdata = bb.data.createCopy(d)
localdata.setVar('OVERRIDES', '%s:%s' % (cmem_machine, old_overrides))
bb.data.update_data(localdata)
# Get source directory and dtsi filename
src_dir = localdata.getVar('WORKDIR')
src_dtsi = localdata.getVar('CMEM_DTSI')
# Get destination directory and destination dtsi filename which adds
# the MACHINE prefix.
dst_dir = os.path.join(localdata.getVar('S'), localdata.expand('arch/${ARCH}/boot/dts'))
dst_dtsi = localdata.expand('${MACHINE}-${CMEM_DTSI}')
# Copy cmem.dtsi into source tree
if localdata.getVar('ARCH') is 'arm64':
shutil.copy(os.path.join(src_dir,src_dtsi), os.path.join(dst_dir,'ti',dst_dtsi))
else:
shutil.copy(os.path.join(src_dir,src_dtsi), os.path.join(dst_dir,dst_dtsi))
# Inject dtsi into each dts in list
for dtb in (localdata.getVar('CMEM_DEVICETREE') or '').split():
dts = dtb[:-4] + '.dts'
with open(os.path.join(dst_dir,dts), 'a') as dts_file:
dts_file.write('\n#include "%s"\n' % dst_dtsi)
}
do_patch[postfuncs] += "do_setup_cmem"
do_patch[vardeps] += "${CMEM_VARS}"

View File

@@ -1,38 +0,0 @@
/*
* This is a placeholder for CMEM reserved memory declarations. This
* is simply an example and does not actually reserve any memory for
* CMEM.
*
* The commented sections below provide an example for how to provide
* a reserved memory region for CMEM to use as a buffer pool.
*/
/ {
/*
reserved-memory {
cmem_block_mem_0: cmem_block_mem@a0000000 {
reg = <0x0 0xa0000000 0x0 0x0a000000>;
no-map;
status = "okay";
};
};
*/
cmem {
compatible = "ti,cmem";
#address-cells = <1>;
#size-cells = <0>;
#pool-size-cells = <2>;
status = "disabled";
/*
status = "okay";
cmem_block_0: cmem_block@0 {
reg = <0>;
memory-region = <&cmem_block_mem_0>;
cmem-buf-pools = <1 0x0 0x0a000000>;
};
*/
};
};

View File

@@ -1,29 +0,0 @@
/ {
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
cmem_block_mem_0: cmem_block_mem@a0000000 {
reg = <0x0 0xa0000000 0x0 0x0c000000>;
no-map;
status = "okay";
};
};
cmem {
compatible = "ti,cmem";
#address-cells = <1>;
#size-cells = <0>;
#pool-size-cells = <2>;
status = "okay";
cmem_block_0: cmem_block@0 {
reg = <0>;
memory-region = <&cmem_block_mem_0>;
cmem-buf-pools = <1 0x0 0x0c000000>;
};
};
};

View File

@@ -1,40 +0,0 @@
/ {
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
cmem_block_mem_0: cmem_block_mem@a0000000 {
reg = <0x0 0xa0000000 0x0 0x18000000>;
no-map;
status = "okay";
};
cmem_block_mem_1_ocmc3: cmem_block_mem@40500000 {
reg = <0x0 0x40500000 0x0 0x100000>;
no-map;
status = "okay";
};
};
cmem {
compatible = "ti,cmem";
#address-cells = <1>;
#size-cells = <0>;
#pool-size-cells = <2>;
status = "okay";
cmem_block_0: cmem_block@0 {
reg = <0>;
memory-region = <&cmem_block_mem_0>;
cmem-buf-pools = <1 0x0 0x18000000>;
};
cmem_block_1: cmem_block@1 {
reg = <1>;
memory-region = <&cmem_block_mem_1_ocmc3>;
};
};
};

View File

@@ -1,40 +0,0 @@
/ {
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
cmem_block_mem_0: cmem_block_mem@a0000000 {
reg = <0x0 0xa0000000 0x0 0x20000000>;
no-map;
status = "okay";
};
cmem_block_mem_1_ocmc3: cmem_block_mem@40500000 {
reg = <0x0 0x40500000 0x0 0x100000>;
no-map;
status = "okay";
};
};
cmem {
compatible = "ti,cmem";
#address-cells = <1>;
#size-cells = <0>;
#pool-size-cells = <2>;
status = "okay";
cmem_block_0: cmem_block@0 {
reg = <0>;
memory-region = <&cmem_block_mem_0>;
cmem-buf-pools = <1 0x0 0x20000000>;
};
cmem_block_1: cmem_block@1 {
reg = <1>;
memory-region = <&cmem_block_mem_1_ocmc3>;
};
};
};

View File

@@ -1,40 +0,0 @@
/ {
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
cmem_block_mem_0: cmem_block_mem@a0000000 {
reg = <0x0 0xa0000000 0x0 0x18000000>;
no-map;
status = "okay";
};
cmem_block_mem_1_ocmc3: cmem_block_mem@40500000 {
reg = <0x0 0x40500000 0x0 0x100000>;
no-map;
status = "okay";
};
};
cmem {
compatible = "ti,cmem";
#address-cells = <1>;
#size-cells = <0>;
#pool-size-cells = <2>;
status = "okay";
cmem_block_0: cmem_block@0 {
reg = <0>;
memory-region = <&cmem_block_mem_0>;
cmem-buf-pools = <1 0x0 0x18000000>;
};
cmem_block_1: cmem_block@1 {
reg = <1>;
memory-region = <&cmem_block_mem_1_ocmc3>;
};
};
};

View File

@@ -1,29 +0,0 @@
/ {
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
cmem_block_mem_0: cmem_block_mem@a0000000 {
reg = <0x0 0xa0000000 0x0 0x0c000000>;
no-map;
status = "okay";
};
};
cmem {
compatible = "ti,cmem";
#address-cells = <1>;
#size-cells = <0>;
#pool-size-cells = <2>;
status = "okay";
cmem_block_0: cmem_block@0 {
reg = <0>;
memory-region = <&cmem_block_mem_0>;
cmem-buf-pools = <1 0x0 0x0c000000>;
};
};
};

View File

@@ -1,29 +0,0 @@
/ {
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
cmem_block_mem_0: cmem_block_mem@a0000000 {
reg = <0x0 0xa0000000 0x0 0x0c000000>;
no-map;
status = "okay";
};
};
cmem {
compatible = "ti,cmem";
#address-cells = <1>;
#size-cells = <0>;
#pool-size-cells = <2>;
status = "okay";
cmem_block_0: cmem_block@0 {
reg = <0>;
memory-region = <&cmem_block_mem_0>;
cmem-buf-pools = <1 0x0 0x0c000000>;
};
};
};

View File

@@ -1,29 +0,0 @@
/ {
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
cmem_block_mem_0: cmem_block_mem@a0000000 {
reg = <0x0 0xa0000000 0x0 0x18000000>;
no-map;
status = "okay";
};
};
cmem {
compatible = "ti,cmem";
#address-cells = <1>;
#size-cells = <0>;
#pool-size-cells = <2>;
status = "okay";
cmem_block_0: cmem_block@0 {
reg = <0>;
memory-region = <&cmem_block_mem_0>;
cmem-buf-pools = <1 0x0 0x18000000>;
};
};
};

View File

@@ -1,40 +0,0 @@
/ {
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
cmem_block_mem_0: cmem_block_mem@a0000000 {
reg = <0x0 0xa0000000 0x0 0x0c000000>;
no-map;
status = "okay";
};
cmem_block_mem_1_ocmc3: cmem_block_mem@40500000 {
reg = <0x0 0x40500000 0x0 0x100000>;
no-map;
status = "okay";
};
};
cmem {
compatible = "ti,cmem";
#address-cells = <1>;
#size-cells = <0>;
#pool-size-cells = <2>;
status = "okay";
cmem_block_0: cmem_block@0 {
reg = <0>;
memory-region = <&cmem_block_mem_0>;
cmem-buf-pools = <1 0x0 0x0c000000>;
};
cmem_block_1: cmem_block@1 {
reg = <1>;
memory-region = <&cmem_block_mem_1_ocmc3>;
};
};
};

View File

@@ -7,7 +7,6 @@ inherit kernel
DEFCONFIG_BUILDER = "${S}/ti_config_fragments/defconfig_builder.sh"
require recipes-kernel/linux/setup-defconfig.inc
require recipes-kernel/linux/cmem.inc
require recipes-kernel/linux/ti-uio.inc
require recipes-kernel/linux/bundle-devicetree.inc
require recipes-kernel/linux/kernel-rdepends.inc