linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: [Linux-galileo] ev64260 bi_rec patch
@ 2002-04-01 19:31 Michael Sokolov
  2002-04-01 18:03 ` Mark A. Greer
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Sokolov @ 2002-04-01 19:31 UTC (permalink / raw)
  To: linux-galileo, linuxppc-dev


Tom Rini <trini@kernel.crashing.org> wrote:

> So the always-correct call for platform_init() is:
> parse_bootinfo((struct bi_record *) (r3 + KERNELBASE));

Yes!

Mark A. Greer <mgreer@mvista.com> responded:

> Is there a reason we shouldn't just fix find_bootinfo then?

How are you going to fix it? How is it going to find out where in the vast
expanses of system memory the bootloader has stuffed the bi_recs? How do you
code ESP in C?

MS

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [Linux-galileo] ev64260 bi_rec patch
@ 2002-04-02  3:35 Michael Sokolov
  2002-04-03  5:09 ` Troy Benjegerdes
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Sokolov @ 2002-04-02  3:35 UTC (permalink / raw)
  To: linux-galileo, linuxppc-dev


Paul Mackerras <paulus@samba.org> wrote:

> Use the memory pointed to by klimit and increment klimit by the amount
> you use.  You should keep klimit aligned on a 4-byte boundary, I think.

Yeah, I've already figured this out myself by looking at what you do for OF.

I'm working on one really big changeset right now that'll add a
CONFIG_GENERIC_PPC32 configuration, have presistent and searchable bi_recs, a
new and much cleaner GT-64260 implementation, etc. I'll push it into
linuxppc_2_4_alt when it's ready to see the light of day (hopefully tomorrow or
Wednesday).

MS

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [Linux-galileo] ev64260 bi_rec patch
@ 2002-04-01 20:09 Michael Sokolov
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Sokolov @ 2002-04-01 20:09 UTC (permalink / raw)
  To: linux-galileo, linuxppc-dev


Mark A. Greer <mgreer@mvista.com> wrote:

> Anyway, I don't care.  I'm done with this conversation.

Responding for the benefit of others on the list who aren't...

> I guess you didn't get it.  What I meant was to change find_bootinfo to use
> r3+KERNELBASE.

Then why do you need find_bootinfo at all? Just pass r3+KERNELBASE as the
argument to parse_bootinfo().

MS

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [Linux-galileo] ev64260 bi_rec patch
@ 2002-03-30  0:42 Michael Sokolov
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Sokolov @ 2002-03-30  0:42 UTC (permalink / raw)
  To: linux-galileo, linuxppc-dev


Mark A. Greer <mgreer@mvista.com> wrote:

> It *is* in the kernel source (and not the bootloader).

I don't understand what you are talking about.

find_bootinfo looks for bi_recs in a magic location in memory. An external
bootloader has no way of knowing where in memory that is and thus can't put
bi_recs in a place where the kernel will find them. A port that uses
find_bootinfo() can't be booted by anything except the wrapper.

> Also, 15 of the *_setup.c
> files in arch/ppc/platforms call find_bootinfo

That's because no one has bothered so far to boot any of those 15 ports with
any bootloader other than the wrapper. And that's in turn because I haven't
worked on any of those ports. :-) See k2_setup.c and adir_setup.c for the
difference.

> including ev64260_setup.c before I
> modified it.

In my patch I changed it.

> I think the R3 way of doing things is out of date now but maybe Tom
> can elaborate.

It can't be out of date w.r.t. find_bootinfo(), as first everyone used the
latter then I screamed and screamed and screamed and got the K2 port changed.

As the wrapper now puts its bi_recs in the magic location *and* sets R3 to
point to them, either way will work for you, but the R3 way makes it work for
me too.

> You may have a point here.

This is not a may, it's certain.

> I thought the bi_rec's were left around but I need to
> verify.

They aren't.

> I took a quick look and didn't see it being reused but I may have missed it.

You won't see the kernel explicitly reusing the bi_recs memory because it
doesn't even know where that memory is! The bootloader can put the bi_recs
absolutely anywhere in memory. They can be parsed in platform_init because
Linux memory management hasn't started yet, but once it's started the memory
belongs to Linux and you can't expect some random bytes in the middle of memory
to be preserved for eternity.

MS

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [Linux-galileo] ev64260 bi_rec patch
@ 2002-03-29 23:59 Michael Sokolov
  2002-03-29 22:24 ` Mark A. Greer
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Sokolov @ 2002-03-29 23:59 UTC (permalink / raw)
  To: linux-galileo, linuxppc-dev


Mark A. Greer <mgreer@mvista.com> wrote:

> I have other things to do so I won't be able to finish today.  In case
> someone wants to work on this over the weekend, attached is a patch of
> what I have so far.  It implements the example bi_rec's emailed before
> for the ev64260 board.  Feel free to use it or do a better job.

Looks OK except for 2 major problems:

1. You are using find_bootinfo() in EV-64260 platform_init to find the bi_recs.
This is bad, as the magic location where find_bootinfo looks for the bi_recs is
unavailable to bootloaders outside the linux source tree. Instead I have
adopted the convention (which Tom Rini has accepted for the K2 port and
implemented in the wrapper) to pass the physical address of bi_recs to the
kernel in R3. You should use r3 + KERNELBASE in platform_init to find the
bi_recs. This works with the wrapper just as well as find_bootinfo(), but is
much nicer for external bootloaders.

2. You are also using find_bootinfo() in the gt64260_eth driver to find its
bi_recs. In addition to the problems mentioned above, this has the extra
problem in that find_bootinfo's magic location, or any other bootloader's
location for that matter, has certainly been overwritten at this point. If you
want to peek at bi_recs after platform_init(), you have to have setup.c or
something copy them into memory that the kernel will retain.

Because of problem #2 your code will most certainly not work as it is right
now.

MS

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2002-04-03  5:09 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-01 19:31 [Linux-galileo] ev64260 bi_rec patch Michael Sokolov
2002-04-01 18:03 ` Mark A. Greer
  -- strict thread matches above, loose matches on Subject: below --
2002-04-02  3:35 Michael Sokolov
2002-04-03  5:09 ` Troy Benjegerdes
2002-04-01 20:09 Michael Sokolov
2002-03-30  0:42 Michael Sokolov
2002-03-29 23:59 Michael Sokolov
2002-03-29 22:24 ` Mark A. Greer
2002-03-29 22:30   ` Mark A. Greer
2002-03-29 22:41     ` Mark A. Greer
2002-03-30  0:45       ` Michael Sokolov
2002-04-01 15:20         ` Tom Rini
2002-04-01 15:25   ` Tom Rini
2002-04-01 15:09     ` Mark A. Greer
2002-04-01 18:53       ` Tom Rini
2002-04-01 19:52         ` Michael Sokolov
2002-04-01 20:21           ` Tom Rini
2002-04-02  2:38           ` Paul Mackerras
2002-04-02  2:50       ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).