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
5
Merge Requests
5
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
7513f96f
Commit
7513f96f
authored
Apr 10, 2024
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/wrpc.c: add cernvme little endian
(used by WREN-VME)
parent
5ac04dd5
Pipeline
#5323
passed with stage
in 4 minutes and 30 seconds
Changes
1
Pipelines
17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
11 deletions
+68
-11
wrpc.c
tools/wrpc.c
+68
-11
No files found.
tools/wrpc.c
View file @
7513f96f
...
...
@@ -446,8 +446,8 @@ static int cernvme_map(struct board_cernvme *board,
return
0
;
}
static
int
board_cernvme_init
(
struct
board
*
board_base
,
int
*
argc
,
char
*
argv
[])
static
int
board_cernvme_init
_common
(
struct
board
*
board_base
,
int
*
argc
,
char
*
argv
[])
{
struct
board_cernvme
*
board
=
(
struct
board_cernvme
*
)
board_base
;
...
...
@@ -539,6 +539,19 @@ static int board_cernvme_init(struct board *board_base,
return
cernvme_map
(
board
,
am
,
data_width
,
vme_addr
,
offset
);
}
static
int
board_cernvme_init
(
struct
board
*
board_base
,
int
*
argc
,
char
*
argv
[])
{
struct
board_cernvme
*
board
=
(
struct
board_cernvme
*
)
board_base
;
int
res
=
board_cernvme_init_common
(
board_base
,
argc
,
argv
);
if
(
res
<
0
)
return
res
;
board
->
parent
.
is_be
=
1
;
return
0
;
}
static
int
board_cernvme_fini
(
struct
board
*
base_board
)
{
struct
board_cernvme
*
board
=
(
struct
board_cernvme
*
)
base_board
;
...
...
@@ -547,7 +560,7 @@ static int board_cernvme_fini(struct board *base_board)
return
0
;
}
static
void
board_cernvme_help
(
void
)
static
void
board_cernvme_help
_common
(
void
)
{
printf
(
"VME board (using CERN-vme bridge)
\n
"
);
printf
(
" -a, --address ADDR board address
\n
"
);
...
...
@@ -558,6 +571,12 @@ static void board_cernvme_help(void)
printf
(
"One of -a or -s is required
\n
"
);
}
static
void
board_cernvme_help
(
void
)
{
printf
(
"VME board (using CERN-vme bridge)
\n
"
);
board_cernvme_help_common
();
}
static
struct
board_cernvme
board_cernvme
=
{
{
...
...
@@ -576,13 +595,50 @@ static struct board_cernvme board_cernvme =
},
};
static
int
board_cernvme_le_init
(
struct
board
*
board_base
,
int
*
argc
,
char
*
argv
[])
{
struct
board_cernvme
*
board
=
(
struct
board_cernvme
*
)
board_base
;
int
res
=
board_cernvme_init_common
(
board_base
,
argc
,
argv
);
if
(
res
<
0
)
return
res
;
board
->
parent
.
is_be
=
0
;
return
0
;
}
static
void
board_cernvme_le_help
(
void
)
{
printf
(
"VME little-endian board (using CERN-vme bridge)
\n
"
);
board_cernvme_help_common
();
}
static
struct
board_cernvme
board_cernvme_le
=
{
{
{
"vme"
,
board_cernvme_le_init
,
board_cernvme_fini
,
board_cernvme_le_help
,
mem_readl
,
mem_writel
},
NULL
,
0
,
NULL
,
0
},
};
static
uint32_t
wr2rf_readl
(
struct
board
*
base_board
,
unsigned
reg
)
{
struct
board_mem
*
board
=
(
struct
board_mem
*
)
base_board
;
volatile
uint16_t
*
addr
=
(
volatile
uint16_t
*
)(
board
->
base
+
reg
);
uint32_t
l
,
h
,
res
;
volatile
uint16_t
*
addr
=
(
volatile
uint16_t
*
)(
board
->
base
+
reg
);
uint32_t
l
,
h
,
res
;
/* A 16b VME bus with special circuitery to get an atomic 32b value */
/* A 16b VME bus with special circuitery to get an atomic 32b value */
l
=
addr
[
0
];
h
=
addr
[
1
];
res
=
(
l
<<
16
)
|
h
;
...
...
@@ -655,16 +711,17 @@ static struct board_cernvme board_wr2rf =
#endif
static
struct
board
*
boards
[]
=
{
&
board_pci
.
parent
.
parent
,
&
board_spec
.
parent
.
parent
,
&
board_pci
.
parent
.
parent
,
&
board_spec
.
parent
.
parent
,
#ifdef SUPPORT_ERTM
&
board_ertm14
.
parent
,
#endif
#ifdef SUPPORT_CERN_VMEBRIDGE
&
board_cernvme
.
parent
.
parent
,
&
board_wr2rf
.
parent
.
parent
,
&
board_cernvme
.
parent
.
parent
,
&
board_cernvme_le
.
parent
.
parent
,
&
board_wr2rf
.
parent
.
parent
,
#endif
NULL
NULL
};
static
struct
board
*
find_board
(
const
char
*
name
)
...
...
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