public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ben Warren <bwarren@qstreams.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] ARM: add support of CONFIG_LAST_STAGE_INIT for arm
Date: Mon, 10 Dec 2007 15:28:40 -0500	[thread overview]
Message-ID: <475DA178.4040000@qstreams.com> (raw)
In-Reply-To: <20071210185827.4f3c005b@dhcp-252-066.norway.atmel.com>

Haavard Skinnemoen wrote:
> On Sun, 09 Dec 2007 17:38:13 +0100
> Michael Schwingen <rincewind@discworld.dascon.de> wrote:
>
>   
>> If we could move board_late_init after eth_initialize (ie. directly 
>> before calling main_loop), that would work in my case, and would remove 
>> the necessity for my reset_phy patch.
>>     
>
> Or even better, move eth_initialize into the board code. That would
> allow us to kill a ridiculous number of #ifdefs in net/eth.c and would
> allow the board to do any fixups it needs before and after the generic
> code.
>
>   
eth_initialize() is definitely a mess, but I don't think moving it to 
board code is the right thing to do. On the other hand, one thing I've 
been thinking about was a new eth_initialze() that steps through an 
array of board-defined controller configurations. This way we could 
specify all sorts of information about controller type, PHY type, 
addresses etc. on a per-controller basis, and of course provide default 
macros to abstract away the mundane.

More to the problem seen here - IMHO, a MAC's initialize() function 
shouldn't do anything other than populate and register one or more 
ethernet devices with the network subsystem. Any PHY initialization 
stuff should happen in the specific driver's init() function, which only 
gets called when the port is used. If you want to do initialization of 
any aspect of a controller that isn't used by u-boot, it should be in 
board-specific init code, and there should be a board-instantiable 
global function that is guaranteed to be after all the common code 
(immediately before the main loop begins). I haven't looked at the code 
in a while, but I gather one of the problems here was that 
board_late_init() (or whatever it's called) comes before 
eth_initialize(). If that's really the case, we need a 
board_really_late_init().

Thoughts?

regards,
Ben

  parent reply	other threads:[~2007-12-10 20:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-10 15:29 [U-Boot-Users] PATCH: support board-specific ethernet PHY init for ARM Michael Schwingen
2007-12-08 12:45 ` Jean-Christophe PLAGNIOL-VILLARD
2007-12-08 22:32   ` Michael Schwingen
2007-12-09  9:43     ` Jean-Christophe PLAGNIOL-VILLARD
2007-12-09  9:50       ` [U-Boot-Users] [PATCH] ARM: add support of CONFIG_LAST_STAGE_INIT for arm Jean-Christophe PLAGNIOL-VILLARD
2007-12-09 14:50         ` Wolfgang Denk
2007-12-09 16:38           ` Michael Schwingen
2007-12-10 17:58             ` Haavard Skinnemoen
2007-12-10 20:08               ` Michael Schwingen
2007-12-10 20:28               ` Ben Warren [this message]
2007-12-11  8:59                 ` Haavard Skinnemoen
2007-12-11 16:13                   ` Wolfgang Denk
2007-12-11 17:05                     ` Mike Frysinger
2007-12-11 22:03                       ` Wolfgang Denk
2007-12-11 18:38                   ` Michael Schwingen
2007-12-11 22:09                     ` Wolfgang Denk
2007-12-12  8:32                       ` Michael Schwingen
2007-12-11  9:53 ` [U-Boot-Users] [PATCH] ARM: support board-specific ethernet PHY init Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=475DA178.4040000@qstreams.com \
    --to=bwarren@qstreams.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox