Lines Matching full:window
57 static void ichxrom_cleanup(struct ichxrom_window *window) in ichxrom_cleanup() argument
63 /* Disable writes through the rom window */ in ichxrom_cleanup()
64 ret = pci_read_config_word(window->pdev, BIOS_CNTL, &word); in ichxrom_cleanup()
66 pci_write_config_word(window->pdev, BIOS_CNTL, word & ~1); in ichxrom_cleanup()
67 pci_dev_put(window->pdev); in ichxrom_cleanup()
70 list_for_each_entry_safe(map, scratch, &window->maps, list) { in ichxrom_cleanup()
78 if (window->rsrc.parent) in ichxrom_cleanup()
79 release_resource(&window->rsrc); in ichxrom_cleanup()
80 if (window->virt) { in ichxrom_cleanup()
81 iounmap(window->virt); in ichxrom_cleanup()
82 window->virt = NULL; in ichxrom_cleanup()
83 window->phys = 0; in ichxrom_cleanup()
84 window->size = 0; in ichxrom_cleanup()
85 window->pdev = NULL; in ichxrom_cleanup()
94 struct ichxrom_window *window = &ichxrom_window; in ichxrom_init_one() local
107 * Also you can page firmware hubs if an 8MB window isn't enough in ichxrom_init_one()
110 window->pdev = pdev; in ichxrom_init_one()
112 /* Find a region continuous to the end of the ROM window */ in ichxrom_init_one()
113 window->phys = 0; in ichxrom_init_one()
116 window->phys = 0xffc00000; in ichxrom_init_one()
119 window->phys = 0xff400000; in ichxrom_init_one()
122 window->phys = 0xff500000; in ichxrom_init_one()
125 window->phys = 0xff600000; in ichxrom_init_one()
128 window->phys = 0xff700000; in ichxrom_init_one()
132 window->phys = 0xffc80000; in ichxrom_init_one()
135 window->phys = 0xffd00000; in ichxrom_init_one()
138 window->phys = 0xffd80000; in ichxrom_init_one()
141 window->phys = 0xffe00000; in ichxrom_init_one()
144 window->phys = 0xffe80000; in ichxrom_init_one()
147 window->phys = 0xfff00000; in ichxrom_init_one()
150 window->phys = 0xfff80000; in ichxrom_init_one()
153 if (window->phys == 0) { in ichxrom_init_one()
154 printk(KERN_ERR MOD_NAME ": Rom window is closed\n"); in ichxrom_init_one()
157 window->phys -= 0x400000UL; in ichxrom_init_one()
158 window->size = (0xffffffffUL - window->phys) + 1UL; in ichxrom_init_one()
160 /* Enable writes through the rom window */ in ichxrom_init_one()
172 * Try to reserve the window mem region. If this fails then in ichxrom_init_one()
173 * it is likely due to the window being "reserved" by the BIOS. in ichxrom_init_one()
175 window->rsrc.name = MOD_NAME; in ichxrom_init_one()
176 window->rsrc.start = window->phys; in ichxrom_init_one()
177 window->rsrc.end = window->phys + window->size - 1; in ichxrom_init_one()
178 window->rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY; in ichxrom_init_one()
179 if (request_resource(&iomem_resource, &window->rsrc)) { in ichxrom_init_one()
180 window->rsrc.parent = NULL; in ichxrom_init_one()
183 __func__, &window->rsrc); in ichxrom_init_one()
187 window->virt = ioremap(window->phys, window->size); in ichxrom_init_one()
188 if (!window->virt) { in ichxrom_init_one()
190 window->phys, window->size); in ichxrom_init_one()
195 map_top = window->phys; in ichxrom_init_one()
196 if ((window->phys & 0x3fffff) != 0) { in ichxrom_init_one()
197 map_top = window->phys + 0x400000; in ichxrom_init_one()
223 offset = map_top - window->phys; in ichxrom_init_one()
225 (((unsigned long)(window->virt)) + offset); in ichxrom_init_one()
260 " rom(%llu) larger than window(%lu). fixing...\n", in ichxrom_init_one()
264 if (window->rsrc.parent) { in ichxrom_init_one()
274 if (request_resource(&window->rsrc, &map->rsrc)) { in ichxrom_init_one()
282 map->map.virt = window->virt; in ichxrom_init_one()
283 map->map.phys = window->phys; in ichxrom_init_one()
302 list_add(&map->list, &window->maps); in ichxrom_init_one()
311 if (list_empty(&window->maps)) { in ichxrom_init_one()
312 ichxrom_cleanup(window); in ichxrom_init_one()
321 struct ichxrom_window *window = &ichxrom_window; in ichxrom_remove_one() local
322 ichxrom_cleanup(window); in ichxrom_remove_one()