From patchwork Thu Sep 27 21:52:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 187484 X-Patchwork-Delegate: twarren@nvidia.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 462762C00F2 for ; Fri, 28 Sep 2012 07:52:15 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4A6FA2808D; Thu, 27 Sep 2012 23:52:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id llMaBfKv3oMQ; Thu, 27 Sep 2012 23:52:11 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0AA7228080; Thu, 27 Sep 2012 23:52:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B384A28086 for ; Thu, 27 Sep 2012 23:52:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kOesjxgYT3M1 for ; Thu, 27 Sep 2012 23:52:08 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from km20343-01.keymachine.de (ns.km20343-01.keymachine.de [84.19.182.79]) by theia.denx.de (Postfix) with ESMTP id 34CBE28080 for ; Thu, 27 Sep 2012 23:52:08 +0200 (CEST) Received: from localhost.localdomain (g229037233.adsl.alicedsl.de [92.229.37.233]) by km20343-01.keymachine.de (Postfix) with ESMTPA id C1D667D42E3; Thu, 27 Sep 2012 23:52:07 +0200 (CEST) From: Lucas Stach To: Tom Warren Date: Thu, 27 Sep 2012 23:52:04 +0200 Message-Id: <1348782724-19151-2-git-send-email-dev@lynxeye.de> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348782724-19151-1-git-send-email-dev@lynxeye.de> References: <1348782724-19151-1-git-send-email-dev@lynxeye.de> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] =?utf-8?q?=5BPATCH_2/2=5D_tegra=3A_nand=3A_add_board_pin?= =?utf-8?q?mux?= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Boards may require a different pinmux setup for NAND than the default one. Add a way to call into board specific code to set this up. Signed-off-by: Lucas Stach --- arch/arm/include/asm/arch-tegra/board.h | 1 + drivers/mtd/nand/tegra_nand.c | 11 ++++++++++- 2 Dateien geändert, 11 Zeilen hinzugefügt(+), 1 Zeile entfernt(-) diff --git a/arch/arm/include/asm/arch-tegra/board.h b/arch/arm/include/asm/arch-tegra/board.h index 7e56df7..be6bf25 100644 --- a/arch/arm/include/asm/arch-tegra/board.h +++ b/arch/arm/include/asm/arch-tegra/board.h @@ -43,5 +43,6 @@ void gpio_early_init(void); /* overrideable GPIO config */ void pin_mux_usb(void); /* overrideable USB pinmux setup */ void pin_mux_spi(void); /* overrideable SPI pinmux setup */ +void pin_mux_nand(void); /* overrideable NAND pinmux setup */ #endif diff --git a/drivers/mtd/nand/tegra_nand.c b/drivers/mtd/nand/tegra_nand.c index 2c1b533..baaea4f 100644 --- a/drivers/mtd/nand/tegra_nand.c +++ b/drivers/mtd/nand/tegra_nand.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -992,7 +993,6 @@ int tegra_nand_init(struct nand_chip *nand, int devnum) /* Adjust timing for NAND device */ setup_timing(config->timing, info->reg); - funcmux_select(PERIPH_ID_NDFLASH, FUNCMUX_DEFAULT); fdtdec_setup_gpio(&config->wp_gpio); gpio_direction_output(config->wp_gpio.gpio, 1); @@ -1016,10 +1016,19 @@ int tegra_nand_init(struct nand_chip *nand, int devnum) return 0; } +void __pin_mux_nand(void) +{ + funcmux_select(PERIPH_ID_NDFLASH, FUNCMUX_DEFAULT); +} + +void pin_mux_nand(void) __attribute__((weak, alias("__pin_mux_nand"))); + void board_nand_init(void) { struct nand_chip *nand = &nand_chip[0]; + pin_mux_nand(); + if (tegra_nand_init(nand, 0)) puts("Tegra NAND init failed\n"); }