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
09de3ed7
Commit
09de3ed7
authored
Aug 02, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec: don't access eeprom if not golden firmware
parent
374e5f11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
spec-fmc.c
kernel/spec-fmc.c
+9
-0
spec-i2c.c
kernel/spec-i2c.c
+1
-1
No files found.
kernel/spec-fmc.c
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
);
}
...
...
kernel/spec-i2c.c
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
;
}
...
...
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