Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha - Software
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
FMC DEL 1ns 4cha - Software
Commits
bdf35d21
Commit
bdf35d21
authored
Apr 08, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: program FPGA only when GOLDEN is there or user ask for it
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
4c4d6160
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
17 deletions
+36
-17
fd-core.c
kernel/fd-core.c
+36
-17
No files found.
kernel/fd-core.c
View file @
bdf35d21
...
...
@@ -151,25 +151,44 @@ int fd_probe(struct fmc_device *fmc)
return
-
ENOMEM
;
}
fwname
=
""
;
if
(
!
strcmp
(
fmc
->
carrier_name
,
"SVEC"
))
fwname
=
FDELAY_GATEWARE_NAME_SVEC
;
else
if
(
!
strcmp
(
fmc
->
carrier_name
,
"SPEC"
))
fwname
=
FDELAY_GATEWARE_NAME_SPEC
;
if
(
fd_drv
.
gw_n
)
fwname
=
""
;
/* reprogram will pick from module parameter */
ret
=
fmc_reprogram
(
fmc
,
&
fd_drv
,
fwname
,
0
/* SDB entry point */
);
if
(
ret
<
0
)
{
if
(
ret
==
-
ESRCH
)
{
dev_info
(
dev
,
"%s: no gateware at index %i
\n
"
,
KBUILD_MODNAME
,
index
);
return
-
ENODEV
;
/*
* If the carrier is still using the golden bitstream or the user is
* asking for a particular one, then program our bistream, otherwise
* we already have our bitstream
*/
if
(
fmc
->
flags
&
FMC_DEVICE_HAS_GOLDEN
||
fd_drv
.
gw_n
)
{
if
(
fd_drv
.
gw_n
)
fwname
=
""
;
/* reprogram will pick from module parameter */
else
if
(
!
strcmp
(
fmc
->
carrier_name
,
"SVEC"
))
fwname
=
FDELAY_GATEWARE_NAME_SVEC
;
else
if
(
!
strcmp
(
fmc
->
carrier_name
,
"SPEC"
))
fwname
=
FDELAY_GATEWARE_NAME_SPEC
;
dev_info
(
fmc
->
hwdev
,
"Gateware (%s)
\n
"
,
fwname
);
/* We first write a new binary (and lm32) within the carrier */
ret
=
fmc_reprogram
(
fmc
,
&
fd_drv
,
fwname
,
0
/* SDB entry point */
);
if
(
ret
<
0
)
{
dev_err
(
fmc
->
hwdev
,
"write firmware
\"
%s
\"
: error %i
\n
"
,
fwname
,
ret
);
if
(
ret
==
-
ESRCH
)
{
dev_info
(
fmc
->
hwdev
,
"%s: no gateware at index %i
\n
"
,
KBUILD_MODNAME
,
index
);
return
-
ENODEV
;
}
return
ret
;
}
return
ret
;
/* other error: pass over */
dev_info
(
fmc
->
hwdev
,
"Gateware successfully loaded
\n
"
);
}
else
{
dev_info
(
fmc
->
hwdev
,
"Gateware already there. Set the
\"
gateware
\"
parameter to overwrite the current gateware
\n
"
);
}
ret
=
fmc_scan_sdb_tree
(
fmc
,
0
);
if
(
ret
==
-
EBUSY
)
{
/* Not a problem, it's already there. We assume that
it's the correct one */
ret
=
0
;
}
dev_dbg
(
dev
,
"Gateware successfully loaded
\n
"
);
/* Now use SDB to find the base addresses */
...
...
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