[U-Boot] Net driver questions

Krzysztof Halasa khc at pm.waw.pl
Mon Nov 2 00:07:43 CET 2009


Hello,

Please forgive me if answers to my questions are obvious, I'm new to
U-Boot.

I'm trying to port the Ethernet driver for Intel IXP4xx CPU from Linux
(I know there is Intel's code already ported). I've read the
doc/README.drivers.eth. I came across some problems:
- dev->halt() seems to be called before the first call to
  dev->init() (i.e., before the hardware is initialized). Is it on
  purpose?

- dev->recv() seems to be called recursively, for example while doing
  "dhcp" or "bootp" (ping is ok). dev->recv() in my driver calls
  NetReceive(), which in turn (without returning to the caller, i.e.,
  dev->recv(), first) reinitializes the driver on error (calls
  dev->halt() and dev->init()). This makes a lot of mess in the driver,
  should it stay this way? Perhaps we should queue the received packets
  and process them on return from dev->recv()? Or maybe return all those
  packets together?

- dev->recv() is provided with RX packet buffers. IXP4xx can only
  receive to already allocated memory so the driver has to provide it's
  own buffers prior to dev->recv(). I assume it's common situation with
  all hardware recent enough. Does the driver have to copy data to
  NetRxPackets[], or is it ok to simply call NetReceive using driver's
  buffers?
-- 
Krzysztof Halasa


More information about the U-Boot mailing list