add (experimental) m68k DMA and wildfire patches
svn path=/dists/sid/linux-2.6/; revision=6666
This commit is contained in:
parent
a55f7cf828
commit
2237e7ee6c
|
@ -0,0 +1,282 @@
|
|||
arch/m68k/kernel/Makefile | 4 -
|
||||
arch/m68k/kernel/dma.c | 112 +++++++++++++++++++++++++++++++++++++++++
|
||||
include/asm-m68k/dma-mapping.h | 63 ++++++++++++++++++++---
|
||||
include/asm-m68k/scatterlist.h | 9 +--
|
||||
4 files changed, 175 insertions(+), 13 deletions(-)
|
||||
|
||||
Index: linux-tmp/include/asm-m68k/scatterlist.h
|
||||
===================================================================
|
||||
--- linux-tmp.orig/include/asm-m68k/scatterlist.h 2005-06-04 21:57:39.000000000 +0200
|
||||
+++ linux-tmp/include/asm-m68k/scatterlist.h 2005-06-04 21:57:50.000000000 +0200
|
||||
@@ -2,18 +2,17 @@
|
||||
#define _M68K_SCATTERLIST_H
|
||||
|
||||
struct scatterlist {
|
||||
- /* These two are only valid if ADDRESS member of this
|
||||
- * struct is NULL.
|
||||
- */
|
||||
struct page *page;
|
||||
unsigned int offset;
|
||||
-
|
||||
unsigned int length;
|
||||
|
||||
- __u32 dvma_address; /* A place to hang host-specific addresses at. */
|
||||
+ __u32 dma_address; /* A place to hang host-specific addresses at. */
|
||||
};
|
||||
|
||||
/* This is bogus and should go away. */
|
||||
#define ISA_DMA_THRESHOLD (0x00ffffff)
|
||||
|
||||
+#define sg_dma_address(sg) ((sg)->dma_address)
|
||||
+#define sg_dma_len(sg) ((sg)->length)
|
||||
+
|
||||
#endif /* !(_M68K_SCATTERLIST_H) */
|
||||
Index: linux-tmp/arch/m68k/kernel/Makefile
|
||||
===================================================================
|
||||
--- linux-tmp.orig/arch/m68k/kernel/Makefile 2005-06-04 21:57:39.000000000 +0200
|
||||
+++ linux-tmp/arch/m68k/kernel/Makefile 2005-06-04 21:57:50.000000000 +0200
|
||||
@@ -9,8 +9,8 @@ else
|
||||
endif
|
||||
extra-y += vmlinux.lds
|
||||
|
||||
-obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \
|
||||
- sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o
|
||||
+obj-y := entry.o process.o traps.o ints.o dma.o signal.o ptrace.o \
|
||||
+ sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o
|
||||
|
||||
obj-$(CONFIG_PCI) += bios32.o
|
||||
obj-$(CONFIG_MODULES) += module.o
|
||||
Index: linux-tmp/arch/m68k/kernel/dma.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux-tmp/arch/m68k/kernel/dma.c 2005-06-04 22:30:41.495377370 +0200
|
||||
@@ -0,0 +1,112 @@
|
||||
+
|
||||
+#include <linux/dma-mapping.h>
|
||||
+#include <linux/device.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/vmalloc.h>
|
||||
+
|
||||
+#include <asm/pgalloc.h>
|
||||
+#include <asm/scatterlist.h>
|
||||
+
|
||||
+void *dma_alloc_coherent(struct device *dev, size_t size,
|
||||
+ dma_addr_t *handle, int flag)
|
||||
+{
|
||||
+ struct page *page, **map;
|
||||
+ pgprot_t pgprot;
|
||||
+ void *addr;
|
||||
+ int i, order;
|
||||
+
|
||||
+ pr_debug("dma_alloc_coherent: %d,%x\n", size, flag);
|
||||
+
|
||||
+ size = PAGE_ALIGN(size);
|
||||
+ order = get_order(size);
|
||||
+
|
||||
+ page = alloc_pages(flag, order);
|
||||
+ if (!page)
|
||||
+ return NULL;
|
||||
+
|
||||
+ *handle = page_to_phys(page);
|
||||
+ map = kmalloc(sizeof(struct page *) << order, flag);
|
||||
+ if (!map) {
|
||||
+ __free_pages(page, order);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ order = 1 << order;
|
||||
+ size >>= PAGE_SHIFT;
|
||||
+ map[0] = page;
|
||||
+ for (i = 1; i < size; i++) {
|
||||
+ map[i] = page + i;
|
||||
+ get_page(map[i]);
|
||||
+ }
|
||||
+ for (; i < order; i++)
|
||||
+ __free_page(page + i);
|
||||
+ pgprot = __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY);
|
||||
+ if (CPU_IS_040_OR_060)
|
||||
+ pgprot_val(pgprot) |= _PAGE_GLOBAL040 | _PAGE_NOCACHE_S;
|
||||
+ else
|
||||
+ pgprot_val(pgprot) |= _PAGE_NOCACHE030;
|
||||
+ addr = vmap(map, size, flag, pgprot);
|
||||
+ kfree(map);
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+void dma_free_coherent(struct device *dev, size_t size,
|
||||
+ void *addr, dma_addr_t handle)
|
||||
+{
|
||||
+ vfree(addr);
|
||||
+}
|
||||
+
|
||||
+inline void dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size,
|
||||
+ enum dma_data_direction dir)
|
||||
+{
|
||||
+ if (dir == DMA_TO_DEVICE)
|
||||
+ cache_push(handle, size);
|
||||
+ else if (dir == DMA_FROM_DEVICE)
|
||||
+ cache_clear(handle, size);
|
||||
+}
|
||||
+
|
||||
+void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
|
||||
+ enum dma_data_direction dir)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < nents; sg++, i++)
|
||||
+ dma_sync_single_for_device(dev, sg->dma_address, sg->length, dir);
|
||||
+}
|
||||
+
|
||||
+dma_addr_t dma_map_single(struct device *dev, void *addr, size_t size,
|
||||
+ enum dma_data_direction dir)
|
||||
+{
|
||||
+ dma_addr_t handle = virt_to_bus(addr);
|
||||
+ dma_sync_single_for_device(dev, handle, size, dir);
|
||||
+ return handle;
|
||||
+}
|
||||
+
|
||||
+dma_addr_t dma_map_page(struct device *dev, struct page *page,
|
||||
+ unsigned long offset, size_t size,
|
||||
+ enum dma_data_direction dir)
|
||||
+{
|
||||
+ dma_addr_t handle = page_to_phys(page) + offset;
|
||||
+ dma_sync_single_for_device(dev, handle, size, dir);
|
||||
+ return handle;
|
||||
+}
|
||||
+
|
||||
+int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
|
||||
+ enum dma_data_direction dir)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < nents; sg++, i++) {
|
||||
+ sg->dma_address = page_to_phys(sg->page) + sg->offset;
|
||||
+ dma_sync_single_for_device(dev, sg->dma_address, sg->length, dir);
|
||||
+ }
|
||||
+ return nents;
|
||||
+}
|
||||
+
|
||||
+EXPORT_SYMBOL(dma_alloc_coherent);
|
||||
+EXPORT_SYMBOL(dma_free_coherent);
|
||||
+EXPORT_SYMBOL(dma_map_single);
|
||||
+EXPORT_SYMBOL(dma_map_page);
|
||||
+EXPORT_SYMBOL(dma_map_sg);
|
||||
+EXPORT_SYMBOL(dma_sync_single_for_device);
|
||||
+EXPORT_SYMBOL(dma_sync_sg_for_device);
|
||||
Index: linux-tmp/include/asm-m68k/dma-mapping.h
|
||||
===================================================================
|
||||
--- linux-tmp.orig/include/asm-m68k/dma-mapping.h 2005-06-04 21:57:39.000000000 +0200
|
||||
+++ linux-tmp/include/asm-m68k/dma-mapping.h 2005-06-04 21:57:50.000000000 +0200
|
||||
@@ -1,12 +1,63 @@
|
||||
#ifndef _M68K_DMA_MAPPING_H
|
||||
#define _M68K_DMA_MAPPING_H
|
||||
|
||||
-#include <linux/config.h>
|
||||
+struct scatterlist;
|
||||
|
||||
-#ifdef CONFIG_PCI
|
||||
-#include <asm-generic/dma-mapping.h>
|
||||
-#else
|
||||
-#include <asm-generic/dma-mapping-broken.h>
|
||||
-#endif
|
||||
+static inline int dma_supported(struct device *dev, u64 mask)
|
||||
+{
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static inline int dma_set_mask(struct device *dev, u64 mask)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+extern void *dma_alloc_coherent(struct device *, size_t,
|
||||
+ dma_addr_t *, int);
|
||||
+extern void dma_free_coherent(struct device *, size_t,
|
||||
+ void *, dma_addr_t);
|
||||
+
|
||||
+extern dma_addr_t dma_map_single(struct device *, void *, size_t,
|
||||
+ enum dma_data_direction);
|
||||
+static inline void dma_unmap_single(struct device *dev, dma_addr_t addr,
|
||||
+ size_t size, enum dma_data_direction dir)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+extern dma_addr_t dma_map_page(struct device *, struct page *,
|
||||
+ unsigned long, size_t size,
|
||||
+ enum dma_data_direction);
|
||||
+static inline void dma_unmap_page(struct device *dev, dma_addr_t address,
|
||||
+ size_t size, enum dma_data_direction dir)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+extern int dma_map_sg(struct device *, struct scatterlist *, int,
|
||||
+ enum dma_data_direction);
|
||||
+static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
|
||||
+ int nhwentries, enum dma_data_direction dir)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+extern void dma_sync_single_for_device(struct device *, dma_addr_t, size_t,
|
||||
+ enum dma_data_direction);
|
||||
+extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int,
|
||||
+ enum dma_data_direction);
|
||||
+
|
||||
+static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle,
|
||||
+ size_t size, enum dma_data_direction dir)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
|
||||
+ int nents, enum dma_data_direction dir)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+static inline int dma_mapping_error(dma_addr_t handle)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
#endif /* _M68K_DMA_MAPPING_H */
|
||||
diff -pur -X /home/roman/nodiff linux-tmp/arch/m68k/apollo/Makefile linux/arch/m68k/apollo/Makefile
|
||||
--- linux-tmp/arch/m68k/apollo/Makefile 2002-12-17 00:58:44.000000000 +0100
|
||||
+++ linux/arch/m68k/apollo/Makefile 2005-06-10 23:28:12.000000000 +0200
|
||||
@@ -2,4 +2,4 @@
|
||||
# Makefile for Linux arch/m68k/amiga source directory
|
||||
#
|
||||
|
||||
-obj-y := config.o dn_ints.o dma.o
|
||||
+obj-y := config.o dn_ints.o
|
||||
diff -pur -X /home/roman/nodiff linux-tmp/drivers/scsi/sun3x_esp.c linux/drivers/scsi/sun3x_esp.c
|
||||
--- linux-tmp/drivers/scsi/sun3x_esp.c 2004-12-30 00:48:46.000000000 +0100
|
||||
+++ linux/drivers/scsi/sun3x_esp.c 2005-06-11 02:43:27.000000000 +0200
|
||||
@@ -334,11 +334,11 @@ static void dma_mmu_get_scsi_sgl (struct
|
||||
struct scatterlist *sg = sp->SCp.buffer;
|
||||
|
||||
while (sz >= 0) {
|
||||
- sg[sz].dvma_address = dvma_map((unsigned long)page_address(sg[sz].page) +
|
||||
+ sg[sz].dma_address = dvma_map((unsigned long)page_address(sg[sz].page) +
|
||||
sg[sz].offset, sg[sz].length);
|
||||
sz--;
|
||||
}
|
||||
- sp->SCp.ptr=(char *)((unsigned long)sp->SCp.buffer->dvma_address);
|
||||
+ sp->SCp.ptr=(char *)((unsigned long)sp->SCp.buffer->dma_address);
|
||||
}
|
||||
|
||||
static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp)
|
||||
@@ -352,14 +352,14 @@ static void dma_mmu_release_scsi_sgl (st
|
||||
struct scatterlist *sg = (struct scatterlist *)sp->buffer;
|
||||
|
||||
while(sz >= 0) {
|
||||
- dvma_unmap((char *)sg[sz].dvma_address);
|
||||
+ dvma_unmap((char *)sg[sz].dma_address);
|
||||
sz--;
|
||||
}
|
||||
}
|
||||
|
||||
static void dma_advance_sg (Scsi_Cmnd *sp)
|
||||
{
|
||||
- sp->SCp.ptr = (char *)((unsigned long)sp->SCp.buffer->dvma_address);
|
||||
+ sp->SCp.ptr = (char *)((unsigned long)sp->SCp.buffer->dma_address);
|
||||
}
|
||||
|
||||
static int sun3x_esp_release(struct Scsi_Host *instance)
|
|
@ -0,0 +1,288 @@
|
|||
arch/m68k/Kconfig | 8 +++
|
||||
arch/m68k/amiga/Makefile | 1
|
||||
arch/m68k/amiga/wildfire.c | 93 +++++++++++++++++++++++++++++++++++++++++++
|
||||
arch/m68k/kernel/Makefile | 1
|
||||
include/asm-m68k/amigaints.h | 14 ++++++
|
||||
include/asm-m68k/io.h | 20 +++++----
|
||||
include/asm-m68k/pci.h | 38 +++++------------
|
||||
7 files changed, 137 insertions(+), 38 deletions(-)
|
||||
|
||||
Index: linux-tmp/arch/m68k/Kconfig
|
||||
===================================================================
|
||||
--- linux-tmp.orig/arch/m68k/Kconfig 2005-06-14 02:49:00.474288599 +0200
|
||||
+++ linux-tmp/arch/m68k/Kconfig 2005-06-14 02:49:06.131323437 +0200
|
||||
@@ -92,6 +92,12 @@ config AMIGA
|
||||
you plan to use this kernel on an Amiga, say Y here and browse the
|
||||
material available in <file:Documentation/m68k>; otherwise say N.
|
||||
|
||||
+config WILDFIRE
|
||||
+ bool "WildFire support"
|
||||
+ depends on AMIGA
|
||||
+ help
|
||||
+ This option enables support for the WildFire accelerator card.
|
||||
+
|
||||
config ATARI
|
||||
bool "Atari support"
|
||||
depends on !MMU_SUN3
|
||||
@@ -110,7 +116,7 @@ config HADES
|
||||
|
||||
config PCI
|
||||
bool
|
||||
- depends on HADES
|
||||
+ depends on HADES || WILDFIRE
|
||||
default y
|
||||
help
|
||||
Find out whether you have a PCI motherboard. PCI is the name of a
|
||||
Index: linux-tmp/arch/m68k/amiga/Makefile
|
||||
===================================================================
|
||||
--- linux-tmp.orig/arch/m68k/amiga/Makefile 2005-06-14 02:49:00.474288599 +0200
|
||||
+++ linux-tmp/arch/m68k/amiga/Makefile 2005-06-14 02:49:06.131323437 +0200
|
||||
@@ -5,3 +5,4 @@
|
||||
obj-y := config.o amiints.o cia.o chipram.o amisound.o amiga_ksyms.o
|
||||
|
||||
obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o
|
||||
+obj-$(CONFIG_WILDFIRE) += wildfire.o
|
||||
Index: linux-tmp/include/asm-m68k/amigaints.h
|
||||
===================================================================
|
||||
--- linux-tmp.orig/include/asm-m68k/amigaints.h 2005-06-14 02:49:00.474288599 +0200
|
||||
+++ linux-tmp/include/asm-m68k/amigaints.h 2005-06-14 02:49:06.131323437 +0200
|
||||
@@ -23,7 +23,8 @@
|
||||
#define AUTO_IRQS (8)
|
||||
#define AMI_STD_IRQS (14)
|
||||
#define CIA_IRQS (5)
|
||||
-#define AMI_IRQS (32) /* AUTO_IRQS+AMI_STD_IRQS+2*CIA_IRQS */
|
||||
+#define WILDFIRE_IRQS (9)
|
||||
+#define AMI_IRQS (41) /* AUTO_IRQS+AMI_STD_IRQS+2*CIA_IRQS+WILDFIRE_IRQS */
|
||||
|
||||
/* builtin serial port interrupts */
|
||||
#define IRQ_AMIGA_TBE (IRQ_USER+0)
|
||||
@@ -108,4 +109,15 @@ extern void cia_init_IRQ(struct ciabase
|
||||
extern unsigned char cia_set_irq(struct ciabase *base, unsigned char mask);
|
||||
extern unsigned char cia_able_irq(struct ciabase *base, unsigned char mask);
|
||||
|
||||
+#define IRQ_WF 32
|
||||
+#define IRQ_WF_WRERR 32
|
||||
+#define IRQ_WF_PCI_INT0 33
|
||||
+#define IRQ_WF_PCI_INT1 34
|
||||
+#define IRQ_WF_PCI_INT2 35
|
||||
+#define IRQ_WF_PCI_INT3 36
|
||||
+#define IRQ_WF_PCI_INT4 37
|
||||
+#define IRQ_WF_PERR 38
|
||||
+#define IRQ_WF_SERR 39
|
||||
+#define IRQ_WF_MERR 40
|
||||
+
|
||||
#endif /* asm-m68k/amigaints.h */
|
||||
Index: linux-tmp/include/asm-m68k/io.h
|
||||
===================================================================
|
||||
--- linux-tmp.orig/include/asm-m68k/io.h 2005-06-14 02:49:00.475288428 +0200
|
||||
+++ linux-tmp/include/asm-m68k/io.h 2005-06-14 02:49:06.132323267 +0200
|
||||
@@ -262,16 +262,16 @@ static inline void isa_delay(void)
|
||||
|
||||
#if defined(CONFIG_PCI)
|
||||
|
||||
-#define inl(port) in_le32(port)
|
||||
-#define outl(val,port) out_le32((port),(val))
|
||||
-#define readl(addr) in_le32(addr)
|
||||
-#define writel(val,addr) out_le32((addr),(val))
|
||||
+#define inl(port) in_be32(port)
|
||||
+#define outl(val,port) out_be32((port),(val))
|
||||
+#define readl(addr) in_be32(addr)
|
||||
+#define writel(val,addr) out_be32((addr),(val))
|
||||
|
||||
/* those can be defined for both ISA and PCI - it won't work though */
|
||||
#define readb(addr) in_8(addr)
|
||||
-#define readw(addr) in_le16(addr)
|
||||
+#define readw(addr) in_be16(addr)
|
||||
#define writeb(val,addr) out_8((addr),(val))
|
||||
-#define writew(val,addr) out_le16((addr),(val))
|
||||
+#define writew(val,addr) out_be16((addr),(val))
|
||||
|
||||
#define readb_relaxed(addr) readb(addr)
|
||||
#define readw_relaxed(addr) readw(addr)
|
||||
@@ -280,8 +280,12 @@ static inline void isa_delay(void)
|
||||
#ifndef CONFIG_ISA
|
||||
#define inb(port) in_8(port)
|
||||
#define outb(val,port) out_8((port),(val))
|
||||
-#define inw(port) in_le16(port)
|
||||
-#define outw(val,port) out_le16((port),(val))
|
||||
+#define inw(port) in_be16(port)
|
||||
+#define outw(val,port) out_be16((port),(val))
|
||||
+
|
||||
+#define memset_io(a,b,c) memset((void *)(a),(b),(c))
|
||||
+#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
|
||||
+#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
|
||||
|
||||
#else
|
||||
/*
|
||||
Index: linux-tmp/include/asm-m68k/pci.h
|
||||
===================================================================
|
||||
--- linux-tmp.orig/include/asm-m68k/pci.h 2005-06-14 02:49:00.475288428 +0200
|
||||
+++ linux-tmp/include/asm-m68k/pci.h 2005-06-14 02:49:06.132323267 +0200
|
||||
@@ -1,39 +1,17 @@
|
||||
#ifndef _ASM_M68K_PCI_H
|
||||
#define _ASM_M68K_PCI_H
|
||||
|
||||
+#include <asm-generic/pci-dma-compat.h>
|
||||
+#include <asm-generic/pci.h>
|
||||
+
|
||||
/*
|
||||
* asm-m68k/pci_m68k.h - m68k specific PCI declarations.
|
||||
*
|
||||
* Written by Wout Klaren.
|
||||
*/
|
||||
|
||||
-#include <asm/scatterlist.h>
|
||||
-
|
||||
-struct pci_ops;
|
||||
-
|
||||
-/*
|
||||
- * Structure with hardware dependent information and functions of the
|
||||
- * PCI bus.
|
||||
- */
|
||||
-
|
||||
-struct pci_bus_info
|
||||
-{
|
||||
- /*
|
||||
- * Resources of the PCI bus.
|
||||
- */
|
||||
-
|
||||
- struct resource mem_space;
|
||||
- struct resource io_space;
|
||||
-
|
||||
- /*
|
||||
- * System dependent functions.
|
||||
- */
|
||||
-
|
||||
- struct pci_ops *m68k_pci_ops;
|
||||
-
|
||||
- void (*fixup)(int pci_modify);
|
||||
- void (*conf_device)(struct pci_dev *dev);
|
||||
-};
|
||||
+#define PCIBIOS_MIN_IO 0
|
||||
+#define PCIBIOS_MIN_MEM 0
|
||||
|
||||
#define pcibios_assign_all_busses() 0
|
||||
#define pcibios_scan_all_fns(a, b) 0
|
||||
@@ -54,6 +32,12 @@ static inline void pcibios_penalize_isa_
|
||||
*/
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
|
||||
+/*
|
||||
+ * We don't support DAC DMA cycles.
|
||||
+ */
|
||||
+#define pci_dac_dma_supported(pci_dev, mask) (0)
|
||||
+
|
||||
+
|
||||
static inline void pcibios_add_platform_entries(struct pci_dev *dev)
|
||||
{
|
||||
}
|
||||
Index: linux-tmp/arch/m68k/amiga/wildfire.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux-tmp/arch/m68k/amiga/wildfire.c 2005-06-14 02:49:06.145321049 +0200
|
||||
@@ -0,0 +1,93 @@
|
||||
+
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/pci.h>
|
||||
+
|
||||
+#include <asm/amigaints.h>
|
||||
+
|
||||
+#define WF_AccCfg0 0x00
|
||||
+#define WF_AccCfg1 0x08
|
||||
+#define WF_IntrCntrl 0x10
|
||||
+#define WF_IntReg0 0x20
|
||||
+#define WF_IntReg1 0x28
|
||||
+
|
||||
+/* WF_AccCfg1 */
|
||||
+#define WF_PCI_Rst 0x04
|
||||
+#define WF_PCI_CfgCyc 0x02
|
||||
+#define WF_AccelDsbl 0x01
|
||||
+
|
||||
+/* WF_IntrCntrl */
|
||||
+#define WF_AccInt6En 0x80
|
||||
+#define WF_SERR_IntEn 0x40
|
||||
+#define WF_PERR_IntEn 0x20
|
||||
+#define WF_MERR_IntEn 0x10
|
||||
+#define WF_PwrUp 0x08
|
||||
+
|
||||
+/* WF_IntReg0 */
|
||||
+#define WF_AccInt6 0x80
|
||||
+#define WF_SERR_Int 0x40
|
||||
+#define WF_PERR_Int 0x20
|
||||
+#define WF_MERR_Int 0x10
|
||||
+#define WF_MBPostWrErr 0x08
|
||||
+#define WF_Dev_Int 0x04
|
||||
+
|
||||
+/* WF_IntReg1 */
|
||||
+#define WF_PCI_Intr4 0x10
|
||||
+#define WF_PCI_Intr3 0x08
|
||||
+#define WF_PCI_Intr2 0x04
|
||||
+#define WF_PCI_Intr1 0x02
|
||||
+#define WF_PCI_Intr0 0x01
|
||||
+
|
||||
+static u8 *pci_conf_base, *wildfire_base;
|
||||
+static int pci_dev_mask;
|
||||
+
|
||||
+void __init pcibios_fixup_bus(struct pci_bus *bus)
|
||||
+{
|
||||
+ struct pci_dev *dev;
|
||||
+
|
||||
+ printk("pcibios_fixup_bus\n");
|
||||
+ list_for_each_entry(dev, &bus->devices, bus_list)
|
||||
+ dev->irq = IRQ_WF_PCI_INT0 + PCI_SLOT(dev->devfn);
|
||||
+}
|
||||
+
|
||||
+int pcibios_enable_device(struct pci_dev *dev, int mask)
|
||||
+{
|
||||
+ struct resource *r;
|
||||
+ u16 cmd, old_cmd;
|
||||
+ int idx;
|
||||
+
|
||||
+ printk("pcibios_enable_device: %x\n", mask);
|
||||
+ pci_read_config_word(dev, PCI_COMMAND, &cmd);
|
||||
+ old_cmd = cmd;
|
||||
+ for (idx = 0; idx < 6; idx++) {
|
||||
+ /* Only set up the requested stuff */
|
||||
+ if (!(mask & (1 << idx)))
|
||||
+ continue;
|
||||
+ r = dev->resource + idx;
|
||||
+ if (r->flags & IORESOURCE_IO)
|
||||
+ cmd |= PCI_COMMAND_IO;
|
||||
+ if (r->flags & IORESOURCE_MEM)
|
||||
+ cmd |= PCI_COMMAND_MEMORY;
|
||||
+ }
|
||||
+ if (cmd != old_cmd) {
|
||||
+ printk("PCI: enabling device %s (%04x -> %04x)\n",
|
||||
+ dev->slot_name, old_cmd, cmd);
|
||||
+ pci_write_config_word(dev, PCI_COMMAND, cmd);
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void pcibios_align_resource(void *data, struct resource *res,
|
||||
+ unsigned long size, unsigned long align)
|
||||
+{
|
||||
+ if (res->flags & IORESOURCE_IO) {
|
||||
+ unsigned long start = res->start;
|
||||
+
|
||||
+ if (start & 0x300)
|
||||
+ res->start = (start + 0x3ff) & ~0x3ff;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+char * __init pcibios_setup (char *str)
|
||||
+{
|
||||
+ return str;
|
||||
+}
|
||||
Index: linux-tmp/arch/m68k/kernel/Makefile
|
||||
===================================================================
|
||||
--- linux-tmp.orig/arch/m68k/kernel/Makefile 2005-06-14 02:49:00.474288599 +0200
|
||||
+++ linux-tmp/arch/m68k/kernel/Makefile 2005-06-14 02:49:06.145321049 +0200
|
||||
@@ -12,7 +12,6 @@ extra-y += vmlinux.lds
|
||||
obj-y := entry.o process.o traps.o ints.o dma.o signal.o ptrace.o \
|
||||
sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o
|
||||
|
||||
-obj-$(CONFIG_PCI) += bios32.o
|
||||
obj-$(CONFIG_MODULES) += module.o
|
||||
|
||||
EXTRA_AFLAGS := -traditional
|
Loading…
Reference in New Issue