Lines Matching refs:window
81 static void ck804xrom_cleanup(struct ck804xrom_window *window) in ck804xrom_cleanup() argument
86 if (window->pdev) { in ck804xrom_cleanup()
88 pci_read_config_byte(window->pdev, 0x6d, &byte); in ck804xrom_cleanup()
89 pci_write_config_byte(window->pdev, 0x6d, byte & ~1); in ck804xrom_cleanup()
93 list_for_each_entry_safe(map, scratch, &window->maps, list) { in ck804xrom_cleanup()
102 if (window->rsrc.parent) in ck804xrom_cleanup()
103 release_resource(&window->rsrc); in ck804xrom_cleanup()
105 if (window->virt) { in ck804xrom_cleanup()
106 iounmap(window->virt); in ck804xrom_cleanup()
107 window->virt = NULL; in ck804xrom_cleanup()
108 window->phys = 0; in ck804xrom_cleanup()
109 window->size = 0; in ck804xrom_cleanup()
111 pci_dev_put(window->pdev); in ck804xrom_cleanup()
121 struct ck804xrom_window *window = &ck804xrom_window; in ck804xrom_init_one() local
126 window->pdev = pci_dev_get(pdev); in ck804xrom_init_one()
144 window->phys = 0xffb00000; /* 5MiB */ in ck804xrom_init_one()
146 window->phys = 0xffc00000; /* 4MiB */ in ck804xrom_init_one()
148 window->phys = 0xffff0000; /* 64KiB */ in ck804xrom_init_one()
161 window->phys = 0xff000000; /* 16MiB, hardcoded for now */ in ck804xrom_init_one()
165 window->size = 0xffffffffUL - window->phys + 1UL; in ck804xrom_init_one()
174 window->rsrc.name = MOD_NAME; in ck804xrom_init_one()
175 window->rsrc.start = window->phys; in ck804xrom_init_one()
176 window->rsrc.end = window->phys + window->size - 1; in ck804xrom_init_one()
177 window->rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY; in ck804xrom_init_one()
178 if (request_resource(&iomem_resource, &window->rsrc)) { in ck804xrom_init_one()
179 window->rsrc.parent = NULL; in ck804xrom_init_one()
182 __func__, &window->rsrc); in ck804xrom_init_one()
193 window->virt = ioremap_nocache(window->phys, window->size); in ck804xrom_init_one()
194 if (!window->virt) { in ck804xrom_init_one()
196 window->phys, window->size); in ck804xrom_init_one()
201 map_top = window->phys; in ck804xrom_init_one()
230 offset = map_top - window->phys; in ck804xrom_init_one()
232 (((unsigned long)(window->virt)) + offset); in ck804xrom_init_one()
268 if (window->rsrc.parent) { in ck804xrom_init_one()
278 if (request_resource(&window->rsrc, &map->rsrc)) { in ck804xrom_init_one()
286 map->map.virt = window->virt; in ck804xrom_init_one()
287 map->map.phys = window->phys; in ck804xrom_init_one()
305 list_add(&map->list, &window->maps); in ck804xrom_init_one()
314 if (list_empty(&window->maps)) { in ck804xrom_init_one()
315 ck804xrom_cleanup(window); in ck804xrom_init_one()
324 struct ck804xrom_window *window = &ck804xrom_window; in ck804xrom_remove_one() local
326 ck804xrom_cleanup(window); in ck804xrom_remove_one()