aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-devkit8000.c
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2011-04-24 18:09:07 -0400
committerTony Lindgren <tony@atomide.com>2011-05-03 05:53:37 -0400
commit9a3f39ff36e11ea6b6c8b5f90337a864cb7e81f6 (patch)
treebdce8353ab8670fa603d5ace590c2a467df3537d /arch/arm/mach-omap2/board-devkit8000.c
parentfbd8071c188e3053fb318d78214e54d4615d93f2 (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-devkit8000.c')
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 983f44b78777..e7dc057600d5 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -97,13 +97,6 @@ static struct mtd_partition devkit8000_nand_partitions[] = {
97 }, 97 },
98}; 98};
99 99
100static struct omap_nand_platform_data devkit8000_nand_data = {
101 .options = NAND_BUSWIDTH_16,
102 .parts = devkit8000_nand_partitions,
103 .nr_parts = ARRAY_SIZE(devkit8000_nand_partitions),
104 .dma_channel = -1, /* disable DMA in OMAP NAND driver */
105};
106
107static struct omap2_hsmmc_info mmc[] = { 100static struct omap2_hsmmc_info mmc[] = {
108 { 101 {
109 .mmc = 1, 102 .mmc = 1,
@@ -516,39 +509,6 @@ static struct platform_device *devkit8000_devices[] __initdata = {
516 &omap_dm9000_dev, 509 &omap_dm9000_dev,
517}; 510};
518 511
519static void __init devkit8000_flash_init(void)
520{
521 u8 cs = 0;
522 u8 nandcs = GPMC_CS_NUM + 1;
523
524 /* find out the chip-select on which NAND exists */
525 while (cs < GPMC_CS_NUM) {
526 u32 ret = 0;
527 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
528
529 if ((ret & 0xC00) == 0x800) {
530 printk(KERN_INFO "Found NAND on CS%d\n", cs);
531 if (nandcs > GPMC_CS_NUM)
532 nandcs = cs;
533 }
534 cs++;
535 }
536
537 if (nandcs > GPMC_CS_NUM) {
538 printk(KERN_INFO "NAND: Unable to find configuration "
539 "in GPMC\n ");
540 return;
541 }
542
543 if (nandcs < GPMC_CS_NUM) {
544 devkit8000_nand_data.cs = nandcs;
545
546 printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
547 if (gpmc_nand_init(&devkit8000_nand_data) < 0)
548 printk(KERN_ERR "Unable to register NAND device\n");
549 }
550}
551
552static struct omap_musb_board_data musb_board_data = { 512static struct omap_musb_board_data musb_board_data = {
553 .interface_type = MUSB_INTERFACE_ULPI, 513 .interface_type = MUSB_INTERFACE_ULPI,
554 .mode = MUSB_OTG, 514 .mode = MUSB_OTG,
@@ -740,7 +700,8 @@ static void __init devkit8000_init(void)
740 700
741 usb_musb_init(&musb_board_data); 701 usb_musb_init(&musb_board_data);
742 usbhs_init(&usbhs_bdata); 702 usbhs_init(&usbhs_bdata);
743 devkit8000_flash_init(); 703 omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions,
704 ARRAY_SIZE(devkit8000_nand_partitions));
744 705
745 /* Ensure SDRC pins are mux'd for self-refresh */ 706 /* Ensure SDRC pins are mux'd for self-refresh */
746 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 707 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);