Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
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
Beam Positoning Monitor - Software
Commits
084d7d25
Commit
084d7d25
authored
Jul 26, 2016
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev_io/dev_io_core.c: add PCIe SDB print information
For now, only LLIO with PCIe endpoints are supported.
parent
61a40a63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
32 deletions
+19
-32
dev_io_core.c
src/dev_io/dev_io_core.c
+19
-32
No files found.
src/dev_io/dev_io_core.c
View file @
084d7d25
...
...
@@ -410,28 +410,28 @@ devio_err_e devio_destroy (devio_t **self_p)
}
/* FIXME: Only valid for PCIe devices */
#if 0
static
int
_devio_read_llio_block
(
struct
sdbfs
*
fs
,
int
offset
,
void
*
buf
,
int
count
)
{
return
llio_read_block
(((
devio_t
*
)
fs
->
drvdata
)
->
llio
,
BAR4_ADDR
|
(
offset
),
count
,
(
uint32_t
*
)
buf
);
}
#endif
/* Read specific information about the device. Typically,
* this is stored in the SDB structure inside the device */
devio_err_e
devio_print_info
(
devio_t
*
self
)
{
(
void
)
self
;
assert
(
self
)
;
devio_err_e
err
=
DEVIO_SUCCESS
;
/* FIXME: Only valid for PCIe devices */
#if 0
/* FIXME: Hardcoded non-default SDB address */
#define SDB_ADDRESS 0x00300000UL
/* FIXME: Only valid for PCIe devices */
ASSERT_TEST
(
llio_get_type
(
self
->
llio
)
!=
PCIE_DEV
,
"SDB is only supported for PCIe devices"
,
err_sdb_not_supp
,
DEVIO_ERR_FUNC_NOT_IMPL
);
/* The sdb filesystem itself */
struct sdbfs
bpm_fpga
_sdb = {
.name = "
fpga
-area",
struct
sdbfs
devio
_sdb
=
{
.
name
=
"
sdb
-area"
,
.
drvdata
=
(
void
*
)
self
,
.
blocksize
=
1
,
/* Not currently used */
.
entrypoint
=
SDB_ADDRESS
,
...
...
@@ -439,33 +439,20 @@ devio_err_e devio_print_info (devio_t *self)
.
flags
=
0
,
.
read
=
_devio_read_llio_block
};
struct sdb_device *d;
int new = 1;
int serr = sdbfs_dev_create
(&bpm_fpga
_sdb);
int
serr
=
sdbfs_dev_create
(
&
devio
_sdb
);
ASSERT_TEST
(
serr
==
0
,
"Could not create SDBFS"
,
err_sdbfs_create, DEVIO_ERR_SMIO_DO_OP /* FIXME: temporary*/);
while ( (d = sdbfs_scan(&bpm_fpga_sdb, new)) != NULL) {
/*
* "%.19s" is not working for XINT printf, and zeroing
* d->sdb_component.product.record_type won't work, as
* the device is read straight from fpga ROM registers
*/
const int namesize = sizeof(d->sdb_component.product.name);
char name[namesize + 1];
memcpy(name, d->sdb_component.product.name, sizeof(name));
name[namesize] = '\0';
DBE_DEBUG (DBG_DEV_IO | DBG_LVL_INFO, "dev 0x%08lx @ %06lx, %s\n",
(long)(d->sdb_component.product.device_id),
bpm_fpga_sdb.f_offset, name);
new = 0;
}
err_sdbfs_create
,
DEVIO_ERR_SMIO_DO_OP
);
/* Print SDB */
sdbutils_do_list
(
&
devio_sdb
,
1
);
/* Cleanup */
sdbfs_dev_destroy
(
&
devio_sdb
);
return
err
;
sdbfs_dev_destroy(&bpm_fpga_sdb);
err_sdbfs_create:
#endif
err_sdb_not_supp:
return
err
;
}
...
...
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