Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2016 15:05:11 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        Krzysztof Parzyszek <kristof@swissmail.org>
Cc:        freebsd-ppc@freebsd.org
Subject:   Re: svn commit: r306065 - in head/sys vs. PowerMacs: Nathan's trail patch included but inappropriate?
Message-ID:  <9335F45B-A630-40A8-B270-4659A0B8B11E@dsl-only.net>
In-Reply-To: <8bc4d151-abcd-b300-9816-b1ca587c86f9@swissmail.org>
References:  <C48933C3-DB22-4D94-B22D-B51822197E4E@dsl-only.net> <917EFF5A-D054-4424-9D7D-4E4BEF6072EF@gmail.com> <4bb1046a-225d-66b2-7b00-067f0d6f6c60@gmail.com> <8bc4d151-abcd-b300-9816-b1ca587c86f9@swissmail.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2016-Sep-21, at 12:54 PM, Krzysztof Parzyszek <kristof at =
swissmail.org> wrote:

> On 9/21/2016 1:15 PM, Jukka A. Ukkonen wrote:
>> Anyhow the old code will not boot on a G5 without a change, neither
>> will it boot with Nathan's patch included. Releasing 11.0-stable in
>> a state that will not actually boot on one of the supported platforms
>> will not look awfully bright either. I guess this is an issue for
>> the re team to decide.
>=20
> The 11 as it stands does not boot on my PowerMac G5.  It hangs before =
it starts printing the booting output. The only exception is that when I =
enable DDB, it prints two lines about DDB and then hangs.
>=20
> It does boot under Qemu though.  I don't know what is going on.
>=20
> -Krzysztof

A couple of possible directions for the PowerMac G5 context:

Direction 0:

If you know how to get to the loader prompt you might be able to boot by =
sidestepping the kernel's use of OpenFirmware. Nathan once asked for =
such an experiment (after he checked in -r302214):

> One thing it would be great to have some testing on after this change =
is=20
> the FDT layer in loader. If you set usefdt=3D1 from the loader prompt,=20=

> loader will distill the OF device tree into an FDT and then stop Open=20=

> Firmware completely before transferring control to FreeBSD. This =
should=20
> avoid any possible problems accessing Open Firmware from the kernel, =
as=20
> well as making boot a little faster.
> -Nathan

The -r302214 changes were to sys/powerpc/aim/aim_machdep.c ad =
sys/powerpc/aim/locore64.S .

The changes are only in CURRRENT (now 12) from what I see so far.

So for that context use of:

usefdt=3D1

from the loader before then booting the kernel might manage to boot your =
G5.

I expect that Nathan would like to know the specifics of the result =
either way. (I've not had access to do the experiment that he requested =
back in late 2016-June when CURRENT was for 11.)

I do not know if the loader and other code in 11.0-STABLE or the like =
would allow an 11.0-??? experiment by merging the above two file =
versions in with the 11.0 source that you might have. But that gets into =
having a buildkernel/installkernel context for powerpc64, possibly via a =
cross-build.


Direction 1:

Have you been able to build and install kernel with one of the following =
changes that have been referenced and that Jukka A. Ukkonen tried (up to =
minor spacing variations)?

Changing:

       __asm __volatile("mfsprg0 %0\n\t"
                        "mtsprg0 %1\n\t"
                        "mtsprg1 %2\n\t"
                        "mtsprg2 %3\n\t"
                        "mtsprg3 %4\n\t"
                        : "=3D&r"(ofw_sprg0_save)
                        : "r"(ofmsr[1]),
                        "r"(ofmsr[2]),
                        "r"(ofmsr[3]),
                        "r"(ofmsr[4]));

in ofw_sprg_prepare(void) to one of:

       __asm __volatile("mfsprg0 %0\n\t"
                        "mtsprg1 %1\n\t"
                        "mtsprg2 %2\n\t"
                        "mtsprg3 %3\n\t"
                        : "=3D&r"(ofw_sprg0_save)
                        : "r"(ofmsr[2]),
                        "r"(ofmsr[3]),
                        "r"(ofmsr[4]));

or:

       __asm __volatile("mfsprg0 %0\n\t"
                        : "=3D&r"(ofw_sprg0_save)
                        :

                        );

This may require a cross-build of the powerpc64 kernel if you have no =
working powerpc64 context that can validly build whatever variant of the =
powerpc64 11.0 kernel you want to try with such a change in.

This type of experiment would not involve loader-prompt activity.

If you have been or are able to try this change to your chosen 11.0 =
variant and it fails to help that would be very interesting information, =
please let us know the details, including especially Nathan Whitehorn.



As stands there has been no checked-in change to address the issues for =
Apple Powermac G5's. What has been observed on PowerMac G5's may or may =
not have code that can also be compatible with non-Apple powerpc64 =
environments that also use Open Firmware. I've never had non-Apple =
access for powerpc64 or powerpc so I've no clue about what it takes to =
have full compatibility in a single build.

If there is such a fully-compatible coding then I expect Nathan would =
check in the changes once they are known to work. But if there is no =
such compatibile-everywhere change I doubt that G5 PowerMacs will have =
priority: things have been problematical for booting PowerMac G5's for =
years. So changing which machines are problematical is probably a =
Principle of Lease Astonishment violation at this point.

=3D=3D=3D
Mark Millard
markmi at dsl-only.net





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9335F45B-A630-40A8-B270-4659A0B8B11E>