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
9b3a10cf
Commit
9b3a10cf
authored
May 04, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec-core: use lm32= parameter, don't load by default
parent
9892fa07
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
spec-sw.in
doc/spec-sw.in
+8
-1
spec-core.c
kernel/spec-core.c
+13
-1
spec.h
kernel/spec.h
+2
-0
No files found.
doc/spec-sw.in
View file @
9b3a10cf
...
...
@@ -142,7 +142,7 @@ turn perform the following actions:
@itemize @bullet
@item Program a @i
{
firmware
}
(or @i
{
gateware
}
) file in the FPGA
@item Load program code for the internal CPU (if any)
@item Load program code for the internal CPU (if any
and if requested
)
@item Load a sub-module for driving the FMC card (if any).
@end itemize
...
...
@@ -152,6 +152,13 @@ may have its program already included in the @i{gateware} file);
similarly you may not need a sub-driver, because the card is
stand-alone and needs no Linux driver.
Please note that the CPU program file is not loaded by default any
more: you must explicitely request it to be loaded with a module
parameter. If you pass ``lm32=1'' as a parameter, it will try to load
at the default address (0x80000). IF you you pass a different value
than 1, it will be used as the load address (for example:
``@code
{
insmod lm32=0xc0000
}
'').
@b
{
Note:
}
all three files are looked-for in @i
{
/lib/firmware/fmc
}
,
because our own installations share firmware for COTS peripherals
but mount a host-specific NFS subdirectory. This is incompatible
...
...
kernel/spec-core.c
View file @
9b3a10cf
...
...
@@ -26,6 +26,9 @@
static
char
*
spec_name
=
"%b"
;
module_param_named
(
name
,
spec_name
,
charp
,
0444
);
static
int
spec_lm32_addr
=
-
1
;
module_param_named
(
lm32
,
spec_lm32_addr
,
int
,
0444
);
/*
* A procedure to build the names associated with the device. This
* copies the spec_name. With "spec-" prefix, expanding %P
...
...
@@ -142,6 +145,15 @@ int spec_load_lm32(struct spec_dev *dev)
const
struct
firmware
*
fw
;
int
err
,
off
;
if
(
spec_lm32_addr
<
0
)
{
/* Not loading lm32 code unless we get the parameter */
return
0
;
}
if
(
spec_lm32_addr
==
1
)
{
/* "insmod lm32=1" loads at the default address */
spec_lm32_addr
=
SPEC_DEFAULT_LM32_ADDR
;
}
err
=
request_firmware
(
&
fw
,
dev
->
names
[
SPEC_NAME_PROG
],
&
dev
->
pdev
->
dev
);
if
(
err
<
0
)
...
...
@@ -157,7 +169,7 @@ int spec_load_lm32(struct spec_dev *dev)
uint32_t
datum
;
datum
=
get_unaligned_be32
(
fw
->
data
+
off
);
writel
(
datum
,
dev
->
remap
[
0
]
+
0x80000
+
off
);
writel
(
datum
,
dev
->
remap
[
0
]
+
spec_lm32_addr
+
off
);
}
/* Unreset the LM32 */
writel
(
0xdeadbee
,
dev
->
remap
[
0
]
+
0xA0400
);
...
...
kernel/spec.h
View file @
9b3a10cf
...
...
@@ -20,6 +20,8 @@
#define PCI_VENDOR_ID_GENNUM 0x1a39
#define PCI_DEVICE_ID_GN4124 0x0004
#define SPEC_DEFAULT_LM32_ADDR 0x80000
/* used if "1" is passed */
#define SPEC_MAX_BOARDS 8
enum
spec_names
{
...
...
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