Commit 24890f11980eb70d835ca7e0b00d32284d8f546c
Committed by
Albert ARIBAUD
1 parent
a950c81851
Exists in
master
and in
54 other branches
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. Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
Showing 2 changed files with 19 additions and 0 deletions Side-by-side Diff
arch/avr32/include/asm/setup.h
... | ... | @@ -107,6 +107,13 @@ |
107 | 107 | |
108 | 108 | #define AETH_INVALID_PHY 0xff |
109 | 109 | |
110 | +/* board information information */ | |
111 | +#define ATAG_BOARDINFO 0x54410008 | |
112 | + | |
113 | +struct tag_boardinfo { | |
114 | + u32 board_number; | |
115 | +}; | |
116 | + | |
110 | 117 | struct tag { |
111 | 118 | struct tag_header hdr; |
112 | 119 | union { |
... | ... | @@ -115,6 +122,7 @@ |
115 | 122 | struct tag_cmdline cmdline; |
116 | 123 | struct tag_clock clock; |
117 | 124 | struct tag_ethernet ethernet; |
125 | + struct tag_boardinfo boardinfo; | |
118 | 126 | } u; |
119 | 127 | }; |
120 | 128 |
arch/avr32/lib/bootm.c
... | ... | @@ -165,6 +165,16 @@ |
165 | 165 | return params; |
166 | 166 | } |
167 | 167 | |
168 | +static struct tag *setup_boardinfo_tag(struct tag *params) | |
169 | +{ | |
170 | + params->hdr.tag = ATAG_BOARDINFO; | |
171 | + params->hdr.size = tag_size(tag_boardinfo); | |
172 | + | |
173 | + params->u.boardinfo.board_number = gd->bd->bi_board_number; | |
174 | + | |
175 | + return tag_next(params); | |
176 | +} | |
177 | + | |
168 | 178 | static void setup_end_tag(struct tag *params) |
169 | 179 | { |
170 | 180 | params->hdr.tag = ATAG_NONE; |
... | ... | @@ -195,6 +205,7 @@ |
195 | 205 | params = setup_commandline_tag(params, commandline); |
196 | 206 | params = setup_clock_tags(params); |
197 | 207 | params = setup_ethernet_tags(params); |
208 | + params = setup_boardinfo_tag(params); | |
198 | 209 | setup_end_tag(params); |
199 | 210 | |
200 | 211 | printf("\nStarting kernel at %p (params at %p)...\n\n", |