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
a8c6809f
Commit
a8c6809f
authored
May 18, 2020
by
Jorge Machado
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve comments. Unify variables. Remove useless variables
parent
d74bcb21
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
spec-sdb-scan.c
kernel/spec-sdb-scan.c
+12
-10
No files found.
kernel/spec-sdb-scan.c
View file @
a8c6809f
...
...
@@ -50,6 +50,8 @@
#define SDB_7SOLS_VENDOR 0x000075cb
// Products
#define SDB_DIO_PID 0x00000001
// V2 DIO gateware product ID. The 0x3 value should
// be used to mantain backward compatibility
#define SDB_DIO_PID_V2 0x00000003
#define SDB_DIO_NAME "DIO"
...
...
@@ -216,9 +218,7 @@ static int spec_sdb_fpga_dev_register(struct fmc_device *fmc, struct fpga_dev *f
int
i
,
j
,
r
;
unsigned
int
n_irqs
=
0
;
unsigned
int
n_res
=
0
;
int
find_v2
=
0
;
int
v1_found
=
0
;
int
v2_found
=
0
;
int
version_found
=
0
;
if
(
fdev
->
n_cores
<=
0
||
fdev
->
n_cores
>=
FPGA_DEV_MAX_CORES
)
return
-
EINVAL
;
...
...
@@ -240,13 +240,13 @@ static int spec_sdb_fpga_dev_register(struct fmc_device *fmc, struct fpga_dev *f
fdev
->
cores
[
i
].
pid
,
&
size
);
if
(
start
<
0
)
{
// If DIO V1 is not found, try to find DIO V2
if
(
fdev
->
cores
[
i
].
vid
==
SDB_7SOLS_VENDOR
)
{
// If DIO V1 is not found, continue to find DIO V2
if
(
fdev
->
cores
[
i
].
pid
==
SDB_DIO_PID
)
{
find_v2
=
1
;
continue
;
}
else
if
(
fdev
->
cores
[
i
].
pid
==
SDB_DIO_PID_V2
&&
v1_found
==
1
){
// If DIO V2 is not found, check if DIO V2 has been found previously
else
if
(
fdev
->
cores
[
i
].
pid
==
SDB_DIO_PID_V2
&&
version_found
==
1
){
continue
;
}
}
...
...
@@ -256,12 +256,14 @@ static int spec_sdb_fpga_dev_register(struct fmc_device *fmc, struct fpga_dev *f
}
if
(
fdev
->
cores
[
i
].
vid
==
SDB_7SOLS_VENDOR
)
{
//DIO v1 has been detected
if
(
fdev
->
cores
[
i
].
pid
==
SDB_DIO_PID
)
{
v
1
_found
=
1
;
v
ersion
_found
=
1
;
}
//DIO v2 has been detected
else
if
(
fdev
->
cores
[
i
].
pid
==
SDB_DIO_PID_V2
)
{
v
2_found
=
1
;
v
ersion_found
=
2
;
}
}
...
...
@@ -287,8 +289,8 @@ static int spec_sdb_fpga_dev_register(struct fmc_device *fmc, struct fpga_dev *f
fdev
->
dev
.
resource
=
res
;
fdev
->
dev
.
num_resources
=
n_res
;
//
set V2 device name if necessary
if
(
v
2_found
==
1
)
{
//
Set V2 device name if it has been detected
if
(
v
ersion_found
==
2
)
{
fdev
->
dev
.
name
=
FPGA_DEVS_DIO_DEV_PDEV_NAME_V2
;
}
...
...
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