ichxrom.c (c1b054d03f5b31c33eaa0b267c629b118eaf3790) ichxrom.c (69f34c98c1416eb74c55e38a21dbf3e294966514)
1/*
2 * ichxrom.c
3 *
4 * Normal mappings of chips in physical memory
1/*
2 * ichxrom.c
3 *
4 * Normal mappings of chips in physical memory
5 * $Id: ichxrom.c,v 1.18 2005/07/07 10:26:20 dwmw2 Exp $
5 * $Id: ichxrom.c,v 1.19 2005/11/07 11:14:27 gleixner Exp $
6 */
7
8#include <linux/module.h>
9#include <linux/types.h>
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <asm/io.h>
13#include <linux/mtd/mtd.h>

--- 82 unchanged lines hidden (view full) ---

96
97 /* For now I just handle the ichx and I assume there
98 * are not a lot of resources up at the top of the address
99 * space. It is possible to handle other devices in the
100 * top 16MB but it is very painful. Also since
101 * you can only really attach a FWH to an ICHX there
102 * a number of simplifications you can make.
103 *
6 */
7
8#include <linux/module.h>
9#include <linux/types.h>
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <asm/io.h>
13#include <linux/mtd/mtd.h>

--- 82 unchanged lines hidden (view full) ---

96
97 /* For now I just handle the ichx and I assume there
98 * are not a lot of resources up at the top of the address
99 * space. It is possible to handle other devices in the
100 * top 16MB but it is very painful. Also since
101 * you can only really attach a FWH to an ICHX there
102 * a number of simplifications you can make.
103 *
104 * Also you can page firmware hubs if an 8MB window isn't enough
104 * Also you can page firmware hubs if an 8MB window isn't enough
105 * but don't currently handle that case either.
106 */
107 window->pdev = pdev;
108
109 /* Find a region continuous to the end of the ROM window */
110 window->phys = 0;
111 pci_read_config_byte(pdev, FWH_DEC_EN1, &byte);
112 if (byte == 0xff) {

--- 26 unchanged lines hidden (view full) ---

139 }
140 else if ((byte & 0xe0) == 0xe0) {
141 window->phys = 0xffe80000;
142 }
143 else if ((byte & 0xc0) == 0xc0) {
144 window->phys = 0xfff00000;
145 }
146 else if ((byte & 0x80) == 0x80) {
105 * but don't currently handle that case either.
106 */
107 window->pdev = pdev;
108
109 /* Find a region continuous to the end of the ROM window */
110 window->phys = 0;
111 pci_read_config_byte(pdev, FWH_DEC_EN1, &byte);
112 if (byte == 0xff) {

--- 26 unchanged lines hidden (view full) ---

139 }
140 else if ((byte & 0xe0) == 0xe0) {
141 window->phys = 0xffe80000;
142 }
143 else if ((byte & 0xc0) == 0xc0) {
144 window->phys = 0xfff00000;
145 }
146 else if ((byte & 0x80) == 0x80) {
147 window->phys = 0xfff80000;
147 window->phys = 0xfff80000;
148 }
149
150 if (window->phys == 0) {
151 printk(KERN_ERR MOD_NAME ": Rom window is closed\n");
152 goto out;
153 }
154 window->phys -= 0x400000UL;
155 window->size = (0xffffffffUL - window->phys) + 1UL;

--- 72 unchanged lines hidden (view full) ---

228 /* Set the name of the map to the address I am trying */
229 sprintf(map->map_name, "%s @%08lx",
230 MOD_NAME, map->map.phys);
231
232 /* Firmware hubs only use vpp when being programmed
233 * in a factory setting. So in-place programming
234 * needs to use a different method.
235 */
148 }
149
150 if (window->phys == 0) {
151 printk(KERN_ERR MOD_NAME ": Rom window is closed\n");
152 goto out;
153 }
154 window->phys -= 0x400000UL;
155 window->size = (0xffffffffUL - window->phys) + 1UL;

