diff options
Diffstat (limited to 'meta-ti-extras/recipes-devtools/gdbc6x')
8 files changed, 292 insertions, 0 deletions
diff --git a/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x.inc b/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x.inc new file mode 100644 index 00000000..54115f4e --- /dev/null +++ b/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x.inc @@ -0,0 +1,9 @@ +# This corresponds to version 1.1.0 +SRCREV = "dd0c82fb5763a6b32dc6d68e561efb66ab8283d7" + +PV = "1.1.0" +INC_PR = "r7" + +SRC_URI = "git://git.ti.com/git/sdo-emu/gdbc6x.git;protocol=https;branch=${BRANCH}" + +BRANCH = "master" diff --git a/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x/0001-libbfd.h-suppress-GCC9-Wstringop-truncation.patch b/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x/0001-libbfd.h-suppress-GCC9-Wstringop-truncation.patch new file mode 100644 index 00000000..e52efa56 --- /dev/null +++ b/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x/0001-libbfd.h-suppress-GCC9-Wstringop-truncation.patch @@ -0,0 +1,30 @@ +From 0aa294e2bbd37a42266e59cb67687e57bfba4a88 Mon Sep 17 00:00:00 2001 +From: Denys Dmytriyenko <denys@ti.com> +Date: Sat, 15 Feb 2020 15:59:37 -0500 +Subject: [PATCH] libbfd.h: suppress GCC9 -Wstringop-truncation + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Denys Dmytriyenko <denys@ti.com> +--- + gdbc6x/bfd/libbfd.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/gdbc6x/bfd/libbfd.h b/gdbc6x/bfd/libbfd.h +index 72d3c50..3465f89 100644 +--- a/gdbc6x/bfd/libbfd.h ++++ b/gdbc6x/bfd/libbfd.h +@@ -34,6 +34,10 @@ + #pragma GCC diagnostic ignored "-Wcast-function-type" + #endif + ++#if __GNUC__ >= 9 ++#pragma GCC diagnostic ignored "-Wstringop-truncation" ++#endif ++ + #include "hashtab.h" + + /* Align an address upward to a boundary, expressed as a number of bytes. +-- +2.7.4 + diff --git a/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x/init b/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x/init new file mode 100644 index 00000000..90210b82 --- /dev/null +++ b/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x/init @@ -0,0 +1,48 @@ +#!/bin/bash + +GDB_DEVICE_NAME='/dev/gdbtty$i' +DSP_FIRMWARE_NAME='/lib/firmware/dra7-dsp$[$i+1]-fw.xe66' + +DSP_L2_GLOBAL_OFFSET="40000000" +DSP_L2_GLOBAL_SHIFT="00800000" + +case "$1" in + start) + + dsp_core_l2_offset=$DSP_L2_GLOBAL_OFFSET + + i=0 + while [ -c "`eval echo $GDB_DEVICE_NAME`" ] + do + dsp_firmware=`eval echo $DSP_FIRMWARE_NAME` + + if [ -f "`eval echo $DSP_FIRMWARE_NAME`" ] + then + eval echo "Initializing $GDB_DEVICE_NAME based on $DSP_FIRMWARE_NAME ..." + + gdb_data_local=`eval readelf -s "$DSP_FIRMWARE_NAME" | \ + grep 'gdb_globalData' | \ + awk '{print $2}'` + + echo "gdb_globalData (local) = $gdb_data_local" + printf "gdb_globalData (global) = %X\n" \ + $[0x$gdb_data_local + 0x$dsp_core_l2_offset] + + + printf "%X\n" $[0x$gdb_data_local + 0x$dsp_core_l2_offset] \ + >> `eval echo $GDB_DEVICE_NAME` + fi + i=$[$i + 1] + dsp_core_l2_offset=`printf "%X" $[0x$dsp_core_l2_offset + 0x$DSP_L2_GLOBAL_SHIFT]` + done + ;; + stop) + # Nothing to be done. + ;; + *) + echo "Usage: $0 {start|stop}" + exit 1 + ;; +esac + + diff --git a/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb b/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb new file mode 100644 index 00000000..d3ada9c6 --- /dev/null +++ b/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb @@ -0,0 +1,49 @@ +DESCRIPTION = "GNU debugger for TI C6X DSP." +SECTION = "devel" +LICENSE = "GPL-3.0-or-later" +LIC_FILES_CHKSUM = "file://debian/copyright;md5=bf0fe2872eb3dfeebb2cbe38206fe81f" + +DEPENDS = "ncurses bison-native texinfo flex-native gettext" + +COMPATIBLE_MACHINE = "dra7xx" + +PR = "${INC_PR}.1" + +SRC_URI:append = " \ + file://init \ + file://0001-libbfd.h-suppress-GCC9-Wstringop-truncation.patch;striplevel=2 \ +" + +S = "${WORKDIR}/git/gdbc6x" + +inherit update-rc.d +inherit gettext + +CFLAGS += "-fcommon" + +do_configure () { + cd ${S} + ./configure --program-suffix=c6x --target=tic6x-elf-tirtos --host=${HOST_SYS} --prefix=${S}/install_gdb +} + +do_install () { + make install + + # Custom install to prevent conflict with standard GDB. + install -d ${D}${bindir} + install -d ${D}${includedir} + install -m 755 ${S}/install_gdb/bin/gdbc6x ${D}${bindir} + cp -rf ${S}/install_gdb/include/* ${D}${includedir} + + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/gdbserverproxy +} + +RDEPENDS:${PN} = "gdbserverproxy-module-drv bash" + +include gdbc6x.inc + +INITSCRIPT_NAME = "gdbserverproxy" +INITSCRIPT_PARAMS = "defaults 95" + +PARALLEL_MAKE = "" diff --git a/meta-ti-extras/recipes-devtools/gdbc6x/gdbserver-c6x_git.bb b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserver-c6x_git.bb new file mode 100644 index 00000000..3460eadb --- /dev/null +++ b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserver-c6x_git.bb @@ -0,0 +1,49 @@ +DESCRIPTION = "TI gdb-server to be used with c6xgdb." +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://../debian/copyright;md5=82c616b6c8f9c11c46feaaf8f9a11495" + +DEPENDS = "ti-xdais ti-framework-components ti-cgt6x-native ti-sysbios ti-xdctools-native" + +PR = "${INC_PR}.0" + +S = "${WORKDIR}/git/gdbserver-c6x/src" + +PLATFORM = "" +PLATFORM:dra7xx = "DRA7xx_PLATFORM" + +EXTRA_OEMAKE = "PLATFORM=${PLATFORM}" + +export XDAIS_DIR = "${XDAIS_INSTALL_DIR}" +export FC_DIR = "${FC_INSTALL_DIR}" +export TI_CGT_INSTALL = "${STAGING_DIR_NATIVE}/usr/share/ti/cgt-c6x" +export BIOS_DIR = "${SYSBIOS_INSTALL_DIR}" +export XDC_DIR = "${XDC_INSTALL_DIR}" + +# The following is to prevent an unused configure.ac from erroneously +# triggering the QA check for gettext. +EXTRA_OECONF = "--disable-nls" +do_configure() { + : +} + +do_install() { + install -d ${D}${datadir}/ti/gdbc6x/include + install -d ${D}${datadir}/ti/gdbc6x/lib + cp -f ../include/* ${D}${datadir}/ti/gdbc6x/include + cp -f ../lib/* ${D}${datadir}/ti/gdbc6x/lib +} + +COMPATIBLE_MACHINE = "dra7xx" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +FILES:${PN}-dev += "\ + ${datadir}/ti/gdbc6x \ +" + +include gdbc6x.inc + +require recipes-ti/includes/ti-paths.inc + +ALLOW_EMPTY:${PN} = "1" + +PARALLEL_MAKE = "" diff --git a/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv/0001-Support-Linux-kernels-v5.15.patch b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv/0001-Support-Linux-kernels-v5.15.patch new file mode 100644 index 00000000..fdf7e95f --- /dev/null +++ b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv/0001-Support-Linux-kernels-v5.15.patch @@ -0,0 +1,40 @@ +From 7e6e1312629f9bc7a24871f7f395f2d288a1758f Mon Sep 17 00:00:00 2001 +From: Andrew Davis <afd@ti.com> +Date: Tue, 18 Apr 2023 11:38:54 -0500 +Subject: [PATCH] Support Linux kernels v5.15+ + +put_tty_driver was removed and write_room return type has changed. + +Function tty_driver_kref_put has been around a while, so no need +to do a kernel version check. + +Upstream-Status: Inactive-Upstream +Signed-off-by: Andrew Davis <afd@ti.com> +--- + kernel_module/gdbproxy-mod/gdbserverproxy.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/kernel_module/gdbproxy-mod/gdbserverproxy.c b/kernel_module/gdbproxy-mod/gdbserverproxy.c +index 418b6db..4b1c676 100644 +--- a/kernel_module/gdbproxy-mod/gdbserverproxy.c ++++ b/kernel_module/gdbproxy-mod/gdbserverproxy.c +@@ -540,7 +540,11 @@ static int gdb_write(struct tty_struct *tty, + * + * + */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)) ++static unsigned int gdb_write_room(struct tty_struct *tty) ++#else + static int gdb_write_room(struct tty_struct *tty) ++#endif + { + return GDB_STR_SIZE; + } +@@ -914,7 +918,7 @@ static int __init gdb_dev_init(void) + if (ret < 0) { + + printk(KERN_ERR "Couldn't register gdbtty driver.\n"); +- put_tty_driver(tty_gdb_driver); ++ tty_driver_kref_put(tty_gdb_driver); + return ret; + } diff --git a/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv/0002-Support-Linux-kernels-v6.6.patch b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv/0002-Support-Linux-kernels-v6.6.patch new file mode 100644 index 00000000..1e897394 --- /dev/null +++ b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv/0002-Support-Linux-kernels-v6.6.patch @@ -0,0 +1,31 @@ +From: Ryan Eatmon <reatmon@ti.com> +Date: Wed, 08 Feb 2024 10:43:00 -0500 +Subject: [PATCH] Support Linux kernels v6.6+ + +gdb_write arg changed from int to unsigned int + +Upstream-Status: Inactive-Upstream + +Signed-off-by: Ryan Eatmon <reatmon@ti.com> +--- + kernel_module/gdbproxy-mod/gdbserverproxy.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/kernel_module/gdbproxy-mod/gdbserverproxy.c b/kernel_module/gdbproxy-mod/gdbserverproxy.c +index 418b6db..4b1c676 100644 +--- a/kernel_module/gdbproxy-mod/gdbserverproxy.c ++++ b/kernel_module/gdbproxy-mod/gdbserverproxy.c +@@ -496,8 +496,13 @@ static void gdb_close(struct tty_struct *tty, struct file *filp) + * + * + */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,6,0)) ++static int gdb_write(struct tty_struct *tty, ++ const unsigned char *buf, unsigned int count) ++#else + static int gdb_write(struct tty_struct *tty, + const unsigned char *buf, int count) ++#endif + { + struct dsp_session *dsp = tty->driver_data; + int ret = 0; diff --git a/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv_git.bb b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv_git.bb new file mode 100644 index 00000000..8bea12f7 --- /dev/null +++ b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv_git.bb @@ -0,0 +1,36 @@ +DESCRIPTION = "Interface for GDB to commincate witha TI C66X DSP" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING.txt;md5=75859989545e37968a99b631ef42722e" + +# This package builds a kernel module, use kernel PR as base and append a local +MACHINE_KERNEL_PR:append = "b" +PR = "${MACHINE_KERNEL_PR}" +PV:append = "+git" + +SRC_URI:append = "\ + file://0001-Support-Linux-kernels-v5.15.patch;patchdir=../.. \ + file://0002-Support-Linux-kernels-v6.6.patch;patchdir=../.. \ +" + +S = "${WORKDIR}/git/kernel_module/gdbproxy-mod" + +inherit module + +PLATFORM = "" +PLATFORM:dra7xx = "DRA7xx_PLATFORM" + +EXTRA_OEMAKE = "PLATFORM=${PLATFORM} KVERSION=${KERNEL_VERSION} KERNEL_SRC=${STAGING_KERNEL_DIR}" + +# The following is to prevent an unused configure.ac from erroneously +# triggering the QA check for gettext. +EXTRA_OECONF = "--disable-nls" +do_configure() { + : +} + +COMPATIBLE_MACHINE = "dra7xx" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +include gdbc6x.inc + +KERNEL_MODULE_AUTOLOAD += "gdbserverproxy" |