diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-04-13 12:34:03 -0400 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-05-25 11:04:32 -0400 |
commit | 76b2ab76a4492f8f43c511857181f8421901ce3f (patch) | |
tree | 3594dadd853458ae4651a93db4d78248232b5518 /arch | |
parent | 4a7df24ddc7097cd789a7527187826552ea0765e (diff) |
at91: remove MTD_NAND_ATMEL_BUSWIDTH_16 option
no board configure it as 'n' and it's an issue to merge all defconfigs
in one
On AT91SAM926x boards both types of NAND flash can be present
(8 and 16 bit data bus width).
so will pass it via system_rev
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-at91/Kconfig | 19 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-at572d940hf_ek.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-cap9adk.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9260ek.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9261ek.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9263ek.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9g20ek.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9m10g45ek.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/system_rev.h | 25 |
9 files changed, 39 insertions, 54 deletions
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 2d299bf5d72f..8cbc3aae6c64 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -3,9 +3,6 @@ if ARCH_AT91 | |||
3 | config HAVE_AT91_DATAFLASH_CARD | 3 | config HAVE_AT91_DATAFLASH_CARD |
4 | bool | 4 | bool |
5 | 5 | ||
6 | config HAVE_NAND_ATMEL_BUSWIDTH_16 | ||
7 | bool | ||
8 | |||
9 | config HAVE_AT91_USART3 | 6 | config HAVE_AT91_USART3 |
10 | bool | 7 | bool |
11 | 8 | ||
@@ -209,7 +206,6 @@ comment "AT91SAM9260 / AT91SAM9XE Board Type" | |||
209 | config MACH_AT91SAM9260EK | 206 | config MACH_AT91SAM9260EK |
210 | bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit" | 207 | bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit" |
211 | select HAVE_AT91_DATAFLASH_CARD | 208 | select HAVE_AT91_DATAFLASH_CARD |
212 | select HAVE_NAND_ATMEL_BUSWIDTH_16 | ||
213 | help | 209 | help |
214 | Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit | 210 | Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit |
215 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933> | 211 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933> |
@@ -270,7 +266,6 @@ comment "AT91SAM9261 Board Type" | |||
270 | config MACH_AT91SAM9261EK | 266 | config MACH_AT91SAM9261EK |
271 | bool "Atmel AT91SAM9261-EK Evaluation Kit" | 267 | bool "Atmel AT91SAM9261-EK Evaluation Kit" |
272 | select HAVE_AT91_DATAFLASH_CARD | 268 | select HAVE_AT91_DATAFLASH_CARD |
273 | select HAVE_NAND_ATMEL_BUSWIDTH_16 | ||
274 | help | 269 | help |
275 | Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit. | 270 | Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit. |
276 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820> | 271 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820> |
@@ -286,7 +281,6 @@ comment "AT91SAM9G10 Board Type" | |||
286 | config MACH_AT91SAM9G10EK | 281 | config MACH_AT91SAM9G10EK |
287 | bool "Atmel AT91SAM9G10-EK Evaluation Kit" | 282 | bool "Atmel AT91SAM9G10-EK Evaluation Kit" |
288 | select HAVE_AT91_DATAFLASH_CARD | 283 | select HAVE_AT91_DATAFLASH_CARD |
289 | select HAVE_NAND_ATMEL_BUSWIDTH_16 | ||
290 | help | 284 | help |
291 | Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit. | 285 | Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit. |
292 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588> | 286 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588> |
@@ -302,7 +296,6 @@ comment "AT91SAM9263 Board Type" | |||
302 | config MACH_AT91SAM9263EK | 296 | config MACH_AT91SAM9263EK |
303 | bool "Atmel AT91SAM9263-EK Evaluation Kit" | 297 | bool "Atmel AT91SAM9263-EK Evaluation Kit" |
304 | select HAVE_AT91_DATAFLASH_CARD | 298 | select HAVE_AT91_DATAFLASH_CARD |
305 | select HAVE_NAND_ATMEL_BUSWIDTH_16 | ||
306 | help | 299 | help |
307 | Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit. | 300 | Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit. |
308 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057> | 301 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057> |
@@ -343,7 +336,6 @@ comment "AT91SAM9G20 Board Type" | |||
343 | config MACH_AT91SAM9G20EK | 336 | config MACH_AT91SAM9G20EK |
344 | bool "Atmel AT91SAM9G20-EK Evaluation Kit" | 337 | bool "Atmel AT91SAM9G20-EK Evaluation Kit" |
345 | select HAVE_AT91_DATAFLASH_CARD | 338 | select HAVE_AT91_DATAFLASH_CARD |
346 | select HAVE_NAND_ATMEL_BUSWIDTH_16 | ||
347 | help | 339 | help |
348 | Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit | 340 | Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit |
349 | that embeds only one SD/MMC slot. | 341 | that embeds only one SD/MMC slot. |
@@ -351,7 +343,6 @@ config MACH_AT91SAM9G20EK | |||
351 | config MACH_AT91SAM9G20EK_2MMC | 343 | config MACH_AT91SAM9G20EK_2MMC |
352 | depends on MACH_AT91SAM9G20EK | 344 | depends on MACH_AT91SAM9G20EK |
353 | bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots" | 345 | bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots" |
354 | select HAVE_NAND_ATMEL_BUSWIDTH_16 | ||
355 | help | 346 | help |
356 | Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit | 347 | Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit |
357 | with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and | 348 | with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and |
@@ -416,7 +407,6 @@ comment "AT91SAM9G45 Board Type" | |||
416 | 407 | ||
417 | config MACH_AT91SAM9M10G45EK | 408 | config MACH_AT91SAM9M10G45EK |
418 | bool "Atmel AT91SAM9M10G45-EK Evaluation Kits" | 409 | bool "Atmel AT91SAM9M10G45-EK Evaluation Kits" |
419 | select HAVE_NAND_ATMEL_BUSWIDTH_16 | ||
420 | help | 410 | help |
421 | Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit. | 411 | Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit. |
422 | "ES" at the end of the name means that this board is an | 412 | "ES" at the end of the name means that this board is an |
@@ -433,7 +423,6 @@ comment "AT91CAP9 Board Type" | |||
433 | config MACH_AT91CAP9ADK | 423 | config MACH_AT91CAP9ADK |
434 | bool "Atmel AT91CAP9A-DK Evaluation Kit" | 424 | bool "Atmel AT91CAP9A-DK Evaluation Kit" |
435 | select HAVE_AT91_DATAFLASH_CARD | 425 | select HAVE_AT91_DATAFLASH_CARD |
436 | select HAVE_NAND_ATMEL_BUSWIDTH_16 | ||
437 | help | 426 | help |
438 | Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit. | 427 | Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit. |
439 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138> | 428 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138> |
@@ -450,7 +439,6 @@ config MACH_AT572D940HFEB | |||
450 | bool "AT572D940HF-EK" | 439 | bool "AT572D940HF-EK" |
451 | depends on ARCH_AT572D940HF | 440 | depends on ARCH_AT572D940HF |
452 | select HAVE_AT91_DATAFLASH_CARD | 441 | select HAVE_AT91_DATAFLASH_CARD |
453 | select HAVE_NAND_ATMEL_BUSWIDTH_16 | ||
454 | help | 442 | help |
455 | Select this if you are using Atmel's AT572D940HF-EK evaluation kit. | 443 | Select this if you are using Atmel's AT572D940HF-EK evaluation kit. |
456 | <http://www.atmel.com/products/diopsis/default.asp> | 444 | <http://www.atmel.com/products/diopsis/default.asp> |
@@ -483,13 +471,6 @@ config MTD_AT91_DATAFLASH_CARD | |||
483 | help | 471 | help |
484 | Enable support for the DataFlash card. | 472 | Enable support for the DataFlash card. |
485 | 473 | ||
486 | config MTD_NAND_ATMEL_BUSWIDTH_16 | ||
487 | bool "Enable 16-bit data bus interface to NAND flash" | ||
488 | depends on HAVE_NAND_ATMEL_BUSWIDTH_16 | ||
489 | help | ||
490 | On AT91SAM926x boards both types of NAND flash can be present | ||
491 | (8 and 16 bit data bus width). | ||
492 | |||
493 | # ---------------------------------------------------------- | 474 | # ---------------------------------------------------------- |
494 | 475 | ||
495 | comment "AT91 Feature Selections" | 476 | comment "AT91 Feature Selections" |
diff --git a/arch/arm/mach-at91/board-at572d940hf_ek.c b/arch/arm/mach-at91/board-at572d940hf_ek.c index 3929f1c9e4e5..096b99f4b1f3 100644 --- a/arch/arm/mach-at91/board-at572d940hf_ek.c +++ b/arch/arm/mach-at91/board-at572d940hf_ek.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <mach/board.h> | 41 | #include <mach/board.h> |
42 | #include <mach/gpio.h> | 42 | #include <mach/gpio.h> |
43 | #include <mach/at91sam9_smc.h> | 43 | #include <mach/at91sam9_smc.h> |
44 | #include <mach/system_rev.h> | ||
44 | 45 | ||
45 | #include "sam9_smc.h" | 46 | #include "sam9_smc.h" |
46 | #include "generic.h" | 47 | #include "generic.h" |
@@ -216,11 +217,6 @@ static struct atmel_nand_data __initdata eb_nand_data = { | |||
216 | /* .rdy_pin = AT91_PIN_PC16, */ | 217 | /* .rdy_pin = AT91_PIN_PC16, */ |
217 | .enable_pin = AT91_PIN_PA15, | 218 | .enable_pin = AT91_PIN_PA15, |
218 | .partition_info = nand_partitions, | 219 | .partition_info = nand_partitions, |
219 | #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) | ||
220 | .bus_width_16 = 1, | ||
221 | #else | ||
222 | .bus_width_16 = 0, | ||
223 | #endif | ||
224 | }; | 220 | }; |
225 | 221 | ||
226 | static struct sam9_smc_config __initdata eb_nand_smc_config = { | 222 | static struct sam9_smc_config __initdata eb_nand_smc_config = { |
@@ -243,6 +239,7 @@ static struct sam9_smc_config __initdata eb_nand_smc_config = { | |||
243 | 239 | ||
244 | static void __init eb_add_device_nand(void) | 240 | static void __init eb_add_device_nand(void) |
245 | { | 241 | { |
242 | ek_nand_data.bus_width_16 = !board_have_nand_8bit(); | ||
246 | /* setup bus-width (8 or 16) */ | 243 | /* setup bus-width (8 or 16) */ |
247 | if (eb_nand_data.bus_width_16) | 244 | if (eb_nand_data.bus_width_16) |
248 | eb_nand_smc_config.mode |= AT91_SMC_DBW_16; | 245 | eb_nand_smc_config.mode |= AT91_SMC_DBW_16; |
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c index e7274440ead9..96010d4e15af 100644 --- a/arch/arm/mach-at91/board-cap9adk.c +++ b/arch/arm/mach-at91/board-cap9adk.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <mach/gpio.h> | 44 | #include <mach/gpio.h> |
45 | #include <mach/at91cap9_matrix.h> | 45 | #include <mach/at91cap9_matrix.h> |
46 | #include <mach/at91sam9_smc.h> | 46 | #include <mach/at91sam9_smc.h> |
47 | #include <mach/system_rev.h> | ||
47 | 48 | ||
48 | #include "sam9_smc.h" | 49 | #include "sam9_smc.h" |
49 | #include "generic.h" | 50 | #include "generic.h" |
@@ -187,11 +188,6 @@ static struct atmel_nand_data __initdata cap9adk_nand_data = { | |||
187 | // .rdy_pin = ... not connected | 188 | // .rdy_pin = ... not connected |
188 | .enable_pin = AT91_PIN_PD15, | 189 | .enable_pin = AT91_PIN_PD15, |
189 | .partition_info = nand_partitions, | 190 | .partition_info = nand_partitions, |
190 | #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) | ||
191 | .bus_width_16 = 1, | ||
192 | #else | ||
193 | .bus_width_16 = 0, | ||
194 | #endif | ||
195 | }; | 191 | }; |
196 | 192 | ||
197 | static struct sam9_smc_config __initdata cap9adk_nand_smc_config = { | 193 | static struct sam9_smc_config __initdata cap9adk_nand_smc_config = { |
@@ -219,6 +215,7 @@ static void __init cap9adk_add_device_nand(void) | |||
219 | csa = at91_sys_read(AT91_MATRIX_EBICSA); | 215 | csa = at91_sys_read(AT91_MATRIX_EBICSA); |
220 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V); | 216 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V); |
221 | 217 | ||
218 | cap9adk_nand_data.bus_width_16 = !board_have_nand_8bit(); | ||
222 | /* setup bus-width (8 or 16) */ | 219 | /* setup bus-width (8 or 16) */ |
223 | if (cap9adk_nand_data.bus_width_16) | 220 | if (cap9adk_nand_data.bus_width_16) |
224 | cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_16; | 221 | cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_16; |
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c index de1816e0e1d9..fdfa144cbe76 100644 --- a/arch/arm/mach-at91/board-sam9260ek.c +++ b/arch/arm/mach-at91/board-sam9260ek.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <mach/gpio.h> | 44 | #include <mach/gpio.h> |
45 | #include <mach/at91sam9_smc.h> | 45 | #include <mach/at91sam9_smc.h> |
46 | #include <mach/at91_shdwc.h> | 46 | #include <mach/at91_shdwc.h> |
47 | #include <mach/system_rev.h> | ||
47 | 48 | ||
48 | #include "sam9_smc.h" | 49 | #include "sam9_smc.h" |
49 | #include "generic.h" | 50 | #include "generic.h" |
@@ -191,11 +192,6 @@ static struct atmel_nand_data __initdata ek_nand_data = { | |||
191 | .rdy_pin = AT91_PIN_PC13, | 192 | .rdy_pin = AT91_PIN_PC13, |
192 | .enable_pin = AT91_PIN_PC14, | 193 | .enable_pin = AT91_PIN_PC14, |
193 | .partition_info = nand_partitions, | 194 | .partition_info = nand_partitions, |
194 | #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) | ||
195 | .bus_width_16 = 1, | ||
196 | #else | ||
197 | .bus_width_16 = 0, | ||
198 | #endif | ||
199 | }; | 195 | }; |
200 | 196 | ||
201 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 197 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
@@ -218,6 +214,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = { | |||
218 | 214 | ||
219 | static void __init ek_add_device_nand(void) | 215 | static void __init ek_add_device_nand(void) |
220 | { | 216 | { |
217 | ek_nand_data.bus_width_16 = !board_have_nand_8bit(); | ||
221 | /* setup bus-width (8 or 16) */ | 218 | /* setup bus-width (8 or 16) */ |
222 | if (ek_nand_data.bus_width_16) | 219 | if (ek_nand_data.bus_width_16) |
223 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; | 220 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; |
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index 14acc901e24c..c2773b5f2eee 100644 --- a/arch/arm/mach-at91/board-sam9261ek.c +++ b/arch/arm/mach-at91/board-sam9261ek.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <mach/gpio.h> | 48 | #include <mach/gpio.h> |
49 | #include <mach/at91sam9_smc.h> | 49 | #include <mach/at91sam9_smc.h> |
50 | #include <mach/at91_shdwc.h> | 50 | #include <mach/at91_shdwc.h> |
51 | #include <mach/system_rev.h> | ||
51 | 52 | ||
52 | #include "sam9_smc.h" | 53 | #include "sam9_smc.h" |
53 | #include "generic.h" | 54 | #include "generic.h" |
@@ -197,11 +198,6 @@ static struct atmel_nand_data __initdata ek_nand_data = { | |||
197 | .rdy_pin = AT91_PIN_PC15, | 198 | .rdy_pin = AT91_PIN_PC15, |
198 | .enable_pin = AT91_PIN_PC14, | 199 | .enable_pin = AT91_PIN_PC14, |
199 | .partition_info = nand_partitions, | 200 | .partition_info = nand_partitions, |
200 | #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) | ||
201 | .bus_width_16 = 1, | ||
202 | #else | ||
203 | .bus_width_16 = 0, | ||
204 | #endif | ||
205 | }; | 201 | }; |
206 | 202 | ||
207 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 203 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
@@ -224,6 +220,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = { | |||
224 | 220 | ||
225 | static void __init ek_add_device_nand(void) | 221 | static void __init ek_add_device_nand(void) |
226 | { | 222 | { |
223 | ek_nand_data.bus_width_16 = !board_have_nand_8bit(); | ||
227 | /* setup bus-width (8 or 16) */ | 224 | /* setup bus-width (8 or 16) */ |
228 | if (ek_nand_data.bus_width_16) | 225 | if (ek_nand_data.bus_width_16) |
229 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; | 226 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; |
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index bfe490df58be..1dabc0ae56c9 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <mach/gpio.h> | 47 | #include <mach/gpio.h> |
48 | #include <mach/at91sam9_smc.h> | 48 | #include <mach/at91sam9_smc.h> |
49 | #include <mach/at91_shdwc.h> | 49 | #include <mach/at91_shdwc.h> |
50 | #include <mach/system_rev.h> | ||
50 | 51 | ||
51 | #include "sam9_smc.h" | 52 | #include "sam9_smc.h" |
52 | #include "generic.h" | 53 | #include "generic.h" |
@@ -198,11 +199,6 @@ static struct atmel_nand_data __initdata ek_nand_data = { | |||
198 | .rdy_pin = AT91_PIN_PA22, | 199 | .rdy_pin = AT91_PIN_PA22, |
199 | .enable_pin = AT91_PIN_PD15, | 200 | .enable_pin = AT91_PIN_PD15, |
200 | .partition_info = nand_partitions, | 201 | .partition_info = nand_partitions, |
201 | #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) | ||
202 | .bus_width_16 = 1, | ||
203 | #else | ||
204 | .bus_width_16 = 0, | ||
205 | #endif | ||
206 | }; | 202 | }; |
207 | 203 | ||
208 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 204 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
@@ -225,6 +221,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = { | |||
225 | 221 | ||
226 | static void __init ek_add_device_nand(void) | 222 | static void __init ek_add_device_nand(void) |
227 | { | 223 | { |
224 | ek_nand_data.bus_width_16 = !board_have_nand_8bit(); | ||
228 | /* setup bus-width (8 or 16) */ | 225 | /* setup bus-width (8 or 16) */ |
229 | if (ek_nand_data.bus_width_16) | 226 | if (ek_nand_data.bus_width_16) |
230 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; | 227 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; |
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c index ca8198b3c168..d13acd5c92f2 100644 --- a/arch/arm/mach-at91/board-sam9g20ek.c +++ b/arch/arm/mach-at91/board-sam9g20ek.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <mach/board.h> | 43 | #include <mach/board.h> |
44 | #include <mach/gpio.h> | 44 | #include <mach/gpio.h> |
45 | #include <mach/at91sam9_smc.h> | 45 | #include <mach/at91sam9_smc.h> |
46 | #include <mach/system_rev.h> | ||
46 | 47 | ||
47 | #include "sam9_smc.h" | 48 | #include "sam9_smc.h" |
48 | #include "generic.h" | 49 | #include "generic.h" |
@@ -175,11 +176,6 @@ static struct atmel_nand_data __initdata ek_nand_data = { | |||
175 | .rdy_pin = AT91_PIN_PC13, | 176 | .rdy_pin = AT91_PIN_PC13, |
176 | .enable_pin = AT91_PIN_PC14, | 177 | .enable_pin = AT91_PIN_PC14, |
177 | .partition_info = nand_partitions, | 178 | .partition_info = nand_partitions, |
178 | #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) | ||
179 | .bus_width_16 = 1, | ||
180 | #else | ||
181 | .bus_width_16 = 0, | ||
182 | #endif | ||
183 | }; | 179 | }; |
184 | 180 | ||
185 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 181 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
@@ -202,6 +198,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = { | |||
202 | 198 | ||
203 | static void __init ek_add_device_nand(void) | 199 | static void __init ek_add_device_nand(void) |
204 | { | 200 | { |
201 | ek_nand_data.bus_width_16 = !board_have_nand_8bit(); | ||
205 | /* setup bus-width (8 or 16) */ | 202 | /* setup bus-width (8 or 16) */ |
206 | if (ek_nand_data.bus_width_16) | 203 | if (ek_nand_data.bus_width_16) |
207 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; | 204 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; |
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c index 6c999dbd2bcf..49d6849f0ccb 100644 --- a/arch/arm/mach-at91/board-sam9m10g45ek.c +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <mach/gpio.h> | 41 | #include <mach/gpio.h> |
42 | #include <mach/at91sam9_smc.h> | 42 | #include <mach/at91sam9_smc.h> |
43 | #include <mach/at91_shdwc.h> | 43 | #include <mach/at91_shdwc.h> |
44 | #include <mach/system_rev.h> | ||
44 | 45 | ||
45 | #include "sam9_smc.h" | 46 | #include "sam9_smc.h" |
46 | #include "generic.h" | 47 | #include "generic.h" |
@@ -155,11 +156,6 @@ static struct atmel_nand_data __initdata ek_nand_data = { | |||
155 | .rdy_pin = AT91_PIN_PC8, | 156 | .rdy_pin = AT91_PIN_PC8, |
156 | .enable_pin = AT91_PIN_PC14, | 157 | .enable_pin = AT91_PIN_PC14, |
157 | .partition_info = nand_partitions, | 158 | .partition_info = nand_partitions, |
158 | #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) | ||
159 | .bus_width_16 = 1, | ||
160 | #else | ||
161 | .bus_width_16 = 0, | ||
162 | #endif | ||
163 | }; | 159 | }; |
164 | 160 | ||
165 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | 161 | static struct sam9_smc_config __initdata ek_nand_smc_config = { |
@@ -182,6 +178,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = { | |||
182 | 178 | ||
183 | static void __init ek_add_device_nand(void) | 179 | static void __init ek_add_device_nand(void) |
184 | { | 180 | { |
181 | ek_nand_data.bus_width_16 = !board_have_nand_8bit(); | ||
185 | /* setup bus-width (8 or 16) */ | 182 | /* setup bus-width (8 or 16) */ |
186 | if (ek_nand_data.bus_width_16) | 183 | if (ek_nand_data.bus_width_16) |
187 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; | 184 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; |
diff --git a/arch/arm/mach-at91/include/mach/system_rev.h b/arch/arm/mach-at91/include/mach/system_rev.h new file mode 100644 index 000000000000..b855ee75f72c --- /dev/null +++ b/arch/arm/mach-at91/include/mach/system_rev.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | ||
3 | * | ||
4 | * Under GPLv2 only | ||
5 | */ | ||
6 | |||
7 | #ifndef __ARCH_SYSTEM_REV_H__ | ||
8 | #define __ARCH_SYSTEM_REV_H__ | ||
9 | |||
10 | /* | ||
11 | * board revision encoding | ||
12 | * mach specific | ||
13 | * the 16-31 bit are reserved for at91 generic information | ||
14 | * | ||
15 | * bit 31: | ||
16 | * 0 => nand 16 bit | ||
17 | * 1 => nand 8 bit | ||
18 | */ | ||
19 | #define BOARD_HAVE_NAND_8BIT (1 << 31) | ||
20 | static int inline board_have_nand_8bit(void) | ||
21 | { | ||
22 | return system_rev & BOARD_HAVE_NAND_8BIT; | ||
23 | } | ||
24 | |||
25 | #endif /* __ARCH_SYSTEM_REV_H__ */ | ||