linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Tiejun Chen <tiejun.china@gmail.com>
Cc: linuxppc-dev@ozlabs.org, akpm@linux-foundation.org
Subject: Re: [PATCH 1/1] Fix 64bit Mapple Host Bridge Address and Size Nodes
Date: Fri, 27 Feb 2009 07:28:59 +1100	[thread overview]
Message-ID: <1235680139.7388.15.camel@pasglop> (raw)
In-Reply-To: <7a800c8d0902260208g4a65b07fi1bb287910c51b342@mail.gmail.com>

On Thu, 2009-02-26 at 18:08 +0800, Tiejun Chen wrote:
> In the DTB tree created by firmware on Maple 64bit target, host bridge
> parent
> node has specified both of these two properties to be 2. However, the
> actual
> "cell" value for host bridge node is 1. we have to provide one fixup
> function.

Hi !

Thanks for the patch. A couple of things tho: Can you make it a bit
more robust by properly checking the board type first ?

Also, what is this "hostbridge" node ? ie, what does it represent ?

Can you send me a full dump of /proc/device-tree from the machine ?
(ie tar it up)

Finally, it looks like your patch was whitespace damaged by your mailer.

Cheers,
Ben.


> Signed-off-by: Tiejun Chen <tiejun.china@gmail.com>
> ---
>  arch/powerpc/kernel/prom_init.c |   42
> +++++++++++++++++++++++++++++++++++++++
>  1 files changed, 42 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom_init.c
> b/arch/powerpc/kernel/prom_init.c
> index 2445945..9cd23b6 100644
> --- a/arch/powerpc/kernel/prom_init.c
> +++ b/arch/powerpc/kernel/prom_init.c
> @@ -1948,8 +1948,49 @@ static void __init
> fixup_device_tree_maple(void)
>        prom_setprop(isa, name, "ranges",
>                        isa_ranges, sizeof(isa_ranges));
>  }
> +
> +/* On Maple 64bit target host bridge parent node has specified
> address and
> + * size properties to be 2. But the actual "cell" value for host
> bridge node
> + * is 1 since early MOTLoad internal bug. */
> +static void __init fixup_device_tree_maple_hb(void)
> +{
> +       phandle hb;
> +       u32 hb_ranges[4];
> +       u32 size_cell, addr_cell;
> +       struct prom_t *_prom = &RELOC(prom);
> +       char *name;
> +
> +       name = "/hostbridge@f8000000";
> +       hb = call_prom("finddevice", 1, 1, ADDR(name));
> +       if (!PHANDLE_VALID(hb))
> +               return;
> +
> +       if (prom_getproplen(hb, "reg") != 8)
> +               return;
> +
> +       if (prom_getprop(hb, "reg", hb_ranges, (sizeof(hb_ranges))/2)
> +               == PROM_ERROR)
> +               return;
> +
> +       prom_getprop(_prom->root, "#address-cells", &addr_cell,
> sizeof(addr_cell));
> +       prom_getprop(_prom->root, "#size-cells", &size_cell,
> sizeof(size_cell));
> +
> +       if ((addr_cell != 2) || (size_cell != 2) ||
> +               (hb_ranges[0] != 0xf8000000))
> +               return;
> +
> +       prom_printf("Fixing up bogus HOSTBRIDGE reg on
> Maple/Apache...\n");
> +
> +       hb_ranges[3] = hb_ranges[1];
> +       hb_ranges[1] = hb_ranges[0];
> +       hb_ranges[0] = hb_ranges[2] = 0;
> +       prom_setprop(hb, name, "reg",
> +               hb_ranges, sizeof(hb_ranges));
> +}
> +
>  #else
>  #define fixup_device_tree_maple()
> +#define fixup_device_tree_maple_hb()
>  #endif
> 
>  #ifdef CONFIG_PPC_CHRP
> @@ -2190,6 +2231,7 @@ static void __init fixup_device_tree_efika(void)
>  static void __init fixup_device_tree(void)
>  {
>        fixup_device_tree_maple();
> +       fixup_device_tree_maple_hb();
>        fixup_device_tree_chrp();
>        fixup_device_tree_pmac();
>        fixup_device_tree_efika();
> --
> 1.5.6
> 
> 
> 

  reply	other threads:[~2009-02-26 20:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1235642785-9684-1-git-send-email-tiejun.chen@windriver.com>
2009-02-26 10:08 ` [PATCH 1/1] Fix 64bit Mapple Host Bridge Address and Size Nodes Tiejun Chen
2009-02-26 20:28   ` Benjamin Herrenschmidt [this message]
2009-02-27  1:55     ` Tiejun Chen
2009-03-03  5:31       ` Benjamin Herrenschmidt
2009-04-03 10:46 tiejun.china

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=1235680139.7388.15.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=akpm@linux-foundation.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=tiejun.china@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).