From patchwork Thu Mar 1 13:23:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 144003 X-Patchwork-Delegate: marek.vasut@gmail.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 6197DB6EEC for ; Fri, 2 Mar 2012 00:23:20 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A8E5528085; Thu, 1 Mar 2012 14:23:18 +0100 (CET) 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 mxE0496KAqr9; Thu, 1 Mar 2012 14:23:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E3E3B28080; Thu, 1 Mar 2012 14:23:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 70FE728080 for ; Thu, 1 Mar 2012 14:23:13 +0100 (CET) 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 7TX14PnGMUya for ; Thu, 1 Mar 2012 14:23:12 +0100 (CET) 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-ey0-f172.google.com (mail-ey0-f172.google.com [209.85.215.172]) by theia.denx.de (Postfix) with ESMTPS id 5FF252807E for ; Thu, 1 Mar 2012 14:23:11 +0100 (CET) Received: by eaaq11 with SMTP id q11so275742eaa.3 for ; Thu, 01 Mar 2012 05:23:10 -0800 (PST) Received-SPF: pass (google.com: domain of festevam@gmail.com designates 10.14.99.1 as permitted sender) client-ip=10.14.99.1; Authentication-Results: mr.google.com; spf=pass (google.com: domain of festevam@gmail.com designates 10.14.99.1 as permitted sender) smtp.mail=festevam@gmail.com; dkim=pass header.i=festevam@gmail.com Received: from mr.google.com ([10.14.99.1]) by 10.14.99.1 with SMTP id w1mr3107580eef.49.1330608190818 (num_hops = 1); Thu, 01 Mar 2012 05:23:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=KtHBNNl30/wOOm9IFYjmciMORwmxxk5ffActrlgVmSw=; b=pw3VerPYphIJyiEnK/HkLOlkNMk2dyVtdXjDOmHAZVBEITF4Opfc1QI9eBvEszDl4n 3k7E0PvJdIAVMSrk6xFG77URUustjb3qp1MuLkwL5ubAHnBq2VGv0T5tvcnJNnALwOfe AwVAkEKDAx9t6mQSHb+Aels6+j0mqW8xWFaLE= MIME-Version: 1.0 Received: by 10.14.99.1 with SMTP id w1mr2374069eef.49.1330608190738; Thu, 01 Mar 2012 05:23:10 -0800 (PST) Received: by 10.213.15.208 with HTTP; Thu, 1 Mar 2012 05:23:10 -0800 (PST) Date: Thu, 1 Mar 2012 10:23:10 -0300 Message-ID: From: Fabio Estevam To: U-Boot-Denx , Stefano Babic , Marek Vasut , Albert ARIBAUD Subject: [U-Boot] Do we really need CONFIG_ARCH_CPU_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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Hi, Currently CONFIG_ARCH_CPU_INIT is used to select arch_cpu_init() function. arch_cpu_init() does CPU level initialization, so why do we need to include CONFIG_ARCH_CPU_INIT in the include/configs/boardXYZ files, which are board related files ? For example: Let's say boards X, Y and Z are based on SoC S: 1. If processor S has a arch_cpu_init() defined, then it means that X,Y,Z need the code from arch_cpu_init() and then we need to define CONFIG_ARCH_CPU_INIT for each of these boards (actually all the boards based on this processor would need CONFIG_ARCH_CPU_INIT) 2. If not all boards need the code inside arch_cpu_init() for processor S, then it means that this code is not really CPU specific and then it should be moved to board code. I was thinking in doing the following: ,so that CONFIG_ARCH_CPU_INIT is not needed anymore. Before I go further in this route to remove CONFIG_ARCH_CPU_INIT from other places, I would like to know if this makes sense. Thanks, Fabio Estevam --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -224,10 +224,15 @@ void __dram_init_banksize(void) void dram_init_banksize(void) __attribute__((weak, alias("__dram_init_banksize"))); +int __arch_cpu_init(void) +{ + return 0; +} +int arch_cpu_init(void) + __attribute__((weak, alias("__arch_cpu_init"))); + init_fnc_t *init_sequence[] = { -#if defined(CONFIG_ARCH_CPU_INIT) arch_cpu_init, /* basic arch cpu dependent setup */ -#endif #if defined(CONFIG_BOARD_EARLY_INIT_F) board_early_init_f, #endif