public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linuxppc-dev@ozlabs.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	cbe-oss-dev@ozlabs.org, "Machida,
	Hiroyuki" <machida@sm.sony.co.jp>
Subject: Re: [PATCH] powerpc: Kill machine numbers
Date: Fri, 24 Mar 2006 10:27:38 +0100	[thread overview]
Message-ID: <200603241027.39836.arnd@arndb.de> (raw)
In-Reply-To: <1143178947.4257.78.camel@localhost.localdomain>

On Friday 24 March 2006 06:42, Benjamin Herrenschmidt wrote:
> -                       if (strstr(p, RELOC("IBM,CPB")))
> -                               return PLATFORM_CELL;

> +int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
> +{
> +       const char* cp;
> +       unsigned long cplen, l;
> +
> +       cp = of_get_flat_dt_prop(node, "compatible", &cplen);
> +       if (cp == NULL)
> +               return 0;
> +       while (cplen > 0) {
> +               if (strncasecmp(cp, compat, strlen(compat)) == 0)
> +                       return 1;
> +               l = strlen(cp) + 1;
> +               cp += l;
> +               cplen -= l;
> +       }
> +
> +       return 0;
> +}

> +static int __init cell_probe(void)
>  {
> -       if (platform != PLATFORM_CELL)
> +       unsigned long root = of_get_flat_dt_root();
> +       if (!of_flat_dt_is_compatible(root, "IBM,CPB"))
>                 return 0;
>  

Unfortunately, this breaks cell detection. The string in our current
hardware is 'IBM,CPBW-1.0', for reasons you don't want to know.
We just relied on strstr being able to scan for everything starting
with 'IBM,CPB'.

For even more obscure reasons, our future firmware is planned
to no no longer claim compatibility with that but rather with
'CBEA' _and_ 'IBM,CBEA'.

At this point, the issue is getting really complicated, as CBEA
was meant to be a generic identifier for all systems based on
that architecture extension, but we probably want to have different
machine_description data for e.g. IBM and Sony hardware, so they
should check for different values.

As soon as I get to the office, I'll try to do a patch that at
least 

- restores the current functionality by checking for 'IBM,CPBW-1.0'
- also checks for 'IBM,CBEA' so we don't break on future IBM systems

but we should make sure we come to a solution that is practical
to all system vendors that are participating in Linux support.

	Arnd <><

      parent reply	other threads:[~2006-03-24  9:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-24  5:42 [PATCH] powerpc: Kill machine numbers Benjamin Herrenschmidt
2006-03-24  6:26 ` Olof Johansson
2006-03-24  8:01   ` Benjamin Herrenschmidt
2006-03-24  8:46     ` Arnd Bergmann
2006-03-24 12:23       ` Segher Boessenkool
2006-03-24 18:52       ` [PATCH] powerpc: fix cell platform detection Arnd Bergmann
2006-03-24 18:58     ` [PATCH] powerpc: Kill machine numbers Olof Johansson
2006-03-24  9:27 ` Arnd Bergmann [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=200603241027.39836.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=machida@sm.sony.co.jp \
    --cc=paulus@samba.org \
    /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