diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2011-05-29 09:49:22 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:01:57 -0400 |
commit | 1754aab9bb869c173aa03b57587256827250e488 (patch) | |
tree | fafa68ef3f589204534a5fb89d45dfa19addadfd | |
parent | 9eeff8243677b8bbfc17e8e606e965bb591a759d (diff) |
mtd: ATMEL, AVR32: inline nand partition table access
Currently atmel_nand driver used by AT91 and AVR32 calls a special callback
which return nand partition table and number of partitions. However in all
boards this callback returns just static data. So drop this callback and
make atmel_nand use partition table provided statically via platform_data.
Nicolas Ferre: I am in favor for a mainline inclusion through linux-mtd tree.
Hans-Christian Egtvedt: I'm fine by sending the changes for AVR32 through linux-mtd
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
23 files changed, 48 insertions, 145 deletions
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c index b0c796d42e49..a053e915c279 100644 --- a/arch/arm/mach-at91/board-afeb-9260v1.c +++ b/arch/arm/mach-at91/board-afeb-9260v1.c | |||
@@ -130,19 +130,14 @@ static struct mtd_partition __initdata afeb9260_nand_partition[] = { | |||
130 | }, | 130 | }, |
131 | }; | 131 | }; |
132 | 132 | ||
133 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
134 | { | ||
135 | *num_partitions = ARRAY_SIZE(afeb9260_nand_partition); | ||
136 | return afeb9260_nand_partition; | ||
137 | } | ||
138 | |||
139 | static struct atmel_nand_data __initdata afeb9260_nand_data = { | 133 | static struct atmel_nand_data __initdata afeb9260_nand_data = { |
140 | .ale = 21, | 134 | .ale = 21, |
141 | .cle = 22, | 135 | .cle = 22, |
142 | .rdy_pin = AT91_PIN_PC13, | 136 | .rdy_pin = AT91_PIN_PC13, |
143 | .enable_pin = AT91_PIN_PC14, | 137 | .enable_pin = AT91_PIN_PC14, |
144 | .partition_info = nand_partitions, | ||
145 | .bus_width_16 = 0, | 138 | .bus_width_16 = 0, |
139 | .parts = afeb9260_nand_partition, | ||
140 | .num_parts = ARRAY_SIZE(afeb9260_nand_partition), | ||
146 | }; | 141 | }; |
147 | 142 | ||
148 | 143 | ||
diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c index d1abd5898e85..46f8bab9c943 100644 --- a/arch/arm/mach-at91/board-cam60.c +++ b/arch/arm/mach-at91/board-cam60.c | |||
@@ -132,19 +132,14 @@ static struct mtd_partition __initdata cam60_nand_partition[] = { | |||
132 | }, | 132 | }, |
133 | }; | 133 | }; |
134 | 134 | ||
135 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
136 | { | ||
137 | *num_partitions = ARRAY_SIZE(cam60_nand_partition); | ||
138 | return cam60_nand_partition; | ||
139 | } | ||
140 | |||
141 | static struct atmel_nand_data __initdata cam60_nand_data = { | 135 | static struct atmel_nand_data __initdata cam60_nand_data = { |
142 | .ale = 21, | 136 | .ale = 21, |
143 | .cle = 22, | 137 | .cle = 22, |
144 | // .det_pin = ... not there | 138 | // .det_pin = ... not there |
145 | .rdy_pin = AT91_PIN_PA9, | 139 | .rdy_pin = AT91_PIN_PA9, |
146 | .enable_pin = AT91_PIN_PA7, | 140 | .enable_pin = AT91_PIN_PA7, |
147 | .partition_info = nand_partitions, | 141 | .parts = cam60_nand_partition, |
142 | .num_parts = ARRAY_SIZE(cam60_nand_partition), | ||
148 | }; | 143 | }; |
149 | 144 | ||
150 | static struct sam9_smc_config __initdata cam60_nand_smc_config = { | 145 | static struct sam9_smc_config __initdata cam60_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c index 679b0b743e92..858927e2aff5 100644 --- a/arch/arm/mach-at91/board-cap9adk.c +++ b/arch/arm/mach-at91/board-cap9adk.c | |||
@@ -169,19 +169,14 @@ static struct mtd_partition __initdata cap9adk_nand_partitions[] = { | |||
169 | }, | 169 | }, |
170 | }; | 170 | }; |
171 | 171 | ||
172 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
173 | { | ||
174 | *num_partitions = ARRAY_SIZE(cap9adk_nand_partitions); | ||
175 | return cap9adk_nand_partitions; | ||
176 | } | ||
177 | |||
178 | static struct atmel_nand_data __initdata cap9adk_nand_data = { | 172 | static struct atmel_nand_data __initdata cap9adk_nand_data = { |
179 | .ale = 21, | 173 | .ale = 21, |
180 | .cle = 22, | 174 | .cle = 22, |
181 | // .det_pin = ... not connected | 175 | // .det_pin = ... not connected |
182 | // .rdy_pin = ... not connected | 176 | // .rdy_pin = ... not connected |
183 | .enable_pin = AT91_PIN_PD15, | 177 | .enable_pin = AT91_PIN_PD15, |
184 | .partition_info = nand_partitions, | 178 | .parts = cap9adk_nand_partitions, |
179 | .num_parts = ARRAY_SIZE(cap9adk_nand_partitions), | ||
185 | }; | 180 | }; |
186 | 181 | ||
187 | static struct sam9_smc_config __initdata cap9adk_nand_smc_config = { | 182 | static struct sam9_smc_config __initdata cap9adk_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c index 9dc8d496ead1..94372441c1aa 100644 --- a/arch/arm/mach-at91/board-kb9202.c +++ b/arch/arm/mach-at91/board-kb9202.c | |||
@@ -97,19 +97,14 @@ static struct mtd_partition __initdata kb9202_nand_partition[] = { | |||
97 | }, | 97 | }, |
98 | }; | 98 | }; |
99 | 99 | ||
100 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
101 | { | ||
102 | *num_partitions = ARRAY_SIZE(kb9202_nand_partition); | ||
103 | return kb9202_nand_partition; | ||
104 | } | ||
105 | |||
106 | static struct atmel_nand_data __initdata kb9202_nand_data = { | 100 | static struct atmel_nand_data __initdata kb9202_nand_data = { |
107 | .ale = 22, | 101 | .ale = 22, |
108 | .cle = 21, | 102 | .cle = 21, |
109 | // .det_pin = ... not there | 103 | // .det_pin = ... not there |
110 | .rdy_pin = AT91_PIN_PC29, | 104 | .rdy_pin = AT91_PIN_PC29, |
111 | .enable_pin = AT91_PIN_PC28, | 105 | .enable_pin = AT91_PIN_PC28, |
112 | .partition_info = nand_partitions, | 106 | .parts = kb9202_nand_partition, |
107 | .num_parts = ARRAY_SIZE(kb9202_nand_partition), | ||
113 | }; | 108 | }; |
114 | 109 | ||
115 | static void __init kb9202_board_init(void) | 110 | static void __init kb9202_board_init(void) |
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c index 9bc6ab32e0ac..60f0cee074dc 100644 --- a/arch/arm/mach-at91/board-neocore926.c +++ b/arch/arm/mach-at91/board-neocore926.c | |||
@@ -182,19 +182,14 @@ static struct mtd_partition __initdata neocore926_nand_partition[] = { | |||
182 | }, | 182 | }, |
183 | }; | 183 | }; |
184 | 184 | ||
185 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
186 | { | ||
187 | *num_partitions = ARRAY_SIZE(neocore926_nand_partition); | ||
188 | return neocore926_nand_partition; | ||
189 | } | ||
190 | |||
191 | static struct atmel_nand_data __initdata neocore926_nand_data = { | 185 | static struct atmel_nand_data __initdata neocore926_nand_data = { |
192 | .ale = 21, | 186 | .ale = 21, |
193 | .cle = 22, | 187 | .cle = 22, |
194 | .rdy_pin = AT91_PIN_PB19, | 188 | .rdy_pin = AT91_PIN_PB19, |
195 | .rdy_pin_active_low = 1, | 189 | .rdy_pin_active_low = 1, |
196 | .enable_pin = AT91_PIN_PD15, | 190 | .enable_pin = AT91_PIN_PD15, |
197 | .partition_info = nand_partitions, | 191 | .parts = neocore926_nand_partition, |
192 | .num_parts = ARRAY_SIZE(neocore926_nand_partition), | ||
198 | }; | 193 | }; |
199 | 194 | ||
200 | static struct sam9_smc_config __initdata neocore926_nand_smc_config = { | 195 | static struct sam9_smc_config __initdata neocore926_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-qil-a9260.c b/arch/arm/mach-at91/board-qil-a9260.c index 81f911033681..78d71e45d744 100644 --- a/arch/arm/mach-at91/board-qil-a9260.c +++ b/arch/arm/mach-at91/board-qil-a9260.c | |||
@@ -130,19 +130,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = { | |||
130 | }, | 130 | }, |
131 | }; | 131 | }; |
132 | 132 | ||
133 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
134 | { | ||
135 | *num_partitions = ARRAY_SIZE(ek_nand_partition); | ||
136 | return ek_nand_partition; | ||
137 | } | ||
138 | |||
139 | static struct atmel_nand_data __initdata ek_nand_data = { | 133 | static struct atmel_nand_data __initdata ek_nand_data = { |
140 | .ale = 21, | 134 | .ale = 21, |
141 | .cle = 22, | 135 | .cle = 22, |
142 | // .det_pin = ... not connected | 136 | // .det_pin = ... not connected |
143 | .rdy_pin = AT91_PIN_PC13, | 137 | .rdy_pin = AT91_PIN_PC13, |
144 | .enable_pin = AT91_PIN_PC14, | 138 | .enable_pin = AT91_PIN_PC14, |
145 | .partition_info = nand_partitions, | 139 | .parts = ek_nand_partition, |
140 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
146 | }; | 141 | }; |
147 | 142 | ||
148 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 143 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-rm9200dk.c b/arch/arm/mach-at91/board-rm9200dk.c index 6f08faadb474..b5f2faf479f6 100644 --- a/arch/arm/mach-at91/board-rm9200dk.c +++ b/arch/arm/mach-at91/board-rm9200dk.c | |||
@@ -138,19 +138,14 @@ static struct mtd_partition __initdata dk_nand_partition[] = { | |||
138 | }, | 138 | }, |
139 | }; | 139 | }; |
140 | 140 | ||
141 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
142 | { | ||
143 | *num_partitions = ARRAY_SIZE(dk_nand_partition); | ||
144 | return dk_nand_partition; | ||
145 | } | ||
146 | |||
147 | static struct atmel_nand_data __initdata dk_nand_data = { | 141 | static struct atmel_nand_data __initdata dk_nand_data = { |
148 | .ale = 22, | 142 | .ale = 22, |
149 | .cle = 21, | 143 | .cle = 21, |
150 | .det_pin = AT91_PIN_PB1, | 144 | .det_pin = AT91_PIN_PB1, |
151 | .rdy_pin = AT91_PIN_PC2, | 145 | .rdy_pin = AT91_PIN_PC2, |
152 | // .enable_pin = ... not there | 146 | // .enable_pin = ... not there |
153 | .partition_info = nand_partitions, | 147 | .parts = dk_nand_partition, |
148 | .num_parts = ARRAY_SIZE(dk_nand_partition), | ||
154 | }; | 149 | }; |
155 | 150 | ||
156 | #define DK_FLASH_BASE AT91_CHIPSELECT_0 | 151 | #define DK_FLASH_BASE AT91_CHIPSELECT_0 |
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c index 4d3a02f1289e..4128f6d8e902 100644 --- a/arch/arm/mach-at91/board-sam9-l9260.c +++ b/arch/arm/mach-at91/board-sam9-l9260.c | |||
@@ -131,19 +131,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = { | |||
131 | }, | 131 | }, |
132 | }; | 132 | }; |
133 | 133 | ||
134 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
135 | { | ||
136 | *num_partitions = ARRAY_SIZE(ek_nand_partition); | ||
137 | return ek_nand_partition; | ||
138 | } | ||
139 | |||
140 | static struct atmel_nand_data __initdata ek_nand_data = { | 134 | static struct atmel_nand_data __initdata ek_nand_data = { |
141 | .ale = 21, | 135 | .ale = 21, |
142 | .cle = 22, | 136 | .cle = 22, |
143 | // .det_pin = ... not connected | 137 | // .det_pin = ... not connected |
144 | .rdy_pin = AT91_PIN_PC13, | 138 | .rdy_pin = AT91_PIN_PC13, |
145 | .enable_pin = AT91_PIN_PC14, | 139 | .enable_pin = AT91_PIN_PC14, |
146 | .partition_info = nand_partitions, | 140 | .parts = ek_nand_partition, |
141 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
147 | }; | 142 | }; |
148 | 143 | ||
149 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 144 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c index 8a50c3e67186..2cf7ce25a33e 100644 --- a/arch/arm/mach-at91/board-sam9260ek.c +++ b/arch/arm/mach-at91/board-sam9260ek.c | |||
@@ -173,19 +173,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = { | |||
173 | }, | 173 | }, |
174 | }; | 174 | }; |
175 | 175 | ||
176 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
177 | { | ||
178 | *num_partitions = ARRAY_SIZE(ek_nand_partition); | ||
179 | return ek_nand_partition; | ||
180 | } | ||
181 | |||
182 | static struct atmel_nand_data __initdata ek_nand_data = { | 176 | static struct atmel_nand_data __initdata ek_nand_data = { |
183 | .ale = 21, | 177 | .ale = 21, |
184 | .cle = 22, | 178 | .cle = 22, |
185 | // .det_pin = ... not connected | 179 | // .det_pin = ... not connected |
186 | .rdy_pin = AT91_PIN_PC13, | 180 | .rdy_pin = AT91_PIN_PC13, |
187 | .enable_pin = AT91_PIN_PC14, | 181 | .enable_pin = AT91_PIN_PC14, |
188 | .partition_info = nand_partitions, | 182 | .parts = ek_nand_partition, |
183 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
189 | }; | 184 | }; |
190 | 185 | ||
191 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 186 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index 5096a0ec50c1..b7f35d0e9e54 100644 --- a/arch/arm/mach-at91/board-sam9261ek.c +++ b/arch/arm/mach-at91/board-sam9261ek.c | |||
@@ -179,19 +179,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = { | |||
179 | }, | 179 | }, |
180 | }; | 180 | }; |
181 | 181 | ||
182 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
183 | { | ||
184 | *num_partitions = ARRAY_SIZE(ek_nand_partition); | ||
185 | return ek_nand_partition; | ||
186 | } | ||
187 | |||
188 | static struct atmel_nand_data __initdata ek_nand_data = { | 182 | static struct atmel_nand_data __initdata ek_nand_data = { |
189 | .ale = 22, | 183 | .ale = 22, |
190 | .cle = 21, | 184 | .cle = 21, |
191 | // .det_pin = ... not connected | 185 | // .det_pin = ... not connected |
192 | .rdy_pin = AT91_PIN_PC15, | 186 | .rdy_pin = AT91_PIN_PC15, |
193 | .enable_pin = AT91_PIN_PC14, | 187 | .enable_pin = AT91_PIN_PC14, |
194 | .partition_info = nand_partitions, | 188 | .parts = ek_nand_partition, |
189 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
195 | }; | 190 | }; |
196 | 191 | ||
197 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 192 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index ea8f185d3b9d..5d2bd12b41a8 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -180,19 +180,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = { | |||
180 | }, | 180 | }, |
181 | }; | 181 | }; |
182 | 182 | ||
183 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
184 | { | ||
185 | *num_partitions = ARRAY_SIZE(ek_nand_partition); | ||
186 | return ek_nand_partition; | ||
187 | } | ||
188 | |||
189 | static struct atmel_nand_data __initdata ek_nand_data = { | 183 | static struct atmel_nand_data __initdata ek_nand_data = { |
190 | .ale = 21, | 184 | .ale = 21, |
191 | .cle = 22, | 185 | .cle = 22, |
192 | // .det_pin = ... not connected | 186 | // .det_pin = ... not connected |
193 | .rdy_pin = AT91_PIN_PA22, | 187 | .rdy_pin = AT91_PIN_PA22, |
194 | .enable_pin = AT91_PIN_PD15, | 188 | .enable_pin = AT91_PIN_PD15, |
195 | .partition_info = nand_partitions, | 189 | .parts = ek_nand_partition, |
190 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
196 | }; | 191 | }; |
197 | 192 | ||
198 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 193 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c index 817f59d7251b..003122772e63 100644 --- a/arch/arm/mach-at91/board-sam9g20ek.c +++ b/arch/arm/mach-at91/board-sam9g20ek.c | |||
@@ -157,19 +157,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = { | |||
157 | }, | 157 | }, |
158 | }; | 158 | }; |
159 | 159 | ||
160 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
161 | { | ||
162 | *num_partitions = ARRAY_SIZE(ek_nand_partition); | ||
163 | return ek_nand_partition; | ||
164 | } | ||
165 | |||
166 | /* det_pin is not connected */ | 160 | /* det_pin is not connected */ |
167 | static struct atmel_nand_data __initdata ek_nand_data = { | 161 | static struct atmel_nand_data __initdata ek_nand_data = { |
168 | .ale = 21, | 162 | .ale = 21, |
169 | .cle = 22, | 163 | .cle = 22, |
170 | .rdy_pin = AT91_PIN_PC13, | 164 | .rdy_pin = AT91_PIN_PC13, |
171 | .enable_pin = AT91_PIN_PC14, | 165 | .enable_pin = AT91_PIN_PC14, |
172 | .partition_info = nand_partitions, | 166 | .parts = ek_nand_partition, |
167 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
173 | }; | 168 | }; |
174 | 169 | ||
175 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 170 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c index ad234ccbf57e..00d041ca8dbe 100644 --- a/arch/arm/mach-at91/board-sam9m10g45ek.c +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c | |||
@@ -137,19 +137,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = { | |||
137 | }, | 137 | }, |
138 | }; | 138 | }; |
139 | 139 | ||
140 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
141 | { | ||
142 | *num_partitions = ARRAY_SIZE(ek_nand_partition); | ||
143 | return ek_nand_partition; | ||
144 | } | ||
145 | |||
146 | /* det_pin is not connected */ | 140 | /* det_pin is not connected */ |
147 | static struct atmel_nand_data __initdata ek_nand_data = { | 141 | static struct atmel_nand_data __initdata ek_nand_data = { |
148 | .ale = 21, | 142 | .ale = 21, |
149 | .cle = 22, | 143 | .cle = 22, |
150 | .rdy_pin = AT91_PIN_PC8, | 144 | .rdy_pin = AT91_PIN_PC8, |
151 | .enable_pin = AT91_PIN_PC14, | 145 | .enable_pin = AT91_PIN_PC14, |
152 | .partition_info = nand_partitions, | 146 | .parts = ek_nand_partition, |
147 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
153 | }; | 148 | }; |
154 | 149 | ||
155 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 150 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c index 4f14b54b93a8..6178b4e7f1aa 100644 --- a/arch/arm/mach-at91/board-sam9rlek.c +++ b/arch/arm/mach-at91/board-sam9rlek.c | |||
@@ -88,19 +88,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = { | |||
88 | }, | 88 | }, |
89 | }; | 89 | }; |
90 | 90 | ||
91 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
92 | { | ||
93 | *num_partitions = ARRAY_SIZE(ek_nand_partition); | ||
94 | return ek_nand_partition; | ||
95 | } | ||
96 | |||
97 | static struct atmel_nand_data __initdata ek_nand_data = { | 91 | static struct atmel_nand_data __initdata ek_nand_data = { |
98 | .ale = 21, | 92 | .ale = 21, |
99 | .cle = 22, | 93 | .cle = 22, |
100 | // .det_pin = ... not connected | 94 | // .det_pin = ... not connected |
101 | .rdy_pin = AT91_PIN_PD17, | 95 | .rdy_pin = AT91_PIN_PD17, |
102 | .enable_pin = AT91_PIN_PB6, | 96 | .enable_pin = AT91_PIN_PB6, |
103 | .partition_info = nand_partitions, | 97 | .parts = ek_nand_partition, |
98 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
104 | }; | 99 | }; |
105 | 100 | ||
106 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 101 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c index c73d25e5faea..0df01c6e2d0c 100644 --- a/arch/arm/mach-at91/board-snapper9260.c +++ b/arch/arm/mach-at91/board-snapper9260.c | |||
@@ -97,18 +97,12 @@ static struct mtd_partition __initdata snapper9260_nand_partitions[] = { | |||
97 | }, | 97 | }, |
98 | }; | 98 | }; |
99 | 99 | ||
100 | static struct mtd_partition * __init | ||
101 | snapper9260_nand_partition_info(int size, int *num_partitions) | ||
102 | { | ||
103 | *num_partitions = ARRAY_SIZE(snapper9260_nand_partitions); | ||
104 | return snapper9260_nand_partitions; | ||
105 | } | ||
106 | |||
107 | static struct atmel_nand_data __initdata snapper9260_nand_data = { | 100 | static struct atmel_nand_data __initdata snapper9260_nand_data = { |
108 | .ale = 21, | 101 | .ale = 21, |
109 | .cle = 22, | 102 | .cle = 22, |
110 | .rdy_pin = AT91_PIN_PC13, | 103 | .rdy_pin = AT91_PIN_PC13, |
111 | .partition_info = snapper9260_nand_partition_info, | 104 | .parts = snapper9260_nand_partitions, |
105 | .num_parts = ARRAY_SIZE(snapper9260_nand_partitions), | ||
112 | .bus_width_16 = 0, | 106 | .bus_width_16 = 0, |
113 | }; | 107 | }; |
114 | 108 | ||
diff --git a/arch/arm/mach-at91/board-usb-a9260.c b/arch/arm/mach-at91/board-usb-a9260.c index 8c4c1a02c4be..73e572302a4a 100644 --- a/arch/arm/mach-at91/board-usb-a9260.c +++ b/arch/arm/mach-at91/board-usb-a9260.c | |||
@@ -104,19 +104,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = { | |||
104 | } | 104 | } |
105 | }; | 105 | }; |
106 | 106 | ||
107 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
108 | { | ||
109 | *num_partitions = ARRAY_SIZE(ek_nand_partition); | ||
110 | return ek_nand_partition; | ||
111 | } | ||
112 | |||
113 | static struct atmel_nand_data __initdata ek_nand_data = { | 107 | static struct atmel_nand_data __initdata ek_nand_data = { |
114 | .ale = 21, | 108 | .ale = 21, |
115 | .cle = 22, | 109 | .cle = 22, |
116 | // .det_pin = ... not connected | 110 | // .det_pin = ... not connected |
117 | .rdy_pin = AT91_PIN_PC13, | 111 | .rdy_pin = AT91_PIN_PC13, |
118 | .enable_pin = AT91_PIN_PC14, | 112 | .enable_pin = AT91_PIN_PC14, |
119 | .partition_info = nand_partitions, | 113 | .parts = ek_nand_partition, |
114 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
120 | }; | 115 | }; |
121 | 116 | ||
122 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 117 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-usb-a9263.c b/arch/arm/mach-at91/board-usb-a9263.c index 25e793782a4e..909fd9743950 100644 --- a/arch/arm/mach-at91/board-usb-a9263.c +++ b/arch/arm/mach-at91/board-usb-a9263.c | |||
@@ -117,19 +117,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = { | |||
117 | } | 117 | } |
118 | }; | 118 | }; |
119 | 119 | ||
120 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
121 | { | ||
122 | *num_partitions = ARRAY_SIZE(ek_nand_partition); | ||
123 | return ek_nand_partition; | ||
124 | } | ||
125 | |||
126 | static struct atmel_nand_data __initdata ek_nand_data = { | 120 | static struct atmel_nand_data __initdata ek_nand_data = { |
127 | .ale = 21, | 121 | .ale = 21, |
128 | .cle = 22, | 122 | .cle = 22, |
129 | // .det_pin = ... not connected | 123 | // .det_pin = ... not connected |
130 | .rdy_pin = AT91_PIN_PA22, | 124 | .rdy_pin = AT91_PIN_PA22, |
131 | .enable_pin = AT91_PIN_PD15, | 125 | .enable_pin = AT91_PIN_PD15, |
132 | .partition_info = nand_partitions, | 126 | .parts = ek_nand_partition, |
127 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
133 | }; | 128 | }; |
134 | 129 | ||
135 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 130 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c index 95edcbd2aec6..7511fb83865a 100644 --- a/arch/arm/mach-at91/board-yl-9200.c +++ b/arch/arm/mach-at91/board-yl-9200.c | |||
@@ -172,19 +172,14 @@ static struct mtd_partition __initdata yl9200_nand_partition[] = { | |||
172 | } | 172 | } |
173 | }; | 173 | }; |
174 | 174 | ||
175 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
176 | { | ||
177 | *num_partitions = ARRAY_SIZE(yl9200_nand_partition); | ||
178 | return yl9200_nand_partition; | ||
179 | } | ||
180 | |||
181 | static struct atmel_nand_data __initdata yl9200_nand_data = { | 175 | static struct atmel_nand_data __initdata yl9200_nand_data = { |
182 | .ale = 6, | 176 | .ale = 6, |
183 | .cle = 7, | 177 | .cle = 7, |
184 | // .det_pin = ... not connected | 178 | // .det_pin = ... not connected |
185 | .rdy_pin = AT91_PIN_PC14, /* R/!B (Sheet10) */ | 179 | .rdy_pin = AT91_PIN_PC14, /* R/!B (Sheet10) */ |
186 | .enable_pin = AT91_PIN_PC15, /* !CE (Sheet10) */ | 180 | .enable_pin = AT91_PIN_PC15, /* !CE (Sheet10) */ |
187 | .partition_info = nand_partitions, | 181 | .parts = yl9200_nand_partition, |
182 | .num_parts = ARRAY_SIZE(yl9200_nand_partition), | ||
188 | }; | 183 | }; |
189 | 184 | ||
190 | /* | 185 | /* |
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index ed544a0d5a1d..664353198bc0 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h | |||
@@ -112,7 +112,8 @@ struct atmel_nand_data { | |||
112 | u8 ale; /* address line number connected to ALE */ | 112 | u8 ale; /* address line number connected to ALE */ |
113 | u8 cle; /* address line number connected to CLE */ | 113 | u8 cle; /* address line number connected to CLE */ |
114 | u8 bus_width_16; /* buswidth is 16 bit */ | 114 | u8 bus_width_16; /* buswidth is 16 bit */ |
115 | struct mtd_partition* (*partition_info)(int, int*); | 115 | struct mtd_partition *parts; |
116 | unsigned int num_parts; | ||
116 | }; | 117 | }; |
117 | extern void __init at91_add_device_nand(struct atmel_nand_data *data); | 118 | extern void __init at91_add_device_nand(struct atmel_nand_data *data); |
118 | 119 | ||
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c index fafed4c38fd2..1f17bde52cd4 100644 --- a/arch/avr32/boards/atngw100/setup.c +++ b/arch/avr32/boards/atngw100/setup.c | |||
@@ -90,11 +90,6 @@ static struct mtd_partition nand_partitions[] = { | |||
90 | }, | 90 | }, |
91 | }; | 91 | }; |
92 | 92 | ||
93 | static struct mtd_partition *nand_part_info(int size, int *num_partitions) | ||
94 | { | ||
95 | *num_partitions = ARRAY_SIZE(nand_partitions); | ||
96 | return nand_partitions; | ||
97 | } | ||
98 | 93 | ||
99 | static struct atmel_nand_data atngw100mkii_nand_data __initdata = { | 94 | static struct atmel_nand_data atngw100mkii_nand_data __initdata = { |
100 | .cle = 21, | 95 | .cle = 21, |
@@ -102,7 +97,8 @@ static struct atmel_nand_data atngw100mkii_nand_data __initdata = { | |||
102 | .rdy_pin = GPIO_PIN_PB(28), | 97 | .rdy_pin = GPIO_PIN_PB(28), |
103 | .enable_pin = GPIO_PIN_PE(23), | 98 | .enable_pin = GPIO_PIN_PE(23), |
104 | .bus_width_16 = true, | 99 | .bus_width_16 = true, |
105 | .partition_info = nand_part_info, | 100 | .parts = nand_partitions, |
101 | .num_parts = ARRAY_SIZE(nand_partitions), | ||
106 | }; | 102 | }; |
107 | #endif | 103 | #endif |
108 | 104 | ||
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 6ce30fb2ec94..4643ff5107c9 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -90,18 +90,13 @@ static struct mtd_partition nand_partitions[] = { | |||
90 | }, | 90 | }, |
91 | }; | 91 | }; |
92 | 92 | ||
93 | static struct mtd_partition *nand_part_info(int size, int *num_partitions) | ||
94 | { | ||
95 | *num_partitions = ARRAY_SIZE(nand_partitions); | ||
96 | return nand_partitions; | ||
97 | } | ||
98 | |||
99 | static struct atmel_nand_data atstk1006_nand_data __initdata = { | 93 | static struct atmel_nand_data atstk1006_nand_data __initdata = { |
100 | .cle = 21, | 94 | .cle = 21, |
101 | .ale = 22, | 95 | .ale = 22, |
102 | .rdy_pin = GPIO_PIN_PB(30), | 96 | .rdy_pin = GPIO_PIN_PB(30), |
103 | .enable_pin = GPIO_PIN_PB(29), | 97 | .enable_pin = GPIO_PIN_PB(29), |
104 | .partition_info = nand_part_info, | 98 | .parts = nand_partitions, |
99 | .num_parts = ARRAY_SIZE(num_partitions), | ||
105 | }; | 100 | }; |
106 | #endif | 101 | #endif |
107 | 102 | ||
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h index 679458d9a622..5d7ffca7d69f 100644 --- a/arch/avr32/mach-at32ap/include/mach/board.h +++ b/arch/avr32/mach-at32ap/include/mach/board.h | |||
@@ -128,7 +128,8 @@ struct atmel_nand_data { | |||
128 | u8 ale; /* address line number connected to ALE */ | 128 | u8 ale; /* address line number connected to ALE */ |
129 | u8 cle; /* address line number connected to CLE */ | 129 | u8 cle; /* address line number connected to CLE */ |
130 | u8 bus_width_16; /* buswidth is 16 bit */ | 130 | u8 bus_width_16; /* buswidth is 16 bit */ |
131 | struct mtd_partition *(*partition_info)(int size, int *num_partitions); | 131 | struct mtd_partition *parts; |
132 | unsigned int num_parts; | ||
132 | }; | 133 | }; |
133 | struct platform_device * | 134 | struct platform_device * |
134 | at32_add_device_nand(unsigned int id, struct atmel_nand_data *data); | 135 | at32_add_device_nand(unsigned int id, struct atmel_nand_data *data); |
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 79a7ef276616..01fb5f0adcf0 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c | |||
@@ -660,9 +660,10 @@ static int __init atmel_nand_probe(struct platform_device *pdev) | |||
660 | num_partitions = parse_mtd_partitions(mtd, part_probes, | 660 | num_partitions = parse_mtd_partitions(mtd, part_probes, |
661 | &partitions, 0); | 661 | &partitions, 0); |
662 | #endif | 662 | #endif |
663 | if (num_partitions <= 0 && host->board->partition_info) | 663 | if (num_partitions <= 0 && host->board->parts) { |
664 | partitions = host->board->partition_info(mtd->size, | 664 | partitions = host->board->parts; |
665 | &num_partitions); | 665 | num_partitions = host->board->num_parts; |
666 | } | ||
666 | 667 | ||
667 | if ((!partitions) || (num_partitions == 0)) { | 668 | if ((!partitions) || (num_partitions == 0)) { |
668 | printk(KERN_ERR "atmel_nand: No partitions defined, or unsupported device.\n"); | 669 | printk(KERN_ERR "atmel_nand: No partitions defined, or unsupported device.\n"); |