diff options
Diffstat (limited to 'drivers/mtd/maps/scx200_docflash.c')
-rw-r--r-- | drivers/mtd/maps/scx200_docflash.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/mtd/maps/scx200_docflash.c b/drivers/mtd/maps/scx200_docflash.c index 0ece3786d6ea..2c91dff8bb60 100644 --- a/drivers/mtd/maps/scx200_docflash.c +++ b/drivers/mtd/maps/scx200_docflash.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* linux/drivers/mtd/maps/scx200_docflash.c | 1 | /* linux/drivers/mtd/maps/scx200_docflash.c |
2 | 2 | ||
3 | Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com> | 3 | Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com> |
4 | 4 | ||
5 | $Id: scx200_docflash.c,v 1.10 2004/11/28 09:40:40 dwmw2 Exp $ | 5 | $Id: scx200_docflash.c,v 1.12 2005/11/07 11:14:28 gleixner Exp $ |
6 | 6 | ||
7 | National Semiconductor SCx200 flash mapped with DOCCS | 7 | National Semiconductor SCx200 flash mapped with DOCCS |
8 | */ | 8 | */ |
@@ -49,23 +49,23 @@ static struct mtd_info *mymtd; | |||
49 | 49 | ||
50 | #ifdef CONFIG_MTD_PARTITIONS | 50 | #ifdef CONFIG_MTD_PARTITIONS |
51 | static struct mtd_partition partition_info[] = { | 51 | static struct mtd_partition partition_info[] = { |
52 | { | 52 | { |
53 | .name = "DOCCS Boot kernel", | 53 | .name = "DOCCS Boot kernel", |
54 | .offset = 0, | 54 | .offset = 0, |
55 | .size = 0xc0000 | 55 | .size = 0xc0000 |
56 | }, | 56 | }, |
57 | { | 57 | { |
58 | .name = "DOCCS Low BIOS", | 58 | .name = "DOCCS Low BIOS", |
59 | .offset = 0xc0000, | 59 | .offset = 0xc0000, |
60 | .size = 0x40000 | 60 | .size = 0x40000 |
61 | }, | 61 | }, |
62 | { | 62 | { |
63 | .name = "DOCCS File system", | 63 | .name = "DOCCS File system", |
64 | .offset = 0x100000, | 64 | .offset = 0x100000, |
65 | .size = ~0 /* calculate from flash size */ | 65 | .size = ~0 /* calculate from flash size */ |
66 | }, | 66 | }, |
67 | { | 67 | { |
68 | .name = "DOCCS High BIOS", | 68 | .name = "DOCCS High BIOS", |
69 | .offset = ~0, /* calculate from flash size */ | 69 | .offset = ~0, /* calculate from flash size */ |
70 | .size = 0x80000 | 70 | .size = 0x80000 |
71 | }, | 71 | }, |
@@ -88,7 +88,7 @@ static int __init init_scx200_docflash(void) | |||
88 | 88 | ||
89 | printk(KERN_DEBUG NAME ": NatSemi SCx200 DOCCS Flash Driver\n"); | 89 | printk(KERN_DEBUG NAME ": NatSemi SCx200 DOCCS Flash Driver\n"); |
90 | 90 | ||
91 | if ((bridge = pci_find_device(PCI_VENDOR_ID_NS, | 91 | if ((bridge = pci_find_device(PCI_VENDOR_ID_NS, |
92 | PCI_DEVICE_ID_NS_SCx200_BRIDGE, | 92 | PCI_DEVICE_ID_NS_SCx200_BRIDGE, |
93 | NULL)) == NULL) | 93 | NULL)) == NULL) |
94 | return -ENODEV; | 94 | return -ENODEV; |
@@ -134,28 +134,28 @@ static int __init init_scx200_docflash(void) | |||
134 | printk(KERN_ERR NAME ": invalid size for flash mapping\n"); | 134 | printk(KERN_ERR NAME ": invalid size for flash mapping\n"); |
135 | return -EINVAL; | 135 | return -EINVAL; |
136 | } | 136 | } |
137 | 137 | ||
138 | if (width != 8 && width != 16) { | 138 | if (width != 8 && width != 16) { |
139 | printk(KERN_ERR NAME ": invalid bus width for flash mapping\n"); | 139 | printk(KERN_ERR NAME ": invalid bus width for flash mapping\n"); |
140 | return -EINVAL; | 140 | return -EINVAL; |
141 | } | 141 | } |
142 | 142 | ||
143 | if (allocate_resource(&iomem_resource, &docmem, | 143 | if (allocate_resource(&iomem_resource, &docmem, |
144 | size, | 144 | size, |
145 | 0xc0000000, 0xffffffff, | 145 | 0xc0000000, 0xffffffff, |
146 | size, NULL, NULL)) { | 146 | size, NULL, NULL)) { |
147 | printk(KERN_ERR NAME ": unable to allocate memory for flash mapping\n"); | 147 | printk(KERN_ERR NAME ": unable to allocate memory for flash mapping\n"); |
148 | return -ENOMEM; | 148 | return -ENOMEM; |
149 | } | 149 | } |
150 | 150 | ||
151 | ctrl = 0x07000000 | ((size-1) >> 13); | 151 | ctrl = 0x07000000 | ((size-1) >> 13); |
152 | 152 | ||
153 | printk(KERN_INFO "DOCCS BASE=0x%08lx, CTRL=0x%08lx\n", (long)docmem.start, (long)ctrl); | 153 | printk(KERN_INFO "DOCCS BASE=0x%08lx, CTRL=0x%08lx\n", (long)docmem.start, (long)ctrl); |
154 | 154 | ||
155 | pci_write_config_dword(bridge, SCx200_DOCCS_BASE, docmem.start); | 155 | pci_write_config_dword(bridge, SCx200_DOCCS_BASE, docmem.start); |
156 | pci_write_config_dword(bridge, SCx200_DOCCS_CTRL, ctrl); | 156 | pci_write_config_dword(bridge, SCx200_DOCCS_CTRL, ctrl); |
157 | pmr = inl(scx200_cb_base + SCx200_PMR); | 157 | pmr = inl(scx200_cb_base + SCx200_PMR); |
158 | 158 | ||
159 | if (width == 8) { | 159 | if (width == 8) { |
160 | pmr &= ~(1<<6); | 160 | pmr &= ~(1<<6); |
161 | } else { | 161 | } else { |
@@ -163,8 +163,8 @@ static int __init init_scx200_docflash(void) | |||
163 | } | 163 | } |
164 | outl(pmr, scx200_cb_base + SCx200_PMR); | 164 | outl(pmr, scx200_cb_base + SCx200_PMR); |
165 | } | 165 | } |
166 | 166 | ||
167 | printk(KERN_INFO NAME ": DOCCS mapped at 0x%lx-0x%lx, width %d\n", | 167 | printk(KERN_INFO NAME ": DOCCS mapped at 0x%lx-0x%lx, width %d\n", |
168 | docmem.start, docmem.end, width); | 168 | docmem.start, docmem.end, width); |
169 | 169 | ||
170 | scx200_docflash_map.size = size; | 170 | scx200_docflash_map.size = size; |