Lines Matching refs:window

54  * The 2 bits controlling the window size are often set to allow reading
62 * The bits are 6 and 7. If both bits are set, it is a 5MiB window.
63 * If only the 7 Bit is set, it is a 4MiB window. Otherwise, a
64 * 64KiB window.
67 * The 15 bits controlling the window size are distributed as follows:
71 * If all bits are enabled, we have a 16? MiB window
76 MODULE_PARM_DESC(win_size_bits, "ROM window size bits override, normally set by BIOS.");
82 static void ck804xrom_cleanup(struct ck804xrom_window *window)
87 if (window->pdev) {
88 /* Disable writes through the rom window */
89 pci_read_config_byte(window->pdev, 0x6d, &byte);
90 pci_write_config_byte(window->pdev, 0x6d, byte & ~1);
94 list_for_each_entry_safe(map, scratch, &window->maps, list) {
103 if (window->rsrc.parent)
104 release_resource(&window->rsrc);
106 if (window->virt) {
107 iounmap(window->virt);
108 window->virt = NULL;
109 window->phys = 0;
110 window->size = 0;
112 pci_dev_put(window->pdev);
122 struct ck804xrom_window *window = &ck804xrom_window;
126 /* Remember the pci dev I find the window in */
127 window->pdev = pci_dev_get(pdev);
131 /* Enable the selected rom window. This is often incorrectly
133 * requires the full 5MiB of window space.
141 /* Assume the rom window is properly setup, and find it's size */
145 window->phys = 0xffb00000; /* 5MiB */
147 window->phys = 0xffc00000; /* 4MiB */
149 window->phys = 0xffff0000; /* 64KiB */
162 window->phys = 0xff000000; /* 16MiB, hardcoded for now */
166 window->size = 0xffffffffUL - window->phys + 1UL;
169 * Try to reserve the window mem region. If this fails then
170 * it is likely due to a fragment of the window being
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 /* Enable writes through the rom window */
194 window->virt = ioremap(window->phys, window->size);
195 if (!window->virt) {
197 window->phys, window->size);
202 map_top = window->phys;
213 * bytes from the starting address of the window.
229 offset = map_top - window->phys;
231 (((unsigned long)(window->virt)) + offset);
263 " rom(%llu) larger than window(%lu). fixing...\n",
267 if (window->rsrc.parent) {
277 if (request_resource(&window->rsrc, &map->rsrc)) {
285 map->map.virt = window->virt;
286 map->map.phys = window->phys;
304 list_add(&map->list, &window->maps);
313 if (list_empty(&window->maps)) {
314 ck804xrom_cleanup(window);
323 struct ck804xrom_window *window = &ck804xrom_window;
325 ck804xrom_cleanup(window);