Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
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
Commits
46b97b4e
Commit
46b97b4e
authored
Jul 15, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv: show FPGA configuration build info
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
93c6beab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
+64
-0
spec-core-fpga.c
software/kernel/spec-core-fpga.c
+62
-0
spec.h
software/kernel/spec.h
+2
-0
No files found.
software/kernel/spec-core-fpga.c
View file @
46b97b4e
...
...
@@ -38,6 +38,8 @@ enum spec_fpga_mem_offsets {
SPEC_FPGA_MEM_DMA_END
=
SPEC_CORE_FPGA
+
0x00FF
,
SPEC_FPGA_MEM_VIC_START
=
SPEC_CORE_FPGA
+
0x0100
,
SPEC_FPGA_MEM_VIC_END
=
SPEC_CORE_FPGA
+
0x01FF
,
SPEC_FPGA_MEM_BLD_START
=
SPEC_CORE_FPGA
+
0x0200
,
SPEC_FPGA_MEM_BLD_END
=
SPEC_CORE_FPGA
+
0x02FF
,
SPEC_FPGA_MEM_WR_START
=
SPEC_CORE_FPGA
+
0x1000
,
SPEC_FPGA_MEM_WR_END
=
SPEC_CORE_FPGA
+
0x1FFF
,
};
...
...
@@ -70,6 +72,7 @@ enum spec_fpga_meta_cap_mask {
SPEC_META_CAP_SPI
=
BIT
(
2
),
SPEC_META_CAP_WR
=
BIT
(
3
),
SPEC_META_CAP_DMA
=
BIT
(
4
),
SPEC_META_CAP_BLD
=
BIT
(
5
),
};
...
...
@@ -100,6 +103,52 @@ static const struct debugfs_reg32 spec_fpga_debugfs_reg32[] = {
},
};
static
int
spec_fpga_dbg_bld_info
(
struct
seq_file
*
s
,
void
*
offset
)
{
struct
spec_fpga
*
spec_fpga
=
s
->
private
;
int
off
;
if
(
!
(
spec_fpga
->
meta
->
cap
&
SPEC_META_CAP_BLD
))
{
seq_puts
(
s
,
"not available
\n
"
);
return
0
;
}
for
(
off
=
SPEC_FPGA_MEM_BLD_START
;
off
<
SPEC_FPGA_MEM_BLD_END
;
off
+=
4
)
{
uint32_t
tmp
=
ioread32
(
spec_fpga
->
fpga
+
off
);
int
i
;
for
(
i
=
3
;
i
>=
0
;
--
i
)
{
char
c
=
(
tmp
>>
(
8
*
i
))
&
0xFF
;
if
(
!
c
)
return
0
;
seq_printf
(
s
,
"%c"
,
c
);
}
}
return
0
;
}
static
int
spec_fpga_dbg_bld_info_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
struct
spec_gn412x
*
spec
=
inode
->
i_private
;
return
single_open
(
file
,
spec_fpga_dbg_bld_info
,
spec
);
}
static
const
struct
file_operations
spec_fpga_dbg_bld_info_ops
=
{
.
owner
=
THIS_MODULE
,
.
open
=
spec_fpga_dbg_bld_info_open
,
.
read
=
seq_read
,
.
llseek
=
seq_lseek
,
.
release
=
single_release
,
};
static
inline
uint32_t
spec_fpga_csr_app_offset
(
struct
spec_fpga
*
spec_fpga
)
{
return
ioread32
(
spec_fpga
->
fpga
+
SPEC_FPGA_CSR_APP_OFF
);
...
...
@@ -700,8 +749,21 @@ int spec_fpga_init(struct spec_gn412x *spec_gn412x)
goto
err_dbg_csr
;
}
spec_fpga
->
dbg_bld_info
=
debugfs_create_file
(
SPEC_DBG_BLD_INFO_NAME
,
0444
,
spec_fpga
->
dbg_dir_fpga
,
spec_fpga
,
&
spec_fpga_dbg_bld_info_ops
);
if
(
IS_ERR_OR_NULL
(
spec_fpga
->
dbg_bld_info
))
{
err
=
PTR_ERR
(
spec_fpga
->
dbg_bld_info
);
dev_err
(
&
spec_fpga
->
dev
,
"Cannot create debugfs file
\"
%s
\"
(%d)
\n
"
,
SPEC_DBG_BLD_INFO_NAME
,
err
);
goto
err_dbg_bld
;
}
return
0
;
err_dbg_bld:
err_dbg_csr:
debugfs_remove_recursive
(
spec_fpga
->
dbg_dir_fpga
);
err_dbg_dir:
...
...
software/kernel/spec.h
View file @
46b97b4e
...
...
@@ -111,6 +111,8 @@ struct spec_fpga {
#define SPEC_DBG_CSR_NAME "csr_regs"
struct
dentry
*
dbg_csr
;
struct
debugfs_regset32
dbg_csr_reg
;
#define SPEC_DBG_BLD_INFO_NAME "build_info"
struct
dentry
*
dbg_bld_info
;
};
/**
...
...
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