Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Simple PCIe FMC carrier SPEC - Software
Commits
aab33787
Commit
aab33787
authored
Nov 30, 2015
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: add printing version of the repo
with -V switch Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
bc0e12b9
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
123 additions
and
12 deletions
+123
-12
Makefile
tools/Makefile
+2
-0
spec-cl.c
tools/spec-cl.c
+13
-2
spec-fwloader.c
tools/spec-fwloader.c
+13
-2
spec-vuart.c
tools/spec-vuart.c
+13
-2
speclib.c
tools/speclib.c
+2
-0
speclib.h
tools/speclib.h
+2
-0
specmem.c
tools/specmem.c
+13
-2
stamp-frame.c
tools/stamp-frame.c
+13
-1
wr-dio-agent.c
tools/wr-dio-agent.c
+13
-1
wr-dio-cmd.c
tools/wr-dio-cmd.c
+14
-1
wr-dio-pps.c
tools/wr-dio-pps.c
+12
-0
wr-dio-ruler.c
tools/wr-dio-ruler.c
+13
-1
No files found.
tools/Makefile
View file @
aab33787
...
...
@@ -7,7 +7,9 @@
REPO_PARENT
=
../..
-include
$(REPO_PARENT)/parent_common.mk
GIT_VERSION
:=
$(
shell
git describe
--dirty
--long
--tags
)
CFLAGS
+=
-ggdb
-Wall
-fPIC
-I
../kernel
$(EXTRACFLAGS)
CFLAGS
+=
-DGIT_VERSION
=
\"
$(GIT_VERSION)
\"
LIB
=
libspec.a
LIBOBJ
=
speclib.o loader-ll.o
...
...
tools/spec-cl.c
View file @
aab33787
...
...
@@ -9,6 +9,14 @@
#include "speclib.h"
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
printf
(
"%s
\n
"
,
libspec_version_s
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
bus
=
-
1
,
dev_fn
=
-
1
,
c
;
...
...
@@ -16,7 +24,7 @@ int main(int argc, char **argv)
void
*
card
;
while
((
c
=
getopt
(
argc
,
argv
,
"b:d:c:"
))
!=
-
1
)
while
((
c
=
getopt
(
argc
,
argv
,
"b:d:c:
V
"
))
!=
-
1
)
{
switch
(
c
)
{
...
...
@@ -29,9 +37,12 @@ int main(int argc, char **argv)
case
'c'
:
sscanf
(
optarg
,
"%i"
,
&
lm32_base
);
break
;
case
'V'
:
print_version
(
argv
[
0
]);
exit
(
0
);
default:
fprintf
(
stderr
,
"Use:
\"
%s [-b bus] [-d devfn] "
"Use:
\"
%s [-
V] [-
b bus] [-d devfn] "
"[-c lm32 base address] <lm32_program.bin>
\"\n
"
,
argv
[
0
]);
fprintf
(
stderr
,
...
...
tools/spec-fwloader.c
View file @
aab33787
...
...
@@ -9,12 +9,20 @@
#include "speclib.h"
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
printf
(
"%s
\n
"
,
libspec_version_s
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
bus
=
-
1
,
dev_fn
=
-
1
,
c
;
void
*
card
;
while
((
c
=
getopt
(
argc
,
argv
,
"b:d:"
))
!=
-
1
)
while
((
c
=
getopt
(
argc
,
argv
,
"b:d:
V
"
))
!=
-
1
)
{
switch
(
c
)
{
...
...
@@ -24,9 +32,12 @@ int main(int argc, char **argv)
case
'd'
:
sscanf
(
optarg
,
"%i"
,
&
dev_fn
);
break
;
case
'V'
:
print_version
(
argv
[
0
]);
exit
(
0
);
default:
fprintf
(
stderr
,
"Use:
\"
%s [-b bus] [-d devfn] "
"Use:
\"
%s [-
V] [-
b bus] [-d devfn] "
"<fpga_bitstream.bin>
\"\n
"
,
argv
[
0
]);
fprintf
(
stderr
,
"By default, the first available SPEC "
"is used.
\n
"
);
...
...
tools/spec-vuart.c
View file @
aab33787
...
...
@@ -14,6 +14,14 @@
#include "speclib.h"
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
printf
(
"%s
\n
"
,
libspec_version_s
);
}
static
void
*
card
;
static
int
transfer_byte
(
int
from
,
int
is_control
)
{
...
...
@@ -89,7 +97,7 @@ int main(int argc, char **argv)
uint32_t
vuart_base
=
0x20500
;
int
keep_term
=
0
;
while
((
c
=
getopt
(
argc
,
argv
,
"b:d:u:k"
))
!=
-
1
)
while
((
c
=
getopt
(
argc
,
argv
,
"b:d:u:k
V
"
))
!=
-
1
)
{
switch
(
c
)
{
...
...
@@ -105,9 +113,12 @@ int main(int argc, char **argv)
case
'k'
:
keep_term
=
1
;
break
;
case
'V'
:
print_version
(
argv
[
0
]);
exit
(
0
);
default:
fprintf
(
stderr
,
"Use:
\"
%s [-b bus] [-d devfn] "
"Use:
\"
%s [-
V] [-
b bus] [-d devfn] "
"[-u VUART base] [-k]
\"\n
"
,
argv
[
0
]);
fprintf
(
stderr
,
"By default, the first available SPEC "
...
...
tools/speclib.c
View file @
aab33787
...
...
@@ -19,6 +19,8 @@
#include "loader-ll.h"
#include "wb_uart.h"
const
char
*
const
libspec_version_s
=
"libspec version: "
GIT_VERSION
;
struct
spec_private
{
/* BAR0 maps the local bus (i.e. we can access FGPA register) */
void
*
bar0
;
...
...
tools/speclib.h
View file @
aab33787
...
...
@@ -49,4 +49,6 @@ enum {
BASE_BAR4
=
4
/* for gennum-internal registers */
};
/* libspec version string */
extern
const
char
*
const
libspec_version_s
;
#endif
tools/specmem.c
View file @
aab33787
...
...
@@ -15,15 +15,23 @@
#include "speclib.h"
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
void
help
(
char
*
name
)
{
fprintf
(
stderr
,
"Use:
\"
%s [-b bus] [-d devfn] [-g] <offset> [<value>]
\"\n
"
,
"Use:
\"
%s [-
V] [-
b bus] [-d devfn] [-g] <offset> [<value>]
\"\n
"
,
name
);
fprintf
(
stderr
,
"By default, the first available SPEC is used.
\n
"
);
exit
(
1
);
}
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
printf
(
"%s
\n
"
,
libspec_version_s
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
i
,
bar
=
BASE_BAR0
;
...
...
@@ -35,7 +43,7 @@ int main(int argc, char **argv)
void
*
map_base
;
char
*
end
;
while
((
c
=
getopt
(
argc
,
argv
,
"b:d:g"
))
!=
-
1
)
while
((
c
=
getopt
(
argc
,
argv
,
"b:d:g
V
"
))
!=
-
1
)
{
switch
(
c
)
{
...
...
@@ -48,6 +56,9 @@ int main(int argc, char **argv)
case
'g'
:
bar
=
BASE_BAR4
;
break
;
case
'V'
:
print_version
(
argv
[
0
]);
exit
(
0
);
default:
help
(
argv
[
0
]);
}
...
...
tools/stamp-frame.c
View file @
aab33787
...
...
@@ -39,6 +39,8 @@
# define ETH_P_1588 0x88F7
#endif
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
/* This structure is used to collect stamping information */
struct
ts_data
{
struct
timespec
ns
;
...
...
@@ -400,6 +402,11 @@ void recv_one_with_followup(int sock, struct frame *f, unsigned char *mac,
}
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
}
int
main
(
int
argc
,
char
**
argv
)
{
static
struct
frame
f
;
...
...
@@ -408,6 +415,11 @@ int main(int argc, char **argv)
int
listenmode
=
0
;
int
howto
=
SOF_TIMESTAMPING_MASK
;
/* everything */
if
((
argc
==
2
)
&&
(
!
strcmp
(
argv
[
1
],
"-V"
)))
{
print_version
(
argv
[
0
]);
exit
(
0
);
}
/* From ./net_tstamp.h, these are the "howto" values
*
* SOF_TIMESTAMPING_TX_HARDWARE = 1,
...
...
@@ -424,7 +436,7 @@ int main(int argc, char **argv)
argc
--
;
}
if
(
argc
!=
2
)
{
fprintf
(
stderr
,
"%s: Use
\"
%s <ifname> [listen]
\n
"
,
argv
[
0
],
fprintf
(
stderr
,
"%s: Use
\"
%s
[-V]
<ifname> [listen]
\n
"
,
argv
[
0
],
argv
[
0
]);
exit
(
1
);
}
...
...
tools/wr-dio-agent.c
View file @
aab33787
...
...
@@ -26,6 +26,8 @@
#include "wr_nic/wr-nic.h"
#include "wr-dio.h"
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
#define RULER_PROTO 0x5752
/* WR */
/*
...
...
@@ -90,6 +92,11 @@ static int agent_open_wr_sock(char *name)
return
0
;
}
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
}
/* And a simple main with the loop inside */
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -101,8 +108,13 @@ int main(int argc, char **argv)
struct
wr_dio_cmd
cmd
;
}
f
;
if
((
argc
==
2
)
&&
(
!
strcmp
(
argv
[
1
],
"-V"
)))
{
print_version
(
argv
[
0
]);
exit
(
0
);
}
if
(
argc
!=
2
)
{
fprintf
(
stderr
,
"%s: Use
\"
%s <wr-if>
\"\n
"
,
fprintf
(
stderr
,
"%s: Use
\"
%s
[-V]
<wr-if>
\"\n
"
,
argv
[
0
],
argv
[
0
]);
exit
(
1
);
}
...
...
tools/wr-dio-cmd.c
View file @
aab33787
...
...
@@ -23,6 +23,8 @@
#include "wr_nic/wr-nic.h"
#include "wr-dio.h"
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
char
*
prgname
;
char
c
;
int
sock
;
...
...
@@ -306,17 +308,28 @@ static int scan_inout(int argc, char **argv)
return
0
;
}
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
}
int
main
(
int
argc
,
char
**
argv
)
{
prgname
=
argv
[
0
];
argv
++
,
argc
--
;
if
((
argc
==
2
)
&&
(
!
strcmp
(
argv
[
1
],
"-V"
)))
{
print_version
(
argv
[
0
]);
exit
(
0
);
}
if
(
argc
<
2
)
{
fprintf
(
stderr
,
"%s: use
\"
%s <netdev> <cmd> [...]
\"\n
"
,
fprintf
(
stderr
,
"%s: use
\"
%s
[-V]
<netdev> <cmd> [...]
\"\n
"
,
prgname
,
prgname
);
exit
(
1
);
}
ifname
=
argv
[
0
];
argv
++
,
argc
--
;
...
...
tools/wr-dio-pps.c
View file @
aab33787
...
...
@@ -31,6 +31,13 @@
* that gives a more accurate precision.
**/
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
}
int
main
(
int
argc
,
char
**
argv
)
{
struct
wr_dio_cmd
_cmd
;
...
...
@@ -41,6 +48,11 @@ int main(int argc, char **argv)
int
sock
,
ch
,
charg
=
1
;
char
c
;
if
((
argc
==
2
)
&&
(
!
strcmp
(
argv
[
1
],
"-V"
)))
{
print_version
(
argv
[
0
]);
exit
(
0
);
}
if
(
argc
<
2
||
argc
>
3
)
{
fprintf
(
stderr
,
"%s: Use
\"
%s [<ifname>] <channel>
\"\n
"
,
prgname
,
prgname
);
...
...
tools/wr-dio-ruler.c
View file @
aab33787
...
...
@@ -26,6 +26,8 @@
#include "wr_nic/wr-nic.h"
#include "wr-dio.h"
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
#define RULER_PROTO 0x5752
/* WR */
/*
* Lazily, use global variables, so the code has less parameter passing.
...
...
@@ -291,6 +293,11 @@ static int ruler_run_actions(int nact, struct timespec *ts,
return
0
;
}
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
}
/* Finally, a main function to wrap it all */
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -298,8 +305,13 @@ int main(int argc, char **argv)
struct
timespec
ts
;
int
inch
;
if
((
argc
==
2
)
&&
(
!
strcmp
(
argv
[
1
],
"-V"
)))
{
print_version
(
argv
[
0
]);
exit
(
0
);
}
if
(
argc
<
4
)
{
fprintf
(
stderr
,
"%s: Use
\"
%s <wr-if> IN<ch> "
fprintf
(
stderr
,
"%s: Use
\"
%s
[-V]
<wr-if> IN<ch> "
"{L,R}<ch>+<delay-as-decimal> [...]
\n
"
,
argv
[
0
],
argv
[
0
]);
exit
(
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment