[U-Boot-Users] [PATCH] pass custom data to Linux

Anders Larsen alarsen at rea.de
Mon Nov 17 10:22:26 CET 2003


Wolfgang Denk <wd at denx.de> schreibt:
>In message <fc.004c4e48001e7bee004c4e48001e648f.1e7c14 at rea.de> you wrote:
>>
>> Another solution could be to add two fields to struct bd_info, e.g.
>> bi_sernum and bi_revision, possibly "protected" by
>> #ifdef CONFIG_SERNUM_TAG and #ifdef CONFIG_REVISION_TAG
>> (bi_sernum is already defined similarly for at least the NX823),
>> and have armlinux pass those to the kernel.
>
>How would you do this, then?  To  pass  this  information  you  would
>probably create the custom tags discussed earlier, right?

Hi Wolfgang,

I'd use the standard tags ATAG_SERIAL and ATAG_REVISION and add
corresponding setup_*_tag() functions to armlinux.c
>
>> This is arguably a cleaner solution than my generic hook.
>
>I'm not so sure. Keep in mind that the bd_info structure  comes  from
>the  PowerPC architecture, wher eit is (more or less directly) passed
>to the Linux kernel. For ARM it is not such a natural thing  to  use.
>And  in  the  long run (when PPC finally starts using bi_recs) it may
>disappear there, too.

Oh, I wasn't aware that bd_info is going to be obsoleted.
Well, how about (ab)using the environment variables serial# and
e.g. revision# for the purpose and leave bd_info alone.
The only problem I see here is that the environment variables can hold
arbitrary strings, whereas the ATAGs expect a 32-bit binary value.

Cheers
 Anders





More information about the U-Boot mailing list