Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT Zynq Ultrascale-based System Board
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
41
Issues
41
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
DIOT Zynq Ultrascale-based System Board
Commits
a6d07c15
Commit
a6d07c15
authored
Dec 02, 2021
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
diot_util: add _pts_ command
parent
a84ff4e1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
0 deletions
+133
-0
diot-util.bb
...roject-spec/meta-user/recipes-apps/diot-util/diot-util.bb
+2
-0
Makefile
...ject-spec/meta-user/recipes-apps/diot-util/files/Makefile
+1
-0
diot_util.c
...t-spec/meta-user/recipes-apps/diot-util/files/diot_util.c
+2
-0
diot_util_pts.c
...ec/meta-user/recipes-apps/diot-util/files/diot_util_pts.c
+104
-0
diot_util_pts.h
...ec/meta-user/recipes-apps/diot-util/files/diot_util_pts.h
+24
-0
No files found.
sw/petalinux/project-spec/meta-user/recipes-apps/diot-util/diot-util.bb
View file @
a6d07c15
...
...
@@ -19,6 +19,8 @@ SRC_URI = " \
file://diot_util_gpio.h \
file://diot_util_sensors.c \
file://diot_util_sensors.h \
file://diot_util_pts.c \
file://diot_util_pts.h \
file://fru.c \
file://fru.h \
file://fru_utils.c \
...
...
sw/petalinux/project-spec/meta-user/recipes-apps/diot-util/files/Makefile
View file @
a6d07c15
...
...
@@ -7,6 +7,7 @@ APP_OBJS = \
diot_util_error.o
\
diot_util_gpio.o
\
diot_util_sensors.o
\
diot_util_pts.o
\
fru.o
\
fru_utils.o
\
term.o
\
...
...
sw/petalinux/project-spec/meta-user/recipes-apps/diot-util/files/diot_util.c
View file @
a6d07c15
...
...
@@ -21,6 +21,7 @@
#include "diot_util_gpio.h"
#include "diot_util_sensors.h"
#include "diot_util_error.h"
#include "diot_util_pts.h"
#include "fru.h"
#include "fru_utils.h"
...
...
@@ -54,6 +55,7 @@ struct command_entry commands_list[] = {
{
.
cmd_name
=
"sensors"
,
.
cmd_func
=
cmd_sensors
,
.
cmd_help_string
=
"Display sensors short version
\n
"
,
.
cmd_params
=
NULL
},
{
.
cmd_name
=
"sensors_refresh"
,
.
cmd_func
=
cmd_sensors_refresh
,
.
cmd_help_string
=
"Display sensors short version with refresh
\n
"
,
.
cmd_params
=
NULL
},
{
.
cmd_name
=
"clocks"
,
.
cmd_func
=
cmd_clocks
,
.
cmd_help_string
=
"Display info about clocks
\n
"
,
.
cmd_params
=
NULL
},
{
.
cmd_name
=
"pts"
,
.
cmd_func
=
cmd_pts
,
.
cmd_help_string
=
"Run PTS basic checks
\n
"
,
.
cmd_params
=
NULL
},
{
.
cmd_name
=
NULL
}
};
...
...
sw/petalinux/project-spec/meta-user/recipes-apps/diot-util/files/diot_util_pts.c
0 → 100644
View file @
a6d07c15
/*
* diot_util - diagnostic tool for DIOT system board
*
* Author: Greg Daniluk
* Copyright CERN 2021
*
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <stdint.h>
#include "diot_util_pts.h"
#include "diot_util_sensors.h"
#include "diot_util_clk.h"
#include "diot_util_gpio.h"
#define DECLARE_PTS_SENSOR(_short_name, _allowed_min, _allowed_max) \
{ .short_name = _short_name, \
.allowed_min = _allowed_min, \
.allowed_max = _allowed_max }
struct
pts_sensor
pts_sensors_list
[]
=
{
DECLARE_PTS_SENSOR
(
"FPGA"
,
21
,
61
),
DECLARE_PTS_SENSOR
(
"FMC"
,
22
,
62
),
DECLARE_PTS_SENSOR
(
"DDR"
,
23
,
63
),
DECLARE_PTS_SENSOR
(
"Pow M"
,
24
,
64
),
DECLARE_PTS_SENSOR
(
"IRPS1"
,
25
,
65
),
DECLARE_PTS_SENSOR
(
"IRPS2"
,
26
,
66
),
DECLARE_PTS_SENSOR
(
"IRPS1 Input Voltage"
,
11
.
0
,
12
.
5
),
DECLARE_PTS_SENSOR
(
"IRPS1 Input Current"
,
0
.
01
,
0
.
25
),
DECLARE_PTS_SENSOR
(
"IRPS1 P0V85 Voltage"
,
0
.
84
,
0
.
86
),
DECLARE_PTS_SENSOR
(
"IRPS1 P1V8_AUX Voltage"
,
1
.
79
,
1
.
81
),
DECLARE_PTS_SENSOR
(
"IRPS1 P1V2 Voltage"
,
1
.
19
,
1
.
21
),
DECLARE_PTS_SENSOR
(
"IRPS1 P1V8 Voltage"
,
1
.
79
,
1
.
81
),
DECLARE_PTS_SENSOR
(
"IRPS1 P1V2_PSPLL LDO Voltage"
,
1
.
18
,
1
.
21
),
DECLARE_PTS_SENSOR
(
"IRPS2 Input Voltage"
,
11
.
0
,
12
.
5
),
DECLARE_PTS_SENSOR
(
"IRPS2 Input Current"
,
0
.
01
,
0
.
2
),
DECLARE_PTS_SENSOR
(
"IRPS2 P3V3 Voltage"
,
3
.
2
,
3
.
4
),
DECLARE_PTS_SENSOR
(
"IRPS2 MGT_1V8 Voltage"
,
1
.
79
,
1
.
81
),
DECLARE_PTS_SENSOR
(
"IRPS2 MGT_0V9 Voltage"
,
0
.
89
,
0
.
91
),
DECLARE_PTS_SENSOR
(
"IRPS2 MGT_1V2 Voltage"
,
1
.
19
,
1
.
21
),
DECLARE_PTS_SENSOR
(
"PLL Input Present"
,
1
,
1
),
DECLARE_PTS_SENSOR
(
"PLL Locked"
,
1
,
1
),
DECLARE_PTS_SENSOR
(
"PLL Input"
,
0
,
0
),
DECLARE_PTS_SENSOR
(
"PLL Out0"
,
124
.
9
,
125
.
1
),
DECLARE_PTS_SENSOR
(
"PLL Out1"
,
156
.
24
,
156
.
26
),
DECLARE_PTS_SENSOR
(
"PLL Out2"
,
124
.
9
,
125
.
1
),
DECLARE_PTS_SENSOR
(
"PLL Out3"
,
124
.
9
,
125
.
1
),
DECLARE_PTS_SENSOR
(
"PLL Out4"
,
124
.
9
,
125
.
1
),
DECLARE_PTS_SENSOR
(
"PLL Out5"
,
124
.
9
,
125
.
1
),
DECLARE_PTS_SENSOR
(
"PLL Out6"
,
62
.
4
,
62
.
6
),
DECLARE_PTS_SENSOR
(
"PLL Out7"
,
124
.
9
,
125
.
1
),
DECLARE_PTS_SENSOR
(
"PLL Out8"
,
124
.
9
,
125
.
1
),
DECLARE_PTS_SENSOR
(
"PLL Out9"
,
24
.
9
,
25
.
1
),
DECLARE_PTS_SENSOR
(
NULL
,
0
,
0
)
};
struct
pts_sensor
*
find_pts_sensor
(
char
*
sensor_name
)
{
struct
pts_sensor
*
sensor_p
=
pts_sensors_list
;
for
(;
sensor_p
->
short_name
;
sensor_p
++
)
{
if
(
!
strcmp
(
sensor_name
,
sensor_p
->
short_name
))
{
return
sensor_p
;
}
}
}
int
pts_sensor_inrange
(
double
val
,
struct
pts_sensor
*
sens
)
{
if
(
val
>=
sens
->
allowed_min
&&
val
<=
sens
->
allowed_max
)
{
return
1
;
}
else
{
return
0
;
}
}
int
cmd_pts
(
char
*
params
)
{
int
errors
=
0
;
int
val
;
printf
(
"Testing HW rev...."
);
val
=
read_pcb_ver
();
if
(
val
==
PTS_HWVER
)
{
printf
(
"
\r
OK HW rev
\n
"
);
}
else
{
printf
(
"
\r
FAIL HW rev(%d vs %d)
\n
"
,
val
,
PTS_HWVER
);
errors
++
;
}
errors
+=
pts_sensors
();
errors
+=
pts_clocks
();
if
(
errors
==
0
)
{
printf
(
"All seems fine
\n
"
);
}
else
{
printf
(
"Board has %d errors.
\n
"
,
errors
);
}
return
0
;
}
sw/petalinux/project-spec/meta-user/recipes-apps/diot-util/files/diot_util_pts.h
0 → 100644
View file @
a6d07c15
/*
* diot_util - diagnostic tool for DIOT system board
*
* Author: Greg Daniluk
* Copyright CERN 2021
*
*/
#ifndef __DIOT_UTIL_PTS_H__
#define __DIOT_UTIL_PTS_H__
#define PTS_HWVER 2
struct
pts_sensor
{
char
*
short_name
;
double
allowed_min
;
double
allowed_max
;
};
struct
pts_sensor
*
find_pts_sensor
(
char
*
sensor_name
);
int
cmd_pts
(
char
*
params
);
int
pts_sensor_inrange
(
double
val
,
struct
pts_sensor
*
sens
);
#endif
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