From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pw0-f49.google.com ([209.85.160.49]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1OCkHj-000118-S6 for barebox@lists.infradead.org; Fri, 14 May 2010 02:06:00 +0000 Received: by pwj6 with SMTP id 6so1094115pwj.36 for ; Thu, 13 May 2010 19:05:54 -0700 (PDT) From: Marc Reilly Date: Fri, 14 May 2010 12:15:15 +1000 Message-Id: <1273803319-24561-2-git-send-email-marc@cpdesign.com.au> In-Reply-To: <1273803319-24561-1-git-send-email-marc@cpdesign.com.au> References: <1273803319-24561-1-git-send-email-marc@cpdesign.com.au> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 1/5] arm: Add revision tag to boot parameters To: barebox@lists.infradead.org Revision info required for some boards at boot time. Only adds if the system_rev has been set to non-zero. Signed-off-by: Marc Reilly --- arch/arm/include/asm/armlinux.h | 6 ++++++ arch/arm/lib/armlinux.c | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/armlinux.h b/arch/arm/include/asm/armlinux.h index cfe57f4..f4104fb 100644 --- a/arch/arm/include/asm/armlinux.h +++ b/arch/arm/include/asm/armlinux.h @@ -6,6 +6,7 @@ void armlinux_set_bootparams(void *params); void armlinux_set_architecture(int architecture); void armlinux_add_dram(struct device_d *dev); +void armlinux_set_revision(unsigned int); #else static inline void armlinux_set_bootparams(void *params) { @@ -18,6 +19,11 @@ static inline void armlinux_set_architecture(int architecture) static inline void armlinux_add_dram(struct device_d *dev) { } + +static inline void armlinux_set_revision(unsigned int) +{ +} + #endif #endif /* __ARCH_ARMLINUX_H */ diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c index 019c030..1c39045 100644 --- a/arch/arm/lib/armlinux.c +++ b/arch/arm/lib/armlinux.c @@ -44,6 +44,8 @@ static struct tag *params; static int armlinux_architecture = 0; static void *armlinux_bootparams = NULL; +static unsigned int system_rev; + static void setup_start_tag(void) { params = (struct tag *)armlinux_bootparams; @@ -106,6 +108,18 @@ static void setup_commandline_tag(const char *commandline) params = tag_next(params); } +static void setup_revision_tag(void) +{ + if( system_rev) { + params->hdr.tag = ATAG_REVISION; + params->hdr.size = tag_size(tag_revision); + + params->u.revision.rev = system_rev; + + params = tag_next(params); + } +} + #if 0 static void setup_initrd_tag(ulong initrd_start, ulong initrd_end) { @@ -147,6 +161,12 @@ void armlinux_add_dram(struct device_d *dev) list_add_tail(&mem->list, &memory_list); } +void armlinux_set_revision(unsigned int rev) +{ + system_rev = rev; +} + + #ifdef CONFIG_CMD_BOOTM int do_bootm_linux(struct image_data *data) { @@ -184,6 +204,7 @@ int do_bootm_linux(struct image_data *data) if (initrd_start && initrd_end) setup_initrd_tag (initrd_start, initrd_end); #endif + setup_revision_tag(); setup_end_tag(); if (relocate_image(data->os, (void *)ntohl(os_header->ih_load))) @@ -281,6 +302,7 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[]) if (initrd_start && initrd_end) setup_initrd_tag (initrd_start, initrd_end); #endif + setup_revision_tag(); setup_end_tag(); shutdown_barebox(); @@ -323,6 +345,7 @@ static int do_bootu(struct command *cmdtp, int argc, char *argv[]) setup_start_tag(); setup_memory_tags(); setup_commandline_tag(commandline); + setup_revision_tag(); setup_end_tag(); shutdown_barebox(); -- 1.6.4.2 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox