From patchwork Wed Jul 27 10:31:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 107021 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 0B84CB6F82 for ; Wed, 27 Jul 2011 20:31:27 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1C55B2808F; Wed, 27 Jul 2011 12:31:22 +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 xgVzF1tdW7Dc; Wed, 27 Jul 2011 12:31:21 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2A1D228091; Wed, 27 Jul 2011 12:31:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2647C28091 for ; Wed, 27 Jul 2011 12:31:17 +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 lzDGX7wsqra4 for ; Wed, 27 Jul 2011 12:31:13 +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-qw0-f44.google.com (mail-qw0-f44.google.com [209.85.216.44]) by theia.denx.de (Postfix) with ESMTPS id 4F96C2808F for ; Wed, 27 Jul 2011 12:31:12 +0200 (CEST) Received: by qwc23 with SMTP id 23so755447qwc.3 for ; Wed, 27 Jul 2011 03:31:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.53.82 with SMTP id l18mr5067978qcg.286.1311762670835; Wed, 27 Jul 2011 03:31:10 -0700 (PDT) Received: by 10.229.65.81 with HTTP; Wed, 27 Jul 2011 03:31:10 -0700 (PDT) In-Reply-To: <1310658307-5278-1-git-send-email-grinberg@compulab.co.il> References: <4E1F03CC.5040401@compulab.co.il> <1310658307-5278-1-git-send-email-grinberg@compulab.co.il> Date: Wed, 27 Jul 2011 16:01:10 +0530 Message-ID: From: Chander Kashyap To: Igor Grinberg Cc: Albert Aribaud , Tom Warren , u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH v2 1/3] arm: add CONFIG_MACH_TYPE setting and documentation 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de dear Igor, On 14 July 2011 21:15, Igor Grinberg wrote: > CONFIG_MACH_TYPE is used to set the machine type number in the > common arm code instead of setting it in the board code. > Boards with dynamically discoverable machine types can still set the > machine type number in the board code. > > Signed-off-by: Igor Grinberg > --- > v2:     Document the option as mandatory. >        Move the bi_arch_number setting to board_init_f() > >  README               |   10 ++++++++++ >  arch/arm/lib/board.c |    4 ++++ >  2 files changed, 14 insertions(+), 0 deletions(-) > > diff --git a/README b/README > index 446966d..0b6802d 100644 > --- a/README > +++ b/README > @@ -442,6 +442,16 @@ The following options need to be configured: >                crash. This is needed for buggy hardware (uc101) where >                no pull down resistor is connected to the signal IDE5V_DD7. > > +               CONFIG_MACH_TYPE        [relevant for ARM only][mandatory] > + > +               This setting is mandatory for all boards that have only one > +               machine type and must be used to specify the machine type > +               number as it appears in the ARM machine registry > +               (see http://www.arm.linux.org.uk/developer/machines/). > +               Only boards that have multiple machine types supported > +               in a single configuration file and the machine type is > +               runtime discoverable, do not have to use this setting. > + >  - vxWorks boot parameters: > >                bootvx constructs a valid bootline using the following > diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c > index 169dfeb..9901694 100644 > --- a/arch/arm/lib/board.c > +++ b/arch/arm/lib/board.c > @@ -281,6 +281,10 @@ void board_init_f (ulong bootflag) > >        gd->mon_len = _bss_end_ofs; > > +#ifdef CONFIG_MACH_TYPE > +       gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */ > +#endif > + bd structure is not initialised by this time. It leads to u-boot hanging for my board. I fixed this problem but modifying it. Below is the patch attached for the same. >        for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { >                if ((*init_fnc_ptr)() != 0) { >                        hang (); > -- > 1.7.3.4 > > _______________________________________________ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot > From d8df2f0ca9f08470c0cb88307fea4a66f41147a5 Mon Sep 17 00:00:00 2001 From: Chander Kashyap Date: Wed, 27 Jul 2011 15:10:59 +0530 Subject: [PATCH] ARM: Fix wrong initialisation of bi_arch_number bi_arch_number is initialised using @arch/arm/lib/board.c \#ifdef CONFIG_MACH_TYPE gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */ \#endif bd structure is not intialized by this time. This leads to u-boot hanging when CONFIG_MACH_TYPE is defined. Signed-off-by: Chander Kashyap --- arch/arm/lib/board.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index bcbf697..98a9bcc 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -281,10 +281,6 @@ void board_init_f (ulong bootflag) gd->mon_len = _bss_end_ofs; -#ifdef CONFIG_MACH_TYPE - gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */ -#endif - for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { if ((*init_fnc_ptr)() != 0) { hang (); @@ -380,6 +376,9 @@ void board_init_f (ulong bootflag) gd->bd = bd; debug ("Reserving %zu Bytes for Board Info at: %08lx\n", sizeof (bd_t), addr_sp); +#ifdef CONFIG_MACH_TYPE + gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */ +#endif addr_sp -= sizeof (gd_t); id = (gd_t *) addr_sp; debug ("Reserving %zu Bytes for Global Data at: %08lx\n",