Skip to contentSkip to conversation

am335x-pru-package: new package

PATCH New Frank Hunleth 2 participants 5 messages Feb 13, 2014 – Oct 12, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 am335x-pru-package: new package

am335x-pru-package provides an assembler and program loader for Texas Instrument's AM335x programmable real-time units.

---
 package/Config.in                                |  1 +
 package/Config.in.host                           |  1 +
 package/am335x-pru-package/Config.in             |  7 +++++
 package/am335x-pru-package/Config.in.host        |  7 +++++
 package/am335x-pru-package/am335x-pru-package.mk | 40 ++++++++++++++++++++++++
 5 files changed, 56 insertions(+)
 create mode 100644 package/am335x-pru-package/Config.in
 create mode 100644 package/am335x-pru-package/Config.in.host
 create mode 100644 package/am335x-pru-package/am335x-pru-package.mk
package/Config.in +1 -0
index fca61d6..71bd2d1 100644
@@ -260,6 +260,7 @@ source "package/zd1211-firmware/Config.in"
 endmenu
 source "package/a10disp/Config.in"
 source "package/acpid/Config.in"
+source "package/am335x-pru-package/Config.in"
 source "package/avrdude/Config.in"
 source "package/cdrkit/Config.in"
 source "package/cryptsetup/Config.in"
package/Config.in.host +1 -0
index ac6091f..a364f4e 100644
@@ -1,5 +1,6 @@
 menu "Host utilities"
 
+source "package/am335x-pru-package/Config.in.host"
 source "package/dfu-util/Config.in.host"
 source "package/dosfstools/Config.in.host"
 source "package/e2fsprogs/Config.in.host"
