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