public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] how to use a function provided by u-boot in linux driver
@ 2009-05-19  6:19 Kartheek N S
  2009-05-19 14:26 ` Detlev Zundel
  2009-05-19 21:25 ` Wolfgang Denk
  0 siblings, 2 replies; 3+ messages in thread
From: Kartheek N S @ 2009-05-19  6:19 UTC (permalink / raw)
  To: u-boot


Hi All,
     I would like to use miiphy_read and miiphy_write functions provided by
u-boot in the linux kernel driver.
     This is required for reading the link status of each of the phys
associated with a switch.

    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.

Thanks,
Kartheek N S
-- 
View this message in context: http://www.nabble.com/how-to-use-a-function-provided-by-u-boot-in-linux-driver-tp23610373p23610373.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] how to use a function provided by u-boot in linux driver
  2009-05-19  6:19 [U-Boot] how to use a function provided by u-boot in linux driver Kartheek N S
@ 2009-05-19 14:26 ` Detlev Zundel
  2009-05-19 21:25 ` Wolfgang Denk
  1 sibling, 0 replies; 3+ messages in thread
From: Detlev Zundel @ 2009-05-19 14:26 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] how to use a function provided by u-boot in linux driver
  2009-05-19  6:19 [U-Boot] how to use a function provided by u-boot in linux driver Kartheek N S
  2009-05-19 14:26 ` Detlev Zundel
@ 2009-05-19 21:25 ` Wolfgang Denk
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2009-05-19 21:25 UTC (permalink / raw)
  To: u-boot

Dear Kartheek N S,

In message <23610373.post@talk.nabble.com> you wrote:
> 
>      I would like to use miiphy_read and miiphy_write functions provided by
> u-boot in the linux kernel driver.

This is not possible, and the request makes no sense.

When Linux boots, all the memory used by U-Boot is freed; no trace of
U-Boot is left behind in memory. You cannot call any U-Boot functions
from Linux, as U-Boot does not exist any more in RAM.

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

Linux has it's own interface and drivers to talk to PHYs and the like.


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
It's hard to make a program foolproof because fools are so ingenious.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-19 21:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-19  6:19 [U-Boot] how to use a function provided by u-boot in linux driver Kartheek N S
2009-05-19 14:26 ` Detlev Zundel
2009-05-19 21:25 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox