From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Nicolas DET <nd@bplan-gmbh.de>
Cc: linuxppc-dev@ozlabs.org, sl@bplan-gmbh.de, linuxppc-embedded@ozlabs.org
Subject: Re: [PATCH/RFC] powerpc: Add Efika platform support
Date: Thu, 02 Nov 2006 10:25:46 +1100 [thread overview]
Message-ID: <1162423546.25682.486.camel@localhost.localdomain> (raw)
In-Reply-To: <1162419546.25682.460.camel@localhost.localdomain>
On Thu, 2006-11-02 at 09:19 +1100, Benjamin Herrenschmidt wrote:
> On Wed, 2006-11-01 at 21:29 +0100, Nicolas DET wrote:
Ooops ... here's the english version :)
> > +
> > +static void __init efika_init_IRQ(void)
> > +{
> > + mpc52xx_init_irq();
> > +}
>
> Ya pas moyen que mpc52xx_init_irq() ait le bon prototype pour que tu le
> colle directement dans ppc_md. ?
It would be better if mpc52xx_init_irq() had the right prototype so it
can be hooked directly from ppc_md.
> > +
> > + ISA_DMA_THRESHOLD = ~0L;
> > + DMA_MODE_READ = 0x44;
> > + DMA_MODE_WRITE = 0x48;
>
> Ca viens de CHRP ca ? Je suis pas sur que ca soit super utile... mais
> bon, ca mange pas de pain.. Au cas ou qqun colle un southbridge ISA sur
> le bus PCI :)
This comes from CHRP ? I'm not sure it's terribly useful, at least for
Efika, though it doesn't hurt. Maybe some day somebody will stick an ISA
southbridge on the 5200 PCI bus :)
> > +void __init efika_pcisetup(void)
> > +{
> > + const int *bus_range;
> > + int len;
> > + struct pci_controller *hose;
> > + struct device_node *root;
> > + struct device_node *pcictrl;
> > +
> > + root = of_find_node_by_path("/");
> > + if (root == NULL) {
> > + printk(KERN_WARNING EFIKA_PLATFORM_NAME
> > + ": Unable to find the root node\n");
> > + return;
> > + }
> > +
> > + for (pcictrl = NULL;;) {
> > + pcictrl = of_get_next_child(root, pcictrl);
> > + if ((pcictrl == NULL) || (strcmp(pcictrl->name, "pci") == 0))
> > + break;
> > + }
> > +
> > + if (pcictrl == NULL) {
> > + printk(KERN_WARNING EFIKA_PLATFORM_NAME
> > + ": Unable to find the PCI bridge node\n");
> > + return;
> > + }
> > +
> > + of_node_put(pcictrl);
> > + of_node_put(root);
>
> Euh... non... tu fait pas of_node_put(pcictrl) avant de t'en servir...
> tu fait ca quand tu as fini. Ca veut dire probablement changer test
> "return" en "goto bail;" ou un truc du genre.
Don't do an of_node_put(pcictrl) before you use that node... Do it when
you are done with it, which probably means changing "return" statements
into something like "goto bail;"
> > + if (bus_range[1] == bus_range[0])
> > + printk(KERN_INFO EFIKA_PLATFORM_NAME ": PCI bus %d",
> > + bus_range[0]);
> > + else
> > + printk(KERN_INFO EFIKA_PLATFORM_NAME ": PCI buses %d..%d",
> > + bus_range[0], bus_range[1]);
> > + printk(" controlled by %s", pcictrl->full_name);
> > + printk("\n");
>
> You really need the above printk's ?
Ah, that one was good :)
> > + hose = pcibios_alloc_controller();
> > + if (!hose) {
> > + printk(KERN_WARNING EFIKA_PLATFORM_NAME
> > + ": Can't allocate PCI controller structure for %s\n",
> > + pcictrl->full_name);
> > + return;
> > + }
> > +
> > + hose->arch_data = pcictrl;
>
> Et ici, tu garde une reference, donc to fait
Here's you are keeping a reference to the node, thus you should do:
> hose->arch_data = of_node_get(pcictrl);
>
> > + hose->first_busno = bus_range[0];
> > + hose->last_busno = bus_range[1];
> > + hose->ops = &rtas_pci_ops;
> > +
> > + pci_process_bridge_OF_ranges(hose, pcictrl, 0);
> > +}
>
> Le reste est bon.
>
> On y est presque ! :)
The rest is good, we're almost there :)
Ben.
next prev parent reply other threads:[~2006-11-01 23:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-01 20:29 [PATCH/RFC] powerpc: Add Efika platform support Nicolas DET
2006-11-01 20:34 ` Nicolas DET
2006-11-01 22:19 ` Benjamin Herrenschmidt
2006-11-01 23:25 ` Benjamin Herrenschmidt [this message]
2006-11-02 20:52 ` Nicolas DET
2006-11-03 7:31 ` Nicolas DET
2006-11-04 23:45 ` Benjamin Herrenschmidt
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=1162423546.25682.486.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=linuxppc-embedded@ozlabs.org \
--cc=nd@bplan-gmbh.de \
--cc=sl@bplan-gmbh.de \
/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).