diff options
Diffstat (limited to 'drivers/mtd/maps/ixp2000.c')
-rw-r--r-- | drivers/mtd/maps/ixp2000.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/mtd/maps/ixp2000.c b/drivers/mtd/maps/ixp2000.c index 6f36497022d1..641eb2b55e9f 100644 --- a/drivers/mtd/maps/ixp2000.c +++ b/drivers/mtd/maps/ixp2000.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: ixp2000.c,v 1.6 2005/03/18 14:07:46 gleixner Exp $ | 2 | * $Id: ixp2000.c,v 1.9 2005/11/07 11:14:27 gleixner Exp $ |
3 | * | 3 | * |
4 | * drivers/mtd/maps/ixp2000.c | 4 | * drivers/mtd/maps/ixp2000.c |
5 | * | 5 | * |
@@ -14,7 +14,7 @@ | |||
14 | * This program is free software; you can redistribute it and/or modify | 14 | * This program is free software; you can redistribute it and/or modify |
15 | * it under the terms of the GNU General Public License version 2 as | 15 | * it under the terms of the GNU General Public License version 2 as |
16 | * published by the Free Software Foundation. | 16 | * published by the Free Software Foundation. |
17 | * | 17 | * |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
@@ -46,8 +46,8 @@ struct ixp2000_flash_info { | |||
46 | }; | 46 | }; |
47 | 47 | ||
48 | static inline unsigned long flash_bank_setup(struct map_info *map, unsigned long ofs) | 48 | static inline unsigned long flash_bank_setup(struct map_info *map, unsigned long ofs) |
49 | { | 49 | { |
50 | unsigned long (*set_bank)(unsigned long) = | 50 | unsigned long (*set_bank)(unsigned long) = |
51 | (unsigned long(*)(unsigned long))map->map_priv_2; | 51 | (unsigned long(*)(unsigned long))map->map_priv_2; |
52 | 52 | ||
53 | return (set_bank ? set_bank(ofs) : ofs); | 53 | return (set_bank ? set_bank(ofs) : ofs); |
@@ -55,8 +55,8 @@ static inline unsigned long flash_bank_setup(struct map_info *map, unsigned long | |||
55 | 55 | ||
56 | #ifdef __ARMEB__ | 56 | #ifdef __ARMEB__ |
57 | /* | 57 | /* |
58 | * Rev A0 and A1 of IXP2400 silicon have a broken addressing unit which | 58 | * Rev A0 and A1 of IXP2400 silicon have a broken addressing unit which |
59 | * causes the lower address bits to be XORed with 0x11 on 8 bit accesses | 59 | * causes the lower address bits to be XORed with 0x11 on 8 bit accesses |
60 | * and XORed with 0x10 on 16 bit accesses. See the spec update, erratum 44. | 60 | * and XORed with 0x10 on 16 bit accesses. See the spec update, erratum 44. |
61 | */ | 61 | */ |
62 | static int erratum44_workaround = 0; | 62 | static int erratum44_workaround = 0; |
@@ -90,7 +90,7 @@ static void ixp2000_flash_copy_from(struct map_info *map, void *to, | |||
90 | unsigned long from, ssize_t len) | 90 | unsigned long from, ssize_t len) |
91 | { | 91 | { |
92 | from = flash_bank_setup(map, from); | 92 | from = flash_bank_setup(map, from); |
93 | while(len--) | 93 | while(len--) |
94 | *(__u8 *) to++ = *(__u8 *)(map->map_priv_1 + from++); | 94 | *(__u8 *) to++ = *(__u8 *)(map->map_priv_1 + from++); |
95 | } | 95 | } |
96 | 96 | ||
@@ -148,11 +148,11 @@ static int ixp2000_flash_probe(struct device *_dev) | |||
148 | static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; | 148 | static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; |
149 | struct platform_device *dev = to_platform_device(_dev); | 149 | struct platform_device *dev = to_platform_device(_dev); |
150 | struct ixp2000_flash_data *ixp_data = dev->dev.platform_data; | 150 | struct ixp2000_flash_data *ixp_data = dev->dev.platform_data; |
151 | struct flash_platform_data *plat; | 151 | struct flash_platform_data *plat; |
152 | struct ixp2000_flash_info *info; | 152 | struct ixp2000_flash_info *info; |
153 | unsigned long window_size; | 153 | unsigned long window_size; |
154 | int err = -1; | 154 | int err = -1; |
155 | 155 | ||
156 | if (!ixp_data) | 156 | if (!ixp_data) |
157 | return -ENODEV; | 157 | return -ENODEV; |
158 | 158 | ||
@@ -161,7 +161,7 @@ static int ixp2000_flash_probe(struct device *_dev) | |||
161 | return -ENODEV; | 161 | return -ENODEV; |
162 | 162 | ||
163 | window_size = dev->resource->end - dev->resource->start + 1; | 163 | window_size = dev->resource->end - dev->resource->start + 1; |
164 | dev_info(_dev, "Probe of IXP2000 flash(%d banks x %dMiB)\n", | 164 | dev_info(_dev, "Probe of IXP2000 flash(%d banks x %dMiB)\n", |
165 | ixp_data->nr_banks, ((u32)window_size >> 20)); | 165 | ixp_data->nr_banks, ((u32)window_size >> 20)); |
166 | 166 | ||
167 | if (plat->width != 1) { | 167 | if (plat->width != 1) { |
@@ -174,7 +174,7 @@ static int ixp2000_flash_probe(struct device *_dev) | |||
174 | if(!info) { | 174 | if(!info) { |
175 | err = -ENOMEM; | 175 | err = -ENOMEM; |
176 | goto Error; | 176 | goto Error; |
177 | } | 177 | } |
178 | memzero(info, sizeof(struct ixp2000_flash_info)); | 178 | memzero(info, sizeof(struct ixp2000_flash_info)); |
179 | 179 | ||
180 | dev_set_drvdata(&dev->dev, info); | 180 | dev_set_drvdata(&dev->dev, info); |
@@ -184,7 +184,7 @@ static int ixp2000_flash_probe(struct device *_dev) | |||
184 | * not attempt to do a direct access on us. | 184 | * not attempt to do a direct access on us. |
185 | */ | 185 | */ |
186 | info->map.phys = NO_XIP; | 186 | info->map.phys = NO_XIP; |
187 | 187 | ||
188 | info->nr_banks = ixp_data->nr_banks; | 188 | info->nr_banks = ixp_data->nr_banks; |
189 | info->map.size = ixp_data->nr_banks * window_size; | 189 | info->map.size = ixp_data->nr_banks * window_size; |
190 | info->map.bankwidth = 1; | 190 | info->map.bankwidth = 1; |
@@ -192,7 +192,7 @@ static int ixp2000_flash_probe(struct device *_dev) | |||
192 | /* | 192 | /* |
193 | * map_priv_2 is used to store a ptr to to the bank_setup routine | 193 | * map_priv_2 is used to store a ptr to to the bank_setup routine |
194 | */ | 194 | */ |
195 | info->map.map_priv_2 = (void __iomem *) ixp_data->bank_setup; | 195 | info->map.map_priv_2 = (unsigned long) ixp_data->bank_setup; |
196 | 196 | ||
197 | info->map.name = dev->dev.bus_id; | 197 | info->map.name = dev->dev.bus_id; |
198 | info->map.read = ixp2000_flash_read8; | 198 | info->map.read = ixp2000_flash_read8; |
@@ -200,8 +200,8 @@ static int ixp2000_flash_probe(struct device *_dev) | |||
200 | info->map.copy_from = ixp2000_flash_copy_from; | 200 | info->map.copy_from = ixp2000_flash_copy_from; |
201 | info->map.copy_to = ixp2000_flash_copy_to; | 201 | info->map.copy_to = ixp2000_flash_copy_to; |
202 | 202 | ||
203 | info->res = request_mem_region(dev->resource->start, | 203 | info->res = request_mem_region(dev->resource->start, |
204 | dev->resource->end - dev->resource->start + 1, | 204 | dev->resource->end - dev->resource->start + 1, |
205 | dev->dev.bus_id); | 205 | dev->dev.bus_id); |
206 | if (!info->res) { | 206 | if (!info->res) { |
207 | dev_err(_dev, "Could not reserve memory region\n"); | 207 | dev_err(_dev, "Could not reserve memory region\n"); |
@@ -209,7 +209,7 @@ static int ixp2000_flash_probe(struct device *_dev) | |||
209 | goto Error; | 209 | goto Error; |
210 | } | 210 | } |
211 | 211 | ||
212 | info->map.map_priv_1 = ioremap(dev->resource->start, | 212 | info->map.map_priv_1 = (unsigned long) ioremap(dev->resource->start, |
213 | dev->resource->end - dev->resource->start + 1); | 213 | dev->resource->end - dev->resource->start + 1); |
214 | if (!info->map.map_priv_1) { | 214 | if (!info->map.map_priv_1) { |
215 | dev_err(_dev, "Failed to ioremap flash region\n"); | 215 | dev_err(_dev, "Failed to ioremap flash region\n"); |