[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.3-279-gfddab1c
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2014-06-13 16:22:51
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via fddab1c0e77239099c8f24c939a3877e4ec34a2f (commit)
via 092679aba3e4372a35f161265ba896767a4b8132 (commit)
from 05a35cba698c2c7a7d04ceb01217465b10eaf480 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fddab1c0e77239099c8f24c939a3877e4ec34a2f
Author: Julien Boibessot <jul...@ar...>
Date: Fri Jun 13 18:22:28 2014 +0200
[DEBUG] fpgaregs: cleanup (code & BR package)
commit 092679aba3e4372a35f161265ba896767a4b8132
Author: Julien Boibessot <jul...@ar...>
Date: Fri Jun 13 18:18:05 2014 +0200
[DEBUG] fpgaregs: cleanup
-----------------------------------------------------------------------
Summary of changes:
buildroot/package/armadeus/fpgaregs/fpgaregs.mk | 48 ++++--------
target/linux/debug/fpgaregs/fpgaregs.c | 92 +++++++++++------------
2 files changed, 58 insertions(+), 82 deletions(-)
diff --git a/buildroot/package/armadeus/fpgaregs/fpgaregs.mk b/buildroot/package/armadeus/fpgaregs/fpgaregs.mk
index 80696d5..faeb44b 100644
--- a/buildroot/package/armadeus/fpgaregs/fpgaregs.mk
+++ b/buildroot/package/armadeus/fpgaregs/fpgaregs.mk
@@ -4,46 +4,28 @@
#
#############################################################
-FPGAREGS_VER:=1.1
-FPGAREGS_SOURCE:=$(TOPDIR)/../target/linux/debug/fpgaregs/
-FPGAREGS_DIR:=$(BUILD_DIR)/fpgaregs-$(FPGAREGS_VER)
-FPGAREGS_CAT:=zcat
+FPGAREGS_VERSION = 2014.06
+FPGAREGS_SITE = $(TOPDIR)/../target/linux/debug/fpgaregs/
+FPGAREGS_SITE_METHOD = local
+FPGAREGS_LICENSE = GPLv2+
+
ifeq ($(BR2_CPU_NAME),"imx27")
-FPGAREGS_BINARY:=fpga27regs
+FPGAREGS_BINARY = fpga27regs
else
ifeq ($(BR2_CPU_NAME),"imx51")
- FPGAREGS_BINARY:=fpga51regs
+ FPGAREGS_BINARY = fpga51regs
else
- FPGAREGS_BINARY:=fpgaregs
+ FPGAREGS_BINARY = fpgaregs
endif
endif
FPGAREGS_TARGET_BINARY:=usr/bin/fpgaregs
-$(FPGAREGS_DIR)/fpgaregs.c:
- mkdir -p $(FPGAREGS_DIR)/
- cp $(FPGAREGS_SOURCE)/* $(FPGAREGS_DIR)/
-
-$(FPGAREGS_DIR)/$(FPGAREGS_BINARY): $(FPGAREGS_DIR)/fpgaregs.c
- $(TARGET_CONFIGURE_OPTS) $(MAKE) CC="$(TARGET_CC)" -C $(FPGAREGS_DIR)
-
-$(TARGET_DIR)/$(FPGAREGS_TARGET_BINARY): $(FPGAREGS_DIR)/$(FPGAREGS_BINARY)
- install -D $< $@
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/$(FPGAREGS_TARGET_BINARY)
-
-fpgaregs: $(TARGET_DIR)/$(FPGAREGS_TARGET_BINARY)
-
-fpgaregs-clean:
- rm -f $(TARGET_DIR)/$(FPGAREGS_TARGET_BINARY)
- -$(MAKE) -C $(FPGAREGS_DIR) clean
+define FPGAREGS_BUILD_CMDS
+ $(TARGET_CONFIGURE_OPTS) $(MAKE) CC="$(TARGET_CC)" -C $(@D)
+endef
-fpgaregs-dirclean:
- rm -rf $(FPGAREGS_DIR)
+define FPGAREGS_INSTALL_TARGET_CMDS
+ $(INSTALL) -m 644 $(@D)/$(FPGAREGS_BINARY) $(TARGET_DIR)/usr/bin/fpgaregs
+endef
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(strip $(BR2_PACKAGE_FPGAREGS)),y)
-TARGETS+=fpgaregs
-endif
+$(eval $(generic-package))
diff --git a/target/linux/debug/fpgaregs/fpgaregs.c b/target/linux/debug/fpgaregs/fpgaregs.c
index d8ac89c..b0abb4d 100644
--- a/target/linux/debug/fpgaregs/fpgaregs.c
+++ b/target/linux/debug/fpgaregs/fpgaregs.c
@@ -1,9 +1,10 @@
/************************************************************************
*
* fpgaregs.c
- * a program to write/read 16/32 bits values on FPGA address map using mmap()
+ * A program to write/read 16/32 bits values to/from APF's FPGA address map
+ * using mmap().
*
- * (c) Copyright 2008-2011 The Armadeus Project - ARMadeus Systems
+ * (c) Copyright 2008-2014 The Armadeus Project - ARMadeus Systems
* Fabien Marteau <fab...@ar...>
* Modified by Sebastien Van Cauwenberghe <sv...@gm...>
*
@@ -24,20 +25,17 @@
#include <stdio.h>
#include <stdlib.h>
-#include <sys/stat.h> /* file management */
-#include <fcntl.h>
-#include <signal.h>
-#include <unistd.h> /* sleep, write(), read() */
-#include <string.h> /* converting string */
-#include <sys/mman.h> /* memory management */
+#include <fcntl.h> /* open() */
+#include <unistd.h> /* close() */
+#include <sys/mman.h> /* mmap() */
#ifdef IMX27
# define PLATFORM "APF27"
-# define FPGA_ADDRESS 0xD6000000
+# define FPGA_ADDRESS 0xd6000000
# define FPGA_MAP_SIZE 0x2000
#elif IMX51
# define PLATFORM "APF51"
-# define FPGA_ADDRESS 0xB8000000
+# define FPGA_ADDRESS 0xb8000000
# define FPGA_MAP_SIZE 0x10000
#else
# define PLATFORM "APF9328"
@@ -48,8 +46,7 @@
#define WORD_ACCESS (2)
#define LONG_ACCESS (4)
-
-void displayResult(const char* text, unsigned int accesstype, unsigned int value, unsigned int address)
+void display_result(const char* text, unsigned int accesstype, unsigned int value, unsigned int address)
{
if (accesstype == WORD_ACCESS)
printf("%s 0x%04x at 0x%08x\n", text, (unsigned short)value, address);
@@ -57,7 +54,6 @@ void displayResult(const char* text, unsigned int accesstype, unsigned int value
printf("%s 0x%08x at 0x%08x\n", text, value, address);
}
-
int main(int argc, char *argv[])
{
unsigned short address;
@@ -67,12 +63,14 @@ int main(int argc, char *argv[])
if ((argc < 3) || (argc > 4)) {
printf("invalid arguments number\n");
- printf("fpgaregs for %s platform\n\n", PLATFORM);
- printf("Usage: fpgaregs [w,l] address [value]\n\n");
- printf("Reads or writes a value at given FPGA's relative address.\n\n");
- printf("Options:\n");
+ printf("fpgaregs v2014.06 for %s platform\n\n", PLATFORM);
+ printf("Usage: fpgaregs w/l address [value]\n\n");
+ printf("Reads/writes a value from/to a given FPGA's relative address.\n\n");
+ printf("Arguments:\n");
printf(" w word (16 bits) access\n");
printf(" l long (32 bits) access\n");
+ printf(" address FPGA relative address to read from/write to\n");
+ printf("Options:\n");
printf(" value value to write\n\n");
printf("Examples:\n");
printf(" fpgaregs w 0x10 --> read @ 0x10\n");
@@ -95,42 +93,38 @@ int main(int argc, char *argv[])
address = (unsigned int)strtol(argv[2], (char **)NULL, 16);
- if (argc < 3) {
- printf("invalid command line");
+ if (*(argv[1]) == 'w')
+ accesstype = WORD_ACCESS;
+ if (accesstype == WORD_ACCESS) {
+ if (address%2 != 0) {
+ printf("Can't do word access at odd address (%d). Please use a 16bits aligned one.\n", address);
+ return -1;
+ }
} else {
- if (*(argv[1]) == 'w')
- accesstype = WORD_ACCESS;
- if (accesstype == WORD_ACCESS) {
- if (address%2 != 0) {
- printf("Can't do word access at odd address (%d). Use a 16bits aligned one.\n", address);
- return -1;
- }
- } else { /* LONG_ACCESS */
- if (address%4 != 0) {
- printf("Can't do long access at non-32bits-aligned address (%d)\n", address);
- return -1;
- }
+ /* LONG_ACCESS */
+ if (address%4 != 0) {
+ printf("Can't do long access at non-32bits-aligned address (%d)\n", address);
+ return -1;
}
+ }
- /* write value at given address */
- if (argc == 4) {
- value = strtoul(argv[3], (char **)NULL, 16);
- if (accesstype == WORD_ACCESS)
- *((unsigned short*)(ptr_fpga + address)) = (unsigned short)value;
- else
- *((unsigned int*)(ptr_fpga + address)) = (unsigned int)value;
-
- displayResult("Write", accesstype, value, address);
- /* read at given address */
- } else if (argc == 3) {
- if (accesstype == WORD_ACCESS)
- value = *((unsigned short*)(ptr_fpga + address));
- else
- value = *((unsigned int*)(ptr_fpga + address));
-
- displayResult("Read", accesstype, value, address);
- }
+ if (argc == 4) { /* write value to given address */
+ value = strtoul(argv[3], (char **)NULL, 16);
+ if (accesstype == WORD_ACCESS)
+ *((unsigned short*)(ptr_fpga + address)) = (unsigned short)value;
+ else
+ *((unsigned int*)(ptr_fpga + address)) = (unsigned int)value;
+
+ display_result("Write", accesstype, value, address);
+ } else if (argc == 3) { /* read at given address */
+ if (accesstype == WORD_ACCESS)
+ value = *((unsigned short*)(ptr_fpga + address));
+ else
+ value = *((unsigned int*)(ptr_fpga + address));
+
+ display_result("Read", accesstype, value, address);
}
+
munmap(ptr_fpga, FPGA_MAP_SIZE);
close(ffpga);
return 0;
hooks/post-receive
--
armadeus
|