--- 72 unchanged lines hidden (view full) ---

228 /* Set the name of the map to the address I am trying */
229 sprintf(map->map_name, "%s @%08lx",
230 MOD_NAME, map->map.phys);
231
232 /* Firmware hubs only use vpp when being programmed
233 * in a factory setting. So in-place programming
234 * needs to use a different method.
235 */
236 for(map->map.bankwidth = 32; map->map.bankwidth;
236 for(map->map.bankwidth = 32; map->map.bankwidth;
237 map->map.bankwidth >>= 1)
238 {
239 char **probe_type;
240 /* Skip bankwidths that are not supported */
241 if (!map_bankwidth_supported(map->map.bankwidth))
242 continue;
243
244 /* Setup the map methods */

--- 36 unchanged lines hidden (view full) ---

281
282 /* Make the whole region visible in the map */
283 map->map.virt = window->virt;
284 map->map.phys = window->phys;
285 cfi = map->map.fldrv_priv;
286 for(i = 0; i < cfi->numchips; i++) {
287 cfi->chips[i].start += offset;
288 }
237 map->map.bankwidth >>= 1)
238 {
239 char **probe_type;
240 /* Skip bankwidths that are not supported */
241 if (!map_bankwidth_supported(map->map.bankwidth))
242 continue;
243
244 /* Setup the map methods */

--- 36 unchanged lines hidden (view full) ---

281
282 /* Make the whole region visible in the map */
283 map->map.virt = window->virt;
284 map->map.phys = window->phys;
285 cfi = map->map.fldrv_priv;
286 for(i = 0; i < cfi->numchips; i++) {
287 cfi->chips[i].start += offset;
288 }
289
289
290 /* Now that the mtd devices is complete claim and export it */
291 map->mtd->owner = THIS_MODULE;
292 if (add_mtd_device(map->mtd)) {
293 map_destroy(map->mtd);
294 map->mtd = NULL;
295 goto out;
296 }
297

--- 22 unchanged lines hidden (view full) ---

320
321static void __devexit ichxrom_remove_one (struct pci_dev *pdev)
322{
323 struct ichxrom_window *window = &ichxrom_window;
324 ichxrom_cleanup(window);
325}
326
327static struct pci_device_id ichxrom_pci_tbl[] __devinitdata = {
290 /* Now that the mtd devices is complete claim and export it */
291 map->mtd->owner = THIS_MODULE;
292 if (add_mtd_device(map->mtd)) {
293 map_destroy(map->mtd);
294 map->mtd = NULL;
295 goto out;
296 }
297

--- 22 unchanged lines hidden (view full) ---

320
321static void __devexit ichxrom_remove_one (struct pci_dev *pdev)
322{
323 struct ichxrom_window *window = &ichxrom_window;
324 ichxrom_cleanup(window);
325}
326
327static struct pci_device_id ichxrom_pci_tbl[] __devinitdata = {
328 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0,
328 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0,
329 PCI_ANY_ID, PCI_ANY_ID, },
329 PCI_ANY_ID, PCI_ANY_ID, },
330 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0,
330 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0,
331 PCI_ANY_ID, PCI_ANY_ID, },
331 PCI_ANY_ID, PCI_ANY_ID, },
332 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0,
332 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0,
333 PCI_ANY_ID, PCI_ANY_ID, },
334 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0,
335 PCI_ANY_ID, PCI_ANY_ID, },
336 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1,
337 PCI_ANY_ID, PCI_ANY_ID, },
338 { 0, },
339};
340

--- 43 unchanged lines hidden ---
333 PCI_ANY_ID, PCI_ANY_ID, },
334 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0,
335 PCI_ANY_ID, PCI_ANY_ID, },
336 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1,
337 PCI_ANY_ID, PCI_ANY_ID, },
338 { 0, },
339};
340

--- 43 unchanged lines hidden ---