From patchwork Wed Apr 13 09:25:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Bie=C3=9Fmann?= X-Patchwork-Id: 90972 X-Patchwork-Delegate: info@emk-elektronik.de 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 E3E4EB6F70 for ; Wed, 13 Apr 2011 19:31:04 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E77E128223; Wed, 13 Apr 2011 11:31:01 +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 PXMHeF0LzsVp; Wed, 13 Apr 2011 11:31:01 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 226A528238; Wed, 13 Apr 2011 11:30:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E1CBB28238 for ; Wed, 13 Apr 2011 11:30:56 +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 6fhyz1i7LiJ0 for ; Wed, 13 Apr 2011 11:30:56 +0200 (CEST) X-Greylist: delayed 305 seconds by postgrey-1.27 at theia; Wed, 13 Apr 2011 11:30:54 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 moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by theia.denx.de (Postfix) with ESMTP id 0360928223 for ; Wed, 13 Apr 2011 11:30:54 +0200 (CEST) Received: from corscience.de (DSL01.212.114.252.242.ip-pool.NEFkom.net [212.114.252.242]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0MHci0-1QB1j40cxg-003OBQ; Wed, 13 Apr 2011 11:25:46 +0200 Received: from azuregos.cs.local (unknown [192.168.102.9]) by corscience.de (Postfix) with ESMTP id 9805C51F7B; Wed, 13 Apr 2011 11:25:45 +0200 (CEST) From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= To: u-boot@lists.denx.de Date: Wed, 13 Apr 2011 11:25:41 +0200 Message-Id: <1302686741-11090-1-git-send-email-biessmann@corscience.de> X-Mailer: git-send-email 1.7.2.5 MIME-Version: 1.0 X-Provags-ID: V02:K0:KwkuycsR1rP/jalQCkWH17xTDnLUDDgPWy6XVvEv7Dc qLAlQfHMabLlZDpcTOYx+xYhFPUOktz1r1h4J90n6PhFcze0HK Os+yaR+A+hT2z5BIz2XzdwyLpkx7QErbtXFCEuFLz+A46DrJB/ JHeO+2mvY+QYVIDEfHGCdqaMGzwpeT6vG6r+JLdjUrz1qZ05Kd hnFN1+IvbzJz5ukvm6Qvw== Cc: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= Subject: [U-Boot] [PATCH] avr32: add ATAG_BOARDINFO 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 This patch adds a new ATAG_BORADINFO to U-Boot. This tag is intended to hand over the bd->bi_board_number to the linux kernel for early stage board information like a board revision or other kind of board specific decisions necessary before the linux peripherial drivers are up. Signed-off-by: Andreas Bießmann --- I try to get this information interchange in mainline to have the ATAG key value reserved for that intended use. Please see http://lists.avr32linux.org/pipermail/kernel/2011-April/005593.html and http://article.gmane.org/gmane.linux.kernel/1125654 for more information. arch/avr32/include/asm/setup.h | 8 ++++++++ arch/avr32/lib/bootm.c | 11 +++++++++++ 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/arch/avr32/include/asm/setup.h b/arch/avr32/include/asm/setup.h index e6ef8d6..7f5d883 100644 --- a/arch/avr32/include/asm/setup.h +++ b/arch/avr32/include/asm/setup.h @@ -107,6 +107,13 @@ struct tag_ethernet { #define AETH_INVALID_PHY 0xff +/* board information information */ +#define ATAG_BOARDINFO 0x54410008 + +struct tag_boardinfo { + u32 board_number; +}; + struct tag { struct tag_header hdr; union { @@ -115,6 +122,7 @@ struct tag { struct tag_cmdline cmdline; struct tag_clock clock; struct tag_ethernet ethernet; + struct tag_boardinfo boardinfo; } u; }; diff --git a/arch/avr32/lib/bootm.c b/arch/avr32/lib/bootm.c index 8a47cfe..c9a55ff 100644 --- a/arch/avr32/lib/bootm.c +++ b/arch/avr32/lib/bootm.c @@ -165,6 +165,16 @@ static struct tag *setup_ethernet_tags(struct tag *params) return params; } +static struct tag *setup_boardinfo_tag(struct tag *params) +{ + params->hdr.tag = ATAG_BOARDINFO; + params->hdr.size = tag_size(tag_boardinfo); + + params->u.boardinfo.board_number = gd->bd->bi_board_number; + + return tag_next(params); +} + static void setup_end_tag(struct tag *params) { params->hdr.tag = ATAG_NONE; @@ -195,6 +205,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima params = setup_commandline_tag(params, commandline); params = setup_clock_tags(params); params = setup_ethernet_tags(params); + params = setup_boardinfo_tag(params); setup_end_tag(params); printf("\nStarting kernel at %p (params at %p)...\n\n",