mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: barebox@lists.infradead.org
Subject: [PATCH 1/3] arm: add support for the serial ATAG
Date: Mon,  2 Aug 2010 14:58:51 +0300	[thread overview]
Message-ID: <531234713e1c3de945df03afb0a1dc96165bea22.1280749932.git.baruch@tkos.co.il> (raw)
In-Reply-To: <cover.1280749932.git.baruch@tkos.co.il>

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 arch/arm/include/asm/armlinux.h |    4 ++++
 arch/arm/lib/armlinux.c         |   19 +++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/armlinux.h b/arch/arm/include/asm/armlinux.h
index f4104fb..a92d4c1 100644
--- a/arch/arm/include/asm/armlinux.h
+++ b/arch/arm/include/asm/armlinux.h
@@ -7,6 +7,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);
+void armlinux_set_serial(u64);
 #else
 static inline void armlinux_set_bootparams(void *params)
 {
@@ -24,6 +25,9 @@ static inline void armlinux_set_revision(unsigned int)
 {
 }
 
+void armlinux_set_serial(u64)
+{
+}
 #endif
 
 #endif /* __ARCH_ARMLINUX_H */
diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
index 17ae057..040fd34 100644
--- a/arch/arm/lib/armlinux.c
+++ b/arch/arm/lib/armlinux.c
@@ -46,6 +46,7 @@ static int armlinux_architecture = 0;
 static void *armlinux_bootparams = NULL;
 
 static unsigned int system_rev;
+static u64 system_serial;
 
 static void setup_start_tag(void)
 {
@@ -121,6 +122,19 @@ static void setup_revision_tag(void)
 	}
 }
 
+static void setup_serial_tag(void)
+{
+	if (system_serial) {
+		params->hdr.tag = ATAG_SERIAL;
+		params->hdr.size = tag_size(tag_serialnr);
+
+		params->u.serialnr.low  = system_serial & 0xffffffff;
+		params->u.serialnr.high = system_serial >> 32;
+
+		params = tag_next(params);
+	}
+}
+
 #if 0
 static void setup_initrd_tag(ulong initrd_start, ulong initrd_end)
 {
@@ -155,6 +169,7 @@ static void setup_tags(void)
 		setup_initrd_tag (initrd_start, initrd_end);
 #endif
 	setup_revision_tag();
+	setup_serial_tag();
 	setup_end_tag();
 
 	printf("commandline: %s\n"
@@ -186,6 +201,10 @@ void armlinux_set_revision(unsigned int rev)
 	system_rev = rev;
 }
 
+void armlinux_set_serial(u64 serial)
+{
+	system_serial = serial;
+}
 
 #ifdef CONFIG_CMD_BOOTM
 int do_bootm_linux(struct image_data *data)
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2010-08-02 11:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-02 11:58 [PATCH 0/3] arm/imx: serial number / UID support Baruch Siach
2010-08-02 11:58 ` Baruch Siach [this message]
2010-08-02 12:13   ` [PATCH 1/3] arm: add support for the serial ATAG Uwe Kleine-König
2010-08-02 11:58 ` [PATCH 2/3] imx25: add support for UID read from eFuse Baruch Siach
2010-08-02 11:58 ` [PATCH 3/3] mx25 3ds: set CPU UID Baruch Siach
2010-08-02 12:02 ` [PATCH 0/3] arm/imx: serial number / UID support Jean-Christophe PLAGNIOL-VILLARD
2010-08-04  6:46   ` Baruch Siach
2010-08-04 10:25     ` Jean-Christophe PLAGNIOL-VILLARD

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=531234713e1c3de945df03afb0a1dc96165bea22.1280749932.git.baruch@tkos.co.il \
    --to=baruch@tkos.co.il \
    --cc=barebox@lists.infradead.org \
    /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