From: Marc Reilly <marc@cpdesign.com.au>
To: barebox@lists.infradead.org
Cc: Marc Reilly <marc@susedev1.rulztime>
Subject: [PATCH 1/3] Add passing of revision tag when booting the kernel on ARM platforms.
Date: Sat, 8 May 2010 12:09:21 +1000 [thread overview]
Message-ID: <1273284563-28645-2-git-send-email-marc@cpdesign.com.au> (raw)
In-Reply-To: <1273284563-28645-1-git-send-email-marc@cpdesign.com.au>
From: Marc Reilly <marc@susedev1.rulztime>
---
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
next prev parent reply other threads:[~2010-05-08 1:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-08 2:09 Revision boot params to kernel for ARM and mx35 3 stack fixes Marc Reilly
2010-05-08 2:09 ` Marc Reilly [this message]
2010-05-08 2:09 ` [PATCH 2/3] Detect CPU and board revision for freescale-mx35-3-stack and add to boot parameters Marc Reilly
2010-05-08 2:09 ` [PATCH 3/3] mx35-3stack: fix Pad selection for CONTRAST pin Marc Reilly
2010-05-11 7:29 ` [PATCH 2/3] Detect CPU and board revision for freescale-mx35-3-stack and add to boot parameters Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1273284563-28645-2-git-send-email-marc@cpdesign.com.au \
--to=marc@cpdesign.com.au \
--cc=barebox@lists.infradead.org \
--cc=marc@susedev1.rulztime \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox