Subject: Re: Newbie looking to figure out how to do a port!
To: Peter Seebach <seebs@plethora.net>
From: Jachym Holecek <freza@dspfpga.com>
List: tech-ports
Date: 02/17/2006 19:00:19
> Apparently, the configuration data I need (MAC address for the (programmable)
> ethernet controller) is available over IIC.  In Linux, they have a special
> custom minimalist I2C driver JUST for this chip used ONLY to get at the RTC
> info.  However, we seem to have a working iic driver... Which leads me to
> suspect that it ought to be possible to have the emac driver simply use
> that.
> 
> Only the emac driver loads first, so even if I knew how to use the iic driver,
> it wouldn't be READY yet at the point in the emac driver setup I need it at.

I can think of:

  1. config_defer() the part of emac(4) initialization that _really_
     needs to know MAC address -- this would be the address filter
     setup and ethar_ifattach() I think -- and make gpiic fill in
     the MAC into property database for emac(4) to pick up.

     [Note that my knowledge of the emac(4) is superficial -- just
      took a peek at it this week when working on TEMAC for
      evbppc/virtex (TBD RSN ;)]

  2. the IIC seems to bitbanged over a few OPB registers, so cover
     them with initial TLB mapping and modify gpiic so that it
     provides inippc() with a way to get at the bus. Then, from
     initppc() load the MAC address to property database and have
     emac(4) pick it up later.

I'm not sure either of these is exactly nice though...

	-- Jachym