int err;
/*
- * Map the first 16MB of th BAR, which includes the registers (0-4MB),
- * reserved space (4MB-8MB), and GGTT (8MB-16MB) for a single tile.
- * This will get remapped later if we determine that we're running
- * on a multi-tile system.
+ * Map the maximum expected BAR size, which will get remapped later
+ * if we determine that we're running on a reduced-tile system.
+ * The first 16MB of the BAR, belong to the root tile, and include:
+ * registers (0-4MB), reserved space (4MB-8MB) and GGTT (8MB-16MB).
*/
- xe->mmio.size = SZ_16M;
- xe->mmio.regs = pci_iomap(to_pci_dev(xe->drm.dev), mmio_bar,
- xe->mmio.size);
+ xe->mmio.size = (SZ_16M + xe->info.tile_mmio_ext_size) * xe->info.tile_count;
+ xe->mmio.regs = pci_iomap(to_pci_dev(xe->drm.dev), mmio_bar, xe->mmio.size);
if (xe->mmio.regs == NULL) {
drm_err(&xe->drm, "failed to map registers\n");
return -EIO;