Port-macppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] Incorrect segment 0 initialization for PMAC G5



On 04/02/2013 08:59 PM, Michael wrote:
Hello,

On Tue, 02 Apr 2013 19:33:16 +0200
Phileas Fogg <phileas-fogg%mail.ru@localhost> wrote:

we need to extend/rework the OpenPIC interface because
currently the implementation assumes the little-endian
architecture which is not true on PowerMAC G5 11,2.

I'm fairly sure there are at least some ofppc boxes with the same problem.

And if we want to reuse some parts of the current OpenPIC
implementation then we need to extend it and support
the big-endian architecture too.

I thought of a global variable "openpic_be" which can be set
to 0 or 1. And "openpic_read" and "openpic_write" methods
will check it.

And then rename the 2nd parameter of "setup_openpic" to "flags"
and define 2 flags:

OPENPIC_FLAG_PASSTHROUGH and OPENPIC_FLAG_BIGENDIAN

What do you think ?

I wonder how likely it is that we'll ever need both in the same kernel
image. If that likelihood is zero then we'd be better off with a macro
and a build time option. Do you think 32bit OEA and 64bit bridge mode
will ever be supported by the same kernel?

Otherwise, I'd avoid checking flags in openpic_read() and openpic_write(),
instead make them function pointers, have variants with and
without byte order twiddling, and decide which one to use in
setup_openpic().

have fun
Michael


Yeah, you are right, checking the variable every time an IRQ is acked is
not a good idea :) But you can't know till run time if it's little
or big-endian architecture because we get this info from OFW.
Linux and FreeBSD do it at run-time on PowerMac.

Regards


Home | Main Index | Thread Index | Old Index