Commit 084d7d25 authored by Lucas Russo's avatar Lucas Russo

dev_io/dev_io_core.c: add PCIe SDB print information

For now, only LLIO with PCIe endpoints are
supported.
parent 61a40a63
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment