From patchwork Mon Oct 1 15:41:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 188319 X-Patchwork-Delegate: trini@ti.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 9A7602C00A2 for ; Tue, 2 Oct 2012 01:41:54 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9B55428077; Mon, 1 Oct 2012 17:41: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 j1tCFDJMnhZX; Mon, 1 Oct 2012 17:41:52 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 03C6C2807B; Mon, 1 Oct 2012 17:41:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BF8B82807B for ; Mon, 1 Oct 2012 17:41:47 +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 5Yyl6WCl6Amn for ; Mon, 1 Oct 2012 17:41:47 +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 mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTPS id 83E3E28077 for ; Mon, 1 Oct 2012 17:41:44 +0200 (CEST) Received: by pbbro8 with SMTP id ro8so8044184pbb.3 for ; Mon, 01 Oct 2012 08:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:x-mailer; bh=k02Zx0d4FLThlqFQAkHnRz/Iyikpb672stXxQR321q4=; b=y/pTzeUz55DIH07PBP9uTr+mOSl8EgIBCosP5VI0iDtQAT/i6huLOooI4fBaTLmj8I p+h3cEh9DRn4nNbGzDWKFrtl6nGje9nBLn5Sf/RlRaM90ZcITUZ35S/Lt60dBdBJh+vX 79OHRd4TSkuVZ/koHttQJd/xvF8Km53MZi95dJQusD8e3S5uIxwATBNUxi0igMDY0cVB 1GcNzH05AGAkY1MhHws6XICVtnjHrNS+eC15/mshv+GZ22gBJAE/DPlKLb4a6FCjzjfG GxZy4Q9UnOzST206axsY13kLN8Xdsg4Jyc6sswVgdaN3ytnuJb7SStML63uK/isEKeIS nR3g== Received: by 10.68.135.234 with SMTP id pv10mr41563200pbb.156.1349106102447; Mon, 01 Oct 2012 08:41:42 -0700 (PDT) Received: from localhost.localdomain (ip68-230-54-74.ph.ph.cox.net. [68.230.54.74]) by mx.google.com with ESMTPS id vi9sm8664220pbc.41.2012.10.01.08.41.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 01 Oct 2012 08:41:41 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Date: Mon, 1 Oct 2012 08:41:36 -0700 Message-Id: <1349106096-31498-1-git-send-email-trini@ti.com> X-Mailer: git-send-email 1.7.9.5 Subject: [U-Boot] [PATCH] AP1000: Inline local 'get_device' 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The AP1000 defines a 'get_device' function to determine what board revision we are on. Inline that checking as it conflicts with the get_device() in and is only used once. Signed-off-by: Tom Rini --- board/amirix/ap1000/ap1000.c | 11 +++-------- board/amirix/ap1000/ap1000.h | 1 - 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/board/amirix/ap1000/ap1000.c b/board/amirix/ap1000/ap1000.c index 64de04c..dbcb34b 100644 --- a/board/amirix/ap1000/ap1000.c +++ b/board/amirix/ap1000/ap1000.c @@ -43,11 +43,13 @@ int checkboard (void) /* After a loadace command, the SystemAce control register is left in a wonky state. */ /* this code did not work in board_pre_init */ unsigned char *p = (unsigned char *) AP1000_SYSACE_REGBASE; + unsigned int *revision_reg_ptr = (unsigned int *) AP1xx_FPGA_REV_ADDR; + unsigned int device = (*revision_reg_ptr & AP1xx_TARGET_MASK); p[SYSACE_CTRLREG0] = 0x0; /* add platform and device to banner */ - switch (get_device ()) { + switch (device) { case AP1xx_AP107_TARGET: puts (AP1xx_AP107_TARGET_STR); break; @@ -160,13 +162,6 @@ unsigned int get_platform (void) return (*revision_reg_ptr & AP1xx_PLATFORM_MASK); } -unsigned int get_device (void) -{ - unsigned int *revision_reg_ptr = (unsigned int *) AP1xx_FPGA_REV_ADDR; - - return (*revision_reg_ptr & AP1xx_TARGET_MASK); -} - #if 0 /* loadace is not working; it appears to be a hardware issue with the system ace. */ /* This function loads FPGA configurations from the SystemACE CompactFlash diff --git a/board/amirix/ap1000/ap1000.h b/board/amirix/ap1000/ap1000.h index 118c4d1..d294816 100644 --- a/board/amirix/ap1000/ap1000.h +++ b/board/amirix/ap1000/ap1000.h @@ -164,7 +164,6 @@ void set_eat_machine_checks(int a_flag); int get_eat_machine_checks(void); unsigned int get_platform(void); -unsigned int get_device(void); void* memcpyb(void * dest,const void *src,size_t count); int process_bootflag(ulong bootflag); void user_led_on(void);