[U-Boot] Porting TPM support (from Linux) to U-Boot

Wolfgang Denk wd at denx.de
Tue Feb 22 12:18:37 CET 2011


Dear Huewe.external at infineon.com,

In message <B2E5851D0F254D45B5019F4DD73497573D00647566 at mucse405.eu.infineon.com> you wrote:
>
> This setup works quite fine.
> But I'm almost sure that this is not the correct way to port a linux driver
>  to u-boot. ;)

There is no general, one-size-fits-all approach.

> Can you perhaps point me to some resources how to do it correctly?
> How would you start? And how would you split up the files?

This cannot be answered without seing the code. Submit your code as
patches, so it can be reviewed.

> Furthermore I have some related questions:
> -       Is U-Boot using a libc / can I use functions from the glibc/ulibc?
> Are there any constraints?

U-Boot is self-contained. It does not use any expternal libc, but
provides all needed functions itself (which is obviously only a small
subset of standard libc functionality).

> -       Is there an equivalent for jiffies in u-boot? Or rather what is the
>  correct way to handle timeouts?

Please use the U-Boot timer functions (udelay(), get_timer()).

> -       Is there an equivalent for be32_to_cpu ? (big endian to whatever en
> dianess the cpu uses) in u-boot?

We have be32_to_cpu(), or you could use ntohl().

Hm... why didn't you check this yourself?  All it takes is a "grep"
...

> "This email and any attachments are confidential and may be subject to lega
> l or some other professional privilege. They are intended solely for the at
...

Please omit such crap whewn posting to public mailing lists.


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
"Data is a lot like humans: It is  born.  Matures.  Gets  married  to
other  data, divorced. Gets old. One thing that it doesn't do is die.
It has to be killed."                                 - Arthur Miller


More information about the U-Boot mailing list