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



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


Home | Main Index | Thread Index | Old Index