1 From da8e8fe3d6ad5eb9589c8e77e7716e4f7e1a7499 Mon Sep 17 00:00:00 2001
2 From: Kurt Mahan <kmahan@freescale.com>
3 Date: Mon, 10 Dec 2007 03:36:05 -0700
4 Subject: [PATCH] Coldfire M5445x PCI Bits.
7 Signed-off-by: Kurt Mahan <kmahan@freescale.com>
9 arch/m68k/Kconfig | 12 ++++++++++--
10 arch/m68k/Makefile | 4 ++++
11 arch/m68k/coldfire/config.c | 2 +-
12 arch/m68k/coldfire/iomap.c | 2 ++
13 arch/m68k/coldfire/mcf5445x-devices.c | 9 +++++++++
14 arch/m68k/coldfire/mcf5445x-pci.c | 5 +++--
15 arch/m68k/coldfire/pci.c | 6 +++---
16 arch/m68k/kernel/Makefile | 2 +-
17 drivers/macintosh/Kconfig | 1 -
18 drivers/pci/Makefile | 1 +
19 include/asm-m68k/io.h | 13 ++++++++++++-
20 include/asm-m68k/pci.h | 2 ++
21 12 files changed, 48 insertions(+), 11 deletions(-)
23 --- a/arch/m68k/Kconfig
24 +++ b/arch/m68k/Kconfig
25 @@ -11,6 +11,14 @@ config MMU
33 +config GENERIC_CLOCKEVENTS
37 config RWSEM_GENERIC_SPINLOCK
40 @@ -48,7 +56,7 @@ config ARCH_MAY_HAVE_PC_FDC
49 @@ -159,7 +167,7 @@ config HADES
54 + depends on HADES || M54455
57 Find out whether you have a PCI motherboard. PCI is the name of a
58 --- a/arch/m68k/Makefile
59 +++ b/arch/m68k/Makefile
60 @@ -32,6 +32,10 @@ ifdef CONFIG_SUN3
64 +ifdef CONFIG_COLDFIRE
65 +# LDFLAGS_vmlinux = --verbose
68 CHECKFLAGS += -D__mc68000__
70 # without -fno-strength-reduce the 53c7xx.c driver fails ;-(
71 --- a/arch/m68k/coldfire/config.c
72 +++ b/arch/m68k/coldfire/config.c
73 @@ -252,7 +252,7 @@ void __init coldfire_sched_init(irq_hand
74 MCF_DTIM_DTMR_FRR | MCF_DTIM_DTMR_RST_EN, \
77 - request_irq(mcf_timervector, handler, SA_INTERRUPT, \
78 + request_irq(mcf_timervector, handler, IRQF_DISABLED, \
79 "timer", (void *)MCF_DTIM0_DTMR);
81 settimericr(1, mcf_timerlevel);
82 --- a/arch/m68k/coldfire/iomap.c
83 +++ b/arch/m68k/coldfire/iomap.c
85 #include <linux/pci.h>
89 void __iomem *__attribute__ ((weak))
90 ioport_map(unsigned long port, unsigned int len)
92 @@ -52,3 +53,4 @@ void pci_iounmap(struct pci_dev *dev, vo
95 EXPORT_SYMBOL(ioport_unmap);
97 --- a/arch/m68k/coldfire/mcf5445x-devices.c
98 +++ b/arch/m68k/coldfire/mcf5445x-devices.c
99 @@ -75,10 +75,19 @@ static int ata_get_clk_rate(void)
103 +/* JKM -- move these to a header file */
104 +#define MCF_IDE_DMA_WATERMARK 32 /* DMA watermark level in bytes */
105 +#define MCF_IDE_DMA_BD_NR (512/3/4) /* number of BDs per channel */
107 static struct fsl_ata_platform_data ata_data = {
110 .get_clk_rate = ata_get_clk_rate,
111 +#ifdef CONFIG_PATA_FSL_USE_DMA
112 + .udma_mask = 0x0F, /* the board handles up to UDMA3 */
113 + .fifo_alarm = MCF_IDE_DMA_WATERMARK / 2,
114 + .max_sg = MCF_IDE_DMA_BD_NR,
118 static struct resource pata_fsl_resources[] = {
119 --- a/arch/m68k/coldfire/mcf5445x-pci.c
120 +++ b/arch/m68k/coldfire/mcf5445x-pci.c
124 #include <linux/delay.h>
125 +#include <linux/interrupt.h>
126 #include <linux/pci.h>
128 #include <asm/mcfsim.h>
129 @@ -76,7 +77,7 @@ void mcf5445x_pci_dumpregs(void);
133 - * static void mcf5445x_conf_device(struct pci_dev *dev)
134 + * mcf5445x_conf_device(struct pci_dev *dev)
136 * Machine dependent Configure the given device.
138 @@ -84,7 +85,7 @@ void mcf5445x_pci_dumpregs(void);
140 * dev - the pci device.
144 mcf5445x_conf_device(struct pci_dev *dev)
146 set_fpga(FPGA_PCI_IRQ_ENABLE, 0x0f);
147 --- a/arch/m68k/coldfire/pci.c
148 +++ b/arch/m68k/coldfire/pci.c
149 @@ -56,7 +56,7 @@ struct pci_ops pci_root_ops = {
151 * Initialize the pcibios based on cmd line params.
155 pcibios_setup(char *str)
157 if (!strcmp(str, "debug")) {
158 @@ -124,7 +124,7 @@ pcibios_map_irq(struct pci_dev *dev, u8
160 * Update a PCI interrupt.
164 pcibios_update_irq(struct pci_dev *dev, int irq)
166 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
167 @@ -171,7 +171,7 @@ pcibios_enable_device(struct pci_dev *de
169 * pcibios_fixup_bus(struct pci_bus *bus)
173 pcibios_fixup_bus(struct pci_bus *bus)
175 struct pci_dev *dev = bus->self;
176 --- a/arch/m68k/kernel/Makefile
177 +++ b/arch/m68k/kernel/Makefile
179 ifndef CONFIG_COLDFIRE
180 extra-y := head.o vmlinux.lds
181 obj-y := entry.o signal.o traps.o ints.o
182 + obj-$(CONFIG_PCI) += bios32.o
183 else # CONFIG_COLDFIRE
184 extra-y := ../coldfire/head.o vmlinux.lds
186 @@ -19,7 +20,6 @@ obj-y += process.o ptrace.o module.o \
188 devres-y = ../../../kernel/irq/devres.o
190 -obj-$(CONFIG_PCI) += bios32.o
191 obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo
193 EXTRA_AFLAGS := -traditional
194 --- a/drivers/macintosh/Kconfig
195 +++ b/drivers/macintosh/Kconfig
196 @@ -118,7 +118,6 @@ config PMAC_SMU
199 tristate "APM emulation"
200 - select APM_EMULATION
201 depends on ADB_PMU && PM && PPC32
204 --- a/drivers/pci/Makefile
205 +++ b/drivers/pci/Makefile
206 @@ -39,6 +39,7 @@ obj-$(CONFIG_PPC) += setup-bus.o
207 obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o
208 obj-$(CONFIG_X86_VISWS) += setup-irq.o
209 obj-$(CONFIG_MN10300) += setup-bus.o
210 +obj-$(CONFIG_M54455) += setup-bus.o setup-irq.o
213 # ACPI Related PCI FW Functions
214 --- a/include/asm-m68k/io.h
215 +++ b/include/asm-m68k/io.h
216 @@ -306,7 +306,18 @@ static inline void isa_delay(void)
217 #define outw(val,port) out_le16((port),(val))
218 #define inl(port) in_le32(port)
219 #define outl(val,port) out_le32((port),(val))
221 +#define insb(port, buf, nr) \
222 + raw_insb((u8 *)(port), (u8 *)(buf), (nr))
223 +#define outsb(port, buf, nr) \
224 + raw_outsb((u8 *)(port), (u8 *)(buf), (nr))
225 +#define insw(port, buf, nr) \
226 + raw_insw_swapw((u16 *)(port), (u16 *)(buf), (nr))
227 +#define outsw(port, buf, nr) \
228 + raw_outsw_swapw((u16 *)(port), (u16 *)(buf), (nr))
229 +#define insl(port, buf, nr) \
230 + raw_insw_swapw((u16 *)(port), (u16 *)(buf), (nr)<<1)
231 +#define outsl(port, buf, nr) \
232 + raw_outsw_swapw((u16 *)(port), (u16 *)(buf), (nr)<<1)
235 * kernel with both ISA and PCI compiled in, those have
236 --- a/include/asm-m68k/pci.h
237 +++ b/include/asm-m68k/pci.h
238 @@ -42,11 +42,13 @@ pcibios_penalize_isa_irq(int irq, int ac
239 /* no dynamic PCI IRQ allocation */
244 pcibios_add_platform_entries(struct pci_dev *dev)
246 /* no special handling */
251 pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,