diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2008-10-16 11:17:05 -0400 |
---|---|---|
committer | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2008-10-29 14:08:37 -0400 |
commit | 6af7a8eb1eb2b5a0967fccf61e750b085d60ad48 (patch) | |
tree | 05b7d4d994bf5582c037a39c0df152c5a651d858 /drivers/mtd/nand/sharpsl.c | |
parent | a20c7ab570ffdce1d6f67c7acf8c1c502a3b3839 (diff) |
[MTD] sharpsl-nand: move registration to board code
Finally move registration of sharpsl-nand device to board-specific code.
sharpsl nand driver is now clean and simple.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Diffstat (limited to 'drivers/mtd/nand/sharpsl.c')
-rw-r--r-- | drivers/mtd/nand/sharpsl.c | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/drivers/mtd/nand/sharpsl.c b/drivers/mtd/nand/sharpsl.c index 698378ca8e0a..54ec7542a7b7 100644 --- a/drivers/mtd/nand/sharpsl.c +++ b/drivers/mtd/nand/sharpsl.c | |||
@@ -247,93 +247,8 @@ static struct platform_driver sharpsl_nand_driver = { | |||
247 | .remove = __devexit_p(sharpsl_nand_remove), | 247 | .remove = __devexit_p(sharpsl_nand_remove), |
248 | }; | 248 | }; |
249 | 249 | ||
250 | /* | ||
251 | * Define partitions for flash device | ||
252 | */ | ||
253 | static struct mtd_partition sharpsl_nand_partitions[] = { | ||
254 | { | ||
255 | .name = "System Area", | ||
256 | .offset = 0, | ||
257 | .size = 7 * 1024 * 1024, | ||
258 | }, | ||
259 | { | ||
260 | .name = "Root Filesystem", | ||
261 | .offset = 7 * 1024 * 1024, | ||
262 | .size = 30 * 1024 * 1024, | ||
263 | }, | ||
264 | { | ||
265 | .name = "Home Filesystem", | ||
266 | .offset = MTDPART_OFS_APPEND, | ||
267 | .size = MTDPART_SIZ_FULL, | ||
268 | }, | ||
269 | }; | ||
270 | |||
271 | static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; | ||
272 | |||
273 | static struct nand_bbt_descr sharpsl_bbt = { | ||
274 | .options = 0, | ||
275 | .offs = 4, | ||
276 | .len = 2, | ||
277 | .pattern = scan_ff_pattern | ||
278 | }; | ||
279 | |||
280 | static struct nand_bbt_descr sharpsl_akita_bbt = { | ||
281 | .options = 0, | ||
282 | .offs = 4, | ||
283 | .len = 1, | ||
284 | .pattern = scan_ff_pattern | ||
285 | }; | ||
286 | |||
287 | static struct nand_ecclayout akita_oobinfo = { | ||
288 | .eccbytes = 24, | ||
289 | .eccpos = { | ||
290 | 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11, | ||
291 | 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23, | ||
292 | 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37}, | ||
293 | .oobfree = {{0x08, 0x09}} | ||
294 | }; | ||
295 | |||
296 | static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { | ||
297 | .badblock_pattern = &sharpsl_bbt, | ||
298 | .partitions = sharpsl_nand_partitions, | ||
299 | .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), | ||
300 | }; | ||
301 | |||
302 | static struct resource sharpsl_nand_resources[] = { | ||
303 | { | ||
304 | .start = 0x0C000000, | ||
305 | .end = 0x0C000FFF, | ||
306 | .flags = IORESOURCE_MEM, | ||
307 | }, | ||
308 | }; | ||
309 | |||
310 | static struct platform_device sharpsl_nand_device = { | ||
311 | .name = "sharpsl-nand", | ||
312 | .id = -1, | ||
313 | .resource = sharpsl_nand_resources, | ||
314 | .num_resources = ARRAY_SIZE(sharpsl_nand_resources), | ||
315 | .dev.platform_data = &sharpsl_nand_platform_data, | ||
316 | }; | ||
317 | |||
318 | static int __init sharpsl_nand_init(void) | 250 | static int __init sharpsl_nand_init(void) |
319 | { | 251 | { |
320 | if (machine_is_poodle()) { | ||
321 | sharpsl_nand_partitions[1].size = 22 * 1024 * 1024; | ||
322 | } else if (machine_is_corgi() || machine_is_shepherd()) { | ||
323 | sharpsl_nand_partitions[1].size = 25 * 1024 * 1024; | ||
324 | } else if (machine_is_husky()) { | ||
325 | sharpsl_nand_partitions[1].size = 53 * 1024 * 1024; | ||
326 | } else if (machine_is_spitz()) { | ||
327 | sharpsl_nand_partitions[1].size = 5 * 1024 * 1024; | ||
328 | } else if (machine_is_akita()) { | ||
329 | sharpsl_nand_partitions[1].size = 58 * 1024 * 1024; | ||
330 | sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt; | ||
331 | sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo; | ||
332 | } else if (machine_is_borzoi()) { | ||
333 | sharpsl_nand_partitions[1].size = 32 * 1024 * 1024; | ||
334 | } | ||
335 | |||
336 | platform_device_register(&sharpsl_nand_device); | ||
337 | return platform_driver_register(&sharpsl_nand_driver); | 252 | return platform_driver_register(&sharpsl_nand_driver); |
338 | } | 253 | } |
339 | module_init(sharpsl_nand_init); | 254 | module_init(sharpsl_nand_init); |
@@ -341,7 +256,6 @@ module_init(sharpsl_nand_init); | |||
341 | static void __exit sharpsl_nand_exit(void) | 256 | static void __exit sharpsl_nand_exit(void) |
342 | { | 257 | { |
343 | platform_driver_unregister(&sharpsl_nand_driver); | 258 | platform_driver_unregister(&sharpsl_nand_driver); |
344 | platform_device_unregister(&sharpsl_nand_device); | ||
345 | } | 259 | } |
346 | module_exit(sharpsl_nand_exit); | 260 | module_exit(sharpsl_nand_exit); |
347 | 261 | ||