Lines Matching refs:window

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