ti-cgt-pru: add package for PRU Host toolchain
PATCH 1/2 ti-cgt-pru: add package for PRU Host toolchain
TI provides a binary code generation toolchain to develop firmware for the programmable real-time unit/co-processor found in some SOCs such as some models in the AM335x line. This toolchain includes C/C++ support (clpru) rather than just assembler (pasm) supported by the pre-existing am335x-pru-package [1]. Following the lead of the Yocto meta-ti layer [2], this package provides a host toolchain suitable for an x86 (or x86_64) Linux targeting an ARM-based PRU core.
[1] http://processors.wiki.ti.com/index.php/PRU_Assembly_Instructions#pasm_vs._clpru
[2] http://git.yoctoproject.org/cgit/cgit.cgi/meta-ti/tree/recipes-ti/devtools/ti-cgt-pru_2.1.1.bb
--- package/Config.in.host | 1 + package/ti-cgt-pru/Config.in.host | 11 +++++++++++ package/ti-cgt-pru/ti-cgt-pru.hash | 2 ++ package/ti-cgt-pru/ti-cgt-pru.mk | 29 +++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 package/ti-cgt-pru/Config.in.host create mode 100644 package/ti-cgt-pru/ti-cgt-pru.hash create mode 100644 package/ti-cgt-pru/ti-cgt-pru.mk
package/Config.in.host +1 -0
@@ -39,6 +39,7 @@ menu "Host utilities" source "package/squashfs/Config.in.host" source "package/sunxi-tools/Config.in.host" source "package/tegrarcm/Config.in.host" + source "package/ti-cgt-pru/Config.in.host" source "package/uboot-tools/Config.in.host" source "package/util-linux/Config.in.host" source "package/vboot-utils/Config.in.host"
package/ti-cgt-pru/Config.in.host new file +11 -0
@@ -0,0 +1,11 @@ +config BR2_PACKAGE_HOST_TI_CGT_PRU + bool "host ti-cgt-pru" + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" + help + This package provides the Code Generation Tools for the PRU + unit found on some TI processors e.g. AM3358. + + Note: this is a binary cross toolchain that runs on x86 hosts + targeting ARM PRU cores. + + https://www-a.ti.com/downloads/sds_support/TICodegenerationTools/download.htm#PRU
package/ti-cgt-pru/ti-cgt-pru.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally calculated +sha256 df85cd1ed3aea12d577854ece11bf5f2af6ace8c39959eea4cf2fa5973924e0e ti_cgt_pru_2.1.3_linux_installer_x86.bin
package/ti-cgt-pru/ti-cgt-pru.mk new file +29 -0
@@ -0,0 +1,29 @@ +################################################################################ +# +# ti-cgt-pru +# +################################################################################ + +TI_CGT_PRU_VERSION = 2.1.3 +TI_CGT_PRU_SOURCE = ti_cgt_pru_$(TI_CGT_PRU_VERSION)_linux_installer_x86.bin +TI_CGT_PRU_SITE = "http://software-dl.ti.com/codegen/esd/cgt_public_sw/PRU/$(TI_CGT_PRU_VERSION)/" +TI_CGT_PRU_LICENSE = BSD-3c, MIT, TI-TSPA +TI_CGT_PRU_LICENSE_FILES = PRU_Code_Generation_Tools_2.1.x_manifest.html + +define HOST_TI_CGT_PRU_EXTRACT_CMDS + chmod +x $(DL_DIR)/$(TI_CGT_PRU_SOURCE) + $(DL_DIR)/$(TI_CGT_PRU_SOURCE) --prefix $(@D) --mode unattended +endef + +# Since this is largely prebuilt toolchain and likes to live in its own +# directory, put is in $(HOST_DIR)/ti-cgt-pru_$(CGT_PRU_VERION) +# Packages wanting to use this toolchain need to use this path as TI's +# standard PRU_CGT path. + +PRU_CGT = $(HOST_DIR)/ti-cgt-pru_$(TI_CGT_PRU_VERSION) +define HOST_TI_CGT_PRU_INSTALL_CMDS + $(INSTALL) -d $(PRU_CGT) + cp -af $(@D)/$(notdir $(PRU_CGT)) $(HOST_DIR) +endef + +$(eval $(host-generic-package))
Signature · 1 line
2.7.4
PATCH 1/2 ti-cgt-pru: add package for PRU Host toolchain
Hi,
I wanted to follow up on this and the other patch in this series [1]. As these are my first submissions to Buildroot, I'll love if anyone has feedback on the patches or suggestions on next steps in order to get these merged :).
[1] http://patchwork.ozlabs.org/patch/695765/
Thanks,
Ash
Quoted 97 lines · Ash Charles
TI provides a binary code generation toolchain to develop firmware for the programmable real-time unit/co-processor found in some SOCs such as some models in the AM335x line. This toolchain includes C/C++ support (clpru) rather than just assembler (pasm) supported by the pre-existing am335x-pru-package [1]. Following the lead of the Yocto meta-ti layer [2], this package provides a host toolchain suitable for an x86 (or
x86_64) Linux targeting an ARM-based PRU core.[1] http://processors.wiki.ti.com/index.php/PRU_Assembly_Instructions#pasm_vs._clpru
[2] http://git.yoctoproject.org/cgit/cgit.cgi/meta-ti/tree/recipes-ti/devtools/ti-cgt-pru_2.1.1.bbSigned-off-by Ash Charles <[email protected]>--- package/Config.in.host | 1 + package/ti-cgt-pru/Config.in.host | 11 +++++++++++ package/ti-cgt-pru/ti-cgt-pru.hash | 2 ++ package/ti-cgt-pru/ti-cgt-pru.mk | 29 +++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 package/ti-cgt-pru/Config.in.host create mode 100644 package/ti-cgt-pru/ti-cgt-pru.hash create mode 100644 package/ti-cgt-pru/ti-cgt-pru.mkpackage/Config.in.host +1
-0@@ -39,6 +39,7 @@ menu "Host utilities" source "package/squashfs/Config.in.host" source "package/sunxi-tools/Config.in.host" source "package/tegrarcm/Config.in.host" + source "package/ti-cgt-pru/Config.in.host" source "package/uboot-tools/Config.in.host" source "package/util-linux/Config.in.host" source "package/vboot-utils/Config.in.host"package/ti-cgt-pru/Config.in.host new file +11
-0@@ -0,0 +1,11 @@ +config BR2_PACKAGE_HOST_TI_CGT_PRU + bool "host ti-cgt-pru" + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" + help + This package provides the Code Generation Tools for the PRU + unit found on some TI processors e.g. AM3358. + + Note: this is a binary cross toolchain that runs on x86 hosts + targeting ARM PRU cores. + + https://www-a.ti.com/downloads/sds_support/TICodegenerationTools/download.htm#PRUpackage/ti-cgt-pru/ti-cgt-pru.hash new file +2
-0@@ -0,0 +1,2 @@ +# Locally calculated +sha256 df85cd1ed3aea12d577854ece11bf5f2af6ace8c39959eea4cf2fa5973924e0e ti_cgt_pru_2.1.3_linux_installer_x86.binpackage/ti-cgt-pru/ti-cgt-pru.mk new file +29
-1@@ -0,0 +1,29 @@ +################################################################################ +# +# ti-cgt-pru +# +################################################################################ + +TI_CGT_PRU_VERSION = 2.1.3 +TI_CGT_PRU_SOURCE = ti_cgt_pru_$(TI_CGT_PRU_VERSION)_linux_installer_x86.bin +TI_CGT_PRU_SITE = "http://software-dl.ti.com/codegen/esd/cgt_public_sw/PRU/$(TI_CGT_PRU_VERSION)/" +TI_CGT_PRU_LICENSE = BSD-3c, MIT, TI-TSPA +TI_CGT_PRU_LICENSE_FILES = PRU_Code_Generation_Tools_2.1.x_manifest.html + +define HOST_TI_CGT_PRU_EXTRACT_CMDS + chmod +x $(DL_DIR)/$(TI_CGT_PRU_SOURCE) + $(DL_DIR)/$(TI_CGT_PRU_SOURCE) --prefix $(@D) --mode unattended +endef + +# Since this is largely prebuilt toolchain and likes to live in its own +# directory, put is in $(HOST_DIR)/ti-cgt-pru_$(CGT_PRU_VERION) +# Packages wanting to use this toolchain need to use this path as TI's +# standard PRU_CGT path. + +PRU_CGT = $(HOST_DIR)/ti-cgt-pru_$(TI_CGT_PRU_VERSION) +define HOST_TI_CGT_PRU_INSTALL_CMDS + $(INSTALL) -d $(PRU_CGT) + cp -af $(@D)/$(notdir $(PRU_CGT)) $(HOST_DIR) +endef + +$(eval $(host-generic-package)) --2.7.4
PATCH 2/2 ti-pru-support: add staging files for PRU firmware
In reply to Ash CharlesTI provides a set of headers files and libraries useful in developing firmware for real-time (PRU) cores embedded in some processors e.g. AM3358. This package stages these files for any packages creating PRU firmware.
Note: As per [1], use commit v4.0.2 to sync with common TI Linux
versions.
[1] http://e2e.ti.com/support/arm/sitara_arm/f/791/p/552190/2018113#2018113
--- package/Config.in | 1 + package/ti-pru-support/Config.in | 10 ++++++++++ package/ti-pru-support/ti-pru-support.mk | 25 +++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 package/ti-pru-support/Config.in create mode 100644 package/ti-pru-support/ti-pru-support.mk
package/Config.in +1 -0
@@ -463,6 +463,7 @@ endmenu source "package/sysstat/Config.in" source "package/targetcli-fb/Config.in" source "package/ti-gfx/Config.in" + source "package/ti-pru-support/Config.in" source "package/ti-sgx-demos/Config.in" source "package/ti-sgx-km/Config.in" source "package/ti-sgx-um/Config.in"
package/ti-pru-support/Config.in new file +10 -0
@@ -0,0 +1,10 @@ +config BR2_PACKAGE_TI_PRU_SUPPORT + bool "TI PRU support" + select BR2_PACKAGE_HOST_TI_CGT_PRU + help + This package provides useful headers and libraries for the + PRU unit found on some TI processors e.g. AM3358. This + package provides staging only; the included labs and + examples aren't built. + + https://git.ti.com/pru-software-support-package/pru-software-support-package/trees/master
package/ti-pru-support/ti-pru-support.mk new file +25 -0
@@ -0,0 +1,25 @@ +################################################################################ +# +# ti-pru-support +# +################################################################################ + +TI_PRU_SUPPORT_VERSION = 804b548e69ef9fdf44445f6d0968d81cb8a1e7b4 +TI_PRU_SUPPORT_SITE = "git://git.ti.com/pru-software-support-package/pru-software-support-package.git" +TI_PRU_SUPPORT_LICENSE = BSD-3c, GPLv2 +TI_PRU_SUPPORT_LICENSE_FILES = PRU_Package-v5.0-Manifest.html +TI_PRU_SUPPORT_INSTALL_STAGING = YES +TI_PRU_SUPPORT_DEPENDENCIES = host-ti-cgt-pru + +define TI_PRU_SUPPORT_BUILD_CMDS + $(MAKE) PRU_CGT=$(PRU_CGT) -C $(@D)/lib/src +endef + +define TI_PRU_SUPPORT_INSTALL_STAGING_CMDS + $(INSTALL) -d $(STAGING_DIR)/usr/include + cp -af $(@D)/include/* $(STAGING_DIR)/usr/include + $(INSTALL) -d $(STAGING_DIR)/usr/lib + $(INSTALL) -m 0644 $(@D)/lib/src/*/gen/*.lib $(STAGING_DIR)/usr/lib/ +endef + +$(eval $(generic-package))
Signature · 1 line
2.7.4
PATCH 2/2 ti-pru-support: add staging files for PRU firmware
Hello,
Quoted 18 lines · Ash Charles
package/Config.in +1
-0@@ -463,6 +463,7 @@ endmenu source "package/sysstat/Config.in" source "package/targetcli-fb/Config.in" source "package/ti-gfx/Config.in" + source "package/ti-pru-support/Config.in" source "package/ti-sgx-demos/Config.in" source "package/ti-sgx-km/Config.in" source "package/ti-sgx-um/Config.in"package/ti-pru-support/Config.in new file +0
-0
package/ti-pru-support/Config.in line 8
Quoted 8 lines
package/ti-pru-support/Config.in new file +8
-0@@ -0,0 +1,10 @@ +config BR2_PACKAGE_TI_PRU_SUPPORT + bool "TI PRU support" + select BR2_PACKAGE_HOST_TI_CGT_PRU + help + This package provides useful headers and libraries for the + PRU unit found on some TI processors e.g. AM3358. This + package provides staging only; the included labs and + examples aren't built.
It would be nice to have a sub-option to build examples, so that it can potentially installs things in the target.
package/ti-pru-support/Config.in line 10
Quoted 2 lines
package/ti-pru-support/Config.in new file +2
-0+ + https://git.ti.com/pru-software-support-package/pru-software-support-package/trees/master
Just:
package/ti-pru-support/Config.in
Quoted 2 lines
package/ti-pru-support/Config.in new file +2
-0+TI_PRU_SUPPORT_VERSION = 804b548e69ef9fdf44445f6d0968d81cb8a1e7b4 +TI_PRU_SUPPORT_SITE = "git://git.ti.com/pru-software-support-package/pru-software-support-package.git"
Double quotes not needed.
Quoted 4 lines
package/ti-pru-support/Config.in new file +4
-0+TI_PRU_SUPPORT_LICENSE = BSD-3c, GPLv2 +TI_PRU_SUPPORT_LICENSE_FILES = PRU_Package-v5.0-Manifest.html +TI_PRU_SUPPORT_INSTALL_STAGING = YES +TI_PRU_SUPPORT_DEPENDENCIES = host-ti-cgt-pru
package/ti-pru-support/Config.in
Quoted 10 lines
package/ti-pru-support/Config.in new file +10
-0+ +define TI_PRU_SUPPORT_BUILD_CMDS + $(MAKE) PRU_CGT=$(PRU_CGT) -C $(@D)/lib/src +endef + +define TI_PRU_SUPPORT_INSTALL_STAGING_CMDS + $(INSTALL) -d $(STAGING_DIR)/usr/include + cp -af $(@D)/include/* $(STAGING_DIR)/usr/include + $(INSTALL) -d $(STAGING_DIR)/usr/lib + $(INSTALL) -m 0644 $(@D)/lib/src/*/gen/*.lib $(STAGING_DIR)/usr/lib/
My understanding is that those libraries are not for the ARM CPU, but for the PRU. If that's the case, then I believe having them in STAGING_DIR/usr/{include,lib} can cause a lot of confusion. They should be installed in a separate place, so that they are not picked up by the regular ARM cross-compiler.
How does one load/run the PRU programs? Any tool that needs to be executed on the ARM side, and which would be useful to have in Buildroot as well?
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 2/2 ti-pru-support: add staging files for PRU firmware
In reply to Ash CharlesHi Ash,
In addition to Thomas's comments...
Quoted 8 lines · Ash Charles
TI provides a set of headers files and libraries useful in developing firmware for real-time (PRU) cores embedded in some processors e.g. AM3358. This package stages these files for any packages creating PRU firmware.
Note: As per [1], use commit v4.0.2 to sync with common TI Linux
versions.
Quoted 7 lines
[1] http://e2e.ti.com/support/arm/sitara_arm/f/791/p/552190/2018113#2018113
Signed-off-by Ash Charles <[email protected]>--- package/Config.in | 1 + package/ti-pru-support/Config.in | 10 ++++++++++ package/ti-pru-support/ti-pru-support.mk | 25 +++++++++++++++++++++++++
We now also include a hash file for git packages.
Quoted 22 lines
3 files changed, 36 insertions(+) create mode 100644 package/ti-pru-support/Config.in create mode 100644 package/ti-pru-support/ti-pru-support.mkpackage/Config.in +1
-0@@ -463,6 +463,7 @@ endmenu source "package/sysstat/Config.in" source "package/targetcli-fb/Config.in" source "package/ti-gfx/Config.in" + source "package/ti-pru-support/Config.in" source "package/ti-sgx-demos/Config.in" source "package/ti-sgx-km/Config.in" source "package/ti-sgx-um/Config.in"package/ti-pru-support/Config.in new file +0
-0
package/ti-pru-support/Config.in line 3
Quoted 3 lines
package/ti-pru-support/Config.in new file +3
-0@@ -0,0 +1,10 @@ +config BR2_PACKAGE_TI_PRU_SUPPORT + bool "TI PRU support" + select BR2_PACKAGE_HOST_TI_CGT_PRU
You need to propagate the dependencies from that package.
package/ti-pru-support/Config.in line 10
Quoted 7 lines
package/ti-pru-support/Config.in new file +7
-0+ help + This package provides useful headers and libraries for the + PRU unit found on some TI processors e.g. AM3358. This + package provides staging only; the included labs and + examples aren't built. + + https://git.ti.com/pru-software-support-package/pru-software-support-package/trees/master
Not a great URL, but I can't find anything better.
Quoted 6 lines
package/ti-pru-support/ti-pru-support.mk new file +0
-0
package/ti-pru-support/ti-pru-support.mk line 8
Quoted 8 lines
package/ti-pru-support/ti-pru-support.mk new file +8
-0@@ -0,0 +1,25 @@ +################################################################################ +# +# ti-pru-support +# +################################################################################ + +TI_PRU_SUPPORT_VERSION = 804b548e69ef9fdf44445f6d0968d81cb8a1e7b4 +TI_PRU_SUPPORT_SITE = "git://git.ti.com/pru-software-support-package/pru-software-support-package.git"
Since upstream calls it pru-software-support-package, why not give the
buildroot package the same name? It's not needed to put ti- in front of it (we also don't put gnu- in front of make).
package/ti-pru-support/ti-pru-support.mk line 9
Quoted 1 line
package/ti-pru-support/ti-pru-support.mk new file +1
-0+TI_PRU_SUPPORT_LICENSE = BSD-3c, GPLv2
Since we only build/install the lib/src subdirectory, only that license
applies: BSD-3c. The only GPLv2 I could find is the dtsi but you're not installing that.
package/ti-pru-support/ti-pru-support.mk line 11
Quoted 2 lines
package/ti-pru-support/ti-pru-support.mk new file +2
-0+TI_PRU_SUPPORT_LICENSE_FILES = PRU_Package-v5.0-Manifest.html +TI_PRU_SUPPORT_INSTALL_STAGING = YES
Since this is not building for the actual target (ARM), I don't think it's
appropriate to install it to staging. In fact, I would call it a host package.
package/ti-pru-support/ti-pru-support.mk line 22
Quoted 11 lines
package/ti-pru-support/ti-pru-support.mk new file +11
-0+TI_PRU_SUPPORT_DEPENDENCIES = host-ti-cgt-pru + +define TI_PRU_SUPPORT_BUILD_CMDS + $(MAKE) PRU_CGT=$(PRU_CGT) -C $(@D)/lib/src +endef + +define TI_PRU_SUPPORT_INSTALL_STAGING_CMDS + $(INSTALL) -d $(STAGING_DIR)/usr/include + cp -af $(@D)/include/* $(STAGING_DIR)/usr/include + $(INSTALL) -d $(STAGING_DIR)/usr/lib + $(INSTALL) -m 0644 $(@D)/lib/src/*/gen/*.lib $(STAGING_DIR)/usr/lib/
Wouldn't it make more sense to install in $(PRU_CGT), so that it gets picked up
automatically when you build your own application?
Regards,
Arnout
Quoted 4 lines
package/ti-pru-support/ti-pru-support.mk new file +3
-0+endef + +$(eval $(generic-package))
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/2 ti-cgt-pru: add package for PRU Host toolchain
In reply to Ash CharlesHello,
package/ti-cgt-pru/Config.in.host line 3
Quoted 9 lines · Ash Charles
package/ti-cgt-pru/Config.in.host new file +3
-0@@ -0,0 +1,11 @@ +config BR2_PACKAGE_HOST_TI_CGT_PRU + bool "host ti-cgt-pru" + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
depends on BR2_arm
would probably be nice here.
package/ti-cgt-pru/Config.in.host line 9
Quoted 6 lines
package/ti-cgt-pru/Config.in.host new file +6
-0+ help + This package provides the Code Generation Tools for the PRU + unit found on some TI processors e.g. AM3358. + + Note: this is a binary cross toolchain that runs on x86 hosts + targeting ARM PRU cores.
No need to align this second line.
package/ti-cgt-pru/ti-cgt-pru.mk line 9
Quoted 13 lines
index 0000000..a4c8566
package/ti-cgt-pru/ti-cgt-pru.mk new file +9
-0@@ -0,0 +1,29 @@ +################################################################################ +# +# ti-cgt-pru +# +################################################################################ + +TI_CGT_PRU_VERSION = 2.1.3 +TI_CGT_PRU_SOURCE = ti_cgt_pru_$(TI_CGT_PRU_VERSION)_linux_installer_x86.bin +TI_CGT_PRU_SITE = "http://software-dl.ti.com/codegen/esd/cgt_public_sw/PRU/$(TI_CGT_PRU_VERSION)/"
Remove double quotes.
package/ti-cgt-pru/ti-cgt-pru.mk line 15
Quoted 6 lines
package/ti-cgt-pru/ti-cgt-pru.mk new file +6
-0+TI_CGT_PRU_LICENSE = BSD-3c, MIT, TI-TSPA +TI_CGT_PRU_LICENSE_FILES = PRU_Code_Generation_Tools_2.1.x_manifest.html + +define HOST_TI_CGT_PRU_EXTRACT_CMDS + chmod +x $(DL_DIR)/$(TI_CGT_PRU_SOURCE) + $(DL_DIR)/$(TI_CGT_PRU_SOURCE) --prefix $(@D) --mode unattended
Add:
mv $(@D)/ti-cgt-pru_2.1.3/* $(@D) rmdir $(@D)/ti-cgt-pru_2.1.3/
package/ti-cgt-pru/ti-cgt-pru.mk line 23
Quoted 8 lines
package/ti-cgt-pru/ti-cgt-pru.mk new file +8
-0+endef + +# Since this is largely prebuilt toolchain and likes to live in its own +# directory, put is in $(HOST_DIR)/ti-cgt-pru_$(CGT_PRU_VERION) +# Packages wanting to use this toolchain need to use this path as TI's +# standard PRU_CGT path. + +PRU_CGT = $(HOST_DIR)/ti-cgt-pru_$(TI_CGT_PRU_VERSION)
I'd think I'd prefer:
TI_PRU_CGT = $(HOST_DIR)/usr/share/ti-cgt-pru/
package/ti-cgt-pru/ti-cgt-pru.mk line 25
Quoted 2 lines
package/ti-cgt-pru/ti-cgt-pru.mk new file +2
-0+define HOST_TI_CGT_PRU_INSTALL_CMDS + $(INSTALL) -d $(PRU_CGT)
We usually use 'mkdir -p' instead.
package/ti-cgt-pru/ti-cgt-pru.mk line 26
Quoted 1 line
package/ti-cgt-pru/ti-cgt-pru.mk new file +1
-0+ cp -af $(@D)/$(notdir $(PRU_CGT)) $(HOST_DIR)
cp -dpfr $(@D)/* $(TI_PRU_CGT)
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 1/2 ti-cgt-pru: add package for PRU Host toolchain
Quoted 9 lines · Thomas Petazzoni
Quoted 6 lines
+# Since this is largely prebuilt toolchain and likes to live in its own
package/ti-cgt-pru/ti-cgt-pru.mk line 23
Quoted 5 lines
package/ti-cgt-pru/ti-cgt-pru.mk new file +5
-0+# directory, put is in $(HOST_DIR)/ti-cgt-pru_$(CGT_PRU_VERION) +# Packages wanting to use this toolchain need to use this path as TI's +# standard PRU_CGT path. + +PRU_CGT = $(HOST_DIR)/ti-cgt-pru_$(TI_CGT_PRU_VERSION)I'd think I'd prefer:
TI_PRU_CGT= $(HOST_DIR)/usr/share/ti-cgt-pru/
But the variable should be named TI_CGT_PRU_DIR (the package is called
ti-cgt-pru, and it's a directory). I completely agree with the value, however.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/2 ti-cgt-pru: add package for PRU Host toolchain
In reply to Ash CharlesQuoted 40 lines · Ash Charles
TI provides a binary code generation toolchain to develop firmware for the programmable real-time unit/co-processor found in some SOCs such as some models in the AM335x line. This toolchain includes C/C++ support (clpru) rather than just assembler (pasm) supported by the pre-existing am335x-pru-package [1]. Following the lead of the Yocto meta-ti layer [2], this package provides a host toolchain suitable for an x86 (or
x86_64) Linux targeting an ARM-based PRU core.[1] http://processors.wiki.ti.com/index.php/PRU_Assembly_Instructions#pasm_vs._clpru
[2] http://git.yoctoproject.org/cgit/cgit.cgi/meta-ti/tree/recipes-ti/devtools/ti-cgt-pru_2.1.1.bbSigned-off-by Ash Charles <[email protected]>--- package/Config.in.host | 1 + package/ti-cgt-pru/Config.in.host | 11 +++++++++++ package/ti-cgt-pru/ti-cgt-pru.hash | 2 ++ package/ti-cgt-pru/ti-cgt-pru.mk | 29 +++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 package/ti-cgt-pru/Config.in.host create mode 100644 package/ti-cgt-pru/ti-cgt-pru.hash create mode 100644 package/ti-cgt-pru/ti-cgt-pru.mkpackage/Config.in.host +1
-0@@ -39,6 +39,7 @@ menu "Host utilities" source "package/squashfs/Config.in.host" source "package/sunxi-tools/Config.in.host" source "package/tegrarcm/Config.in.host" + source "package/ti-cgt-pru/Config.in.host" source "package/uboot-tools/Config.in.host" source "package/util-linux/Config.in.host" source "package/vboot-utils/Config.in.host"package/ti-cgt-pru/Config.in.host new file +0
-0
package/ti-cgt-pru/Config.in.host line 9
Quoted 9 lines
package/ti-cgt-pru/Config.in.host new file +9
-0@@ -0,0 +1,11 @@ +config BR2_PACKAGE_HOST_TI_CGT_PRU + bool "host ti-cgt-pru" + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" + help + This package provides the Code Generation Tools for the PRU + unit found on some TI processors e.g. AM3358. + + Note: this is a binary cross toolchain that runs on x86 hosts + targeting ARM PRU cores.
I wouldn't say "ARM PRU", that sounds as if the PRU is an ARM.
package/ti-cgt-pru/Config.in.host line 11
Quoted 2 lines
package/ti-cgt-pru/Config.in.host new file +2
-0+ + https://www-a.ti.com/downloads/sds_support/TICodegenerationTools/download.htm#PRU
I think
http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit_Software_Development
is a much more useful URL.
Quoted 14 lines
package/ti-cgt-pru/ti-cgt-pru.hash new file +2
-0@@ -0,0 +1,2 @@ +# Locally calculated +sha256 df85cd1ed3aea12d577854ece11bf5f2af6ace8c39959eea4cf2fa5973924e0e ti_cgt_pru_2.1.3_linux_installer_x86.binpackage/ti-cgt-pru/ti-cgt-pru.mk new file +0
-0
package/ti-cgt-pru/ti-cgt-pru.mk line 10
Quoted 10 lines
package/ti-cgt-pru/ti-cgt-pru.mk new file +10
-0@@ -0,0 +1,29 @@ +################################################################################ +# +# ti-cgt-pru +# +################################################################################ + +TI_CGT_PRU_VERSION = 2.1.3 +TI_CGT_PRU_SOURCE = ti_cgt_pru_$(TI_CGT_PRU_VERSION)_linux_installer_x86.bin +TI_CGT_PRU_SITE = "http://software-dl.ti.com/codegen/esd/cgt_public_sw/PRU/$(TI_CGT_PRU_VERSION)/" +TI_CGT_PRU_LICENSE = BSD-3c, MIT, TI-TSPA
We prefer to specify a bit which license applies to which part. In addition,
the TSPA kind of eats up the other licenses, so I'd put it in front. You're also missing a few licenses. Finally, the title of the non-standardized licenses should be in full. So something like this:
TI_CGT_PRU_LICENSE = TI Technology and Software Publicly Available License
(compiler + PRU library), \ Boost Software License 1.0 (compiler), \
BSD-2c, BSD-3c, MIT, Academic Free License 3.0, Hewlett-Packard (PRU library)
package/ti-cgt-pru/ti-cgt-pru.mk line 11
Quoted 1 line
package/ti-cgt-pru/ti-cgt-pru.mk new file +1
-0+TI_CGT_PRU_LICENSE_FILES = PRU_Code_Generation_Tools_2.1.x_manifest.html
Part of the license text is only in
PRU_CodeGen_Library_2.1_0222433C-30C1-442d-B5C6-2073BD97F80F.spdx.tag
Regards,
Arnout
Quoted 19 lines
package/ti-cgt-pru/ti-cgt-pru.mk new file +18
-0+ +define HOST_TI_CGT_PRU_EXTRACT_CMDS + chmod +x $(DL_DIR)/$(TI_CGT_PRU_SOURCE) + $(DL_DIR)/$(TI_CGT_PRU_SOURCE) --prefix $(@D) --mode unattended +endef + +# Since this is largely prebuilt toolchain and likes to live in its own +# directory, put is in $(HOST_DIR)/ti-cgt-pru_$(CGT_PRU_VERION) +# Packages wanting to use this toolchain need to use this path as TI's +# standard PRU_CGT path. + +PRU_CGT = $(HOST_DIR)/ti-cgt-pru_$(TI_CGT_PRU_VERSION) +define HOST_TI_CGT_PRU_INSTALL_CMDS + $(INSTALL) -d $(PRU_CGT) + cp -af $(@D)/$(notdir $(PRU_CGT)) $(HOST_DIR) +endef + +$(eval $(host-generic-package))
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v2 1/3 ti-cgt-pru: add package for PRU Host toolchain
In reply to Ash CharlesTI provides a binary code generation toolchain to develop firmware for the programmable real-time unit/co-processor found in some SOCs such as some models in the AM335x line. This toolchain includes C/C++ support (clpru) rather than just assembler (pasm) supported by the pre-existing am335x-pru-package [1]. Following the lead of the Yocto meta-ti layer [2], this package provides a host toolchain suitable for an x86 (or x86_64) Linux targeting an ARM-based PRU core.
[1] http://processors.wiki.ti.com/index.php/PRU_Assembly_Instructions#pasm_vs._clpru
[2] http://git.yoctoproject.org/cgit/cgit.cgi/meta-ti/tree/recipes-ti/devtools/ti-cgt-pru_2.1.1.bb
---
Changes v1 --> v2
* extract source to $(@D) cleanly (suggested by Thomas)
* be more explicit about licensing (suggested by Arnout)
* switch to buildroot-suitable name: PRU_CGT --> TI_CGT_PRU_DIR
* sundry clarifications
--- package/Config.in.host | 1 + package/ti-cgt-pru/Config.in.host | 12 ++++++++++++ package/ti-cgt-pru/ti-cgt-pru.hash | 2 ++ package/ti-cgt-pru/ti-cgt-pru.mk | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 package/ti-cgt-pru/Config.in.host create mode 100644 package/ti-cgt-pru/ti-cgt-pru.hash create mode 100644 package/ti-cgt-pru/ti-cgt-pru.mk
package/Config.in.host +1 -0
@@ -39,6 +39,7 @@ menu "Host utilities" source "package/squashfs/Config.in.host" source "package/sunxi-tools/Config.in.host" source "package/tegrarcm/Config.in.host" + source "package/ti-cgt-pru/Config.in.host" source "package/uboot-tools/Config.in.host" source "package/util-linux/Config.in.host" source "package/vboot-utils/Config.in.host"
package/ti-cgt-pru/Config.in.host new file +12 -0
@@ -0,0 +1,12 @@ +config BR2_PACKAGE_HOST_TI_CGT_PRU + bool "host ti-cgt-pru" + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" + depends on BR2_arm + help + This package provides the Code Generation Tools for the PRU + unit found on some TI processors e.g. AM3358. + + Note: this is a binary cross toolchain that runs on x86 hosts + targeting PRU cores found alongside some ARM processors. + + http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit_Software_Development
package/ti-cgt-pru/ti-cgt-pru.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally calculated +sha256 df85cd1ed3aea12d577854ece11bf5f2af6ace8c39959eea4cf2fa5973924e0e ti_cgt_pru_2.1.3_linux_installer_x86.bin
package/ti-cgt-pru/ti-cgt-pru.mk new file +34 -0
@@ -0,0 +1,34 @@ +################################################################################ +# +# ti-cgt-pru +# +################################################################################ + +TI_CGT_PRU_VERSION = 2.1.3 +TI_CGT_PRU_SOURCE = ti_cgt_pru_$(TI_CGT_PRU_VERSION)_linux_installer_x86.bin +TI_CGT_PRU_SITE = http://software-dl.ti.com/codegen/esd/cgt_public_sw/PRU/$(TI_CGT_PRU_VERSION) +TI_CGT_PRU_LICENSE = TI Technology and Software Publicly Available License (compiler + PRU library), \ + Boost Software License 1.0 (compiler), \ + BSD-2c, BSD-3c, MIT, Academic Free License 3.0, Hewlett-Packard (PRU library) +TI_CGT_PRU_LICENSE_FILES = PRU_Code_Generation_Tools_2.1.x_manifest.html \ + PRU_CodeGen_Library_2.1_0222433C-30C1-442d-B5C6-2073BD97F80F.spdx.tag + +define HOST_TI_CGT_PRU_EXTRACT_CMDS + chmod +x $(DL_DIR)/$(TI_CGT_PRU_SOURCE) + $(DL_DIR)/$(TI_CGT_PRU_SOURCE) --prefix $(@D) --mode unattended + mv $(@D)/ti-cgt-pru_2.1.3/* $(@D) + rmdir $(@D)/ti-cgt-pru_2.1.3/ +endef + +# Since this is largely prebuilt toolchain and likes to live in its own +# directory, put is in $(HOST_DIR)/ti-cgt-pru_$(CGT_PRU_VERION) +# Packages wanting to use this toolchain need to use this path as TI's +# standard PRU_CGT path e.g. make PRU_CGT=$(TI_CGT_PRU_DIR)... + +TI_CGT_PRU_DIR = $(HOST_DIR)/ti-cgt-pru_$(TI_CGT_PRU_VERSION) +define HOST_TI_CGT_PRU_INSTALL_CMDS + mkdir -p $(TI_CGT_PRU_DIR) + cp -dpfr $(@D)/* $(TI_CGT_PRU_DIR) +endef + +$(eval $(host-generic-package))
Signature · 1 line
2.7.4
PATCH v2 2/3 pru-software-support: add library for PRU firmware
TI provides a set of headers files and libraries useful in developing firmware for real-time (PRU) cores embedded in some processors e.g. AM3358. This package stages these files for any packages creating PRU firmware.
Note: As per [1], use commit v4.0.2 to sync with common TI Linux
versions.
[1] http://e2e.ti.com/support/arm/sitara_arm/f/791/p/552190/2018113#2018113
---
Changes v1 --> v2
* change from staging to host package (thanks Arnout & Thomas)
* match upstream name of pru-software-support (thanks Arnout)
* ensured config dependencies are propagated (thanks Arnout)
* added a hash file (thanks Arnout)
* various little clean-ups
--- package/Config.in.host | 1 + package/pru-software-support/Config.in.host | 12 ++++++++++ .../pru-software-support/pru-software-support.hash | 2 ++ .../pru-software-support/pru-software-support.mk | 26 ++++++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 package/pru-software-support/Config.in.host create mode 100644 package/pru-software-support/pru-software-support.hash create mode 100644 package/pru-software-support/pru-software-support.mk
package/Config.in.host +1 -0
@@ -33,6 +33,7 @@ menu "Host utilities" source "package/openocd/Config.in.host" source "package/parted/Config.in.host" source "package/patchelf/Config.in.host" + source "package/pru-software-support/Config.in.host" source "package/pwgen/Config.in.host" source "package/qemu/Config.in.host" source "package/sam-ba/Config.in.host"
package/pru-software-support/Config.in.host new file +12 -0
@@ -0,0 +1,12 @@ +config BR2_PACKAGE_HOST_PRU_SOFTWARE_SUPPORT + bool "host PRU software support" + select BR2_PACKAGE_HOST_TI_CGT_PRU + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" + depends on BR2_arm + help + This package provides useful headers and libraries for the + PRU unit found on some TI processors e.g. AM3358. This + package provides staging only; the included labs and + examples aren't built. + + https://git.ti.com/pru-software-support-package/pru-software-support-package
package/pru-software-support/pru-software-support.hash new file +2 -0
@@ -0,0 +1,2 @@ +# no hash for git checkout +none xxx pru-software-support-804b548e69ef9fdf44445f6d0968d81cb8a1e7b4.tar.gz
package/pru-software-support/pru-software-support.mk new file +26 -0
@@ -0,0 +1,26 @@ +################################################################################ +# +# pru-software-support +# +################################################################################ + +PRU_SOFTWARE_SUPPORT_VERSION = 804b548e69ef9fdf44445f6d0968d81cb8a1e7b4 +PRU_SOFTWARE_SUPPORT_SITE = git://git.ti.com/pru-software-support-package/pru-software-support-package.git +PRU_SOFTWARE_SUPPORT_LICENSE = BSD-3c +PRU_SOFTWARE_SUPPORT_LICENSE_FILES = PRU_Package-v5.0-Manifest.html +PRU_SOFTWARE_SUPPORT_DEPENDENCIES = host-ti-cgt-pru + +define HOST_PRU_SOFTWARE_SUPPORT_BUILD_CMDS + $(MAKE) PRU_CGT=$(TI_CGT_PRU_DIR) -C $(@D)/lib/src +endef + +# install this library support alongside PRU toolchain i.e. +# everything in TI_CGT_PRU_DIR as PRU_CGT +define HOST_PRU_SOFTWARE_SUPPORT_INSTALL_CMDS + mkdir -p $(TI_CGT_PRU_DIR)/usr/include + cp -dpfr $(@D)/include/* $(TI_CGT_PRU_DIR)/usr/include + mkdir -p $(TI_CGT_PRU_DIR)/usr/lib + $(INSTALL) -m 0644 $(@D)/lib/src/*/gen/*.lib $(TI_CGT_PRU_DIR)/usr/lib/ +endef + +$(eval $(host-generic-package))
Signature · 1 line
2.7.4
PATCH v2 2/3 pru-software-support: add library for PRU firmware
Quoted 11 lines · Ash Charles
TI provides a set of headers files and libraries useful in developing firmware for real-time (PRU) cores embedded in some processors e.g. AM3358. This package stages these files for any packages creating PRU firmware.
Note: As per [1], use commit v4.0.2 to sync with common TI Linux
versions.[1] http://e2e.ti.com/support/arm/sitara_arm/f/791/p/552190/2018113#2018113
Signed-off-by Ash Charles <[email protected]>
[snip]
package/pru-software-support/pru-software-support.hash line 1
Quoted 7 lines
package/pru-software-support/pru-software-support.hash new file +1
-0@@ -0,0 +1,2 @@ +# no hash for git checkout
Where do you get this from? It's been more than a year now that this is no
longer true, do we still have documentation bits saying that there should be no hash for git downloads?
For git downloads, add a locally calculated sha256.
Quoted 21 lines
package/pru-software-support/pru-software-support.hash new file +1
-0+none xxx pru-software-support-804b548e69ef9fdf44445f6d0968d81cb8a1e7b4.tar.gzpackage/pru-software-support/pru-software-support.mk new file +14
-0@@ -0,0 +1,26 @@ +################################################################################ +# +# pru-software-support +# +################################################################################ + +PRU_SOFTWARE_SUPPORT_VERSION = 804b548e69ef9fdf44445f6d0968d81cb8a1e7b4 +PRU_SOFTWARE_SUPPORT_SITE = git://git.ti.com/pru-software-support-package/pru-software-support-package.git +PRU_SOFTWARE_SUPPORT_LICENSE = BSD-3c +PRU_SOFTWARE_SUPPORT_LICENSE_FILES = PRU_Package-v5.0-Manifest.html +PRU_SOFTWARE_SUPPORT_DEPENDENCIES = host-ti-cgt-pru + +define HOST_PRU_SOFTWARE_SUPPORT_BUILD_CMDS + $(MAKE) PRU_CGT=$(TI_CGT_PRU_DIR) -C $(@D)/lib/src
package/pru-software-support/pru-software-support.mk line 24
Quoted 10 lines
package/pru-software-support/pru-software-support.mk new file +10
-0+endef + +# install this library support alongside PRU toolchain i.e. +# everything in TI_CGT_PRU_DIR as PRU_CGT +define HOST_PRU_SOFTWARE_SUPPORT_INSTALL_CMDS + mkdir -p $(TI_CGT_PRU_DIR)/usr/include + cp -dpfr $(@D)/include/* $(TI_CGT_PRU_DIR)/usr/include + mkdir -p $(TI_CGT_PRU_DIR)/usr/lib + $(INSTALL) -m 0644 $(@D)/lib/src/*/gen/*.lib $(TI_CGT_PRU_DIR)/usr/lib/ +endef
Otherwise, looks good to me.
Regards,
Arnout
Quoted 3 lines
package/pru-software-support/pru-software-support.mk new file +2
-0+ +$(eval $(host-generic-package))
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v2 2/3 pru-software-support: add library for PRU firmware
Hello,
Quoted 7 lines · Arnout Vandecappelle
package/pru-software-support/pru-software-support.hash line 1
Quoted 3 lines
+++ b/package/pru-software-support/pru-software-support.hash
package/pru-software-support/pru-software-support.hash new file +1
-0@@ -0,0 +1,2 @@ +# no hash for git checkoutWhere do you get this from? It's been more than a year now that this is no
longer true, do we still have documentation bits saying that there should be no hash for git downloads?
Correct, but they are not checked, so it isn't really obvious today that we want to have hashes for git downloads.
But still: please add a locally calculated sha256 hash.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH v2 2/3 pru-software-support: add library for PRU firmware
Hi,
Quoted 4 lines · Thomas Petazzoni
Correct, but they are not checked, so it isn't really obvious today that we want to have hashes for git downloads.
But still: please add a locally calculated sha256 hash.
I found the documentation about using 'none' in section 17.4 of the buildroot manual [1]. I'll add a patch with some wording to capture this correction.
Thanks Arnout and Thomas both for the feedback on this series.
[1] https://buildroot.org/downloads/manual/manual.html#adding-packages-hash
--Ash
PATCH v2 3/3 pru-sample: add sample PRU application
In reply to Ash CharlesAs suggested [1], provide a sample application demonstrating how to use the PRU toolchain (specifically, the ti-cgt-pru and pru-software-support packages) within buildroot. This sample is taken from PRU Lab #4 for the AM335x [2, 3].
Note: No special userspace tools are needed to load PRU firmware. The Linux kernel loads the specifically-named files as normal kernel firmware.
[1] http://lists.busybox.net/pipermail/buildroot/2016-November/178050.html
[2] http://processors.wiki.ti.com/index.php/PRU_Training:_Hands-on_Labs
[3] https://git.ti.com/pru-software-support-package/pru-software-support-package/trees/v4.0.2/labs/lab_4
--- package/Config.in | 1 + package/pru-sample/Config.in | 7 ++ package/pru-sample/pru-sample.mk | 22 +++++++ package/pru-sample/src/AM335x_PRU.cmd | 78 +++++++++++++++++++++++ package/pru-sample/src/Makefile | 31 +++++++++ package/pru-sample/src/pru0.c | 95 ++++++++++++++++++++++++++++ package/pru-sample/src/pru1.c | 65 +++++++++++++++++++ package/pru-sample/src/resource_table_0.h | 102 ++++++++++++++++++++++++++++++ package/pru-sample/src/resource_table_1.h | 83 ++++++++++++++++++++++++ 9 files changed, 484 insertions(+) create mode 100644 package/pru-sample/Config.in create mode 100644 package/pru-sample/pru-sample.mk create mode 100644 package/pru-sample/src/AM335x_PRU.cmd create mode 100644 package/pru-sample/src/Makefile create mode 100644 package/pru-sample/src/pru0.c create mode 100644 package/pru-sample/src/pru1.c create mode 100644 package/pru-sample/src/resource_table_0.h create mode 100644 package/pru-sample/src/resource_table_1.h
package/Config.in +1 -0
@@ -437,6 +437,7 @@ endmenu source "package/pifmrds/Config.in" source "package/powertop/Config.in" source "package/pps-tools/Config.in" + source "package/pru-sample/Config.in" source "package/pulseview/Config.in" source "package/read-edid/Config.in" source "package/rfkill/Config.in"
package/pru-sample/Config.in new file +7 -0
@@ -0,0 +1,7 @@ +config BR2_PACKAGE_PRU_SAMPLE + bool "PRU sample firmware" + depends on BR2_PACKAGE_HOST_PRU_SOFTWARE_SUPPORT + help + Sample PRU firmware extracted from lab #4 from the TI + example code. See + http://processors.wiki.ti.com/index.php/PRU_Training:_Hands-on_Labs
package/pru-sample/pru-sample.mk new file +22 -0
@@ -0,0 +1,22 @@ +################################################################################ +# +# pru-sample +# +################################################################################ + +PRU_SAMPLE_VERSION = 0.1 +PRU_SAMPLE_SITE = package/pru-sample/src +PRU_SAMPLE_SITE_METHOD = local +PRU_SAMPLE_DEPENDENCIES = host-ti-cgt-pru host-pru-software-support + +define PRU_SAMPLE_BUILD_CMDS + $(MAKE) PRU_CGT=$(TI_CGT_PRU_DIR) -C $(@D) +endef + +define PRU_SAMPLE_INSTALL_TARGET_CMDS + mkdir -p $(TARGET_DIR)/lib/firmware/ + $(INSTALL) -m 0644 $(@D)/pru0.out $(TARGET_DIR)/lib/firmware/am335x-pru0-fw + $(INSTALL) -m 0644 $(@D)/pru1.out $(TARGET_DIR)/lib/firmware/am335x-pru1-fw +endef + +$(eval $(generic-package))
package/pru-sample/src/AM335x_PRU.cmd new file +78 -0
78 lines not on this page · raw message
package/pru-sample/src/Makefile new file +31 -0
@@ -0,0 +1,31 @@ +ifndef PRU_CGT +define ERROR_BODY +******************************************************************************* +Set PRU_CGT environment variable e.g. + export PRU_CGT=/path/to/pru/code/gen/tools/ti-cgt-pru +******************************************************************************* +endef +$(error $(ERROR_BODY)) +endif + +LINKER_COMMAND_FILE=./AM335x_PRU.cmd +LIBS=--library=$(PRU_CGT)/usr/lib/rpmsg_lib.lib +INCLUDE=--include_path=$(PRU_CGT)/include --include_path=$(PRU_CGT)/usr/include --include_path=$(PRU_CGT)/usr/include/am335x +CFLAGS=-v3 -O2 --display_error_number --endian=little --hardware_mac=on -ppd -ppa +LFLAGS=--reread_libs --warn_sections --stack_size=0x100 --heap_size=0x100 + +TARGETS=pru0.out pru1.out + +.PHONY: all +all: $(TARGETS) + +# Invokes the linker (-z flag) to make the .out file +%.out: %.object $(LINKER_COMMAND_FILE) + @echo 'Linking target: $@' + $(PRU_CGT)/bin/clpru $(CFLAGS) -z -i$(PRU_CGT)/lib -i$(PRU_CGT)/include $(LFLAGS) -o $@ $< $(LINKER_COMMAND_FILE) --library=libc.a $(LIBS) + @echo 'Finished linking building target: $@' + +# Invokes the compiler on all c files in the directory to create the object files +%.object: %.c + @echo 'Compiling: $<' + $(PRU_CGT)/bin/clpru $(INCLUDE) $(CFLAGS) -fe $@ $<
package/pru-sample/src/pru0.c new file +95 -0
95 lines not on this page · raw message
package/pru-sample/src/pru1.c new file +65 -0
65 lines not on this page · raw message
package/pru-sample/src/resource_table_0.h new file +102 -0
102 lines not on this page · raw message
package/pru-sample/src/resource_table_1.h new file +83 -0
83 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 3/3 pru-sample: add sample PRU application
Hello,
Quoted 9 lines · Ash Charles
As suggested [1], provide a sample application demonstrating how to use the PRU toolchain (specifically, the ti-cgt-pru and pru-software-support packages) within buildroot. This sample is taken from PRU Lab #4 for the AM335x [2, 3].
Note: No special userspace tools are needed to load PRU firmware. The Linux kernel loads the specifically-named files as normal kernel firmware.
Quoted 5 lines
[1] http://lists.busybox.net/pipermail/buildroot/2016-November/178050.html
[2] http://processors.wiki.ti.com/index.php/PRU_Training:_Hands-on_Labs
[3] https://git.ti.com/pru-software-support-package/pru-software-support-package/trees/v4.0.2/labs/lab_4Signed-off-by Ash Charles <[email protected]>
We don't really want the full source code of an application in Buildroot. Would it be possible to download it instead?
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH v2 3/3 pru-sample: add sample PRU application
In reply to Ash CharlesQuoted 4 lines · Ash Charles
As suggested [1], provide a sample application demonstrating how to use the PRU toolchain (specifically, the ti-cgt-pru and pru-software-support packages) within buildroot. This sample is taken from PRU Lab #4 for the AM335x [2, 3].
The intention here was not to create a new package, but rather to allow the
installation of the examples provided in pru-software-support. I.e. add a config option "PRU_SOFTWARE_SUPPORT_INSTALL_EXAMPLES". Or rather, add a pru-software-support target package for the examples (the firmware files are to be installed on the target so it has to be a target package).
Obviously, only 1 firmware binary can be installed. So you have the following
options:
- Support only one example.
- Add config options for all the examples and let the user select it.
- Install examples, but not as am335x-pru0-fw, but in a pru-examples subdirectory, leaving it up to the user to copy/link it to the correct name for firmware loading. Mention in the help text how to do that.
I'm in favour of the last option. Among other things, it makes it easier to
support other SoCs than the AM335x.
Quoted 10 lines
Note: No special userspace tools are needed to load PRU firmware. The Linux kernel loads the specifically-named files as normal kernel firmware.
[1] http://lists.busybox.net/pipermail/buildroot/2016-November/178050.html
[2] http://processors.wiki.ti.com/index.php/PRU_Training:_Hands-on_Labs
[3] https://git.ti.com/pru-software-support-package/pru-software-support-package/trees/v4.0.2/labs/lab_4Signed-off-by Ash Charles <[email protected]>
[snip]
package/pru-sample/Config.in line 7
Quoted 7 lines
package/pru-sample/Config.in new file +7
-0+config BR2_PACKAGE_PRU_SAMPLE + bool "PRU sample firmware" + depends on BR2_PACKAGE_HOST_PRU_SOFTWARE_SUPPORT + help + Sample PRU firmware extracted from lab #4 from the TI + example code. See + http://processors.wiki.ti.com/index.php/PRU_Training:_Hands-on_Labs
This is a useful URL, make sure you keep it somewhere.
Quoted 14 lines
package/pru-sample/pru-sample.mk new file +8
-0@@ -0,0 +1,22 @@ +################################################################################ +# +# pru-sample +# +################################################################################ + +PRU_SAMPLE_VERSION = 0.1 +PRU_SAMPLE_SITE = package/pru-sample/src
package/pru-sample/pru-sample.mk line 18
Quoted 10 lines
package/pru-sample/pru-sample.mk new file +10
-0+PRU_SAMPLE_SITE_METHOD = local +PRU_SAMPLE_DEPENDENCIES = host-ti-cgt-pru host-pru-software-support + +define PRU_SAMPLE_BUILD_CMDS + $(MAKE) PRU_CGT=$(TI_CGT_PRU_DIR) -C $(@D) +endef + +define PRU_SAMPLE_INSTALL_TARGET_CMDS + mkdir -p $(TARGET_DIR)/lib/firmware/ + $(INSTALL) -m 0644 $(@D)/pru0.out $(TARGET_DIR)/lib/firmware/am335x-pru0-fw
Add -D to the install command, then the mkdir above isn't needed.
Regards,
Arnout
Quoted 4 lines
package/pru-sample/pru-sample.mk new file +4
-0+ $(INSTALL) -m 0644 $(@D)/pru1.out $(TARGET_DIR)/lib/firmware/am335x-pru1-fw +endef + +$(eval $(generic-package))
[snip]
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v2 3/3 pru-sample: add sample PRU application
Hello,
Quoted 10 lines · Arnout Vandecappelle
Obviously, only 1 firmware binary can be installed. So you have the following
options:
- Support only one example.
- Add config options for all the examples and let the user select it.
- Install examples, but not as am335x-pru0-fw, but in a pru-examples subdirectory, leaving it up to the user to copy/link it to the correct name for firmware loading. Mention in the help text how to do that.I'm in favour of the last option. Among other things, it makes it easier to
support other SoCs than the AM335x.
Agreed.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH v2 3/3 pru-sample: add sample PRU application
In reply to Arnout VandecappelleHi,
Quoted 5 lines · Arnout Vandecappelle
The intention here was not to create a new package, but rather to allow the
installation of the examples provided in pru-software-support. I.e. add a config option "PRU_SOFTWARE_SUPPORT_INSTALL_EXAMPLES". Or rather, add a pru-software-support target package for the examples (the firmware files are to be installed on the target so it has to be a target package).
Okay. How best to implement this? Currently, I have PRU_SOFTWARE_SUPPORT as a host package (Config.in.host) as previously discussed. In the same directory, I can add a PRU_SOFTWARE_EXAMPLES Config.in for a target package that depends on the host package i.e. a user will select PRU support and then, if they wish, can choose to include the examples pack for their target. Then, I just need to add some steps to the existing makefile to build out the examples too.
Quoted 8 lines
Obviously, only 1 firmware binary can be installed. So you have the following
options:
- Support only one example.
- Add config options for all the examples and let the user select it.
- Install examples, but not as am335x-pru0-fw, but in a pru-examples subdirectory, leaving it up to the user to copy/link it to the correct name for firmware loading. Mention in the help text how to do that.
What is the best place for the examples directory tree to be installed /opt/pru-examples?
Is it reasonable to support users who wish to select their desired example firmware before filesystem creation (firmware can be loaded directly on boot & maybe they have a read-only rootfs) rather than on first boot? I think this means they'd have to make the copy in the output/target directory and then rerun make to finalize the rootfs. What is the best way to give a user instructions? (Sorry for all the questions...buildroot neophyte)
--Ash
PATCH v2 3/3 pru-sample: add sample PRU application
Hello,
Quoted 8 lines · Ash Charles
Quoted 5 lines
The intention here was not to create a new package, but rather to allow the
installation of the examples provided in pru-software-support. I.e. add a config option "PRU_SOFTWARE_SUPPORT_INSTALL_EXAMPLES". Or rather, add a pru-software-support target package for the examples (the firmware files are to be installed on the target so it has to be a target package).Okay. How best to implement this? Currently, I have
PRU_SOFTWARE_SUPPORTas a host package (Config.in.host) as previously discussed.
Why is pru-software-support a host package? It really builds/installs things for the target, even if the target is the PRU and not the ARM.
Was it made a host tool after a discussion with Arnout?
Quoted 5 lines
In the same directory, I can add a
PRU_SOFTWARE_EXAMPLESConfig.in for a target package that depends on the host package i.e. a user will select PRU support and then, if they wish, can choose to include the examples pack for their target. Then, I just need to add some steps to the existing makefile to build out the examples too.
I would say pru-software-support should be a target package, with the main option installing the "libraries", and a sub-option to enable the examples.
Quoted 9 lines
Quoted 7 lines
Obviously, only 1 firmware binary can be installed. So you have the following
options:
- Support only one example.
- Add config options for all the examples and let the user select it.
- Install examples, but not as am335x-pru0-fw, but in a pru-examples subdirectory, leaving it up to the user to copy/link it to the correct name for firmware loading. Mention in the help text how to do that.What is the best place for the examples directory tree to be installed
/opt/pru-examples?
/usr/share/pru-software-support/ I'd say.
Quoted 7 lines
Is it reasonable to support users who wish to select their desired example firmware before filesystem creation (firmware can be loaded directly on boot & maybe they have a read-only rootfs) rather than on first boot? I think this means they'd have to make the copy in the output/target directory and then rerun make to finalize the rootfs. What is the best way to give a user instructions? (Sorry for all the questions...buildroot neophyte)
You can give some details by writing a readme.txt in package/pru-software-support/.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH v2 3/3 pru-sample: add sample PRU application
Quoted 5 lines · Thomas Petazzoni
Why is pru-software-support a host package? It really builds/installs things for the target, even if the target is the PRU and not the ARM.
Was it made a host tool after a discussion with Arnout?
It is really best described as a staging package for the PRU. There are
only headers and a library used for static linking. IIRC, Arnout suggested
that putting this as staging was confusing---these aren't for the target
e.g. ARM---and suggested instead that we treat them as host tools along
with the rest of the tool chain.
Ash
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20161128/2de3709a/attachment.html>
PATCH v2 3/3 pru-sample: add sample PRU application
Quoted 8 lines · Ash Charles
Quoted 4 lines · On Sun, Nov 27, 2016 at 8:47 AM, Thomas Petazzoni…
Why is pru-software-support a host package? It really builds/installs things for the target, even if the target is the PRU and not the ARM.
Quoted 7 lines
Quoted 1 line
Was it made a host tool after a discussion with Arnout?
It is really best described as a staging package for the PRU. There are only headers and a library used for static linking. IIRC, Arnout suggested that putting this as staging was confusing---these aren't for the target e.g. ARM---and suggested instead that we treat them as host tools along with the rest of the tool chain.
Yeah, but now I'm not so sure anymore.
Clearly, TI_CGT_PRU_INSTALLDIR is the equivalent of STAGING_DIR for the PRU. In
that sense, it makes sense to have TI_CGT_PRU_INSTALLDIR as a subdirectory of HOST_DIR (just like STAGING_DIR is a subdirectory of HOST_DIR). And it anyway has to be a subdirectory of HOST_DIR because the compiler executables are installed there as well. For me, that was the reason to say that it should be a host package.
However, we are indeed building for the target (kind of). and we are installing
into a staging directory (though it is not in STAGING_DIR). So it makes sense to make it a target package, with INSTALL_STAGING = YES, but where the INSTALL_STAGING step doesn't actually install in staging but in the 'PRU staging' i.e. TI_CGT_PRU_INSTALLDIR.
Thomas, do you agree?
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v2 3/3 pru-sample: add sample PRU application
Quoted 7 lines · Arnout Vandecappelle
Clearly,
TI_CGT_PRU_INSTALLDIRis the equivalent ofSTAGING_DIRfor the PRU. In that sense, it makes sense to haveTI_CGT_PRU_INSTALLDIRas a subdirectory ofHOST_DIR(just likeSTAGING_DIRis a subdirectory ofHOST_DIR). And it anyway has to be a subdirectory ofHOST_DIRbecause the compiler executables are installed there as well. For me, that was the reason to say that it should be a host package.
Quoted 5 lines
However, we are indeed building for the target (kind of). and we are installing
into a staging directory (though it is not inSTAGING_DIR). So it makes sense to make it a target package, withINSTALL_STAGING= YES, but where theINSTALL_STAGINGstep doesn't actually install in staging but in the 'PRU staging' i.e.TI_CGT_PRU_INSTALLDIR.
In either case, TI_CGT_PRU_INSTALLDIR is the right place for it to go :). As we are obliged to cross-compile x86 --> PRU (so staging must be on x86), perhaps this makes an argument for sticking with current (v3) host package approach?
--Ash
PATCH v2 1/3 ti-cgt-pru: add package for PRU Host toolchain
In reply to Ash CharlesQuoted 19 lines · Ash Charles
TI provides a binary code generation toolchain to develop firmware for the programmable real-time unit/co-processor found in some SOCs such as some models in the AM335x line. This toolchain includes C/C++ support (clpru) rather than just assembler (pasm) supported by the pre-existing am335x-pru-package [1]. Following the lead of the Yocto meta-ti layer [2], this package provides a host toolchain suitable for an x86 (or
x86_64) Linux targeting an ARM-based PRU core.[1] http://processors.wiki.ti.com/index.php/PRU_Assembly_Instructions#pasm_vs._clpru
[2] http://git.yoctoproject.org/cgit/cgit.cgi/meta-ti/tree/recipes-ti/devtools/ti-cgt-pru_2.1.1.bbSigned-off-by Ash Charles <[email protected]>---
Changes v1 --> v2
* extract source to $(@D) cleanly (suggested by Thomas)
* be more explicit about licensing (suggested by Arnout)
* switch to buildroot-suitable name:PRU_CGT-->TI_CGT_PRU_DIR
* sundry clarifications
---
[snip]
package/ti-cgt-pru/ti-cgt-pru.mk line 7
Quoted 13 lines
package/ti-cgt-pru/ti-cgt-pru.mk new file +7
-0@@ -0,0 +1,34 @@ +################################################################################ +# +# ti-cgt-pru +# +################################################################################ + +TI_CGT_PRU_VERSION = 2.1.3
Any reason not to use 2.1.4?
package/ti-cgt-pru/ti-cgt-pru.mk line 20
Quoted 13 lines
package/ti-cgt-pru/ti-cgt-pru.mk new file +13
-0+TI_CGT_PRU_SOURCE = ti_cgt_pru_$(TI_CGT_PRU_VERSION)_linux_installer_x86.bin +TI_CGT_PRU_SITE = http://software-dl.ti.com/codegen/esd/cgt_public_sw/PRU/$(TI_CGT_PRU_VERSION) +TI_CGT_PRU_LICENSE = TI Technology and Software Publicly Available License (compiler + PRU library), \ + Boost Software License 1.0 (compiler), \ + BSD-2c, BSD-3c, MIT, Academic Free License 3.0, Hewlett-Packard (PRU library) +TI_CGT_PRU_LICENSE_FILES = PRU_Code_Generation_Tools_2.1.x_manifest.html \ + PRU_CodeGen_Library_2.1_0222433C-30C1-442d-B5C6-2073BD97F80F.spdx.tag + +define HOST_TI_CGT_PRU_EXTRACT_CMDS + chmod +x $(DL_DIR)/$(TI_CGT_PRU_SOURCE) + $(DL_DIR)/$(TI_CGT_PRU_SOURCE) --prefix $(@D) --mode unattended + mv $(@D)/ti-cgt-pru_2.1.3/* $(@D) + rmdir $(@D)/ti-cgt-pru_2.1.3/
Indentation is wrong here: should be tabs. Also, use $(TI_CGT_PRU_VERSION)
instead of 2.1.3.
package/ti-cgt-pru/ti-cgt-pru.mk line 24
Quoted 4 lines
package/ti-cgt-pru/ti-cgt-pru.mk new file +4
-0+endef + +# Since this is largely prebuilt toolchain and likes to live in its own +# directory, put is in $(HOST_DIR)/ti-cgt-pru_$(CGT_PRU_VERION)
it
package/ti-cgt-pru/ti-cgt-pru.mk line 28
Quoted 4 lines
package/ti-cgt-pru/ti-cgt-pru.mk new file +4
-0+# Packages wanting to use this toolchain need to use this path as TI's +# standard PRU_CGT path e.g. make PRU_CGT=$(TI_CGT_PRU_DIR)... + +TI_CGT_PRU_DIR = $(HOST_DIR)/ti-cgt-pru_$(TI_CGT_PRU_VERSION)
Actually, TI_CGT_PRU_DIR is not good because we already define that name (it's
the build directory). It's not really a problem now because we only have a host package so we only define HOST_TI_CGT_PRU_DIR, but still, it's inconsistent. So the variable name should be e.g. TI_CGT_PRU_INSTALLDIR.
Also, I don't think it's necessary to put the version in the installation
directory name. We're not going to support side-by-side install of different versions. But that's just a minor nit.
Regards,
Arnout
Quoted 7 lines
package/ti-cgt-pru/ti-cgt-pru.mk new file +6
-0+define HOST_TI_CGT_PRU_INSTALL_CMDS + mkdir -p $(TI_CGT_PRU_DIR) + cp -dpfr $(@D)/* $(TI_CGT_PRU_DIR) +endef + +$(eval $(host-generic-package))
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v2 1/3 ti-cgt-pru: add package for PRU Host toolchain
Quoted 3 lines · Arnout Vandecappelle
Quoted 1 line
+TI_CGT_PRU_VERSION = 2.1.3
Any reason not to use 2.1.4?
Good question: only because I didn't know it had been released and hadn't tested with it :). Okay if I keep with 2.1.3 for the moment?
The rest of the feedback makes good sense---thanks! --Ash