LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sylvain Munaut <tnt@246tNt.com>
To: Linux PPC embedded <linuxppc-embedded@ozlabs.org>
Cc: Paul Mackerras <paulus@samba.org>
Subject: [PATCH 2/4] ppc32: Adds support for the LITE5200B dev board
Date: Sun, 26 Mar 2006 13:37:38 +0200	[thread overview]
Message-ID: <2.20060326_133535_93e6_tnt@patchsend.246tNt.com> (raw)
In-Reply-To: <0.20060326_133535_93e6_tnt@patchsend.246tNt.com>

ppc32: Adds support for the LITE5200B dev board

This LITE5200B devboard is the new development board for the
Freescale MPC5200 processor. It has two PCI slots and so a
different PCI IRQ routing.

Signed-off-by: John Rigby <jrigby@freescale.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
---
commit 37ffaaccad4fb48c8416e610aab4d3bed41dfc80
tree 3f7b1b661e3ea7c6830c020e42948c575e73d52f
parent d2c9f75189b6bd63b94cc78f8522a44c4476939a
author Sylvain Munaut <tnt@246tNt.com> 1138562427 +0100
committer Sylvain Munaut <tnt@246tNt.com> 1143311804 +0100

 Kconfig              |    7 +++++++
 platforms/lite5200.c |   33 ++++++++++++++++++++++++++++++---
 2 files changed, 37 insertions(+), 3 deletions(-)

---
37ffaaccad4fb48c8416e610aab4d3bed41dfc80
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 54a0a9b..1c12da2 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -711,6 +711,13 @@ config LITE5200
 	  much but it's only been tested on this board version. I think this
 	  board is also known as IceCube.
 
+config LITE5200B
+	bool "Freescale LITE5200B"
+	depends LITE5200
+	help
+	  Support for the LITE5200B dev board for the MPC5200 from Freescale.
+	  This is the new board with 2 PCI slots.
+
 config MPC834x_SYS
 	bool "Freescale MPC834x SYS"
 	help
diff --git a/arch/ppc/platforms/lite5200.c b/arch/ppc/platforms/lite5200.c
index 5171b53..d91efe1 100644
--- a/arch/ppc/platforms/lite5200.c
+++ b/arch/ppc/platforms/lite5200.c
@@ -34,6 +34,7 @@
 #include <asm/mpc52xx.h>
 #include <asm/ppc_sys.h>
 #include <asm/machdep.h>
+#include <asm/pci-bridge.h>
 
 #include <syslib/mpc52xx_pci.h>
 
@@ -68,12 +69,32 @@ lite5200_show_cpuinfo(struct seq_file *m
 }
 
 #ifdef CONFIG_PCI
+#ifdef CONFIG_LITE5200B
+static int
+lite5200_map_irq(struct pci_dev *dev, unsigned char idsel,
+		    unsigned char pin)
+{
+	static char pci_irq_table[][4] =
+	/*
+	 *      PCI IDSEL/INTPIN->INTLINE
+	 *        A             B             C             D
+	 */
+	{
+		{MPC52xx_IRQ0, MPC52xx_IRQ1, MPC52xx_IRQ2, MPC52xx_IRQ3},
+		{MPC52xx_IRQ1, MPC52xx_IRQ2, MPC52xx_IRQ3, MPC52xx_IRQ0},
+	};
+
+	const long min_idsel = 24, max_idsel = 25, irqs_per_slot = 4;
+	return PCI_IRQ_TABLE_LOOKUP;
+}
+#else /* Original Lite */
 static int
 lite5200_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
 {
 	return (pin == 1) && (idsel==24) ? MPC52xx_IRQ0 : -1;
 }
 #endif
+#endif
 
 static void __init
 lite5200_setup_cpu(void)
@@ -127,11 +148,17 @@ lite5200_setup_cpu(void)
 	out_be32(&xlb->config, in_be32(&xlb->config) | MPC52xx_XLB_CFG_SNOOP);
 	out_be32(&xlb->snoop_window, MPC52xx_PCI_TARGET_MEM | 0x1d);
 
-	/* IRQ[0-3] setup : IRQ0     - Level Active Low  */
-	/*                  IRQ[1-3] - Level Active High */
+	/* IRQ[0-3] setup */
 	intr_ctrl = in_be32(&intr->ctrl);
 	intr_ctrl &= ~0x00ff0000;
-	intr_ctrl |=  0x00c00000;
+#ifdef CONFIG_LITE5200B
+	/* IRQ[0-3] Level Active Low */
+	intr_ctrl |=  0x00ff0000;
+#else
+	/* IRQ0 Level Active Low
+	 * IRQ[1-3] Level Active High */
+ 	intr_ctrl |=  0x00c00000;
+#endif
 	out_be32(&intr->ctrl, intr_ctrl);
 
 	/* Unmap reg zone */

  parent reply	other threads:[~2006-03-26 11:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-26 11:36 [PATCH 0/4] MPC52xx updates : lite5200b + ide support Sylvain Munaut
2006-03-26 11:37 ` [PATCH 1/4] ppc32: Adds support for the PCI hostbridge in MPC5200B Sylvain Munaut
2006-03-26 11:37 ` Sylvain Munaut [this message]
2006-03-26 11:38 ` [PATCH 3/4] ppc32: Reorganize and complete MPC52xx initial cpu setup Sylvain Munaut
2006-03-26 11:38 ` [PATCH 4/4] ppc32/ide: Add support for MPC52xx on-chip ATA controller Sylvain Munaut
2006-03-26 22:20 ` [PATCH 0/4] MPC52xx updates : lite5200b + ide support Paul Mackerras
2006-03-27  6:16   ` Sylvain Munaut

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=2.20060326_133535_93e6_tnt@patchsend.246tNt.com \
    --to=tnt@246tnt.com \
    --cc=linuxppc-embedded@ozlabs.org \
    --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