From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] MPC512x FEC/MII
Date: Tue, 27 Sep 2011 17:21:14 +0200 [thread overview]
Message-ID: <m2r532royd.fsf@ohwell.denx.de> (raw)
In-Reply-To: <D42F060B3778074EA85B5FC2CC9E015C16A1C8@MEN-EX2.intra.men.de> (Kolja Schneider's message of "Tue, 27 Sep 2011 14:57:06 +0000")
Hi Kolja,
[...]
>> > The PHY is only initialized while a network command (such as dhcp, tftp,
>> > ...) is being executed.
>>
>> Well, this is actually in line with the U-Boot design principles of
>> initializing a device only if its needed[1]. This principle was
>> disregarded regularly in the past and so it seems kind of naturla that
>> "fixing" it results in changes of behaviour. We should however fix the
>> fallout rather than going back to violating the principles.
>>
>> If the mii routines need initializations, then they should ensure that
>> they have been done.
>
> This really is a shame as the mii tools are quite helpful for
> debugging/hardware verification. If the mii-command performs a
> re-initialisation each time they are invoked, they are probably close
> to useless (as one would need several commands to perform certain
> tasks...).
I never said that the mii commands should initialize the phy _every_
time they are called. All I said was that if they need an init, they
should ensure it has been run - this can also be done only once.
> However I understand this is something that is not quite in the scope
> of a bootloader. As long as an easy workaround is available...
I think this is in the scope of a bootloader - all I want to say is that
we should fix the problems that we encounter getting closer to our own
goals rather than giving up our goals to fix an individual problem.
Actually I believe that the move towards a driver model discussed on the
ML only recently, can solve many of these problems currently handled in
all the sub-modules and can centralize it in a single place. By then we
would have a "initialized" field for every device and the commands (mii
or net commands) that deal with a net device can ensure that its "init"
method runs if this is not set.
Also with this approach, before booting an operating system, we can
deinitialize all devices again. Although this sounds somewhat strange,
this was one of the more hard to find bugs that I have seen - an usb
controller happily updating frame counters in RAM while Linux booted...
So maybe the solution to this problem can be reached by helping other
code changes ;)
Cheers
Detlev
--
Progress in mathematics comes from repeated acts of generalization.
If mathematics is anything, it is the art of chosing the most elegant
generalization for some abstract pattern. Thus esthetics is central.
-- Douglas Hofstadter
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
prev parent reply other threads:[~2011-09-27 15:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-09 9:51 [U-Boot] MPC512x FEC/MII Schneider, Kolja
2011-09-12 21:01 ` Bernhard Kaindl
2011-09-27 14:27 ` Detlev Zundel
2011-09-27 14:57 ` Schneider, Kolja
2011-09-27 15:21 ` Detlev Zundel [this message]
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=m2r532royd.fsf@ohwell.denx.de \
--to=dzu@denx.de \
--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