Lines Matching defs:window

53  * The 2 bits controlling the window size are often set to allow reading
61 * The bits are 6 and 7. If both bits are set, it is a 5MiB window.
62 * If only the 7 Bit is set, it is a 4MiB window. Otherwise, a
63 * 64KiB window.
66 * The 15 bits controlling the window size are distributed as follows:
70 * If all bits are enabled, we have a 16? MiB window
75 MODULE_PARM_DESC(win_size_bits, "ROM window size bits override, normally set by BIOS.");
81 static void ck804xrom_cleanup(struct ck804xrom_window *window)
86 if (window->pdev) {
87 /* Disable writes through the rom window */
88 pci_read_config_byte(window->pdev, 0x6d, &byte);
89 pci_write_config_byte(window->pdev, 0x6d, byte & ~1);
93 list_for_each_entry_safe(map, scratch, &window->maps, list) {
102 if (window->rsrc.parent)
103 release_resource(&window->rsrc);
105 if (window->virt) {
106 iounmap(window->virt);
107 window->virt = NULL;
108 window->phys = 0;
109 window->size = 0;
111 pci_dev_put(window->pdev);
121 struct ck804xrom_window *window = &ck804xrom_window;
125 /* Remember the pci dev I find the window in */
126 window->pdev = pci_dev_get(pdev);
130 /* Enable the selected rom window. This is often incorrectly
132 * requires the full 5MiB of window space.
140 /* Assume the rom window is properly setup, and find it's size */
144 window->phys = 0xffb00000; /* 5MiB */
146 window->phys = 0xffc00000; /* 4MiB */
148 window->phys = 0xffff0000; /* 64KiB */
161 window->phys = 0xff000000; /* 16MiB, hardcoded for now */
165 window->size = 0xffffffffUL - window->phys + 1UL;
168 * Try to reserve the window mem region. If this fails then
169 * it is likely due to a fragment of the window being
174 window->rsrc.name = MOD_NAME;
175 window->rsrc.start = window->phys;
176 window->rsrc.end = window->phys + window->size - 1;
177 window->rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
178 if (request_resource(&iomem_resource, &window->rsrc)) {
179 window->rsrc.parent = NULL;
182 __func__, &window->rsrc);
186 /* Enable writes through the rom window */
193 window->virt = ioremap_nocache(window->phys, window->size);
194 if (!window->virt) {
196 window->phys, window->size);
201 map_top = window->phys;
212 * bytes from the starting address of the window.
230 offset = map_top - window->phys;
232 (((unsigned long)(window->virt)) + offset);
264 " rom(%llu) larger than window(%lu). fixing...\n",
268 if (window->rsrc.parent) {
278 if (request_resource(&window->rsrc, &map->rsrc)) {
286 map->map.virt = window->virt;
287 map->map.phys = window->phys;
305 list_add(&map->list, &window->maps);
315 if (list_empty(&window->maps)) {
316 ck804xrom_cleanup(window);
325 struct ck804xrom_window *window = &ck804xrom_window;
327 ck804xrom_cleanup(window);