diff options
author | Mike Rapoport <mike@compulab.co.il> | 2011-04-24 18:09:07 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-05-03 05:53:37 -0400 |
commit | 9a3f39ff36e11ea6b6c8b5f90337a864cb7e81f6 (patch) | |
tree | bdce8353ab8670fa603d5ace590c2a467df3537d /arch/arm/mach-omap2/board-omap3touchbook.c | |
parent | fbd8071c188e3053fb318d78214e54d4615d93f2 (diff) |
omap: move detection of NAND CS to common-board-devices
and reduce amount of copy/paste
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
CC: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3touchbook.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3touchbook.c | 45 |
1 files changed, 2 insertions, 43 deletions
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 0a9b3299427a..d770802900b2 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c | |||
@@ -96,15 +96,6 @@ static struct mtd_partition omap3touchbook_nand_partitions[] = { | |||
96 | }, | 96 | }, |
97 | }; | 97 | }; |
98 | 98 | ||
99 | static struct omap_nand_platform_data omap3touchbook_nand_data = { | ||
100 | .options = NAND_BUSWIDTH_16, | ||
101 | .parts = omap3touchbook_nand_partitions, | ||
102 | .nr_parts = ARRAY_SIZE(omap3touchbook_nand_partitions), | ||
103 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | ||
104 | .nand_setup = NULL, | ||
105 | .dev_ready = NULL, | ||
106 | }; | ||
107 | |||
108 | #include "sdram-micron-mt46h32m32lf-6.h" | 99 | #include "sdram-micron-mt46h32m32lf-6.h" |
109 | 100 | ||
110 | static struct omap2_hsmmc_info mmc[] = { | 101 | static struct omap2_hsmmc_info mmc[] = { |
@@ -396,39 +387,6 @@ static struct platform_device *omap3_touchbook_devices[] __initdata = { | |||
396 | &keys_gpio, | 387 | &keys_gpio, |
397 | }; | 388 | }; |
398 | 389 | ||
399 | static void __init omap3touchbook_flash_init(void) | ||
400 | { | ||
401 | u8 cs = 0; | ||
402 | u8 nandcs = GPMC_CS_NUM + 1; | ||
403 | |||
404 | /* find out the chip-select on which NAND exists */ | ||
405 | while (cs < GPMC_CS_NUM) { | ||
406 | u32 ret = 0; | ||
407 | ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); | ||
408 | |||
409 | if ((ret & 0xC00) == 0x800) { | ||
410 | printk(KERN_INFO "Found NAND on CS%d\n", cs); | ||
411 | if (nandcs > GPMC_CS_NUM) | ||
412 | nandcs = cs; | ||
413 | } | ||
414 | cs++; | ||
415 | } | ||
416 | |||
417 | if (nandcs > GPMC_CS_NUM) { | ||
418 | printk(KERN_INFO "NAND: Unable to find configuration " | ||
419 | "in GPMC\n "); | ||
420 | return; | ||
421 | } | ||
422 | |||
423 | if (nandcs < GPMC_CS_NUM) { | ||
424 | omap3touchbook_nand_data.cs = nandcs; | ||
425 | |||
426 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); | ||
427 | if (gpmc_nand_init(&omap3touchbook_nand_data) < 0) | ||
428 | printk(KERN_ERR "Unable to register NAND device\n"); | ||
429 | } | ||
430 | } | ||
431 | |||
432 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | 390 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { |
433 | 391 | ||
434 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, | 392 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, |
@@ -491,7 +449,8 @@ static void __init omap3_touchbook_init(void) | |||
491 | omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata); | 449 | omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata); |
492 | usb_musb_init(&musb_board_data); | 450 | usb_musb_init(&musb_board_data); |
493 | usbhs_init(&usbhs_bdata); | 451 | usbhs_init(&usbhs_bdata); |
494 | omap3touchbook_flash_init(); | 452 | omap_nand_flash_init(NAND_BUSWIDTH_16, omap3touchbook_nand_partitions, |
453 | ARRAY_SIZE(omap3touchbook_nand_partitions)); | ||
495 | 454 | ||
496 | /* Ensure SDRC pins are mux'd for self-refresh */ | 455 | /* Ensure SDRC pins are mux'd for self-refresh */ |
497 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 456 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |