Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
V
VME FMC Carrier - VFC-HD
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
VME FMC Carrier - VFC-HD
Commits
d73c9ce9
Commit
d73c9ce9
authored
Jul 05, 2017
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw/tools/wrc: add simple standalone rellocation tool
parent
712f07b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
1 deletion
+65
-1
Makefile
sw/tools/wrc/Makefile
+1
-1
vfchd-relloc.c
sw/tools/wrc/vfchd-relloc.c
+64
-0
No files found.
sw/tools/wrc/Makefile
View file @
d73c9ce9
...
...
@@ -10,7 +10,7 @@ CFLAGS += -I $(VME_INC)
LDFLAGS
+=
-L
.
LDLIBS
+=
-lvfchd
.
$(CPU)
TARGETS
=
vfchd-vuart.
$(CPU)
vfchd-wrc_loader.
$(CPU)
vfchd-eeprom_loader.
$(CPU)
TARGETS
=
vfchd-vuart.
$(CPU)
vfchd-wrc_loader.
$(CPU)
vfchd-eeprom_loader.
$(CPU)
vfchd-relloc.
$(CPU)
all
:
$(TARGETS)
...
...
sw/tools/wrc/vfchd-relloc.c
0 → 100644
View file @
d73c9ce9
/* A simple tool to rellocate the VFC-HD (to the same address as the geographical address) in both
A24 and A32 */
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include "vfchdlib.h"
extern
int
_vfchd_vme64x_rellocate
(
struct
vfchd_dev
*
);
void
_vfchd_relloc_print_usage
(
const
char
*
progname
)
{
fprintf
(
stderr
,
"
\n
Usage:
\"
%s "
"-l SLOT [...]
\n
"
,
progname
);
}
int
main
(
int
argc
,
char
**
argv
)
{
struct
vfchd_dev
*
dev
;
int
c
;
// Required arguments
uint8_t
slot
=
0
;
// Process cmd line arguments
while
((
c
=
getopt
(
argc
,
argv
,
"l:"
))
!=
-
1
)
switch
(
c
)
{
case
'l'
:
slot
=
strtol
(
optarg
,
NULL
,
0
);
break
;
case
'?'
:
default:
_vfchd_relloc_print_usage
(
argv
[
0
]);
return
EINVAL
;
}
if
(
!
slot
)
{
fprintf
(
stderr
,
"(EE): missing SLOT argument.
\n
"
);
_vfchd_relloc_print_usage
(
argv
[
0
]);
return
EINVAL
;
}
// Allocate and init the device structure
dev
=
malloc
(
sizeof
(
struct
vfchd_dev
));
if
(
!
dev
)
return
ENOMEM
;
dev
->
slot
=
slot
;
// Perform VME64x rellocation if necessary
if
(
_vfchd_vme64x_rellocate
(
dev
)
<
0
)
{
fprintf
(
stderr
,
"(EE): VME64x rellocation failed.
\n
"
);
free
(
dev
);
return
-
1
;
}
return
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