Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC Bus
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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 Bus
Commits
a96c24bc
Commit
a96c24bc
authored
Aug 01, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmc_operations: use a different reprogram
parent
b966f47a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
27 deletions
+11
-27
fmc-bus.in
doc/fmc-bus.in
+6
-5
fmc-trivial.c
kernel/fmc-trivial.c
+4
-21
fmc.h
kernel/include/linux/fmc.h
+1
-1
No files found.
doc/fmc-bus.in
View file @
a96c24bc
...
@@ -184,7 +184,7 @@ this document):
...
@@ -184,7 +184,7 @@ this document):
struct fmc
_
operations
{
struct fmc
_
operations
{
uint32
_
t (*readl)(struct fmc
_
device *fmc, int offset);
uint32
_
t (*readl)(struct fmc
_
device *fmc, int offset);
void (*writel)(struct fmc
_
device *fmc, uint32
_
t value, int offset);
void (*writel)(struct fmc
_
device *fmc, uint32
_
t value, int offset);
int (*reprogram)(struct fmc
_
device *fmc,
void *data, int len
);
int (*reprogram)(struct fmc
_
device *fmc,
char *gateware
);
int (*irq
_
request)(struct fmc
_
device *fmc, irq
_
handler
_
t h,
int (*irq
_
request)(struct fmc
_
device *fmc, irq
_
handler
_
t h,
char *name, int flags);
char *name, int flags);
void (*irq
_
ack)(struct fmc
_
device *fmc);
void (*irq
_
ack)(struct fmc
_
device *fmc);
...
@@ -214,10 +214,11 @@ The individual methods perform the following tasks:
...
@@ -214,10 +214,11 @@ The individual methods perform the following tasks:
The carrier enumerates FMC devices by loading a standard (or
The carrier enumerates FMC devices by loading a standard (or
@i
{
golden
}
FPGA binary that allows EEPROM access. Each driver, then,
@i
{
golden
}
FPGA binary that allows EEPROM access. Each driver, then,
will need to reprogram the FPGA for its own use by calling this
will need to reprogram the FPGA by calling this
function. If @i
{
reprogram
}
is called with NULL arguments, the
function. If the name argument is NULL,
carrier will reprogram the golden binary -- which will happen
the carrier will reprogram the golden binary. If the gateware name
after @i
{
remove
}
time in any case.
has been overridden through module parameters (in a carrier-specific
way) the file loaded will match the parameters.
@item irq
_
request
@item irq
_
request
@itemx irq
_
ack
@itemx irq
_
ack
...
...
kernel/fmc-trivial.c
View file @
a96c24bc
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/firmware.h>
#include <linux/fmc.h>
#include <linux/fmc.h>
#include "spec.h"
#include "spec.h"
...
@@ -21,31 +20,15 @@ irqreturn_t t_handler(int irq, void *dev_id)
...
@@ -21,31 +20,15 @@ irqreturn_t t_handler(int irq, void *dev_id)
int
t_probe
(
struct
fmc_device
*
fmc
)
int
t_probe
(
struct
fmc_device
*
fmc
)
{
{
int
ret
;
int
ret
;
struct
device
*
dev
=
fmc
->
hwdev
;
ret
=
fmc
->
op
->
irq_request
(
fmc
,
t_handler
,
"fmc-trivial"
,
0
);
ret
=
fmc
->
op
->
irq_request
(
fmc
,
t_handler
,
"fmc-trivial"
,
0
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
if
(
t_filename
)
{
/* Reprogram, but only if specified in the arguments */
const
struct
firmware
*
fw
;
ret
=
fmc
->
op
->
reprogram
(
fmc
,
""
);
if
(
ret
<
0
)
ret
=
request_firmware
(
&
fw
,
t_filename
,
dev
);
fmc
->
op
->
irq_free
(
fmc
);
if
(
ret
<
0
)
{
dev_warn
(
dev
,
"request firmware
\"
%s
\"
: error %i
\n
"
,
t_filename
,
ret
);
ret
=
0
;
/* not fatal */
}
else
{
ret
=
fmc
->
op
->
reprogram
(
fmc
,
(
void
*
)
fw
->
data
,
fw
->
size
);
}
if
(
ret
<
0
)
{
dev_err
(
dev
,
"write firmware
\"
%s
\"
: error %i
\n
"
,
t_filename
,
ret
);
ret
=
0
;
/* not fatal, either (lazy me) */
}
release_firmware
(
fw
);
}
return
ret
;
return
ret
;
}
}
...
...
kernel/include/linux/fmc.h
View file @
a96c24bc
...
@@ -36,7 +36,7 @@ struct fmc_driver {
...
@@ -36,7 +36,7 @@ struct fmc_driver {
struct
fmc_operations
{
struct
fmc_operations
{
uint32_t
(
*
readl
)(
struct
fmc_device
*
fmc
,
int
offset
);
uint32_t
(
*
readl
)(
struct
fmc_device
*
fmc
,
int
offset
);
void
(
*
writel
)(
struct
fmc_device
*
fmc
,
uint32_t
value
,
int
offset
);
void
(
*
writel
)(
struct
fmc_device
*
fmc
,
uint32_t
value
,
int
offset
);
int
(
*
reprogram
)(
struct
fmc_device
*
fmc
,
void
*
data
,
int
len
);
int
(
*
reprogram
)(
struct
fmc_device
*
fmc
,
char
*
gateware
);
int
(
*
irq_request
)(
struct
fmc_device
*
fmc
,
irq_handler_t
h
,
int
(
*
irq_request
)(
struct
fmc_device
*
fmc
,
irq_handler_t
h
,
char
*
name
,
int
flags
);
char
*
name
,
int
flags
);
void
(
*
irq_ack
)(
struct
fmc_device
*
fmc
);
void
(
*
irq_ack
)(
struct
fmc_device
*
fmc
);
...
...
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