Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FPGA Configuration Space
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
FPGA Configuration Space
Commits
ee1e2292
Commit
ee1e2292
authored
Feb 02, 2016
by
Piotr Miedzik
Committed by
root
Feb 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec_wb: MSI is now optional
parent
279d8071
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
spec_wb.c
pcie-wb/spec_wb.c
+20
-7
spec_wb.h
pcie-wb/spec_wb.h
+1
-0
No files found.
pcie-wb/spec_wb.c
View file @
ee1e2292
...
...
@@ -28,6 +28,7 @@
#endif
static
unsigned
int
debug
=
0
;
static
unsigned
int
sdb_addr
=
0x100
;
static
void
wb_cycle
(
struct
wishbone
*
wb
,
int
on
)
{
...
...
@@ -157,7 +158,7 @@ static wb_data_t wb_read_cfg(struct wishbone *wb, wb_addr_t addr)
case
0
:
out
=
0
;
break
;
case
4
:
out
=
0
;
break
;
case
8
:
out
=
0
;
break
;
case
12
:
out
=
0x30000
;
break
;
case
12
:
out
=
sdb_addr
;
break
;
default:
out
=
0
;
break
;
}
...
...
@@ -260,6 +261,7 @@ static int probe(struct pci_dev *pdev, const struct pci_device_id *id)
dev
->
pci_dev
=
pdev
;
dev
->
wb
.
wops
=
&
wb_ops
;
dev
->
wb
.
parent
=
&
pdev
->
dev
;
dev
->
msi
=
1
;
mutex_init
(
&
dev
->
mutex
);
dev
->
window_offset
=
0
;
dev
->
low_addr
=
0
;
...
...
@@ -271,7 +273,12 @@ static int probe(struct pci_dev *pdev, const struct pci_device_id *id)
if
(
pci_enable_msi
(
pdev
)
!=
0
)
{
/* resort to legacy interrupts */
printk
(
KERN_ALERT
SPEC_WB
": could not enable MSI interrupting
\n
"
);
goto
fail_free
;
dev
->
msi
=
0
;
}
if
(
dev
->
msi
)
{
/* disable legacy interrupts when using MSI */
pci_intx
(
pdev
,
0
);
}
if
(
setup_bar
(
pdev
,
&
dev
->
pci_res
[
0
],
0
)
<
0
)
goto
fail_msi
;
...
...
@@ -292,9 +299,11 @@ fail_bar1:
destroy_bar
(
&
dev
->
pci_res
[
1
]);
fail_bar0:
destroy_bar
(
&
dev
->
pci_res
[
0
]);
fail_msi:
pci_disable_msi
(
pdev
);
fail_free:
fail_msi:
if
(
dev
->
msi
)
{
pci_intx
(
pdev
,
1
);
pci_disable_msi
(
pdev
);
}
kfree
(
dev
);
fail_out:
return
-
EIO
;
...
...
@@ -314,8 +323,10 @@ static void remove(struct pci_dev *pdev)
destroy_bar
(
&
dev
->
pci_res
[
2
]);
destroy_bar
(
&
dev
->
pci_res
[
1
]);
destroy_bar
(
&
dev
->
pci_res
[
0
]);
pci_disable_msi
(
pdev
);
if
(
dev
->
msi
)
{
pci_intx
(
pdev
,
1
);
pci_disable_msi
(
pdev
);
}
kfree
(
dev
);
}
...
...
@@ -348,6 +359,8 @@ MODULE_AUTHOR("Wesley W. Terpstra <w.tersptra@gsi.de>");
MODULE_DESCRIPTION
(
"CERN SPEC card bridge"
);
module_param
(
debug
,
int
,
0644
);
MODULE_PARM_DESC
(
debug
,
"Enable debugging information"
);
module_param
(
sdb_addr
,
int
,
0644
);
MODULE_PARM_DESC
(
sdb_addr
,
"SDB address"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_VERSION
(
SPEC_WB_VERSION
);
...
...
pcie-wb/spec_wb.h
View file @
ee1e2292
...
...
@@ -31,6 +31,7 @@ struct spec_wb_dev {
struct
pci_dev
*
pci_dev
;
struct
spec_wb_resource
pci_res
[
3
];
int
pci_irq
[
4
];
int
msi
;
struct
wishbone
wb
;
struct
mutex
mutex
;
/* only one user can open a cycle at a time */
...
...
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