Commit d6f74dff authored by Adam Wujek's avatar Adam Wujek

[FEATURE: #241] userspace/tools: add detection of LJD to wrs_version

Signed-off-by: 's avatarAdam Wujek <dev_public@wujek.eu>
parent 9ec04830
Pipeline #4201 failed with stage
in 7 seconds
......@@ -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
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment