[U-Boot] how to use a function provided by u-boot in linux driver

Detlev Zundel dzu at denx.de
Tue May 19 16:26:50 CEST 2009


Hi Kartheek,

>      I would like to use miiphy_read and miiphy_write functions provided by
> u-boot in the linux kernel driver.

Why would you want to do such a weird thing?

By the time Linux boots, U-Boot will be completely overwritten in
memory.  After all, Linux is perfectly able to care for itself ;)

>      This is required for reading the link status of each of the phys
> associated with a switch.

So implement similar code in the Linux driver.

>     I added miiphy_read and miiphy_write to the exports.h and tried to use
> it in the kernel. But we get lots of multiple reference errors as some
> libraries will be there both in u-boot and linux kernel.
>
>     Could I do something like a dll or lib for these functions and use them
> in the linux kernel driver ?
>     Please guide me on this.

We do not do such a form of sharing.  Actually we copy much code from
Linux to U-Boot - the other way is rather seldom - and then we try to
keep the code exatly the same as in Linux to allow for easy updates in
the future.

Cheers
  Detlev

-- 
Given that I had no time for a nervous breakdown, I chose to fix the
issue instead...
                              -- Philippe Gerum
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de


More information about the U-Boot mailing list