Skip to contentSkip to conversation

avr32: add ATAG_BOARDINFO

PATCH New Andreas Bießmann 4 participants 8 messages Apr 13, 2011 – Apr 19, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 avr32: add ATAG_BOARDINFO

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.

---
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(-)
arch/avr32/include/asm/setup.h +8 -0
index e6ef8d6..7f5d883 100644
@@ -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;
 };
 
arch/avr32/lib/bootm.c +11 -0
index 8a47cfe..c9a55ff 100644
@@ -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",
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 1/1 avr32: add ATAG_BOARDINFO

Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

Quoted 4 lines · In message <[email protected]> you…

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.

Is this ATAG_BOARDINFO already supported by the ARM Linux kernel? I cannot find it there, nor can I find any postings referencing it on linux-arm-kernel

I think it's a fundamentally wrong approach to take, like the MACH-ID's have been right from day one. By now we should have learned that lesson and not repeat it again.

ARM Linux is in the process of being converted to using the Device Tree for description of hardware specifics, so this is the way to go for new things.

#2 lore raw

PATCH 1/1 avr32: add ATAG_BOARDINFO

Dear Wolfgang Denk,

Am 13.04.2011 13:44, schrieb Wolfgang Denk:

Quoted 11 lines

Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

Quoted 4 lines · In message <[email protected]> you…

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.

Is this ATAG_BOARDINFO already supported by the ARM Linux kernel? I cannot find it there, nor can I find any postings referencing it on linux-arm-kernel

No, it is avr32!

Please see
http://lists.avr32linux.org/pipermail/kernel/2011-April/005593.html
and http://article.gmane.org/gmane.linux.kernel/1125654

Quoted 3 lines

I think it's a fundamentally wrong approach to take, like the MACH-ID's have been right from day one. By now we should have learned that lesson and not repeat it again.

Well, there is no fixed mechanism planed for using this information in linux kernel. But we use it in our (not mainline) product. In one comment in mentioned threads above I explain why this is needed. In short I like to pin that ATAG key value to that function to have it reserved if one other thinks to introduce another ATAG key not using that one.

Quoted 3 lines

ARM Linux is in the process of being converted to using the Device Tree for description of hardware specifics, so this is the way to go for new things.

Well, you may be right here, but I don't think we get so much AVR32 SoC or boards in future as we have on ARM side.

Quoted 3 lines

From my point of view, I would like to reject this patch. If you however manage to get this accepted for mainline Linux, then maybe I reconsider.

For now this submission is mostly to reference from linux-list to have a test basis for other users. I will resend or trigger the list, if my patch in linux tree will be accepted.

regards

Andreas Bie?mann

#3 lore raw

PATCH 1/1 avr32: add ATAG_BOARDINFO

In reply to Wolfgang Denk

Dear Wolfgang Denk,

Am 13.04.2011 13:44, schrieb Wolfgang Denk:

Quoted 5 lines

Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

From my point of view, I would like to reject this patch. If you however manage to get this accepted for mainline Linux, then maybe I reconsider.

The patch was accepted in kernel mainline (see
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=24a1a47562b0fbb97321191dcc3a67b337b20f8f
)

Please consider accepting this patch in u-boot.

regards

Andreas Bie?mann

#4 lore raw

PATCH 1/1 avr32: add ATAG_BOARDINFO

Dear "=?ISO-8859-1?Q?Andreas_Bie=DFmann?=",

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 4 lines

From my point of view, I would like to reject this patch. If you however manage to get this accepted for mainline Linux, then maybe I reconsider.

The patch was accepted in kernel mainline (see
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=24a1a47562b0fbb97321191dcc3a67b337b20f8f
)

Ouch... oooouchh!

Quoted 1 line

Please consider accepting this patch in u-boot.

Guess I have no other choice now, but you owe me a new keyboard.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There are always alternatives.
	-- Spock, "The Galileo Seven", stardate 2822.3
#5 lore raw

PATCH 1/1 avr32: add ATAG_BOARDINFO

Dear Wolfgang Denk:

Quoted 12 lines

Dear "=?ISO-8859-1?Q?Andreas_Bie=DFmann?=",

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 4 lines

From my point of view, I would like to reject this patch. If you however manage to get this accepted for mainline Linux, then maybe I reconsider.

The patch was accepted in kernel mainline (see
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=24a1a47562b0fbb97321191dcc3a67b337b20f8f
)

Quoted 5 lines

Ouch... oooouchh!

Quoted 1 line

Please consider accepting this patch in u-boot.

Guess I have no other choice now, but you owe me a new keyboard.

I'm busy right now, but I will take this (and other stuff) in during the upcoming weekend.

Best Regards,
Reinhard

#6 lore raw

PATCH 1/1 avr32: add ATAG_BOARDINFO

Dear Reinhard Meyer,

Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 2 lines

Guess I have no other choice now, but you owe me a new keyboard.

I'm busy right now, but I will take this (and other stuff) in during the upcoming weekend.

Thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q: Why do PCs have a reset button on the front?
A: Because they are expected to run Microsoft operating systems.
#7 lore raw

PATCH 1/1 avr32: add ATAG_BOARDINFO

Dear Wolfgang Denk,

Quoted 6 lines

Dear Reinhard Meyer,

Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 2 lines

Guess I have no other choice now, but you owe me a new keyboard.

I'm busy right now, but I will take this (and other stuff) in during the upcoming weekend.

Applied to u-boot-atmel/next.

Best Regards,

Reinhard