[U-Boot] Newby trying to port a Linux Ethernet driver into u-boot

Ismael Farfán sulfurfff at gmail.com
Fri Feb 24 01:51:19 UTC 2017


Hello list

I took a Linux driver for an Ethernet device and I'm trying to make it
work with u-boot.

I'm a little bit lost, so far I've based my work on
drivers/net/rtl8139.c because it uses "struct pci_device_id", as my
linux driver does, but I have no idea how to know if it's at least
trying to detect the device.

* I copied that file into newdev.c
* Changed the vendor and device ID for the card's and renamed the init function.
* Added the newdev.c file in such a way that I can select it from
"make menuconfig".
* Registered the CONFIG_NEWDEV macro somewhere.
* Long story short, I pretty much added a newdev everywhere I saw
rtl8139 in the source tree.

So far it's building -probably as a module, not sure- if I grep its
name in the u-boot* files created I can see 1 occurrence of it
followed by a number (it's address?)

I added a printf() in the init function I registered in include/net.h
(or something like that, I don't have the src at this moment) but I'm
not seeing the message, only one error message from net/eth_legacy.c,
it's not clear to me the relationship between net/ and drivers/net/.

I'm running in a well known hardware simulator.

Any advice you can give this newcomer?

Thanks in advance
-Farfan




-- 
Do not let me induce you to satisfy my curiosity, from an expectation,
that I shall gratify yours. What I may judge proper to conceal, does
not concern myself alone.


More information about the U-Boot mailing list