[U-Boot] [PATCH] avr32: add ATAG_BOARDINFO

Andreas Bießmann biessmann at corscience.de
Wed Apr 13 11:25:41 CEST 2011


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 <biessmann at corscience.de>
---
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",
-- 
1.7.2.5



More information about the U-Boot mailing list