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
b0d2f392
Commit
b0d2f392
authored
Oct 17, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw: show application metadata
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
64edb712
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
23 deletions
+31
-23
spec-core.c
software/kernel/spec-core.c
+31
-23
No files found.
software/kernel/spec-core.c
View file @
b0d2f392
...
...
@@ -88,39 +88,47 @@ static const struct file_operations spec_dbg_fw_ops = {
.
write
=
spec_dbg_fw_write
,
};
static
int
spec_dbg_meta
(
struct
seq_file
*
s
,
void
*
offset
)
static
void
seq_printf_meta
(
struct
seq_file
*
s
,
const
char
*
indent
,
struct
spec_meta_id
*
meta
)
{
struct
spec_gn412x
*
spec_gn412x
=
s
->
private
;
struct
resource
*
r0
=
&
spec_gn412x
->
pdev
->
resource
[
0
];
struct
spec_meta_id
__iomem
*
meta
;
meta
=
ioremap
(
r0
->
start
+
SPEC_META_BASE
,
sizeof
(
*
meta
));
if
(
!
meta
)
{
dev_warn
(
&
spec_gn412x
->
pdev
->
dev
,
"%s: Mapping failed
\n
"
,
__func__
);
return
-
ENOMEM
;
}
seq_printf
(
s
,
"'%s':
\n
"
,
dev_name
(
&
spec_gn412x
->
pdev
->
dev
));
seq_puts
(
s
,
"Metadata:
\n
"
);
seq_printf
(
s
,
" - Vendor: 0x%08x
\n
"
,
meta
->
vendor
);
seq_printf
(
s
,
" - Device: 0x%08x
\n
"
,
meta
->
device
);
seq_printf
(
s
,
" - Version: 0x%08x
\n
"
,
meta
->
version
);
seq_printf
(
s
,
" - BOM: 0x%08x
\n
"
,
meta
->
bom
);
seq_printf
(
s
,
" - SourceID: 0x%08x%08x%08x%08x
\n
"
,
seq_printf
(
s
,
"%sMetadata:
\n
"
,
indent
);
seq_printf
(
s
,
"%s - Vendor: 0x%08x
\n
"
,
indent
,
meta
->
vendor
);
seq_printf
(
s
,
"%s - Device: 0x%08x
\n
"
,
indent
,
meta
->
device
);
seq_printf
(
s
,
"%s - Version: 0x%08x
\n
"
,
indent
,
meta
->
version
);
seq_printf
(
s
,
"%s - BOM: 0x%08x
\n
"
,
indent
,
meta
->
bom
);
seq_printf
(
s
,
"%s - SourceID: 0x%08x%08x%08x%08x
\n
"
,
indent
,
meta
->
src
[
0
],
meta
->
src
[
1
],
meta
->
src
[
2
],
meta
->
src
[
3
]);
seq_printf
(
s
,
" - CapabilityMask: 0x%08x
\n
"
,
meta
->
cap
);
seq_printf
(
s
,
" - VendorUUID: 0x%08x%08x%08x%08x
\n
"
,
seq_printf
(
s
,
"%s - CapabilityMask: 0x%08x
\n
"
,
indent
,
meta
->
cap
);
seq_printf
(
s
,
"%s - VendorUUID: 0x%08x%08x%08x%08x
\n
"
,
indent
,
meta
->
uuid
[
0
],
meta
->
uuid
[
1
],
meta
->
uuid
[
2
],
meta
->
uuid
[
3
]);
}
static
int
spec_dbg_meta
(
struct
seq_file
*
s
,
void
*
offset
)
{
struct
spec_gn412x
*
spec_gn412x
=
s
->
private
;
struct
resource
*
r0
=
&
spec_gn412x
->
pdev
->
resource
[
0
];
void
*
iomem
;
uint32_t
app_offset
;
iounmap
(
meta
);
iomem
=
ioremap
(
r0
->
start
,
resource_size
(
r0
));
if
(
!
iomem
)
{
dev_warn
(
&
spec_gn412x
->
pdev
->
dev
,
"%s: Mapping failed
\n
"
,
__func__
);
return
-
ENOMEM
;
}
app_offset
=
ioread32
(
iomem
+
0x40
);
seq_printf_meta
(
s
,
""
,
iomem
+
SPEC_META_BASE
);
seq_puts
(
s
,
"Application:
\n
"
);
seq_printf_meta
(
s
,
" "
,
iomem
+
app_offset
);
iounmap
(
iomem
);
return
0
;
}
...
...
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