From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Milton Miller <miltonm@bga.com>
Cc: Michael Neuling <mikey@neuling.org>,
open-source-review@apm.com, Tirumala R Marri <tmarri@apm.com>,
linux-kernel@vger.kernel.org,
Josh Boyer <jwboyer@linux.vnet.ibm.com>,
Anton Blanchard <anton@samba.org>, Mai La <mla@apm.com>,
Paul Mackerras <paulus@samba.org>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [1/2] powerpc/44x: Fix PCI MSI support for APM821xx SoC and Bluestone board
Date: Tue, 06 Mar 2012 18:11:32 +1100 [thread overview]
Message-ID: <1331017892.11728.96.camel@pasglop> (raw)
In-Reply-To: <bluehawk-msi-use-upper-lower-32@mdm.bga.com>
On Mon, 2012-03-05 at 22:37 -0600, Milton Miller wrote:
> On Mon, 05 Mar 2012 about 17:29:41 -0000, Mai La wrote:
> >
> > @@ -43,7 +43,12 @@
> > #define PEIH_FLUSH0 0x30
> > #define PEIH_FLUSH1 0x38
> > #define PEIH_CNTRST 0x48
> > +
> > +#ifdef CONFIG_APM821xx
> > +#define NR_MSI_IRQS 8
> > +#else
> > #define NR_MSI_IRQS 4
> > +#endif
> >
>
> does this need to go into the dts binding?
A compile time #define is definitely not acceptable as it would break a
multiplatform kernel.
Ben.
> > struct ppc4xx_msi {
> > u32 msi_addr_lo;
> > @@ -150,12 +155,11 @@ static int ppc4xx_setup_pcieh_hw(struct platform_device *dev,
> > if (!sdr_addr)
> > return -1;
> >
> > - SDR0_WRITE(sdr_addr, (u64)res.start >> 32); /*HIGH addr */
> > - SDR0_WRITE(sdr_addr + 1, res.start & 0xFFFFFFFF); /* Low addr */
> > -
> > + mtdcri(SDR0, *sdr_addr, (u64)res.start >> 32); /*HIGH addr */
> > + mtdcri(SDR0, *sdr_addr + 1, res.start & 0xFFFFFFFF);/* Low addr */
>
> Please use upper_32_bits and lower_32_bits from linux/kernel.h
>
> > msi->msi_dev = of_find_node_by_name(NULL, "ppc4xx-msi");
> > - if (msi->msi_dev)
> > + if (!msi->msi_dev)
> > return -ENODEV;
> >
> > msi->msi_regs = of_iomap(msi->msi_dev, 0);
> > @@ -167,9 +171,12 @@ static int ppc4xx_setup_pcieh_hw(struct platform_device *dev,
> > (u32) (msi->msi_regs + PEIH_TERMADH), (u32) (msi->msi_regs));
> >
> > msi_virt = dma_alloc_coherent(&dev->dev, 64, &msi_phys, GFP_KERNEL);
> > - msi->msi_addr_hi = 0x0;
> > - msi->msi_addr_lo = (u32) msi_phys;
> > - dev_dbg(&dev->dev, "PCIE-MSI: msi address 0x%x\n", msi->msi_addr_lo);
> > + if (!msi_virt)
> > + return -ENOMEM;
> > + msi->msi_addr_hi = (u32)(msi_phys >> 32);
> > + msi->msi_addr_lo = (u32)(msi_phys & 0xffffffff);
>
> ditto
>
>
> milton
prev parent reply other threads:[~2012-03-06 7:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-06 3:29 [PATCH 1/2] powerpc/44x: Fix PCI MSI support for APM821xx SoC and Bluestone board Mai La
2012-03-06 4:37 ` [1/2] " Milton Miller
2012-03-06 7:11 ` Benjamin Herrenschmidt [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=1331017892.11728.96.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=anton@samba.org \
--cc=jwboyer@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.org \
--cc=miltonm@bga.com \
--cc=mla@apm.com \
--cc=open-source-review@apm.com \
--cc=paulus@samba.org \
--cc=tmarri@apm.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).