Thread (3 messages) 3 messages, 2 authors, 2012-03-06

Re: [PATCH 1/2] powerpc/44x: Fix PCI MSI support for APM821xx SoC and Bluestone board

flat view

From: Josh Boyer <hidden>
Date: 2012-02-29 14:19:08
Also in: lkml

On Wed, Feb 29, 2012 at 3:47 AM, Mai La [off-list ref] wrote:
This patch consists of:
- Enable PCI MSI as default for Bluestone board
- Define number of MSI interrupt for Maui APM821xx
What is Maui?  Is that the same thing as Bluestone?
- Fix returning ENODEV as finding MSI node
- Fix MSI physical high and low address
- Keep MSI data logically

Signed-off-by: Mai La <redacted>
Wow.  So there are a lot of bugfixes here.  I'm surprised this ever worked =
at
all with some of the things you're fixing.  Nice to see.
---
=A0arch/powerpc/platforms/44x/Kconfig | =A0 =A02 ++
=A0arch/powerpc/sysdev/ppc4xx_msi.c =A0 | =A0 28 ++++++++++++++++++------=
----
quoted hunk ↗ jump to hunk
=A02 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/=
44x/Kconfig
quoted hunk ↗ jump to hunk
index fcf6bf2..9f04ce3 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -23,6 +23,8 @@ config BLUESTONE
=A0 =A0 =A0 =A0default n
=A0 =A0 =A0 =A0select PPC44x_SIMPLE
=A0 =A0 =A0 =A0select APM821xx
+ =A0 =A0 =A0 select PCI_MSI
+ =A0 =A0 =A0 select PPC4xx_MSI
=A0 =A0 =A0 =A0select IBM_EMAC_RGMII
=A0 =A0 =A0 =A0help
=A0 =A0 =A0 =A0 =A0This option enables support for the APM APM821xx Evalu=
ation board.
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/sysdev/ppc4xx_msi.c b/arch/powerpc/sysdev/ppc4x=
x_msi.c
quoted hunk ↗ jump to hunk
index 1c2d7af..6103908 100644
--- a/arch/powerpc/sysdev/ppc4xx_msi.c
+++ b/arch/powerpc/sysdev/ppc4xx_msi.c
@@ -31,7 +31,7 @@
=A0#include <asm/prom.h>
=A0#include <asm/hw_irq.h>
=A0#include <asm/ppc-pci.h>
-#include <boot/dcr.h>
+#include <asm/dcr.h>
=A0#include <asm/dcr-regs.h>
=A0#include <asm/msi_bitmap.h>
@@ -43,7 +43,12 @@
=A0#define PEIH_FLUSH0 =A0 =A00x30
=A0#define PEIH_FLUSH1 =A0 =A00x38
=A0#define PEIH_CNTRST =A0 =A00x48
+
+#ifdef CONFIG_APM821xx
+#define NR_MSI_IRQS =A0 =A08
+#else
=A0#define NR_MSI_IRQS =A0 =A04
+#endif
Hm.  Do you think this is going to change quite a bit depending on which So=
C
is being used?  If so, it might be better to introduce a Kconfig variable
that just defines this instead.  Something like:

	config 4xx_MSI_IRQS
	   int "Number of MSI IRQs"
	   depends on 4xx
	   default "8" if APM821xx
	   default "4" if !APM821xx

If there aren't going to be a wide variety of numbers, then the simple ifde=
f
you have is probably sufficient.
quoted hunk ↗ jump to hunk
=A0struct ppc4xx_msi {
=A0 =A0 =A0 =A0u32 msi_addr_lo;
@@ -150,12 +155,11 @@ static int ppc4xx_setup_pcieh_hw(struct platform_de=
vice *dev,
=A0 =A0 =A0 =A0if (!sdr_addr)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1;

- =A0 =A0 =A0 SDR0_WRITE(sdr_addr, (u64)res.start >> 32); =A0 =A0 =A0/*HI=
GH addr */
- =A0 =A0 =A0 SDR0_WRITE(sdr_addr + 1, res.start & 0xFFFFFFFF); /* Low ad=
dr */
-
+ =A0 =A0 =A0 mtdcri(SDR0, *sdr_addr, res.start >> 32); =A0 =A0 =A0 /*HIG=
H addr */
+ =A0 =A0 =A0 mtdcri(SDR0, *sdr_addr + 1, res.start & 0xFFFFFFFF);/* Low =
addr */

Don't you still want the (u64) cast on res.start?
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments,
is for the sole use of the intended recipient(s) and contains information
that is confidential and proprietary to AppliedMicro Corporation or its s=
ubsidiaries.
It is to be used solely for the purpose of furthering the parties' busine=
ss relationship.
All unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by reply=
 e-mail
and destroy all copies of the original message.
Is there a way you can drop this?  Others from APM seem to have figured out
how to do that, so hopefully it won't be a big problem.

josh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help