Lines Matching defs:window

56 static void ichxrom_cleanup(struct ichxrom_window *window)
61 /* Disable writes through the rom window */
62 pci_read_config_word(window->pdev, BIOS_CNTL, &word);
63 pci_write_config_word(window->pdev, BIOS_CNTL, word & ~1);
64 pci_dev_put(window->pdev);
67 list_for_each_entry_safe(map, scratch, &window->maps, list) {
75 if (window->rsrc.parent)
76 release_resource(&window->rsrc);
77 if (window->virt) {
78 iounmap(window->virt);
79 window->virt = NULL;
80 window->phys = 0;
81 window->size = 0;
82 window->pdev = NULL;
91 struct ichxrom_window *window = &ichxrom_window;
104 * Also you can page firmware hubs if an 8MB window isn't enough
107 window->pdev = pdev;
109 /* Find a region continuous to the end of the ROM window */
110 window->phys = 0;
113 window->phys = 0xffc00000;
116 window->phys = 0xff400000;
119 window->phys = 0xff500000;
122 window->phys = 0xff600000;
125 window->phys = 0xff700000;
129 window->phys = 0xffc80000;
132 window->phys = 0xffd00000;
135 window->phys = 0xffd80000;
138 window->phys = 0xffe00000;
141 window->phys = 0xffe80000;
144 window->phys = 0xfff00000;
147 window->phys = 0xfff80000;
150 if (window->phys == 0) {
151 printk(KERN_ERR MOD_NAME ": Rom window is closed\n");
154 window->phys -= 0x400000UL;
155 window->size = (0xffffffffUL - window->phys) + 1UL;
157 /* Enable writes through the rom window */
169 * Try to reserve the window mem region. If this fails then
170 * it is likely due to the window being "reseved" by the BIOS.
172 window->rsrc.name = MOD_NAME;
173 window->rsrc.start = window->phys;
174 window->rsrc.end = window->phys + window->size - 1;
175 window->rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
176 if (request_resource(&iomem_resource, &window->rsrc)) {
177 window->rsrc.parent = NULL;
180 __func__, &window->rsrc);
184 window->virt = ioremap_nocache(window->phys, window->size);
185 if (!window->virt) {
187 window->phys, window->size);
192 map_top = window->phys;
193 if ((window->phys & 0x3fffff) != 0) {
194 map_top = window->phys + 0x400000;
222 offset = map_top - window->phys;
224 (((unsigned long)(window->virt)) + offset);
259 " rom(%llu) larger than window(%lu). fixing...\n",
263 if (window->rsrc.parent) {
273 if (request_resource(&window->rsrc, &map->rsrc)) {
281 map->map.virt = window->virt;
282 map->map.phys = window->phys;
301 list_add(&map->list, &window->maps);
310 if (list_empty(&window->maps)) {
311 ichxrom_cleanup(window);
320 struct ichxrom_window *window = &ichxrom_window;
321 ichxrom_cleanup(window);