linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/5] Updates for WRS SBC82xx boards
@ 2006-05-25 18:25 Paul Gortmaker
  2006-05-26  8:22 ` Vitaly Bordug
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Gortmaker @ 2006-05-25 18:25 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: p_gortmaker


patch2: sbc82xx-PCI-diff1
	- allow m82xx_pci.c to be used by other platforms that have
	  their own map_irq

I'm open to doing this another way if desired -- I just went for the
minimal impact on the existing code with this.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


diff -ur orig/linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.c linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.c
--- orig/linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.c	2006-02-09 16:20:35.000000000 -0500
+++ linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.c	2006-02-09 16:01:40.000000000 -0500
@@ -198,7 +198,7 @@
 	}
 }
 
-static int sbc82xx_pci_map_irq(struct pci_dev *dev, unsigned char idsel,
+int pq2pci_map_irq(struct pci_dev *dev, unsigned char idsel,
 			       unsigned char pin)
 {
 	static char pci_irq_table[][4] = {
@@ -247,7 +247,7 @@
 	callback_init_IRQ	= ppc_md.init_IRQ;
 
 	ppc_md.init_IRQ		= sbc82xx_init_IRQ;
-	ppc_md.pci_map_irq	= sbc82xx_pci_map_irq;
+	ppc_md.pci_map_irq	= pq2pci_map_irq;
 #ifdef CONFIG_GEN_RTC
 	ppc_md.time_init        = NULL;
 	ppc_md.get_rtc_time     = NULL;
diff -ur orig/linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.h linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.h
--- orig/linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.h	2006-02-09 16:20:35.000000000 -0500
+++ linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.h	2006-02-09 16:35:05.000000000 -0500
@@ -24,6 +24,7 @@
 
 #define BOOTROM_RESTART_ADDR      ((uint)0x40000104)
 
+#define HAVE_OWN_PQ2PCI_IRQ
 #define SBC82xx_PC_IRQA		(NR_CPM_INTS+0)
 #define SBC82xx_PC_IRQB		(NR_CPM_INTS+1)
 #define SBC82xx_MPC185_IRQ	(NR_CPM_INTS+2)
diff -ur orig/linux-2.6.16rc2/arch/ppc/syslib/m82xx_pci.c linux-2.6.16rc2/arch/ppc/syslib/m82xx_pci.c
--- orig/linux-2.6.16rc2/arch/ppc/syslib/m82xx_pci.c	2006-01-02 22:21:10.000000000 -0500
+++ linux-2.6.16rc2/arch/ppc/syslib/m82xx_pci.c	2006-02-09 14:35:10.000000000 -0500
@@ -51,6 +51,10 @@
  * Interrupt routing
  */
 
+#ifdef HAVE_OWN_PQ2PCI_IRQ
+extern int
+pq2pci_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin);
+#else 
 static inline int
 pq2pci_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
 {
@@ -172,6 +176,7 @@
 	setup_irq(PCI_INT_TO_SIU, &pq2pci_irqaction);
 	return;
 }
+#endif	/* HAVE_OWN_PQ2PCI_IRQ */
 
 static int
 pq2pci_exclude_device(u_char bus, u_char devfn)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/5] Updates for WRS SBC82xx boards
  2006-05-25 18:25 [PATCH 2/5] Updates for WRS SBC82xx boards Paul Gortmaker
@ 2006-05-26  8:22 ` Vitaly Bordug
  0 siblings, 0 replies; 2+ messages in thread
From: Vitaly Bordug @ 2006-05-26  8:22 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: p_gortmaker, linuxppc-embedded

On Thu, 25 May 2006 14:25:33 -0400
Paul Gortmaker <paul.gortmaker@windriver.com> wrote:

> 
> patch2: sbc82xx-PCI-diff1
> 	- allow m82xx_pci.c to be used by other platforms that have
> 	  their own map_irq
> 
> I'm open to doing this another way if desired -- I just went for the
> minimal impact on the existing code with this.

> 
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> 
> diff -ur orig/linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.c
> linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.c ---
> orig/linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.c	2006-02-09
> 16:20:35.000000000 -0500 +++
> linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.c	2006-02-09
> 16:01:40.000000000 -0500 @@ -198,7 +198,7 @@ } }
>  
> -static int sbc82xx_pci_map_irq(struct pci_dev *dev, unsigned char
> idsel, +int pq2pci_map_irq(struct pci_dev *dev, unsigned char idsel,
>  			       unsigned char pin)
>  {
>  	static char pci_irq_table[][4] = {
> @@ -247,7 +247,7 @@
>  	callback_init_IRQ	= ppc_md.init_IRQ;
>  
>  	ppc_md.init_IRQ		= sbc82xx_init_IRQ;
> -	ppc_md.pci_map_irq	= sbc82xx_pci_map_irq;
> +	ppc_md.pci_map_irq	= pq2pci_map_irq;
>  #ifdef CONFIG_GEN_RTC
>  	ppc_md.time_init        = NULL;
>  	ppc_md.get_rtc_time     = NULL;
> diff -ur orig/linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.h
> linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.h ---
> orig/linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.h	2006-02-09
> 16:20:35.000000000 -0500 +++
> linux-2.6.16rc2/arch/ppc/platforms/sbc82xx.h	2006-02-09
> 16:35:05.000000000 -0500 @@ -24,6 +24,7 @@ #define
> BOOTROM_RESTART_ADDR      ((uint)0x40000104) 
> +#define HAVE_OWN_PQ2PCI_IRQ
>  #define SBC82xx_PC_IRQA		(NR_CPM_INTS+0)
>  #define SBC82xx_PC_IRQB		(NR_CPM_INTS+1)
>  #define SBC82xx_MPC185_IRQ	(NR_CPM_INTS+2)
> diff -ur orig/linux-2.6.16rc2/arch/ppc/syslib/m82xx_pci.c
> linux-2.6.16rc2/arch/ppc/syslib/m82xx_pci.c ---
> orig/linux-2.6.16rc2/arch/ppc/syslib/m82xx_pci.c	2006-01-02
> 22:21:10.000000000 -0500 +++
> linux-2.6.16rc2/arch/ppc/syslib/m82xx_pci.c	2006-02-09
> 14:35:10.000000000 -0500 @@ -51,6 +51,10 @@
>   * Interrupt routing
>   */
>  
> +#ifdef HAVE_OWN_PQ2PCI_IRQ
> +extern int
> +pq2pci_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned
> char pin); +#else 
>  static inline int
>  pq2pci_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned
> char pin) {
> @@ -172,6 +176,7 @@
>  	setup_irq(PCI_INT_TO_SIU, &pq2pci_irqaction);
>  	return;
>  }
> +#endif	/* HAVE_OWN_PQ2PCI_IRQ */
Sorry, but I don't quite follow the reason of that. As I see, 
you are going to call find_bridges stuff but with demux disabled.

I see no reason to add any defines - if you won't call init_irq,
nothing will happen, I mean demux will not be assigned and so on. BTW,
right now it will not be issued in case of sbc82xx. It is not code-size
optimal, but we'll leave optimizations to arch/powerpc time. 

Actually, you'll just have to override map_irq with sbc_ thing after
find_bridges() call.

>  
>  static int
>  pq2pci_exclude_device(u_char bus, u_char devfn)
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-26  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-25 18:25 [PATCH 2/5] Updates for WRS SBC82xx boards Paul Gortmaker
2006-05-26  8:22 ` Vitaly Bordug

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).