Lines Matching full:window

48 /* The 2 bits controlling the window size are often set to allow reading
56 * The bits are 6 and 7. If both bits are set, it is a 5MiB window.
57 * If only the 7 Bit is set, it is a 4MiB window. Otherwise, a
58 * 64KiB window.
63 MODULE_PARM_DESC(win_size_bits, "ROM window size bits override for 0x43 byte, normally set by BIOS.…
69 static void amd76xrom_cleanup(struct amd76xrom_window *window) in amd76xrom_cleanup() argument
74 if (window->pdev) { in amd76xrom_cleanup()
75 /* Disable writes through the rom window */ in amd76xrom_cleanup()
76 pci_read_config_byte(window->pdev, 0x40, &byte); in amd76xrom_cleanup()
77 pci_write_config_byte(window->pdev, 0x40, byte & ~1); in amd76xrom_cleanup()
78 pci_dev_put(window->pdev); in amd76xrom_cleanup()
82 list_for_each_entry_safe(map, scratch, &window->maps, list) { in amd76xrom_cleanup()
91 if (window->rsrc.parent) in amd76xrom_cleanup()
92 release_resource(&window->rsrc); in amd76xrom_cleanup()
94 if (window->virt) { in amd76xrom_cleanup()
95 iounmap(window->virt); in amd76xrom_cleanup()
96 window->virt = NULL; in amd76xrom_cleanup()
97 window->phys = 0; in amd76xrom_cleanup()
98 window->size = 0; in amd76xrom_cleanup()
99 window->pdev = NULL; in amd76xrom_cleanup()
109 struct amd76xrom_window *window = &amd76xrom_window; in amd76xrom_init_one() local
113 /* Remember the pci dev I find the window in - already have a ref */ in amd76xrom_init_one()
114 window->pdev = pdev; in amd76xrom_init_one()
116 /* Enable the selected rom window. This is often incorrectly in amd76xrom_init_one()
118 * requires the full 5MiB of window space. in amd76xrom_init_one()
126 /* Assume the rom window is properly setup, and find it's size */ in amd76xrom_init_one()
129 window->phys = 0xffb00000; /* 5MiB */ in amd76xrom_init_one()
132 window->phys = 0xffc00000; /* 4MiB */ in amd76xrom_init_one()
135 window->phys = 0xffff0000; /* 64KiB */ in amd76xrom_init_one()
137 window->size = 0xffffffffUL - window->phys + 1UL; in amd76xrom_init_one()
140 * Try to reserve the window mem region. If this fails then in amd76xrom_init_one()
141 * it is likely due to a fragment of the window being in amd76xrom_init_one()
146 window->rsrc.name = MOD_NAME; in amd76xrom_init_one()
147 window->rsrc.start = window->phys; in amd76xrom_init_one()
148 window->rsrc.end = window->phys + window->size - 1; in amd76xrom_init_one()
149 window->rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY; in amd76xrom_init_one()
150 if (request_resource(&iomem_resource, &window->rsrc)) { in amd76xrom_init_one()
151 window->rsrc.parent = NULL; in amd76xrom_init_one()
154 __func__, &window->rsrc); in amd76xrom_init_one()
159 /* Enable writes through the rom window */ in amd76xrom_init_one()
166 window->virt = ioremap(window->phys, window->size); in amd76xrom_init_one()
167 if (!window->virt) { in amd76xrom_init_one()
169 window->phys, window->size); in amd76xrom_init_one()
174 map_top = window->phys; in amd76xrom_init_one()
199 offset = map_top - window->phys; in amd76xrom_init_one()
201 (((unsigned long)(window->virt)) + offset); in amd76xrom_init_one()
233 " rom(%llu) larger than window(%lu). fixing...\n", in amd76xrom_init_one()
237 if (window->rsrc.parent) { in amd76xrom_init_one()
247 if (request_resource(&window->rsrc, &map->rsrc)) { in amd76xrom_init_one()
255 map->map.virt = window->virt; in amd76xrom_init_one()
256 map->map.phys = window->phys; in amd76xrom_init_one()
275 list_add(&map->list, &window->maps); in amd76xrom_init_one()
283 if (list_empty(&window->maps)) { in amd76xrom_init_one()
284 amd76xrom_cleanup(window); in amd76xrom_init_one()
293 struct amd76xrom_window *window = &amd76xrom_window; in amd76xrom_remove_one() local
295 amd76xrom_cleanup(window); in amd76xrom_remove_one()