From 8cdf92a98fa0f91068615443f2a8597b7f2c34ca Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 1 Jan 2007 19:31:15 +0000 Subject: Fix Maple PATA IRQ assignment. On the Maple board, the AMD8111 IDE is in legacy mode... except that it appears on IRQ 20 instead of IRQ 15. For drivers/ide this was handled by the architecture's "pci_get_legacy_ide_irq()" function, but in libata we just hard-code the numbers 14 and 15. This patch provides asm-powerpc/libata-portmap.h which maps the IRQ as appropriate, having added a pci_dev argument to the ATA_{PRIM,SECOND}ARY_IRQ macros. There's probably a better way to do this -- especially if we observe that the _only_ case in which this seemingly-generic "pci_get_legacy_ide_irq()" function returns anything other than 14 and 15 for primary and secondary respectively is the case of the AMD8111 on the Maple board -- couldn't we handle that with a special case in the pata_amd driver, or perhaps with a PCI quirk for Maple to switch it into native mode during early boot and assign resources properly? Signed-off-by: David Woodhouse Signed-off-by: Jeff Garzik --- include/asm-powerpc/libata-portmap.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 include/asm-powerpc/libata-portmap.h (limited to 'include/asm-powerpc') diff --git a/include/asm-powerpc/libata-portmap.h b/include/asm-powerpc/libata-portmap.h new file mode 100644 index 000000000000..4d8518049f4d --- /dev/null +++ b/include/asm-powerpc/libata-portmap.h @@ -0,0 +1,12 @@ +#ifndef __ASM_POWERPC_LIBATA_PORTMAP_H +#define __ASM_POWERPC_LIBATA_PORTMAP_H + +#define ATA_PRIMARY_CMD 0x1F0 +#define ATA_PRIMARY_CTL 0x3F6 +#define ATA_PRIMARY_IRQ(dev) pci_get_legacy_ide_irq(dev, 0) + +#define ATA_SECONDARY_CMD 0x170 +#define ATA_SECONDARY_CTL 0x376 +#define ATA_SECONDARY_IRQ(dev) pci_get_legacy_ide_irq(dev, 1) + +#endif -- cgit v1.2.2 From 6a13f66043cd755fc7e19f8e0fbb5bfcdf470e74 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 30 Jan 2007 13:24:00 +0000 Subject: [PATCH] dma-mapping.h stubs fix do { } while(0) is not a good imitation of function returning void; use ((void)0) instead. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/asm-powerpc/dma-mapping.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/asm-powerpc') diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h index 7c7de87bd8ae..a19a6f1a1cf1 100644 --- a/include/asm-powerpc/dma-mapping.h +++ b/include/asm-powerpc/dma-mapping.h @@ -37,9 +37,9 @@ extern void __dma_sync_page(struct page *page, unsigned long offset, */ #define __dma_alloc_coherent(gfp, size, handle) NULL -#define __dma_free_coherent(size, addr) do { } while (0) -#define __dma_sync(addr, size, rw) do { } while (0) -#define __dma_sync_page(pg, off, sz, rw) do { } while (0) +#define __dma_free_coherent(size, addr) ((void)0) +#define __dma_sync(addr, size, rw) ((void)0) +#define __dma_sync_page(pg, off, sz, rw) ((void)0) #endif /* ! CONFIG_NOT_COHERENT_CACHE */ @@ -251,7 +251,7 @@ dma_map_single(struct device *dev, void *ptr, size_t size, } /* We do nothing. */ -#define dma_unmap_single(dev, addr, size, dir) do { } while (0) +#define dma_unmap_single(dev, addr, size, dir) ((void)0) static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, @@ -266,7 +266,7 @@ dma_map_page(struct device *dev, struct page *page, } /* We do nothing. */ -#define dma_unmap_page(dev, handle, size, dir) do { } while (0) +#define dma_unmap_page(dev, handle, size, dir) ((void)0) static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, @@ -286,7 +286,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, } /* We don't do anything here. */ -#define dma_unmap_sg(dev, sg, nents, dir) do { } while (0) +#define dma_unmap_sg(dev, sg, nents, dir) ((void)0) #endif /* CONFIG_PPC64 */ -- cgit v1.2.2 From 8209003547c4b1006943eac8dc6c1fb6493cafda Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 6 Feb 2007 22:55:19 -0600 Subject: [POWERPC] Added kprobes support to ppc32 Added kprobes to ppc32 platforms that have use single_step_exception. This excludes 4xx and anything Book-E since their debug mechanisms for single stepping are completely different. Signed-off-by: Kumar Gala --- include/asm-powerpc/kprobes.h | 7 ++++++- include/asm-powerpc/sstep.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'include/asm-powerpc') diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index 2dafa376a63f..3a5dd492588f 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h @@ -44,6 +44,7 @@ typedef unsigned int kprobe_opcode_t; #define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) #define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) +#ifdef CONFIG_PPC64 /* * 64bit powerpc uses function descriptors. * Handle cases where: @@ -67,9 +68,13 @@ typedef unsigned int kprobe_opcode_t; } #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) - #define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ IS_TWI(instr) || IS_TDI(instr)) +#else +/* Use stock kprobe_lookup_name since ppc32 doesn't use function descriptors */ +#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)(pentry) +#define is_trap(instr) (IS_TW(instr) || IS_TWI(instr)) +#endif #define ARCH_SUPPORTS_KRETPROBES #define ARCH_INACTIVE_KPROBE_COUNT 1 diff --git a/include/asm-powerpc/sstep.h b/include/asm-powerpc/sstep.h index 630a9889c07c..f593b0f9b627 100644 --- a/include/asm-powerpc/sstep.h +++ b/include/asm-powerpc/sstep.h @@ -21,6 +21,7 @@ struct pt_regs; */ #define IS_MTMSRD(instr) (((instr) & 0xfc0007be) == 0x7c000124) #define IS_RFID(instr) (((instr) & 0xfc0007fe) == 0x4c000024) +#define IS_RFI(instr) (((instr) & 0xfc0007fe) == 0x4c000064) /* Emulate instructions that cause a transfer of control. */ extern int emulate_step(struct pt_regs *regs, unsigned int instr); -- cgit v1.2.2