Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Software
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 ADC 100M 14b 4cha - Software
Commits
cb603760
Commit
cb603760
authored
Aug 15, 2012
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: reprogram memory with adc binaries
Signed-off-by:
Federico Vaga
<
federico.vaga@gmail.com
>
parent
62a91333
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
fa-core.c
fa-core.c
+17
-7
fmc-adc.h
fmc-adc.h
+2
-0
No files found.
fa-core.c
View file @
cb603760
...
...
@@ -13,6 +13,10 @@
#include "spec.h"
#include "fmc-adc.h"
static
struct
fmc_driver
fmc_adc__drv
;
static
char
*
fa_binaries
=
FA_GATEWARE_DEFAULT_NAME
;
module_param_named
(
file
,
fa_binaries
,
charp
,
0444
);
/* This structure lists the various subsystems */
struct
fa_modlist
{
char
*
name
;
...
...
@@ -21,17 +25,17 @@ struct fa_modlist {
};
#define SUBSYS(x) { #x, fa_ ## x ## _init, fa_ ## x ## _exit }
static
struct
fa_modlist
mods
[]
=
{
SUBSYS
(
onewire
),
//
SUBSYS(onewire),
SUBSYS
(
zio
),
};
/* probe and remove are called by fa-spec.c */
int
fa_probe
(
struct
fmc_device
*
fmc
)
{
struct
fa_modlist
*
m
;
struct
fa_modlist
*
m
=
NULL
;
struct
spec_fa
*
fa
;
struct
spec_dev
*
spec
=
fmc
->
carrier_data
;
int
err
,
i
;
int
err
,
i
=
0
;
pr_info
(
"%s:%d
\n
"
,
__func__
,
__LINE__
);
/* Driver data */
...
...
@@ -43,14 +47,20 @@ int fa_probe(struct fmc_device *fmc)
fa
->
fmc
=
fmc
;
fa
->
base
=
spec
->
remap
[
0
];
/* We first write a new binary (and lm32) within the spec */
err
=
fmc
->
op
->
reprogram
(
fmc
,
&
fmc_adc__drv
,
fa_binaries
);
if
(
err
)
{
dev_err
(
fmc
->
hwdev
,
"write firmware
\"
%s
\"
: error %i
\n
"
,
fa_binaries
,
err
);
goto
out
;
}
/* init all subsystems */
for
(
i
=
0
,
m
=
mods
;
i
<
ARRAY_SIZE
(
mods
);
i
++
,
m
++
)
{
pr_debug
(
"%s: Calling init for
\"
%s
\"\n
"
,
__func__
,
m
->
name
);
dev_dbg
(
fmc
->
hwdev
,
"Calling init for
\"
%s
\"\n
"
,
m
->
name
);
err
=
m
->
init
(
fa
);
if
(
err
)
{
pr_err
(
"%s: error initializing %s
\n
"
,
__func__
,
m
->
name
);
dev_err
(
fmc
->
hwdev
,
"error initializing %s
\n
"
,
m
->
name
);
goto
out
;
}
...
...
fmc-adc.h
View file @
cb603760
...
...
@@ -10,6 +10,8 @@
#include <linux/zio.h>
#include "spec.h"
#define FA_GATEWARE_DEFAULT_NAME "fmc/fmc-adc.bin"
/* ADC register offset */
#define FA_DMA_MEM_OFF 0x00000
#define FA_UTC_MEM_OFF 0x40000
...
...
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