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
6
Merge Requests
6
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
cd48cfb8
Commit
cd48cfb8
authored
May 03, 2023
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ertm14: working SPLL debugger API available over UART
parent
ac22b12b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
board-state.h
boards/ertm14/board-state.h
+2
-0
board.c
boards/ertm14/board.c
+11
-11
psnmp-proto.h
boards/ertm14/psnmp-proto.h
+1
-1
No files found.
boards/ertm14/board-state.h
View file @
cd48cfb8
...
...
@@ -64,6 +64,8 @@
#define ERTM14_UART_PTYPE_PING 101
#define ERTM14_UART_PTYPE_SNMP_REQ 102
#define ERTM14_UART_PTYPE_SNMP_RESP 103
#define ERTM14_UART_PTYPE_SOFTPLL_LOG 104
#define ERTM14_UART_PTYPE_MMC_STATUS_REQ 4
#define ERTM14_UART_PTYPE_MMC_STATUS_RESP 5
...
...
boards/ertm14/board.c
View file @
cd48cfb8
...
...
@@ -1181,40 +1181,38 @@ static void get_wrc_diags(struct wrc_diags *diags)
}
static
int
spll_dbg_enabled
=
0
;
static
int
spll_dbg_oversample
=
0
;
static
void
configure_spll_debug_dump
(
int
enabled
,
int
ov
ersample
)
static
void
configure_spll_debug_dump
(
int
enabled
,
int
und
ersample
)
{
spll_dbg_enabled
=
enabled
;
spll_dbg_oversample
=
oversample
;
if
(
enabled
)
spll_debug_queue_purge
();
{
spll_debug_queue_configure
(
undersample
,
32
);
// fixme: make coalescence threshold configurable? is it worth it?
}
}
static
void
ertm14_spll_debug_dump_task_init
(
void
)
{
spll_dbg_enabled
=
0
;
spll_dbg_oversample
=
8
;
}
static
int
ertm14_spll_debug_dump_task_poll
(
void
)
{
struct
uart_packet
tx_pkt
;
struct
ertm14_spll_debug_dump_data
*
tx_payload
;
int
count
=
sizeof
(
*
tx_payload
)
/
sizeof
(
uint32_t
)
-
2
;
struct
ertm14_spll_debug_dump_data
*
tx_payload
=
(
struct
ertm14_spll_debug_dump_data
*
)
&
tx_pkt
.
payload
;
int
count
=
64
;
//
sizeof( *tx_payload ) / sizeof( uint32_t ) - 2;
if
(
!
spll_dbg_enabled
)
return
0
;
int
r
=
spll_get_debug_queue_samples
(
tx_payload
->
payload
,
&
count
,
spll_dbg_oversample
);
int
r
=
spll_get_debug_queue_samples
(
tx_payload
->
payload
,
&
count
);
if
(
count
<=
0
)
return
0
;
tx_payload
->
flags
=
ERTM14_SPLL_DEBUG_DUMP_HEADER
;
tx_pkt
.
ptype
=
ERTM14_UART_PTYPE_S
NMP_RESP
;
tx_pkt
.
ptype
=
ERTM14_UART_PTYPE_S
OFTPLL_LOG
;
tx_pkt
.
length
=
sizeof
(
uint32_t
)
*
count
+
4
;
if
(
r
==
-
ENOSPC
)
...
...
@@ -1413,7 +1411,9 @@ static int ertm_process_psnmp(struct uart_packet *rx_pkt, struct uart_packet *tx
break
;
case
ertm14_configure_spll_debug_dump
:
{
struct
ertm14_spll_debug_dump_request
*
dbgs
=
(
struct
ertm14_spll_debug_dump_request
*
)
&
tx_pkt
->
payload
[
0
];
struct
ertm14_spll_debug_dump_request
*
dbgs
=
(
struct
ertm14_spll_debug_dump_request
*
)
&
rx_pkt
->
payload
[
op
->
offset1
];
dbgs
->
enabled
=
ntohl
(
dbgs
->
enabled
);
// fixme: this sucks
dbgs
->
undersample
=
ntohl
(
dbgs
->
undersample
);
configure_spll_debug_dump
(
dbgs
->
enabled
,
dbgs
->
undersample
);
break
;
}
...
...
boards/ertm14/psnmp-proto.h
View file @
cd48cfb8
...
...
@@ -132,7 +132,7 @@ static struct ertm14_protocol_op {
},
{
.
opcode
=
ertm14_configure_spll_debug_dump
,
.
offset1
=
1
,
.
offset1
=
4
,
.
length1
=
sizeof
(
struct
ertm14_spll_debug_dump_request
),
.
offset2
=
0
,
.
length2
=
0
,
...
...
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