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
09de3ed7
There was an error fetching the commit references. Please try again later.
Commit
09de3ed7
authored
12 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
spec: don't access eeprom if not golden firmware
parent
374e5f11
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
kernel/spec-fmc.c
+9
-0
9 additions, 0 deletions
kernel/spec-fmc.c
kernel/spec-i2c.c
+1
-1
1 addition, 1 deletion
kernel/spec-i2c.c
with
10 additions
and
1 deletion
kernel/spec-fmc.c
+
9
−
0
View file @
09de3ed7
...
...
@@ -55,11 +55,16 @@ static int spec_reprogram(struct fmc_device *fmc, char *gw)
goto
out
;
}
fmc_free_sdb_tree
(
fmc
);
fmc
->
flags
&=
~
(
FMC_DEVICE_HAS_GOLDEN
|
FMC_DEVICE_HAS_CUSTOM
);
ret
=
spec_load_fpga
(
spec
,
fw
->
data
,
fw
->
size
);
if
(
ret
<
0
)
{
dev_err
(
dev
,
"write firmware
\"
%s
\"
: error %i
\n
"
,
gw
,
ret
);
goto
out
;
}
if
(
gw
==
spec_fw_name
)
fmc
->
flags
|=
FMC_DEVICE_HAS_GOLDEN
;
else
fmc
->
flags
|=
FMC_DEVICE_HAS_CUSTOM
;
/* FIXME: load lm32 */
out:
...
...
@@ -132,12 +137,16 @@ static int spec_irq_free(struct fmc_device *fmc)
/* The engines for this live in spec-i2c.c, we only shape arguments */
static
int
spec_read_ee
(
struct
fmc_device
*
fmc
,
int
pos
,
void
*
data
,
int
len
)
{
if
(
!
(
fmc
->
flags
&
FMC_DEVICE_HAS_GOLDEN
))
return
-
ENOTSUPP
;
return
spec_eeprom_read
(
fmc
,
SPEC_I2C_EEPROM_ADDR
,
pos
,
data
,
len
);
}
static
int
spec_write_ee
(
struct
fmc_device
*
fmc
,
int
pos
,
const
void
*
data
,
int
len
)
{
if
(
!
(
fmc
->
flags
&
FMC_DEVICE_HAS_GOLDEN
))
return
-
ENOTSUPP
;
return
spec_eeprom_write
(
fmc
,
SPEC_I2C_EEPROM_ADDR
,
pos
,
data
,
len
);
}
...
...
This diff is collapsed.
Click to expand it.
kernel/spec-i2c.c
+
1
−
1
View file @
09de3ed7
...
...
@@ -205,7 +205,7 @@ int spec_i2c_init(struct fmc_device *fmc)
found
=
mi2c_scan
(
fmc
);
if
(
!
found
)
{
dev_err
(
&
spec
->
pdev
->
dev
,
"Empty mezzanine?
\n
"
)
;
fmc
->
flags
|=
FMC_DEVICE_NO_MEZZANINE
;
return
0
;
}
...
...
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