📄 1010.pci.patch
字号:
+#ifdef CONFIG_TANGO2+ l += MEMORY_BASE_PCI_MEMORY;+#endif sz = pci_size(l, sz, PCI_BASE_ADDRESS_MEM_MASK); if (!sz) continue; res->start = l & PCI_BASE_ADDRESS_MEM_MASK; res->flags |= l & ~PCI_BASE_ADDRESS_MEM_MASK; } else {+#ifdef CONFIG_TANGO2+ l += MEMORY_BASE_PCI_CONFIG;+#endif sz = pci_size(l, sz, PCI_BASE_ADDRESS_IO_MASK & 0xffff); if (!sz) continue;@@ -1618,6 +1630,28 @@ return b; } +/* To shutoff all devices on a given bus */+static void pci_disable_device_bus(struct pci_bus *bus)+{+ struct list_head *list;++ list_for_each(list, &bus->devices) {+ pci_disable_device(pci_dev_b(list));+ }+}++/* To shutoff all PCI devices on all buses */+void pci_disable_device_all(void)+{+ struct list_head *list;+ struct pci_bus *bus;++ list_for_each(list, &pci_root_buses) {+ bus = pci_bus_b(list);+ pci_disable_device_bus(bus);+ }+}+ #ifdef CONFIG_PM /*@@ -2129,15 +2163,17 @@ { struct pci_dev *dev; - pcibios_init();+ if (pci_enabled != 0) {+ pcibios_init(); - pci_for_each_dev(dev) {- pci_fixup_device(PCI_FIXUP_FINAL, dev);- }+ pci_for_each_dev(dev) {+ pci_fixup_device(PCI_FIXUP_FINAL, dev);+ } #ifdef CONFIG_PM- pm_register(PM_PCI_DEV, 0, pci_pm_callback);+ pm_register(PM_PCI_DEV, 0, pci_pm_callback); #endif+ } } static int __devinit pci_setup(char *str)@@ -2167,6 +2203,7 @@ EXPORT_SYMBOL(pci_root_buses); EXPORT_SYMBOL(pci_enable_device_bars); EXPORT_SYMBOL(pci_enable_device);+EXPORT_SYMBOL(pci_disable_device_all); EXPORT_SYMBOL(pci_disable_device); EXPORT_SYMBOL(pci_find_capability); EXPORT_SYMBOL(pci_release_regions);diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linuxmips-2.4.30.ref/include/asm-mips/io.h linuxmips-2.4.30/include/asm-mips/io.h--- linuxmips-2.4.30.ref/include/asm-mips/io.h 2007-01-09 12:54:45.000000000 -0800+++ linuxmips-2.4.30/include/asm-mips/io.h 2007-01-09 13:01:43.000000000 -0800@@ -24,6 +24,12 @@ #define bus_to_baddr(bus, addr) (bus_to_baddr[(bus)->number] + (addr)) #define baddr_to_bus(bus, addr) ((addr) - bus_to_baddr[(bus)->number]) #define __swizzle_addr_w(port) ((port) ^ 2)+#elif defined(CONFIG_TANGO2) && defined(CONFIG_PCI)+unsigned long tango2_virt_to_bus(unsigned long virt_addr);+unsigned long tango2_bus_to_virt(unsigned long bus_addr);+#define bus_to_baddr(bus, addr) tango2_virt_to_bus(addr)+#define baddr_to_bus(bus, addr) tango2_bus_to_virt(addr)+#define __swizzle_addr_w(port) (port) #else #define bus_to_baddr(bus, addr) (addr) #define baddr_to_bus(bus, addr) (addr)@@ -310,6 +316,181 @@ #define SLOW_DOWN_IO #endif +#if defined(CONFIG_TANGO2) && defined(CONFIG_PCI)+//#define TANGO2_PCI_IO MEMORY_BASE_PCI_IO /* PCi I/O space */+//#define TANGO2_PCI_MEM MEMORY_BASE_PCI_MEMORY /* PCI Memory Base */+#define TANGO2_PCI_IO 0x58000000UL+#define TANGO2_PCI_MEM 0x60000000UL++#define outb(val,port) \+do { \+ u32 p; \+ if (((port) >= TANGO2_PCI_IO) && ((port) < TANGO2_PCI_MEM)) \+ p = (port) - TANGO2_PCI_IO; \+ else { \+ printk("Port operation exceed Tango2 PCI IO space 0x%08x\n", (port)); \+ p = (port); \+ } \+ *(volatile u8 *)(mips_io_port_base + (p)) = (val); \+ __sync(); \+} while(0)+ +#define outw(val,port) \+do { \+ u32 p; \+ if (((port) >= TANGO2_PCI_IO) && ((port) < TANGO2_PCI_MEM)) \+ p = (port) - TANGO2_PCI_IO; \+ else { \+ printk("Port operation exceed Tango2 PCI IO space 0x%08x\n", (port)); \+ p = (port); \+ } \+ *(volatile u16 *)(mips_io_port_base + __swizzle_addr_w(p)) = \+ __ioswab16(val); \+ __sync(); \+} while(0)+ +#define outl(val,port) \+do { \+ u32 p; \+ if (((port) >= TANGO2_PCI_IO) && ((port) < TANGO2_PCI_MEM)) \+ p = (port) - TANGO2_PCI_IO; \+ else { \+ printk("Port operation exceed Tango2 PCI IO space 0x%08x\n", (port)); \+ p = (port); \+ } \+ *(volatile u32 *)(mips_io_port_base + (p)) = __ioswab32(val); \+ __sync(); \+} while(0)+ +#define outb_p(val,port) \+do { \+ u32 p; \+ if (((port) >= TANGO2_PCI_IO) && ((port) < TANGO2_PCI_MEM)) \+ p = (port) - TANGO2_PCI_IO; \+ else { \+ printk("Port operation exceed Tango2 PCI IO space 0x%08x\n", (port)); \+ p = (port); \+ } \+ *(volatile u8 *)(mips_io_port_base + (p)) = (val); \+ __sync(); \+ SLOW_DOWN_IO; \+} while(0)+ +#define outw_p(val,port) \+do { \+ u32 p; \+ if (((port) >= TANGO2_PCI_IO) && ((port) < TANGO2_PCI_MEM)) \+ p = (port) - TANGO2_PCI_IO; \+ else { \+ printk("Port operation exceed Tango2 PCI IO space 0x%08x\n", (port)); \+ p = (port); \+ } \+ *(volatile u16 *)(mips_io_port_base + __swizzle_addr_w(p)) = \+ __ioswab16(val); \+ __sync(); \+ SLOW_DOWN_IO; \+} while(0)+ +#define outl_p(val,port) \+do { \+ u32 p; \+ if (((port) >= TANGO2_PCI_IO) && ((port) < TANGO2_PCI_MEM)) \+ p = (port) - TANGO2_PCI_IO; \+ else { \+ printk("Port operation exceed Tango2 PCI IO space 0x%08x\n", (port)); \+ p = (port); \+ } \+ *(volatile u32 *)(mips_io_port_base + (p)) = __ioswab32(val); \+ __sync(); \+ SLOW_DOWN_IO; \+} while(0)+ +static inline unsigned char inb(unsigned long port)+{+ u32 p; + if ((port >= TANGO2_PCI_IO) && (port < TANGO2_PCI_MEM)) + p = port - TANGO2_PCI_IO; + else { + printk("Port operation exceed Tango2 PCI IO space 0x%08x\n", (port)); + p = port; + } + return *(volatile u8 *)(mips_io_port_base + p);+}+ +static inline unsigned short inw(unsigned long port)+{+ u32 p; + if ((port >= TANGO2_PCI_IO) && (port < TANGO2_PCI_MEM)) + p = port - TANGO2_PCI_IO; + else { + printk("Port operation exceed Tango2 PCI IO space 0x%08x\n", (port)); + p = port; + } + p = __swizzle_addr_w(p);+ + return __ioswab16(*(volatile u16 *)(mips_io_port_base + p));+}+ +static inline unsigned int inl(unsigned long port)+{+ u32 p; + if ((port >= TANGO2_PCI_IO) && (port < TANGO2_PCI_MEM)) + p = port - TANGO2_PCI_IO; + else { + printk("Port operation exceed Tango2 PCI IO space 0x%08x\n", (port)); + p = port; + } + return __ioswab32(*(volatile u32 *)(mips_io_port_base + p));+}+ +static inline unsigned char inb_p(unsigned long port)+{+ u8 __val;+ u32 p; + if ((port >= TANGO2_PCI_IO) && (port < TANGO2_PCI_MEM)) + p = port - TANGO2_PCI_IO; + else { + printk("Port operation exceed Tango2 PCI IO space 0x%08x\n", (port)); + p = port; + } + __val = *(volatile u8 *)(mips_io_port_base + p);+ SLOW_DOWN_IO;+ + return __val;+}+ +static inline unsigned short inw_p(unsigned long port)+{+ u16 __val;+ u32 p; + if ((port >= TANGO2_PCI_IO) && (port < TANGO2_PCI_MEM)) + p = port - TANGO2_PCI_IO; + else { + printk("Port operation exceed Tango2 PCI IO space 0x%08x\n", (port)); + p = port; + } + p = __swizzle_addr_w(p);+ __val = *(volatile u16 *)(mips_io_port_base + p);+ SLOW_DOWN_IO;+ + return __ioswab16(__val);+}+ +static inline unsigned int inl_p(unsigned long port)+{+ u32 __val;+ u32 p; + if ((port >= TANGO2_PCI_IO) && (port < TANGO2_PCI_MEM)) + p = port - TANGO2_PCI_IO; + else { + printk("Port operation exceed Tango2 PCI IO space 0x%08x\n", (port)); + p = port; + } + __val = *(volatile u32 *)(mips_io_port_base + p);+ SLOW_DOWN_IO;+ return __ioswab32(__val);+}+#else /* !CONFIG_TANGO2 || !CONFIG_PCI */ #define outb(val,port) \ do { \ *(volatile u8 *)(mips_io_port_base + (port)) = (val); \@@ -391,6 +572,7 @@ SLOW_DOWN_IO; return __ioswab32(__val); }+#endif /* CONFIG_TANGO2 && CONFIG_PCI */ static inline void __outsb(unsigned long port, void *addr, unsigned int count) {diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linuxmips-2.4.30.ref/include/asm-mips/pci.h linuxmips-2.4.30/include/asm-mips/pci.h--- linuxmips-2.4.30.ref/include/asm-mips/pci.h 2003-11-16 17:07:45.000000000 -0800+++ linuxmips-2.4.30/include/asm-mips/pci.h 2007-01-09 13:01:43.000000000 -0800@@ -49,6 +49,14 @@ #define PCIBIOS_MIN_MEM 0x1000000 #endif +#if defined(CONFIG_TANGO2)+#include <asm/tango2/hardware.h>+#undef PCIBIOS_MIN_IO+#undef PCIBIOS_MIN_MEM+#define PCIBIOS_MIN_IO MEMORY_BASE_PCI_IO+#define PCIBIOS_MIN_MEM (MEMORY_BASE_PCI_MEMORY + 0x00100000) /* avoid 0x00000000 on bus addr */+#endif+ struct pci_dev; /*diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linuxmips-2.4.30.ref/README.1010.pci.patch linuxmips-2.4.30/README.1010.pci.patch--- linuxmips-2.4.30.ref/README.1010.pci.patch 1969-12-31 16:00:00.000000000 -0800+++ linuxmips-2.4.30/README.1010.pci.patch 2007-01-09 13:04:38.000000000 -0800@@ -0,0 +1,21 @@+Feature:+--------+PCI host support for SMP863x.++Prerequisite patch numbers:+---------------------------+0000+1000+1005+1006++Primary author:+---------------+YH Lin++Related to which chip version SMP863x x=?+-----------------------------------------+all++(linux patches) which CONFIG_... are provided:+----------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -