Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
White Rabbit Switch - Software
Commits
ea6209d9
Commit
ea6209d9
authored
Jun 06, 2013
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shw_ver can now report also info about GW version
parent
0facccb6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
shw_ver.c
userspace/tools/shw_ver.c
+26
-0
No files found.
userspace/tools/shw_ver.c
View file @
ea6209d9
...
...
@@ -24,6 +24,7 @@
#include <string.h>
#include <shw_io.h>
#include <hwiu.h>
#include "pio.h"
...
...
@@ -43,6 +44,7 @@ void help(const char* pgrname)
" -p PCB version
\n
"
" -f FPGA type
\n
"
" -F FPGA type and init status LED
\n
"
" -g Gateware version
\n
"
" -c Compiling time
\n
"
" -v version (git)
\n
"
" -a All (default)
\n
"
...
...
@@ -50,6 +52,27 @@ void help(const char* pgrname)
exit
(
1
);
}
void
print_gw_info
()
{
struct
gw_info
info
;
shw_fpga_mmap_init
();
printf
(
"Reading GW info
\n
"
);
if
(
shw_hwiu_gwver
(
&
info
)
<
0
)
{
printf
(
"Could not get GW version info
\n
"
);
return
;
}
if
(
info
.
struct_ver
!=
HWIU_STRUCT_VERSION
)
printf
(
"WARNING: dealing with unsupported info struct, sw:%u, gw:%u
\n
"
,
HWIU_STRUCT_VERSION
,
info
.
struct_ver
);
printf
(
"WRSW Gateware: version %u.%u
\n
"
,
info
.
ver_major
,
info
.
ver_minor
);
printf
(
"WRSW Gateware: build %02u/%02u/%02u.%02u
\n
"
,
info
.
build_day
,
info
.
build_month
,
info
.
build_year
,
info
.
build_no
);
printf
(
"WRSW Gateware: wr_switch_hdl commit: %x
\n
"
,
info
.
switch_hdl_hash
);
printf
(
"WRSW Gateware: general-cores commit: %x
\n
"
,
info
.
general_cores_hash
);
printf
(
"WRSW Gateware: wr-cores commit: %x
\n
"
,
info
.
wr_cores_hash
);
}
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -85,6 +108,9 @@ int main(int argc, char **argv)
case
'f'
:
printf
(
"%s
\n
"
,
get_shw_info
(
func
));
break
;
case
'g'
:
print_gw_info
();
break
;
case
'c'
:
printf
(
"%s %s
\n
"
,
__DATE__
,
__TIME__
);
break
;
...
...
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