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
84
Issues
84
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
d6f74dff
Commit
d6f74dff
authored
Nov 17, 2022
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEATURE:
#241
] userspace/tools: add detection of LJD to wrs_version
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
9ec04830
Pipeline
#4201
failed with stage
in 7 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
fpga_io.h
userspace/include/fpga_io.h
+3
-0
wrs_version.c
userspace/tools/wrs_version.c
+11
-0
No files found.
userspace/include/fpga_io.h
View file @
d6f74dff
...
...
@@ -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
...
...
userspace/tools/wrs_version.c
View file @
d6f74dff
...
...
@@ -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 */
...
...
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