diff options
Diffstat (limited to 'meta-ti-bsp/recipes-bsp/uio-module-drv')
4 files changed, 111 insertions, 0 deletions
diff --git a/meta-ti-bsp/recipes-bsp/uio-module-drv/uio-module-drv-test_git.bb b/meta-ti-bsp/recipes-bsp/uio-module-drv/uio-module-drv-test_git.bb new file mode 100644 index 00000000..dc17a1e9 --- /dev/null +++ b/meta-ti-bsp/recipes-bsp/uio-module-drv/uio-module-drv-test_git.bb | |||
@@ -0,0 +1,35 @@ | |||
1 | DESCRIPTION = "Test code for user space IO (UIO) driver" | ||
2 | |||
3 | include uio-module-drv.inc | ||
4 | |||
5 | PR = "r1" | ||
6 | |||
7 | COMPATIBLE_MACHINE = "omap-a15|ti33x|ti43x" | ||
8 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
9 | |||
10 | DEVICE_NAME:omap-a15 = "am57xx" | ||
11 | DEVICE_NAME:ti33x = "am33xx" | ||
12 | DEVICE_NAME:ti43x = "am43xx" | ||
13 | RDEPENDS:${PN} = "uio-module-drv" | ||
14 | |||
15 | do_compile() { | ||
16 | oe_runmake -C ${S} test "DEVICE=${DEVICE_NAME}" | ||
17 | } | ||
18 | |||
19 | do_install() { | ||
20 | install -d ${D}${bindir}/ | ||
21 | install -c -m 755 ${S}/test/uio_mem_test ${D}${bindir}/. | ||
22 | install -c -m 755 ${S}/test/uio_int_test ${D}${bindir}/. | ||
23 | } | ||
24 | |||
25 | do_install:append:omap-a15 () { | ||
26 | install -c -m 755 ${S}/test/prussdrv_test/test/pruss_uio_test ${D}${bindir}/. | ||
27 | } | ||
28 | |||
29 | do_install:append:ti33x () { | ||
30 | install -c -m 755 ${S}/test/prussdrv_test/test/pruss_uio_test ${D}${bindir}/. | ||
31 | } | ||
32 | |||
33 | do_install:append:ti43x () { | ||
34 | install -c -m 755 ${S}/test/prussdrv_test/test/pruss_uio_test ${D}${bindir}/. | ||
35 | } | ||
diff --git a/meta-ti-bsp/recipes-bsp/uio-module-drv/uio-module-drv.inc b/meta-ti-bsp/recipes-bsp/uio-module-drv/uio-module-drv.inc new file mode 100644 index 00000000..8081d021 --- /dev/null +++ b/meta-ti-bsp/recipes-bsp/uio-module-drv/uio-module-drv.inc | |||
@@ -0,0 +1,19 @@ | |||
1 | LICENSE = "BSD" | ||
2 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2b7c96eb2aed7b0f6f922214dbde9016" | ||
3 | |||
4 | BRANCH = "master" | ||
5 | # This corresponds to version 02.02.01.00 | ||
6 | UIO_MODULE_DRV_SRCREV = "bda9260f2220840a60ec0fbc8011cbadf3cf1b91" | ||
7 | |||
8 | PV = "2.2.1.0+git${SRCPV}" | ||
9 | |||
10 | UIO_MODULE_DRV_GIT_URI = "git://git.ti.com/keystone-linux/uio-module-drv.git" | ||
11 | UIO_MODULE_DRV_GIT_PROTOCOL = "git" | ||
12 | SRC_URI = "${UIO_MODULE_DRV_GIT_URI};protocol=${UIO_MODULE_DRV_GIT_PROTOCOL};branch=${BRANCH}" | ||
13 | |||
14 | SRCREV = "${UIO_MODULE_DRV_SRCREV}" | ||
15 | |||
16 | S = "${WORKDIR}/git" | ||
17 | |||
18 | COMPATIBLE_HOST ?= "null" | ||
19 | COMPATIBLE_HOST:ti-soc = "(.*)" | ||
diff --git a/meta-ti-bsp/recipes-bsp/uio-module-drv/uio-module-drv/0001-uio-module-drv-Replace-ioremap_nocache-with-ioremap.patch b/meta-ti-bsp/recipes-bsp/uio-module-drv/uio-module-drv/0001-uio-module-drv-Replace-ioremap_nocache-with-ioremap.patch new file mode 100644 index 00000000..955ef558 --- /dev/null +++ b/meta-ti-bsp/recipes-bsp/uio-module-drv/uio-module-drv/0001-uio-module-drv-Replace-ioremap_nocache-with-ioremap.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From b5c4036dac06817bffd0be21c5fa1b7f75f74e4b Mon Sep 17 00:00:00 2001 | ||
2 | From: Suman Anna <s-anna@ti.com> | ||
3 | Date: Mon, 19 Apr 2021 13:15:51 -0500 | ||
4 | Subject: [PATCH] uio-module-drv: Replace ioremap_nocache with ioremap | ||
5 | |||
6 | The ioremap_nocache is the same as the regular ioremap and its | ||
7 | definition has been dropped from the Linux kernel v5.6 onwards in | ||
8 | commit 4bdc0d676a64 ("remove ioremap_nocache and devm_ioremap_nocache") | ||
9 | [1]. The uio-module-drv module fails to build against these newer | ||
10 | kernels, so fix it by simply replacing ioremap_nocache with ioremap. | ||
11 | |||
12 | [1] | ||
13 | https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4bdc0d676a643140bdf17dbf7eafedee3d496a3c | ||
14 | |||
15 | Signed-off-by: Suman Anna <s-anna@ti.com> | ||
16 | --- | ||
17 | uio_module_drv.c | 2 +- | ||
18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/uio_module_drv.c b/uio_module_drv.c | ||
21 | index 5a67dd199e21..7cc6005d1f05 100644 | ||
22 | --- a/uio_module_drv.c | ||
23 | +++ b/uio_module_drv.c | ||
24 | @@ -240,7 +240,7 @@ static ssize_t uio_module_drv_transfer(struct file *file, char __user *buf, | ||
25 | return -EINVAL; | ||
26 | } | ||
27 | |||
28 | - virt_addr_p = ioremap_nocache(phys_addr, count); | ||
29 | + virt_addr_p = ioremap(phys_addr, count); | ||
30 | if (!virt_addr_p) { | ||
31 | dev_err(uio_module_drv->dev, "Mapping of virtual memory failed\n"); | ||
32 | return(-ENOMEM); | ||
33 | -- | ||
34 | 2.30.1 | ||
35 | |||
diff --git a/meta-ti-bsp/recipes-bsp/uio-module-drv/uio-module-drv_git.bb b/meta-ti-bsp/recipes-bsp/uio-module-drv/uio-module-drv_git.bb new file mode 100644 index 00000000..2bb1f0b3 --- /dev/null +++ b/meta-ti-bsp/recipes-bsp/uio-module-drv/uio-module-drv_git.bb | |||
@@ -0,0 +1,22 @@ | |||
1 | DESCRIPTION = "User space IO (UIO) driver for on-chip modules" | ||
2 | |||
3 | include uio-module-drv.inc | ||
4 | |||
5 | FILESEXTRAPATHS:prepend:= "${THISDIR}/${PN}:" | ||
6 | |||
7 | SRC_URI += "file://0001-uio-module-drv-Replace-ioremap_nocache-with-ioremap.patch" | ||
8 | |||
9 | # This package builds a kernel module, use kernel PR as base and append a local | ||
10 | MACHINE_KERNEL_PR:append = "d" | ||
11 | PR = "${MACHINE_KERNEL_PR}" | ||
12 | |||
13 | module_auto_load_uio-module-drv = "uio-module-drv" | ||
14 | |||
15 | inherit module | ||
16 | |||
17 | do_install:append () { | ||
18 | install -d ${D}${includedir} | ||
19 | cp *.h ${D}${includedir} | ||
20 | } | ||
21 | |||
22 | KERNEL_MODULE_AUTOLOAD += "uio_module_drv" | ||