From patchwork Fri Jun 1 18:31:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 162362 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 30264B6FA1 for ; Sat, 2 Jun 2012 04:32:04 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6B9C7281DA; Fri, 1 Jun 2012 20:32:02 +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 rXTHPMqIx5V9; Fri, 1 Jun 2012 20:32:02 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 70873281CD; Fri, 1 Jun 2012 20:32:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D082C281CD for ; Fri, 1 Jun 2012 20:31:57 +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 7obj5dFZr1JV for ; Fri, 1 Jun 2012 20:31:57 +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-we0-f172.google.com (mail-we0-f172.google.com [74.125.82.172]) by theia.denx.de (Postfix) with ESMTPS id 12476281CA for ; Fri, 1 Jun 2012 20:31:55 +0200 (CEST) Received: by werb13 with SMTP id b13so1554787wer.3 for ; Fri, 01 Jun 2012 11:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=MrMBDjM3wQmxsceWUOvcclk1gfMs+SF0h2kRhBG1ZhI=; b=J2ZHeHxbcxkVkVBqMhdt1/OvBkGpdwunG4/g+voZiMA/m3PqoTOsYYbjfNbsj9odZN twEol7pE4f4ie9Y6kbpoJwE3Xc/DiPG6yozthlXU3gPrr1TYuKLTnZ5WijxF99UvnUyT P8JDvL8mjUs+oZc5LP0Dx6lvNB1uBT3jC3PGcNuIGiI4+/Mr/xk1YlnBl2pT09VZU0Fn bcoMFzz/B8FWJOpGHGrrPSt+ihlEBnjSsl6ZDHLFQNQNIeH4F+g/9caV8eiw2ByfRkBy NNE/IB0D0iNdKY0jWQfzfVQhdzrIHTlwCtcY/eyznnlZI7h00/aKmbO/EG0hzhIN6al+ g3vQ== Received: by 10.216.216.1 with SMTP id f1mr2892128wep.24.1338575513572; Fri, 01 Jun 2012 11:31:53 -0700 (PDT) Received: from pali-elitebook.localnet (pali.kolej.mff.cuni.cz. [78.128.193.202]) by mx.google.com with ESMTPS id gv7sm12344045wib.4.2012.06.01.11.31.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Jun 2012 11:31:51 -0700 (PDT) From: Pali =?ISO-8859-1?Q?Roh=E1r?= To: Marek Vasut Date: Fri, 01 Jun 2012 20:31:49 +0200 Message-ID: <4251764.r7rgFUUbND@pali> User-Agent: KMail/4.8.3 (Linux/3.2.0-25-generic; KDE/4.8.3; x86_64; ; ) In-Reply-To: <201204291508.01145.marex@denx.de> References: <1335634011-9104-1-git-send-email-pali.rohar@gmail.com> <5992269.LhFVZi1UCt@pali> <201204291508.01145.marex@denx.de> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH v2 01/11] arm: Optionally use existing atags in bootm.c 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 On Sunday 29 April 2012 15:08:00 you wrote: > Dear Pali Rohár, > > > On Sunday 29 April 2012 11:10:42 Marek Vasut wrote: > > > Dear Pali Rohár, > > > > > > > On Sunday 29 April 2012 00:15:23 Marek Vasut wrote: > > > > > Won't it be easier to create a preprocessing function > > > > > that'd > > > > > fill gd properly, so uboot can generate the atags > > > > > through > > > > > standard means then? > > > > > > > > Do you mean to generate/copy other atags in board code? > > > > This > > > > will not work because u-boot (in bootm.c) always passing > > > > ATAG_CORE in function setup_start_tag. And I do not want > > > > to > > > > pass ATAG_CORE two times to kernel (once which I copy > > > > from > > > > other bootloader and once which generate u-boot). > > > > > > No, I mean parse the old ATAGS from nolo and fill u-boot's > > > internal structures with that. Then let uboot generate the > > > ATAGS from it's internal structures as usual. > > > > > > Best regards, > > > Marek Vasut > > > > Ok, but what to do with non-standard omap/maemo atags which > > is > > used only for maemo (atag for bootreason, atag for bootmode > > ...)? U-Boot does not have internal structures for these > > non-standrad atags and also does not support passing it. > > Implement support for passing ad-hoc additional non-standard > atags then? > > Best regards, > Marek Vasut Hi, what do you think about adding function setup_board_tags which will be implemented in board code? diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h index 89df4dc..572cb2a 100644 --- a/arch/arm/include/asm/setup.h +++ b/arch/arm/include/asm/setup.h @@ -267,3 +267,10 @@ struct meminfo { extern struct meminfo meminfo; #endif + +/* + * Board specified tags + */ +#ifdef CONFIG_SETUP_BOARD_TAGS +void setup_board_tags(struct tag **in_params); +#endif diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 599547d..9c27405 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -111,6 +111,15 @@ static void announce_and_cleanup(void) defined(CONFIG_INITRD_TAG) || \ defined(CONFIG_SERIAL_TAG) || \ defined(CONFIG_REVISION_TAG) +#ifndef CONFIG_ATAG_CORE_FLAGS +#define CONFIG_ATAG_CORE_FLAGS 0 +#endif +#ifndef CONFIG_ATAG_CORE_PAGESIZE +#define CONFIG_ATAG_CORE_PAGESIZE 0 +#endif +#ifndef CONFIG_ATAG_CORE_ROOTDEV +#define CONFIG_ATAG_CORE_ROOTDEV 0 +#endif static void setup_start_tag (bd_t *bd) { params = (struct tag *)bd->bi_boot_params; @@ -118,9 +127,9 @@ static void setup_start_tag (bd_t *bd) params->hdr.tag = ATAG_CORE; params->hdr.size = tag_size (tag_core); - params->u.core.flags = 0; - params->u.core.pagesize = 0; - params->u.core.rootdev = 0; + params->u.core.flags = CONFIG_ATAG_CORE_FLAGS; + params->u.core.pagesize = CONFIG_ATAG_CORE_PAGESIZE; + params->u.core.rootdev = CONFIG_ATAG_CORE_ROOTDEV; params = tag_next (params); } @@ -304,6 +313,9 @@ static void boot_prep_linux(bootm_headers_t *images) setup_initrd_tag(gd->bd, images->rd_start, images->rd_end); #endif +#ifdef CONFIG_SETUP_BOARD_TAGS + setup_board_tags(¶ms); +#endif setup_end_tag(gd->bd); #else /* all tags */ printf("FDT and ATAGS support not compiled in - hanging\n");