[U-Boot] [PATCH v2 1/2] Introduce generic TPM support in u-boot

Vadim Bendebury vbendeb at chromium.org
Sun Oct 16 22:42:01 CEST 2011


Dear Wolfgang Denk,

On Sun, Oct 16, 2011 at 1:31 PM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Vadim Bendebury,
>
> In message <CAC3GErH1GpLTEfH3ELi5ebtJPz0HLcJxj3YX3GGUU9HgcHErGA at mail.gmail.com> you wrote:
>>
>> > Yes, I consider this weird, too.  And you failed to provide a good
>> > explanation why you think this would be needed so far.
>>
>> My explanation is that it is better readable when the entire
>> information about a chip is contained in one type, as opposed to
>> having the size separate and needed to be carried around (instead of
>> using ARRAY_SIZE() when needed). When the pointer to the chip
>> structure is passed around, the recipient does not have to be aware of
>> a separate definition, all information about the chip is contained in
>> a structure.
>
> I read your explanation, but I still fail to uinderstand why we need
> an additinal wrapper around the internal strcut, which is the only
> element.
>
>> Sorry, I am restating the reasons here because I am not sure if you
>> wrote your previous reply before seeing them.
>
> I did. That's why I wrote you failed to provide a _good_ explanation.
>

ok.

>> Please let me know if you don't find this explanation convincing, I
>> will change the code as you suggest.
>>
>> >> Are macros acceptable to wrap input output with debug messages, as was
>> >> suggested earlier on this list, or should I replace each macro with
>> >> two inline functions?
>> >
>> > Sorry, I don't remember which code you are referring to here.
>> >
>>
>> I am referring to this message:
>>
>> http://lists.denx.de/pipermail/u-boot/2011-October/104780.html
>
> Yes, I know that.  But why would one macro turn into two inline
> functions?
>

because this chip is sensitive to the access cycle size (byte versus word).

When using macros one can rely on the passed in pointer type to decide
which access to use (byte vs word). If using inline functions, there
would be two separate functions required for read (byte and u32) and
write (byte and u32).

cheers,
/vb

> Best regards,
>
> Wolfgang Denk
>
> --
> 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
> Alan Turing thought about criteria to settle the question of  whether
> machines  can think, a question of which we now know that it is about
> as relevant as the question of whether submarines can swim.
>                                                   -- Edsger Dijkstra
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>


More information about the U-Boot mailing list