From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Tue, 24 Jun 2008 16:05:36 -0700 Subject: [U-Boot-Users] [PATCH] Add mechanisms for CPU and board-specific Ethernet initialization In-Reply-To: <20080624223248.GA18929@game.jcrosoft.org> References: <1213086567-29194-1-git-send-email-biggerbadderben@gmail.com> <484E9AD9.2060802@ruby.dti.ne.jp> <200806101725.37247.sr@denx.de> <484EA29F.2080905@ruby.dti.ne.jp> <484EA8F6.4030502@gmail.com> <20080624223248.GA18929@game.jcrosoft.org> Message-ID: <48617DC0.8010707@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Jean-Christophe PLAGNIOL-VILLARD wrote: > On 09:16 Tue 10 Jun , Ben Warren wrote: > >> Shinya Kuribayashi wrote: >> >>> Stefan Roese wrote: >>> >>>> On Tuesday 10 June 2008, Shinya Kuribayashi wrote: >>>> >>>>>>> Shouldn't this be the other way around? >>>>>>> >>>>>>> + if (board_eth_init(bis) < 0) >>>>>>> + eth_eth_init(bis); >>>>>>> >>>>>>> So that the board init routine can "overwrite" the cpu init version. >>>>>>> >>>>>> Yeah, I think you're right. If board_eth_init() exists, it gets >>>>>> highest priority. >>>>>> >>>>> Just wondered, does that mean we could only have either cpu_eth_init or >>>>> board_eth_init at a time? >>>>> >>>> Not really. board_eth_init() could call cpu_eth_init() if necessary. >>>> >>> Hm. What is cpu_eth_init for then? Just >>> >>> board_eth_init(bis); >>> >>> seems to be enough for me. I also wonder where is the best place to have >>> cpu_eth_init? >>> >>> >> The cpu_init() was suggested by Stefan in our original discussion, when >> I only had the board function. His perspective is ppc_4xx, where tons >> of CPUs and boards share the EMAC driver, and he didn't want to modify >> each board. As you'll see in the discussion with JDL, it can probably >> apply to TSEC as well. >> >>> I'm not going to argue with you, I'm just thinking about my targets. One >>> of my targets has internal ethernet MAC, and its evaluation board has an >>> on-board external PCI NIC. Another target has internal MAC, but doesn't >>> have PCI NIC. >>> >>> I thought it'll be something like >>> >>> cpu_eth_init(bis); >>> board_eth_init(bis); >>> >>> >> The idea is that cpu_eth_init is a default for a CPU family, and >> board_eth_init is a board override, which can of course call cpu_eth_init. >> > What about a section to declare the netdev? > > In this case we can have more than 2 eth and it more generic. > > Best Regards, > J. > > Sorry, I don't follow. regards, Ben