Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
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
Simple PCIe FMC carrier SPEC - Software
Commits
c641779b
Commit
c641779b
authored
Jul 30, 2014
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
speclib: allow to write FPGA with a given buffer
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
3e282487
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
speclib.c
tools/speclib.c
+13
-4
speclib.h
tools/speclib.h
+4
-0
No files found.
tools/speclib.c
View file @
c641779b
...
...
@@ -270,9 +270,20 @@ static char *load_binary_file(const char *filename, size_t *size)
return
buf
;
}
int
spec_load_bitstream
(
void
*
card
,
const
char
*
filenam
e
)
int
spec_load_bitstream
_buffer
(
void
*
card
,
void
*
buf
,
size_t
siz
e
)
{
struct
spec_private
*
p
=
(
struct
spec_private
*
)
card
;
int
rv
;
rv
=
loader_low_level
(
0
,
p
->
bar4
,
buf
,
size
);
waitdone_low_level
(
0
,
p
->
bar4
);
gpiofix_low_level
(
0
,
p
->
bar4
);
return
rv
;
}
int
spec_load_bitstream
(
void
*
card
,
const
char
*
filename
)
{
char
*
buf
;
size_t
size
;
int
rv
;
...
...
@@ -281,9 +292,7 @@ int spec_load_bitstream(void *card, const char *filename)
if
(
!
buf
)
return
-
1
;
rv
=
loader_low_level
(
0
,
p
->
bar4
,
buf
,
size
);
waitdone_low_level
(
0
,
p
->
bar4
);
gpiofix_low_level
(
0
,
p
->
bar4
);
rv
=
spec_load_bitstream_buffer
(
card
,
buf
,
size
);
free
(
buf
);
return
rv
;
...
...
tools/speclib.h
View file @
c641779b
...
...
@@ -20,6 +20,10 @@ void spec_close(void *card);
Returns 0 on success. */
int
spec_load_bitstream
(
void
*
card
,
const
char
*
filename
);
/* Load the FPGA bitstram into car [card] from a given buffer [buf]
of size [size] */
int
spec_load_bitstream_buffer
(
void
*
card
,
void
*
buf
,
size_t
size
);
/* Loads the WRC LM32 firmware into card [card] from file [filename]. starting at
address [base_addr]. Returns 0 on success.
WARNING: using improper base address/FPGA firmware will freeze the computer. */
...
...
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