From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Wed, 19 Nov 2008 14:03:44 +0100 Subject: [U-Boot] [PATCH 4/5] powerpc: keymile: Add a check for the PIGGY debug board In-Reply-To: <20081119133549.2a495728@ernst.jennejohn.org> References: <491A98A0.6070107@denx.de> <491B15DF.1070805@gmail.com> <491BDA95.2060306@invitel.hu> <491C644B.3030508@gmail.com> <20081119133549.2a495728@ernst.jennejohn.org> Message-ID: <49240EB0.3010009@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Gray, Gary Jennejohn schrieb: > On Thu, 13 Nov 2008 09:30:51 -0800 > Ben Warren wrote: > >> Heiko Schocher wrote: >>> Hello Ben >>> >>> Ben Warren wrote: >>> >>>> Heiko Schocher wrote: >>>> >>>> >>>>> Check the presence of the PIGGY on the keymile boards mgcoge, >>>>> mgsuvd and kmeter1. If the PIGGY is not present, dont register >>>>> this Ethernet device. >>>>> >>>>> Signed-off-by: Heiko Schocher >>>>> --- >>>>> >>>>> >>>> This looks like useful stuff to have, but I'd prefer that you put the >>>> check logic in board_eth_init() rather than adding to the individual >>>> device drivers. I know the 8260 SCC driver is the older style, which >>>> precludes the use of board_eth_init, but I'll convert it if you're able >>>> to test. >>>> > > Unfortunately, this approach won't work. First of all, the 82xx SCC > driver is now initialized in cpu_eth_init(), which knows nothing about > board-specific peculiarities like the PIGGY. Secondly, the HDLC > driver for Keymile has to be initialized in board_eth_init(), and it > has nothing to do with the PIGGY. Putting the check in board_eth_init() > would break it completely. I looked at Heiko's latest patch and couldn't > figure out a way to cleanly differentiate between initializing the HDLC > driver and checking whether the PIGGY was present fo the other ENET drivers. Hmm.. you can now initialize in board_eth_init () in board/keymile/common/common.c your HDLC specific things, or? [...] >> That's what board_eth_init() and cpu_eth_init() are for. In addition, I >> forgot to mention that a couple of days ago Gary Jennejohn submitted a >> patch for changing the 82xx SCC driver over to CONFIG_NET_MULTI style. >> > > Correct, and it must explicitly call ethernet_present() - see above. If I understand the actual code right, then _now_ (which means actual top of tree+ patch 4/5) it gets first called board_eth_init (). There, I check if ethernet_present (), and if so, I return -1, which will result in calling cpu_eth_init(). If the ethernet is not present, it returns 0, which will result in not calling cpu_eth_init() ... And your HDLC initialization can be done in board_eth_init() ... thats what we need, or? bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany