Skip to contentSkip to conversation

Freescale 8272ADS PCI bridge support to the stock linux-2.5

RFC PATCH New Vitaly Bordug 1 participant 1 message Mar 25, 2005

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Freescale 8272ADS PCI bridge support to the stock linux-2.5

Hello,
This patch adds support for the 8272ADS PCI bridge to the latest linux-2.5

There is a minor problem in the 2.5 tree, and I'm not completely sure this solution is the best one. The point is, that the existing PCI code actually includes two completely different PCI map defines- one is in platforms/pq2ads.h, the another - syslib/m8260-pci.h. In the added code I tried to use the first one only, preventing even second include for the supported board, and implementing alternative setup_pci function, thus adding extra code . Existing support (I assume was for 8266) lacks irq stuff at all, and though new stuff _may_ work with other 82xx, I haven't any to test. So, the replace of existing m8260-pci.c/h seems a cleaner solution to provide and extend functionality without code bloat, as keeping several define sets for actually the same thing isn't good, IMO.

Signature · 2 lines
Sincerely,
Vitaly

===== arch/ppc/Kconfig 1.105 vs edited =====

arch/ppc/Kconfig +1 -1
@@ -1133,7 +1133,7 @@
 
 config PCI_8260
 	bool
-	depends on PCI && 8260 && !8272
+	depends on PCI && 8260 
 	default y
 
 config 8260_PCI9

===== arch/ppc/platforms/pq2ads.h 1.3 vs edited =====

arch/ppc/platforms/pq2ads.h +58 -0

73 lines not on this page · raw message

===== arch/ppc/syslib/Makefile 1.49 vs edited =====

arch/ppc/syslib/Makefile +3 -0
@@ -82,6 +82,9 @@
 				   todc_time.o
 obj-$(CONFIG_8260)		+= m8260_setup.o
 obj-$(CONFIG_PCI_8260)		+= m8260_pci.o indirect_pci.o
+ifeq ($(CONFIG_ADS8272),y)
+obj-$(CONFIG_PCI)		+= pci_auto.o
+endif
 obj-$(CONFIG_8260_PCI9)		+= m8260_pci_erratum9.o
 obj-$(CONFIG_CPM2)		+= cpm2_common.o cpm2_pic.o
 ifeq ($(CONFIG_PPC_GEN550),y)

===== arch/ppc/syslib/m8260_pci.c 1.2 vs edited =====

arch/ppc/syslib/m8260_pci.c +304 -3

358 lines not on this page · raw message

===== arch/ppc/syslib/m8260_setup.c 1.29 vs edited =====

arch/ppc/syslib/m8260_setup.c +13 -1
@@ -34,7 +34,8 @@
 unsigned char __res[sizeof(bd_t)];
 
 extern void cpm2_reset(void);
-extern void m8260_find_bridges(void);
+extern void pq2_find_bridges(void);
+extern void pq2pci_init_irq(void);
 extern void idma_pci9_init(void);
 
 /* Place-holder for board-specific init */
@@ -56,7 +57,11 @@
 	idma_pci9_init();
 #endif
 #ifdef CONFIG_PCI_8260
+#if defined(CONFIG_ADS8272) || defined(CONFIG_PQ2FADS)
+	pq2_find_bridges();
+#else
 	m8260_find_bridges();
+#endif 
 #endif
 #ifdef CONFIG_BLK_DEV_INITRD
 	if (initrd_start)
@@ -179,6 +184,10 @@
 	cpm2_immr->im_intctl.ic_siprr = 0x05309770;
 	cpm2_immr->im_intctl.ic_scprrh = 0x05309770;
 	cpm2_immr->im_intctl.ic_scprrl = 0x05309770;
+#if defined(CONFIG_PCI) && (defined(CONFIG_ADS8272) || defined(CONFIG_ADS8272))
+	/* Initialize stuff for the 82xx CPLD IC and install demux  */
+	pq2pci_init_irq();
+#endif
 }
 
 /*
@@ -201,6 +210,9 @@
 m8260_map_io(void)
 {
 	uint addr;
+#if defined(CONFIG_PCI) && (defined(CONFIG_ADS8272) || defined(CONFIG_ADS8272))
+	io_block_mapping(0x80000000,0x80000000,0x10000000, _PAGE_IO);
+#endif
 
 	/* Map IMMR region to a 256MB BAT */
 	addr = (cpm2_immr != NULL) ? (uint)cpm2_immr : CPM_MAP_ADDR;

===== include/asm-ppc/m8260_pci.h 1.1 vs edited =====

include/asm-ppc/m8260_pci.h +1 -0
@@ -19,6 +19,7 @@
  * Define the vendor/device ID for the MPC8265.
  */
 #define	PCI_DEVICE_ID_MPC8265	((0x18C0 << 16) | PCI_VENDOR_ID_MOTOROLA)
+#define	PCI_DEVICE_ID_MPC8272	((0x18C1 << 16) | PCI_VENDOR_ID_MOTOROLA)
 
 #define M8265_PCIBR0	0x101ac
 #define M8265_PCIBR1	0x101b0