From patchwork Thu Aug 22 12:52:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 269052 X-Patchwork-Delegate: albert.aribaud@free.fr 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 AD8282C0098 for ; Thu, 22 Aug 2013 22:52:38 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DA72D4A06E; Thu, 22 Aug 2013 14:52:34 +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 jm8ao58TLe1x; Thu, 22 Aug 2013 14:52:34 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B310F4A062; Thu, 22 Aug 2013 14:52:33 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 83B814A063 for ; Thu, 22 Aug 2013 14:52:27 +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 a56C5bymVx71 for ; Thu, 22 Aug 2013 14:52:21 +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-ea0-f174.google.com (mail-ea0-f174.google.com [209.85.215.174]) by theia.denx.de (Postfix) with ESMTPS id 460B54A05E for ; Thu, 22 Aug 2013 14:52:15 +0200 (CEST) Received: by mail-ea0-f174.google.com with SMTP id z15so882009ead.5 for ; Thu, 22 Aug 2013 05:52:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:sender:from:to:subject:date:message-id :content-type; bh=hcr11k8f4dJJKD1LCcfUtblwIz4bfqKjR7EvUQtoMT4=; b=Z02m4XMIKMRyr/SJsfZh8IT/K+xxRzp/inUKf7PyPltwRsNlzdv1aZl8lIyqrbDIpy AarJUtqvpBDymNv0H8NZGsUJHp+BNHMl/dCeu1PTiZtYgI8gGn/LGE97IJk5C5GIlzFM w8o7kFR9D3h99bUk1Z8Soik7a45fsI3dbLcStNegfX36/vrgpDJV1h+WQm/PpFyNXGj8 /0aG92qG2gdIHiHq814tZYEnGHhTCHrKOTYgotwkaROin0Xae6iY5BZBClheM3RumZbw YutXc3OyXsUQIi8Xo7EF65Qxm9nmZ9ao5wGEjK73/ze+GjT8wu8js77qYhte60yJHd4d tJbQ== X-Gm-Message-State: ALoCoQmtOAdBJCUZpiONUr+cSnKFFPivqMcb5rIpsE2U1AHrag7jwAMRjjprfO5CPP04zKSkYRE8 X-Received: by 10.14.113.137 with SMTP id a9mr18361027eeh.3.1377175935098; Thu, 22 Aug 2013 05:52:15 -0700 (PDT) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id p5sm17374548eeg.5.1969.12.31.16.00.00 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Thu, 22 Aug 2013 05:52:14 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, Albert Aribaud , Sven Schwermer Date: Thu, 22 Aug 2013 14:52:02 +0200 Message-Id: <230d876ac5e8ec8d7a16c90415263154650d0486.1377175919.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.8.2.3 Subject: [U-Boot] [PATCH] zynq: Use arch_cpu_init() instead of lowlevel_init() 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 Zynq lowlevel_init() was implemented in C but stack pointer is setup after function call in _main(). Move architecture setup to arch_cpu_init() which is call as the first function in board_init_f() which already have correct stack pointer. Reported-by: Sven Schwermer Signed-off-by: Michal Simek --- I can't see any problem to call zynq setup a little bit later. There is already expectation that u-boot runs from DDR. Moving lowlevel_init from C to ASM is possible but I will have to introduce new macros with hardcoded values. Using structures is much nicer. --- arch/arm/cpu/armv7/zynq/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 1.8.2.3 diff --git a/arch/arm/cpu/armv7/zynq/cpu.c b/arch/arm/cpu/armv7/zynq/cpu.c index 4367d1a..8846f30 100644 --- a/arch/arm/cpu/armv7/zynq/cpu.c +++ b/arch/arm/cpu/armv7/zynq/cpu.c @@ -11,6 +11,10 @@ void lowlevel_init(void) { +} + +int arch_cpu_init(void) +{ zynq_slcr_unlock(); /* remap DDR to zero, FILTERSTART */ writel(0, &scu_base->filter_start); @@ -31,6 +35,8 @@ void lowlevel_init(void) writel(0xC, &slcr_base->ddr_urgent); zynq_slcr_lock(); + + return 0; } void reset_cpu(ulong addr)