From patchwork Sat Oct 17 21:06:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 531882 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 AFDA71402DD for ; Sun, 18 Oct 2015 08:08:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=S8+bKrX1; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C67BF4B6D1; Sat, 17 Oct 2015 23:07:57 +0200 (CEST) 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 pxIxBN9gTwjd; Sat, 17 Oct 2015 23:07:57 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2CC3F4B65A; Sat, 17 Oct 2015 23:07:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A53A14B67D for ; Sat, 17 Oct 2015 23:07:22 +0200 (CEST) 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 gu3D_Ka6CAtV for ; Sat, 17 Oct 2015 23:07:22 +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-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) by theia.denx.de (Postfix) with ESMTPS id 1DE584B672 for ; Sat, 17 Oct 2015 23:07:14 +0200 (CEST) Received: by iofz202 with SMTP id z202so12780617iof.2 for ; Sat, 17 Oct 2015 14:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=cZlbcLpaElE3WSeAbUXxiIT/J9Ao05iZ2qUScH/4zQc=; b=S8+bKrX19l3O5kJ4ULg8cdkwDvU0Mxzgcv/QJg7QzjEfWYD+/VHlulPFTY+tt/S6cn QvrT7YkQOWPGQi6TMBtSzUGULiuZ+ZRGwDAyTveFVgBAtGQ/CXOyPfe6PaUPCX6qRQ13 CJmaauT5dm+IH0Dv91b8TkOgXe4d40hvRc2cZI+J4q7MarMFC8fxuYPuKuJ/UR1jIzDx sLmxHF2prSR6O5+MFVLPQP0sWPjwRa0yJhVyyB4WVUrcNUt99QweOkwtZdTo4cr0TbGz W7xqKF0cAcuj5HwrUUBTTjq1r+Ii91qVhaSgYkm8KcWXh7rcDWwLJA7HjlKhslAkXp/9 dBpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=cZlbcLpaElE3WSeAbUXxiIT/J9Ao05iZ2qUScH/4zQc=; b=RtEiX1e2AL+nCdM2JR1+g5kTO36TmlqmNKJ91wCV3FTKmPXY0egPPwcLDO42pWsoz+ auO5W7ct6Wk/GgCuRDQtnuK5tf8sOg1QofoxmtzdY+2rVc2ehyRJGGLDDslvblAHURO3 sf7b2vNb3YADpdPRNITASZuqsOSJchJOEXhYjtPAftYoIq7IjTO2qZJe8c7OmbKAthgu mPehgtZrGNfbFV0xS7GJWVUJjv2Th99F37X3BKn5vSRsYQb/8j+QDaFCL+vAPZahhuPg 14sVNYGeWCnfJKi3fEYncWTAtJ+cjvdY9XSzcRK5030tz2SYQnWLVl8eZJGeRuerISEC KICw== X-Gm-Message-State: ALoCoQmmXc9Pb0BsHHIto8LVp+NkcKsA400jLublDj0Kg3CXUaSTFGpmtv0Bs2cLO3aVFbL3yBs5 X-Received: by 10.107.170.200 with SMTP id g69mr25375639ioj.170.1445116033390; Sat, 17 Oct 2015 14:07:13 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id 77sm8886168ior.25.2015.10.17.14.07.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Oct 2015 14:07:11 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id B7D81221774; Sat, 17 Oct 2015 15:07:10 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 17 Oct 2015 15:06:58 -0600 Message-Id: <1445116021-27296-6-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1445116021-27296-1-git-send-email-sjg@chromium.org> References: <1445116021-27296-1-git-send-email-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 5/8] arm: Switch 32-bit ARM to using generic global_data setup X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" There is quite a bit of assembler code that can be removed if we use the generic global_data setup. Less arch-specific code makes it easier to add new features and maintain the start-up code. Drop the unneeded code and adjust the hooks in board_f.c to cope. Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: None arch/arm/lib/crt0.S | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S index 4c3a94a..80548eb 100644 --- a/arch/arm/lib/crt0.S +++ b/arch/arm/lib/crt0.S @@ -82,31 +82,11 @@ ENTRY(_main) #else bic sp, sp, #7 /* 8-byte alignment for ABI compliance */ #endif - mov r2, sp - sub sp, sp, #GD_SIZE /* allocate one GD above SP */ -#if defined(CONFIG_CPU_V7M) /* v7M forbids using SP as BIC destination */ - mov r3, sp - bic r3, r3, #7 - mov sp, r3 -#else - bic sp, sp, #7 /* 8-byte alignment for ABI compliance */ -#endif - mov r9, sp /* GD is above SP */ - mov r1, sp + mov r0, sp + bl board_init_f_mem + mov sp, r0 + mov r0, #0 -clr_gd: - cmp r1, r2 /* while not at end of GD */ -#if defined(CONFIG_CPU_V7M) - itt lo -#endif - strlo r0, [r1] /* clear 32-bit GD word */ - addlo r1, r1, #4 /* move to next */ - blo clr_gd -#if defined(CONFIG_SYS_MALLOC_F_LEN) - sub sp, sp, #CONFIG_SYS_MALLOC_F_LEN - str sp, [r9, #GD_MALLOC_BASE] -#endif - /* mov r0, #0 not needed due to above code */ bl board_init_f #if ! defined(CONFIG_SPL_BUILD)