package/am335x-pru-package/Config.in new file +7 -0
new file mode 100644
index 0000000..66d7773
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_AM335X_PRU_PACKAGE
+	bool "am335x-pru-package"
+	depends on BR2_arm # only relevant for TI am335x
+	help
+	  TI AM335X PRU program loader
+
+	  https://github.com/beagleboard/am335x_pru_package
package/am335x-pru-package/Config.in.host new file +7 -0
new file mode 100644
index 0000000..283128e
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_HOST_AM335X_PRU_PACKAGE
+	bool "host am335x-pru-package"
+	depends on BR2_arm # only relevant for TI am335x
+	help
+	  TI AM335X PRU assembler (pasm)
+
+	  https://github.com/beagleboard/am335x_pru_package
package/am335x-pru-package/am335x-pru-package.mk new file +40 -0
new file mode 100644
index 0000000..f70e679
@@ -0,0 +1,40 @@
+################################################################################
+#
+# am335x-pru-package
+#
+################################################################################
+
+AM335X_PRU_PACKAGE_VERSION = f46d8cb564f492740ccd33a03e8368ee4ecc83ae
+AM335X_PRU_PACKAGE_SITE = $(call github,beagleboard,am335x_pru_package,$(AM335X_PRU_PACKAGE_VERSION))
+AM335X_PRU_PACKAGE_LICENSE = BSD-3c
+AM335X_PRU_PACKAGE_LICENSE_FILES = pru_sw/utils/LICENCE.txt
+AM335X_PRU_PACKAGE_DEPENDENCIES = host-am335x-pru-package
+AM335X_PRU_PACKAGE_INSTALL_STAGING = YES
+
+define AM335X_PRU_PACKAGE_BUILD_CMDS
+	$(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" \
+		-C $(@D)/pru_sw/app_loader/interface all
+endef
+
+define AM335X_PRU_PACKAGE_INSTALL_STAGING_CMDS
+	$(MAKE1) PREFIX="$(STAGING_DIR)/usr" \
+		-C $(@D)/pru_sw/app_loader/interface install
+endef
+
+define AM335X_PRU_PACKAGE_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/pru_sw/app_loader/lib/libprussdrv.so \
+		$(TARGET_DIR)/usr/lib
+endef
+
+define HOST_AM335X_PRU_PACKAGE_BUILD_CMDS
+	cd $(@D)/pru_sw/utils/pasm_source && \
+		$(HOSTCC) -Wall -D_UNIX_ pasm.c pasmpp.c pasmexp.c pasmop.c \
+			pasmdot.c pasmstruct.c pasmmacro.c -o ../pasm
+endef
+
+define HOST_AM335X_PRU_PACKAGE_INSTALL_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/pru_sw/utils/pasm $(HOST_DIR)/usr/bin/pasm
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/1 am335x-pru-package: new package

Franck, All,

On 2014-02-12 20:43 -0500, Frank Hunleth spake thusly:

Quoted 4 lines

am335x-pru-package provides an assembler and program loader for Texas Instrument's AM335x programmable real-time units.

Thanks for your contribution, and sorry for the delay.

Here are a few comments, below.

[--SNIP--]

package/am335x-pru-package/Config.in.host line 7

Quoted 13 lines
package/am335x-pru-package/Config.in.host new file +7 -0
new file mode 100644
index 0000000..283128e
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_HOST_AM335X_PRU_PACKAGE
+	bool "host am335x-pru-package"
+	depends on BR2_arm # only relevant for TI am335x
+	help
+	  TI AM335X PRU assembler (pasm)
+
+	  https://github.com/beagleboard/am335x_pru_package

Is there any special reason this is a user-visible option?

Does it make sense to build the host variant without building the target variant?

Quoted 12 lines
package/am335x-pru-package/am335x-pru-package.mk new file +6 -0
new file mode 100644
index 0000000..f70e679
@@ -0,0 +1,40 @@
+################################################################################
+#
+# am335x-pru-package
+#
+################################################################################
+

package/am335x-pru-package/am335x-pru-package.mk line 16

Quoted 10 lines
package/am335x-pru-package/am335x-pru-package.mk new file +10 -0
+AM335X_PRU_PACKAGE_VERSION = f46d8cb564f492740ccd33a03e8368ee4ecc83ae
+AM335X_PRU_PACKAGE_SITE = $(call github,beagleboard,am335x_pru_package,$(AM335X_PRU_PACKAGE_VERSION))
+AM335X_PRU_PACKAGE_LICENSE = BSD-3c
+AM335X_PRU_PACKAGE_LICENSE_FILES = pru_sw/utils/LICENCE.txt
+AM335X_PRU_PACKAGE_DEPENDENCIES = host-am335x-pru-package
+AM335X_PRU_PACKAGE_INSTALL_STAGING = YES
+
+define AM335X_PRU_PACKAGE_BUILD_CMDS
+	$(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" \
+		-C $(@D)/pru_sw/app_loader/interface all

Usually, 'all' is the default target for make, so it is not required to specify it. You only need to specify it if it is not the default.

package/am335x-pru-package/am335x-pru-package.mk line 26

Quoted 10 lines
package/am335x-pru-package/am335x-pru-package.mk new file +10 -0
+endef
+
+define AM335X_PRU_PACKAGE_INSTALL_STAGING_CMDS
+	$(MAKE1) PREFIX="$(STAGING_DIR)/usr" \
+		-C $(@D)/pru_sw/app_loader/interface install
+endef
+
+define AM335X_PRU_PACKAGE_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/pru_sw/app_loader/lib/libprussdrv.so \
+		$(TARGET_DIR)/usr/lib

You need to pass the full intall path, not only the directory name. If $(TARGET_DIR)/usr/lib does not exist, then install would simply copy libprussdrv.so to the file $(TARGET_DIR)/usr/lib.

    $(INSTALL) -m 0755 -D $(@D)/pru_sw/app_loader/lib/libprussdrv.so \
    	$(TARGET_DIR)/usr/lib/libprussdrv.so

package/am335x-pru-package/am335x-pru-package.mk line 32

Quoted 6 lines
package/am335x-pru-package/am335x-pru-package.mk new file +6 -0
+endef
+
+define HOST_AM335X_PRU_PACKAGE_BUILD_CMDS
+	cd $(@D)/pru_sw/utils/pasm_source && \
+		$(HOSTCC) -Wall -D_UNIX_ pasm.c pasmpp.c pasmexp.c pasmop.c \
+			pasmdot.c pasmstruct.c pasmmacro.c -o ../pasm

Any reason you output in the parent directory?
Also, no indentation on the second line.

Why not:

    cd $(@D)/pru_sw/utils/pasm_source && \
    $(HOSTCC) -Wall -D_UNIX_ pasm.c pasmpp.c pasmexp.c pasmop.c \
    	pasmdot.c pasmstruct.c pasmmacro.c -o pasm

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 am335x-pru-package: new package

Hi Yann,

Quoted 9 lines · Yann E. MORIN

Franck, All,

On 2014-02-12 20:43 -0500, Frank Hunleth spake thusly:

Quoted 4 lines

am335x-pru-package provides an assembler and program loader for Texas Instrument's AM335x programmable real-time units.

Thanks for your contribution, and sorry for the delay.

No problem regarding the delay. There have been some recent discussions around this project that may affect the buildroot integration, so I'm waiting on those to be resolved as well. I'll be sending the next patch updates hopefully in the next week or so as I understand more about what will be happening.

Quoted 20 lines

Here are a few comments, below.

[--SNIP--]

package/am335x-pru-package/Config.in.host line 7

Quoted 13 lines
package/am335x-pru-package/Config.in.host new file +7 -0
new file mode 100644
index 0000000..283128e
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_HOST_AM335X_PRU_PACKAGE
+     bool "host am335x-pru-package"
+     depends on BR2_arm # only relevant for TI am335x
+     help
+       TI AM335X PRU assembler (pasm)
+
+       https://github.com/beagleboard/am335x_pru_package

Is there any special reason this is a user-visible option?

Quoted 2 lines

Does it make sense to build the host variant without building the target variant?

I don't think so. I'll remove the host variant from being user visible.

Quoted 18 lines
Quoted 18 lines
package/am335x-pru-package/am335x-pru-package.mk new file +11 -0
new file mode 100644
index 0000000..f70e679
@@ -0,0 +1,40 @@
+################################################################################
+#
+# am335x-pru-package
+#
+################################################################################
+
+AM335X_PRU_PACKAGE_VERSION = f46d8cb564f492740ccd33a03e8368ee4ecc83ae
+AM335X_PRU_PACKAGE_SITE = $(call github,beagleboard,am335x_pru_package,$(AM335X_PRU_PACKAGE_VERSION))
+AM335X_PRU_PACKAGE_LICENSE = BSD-3c
+AM335X_PRU_PACKAGE_LICENSE_FILES = pru_sw/utils/LICENCE.txt
+AM335X_PRU_PACKAGE_DEPENDENCIES = host-am335x-pru-package
Quoted 8 lines

package/am335x-pru-package/am335x-pru-package.mk line 16

Quoted 5 lines
package/am335x-pru-package/am335x-pru-package.mk new file +5 -0
+AM335X_PRU_PACKAGE_INSTALL_STAGING = YES
+
+define AM335X_PRU_PACKAGE_BUILD_CMDS
+     $(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" \
+             -C $(@D)/pru_sw/app_loader/interface all

Usually, 'all' is the default target for make, so it is not required to specify it. You only need to specify it if it is not the default.

I'll double check whether it's the default now. If it isn't, I'll submit a fix upstream since I agree that it should be.

Quoted 16 lines

package/am335x-pru-package/am335x-pru-package.mk line 26

Quoted 11 lines
package/am335x-pru-package/am335x-pru-package.mk new file +10 -0
+endef
+
+define AM335X_PRU_PACKAGE_INSTALL_STAGING_CMDS
+     $(MAKE1) PREFIX="$(STAGING_DIR)/usr" \
+             -C $(@D)/pru_sw/app_loader/interface install
+endef
+
+define AM335X_PRU_PACKAGE_INSTALL_TARGET_CMDS
+     $(INSTALL) -m 0755 -D $(@D)/pru_sw/app_loader/lib/libprussdrv.so \
+             $(TARGET_DIR)/usr/lib

You need to pass the full intall path, not only the directory name. If $(TARGET_DIR)/usr/lib does not exist, then install would simply copy libprussdrv.so to the file $(TARGET_DIR)/usr/lib.

Quoted 2 lines
    $(INSTALL) -m 0755 -D $(@D)/pru_sw/app_loader/lib/libprussdrv.so \
        $(TARGET_DIR)/usr/lib/libprussdrv.so

Thanks for catching that.

Quoted 9 lines

package/am335x-pru-package/am335x-pru-package.mk line 32

Quoted 7 lines
package/am335x-pru-package/am335x-pru-package.mk new file +6 -0
+endef
+
+define HOST_AM335X_PRU_PACKAGE_BUILD_CMDS
+     cd $(@D)/pru_sw/utils/pasm_source && \
+             $(HOSTCC) -Wall -D_UNIX_ pasm.c pasmpp.c pasmexp.c pasmop.c \
+                     pasmdot.c pasmstruct.c pasmmacro.c -o ../pasm

Any reason you output in the parent directory?

Only to have identical behavior to the non-so-useful build script included in the project. In hindsight, this doesn't seem that important anymore. Also, I think that someone is trying to get a proper Makefile submitted upstream for building pasm. If it gets accepted in the next couple weeks, I'll hopefully be able to use it.

Quoted 17 lines

Also, no indentation on the second line.

Why not:

    cd $(@D)/pru_sw/utils/pasm_source && \
    $(HOSTCC) -Wall -D_UNIX_ pasm.c pasmpp.c pasmexp.c pasmop.c \
        pasmdot.c pasmstruct.c pasmmacro.c -o pasm

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

Signature · 4 lines
Frank Hunleth
Troodon Software LLC
Embedded Software Development
http://troodon-software.com/
#3 lore raw

PATCH 1/1 am335x-pru-package: new package

In reply to Frank Hunleth

Frank, All,

On 2014-02-12 20:43 -0500, Frank Hunleth spake thusly:

Quoted 2 lines

am335x-pru-package provides an assembler and program loader for Texas Instrument's AM335x programmable real-time units.

I've just sent an updated version of that patch:

    http://patchwork.ozlabs.org/patch/398921/

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 am335x-pru-package: new package

Hi Yann,

Quoted 9 lines · Yann E. MORIN

Frank, All,

On 2014-02-12 20:43 -0500, Frank Hunleth spake thusly:

Quoted 2 lines

am335x-pru-package provides an assembler and program loader for Texas Instrument's AM335x programmable real-time units.

I've just sent an updated version of that patch:

    http://patchwork.ozlabs.org/patch/398921/

Thanks for updating the patch! It seems like it's been a while since I worked on the project that required it, but it should help anyone using the PRU get going in the future. I'm really thankful for all of the work that you and everyone else put into this project.

Frank