From patchwork Sat Jul 16 10:06:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 104944 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 5BCFBB6F69 for ; Sat, 16 Jul 2011 20:07:35 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6DA5628142; Sat, 16 Jul 2011 12:07:28 +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 n17VCksgGvPT; Sat, 16 Jul 2011 12:07:28 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3A82C28114; Sat, 16 Jul 2011 12:07:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9C351280EE for ; Sat, 16 Jul 2011 12:06:57 +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 UWJw9IQikiea for ; Sat, 16 Jul 2011 12:06:57 +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 pollux.denx.de (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by theia.denx.de (Postfix) with ESMTP id 5AF04280F2 for ; Sat, 16 Jul 2011 12:06:57 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 515) id 1F3184BFE; Sat, 16 Jul 2011 12:06:57 +0200 (CEST) From: Heiko Schocher To: u-boot@lists.denx.de Date: Sat, 16 Jul 2011 12:06:44 +0200 Message-Id: <1310810810-5322-4-git-send-email-hs@denx.de> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1310810810-5322-1-git-send-email-hs@denx.de> References: <1310810810-5322-1-git-send-email-hs@denx.de> Cc: Scott Wood , Heiko Schocher Subject: [U-Boot] [PATCH 3/9] nand: add a hw specific subcommand to the nand command. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Actually this is needed for coming up davinci dm368 cam_enc_4xx board support. There we need two different nand read/write functions, because the RBL uses different nand read/write functions than u-boot. Another place where such a command is used is: arch/arm/cpu/armv7/omap3/board.c: do_switch_ecc() Maybe this should be fixed? Signed-off-by: Heiko Schocher cc: Scott Wood --- README | 2 ++ common/cmd_nand.c | 8 ++++++++ include/nand.h | 3 +++ 3 files changed, 13 insertions(+), 0 deletions(-) diff --git a/README b/README index 1e2d4d3..647e10b 100644 --- a/README +++ b/README @@ -705,6 +705,8 @@ The following options need to be configured: CONFIG_CMD_MII * MII utility commands CONFIG_CMD_MTDPARTS * MTD partition support CONFIG_CMD_NAND * NAND support + CONFIG_CMD_NAND_HWFUNC add to the nand commando a hw specific + subcommand. CONFIG_CMD_NET bootp, tftpboot, rarpboot CONFIG_CMD_PCA953X * PCA953x I2C gpio commands CONFIG_CMD_PCA953X_INFO * PCA953x I2C gpio info command diff --git a/common/cmd_nand.c b/common/cmd_nand.c index 8c56802..416d2c7 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -689,6 +689,10 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) return 0; } #endif +#ifdef CONFIG_CMD_NAND_HWFUNC + if (strcmp(cmd, "hwfunc") == 0) + return nand_hwfunc(argc - 2, argv + 2); +#endif usage: return cmd_usage(cmdtp); @@ -739,6 +743,10 @@ U_BOOT_CMD( "nand env.oob set off|partition - set enviromnent offset\n" "nand env.oob get - get environment offset" #endif +#ifdef CONFIG_CMD_NAND_HWFUNC + "\n" + "nand hwfunc " CONFIG_CMD_NAND_HWFUNC "\n" +#endif ); static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, diff --git a/include/nand.h b/include/nand.h index 8d94b5c..06b86f8 100644 --- a/include/nand.h +++ b/include/nand.h @@ -138,6 +138,9 @@ void board_nand_select_device(struct nand_chip *nand, int chip); __attribute__((noreturn)) void nand_boot(void); +#ifdef CONFIG_CMD_NAND_HWFUNC +int nand_hwfunc(int argc, char * const argv[]); +#endif #endif #ifdef CONFIG_ENV_OFFSET_OOB