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
bd23b5e8
Commit
bd23b5e8
authored
Apr 30, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel/fd-core: refuse to work if core version is old
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
a1cea9b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
fd-core.c
kernel/fd-core.c
+29
-0
No files found.
kernel/fd-core.c
View file @
bd23b5e8
...
...
@@ -193,6 +193,35 @@ int fd_probe(struct fmc_device *fmc)
if
(
ret
<
0
)
return
ret
;
/*
* Now, check the release field of the sdb record for our core.
* Unfortunately we have no fmc primitive to see the device record.
* So keep at the first level, knowing fdelay leaves there (FIXME)
*/
for
(
i
=
0
;
i
<
fmc
->
sdb
->
len
;
i
++
)
{
union
sdb_record
*
r
;
struct
sdb_product
*
p
;
struct
sdb_component
*
c
;
r
=
fmc
->
sdb
->
record
+
i
;
if
(
r
->
empty
.
record_type
!=
sdb_type_device
)
continue
;
c
=
&
r
->
dev
.
sdb_component
;
p
=
&
c
->
product
;
if
(
be64_to_cpu
(
p
->
vendor_id
)
!=
0xce42LL
)
continue
;
if
(
be32_to_cpu
(
p
->
device_id
)
!=
0xf19ede1a
)
continue
;
if
(
be32_to_cpu
(
p
->
version
)
<
3
)
{
dev_err
(
dev
,
"Core version %i < 3; refusing to work
\n
"
,
be32_to_cpu
(
p
->
version
));
return
-
EINVAL
;
}
break
;
}
if
(
i
==
fmc
->
sdb
->
len
)
dev_warn
(
dev
,
"Can't find 0xf19ede1a dev for version check
\n
"
);
/* First, hardware reset */
fd_do_reset
(
fd
,
1
);
...
...
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