diff --git a/userspace/include/fpga_io.h b/userspace/include/fpga_io.h index f5f55615c6b4e1ffa53323e555712697683352ce..b9a4c7dba1da7d6d0daa27348654e25d74bdc113 100644 --- a/userspace/include/fpga_io.h +++ b/userspace/include/fpga_io.h @@ -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 diff --git a/userspace/tools/wrs_version.c b/userspace/tools/wrs_version.c index a592f8e9486278511b1f65c3b5f6a3a42a90b900..23f2c61528778bc0d5dd7535d5c84f77ca7cffc2 100644 --- a/userspace/tools/wrs_version.c +++ b/userspace/tools/wrs_version.c @@ -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 */