diff mbox

[1/2] ti-cgt-pru: add package for PRU Host toolchain

Message ID 1479324273-13589-1-git-send-email-ash.charles@savoirfairelinux.com
State Superseded
Headers show

Commit Message

Ash Charles Nov. 16, 2016, 7:24 p.m. UTC
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

Signed-off-by: Ash Charles <ash.charles@savoirfairelinux.com>
---
 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

Comments

Ash Charles Nov. 21, 2016, 11:51 p.m. UTC | #1
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

On Wed, Nov 16, 2016 at 2:24 PM, Ash Charles <ashcharles@gmail.com> wrote:
> 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
>
> Signed-off-by: Ash Charles <ash.charles@savoirfairelinux.com>
> ---
>  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
>
> diff --git a/package/Config.in.host b/package/Config.in.host
> index 3b115c5..e244694 100644
> --- a/package/Config.in.host
> +++ b/package/Config.in.host
> @@ -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"
> diff --git a/package/ti-cgt-pru/Config.in.host b/package/ti-cgt-pru/Config.in.host
> new file mode 100644
> index 0000000..440f774
> --- /dev/null
> +++ b/package/ti-cgt-pru/Config.in.host
> @@ -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
> diff --git a/package/ti-cgt-pru/ti-cgt-pru.hash b/package/ti-cgt-pru/ti-cgt-pru.hash
> new file mode 100644
> index 0000000..1c19b33
> --- /dev/null
> +++ b/package/ti-cgt-pru/ti-cgt-pru.hash
> @@ -0,0 +1,2 @@
> +# Locally calculated
> +sha256 df85cd1ed3aea12d577854ece11bf5f2af6ace8c39959eea4cf2fa5973924e0e        ti_cgt_pru_2.1.3_linux_installer_x86.bin
> diff --git a/package/ti-cgt-pru/ti-cgt-pru.mk b/package/ti-cgt-pru/ti-cgt-pru.mk
> new file mode 100644
> index 0000000..a4c8566
> --- /dev/null
> +++ b/package/ti-cgt-pru/ti-cgt-pru.mk
> @@ -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
>
Thomas Petazzoni Nov. 24, 2016, 3:44 p.m. UTC | #2
Hello,

On Wed, 16 Nov 2016 14:24:32 -0500, Ash Charles wrote:

> diff --git a/package/ti-cgt-pru/Config.in.host b/package/ti-cgt-pru/Config.in.host
> new file mode 100644
> index 0000000..440f774
> --- /dev/null
> +++ b/package/ti-cgt-pru/Config.in.host
> @@ -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.

> +	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.


> index 0000000..a4c8566
> --- /dev/null
> +++ b/package/ti-cgt-pru/ti-cgt-pru.mk
> @@ -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.

> +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/

> +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/

> +define HOST_TI_CGT_PRU_INSTALL_CMDS
> +	$(INSTALL) -d $(PRU_CGT)

We usually use 'mkdir -p' instead.

> +	cp -af $(@D)/$(notdir $(PRU_CGT)) $(HOST_DIR)

	cp -dpfr $(@D)/* $(TI_PRU_CGT)

Thanks!

Thomas
Arnout Vandecappelle Nov. 24, 2016, 8:07 p.m. UTC | #3
On 16-11-16 20:24, Ash Charles wrote:
> 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
> 
> Signed-off-by: Ash Charles <ash.charles@savoirfairelinux.com>
> ---
>  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
> 
> diff --git a/package/Config.in.host b/package/Config.in.host
> index 3b115c5..e244694 100644
> --- a/package/Config.in.host
> +++ b/package/Config.in.host
> @@ -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"
> diff --git a/package/ti-cgt-pru/Config.in.host b/package/ti-cgt-pru/Config.in.host
> new file mode 100644
> index 0000000..440f774
> --- /dev/null
> +++ b/package/ti-cgt-pru/Config.in.host
> @@ -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.

> +
> +	  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.


> diff --git a/package/ti-cgt-pru/ti-cgt-pru.hash b/package/ti-cgt-pru/ti-cgt-pru.hash
> new file mode 100644
> index 0000000..1c19b33
> --- /dev/null
> +++ b/package/ti-cgt-pru/ti-cgt-pru.hash
> @@ -0,0 +1,2 @@
> +# Locally calculated
> +sha256	df85cd1ed3aea12d577854ece11bf5f2af6ace8c39959eea4cf2fa5973924e0e	ti_cgt_pru_2.1.3_linux_installer_x86.bin
> diff --git a/package/ti-cgt-pru/ti-cgt-pru.mk b/package/ti-cgt-pru/ti-cgt-pru.mk
> new file mode 100644
> index 0000000..a4c8566
> --- /dev/null
> +++ b/package/ti-cgt-pru/ti-cgt-pru.mk
> @@ -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)

> +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

> +
> +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))
>
Arnout Vandecappelle Nov. 24, 2016, 8:16 p.m. UTC | #4
On 24-11-16 16:44, Thomas Petazzoni wrote:
>> +# 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/

 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
diff mbox

Patch

diff --git a/package/Config.in.host b/package/Config.in.host
index 3b115c5..e244694 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -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"
diff --git a/package/ti-cgt-pru/Config.in.host b/package/ti-cgt-pru/Config.in.host
new file mode 100644
index 0000000..440f774
--- /dev/null
+++ b/package/ti-cgt-pru/Config.in.host
@@ -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
diff --git a/package/ti-cgt-pru/ti-cgt-pru.hash b/package/ti-cgt-pru/ti-cgt-pru.hash
new file mode 100644
index 0000000..1c19b33
--- /dev/null
+++ b/package/ti-cgt-pru/ti-cgt-pru.hash
@@ -0,0 +1,2 @@ 
+# Locally calculated
+sha256	df85cd1ed3aea12d577854ece11bf5f2af6ace8c39959eea4cf2fa5973924e0e	ti_cgt_pru_2.1.3_linux_installer_x86.bin
diff --git a/package/ti-cgt-pru/ti-cgt-pru.mk b/package/ti-cgt-pru/ti-cgt-pru.mk
new file mode 100644
index 0000000..a4c8566
--- /dev/null
+++ b/package/ti-cgt-pru/ti-cgt-pru.mk
@@ -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))