Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
85
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
White Rabbit Switch - Software
Commits
9dad48a8
Commit
9dad48a8
authored
2 years ago
by
Adam Wujek
Browse files
Options
Downloads
Patches
Plain Diff
[FEATURE:
#241
] userspace/tools: add detection of LJD to wrs_version
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
affdd881
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
userspace/include/fpga_io.h
+3
-0
3 additions, 0 deletions
userspace/include/fpga_io.h
userspace/tools/wrs_version.c
+11
-0
11 additions, 0 deletions
userspace/tools/wrs_version.c
with
14 additions
and
0 deletions
userspace/include/fpga_io.h
+
3
−
0
View file @
9dad48a8
...
...
@@ -5,6 +5,9 @@
/* Base addresses of all FPGA peripherals used in libwr */
/* FPGA GPIO */
#define FPGA_BASE_RT_GPIO 0x10300
/* PPS Generator */
#define FPGA_BASE_PPS_GEN 0x10500
...
...
This diff is collapsed.
Click to expand it.
userspace/tools/wrs_version.c
+
11
−
0
View file @
9dad48a8
...
...
@@ -27,6 +27,7 @@
#include
<libwr/hwiu.h>
#include
<libwr/switch_hw.h>
#include
<libwr/wrs-msg.h>
#include
<fpga_io.h>
#include
"libsdbfs.h"
#define SDBFS_NAME "/dev/mtd5ro"
...
...
@@ -39,6 +40,11 @@
#define __GIT_USR__ "?"
#endif
/* TODO: Should be taken from generated files, but there are not present in
* WRS repo */
#define GPIO_LJD_BOARD_DETECT 4
#define GPIO_REG_PSR 12
void
help
(
const
char
*
pgrname
)
{
...
...
@@ -177,6 +183,8 @@ static void print_gw_info(void)
/* Print everything in tagged format, for snmp parsing etc */
static
void
wrsw_tagged_versions
(
void
)
{
int
feature_ljd
;
printf
(
"software-version: %s
\n
"
,
__GIT_VER__
);
/* see Makefile */
printf
(
"bult-by: %s
\n
"
,
__GIT_USR__
);
/* see Makefile */
printf
(
"build-date: %s %s
\n
"
,
__DATE__
,
__TIME__
);
...
...
@@ -186,6 +194,9 @@ static void wrsw_tagged_versions(void)
printf
(
"serial-number: %s
\n
"
,
sdb_get
(
"hw_info"
,
"scb_serial"
));
printf
(
"scb-version: %s
\n
"
,
sdb_get
(
"scb_version"
,
NULL
));
print_gw_info
();
/* This is already tagged */
feature_ljd
=
_fpga_readl
(
FPGA_BASE_RT_GPIO
+
GPIO_REG_PSR
)
&
1
<<
GPIO_LJD_BOARD_DETECT
;
printf
(
"features: %s
\n
"
,
feature_ljd
?
"LJD"
:
""
);
}
/* remove dots from strings */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment