diff options
Diffstat (limited to 'drivers/mtd/maps/sbc_gxx.c')
-rw-r--r-- | drivers/mtd/maps/sbc_gxx.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/mtd/maps/sbc_gxx.c b/drivers/mtd/maps/sbc_gxx.c index 65add28bde14..7cc4041d096d 100644 --- a/drivers/mtd/maps/sbc_gxx.c +++ b/drivers/mtd/maps/sbc_gxx.c | |||
@@ -1,35 +1,35 @@ | |||
1 | /* sbc_gxx.c -- MTD map driver for Arcom Control Systems SBC-MediaGX, | 1 | /* sbc_gxx.c -- MTD map driver for Arcom Control Systems SBC-MediaGX, |
2 | SBC-GXm and SBC-GX1 series boards. | 2 | SBC-GXm and SBC-GX1 series boards. |
3 | 3 | ||
4 | Copyright (C) 2001 Arcom Control System Ltd | 4 | Copyright (C) 2001 Arcom Control System Ltd |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
19 | 19 | ||
20 | $Id: sbc_gxx.c,v 1.33 2004/11/28 09:40:40 dwmw2 Exp $ | 20 | $Id: sbc_gxx.c,v 1.35 2005/11/07 11:14:28 gleixner Exp $ |
21 | 21 | ||
22 | The SBC-MediaGX / SBC-GXx has up to 16 MiB of | 22 | The SBC-MediaGX / SBC-GXx has up to 16 MiB of |
23 | Intel StrataFlash (28F320/28F640) in x8 mode. | 23 | Intel StrataFlash (28F320/28F640) in x8 mode. |
24 | 24 | ||
25 | This driver uses the CFI probe and Intel Extended Command Set drivers. | 25 | This driver uses the CFI probe and Intel Extended Command Set drivers. |
26 | 26 | ||
27 | The flash is accessed as follows: | 27 | The flash is accessed as follows: |
28 | 28 | ||
29 | 16 KiB memory window at 0xdc000-0xdffff | 29 | 16 KiB memory window at 0xdc000-0xdffff |
30 | 30 | ||
31 | Two IO address locations for paging | 31 | Two IO address locations for paging |
32 | 32 | ||
33 | 0x258 | 33 | 0x258 |
34 | bit 0-7: address bit 14-21 | 34 | bit 0-7: address bit 14-21 |
35 | 0x259 | 35 | 0x259 |
@@ -37,7 +37,7 @@ The flash is accessed as follows: | |||
37 | bit 7: 0 - reset/powered down | 37 | bit 7: 0 - reset/powered down |
38 | 1 - device enabled | 38 | 1 - device enabled |
39 | 39 | ||
40 | The single flash device is divided into 3 partition which appear as | 40 | The single flash device is divided into 3 partition which appear as |
41 | separate MTD devices. | 41 | separate MTD devices. |
42 | 42 | ||
43 | 25/04/2001 AJL (Arcom) Modified signon strings and partition sizes | 43 | 25/04/2001 AJL (Arcom) Modified signon strings and partition sizes |
@@ -87,17 +87,17 @@ static volatile int page_in_window = -1; // Current page in window. | |||
87 | static void __iomem *iomapadr; | 87 | static void __iomem *iomapadr; |
88 | static DEFINE_SPINLOCK(sbc_gxx_spin); | 88 | static DEFINE_SPINLOCK(sbc_gxx_spin); |
89 | 89 | ||
90 | /* partition_info gives details on the logical partitions that the split the | 90 | /* partition_info gives details on the logical partitions that the split the |
91 | * single flash device into. If the size if zero we use up to the end of the | 91 | * single flash device into. If the size if zero we use up to the end of the |
92 | * device. */ | 92 | * device. */ |
93 | static struct mtd_partition partition_info[]={ | 93 | static struct mtd_partition partition_info[]={ |
94 | { .name = "SBC-GXx flash boot partition", | 94 | { .name = "SBC-GXx flash boot partition", |
95 | .offset = 0, | 95 | .offset = 0, |
96 | .size = BOOT_PARTITION_SIZE_KiB*1024 }, | 96 | .size = BOOT_PARTITION_SIZE_KiB*1024 }, |
97 | { .name = "SBC-GXx flash data partition", | 97 | { .name = "SBC-GXx flash data partition", |
98 | .offset = BOOT_PARTITION_SIZE_KiB*1024, | 98 | .offset = BOOT_PARTITION_SIZE_KiB*1024, |
99 | .size = (DATA_PARTITION_SIZE_KiB)*1024 }, | 99 | .size = (DATA_PARTITION_SIZE_KiB)*1024 }, |
100 | { .name = "SBC-GXx flash application partition", | 100 | { .name = "SBC-GXx flash application partition", |
101 | .offset = (BOOT_PARTITION_SIZE_KiB+DATA_PARTITION_SIZE_KiB)*1024 } | 101 | .offset = (BOOT_PARTITION_SIZE_KiB+DATA_PARTITION_SIZE_KiB)*1024 } |
102 | }; | 102 | }; |
103 | 103 | ||
@@ -130,7 +130,7 @@ static void sbc_gxx_copy_from(struct map_info *map, void *to, unsigned long from | |||
130 | unsigned long thislen = len; | 130 | unsigned long thislen = len; |
131 | if (len > (WINDOW_LENGTH - (from & WINDOW_MASK))) | 131 | if (len > (WINDOW_LENGTH - (from & WINDOW_MASK))) |
132 | thislen = WINDOW_LENGTH-(from & WINDOW_MASK); | 132 | thislen = WINDOW_LENGTH-(from & WINDOW_MASK); |
133 | 133 | ||
134 | spin_lock(&sbc_gxx_spin); | 134 | spin_lock(&sbc_gxx_spin); |
135 | sbc_gxx_page(map, from); | 135 | sbc_gxx_page(map, from); |
136 | memcpy_fromio(to, iomapadr + (from & WINDOW_MASK), thislen); | 136 | memcpy_fromio(to, iomapadr + (from & WINDOW_MASK), thislen); |
@@ -150,12 +150,12 @@ static void sbc_gxx_write8(struct map_info *map, map_word d, unsigned long adr) | |||
150 | } | 150 | } |
151 | 151 | ||
152 | static void sbc_gxx_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len) | 152 | static void sbc_gxx_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len) |
153 | { | 153 | { |
154 | while(len) { | 154 | while(len) { |
155 | unsigned long thislen = len; | 155 | unsigned long thislen = len; |
156 | if (len > (WINDOW_LENGTH - (to & WINDOW_MASK))) | 156 | if (len > (WINDOW_LENGTH - (to & WINDOW_MASK))) |
157 | thislen = WINDOW_LENGTH-(to & WINDOW_MASK); | 157 | thislen = WINDOW_LENGTH-(to & WINDOW_MASK); |
158 | 158 | ||
159 | spin_lock(&sbc_gxx_spin); | 159 | spin_lock(&sbc_gxx_spin); |
160 | sbc_gxx_page(map, to); | 160 | sbc_gxx_page(map, to); |
161 | memcpy_toio(iomapadr + (to & WINDOW_MASK), from, thislen); | 161 | memcpy_toio(iomapadr + (to & WINDOW_MASK), from, thislen); |
@@ -201,7 +201,7 @@ static int __init init_sbc_gxx(void) | |||
201 | sbc_gxx_map.name ); | 201 | sbc_gxx_map.name ); |
202 | return -EIO; | 202 | return -EIO; |
203 | } | 203 | } |
204 | 204 | ||
205 | if (!request_region( PAGE_IO, PAGE_IO_SIZE, "SBC-GXx flash")) { | 205 | if (!request_region( PAGE_IO, PAGE_IO_SIZE, "SBC-GXx flash")) { |
206 | printk( KERN_ERR"%s: IO ports 0x%x-0x%x in use\n", | 206 | printk( KERN_ERR"%s: IO ports 0x%x-0x%x in use\n", |
207 | sbc_gxx_map.name, | 207 | sbc_gxx_map.name, |
@@ -209,8 +209,8 @@ static int __init init_sbc_gxx(void) | |||
209 | iounmap(iomapadr); | 209 | iounmap(iomapadr); |
210 | return -EAGAIN; | 210 | return -EAGAIN; |
211 | } | 211 | } |
212 | 212 | ||
213 | 213 | ||
214 | printk( KERN_INFO"%s: IO:0x%x-0x%x MEM:0x%x-0x%x\n", | 214 | printk( KERN_INFO"%s: IO:0x%x-0x%x MEM:0x%x-0x%x\n", |
215 | sbc_gxx_map.name, | 215 | sbc_gxx_map.name, |
216 | PAGE_IO, PAGE_IO+PAGE_IO_SIZE-1, | 216 | PAGE_IO, PAGE_IO+PAGE_IO_SIZE-1, |
@@ -222,7 +222,7 @@ static int __init init_sbc_gxx(void) | |||
222 | cleanup_sbc_gxx(); | 222 | cleanup_sbc_gxx(); |
223 | return -ENXIO; | 223 | return -ENXIO; |
224 | } | 224 | } |
225 | 225 | ||
226 | all_mtd->owner = THIS_MODULE; | 226 | all_mtd->owner = THIS_MODULE; |
227 | 227 | ||
228 | /* Create MTD devices for each partition. */ | 228 | /* Create MTD devices for each partition. */ |