Lines Matching refs:window

118 static void esb2rom_cleanup(struct esb2rom_window *window)
123 /* Disable writes through the rom window */
124 pci_read_config_byte(window->pdev, BIOS_CNTL, &byte);
125 pci_write_config_byte(window->pdev, BIOS_CNTL,
129 list_for_each_entry_safe(map, scratch, &window->maps, list) {
137 if (window->rsrc.parent)
138 release_resource(&window->rsrc);
139 if (window->virt) {
140 iounmap(window->virt);
141 window->virt = NULL;
142 window->phys = 0;
143 window->size = 0;
145 pci_dev_put(window->pdev);
152 struct esb2rom_window *window = &esb2rom_window;
165 * Also you can page firmware hubs if an 8MiB window isn't enough
168 window->pdev = pci_dev_get(pdev);
170 /* RLG: experiment 2. Force the window registers to the widest values */
186 /* Find a region continuous to the end of the ROM window */
187 window->phys = 0;
192 window->phys = 0xff400000;
194 window->phys = 0xff500000;
196 window->phys = 0xff600000;
198 window->phys = 0xFF700000;
200 window->phys = 0xffc00000;
202 window->phys = 0xffc80000;
204 window->phys = 0xffd00000;
206 window->phys = 0xffd80000;
208 window->phys = 0xffe00000;
210 window->phys = 0xffe80000;
212 window->phys = 0xfff00000;
214 window->phys = 0xfff80000;
216 if (window->phys == 0) {
217 printk(KERN_ERR MOD_NAME ": Rom window is closed\n");
222 window->phys -= 0x400000UL;
223 window->size = (0xffffffffUL - window->phys) + 1UL;
225 /* Enable writes through the rom window */
237 * Try to reserve the window mem region. If this fails then
238 * it is likely due to the window being "reserved" by the BIOS.
240 window->rsrc.name = MOD_NAME;
241 window->rsrc.start = window->phys;
242 window->rsrc.end = window->phys + window->size - 1;
243 window->rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
244 if (request_resource(&iomem_resource, &window->rsrc)) {
245 window->rsrc.parent = NULL;
248 __func__, &window->rsrc);
252 window->virt = ioremap(window->phys, window->size);
253 if (!window->virt) {
255 window->phys, window->size);
260 map_top = window->phys;
261 if ((window->phys & 0x3fffff) != 0) {
263 map_top = window->phys + 0x400000;
289 offset = map_top - window->phys;
291 (((unsigned long)(window->virt)) + offset);
325 " rom(%llu) larger than window(%lu). fixing...\n",
329 if (window->rsrc.parent) {
339 if (request_resource(&window->rsrc, &map->rsrc)) {
347 map->map.virt = window->virt;
348 map->map.phys = window->phys;
365 list_add(&map->list, &window->maps);
374 if (list_empty(&window->maps)) {
375 esb2rom_cleanup(window);
383 struct esb2rom_window *window = &esb2rom_window;
384 esb2rom_cleanup(window);