Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spec-sw
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
fmc-projects
spec
spec-sw
Commits
b005f770
Commit
b005f770
authored
12 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
spec-fmc: verify the SDB records of the golden image
parent
3dfdab04
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/spec-fmc.c
+31
-0
31 additions, 0 deletions
kernel/spec-fmc.c
with
31 additions
and
0 deletions
kernel/spec-fmc.c
+
31
−
0
View file @
b005f770
...
...
@@ -158,6 +158,32 @@ static void spec_irq_exit(struct fmc_device *fmc)
fmc
->
op
->
irq_ack
(
fmc
);
/* just to be safe */
}
static
int
check_golden
(
struct
fmc_device
*
fmc
)
{
struct
spec_dev
*
spec
=
fmc
->
carrier_data
;
/* poor man's SDB */
if
(
fmc_readl
(
fmc
,
0x100
)
!=
0x5344422d
)
{
dev_err
(
&
spec
->
pdev
->
dev
,
"Can't find SDB magic
\n
"
);
return
-
ENODEV
;
}
/* Offset 4 is number of records, version, bus type */
if
(
fmc_readl
(
fmc
,
0x104
)
!=
0x00020100
)
{
dev_err
(
&
spec
->
pdev
->
dev
,
"unsexpected content of SDB
\n
"
);
return
-
ENODEV
;
}
if
(
fmc_readl
(
fmc
,
0x15c
)
!=
0x0000ce42
)
{
dev_err
(
&
spec
->
pdev
->
dev
,
"unsexpected vendor in SDB
\n
"
);
return
-
ENODEV
;
}
if
(
fmc_readl
(
fmc
,
0x160
)
!=
0xff07fc47
)
{
dev_err
(
&
spec
->
pdev
->
dev
,
"unsexpected device in SDB
\n
"
);
return
-
ENODEV
;
}
return
0
;
}
int
spec_fmc_create
(
struct
spec_dev
*
spec
)
{
struct
fmc_device
*
fmc
;
...
...
@@ -175,6 +201,11 @@ int spec_fmc_create(struct spec_dev *spec)
fmc
->
op
=
&
spec_fmc_operations
;
spec
->
fmc
=
fmc
;
/* Check that the golden binary is actually correct */
ret
=
check_golden
(
fmc
);
if
(
ret
)
goto
out_free
;
ret
=
spec_i2c_init
(
fmc
);
if
(
ret
)
goto
out_free
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment