impa7.c (1da177e4c3f41524e886b7f1b8a0c1fc7321cac2) impa7.c (69f34c98c1416eb74c55e38a21dbf3e294966514)
1/*
1/*
2 * $Id: impa7.c,v 1.13 2004/11/04 13:24:14 gleixner Exp $
2 * $Id: impa7.c,v 1.14 2005/11/07 11:14:27 gleixner Exp $
3 *
4 * Handle mapping of the NOR flash on implementa A7 boards
5 *
6 * Copyright 2002 SYSGO Real-Time Solutions GmbH
3 *
4 * Handle mapping of the NOR flash on implementa A7 boards
5 *
6 * Copyright 2002 SYSGO Real-Time Solutions GmbH
7 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/module.h>
14#include <linux/types.h>
15#include <linux/kernel.h>

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

50 .size = WINDOW_SIZE1,
51 .bankwidth = BUSWIDTH,
52 },
53};
54
55#ifdef CONFIG_MTD_PARTITIONS
56
57/*
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/module.h>
14#include <linux/types.h>
15#include <linux/kernel.h>

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

50 .size = WINDOW_SIZE1,
51 .bankwidth = BUSWIDTH,
52 },
53};
54
55#ifdef CONFIG_MTD_PARTITIONS
56
57/*
58 * MTD partitioning stuff
58 * MTD partitioning stuff
59 */
60static struct mtd_partition static_partitions[] =
61{
62 {
63 .name = "FileSystem",
64 .size = 0x800000,
65 .offset = 0x00000000
66 },

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

103 for(; !impa7_mtd[i] && *type; type++) {
104 impa7_mtd[i] = do_map_probe(*type, &impa7_map[i]);
105 }
106
107 if (impa7_mtd[i]) {
108 impa7_mtd[i]->owner = THIS_MODULE;
109 devicesfound++;
110#ifdef CONFIG_MTD_PARTITIONS
59 */
60static struct mtd_partition static_partitions[] =
61{
62 {
63 .name = "FileSystem",
64 .size = 0x800000,
65 .offset = 0x00000000
66 },

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

103 for(; !impa7_mtd[i] && *type; type++) {
104 impa7_mtd[i] = do_map_probe(*type, &impa7_map[i]);
105 }
106
107 if (impa7_mtd[i]) {
108 impa7_mtd[i]->owner = THIS_MODULE;
109 devicesfound++;
110#ifdef CONFIG_MTD_PARTITIONS
111 mtd_parts_nb[i] = parse_mtd_partitions(impa7_mtd[i],
111 mtd_parts_nb[i] = parse_mtd_partitions(impa7_mtd[i],
112 probes,
112 probes,
113 &mtd_parts[i],
113 &mtd_parts[i],
114 0);
115 if (mtd_parts_nb[i] > 0) {
116 part_type = "command line";
117 } else {
118 mtd_parts[i] = static_partitions;
119 mtd_parts_nb[i] = ARRAY_SIZE(static_partitions);
120 part_type = "static";
121 }
122
123 printk(KERN_NOTICE MSG_PREFIX
114 0);
115 if (mtd_parts_nb[i] > 0) {
116 part_type = "command line";
117 } else {
118 mtd_parts[i] = static_partitions;
119 mtd_parts_nb[i] = ARRAY_SIZE(static_partitions);
120 part_type = "static";
121 }
122
123 printk(KERN_NOTICE MSG_PREFIX
124 "using %s partition definition\n",
124 "using %s partition definition\n",
125 part_type);
125 part_type);
126 add_mtd_partitions(impa7_mtd[i],
126 add_mtd_partitions(impa7_mtd[i],
127 mtd_parts[i], mtd_parts_nb[i]);
128#else
129 add_mtd_device(impa7_mtd[i]);
130
131#endif
132 }
127 mtd_parts[i], mtd_parts_nb[i]);
128#else
129 add_mtd_device(impa7_mtd[i]);
130
131#endif
132 }
133 else
133 else
134 iounmap((void *)impa7_map[i].virt);
135 }
136 return devicesfound == 0 ? -ENXIO : 0;
137}
138
139static void __exit cleanup_impa7(void)
140{
141 int i;

--- 20 unchanged lines hidden ---
134 iounmap((void *)impa7_map[i].virt);
135 }
136 return devicesfound == 0 ? -ENXIO : 0;
137}
138
139static void __exit cleanup_impa7(void)
140{
141 int i;

--- 20 unchanged lines hidden ---