/* * If the BAR is missing, dev_mapbase is zero, or if the * device is IO mapped we just print a warning and go on with the * next device, instead of completely stop the gdd parser
*/ if (mdev->bar > bar_count - 1) {
pr_info("No BAR for 16z%03d\n", mdev->id);
ret = 0; goto err;
}
dev_mapbase = cb[mdev->bar].addr; if (!dev_mapbase) {
pr_info("BAR not assigned for 16z%03d\n", mdev->id);
ret = 0; goto err;
}
if (dev_mapbase & 0x01) {
pr_info("IO mapped Device (16z%03d) not yet supported\n",
mdev->id);
ret = 0; goto err;
}
/* * For those devices which are not connected * to the PCI Bus (e.g. LPC) there is a bar * descriptor located directly after the * chameleon header. This header is comparable * to a PCI header.
*/
dtype = get_next_dtype(*base); if (dtype == CHAMELEON_DTYPE_BAR) {
reg = readl(*base);
c = kcalloc(bar_count, sizeof(struct chameleon_bar),
GFP_KERNEL); if (!c) return -ENOMEM;
chameleon_parse_bar(*base, c, bar_count);
*base += BAR_DESC_SIZE(bar_count);
} else {
c = kzalloc(sizeof(struct chameleon_bar), GFP_KERNEL); if (!c) return -ENOMEM;
bar_count = 1;
c->addr = mapbase;
}
*cb = c;
return bar_count;
}
int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase, void __iomem *base)
{ struct chameleon_fpga_header *header; struct chameleon_bar *cb; void __iomem *p = base; int num_cells = 0;
uint32_t dtype; int bar_count; int ret;
u32 hsize;
u32 table_size;
hsize = sizeof(struct chameleon_fpga_header);
header = kzalloc(hsize, GFP_KERNEL); if (!header) return -ENOMEM;
/* Extract header information */
memcpy_fromio(header, p, hsize); /* We only support chameleon v2 at the moment */
header->magic = le16_to_cpu(header->magic); if (header->magic != CHAMELEONV2_MAGIC) {
pr_err("Unsupported chameleon version 0x%x\n",
header->magic);
ret = -ENODEV; goto free_header;
}
p += hsize;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.