From patchwork Mon May 2 08:17:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Macpaul Lin X-Patchwork-Id: 93606 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 D7468B6F44 for ; Mon, 2 May 2011 18:18:02 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 80878282CB; Mon, 2 May 2011 10:17: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 OIxbODpSgzep; Mon, 2 May 2011 10:17:57 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 25CF5282CD; Mon, 2 May 2011 10:17:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E72D9282CC for ; Mon, 2 May 2011 10:17:52 +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 cb+wE9mhABnd for ; Mon, 2 May 2011 10:17:51 +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 ATCPCS06.andestech.com (59-124-160-117.HINET-IP.hinet.net [59.124.160.117]) by theia.denx.de (Postfix) with ESMTP id 04F54282CB for ; Mon, 2 May 2011 10:17:49 +0200 (CEST) Received: from app01.andestech.com ([10.0.4.31]) by ATCPCS06.andestech.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 2 May 2011 16:17:37 +0800 From: Macpaul Lin To: Wolfgang Denk , u-boot@lists.denx.de, ratbert@faraday-tech.com Date: Mon, 2 May 2011 16:17:29 +0800 Message-Id: <1304324251-15293-1-git-send-email-macpaul@andestech.com> X-Mailer: git-send-email 1.7.3.5 In-Reply-To: <1301570307-13852-1-git-send-email-macpaul@andestech.com> References: <1301570307-13852-1-git-send-email-macpaul@andestech.com> X-OriginalArrivalTime: 02 May 2011 08:17:37.0144 (UTC) FILETIME=[656F1F80:01CC08A1] Cc: Macpaul Lin Subject: [U-Boot] [PATCH v3 1/3] ftsmc020: fix relocation 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 Avoid relocation problem by fix global declaration. Signed-off-by: Macpaul Lin --- Changes for v2: - Remove assembly register offsets for support lowlevel_init.S. - The nested structure of register offsets has been rewrote. - Fix relocation related declaration. Changes for v3: - Split this patch into 3 different patches according to Wolfgang's suggestion - Fix gloable declarations to avoid problem in relocation. - Un-nested the register structure. - Add missing definitions in header according to datasheet. drivers/mtd/ftsmc020.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/ftsmc020.c b/drivers/mtd/ftsmc020.c index b027685..ddeb3a4 100644 --- a/drivers/mtd/ftsmc020.c +++ b/drivers/mtd/ftsmc020.c @@ -27,12 +27,10 @@ struct ftsmc020_config { unsigned int timing; }; -static struct ftsmc020_config config[] = CONFIG_SYS_FTSMC020_CONFIGS; - -static struct ftsmc020 *smc = (struct ftsmc020 *)CONFIG_FTSMC020_BASE; - static void ftsmc020_setup_bank(unsigned int bank, struct ftsmc020_config *cfg) { + struct ftsmc020 *smc = (struct ftsmc020 *)CONFIG_FTSMC020_BASE; + if (bank > 3) { printf("bank # %u invalid\n", bank); return; @@ -44,6 +42,7 @@ static void ftsmc020_setup_bank(unsigned int bank, struct ftsmc020_config *cfg) void ftsmc020_init(void) { + struct ftsmc020_config config[] = CONFIG_SYS_FTSMC020_CONFIGS; int i; for (i = 0; i < ARRAY_SIZE(config); i++)