Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
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
Software for White Rabbit PTP Core
Commits
8304358d
Commit
8304358d
authored
Feb 16, 2024
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 'ep' command (for debugging)
parent
4545a83c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
1 deletion
+81
-1
Kconfig
Kconfig
+7
-0
cmd_ep.c
shell/cmd_ep.c
+70
-0
shell.c
shell/shell.c
+3
-0
shell.mk
shell/shell.mk
+1
-1
No files found.
Kconfig
View file @
8304358d
...
...
@@ -514,6 +514,13 @@ config FREQUENCY_MONITOR
Requires g_with_clock_freq_monitor to be enabled in the HDL
IP instantiation.
config CMD_EP
depends on WR_NODE
boolean "Add 'ep' command to diagnose endpoints"
default n
help
This enables ep command, which can be used to diagnose endpoint.
comment "wrpc-sw is tainted if you change the following options"
config DEVELOPER
depends on WR_NODE
...
...
shell/cmd_ep.c
0 → 100644
View file @
8304358d
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2024 CERN (www.cern.ch)
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <wrc.h>
#include "shell.h"
#include "dev/syscon.h"
#include "dev/endpoint.h"
#include "hw/ep_mdio_regs.h"
#include "hw/lpdc_mdio_regs.h"
struct
reg_desc
{
const
char
*
name
;
unsigned
addr
;
};
static
const
struct
reg_desc
regs
[]
=
{
{
"msr"
,
EP_MDIO_MSR
},
{
"mcr"
,
EP_MDIO_MCR
},
{
"lpdc-ctrl"
,
EP_MDIO_PHY_SPECIFIC_REGS
+
LPDC_MDIO_CTRL
},
{
"lpdc-stat"
,
EP_MDIO_PHY_SPECIFIC_REGS
+
LPDC_MDIO_STAT
},
{
NULL
,
0
}
};
static
const
char
*
const
ep_cmds
[]
=
{
[
0
]
=
"link"
,
[
1
]
=
"rd"
,
};
static
int
cmd_ep
(
const
char
*
args
[])
{
struct
wr_endpoint_device
*
dev
=
&
wrc_endpoint_dev
;
int
icmd
;
icmd
=
sub_cmd
(
ep_cmds
,
ARRAY_SIZE
(
ep_cmds
),
args
);
switch
(
icmd
)
{
case
0
:
pp_printf
(
"%d
\n
"
,
ep_link_up
(
dev
,
NULL
));
return
0
;
case
1
:
{
const
struct
reg_desc
*
r
;
for
(
r
=
regs
;
r
->
name
;
r
++
)
if
(
!
strcmp
(
r
->
name
,
args
[
1
]))
break
;
if
(
r
->
name
==
NULL
)
return
-
1
;
pp_printf
(
"%s (@%x): %04x
\n
"
,
r
->
name
,
r
->
addr
,
ep_pcs_read
(
dev
,
r
->
addr
));
return
0
;
}
default:
return
-
1
;
}
}
DEFINE_WRC_COMMAND
(
ep
)
=
{
.
name
=
"ep"
,
.
exec
=
cmd_ep
,
};
shell/shell.c
View file @
8304358d
...
...
@@ -485,6 +485,9 @@ void shell_register_commands(void)
REGISTER_WRC_COMMAND
(
pll
);
if
(
HAS_CMD_PPS
)
REGISTER_WRC_COMMAND
(
pps
);
#ifdef CONFIG_CMD_EP
REGISTER_WRC_COMMAND
(
ep
);
#endif
REGISTER_WRC_COMMAND
(
ps
);
REGISTER_WRC_COMMAND
(
ptp
);
REGISTER_WRC_COMMAND
(
ptrack
);
...
...
shell/shell.mk
View file @
8304358d
...
...
@@ -27,7 +27,7 @@ obj-$(CONFIG_CMD_LL) += shell/cmd_ll.o
obj-$(CONFIG_CMD_PPS) += shell/cmd_pps.o
obj-$(CONFIG_CMD_LEAPSEC) += shell/cmd_leapsec.o
obj-$(CONFIG_CMD_REFRESH) += shell/cmd_refresh.o
obj-$(CONFIG_CMD_EP) += shell/cmd_ep.o
obj-$(CONFIG_FLASH_INIT) += shell/cmd_init.o
obj-$(CONFIG_VLAN) += shell/cmd_vlan.o
obj-$(CONFIG_FREQUENCY_MONITOR) += shell/cmd_freqmon.o
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