From patchwork Tue Oct 12 10:16:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo Serra X-Patchwork-Id: 247371 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9CAGVaO029972 for ; Tue, 12 Oct 2010 10:16:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932142Ab0JLKQa (ORCPT ); Tue, 12 Oct 2010 06:16:30 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:57259 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932131Ab0JLKQ3 (ORCPT ); Tue, 12 Oct 2010 06:16:29 -0400 Received: by wwj40 with SMTP id 40so4826116wwj.1 for ; Tue, 12 Oct 2010 03:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=gyBwHUjPGRfeCLF1E4ONebSgG1/sBD2z1PqlfzJqyVE=; b=JVo6tKMQhTto0ymFAMLgZ21eNh0+POGtz5q46RUydVLXA+2VckDXITUXzYG1lmndk7 V01HxGFrqcIC6s+M+D56cwB5xVtVbRMN2qPa9sYSxK+9n7ik7KDC+Ou1cj07qO2XIdLM o5Zw4khCNZ59e+y+/WtgGrYv/DmIpCxUwE1Xs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=B2cxU8UEWu7kIwllMGgK+/wj9es8X/MvMtabAQKgD8kThwGXepF7OBcjPd4ujA+tfg c8wzmuFQENIr21fmJpJnlnSKen8uWQBilx7j7MNh/l4CNc5LJ1akAFYU5bcIaOlyKR8N glCEPk1XQq+N7rchxPEoaC3L2tPbyIYqAOfI8= Received: by 10.227.32.147 with SMTP id c19mr6900330wbd.43.1286878587526; Tue, 12 Oct 2010 03:16:27 -0700 (PDT) Received: from localhost.localdomain (192.Red-88-27-117.staticIP.rima-tde.net [88.27.117.192]) by mx.google.com with ESMTPS id n40sm5097400weq.5.2010.10.12.03.16.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 12 Oct 2010 03:16:26 -0700 (PDT) From: Enric Balletbo i Serra To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Enric Balletbo i Serra Subject: [PATCH] omap3: various code improvements for IGEP v2 board. Date: Tue, 12 Oct 2010 12:16:10 +0200 Message-Id: <1286878570-1973-1-git-send-email-eballetbo@gmail.com> X-Mailer: git-send-email 1.7.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 12 Oct 2010 10:16:32 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 152f757..ddcfd06 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c @@ -136,16 +136,10 @@ static struct mtd_partition igep2_onenand_partitions[] = { }, }; -static int igep2_onenand_setup(void __iomem *onenand_base, int freq) -{ - /* nothing is required to be setup for onenand as of now */ - return 0; -} - static struct omap_onenand_platform_data igep2_onenand_data = { .parts = igep2_onenand_partitions, .nr_parts = ARRAY_SIZE(igep2_onenand_partitions), - .onenand_setup = igep2_onenand_setup, + .onenand_setup = NULL, .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ }; @@ -159,35 +153,35 @@ static struct platform_device igep2_onenand_device = { static void __init igep2_flash_init(void) { - u8 cs = 0; - u8 onenandcs = GPMC_CS_NUM + 1; + u8 cs = 0; + u8 onenandcs = GPMC_CS_NUM + 1; - while (cs < GPMC_CS_NUM) { - u32 ret = 0; + for (cs = 0; cs < GPMC_CS_NUM; cs++) { + u32 ret; ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); /* Check if NAND/oneNAND is configured */ if ((ret & 0xC00) == 0x800) /* NAND found */ - pr_err("IGEP v2: Unsupported NAND found\n"); + pr_err("IGEP2: Unsupported NAND found\n"); else { ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); + if ((ret & 0x3F) == (ONENAND_MAP >> 24)) - /* ONENAND found */ + /* OneNAND found */ onenandcs = cs; } - cs++; } + if (onenandcs > GPMC_CS_NUM) { - pr_err("IGEP v2: Unable to find configuration in GPMC\n"); + pr_err("IGEP2: Unable to find configuration in GPMC\n"); return; } - if (onenandcs < GPMC_CS_NUM) { - igep2_onenand_data.cs = onenandcs; - if (platform_device_register(&igep2_onenand_device) < 0) - pr_err("IGEP v2: Unable to register OneNAND device\n"); - } + igep2_onenand_data.cs = onenandcs; + + if (platform_device_register(&igep2_onenand_device) < 0) + pr_err("IGEP2: Unable to register OneNAND device\n"); } #else @@ -254,9 +248,6 @@ static inline void __init igep2_init_smsc911x(void) static inline void __init igep2_init_smsc911x(void) { } #endif -static struct omap_board_config_kernel igep2_config[] __initdata = { -}; - static struct regulator_consumer_supply igep2_vmmc1_supply = { .supply = "vmmc", }; @@ -493,8 +484,6 @@ static struct platform_device *igep2_devices[] __initdata = { static void __init igep2_init_irq(void) { - omap_board_config = igep2_config; - omap_board_config_size = ARRAY_SIZE(igep2_config); omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params); omap_init_irq(); omap_gpio_init();