From 85aa0efb678ecaaba8dc5f05ffded06b71902f91 Mon Sep 17 00:00:00 2001 From: Boris Itkis Date: Tue, 14 May 2002 02:07:39 +0100 Subject: [ARM PATCH] 1146/1: Fix complilation bug in 2.5.10-rmk1 for jffs This is patch 1004/1 done how you wanted it. Files affected: include/asm-arm/unistd.h --- include/asm-arm/unistd.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index efb95cb9fdf1..0079e480e0d3 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h @@ -13,6 +13,8 @@ #ifndef __ASM_ARM_UNISTD_H #define __ASM_ARM_UNISTD_H +#include + #define __NR_SYSCALL_BASE 0x900000 /* -- cgit v1.2.3 From 47a00fe0fe75745ea966787c6752639808367a23 Mon Sep 17 00:00:00 2001 From: Christopher Hoover Date: Tue, 14 May 2002 02:26:52 +0100 Subject: [ARM PATCH] 1137/1: additional defines for SA-1111 OHCI Christopher Hoover mailto:ch@murgatroid.com mailto:ch@hpl.hp.com --- include/asm-arm/hardware/sa1111.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/asm-arm/hardware/sa1111.h b/include/asm-arm/hardware/sa1111.h index bc0933178340..60bcc0869ab8 100644 --- a/include/asm-arm/hardware/sa1111.h +++ b/include/asm-arm/hardware/sa1111.h @@ -198,6 +198,12 @@ #define USB_RESET_PWRSENSELOW (1 << 6) #define USB_RESET_PWRCTRLLOW (1 << 7) +#define USB_STATUS_IRQHCIRMTWKUP (1 << 7) +#define USB_STATUS_IRQHCIBUFFACC (1 << 8) +#define USB_STATUS_NIRQHCIM (1 << 9) +#define USB_STATUS_NHCIMFCLR (1 << 10) +#define USB_STATUS_USBPWRSENSE (1 << 11) + /* * Serial Audio Controller * -- cgit v1.2.3 From f46c7a6f07bc0ff9ff50bc176b92c1d34a9cfb30 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 14 May 2002 12:42:26 +0100 Subject: [ARM] 2.5.15 PCI cleanups/fixups 2.5.15 removes the pcibios_init() call from the generic PCI layer to the architecture layers. This allows us to clean up the ARM PCI layer by moving the machine specific PCI initialisation from arch/arm/kernel/bios32.c to the machine specific files. We also fix a bug in the resource flags in the iop310 initialisation. --- arch/arm/kernel/bios32.c | 67 +------------------------- arch/arm/mach-footbridge/cats-pci.c | 12 ++++- arch/arm/mach-footbridge/dc21285.c | 82 +++++++++++++++++++------------- arch/arm/mach-footbridge/ebsa285-pci.c | 12 ++++- arch/arm/mach-footbridge/netwinder-pci.c | 12 ++++- arch/arm/mach-footbridge/personal-pci.c | 12 ++++- arch/arm/mach-ftvpci/pci.c | 11 ++++- arch/arm/mach-integrator/pci.c | 12 ++++- arch/arm/mach-iop310/iop310-pci.c | 4 ++ arch/arm/mach-iop310/iq80310-pci.c | 12 ++++- arch/arm/mach-shark/pci.c | 12 ++++- include/asm-arm/mach/pci.h | 25 ++++------ 12 files changed, 148 insertions(+), 125 deletions(-) (limited to 'include') diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index bddbcef51c1b..201f14368eb2 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -545,73 +545,8 @@ static void __init pcibios_init_hw(struct hw_pci *hw) } } -extern struct hw_pci ebsa285_pci; -extern struct hw_pci cats_pci; -extern struct hw_pci netwinder_pci; -extern struct hw_pci personal_server_pci; -extern struct hw_pci ftv_pci; -extern struct hw_pci shark_pci; -extern struct hw_pci integrator_pci; -extern struct hw_pci iq80310_pci; - -void __init pcibios_init(void) +void __init pci_common_init(struct hw_pci *hw) { - struct hw_pci *hw = NULL; - - do { -#ifdef CONFIG_ARCH_EBSA285 - if (machine_is_ebsa285()) { - hw = &ebsa285_pci; - break; - } -#endif -#ifdef CONFIG_ARCH_SHARK - if (machine_is_shark()) { - hw = &shark_pci; - break; - } -#endif -#ifdef CONFIG_ARCH_CATS - if (machine_is_cats()) { - hw = &cats_pci; - break; - } -#endif -#ifdef CONFIG_ARCH_NETWINDER - if (machine_is_netwinder()) { - hw = &netwinder_pci; - break; - } -#endif -#ifdef CONFIG_ARCH_PERSONAL_SERVER - if (machine_is_personal_server()) { - hw = &personal_server_pci; - break; - } -#endif -#ifdef CONFIG_ARCH_FTVPCI - if (machine_is_ftvpci()) { - hw = &ftv_pci; - break; - } -#endif -#ifdef CONFIG_ARCH_INTEGRATOR - if (machine_is_integrator()) { - hw = &integrator_pci; - break; - } -#endif -#ifdef CONFIG_ARCH_IQ80310 - if (machine_is_iq80310()) { - hw = &iq80310_pci; - break; - } -#endif - } while (0); - - if (hw == NULL) - return; - if (hw->preinit) hw->preinit(); pcibios_init_hw(hw); diff --git a/arch/arm/mach-footbridge/cats-pci.c b/arch/arm/mach-footbridge/cats-pci.c index 0e09d315016a..386d400f5c1f 100644 --- a/arch/arm/mach-footbridge/cats-pci.c +++ b/arch/arm/mach-footbridge/cats-pci.c @@ -11,6 +11,7 @@ #include #include +#include /* cats host-specific stuff */ static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 }; @@ -34,7 +35,7 @@ static int __init cats_map_irq(struct pci_dev *dev, u8 slot, u8 pin) * why not the standard PCI swizzle? does this prevent 4-port tulip * cards being used (ie, pci-pci bridge based cards)? */ -struct hw_pci cats_pci __initdata = { +static struct hw_pci cats_pci __initdata = { swizzle: NULL, map_irq: cats_map_irq, nr_controllers: 1, @@ -43,3 +44,12 @@ struct hw_pci cats_pci __initdata = { preinit: dc21285_preinit, postinit: dc21285_postinit, }; + +static int cats_pci_init(void) +{ + if (machine_is_cats()) + pci_common_init(&cats_pci); + return 0; +} + +subsys_initcall(cats_pci_init); diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index 3d08c2e7fee8..8cfa3a437a4b 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c @@ -1,7 +1,8 @@ /* * linux/arch/arm/kernel/dec21285.c: PCI functions for DC21285 * - * Copyright (C) 1998-2000 Russell King, Phil Blundell + * Copyright (C) 1998-2001 Russell King + * Copyright (C) 1998-2000 Phil Blundell * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -261,31 +262,45 @@ static void dc21285_parity_irq(int irq, void *dev_id, struct pt_regs *regs) add_timer(timer); } -void __init dc21285_setup_resources(struct resource **resource) +int __init dc21285_setup(int nr, struct pci_sys_data *sys) { - struct resource *busmem, *busmempf; + struct resource *res; - busmem = kmalloc(sizeof(*busmem), GFP_KERNEL); - busmempf = kmalloc(sizeof(*busmempf), GFP_KERNEL); - memset(busmem, 0, sizeof(*busmem)); - memset(busmempf, 0, sizeof(*busmempf)); + if (nr || !footbridge_cfn_mode()) + return 0; - busmem->flags = IORESOURCE_MEM; - busmem->name = "Footbridge non-prefetch"; - busmempf->flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; - busmempf->name = "Footbridge prefetch"; + res = kmalloc(sizeof(struct resource) * 2, GFP_KERNEL); + if (!res) { + printk("out of memory for root bus resources"); + return 0; + } + + memset(res, 0, sizeof(struct resource) * 2); - allocate_resource(&iomem_resource, busmempf, 0x20000000, - 0x80000000, 0xffffffff, 0x20000000, NULL, NULL); - allocate_resource(&iomem_resource, busmem, 0x40000000, + res[0].flags = IORESOURCE_MEM; + res[0].name = "Footbridge non-prefetch"; + res[1].flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; + res[1].name = "Footbridge prefetch"; + + allocate_resource(&iomem_resource, &res[1], 0x20000000, + 0xa0000000, 0xffffffff, 0x20000000, NULL, NULL); + allocate_resource(&iomem_resource, &res[0], 0x40000000, 0x80000000, 0xffffffff, 0x40000000, NULL, NULL); - resource[0] = &ioport_resource; - resource[1] = busmem; - resource[2] = busmempf; + sys->resource[0] = &ioport_resource; + sys->resource[1] = &res[0]; + sys->resource[2] = &res[1]; + sys->mem_offset = DC21285_PCI_MEM; + + return 1; +} + +struct pci_bus * __init dc21285_scan_bus(int nr, struct pci_sys_data *sys) +{ + return pci_scan_bus(0, &dc21285_ops, sys); } -void __init dc21285_init(void *sysdata) +void __init dc21285_preinit(void) { unsigned int mem_size, mem_mask; int cfn_mode; @@ -313,17 +328,13 @@ void __init dc21285_init(void *sysdata) "central function" : "addin"); if (cfn_mode) { - static struct resource csrmem, csrio; + static struct resource csrio; csrio.flags = IORESOURCE_IO; csrio.name = "Footbridge"; - csrmem.flags = IORESOURCE_MEM; - csrmem.name = "Footbridge"; allocate_resource(&ioport_resource, &csrio, 128, 0xff00, 0xffff, 128, NULL, NULL); - allocate_resource(&iomem_resource, &csrmem, 128, - 0xf4000000, 0xf8000000, 128, NULL, NULL); /* * Map our SDRAM at a known address in PCI space, just in case @@ -331,22 +342,12 @@ void __init dc21285_init(void *sysdata) * necessary, since some VGA cards forcefully use PCI addresses * in the range 0x000a0000 to 0x000c0000. (eg, S3 cards). */ - *CSR_PCICSRBASE = csrmem.start; + *CSR_PCICSRBASE = 0xf4000000; *CSR_PCICSRIOBASE = csrio.start; *CSR_PCISDRAMBASE = __virt_to_bus(PAGE_OFFSET); *CSR_PCIROMBASE = 0; *CSR_PCICMD = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE | PCICMD_ERROR_BITS; - - pci_scan_bus(0, &dc21285_ops, sysdata); - - /* - * Clear any existing errors - we aren't - * interested in historical data... - */ - *CSR_SA110_CNTL = (*CSR_SA110_CNTL & 0xffffde07) | - SA110_CNTL_RXSERR; - *CSR_PCICMD = (*CSR_PCICMD & 0xffff) | PCICMD_ERROR_BITS; } else if (footbridge_cfn_mode() != 0) { /* * If we are not compiled to accept "add-in" mode, then @@ -357,6 +358,19 @@ void __init dc21285_init(void *sysdata) panic("PCI: this kernel is compiled for central " "function mode only"); } +} + +void __init dc21285_postinit(void) +{ + if (footbridge_cfn_mode()) { + /* + * Clear any existing errors - we aren't + * interested in historical data... + */ + *CSR_SA110_CNTL = (*CSR_SA110_CNTL & 0xffffde07) | + SA110_CNTL_RXSERR; + *CSR_PCICMD = (*CSR_PCICMD & 0xffff) | PCICMD_ERROR_BITS; + } /* * Initialise PCI error IRQ after we've finished probing diff --git a/arch/arm/mach-footbridge/ebsa285-pci.c b/arch/arm/mach-footbridge/ebsa285-pci.c index 8f1603d787fb..f8f956905264 100644 --- a/arch/arm/mach-footbridge/ebsa285-pci.c +++ b/arch/arm/mach-footbridge/ebsa285-pci.c @@ -11,6 +11,7 @@ #include #include +#include static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI }; @@ -27,7 +28,7 @@ static int __init ebsa285_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irqmap_ebsa285[(slot + pin) & 3]; } -struct hw_pci ebsa285_pci __initdata = { +static struct hw_pci ebsa285_pci __initdata = { swizzle: pci_std_swizzle, map_irq: ebsa285_map_irq, nr_controllers: 1, @@ -36,3 +37,12 @@ struct hw_pci ebsa285_pci __initdata = { preinit: dc21285_preinit, postinit: dc21285_postinit, }; + +static int __init ebsa285_init_pci(void) +{ + if (machine_is_ebsa285()) + pci_common_init(&ebsa285_pci); + return 0; +} + +subsys_initcall(ebsa285_init_pci); diff --git a/arch/arm/mach-footbridge/netwinder-pci.c b/arch/arm/mach-footbridge/netwinder-pci.c index d8bae268d70c..8c426a802ab9 100644 --- a/arch/arm/mach-footbridge/netwinder-pci.c +++ b/arch/arm/mach-footbridge/netwinder-pci.c @@ -11,6 +11,7 @@ #include #include +#include /* * We now use the slot ID instead of the device identifiers to select @@ -41,7 +42,7 @@ static int __init netwinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin) } } -struct hw_pci netwinder_pci __initdata = { +static struct hw_pci netwinder_pci __initdata = { swizzle: pci_std_swizzle, map_irq: netwinder_map_irq, nr_controllers: 1, @@ -50,3 +51,12 @@ struct hw_pci netwinder_pci __initdata = { preinit: dc21285_preinit, postinit: dc21285_postinit, }; + +static int __init netwinder_pci_init(void) +{ + if (machine_is_netwinder()) + pci_common_init(&netwinder_pci); + return 0; +} + +subsys_initcall(netwinder_pci_init); diff --git a/arch/arm/mach-footbridge/personal-pci.c b/arch/arm/mach-footbridge/personal-pci.c index 9df2853b313e..148a0fa55d27 100644 --- a/arch/arm/mach-footbridge/personal-pci.c +++ b/arch/arm/mach-footbridge/personal-pci.c @@ -11,6 +11,7 @@ #include #include +#include static int irqmap_personal_server[] __initdata = { IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0, @@ -36,7 +37,7 @@ static int __init personal_server_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irqmap_personal_server[(line - 1) & 3]; } -struct hw_pci personal_server_pci __initdata = { +static struct hw_pci personal_server_pci __initdata = { map_irq: personal_server_map_irq, nr_controllers: 1, setup: dc21285_setup, @@ -44,3 +45,12 @@ struct hw_pci personal_server_pci __initdata = { preinit: dc21285_preinit, postinit: dc21285_postinit, }; + +static int __init personal_pci_init(void) +{ + if (machine_is_personal_server()) + pci_common_init(&personal_server_pci); + return 0; +} + +subsys_initcall(&personal_pci_init); diff --git a/arch/arm/mach-ftvpci/pci.c b/arch/arm/mach-ftvpci/pci.c index 11369bc58c0f..43bedeb5c90f 100644 --- a/arch/arm/mach-ftvpci/pci.c +++ b/arch/arm/mach-ftvpci/pci.c @@ -11,6 +11,7 @@ #include #include +#include /* * Owing to a PCB cockup, issue A backplanes are wired thus: @@ -43,9 +44,17 @@ static u8 __init ftv_swizzle(struct pci_dev *dev, u8 *pin) } /* ftv host-specific stuff */ -struct hw_pci ftv_pci __initdata = { +static struct hw_pci ftv_pci __initdata = { init: plx90x0_init, swizzle: ftv_swizzle, map_irq: ftv_map_irq, }; +static int __init ftv_pci_init(void) +{ + if (machine_is_ftvpci()) + pci_common_init(&ftv_pci); + return 0; +} + +subsys_initcall(ftv_pci_init); diff --git a/arch/arm/mach-integrator/pci.c b/arch/arm/mach-integrator/pci.c index 62d961835311..5489e8437bb2 100644 --- a/arch/arm/mach-integrator/pci.c +++ b/arch/arm/mach-integrator/pci.c @@ -31,6 +31,7 @@ #include #include #include +#include /* * A small note about bridges and interrupts. The DECchip 21050 (and @@ -112,7 +113,7 @@ static int __init integrator_map_irq(struct pci_dev *dev, u8 slot, u8 pin) extern void pci_v3_init(void *); -struct hw_pci integrator_pci __initdata = { +static struct hw_pci integrator_pci __initdata = { swizzle: integrator_swizzle, map_irq: integrator_map_irq, setup: pci_v3_setup, @@ -121,3 +122,12 @@ struct hw_pci integrator_pci __initdata = { preinit: pci_v3_preinit, postinit: pci_v3_postinit, }; + +static int __init integrator_pci_init(void) +{ + if (machine_is_integrator()) + pci_common_init(&integrator_pci); + return 0; +} + +subsys_initcall(integrator_pci_init); diff --git a/arch/arm/mach-iop310/iop310-pci.c b/arch/arm/mach-iop310/iop310-pci.c index 1dca952f109b..3e1a5f6b4480 100644 --- a/arch/arm/mach-iop310/iop310-pci.c +++ b/arch/arm/mach-iop310/iop310-pci.c @@ -452,20 +452,24 @@ int iop310_setup(int nr, struct pci_sys_data *sys) res[0].start = IOP310_PCIPRI_LOWER_IO + 0x6e000000; res[0].end = IOP310_PCIPRI_LOWER_IO + 0x6e00ffff; res[0].name = "PCI IO Primary"; + res[0].flags = IORESOURCE_IO; res[1].start = IOP310_PCIPRI_LOWER_MEM; res[1].end = IOP310_PCIPRI_LOWER_MEM + IOP310_PCI_WINDOW_SIZE; res[1].name = "PCI Memory Primary"; + res[1].flags = IORESOURCE_MEM; break; case 1: res[0].start = IOP310_PCISEC_LOWER_IO + 0x6e000000; res[0].end = IOP310_PCISEC_LOWER_IO + 0x6e00ffff; res[0].name = "PCI IO Secondary"; + res[0].flags = IORESOURCE_IO; res[1].start = IOP310_PCISEC_LOWER_MEM; res[1].end = IOP310_PCISEC_LOWER_MEM + IOP310_PCI_WINDOW_SIZE; res[1].name = "PCI Memory Secondary"; + res[1].flags = IORESOURCE_MEM; break; } diff --git a/arch/arm/mach-iop310/iq80310-pci.c b/arch/arm/mach-iop310/iq80310-pci.c index a26a8e1e5e2e..b6f6b2308a69 100644 --- a/arch/arm/mach-iop310/iq80310-pci.c +++ b/arch/arm/mach-iop310/iq80310-pci.c @@ -18,6 +18,7 @@ #include #include #include +#include /* * The following macro is used to lookup irqs in a standard table @@ -140,10 +141,19 @@ static void iq80310_preinit(void) iop310_init(); } -struct hw_pci iq80310_pci __initdata = { +static struct hw_pci iq80310_pci __initdata = { swizzle: pci_std_swizzle, nr_controllers: 2, setup: iq80310_setup, scan: iop310_scan_bus, preinit: iq80310_preinit, }; + +static int __init iq80310_pci_init(void) +{ + if (machine_is_iq80310()) + pci_common_init(&iq80310_pci); + return 0; +} + +subsys_initcall(iq80310_pci_init); diff --git a/arch/arm/mach-shark/pci.c b/arch/arm/mach-shark/pci.c index 46c083f3a502..809dfc1643e6 100644 --- a/arch/arm/mach-shark/pci.c +++ b/arch/arm/mach-shark/pci.c @@ -11,6 +11,7 @@ #include #include +#include static int __init shark_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { @@ -22,7 +23,7 @@ static int __init shark_map_irq(struct pci_dev *dev, u8 slot, u8 pin) extern void __init via82c505_preinit(void *sysdata); -struct hw_pci shark_pci __initdata = { +static struct hw_pci shark_pci __initdata = { setup: via82c505_setup, swizzle: pci_std_swizzle, map_irq: shark_map_irq, @@ -30,3 +31,12 @@ struct hw_pci shark_pci __initdata = { scan: via82c505_scan_bus, preinit: via82c505_preinit }; + +static int __init shark_pci_init(void) +{ + if (machine_is_shark()) + pci_common_init(&shark_pci); + return 0; +} + +subsys_initcall(shark_pci_init); diff --git a/include/asm-arm/mach/pci.h b/include/asm-arm/mach/pci.h index 08c459b25aa5..10f0158e6372 100644 --- a/include/asm-arm/mach/pci.h +++ b/include/asm-arm/mach/pci.h @@ -12,27 +12,13 @@ struct pci_sys_data; struct pci_bus; struct hw_pci { - /* START OF OLD STUFF */ - /* Initialise the hardware */ - void (*init)(void *); - - /* Setup bus resources */ - void (*setup_resources)(struct resource **); - - /* IRQ swizzle */ - u8 (*swizzle)(struct pci_dev *dev, u8 *pin); - - /* IRQ mapping */ - int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin); - - /* END OF OLD STUFF */ - - /* NEW STUFF */ int nr_controllers; int (*setup)(int nr, struct pci_sys_data *); struct pci_bus *(*scan)(int nr, struct pci_sys_data *); void (*preinit)(void); void (*postinit)(void); + u8 (*swizzle)(struct pci_dev *dev, u8 *pin); + int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin); }; /* @@ -56,6 +42,11 @@ struct pci_sys_data { */ u8 pci_std_swizzle(struct pci_dev *dev, u8 *pinp); +/* + * Call this with your hw_pci struct to initialise the PCI system. + */ +void pci_common_init(struct hw_pci *); + /* * PCI controllers */ @@ -70,7 +61,7 @@ extern void dc21285_postinit(void); extern int via82c505_setup(int nr, struct pci_sys_data *); extern struct pci_bus *via82c505_scan_bus(int nr, struct pci_sys_data *); -extern void __init via82c505_init(void *sysdata); +extern void via82c505_init(void *sysdata); extern int pci_v3_setup(int nr, struct pci_sys_data *); extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *); -- cgit v1.2.3 From 38fd5d4d59fdc62fedfb26dc98530d47bc04182c Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 14 May 2002 13:04:56 +0100 Subject: [ARM] 2.5.15 random fixups: - Add SIGURG to ignored signal list. - Ensure PFN_TO_NID is always defined on clps711x. - Machine specific fixups take struct tag not param_struct. - Fix pfn_valid() for non-discontigmem case. - Make PTRACE_* available to all. - Add PTRACE_SETOPTIONS. --- arch/arm/kernel/signal.c | 2 +- include/asm-arm/arch-clps711x/memory.h | 8 ++++---- include/asm-arm/mach/arch.h | 4 +++- include/asm-arm/memory.h | 2 +- include/asm-arm/ptrace.h | 15 ++++++++++----- 5 files changed, 19 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index b90df71485d0..fa5df23bf4c0 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c @@ -618,7 +618,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall) continue; switch (signr) { - case SIGCONT: case SIGCHLD: case SIGWINCH: + case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG: continue; case SIGTSTP: case SIGTTIN: case SIGTTOU: diff --git a/include/asm-arm/arch-clps711x/memory.h b/include/asm-arm/arch-clps711x/memory.h index dd1ae0acb55e..e40d08e180f6 100644 --- a/include/asm-arm/arch-clps711x/memory.h +++ b/include/asm-arm/arch-clps711x/memory.h @@ -153,13 +153,13 @@ #define NODE_MAX_MEM_SHIFT 24 #define NODE_MAX_MEM_SIZE (1<= PHYS_PFN_OFFSET && (pfn) < max_mapnr) +#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr)) #define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)) #define virt_addr_valid(kaddr) ((kaddr) >= PAGE_OFFSET && (kaddr) < (unsigned long)high_memory) diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h index ae4927937309..0e4482b8c7ab 100644 --- a/include/asm-arm/ptrace.h +++ b/include/asm-arm/ptrace.h @@ -1,6 +1,16 @@ #ifndef __ASM_ARM_PTRACE_H #define __ASM_ARM_PTRACE_H +#define PTRACE_GETREGS 12 +#define PTRACE_SETREGS 13 +#define PTRACE_GETFPREGS 14 +#define PTRACE_SETFPREGS 15 + +#define PTRACE_SETOPTIONS 21 + +/* options set using PTRACE_SETOPTIONS */ +#define PTRACE_O_TRACESYSGOOD 0x00000001 + #include #ifndef __ASSEMBLY__ @@ -11,11 +21,6 @@ (pc_pointer((regs)->ARM_pc)) #ifdef __KERNEL__ -#define PTRACE_GETREGS 12 -#define PTRACE_SETREGS 13 -#define PTRACE_GETFPREGS 14 -#define PTRACE_SETFPREGS 15 - extern void show_regs(struct pt_regs *); #define predicate(x) (x & 0xf0000000) -- cgit v1.2.3 From 8e206637c86fec3e38480aa5bad4e8c8295365ca Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 23 May 2002 02:30:39 +0100 Subject: [ARM] Fixups for GCC 3.x: - Provide an ARM architecture major version number so we can use the preprocessor more effectively to select features that ARMv4 and above contain. - Fix GCC 3.1 multi-line __asm__ build warnings --- arch/arm/Makefile | 11 ++-- arch/arm/kernel/process.c | 20 +++--- arch/arm/kernel/semaphore.c | 132 ++++++++++++++++++------------------- arch/arm/lib/csumpartial.S | 4 +- arch/arm/lib/longlong.h | 28 ++++---- arch/arm/lib/muldi3.c | 24 +++---- arch/arm/nwfpe/softfloat.c | 6 +- include/asm-arm/proc-armv/system.h | 4 +- 8 files changed, 116 insertions(+), 113 deletions(-) (limited to 'include') diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 218deb1cdd16..5490f0f6403a 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -26,11 +26,14 @@ apcs-$(CONFIG_CPU_32) :=-mapcs-32 apcs-$(CONFIG_CPU_26) :=-mapcs-26 -mcpu=arm3 -Os # This selects which instruction set is used. +# Note that GCC is lame - it doesn't numerically define an +# architecture version macro, but instead defines a whole +# series of macros. arch-y := -arch-$(CONFIG_CPU_32v3) :=-march=armv3 -arch-$(CONFIG_CPU_32v4) :=-march=armv4 -arch-$(CONFIG_CPU_32v5) :=-march=armv5 -arch-$(CONFIG_CPU_XSCALE) :=-march=armv4 -Wa,-mxscale #-march=armv5te +arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3 +arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4 +arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 -march=armv5 +arch-$(CONFIG_CPU_XSCALE) :=-D__LINUX_ARM_ARCH__=5 -march=armv4 -Wa,-mxscale #-march=armv5te # This selects how we optimise for the processor. tune-y := diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index d073d21127fc..9d192b98d6d6 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -386,16 +386,16 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) pid_t __ret; __asm__ __volatile__( - "orr r0, %1, %2 @ kernel_thread sys_clone - mov r1, #0 - "__syscall(clone)" - movs %0, r0 @ if we are the child - bne 1f - mov fp, #0 @ ensure that fp is zero - mov r0, %4 - mov lr, pc - mov pc, %3 - b sys_exit + "orr r0, %1, %2 @ kernel_thread sys_clone \n\ + mov r1, #0 \n\ + "__syscall(clone)" \n\ + movs %0, r0 @ if we are the child \n\ + bne 1f \n\ + mov fp, #0 @ ensure that fp is zero \n\ + mov r0, %4 \n\ + mov lr, pc \n\ + mov pc, %3 \n\ + b sys_exit \n\ 1: " : "=r" (__ret) : "Ir" (flags), "I" (CLONE_VM), "r" (fn), "r" (arg) diff --git a/arch/arm/kernel/semaphore.c b/arch/arm/kernel/semaphore.c index 2ac3faa7b364..31efb0d53c64 100644 --- a/arch/arm/kernel/semaphore.c +++ b/arch/arm/kernel/semaphore.c @@ -178,76 +178,76 @@ int __down_trylock(struct semaphore * sem) * value in some cases.. */ #ifdef CONFIG_CPU_26 -asm(" .align 5 - .globl __down_failed -__down_failed: - stmfd sp!, {r0 - r3, lr} - mov r0, ip - bl __down - ldmfd sp!, {r0 - r3, pc}^ - - .align 5 - .globl __down_interruptible_failed -__down_interruptible_failed: - stmfd sp!, {r0 - r3, lr} - mov r0, ip - bl __down_interruptible - mov ip, r0 - ldmfd sp!, {r0 - r3, pc}^ - - .align 5 - .globl __down_trylock_failed -__down_trylock_failed: - stmfd sp!, {r0 - r3, lr} - mov r0, ip - bl __down_trylock - mov ip, r0 - ldmfd sp!, {r0 - r3, pc}^ - - .align 5 - .globl __up_wakeup -__up_wakeup: - stmfd sp!, {r0 - r3, lr} - mov r0, ip - bl __up - ldmfd sp!, {r0 - r3, pc}^ +asm(" .align 5 \n\ + .globl __down_failed \n\ +__down_failed: \n\ + stmfd sp!, {r0 - r3, lr} \n\ + mov r0, ip \n\ + bl __down \n\ + ldmfd sp!, {r0 - r3, pc}^ \n\ + \n\ + .align 5 \n\ + .globl __down_interruptible_failed \n\ +__down_interruptible_failed: \n\ + stmfd sp!, {r0 - r3, lr} \n\ + mov r0, ip \n\ + bl __down_interruptible \n\ + mov ip, r0 \n\ + ldmfd sp!, {r0 - r3, pc}^ \n\ + \n\ + .align 5 \n\ + .globl __down_trylock_failed \n\ +__down_trylock_failed: \n\ + stmfd sp!, {r0 - r3, lr} \n\ + mov r0, ip \n\ + bl __down_trylock \n\ + mov ip, r0 \n\ + ldmfd sp!, {r0 - r3, pc}^ \n\ + \n\ + .align 5 \n\ + .globl __up_wakeup \n\ +__up_wakeup: \n\ + stmfd sp!, {r0 - r3, lr} \n\ + mov r0, ip \n\ + bl __up \n\ + ldmfd sp!, {r0 - r3, pc}^ \n\ "); #else /* 32 bit version */ -asm(" .align 5 - .globl __down_failed -__down_failed: - stmfd sp!, {r0 - r3, lr} - mov r0, ip - bl __down - ldmfd sp!, {r0 - r3, pc} - - .align 5 - .globl __down_interruptible_failed -__down_interruptible_failed: - stmfd sp!, {r0 - r3, lr} - mov r0, ip - bl __down_interruptible - mov ip, r0 - ldmfd sp!, {r0 - r3, pc} - - .align 5 - .globl __down_trylock_failed -__down_trylock_failed: - stmfd sp!, {r0 - r3, lr} - mov r0, ip - bl __down_trylock - mov ip, r0 - ldmfd sp!, {r0 - r3, pc} - - .align 5 - .globl __up_wakeup -__up_wakeup: - stmfd sp!, {r0 - r3, lr} - mov r0, ip - bl __up - ldmfd sp!, {r0 - r3, pc} +asm(" .align 5 \n\ + .globl __down_failed \n\ +__down_failed: \n\ + stmfd sp!, {r0 - r3, lr} \n\ + mov r0, ip \n\ + bl __down \n\ + ldmfd sp!, {r0 - r3, pc} \n\ + \n\ + .align 5 \n\ + .globl __down_interruptible_failed \n\ +__down_interruptible_failed: \n\ + stmfd sp!, {r0 - r3, lr} \n\ + mov r0, ip \n\ + bl __down_interruptible \n\ + mov ip, r0 \n\ + ldmfd sp!, {r0 - r3, pc} \n\ + \n\ + .align 5 \n\ + .globl __down_trylock_failed \n\ +__down_trylock_failed: \n\ + stmfd sp!, {r0 - r3, lr} \n\ + mov r0, ip \n\ + bl __down_trylock \n\ + mov ip, r0 \n\ + ldmfd sp!, {r0 - r3, pc} \n\ + \n\ + .align 5 \n\ + .globl __up_wakeup \n\ +__up_wakeup: \n\ + stmfd sp!, {r0 - r3, lr} \n\ + mov r0, ip \n\ + bl __up \n\ + ldmfd sp!, {r0 - r3, pc} \n\ "); #endif diff --git a/arch/arm/lib/csumpartial.S b/arch/arm/lib/csumpartial.S index 1e7f4a60fedb..25c05f35fd8d 100644 --- a/arch/arm/lib/csumpartial.S +++ b/arch/arm/lib/csumpartial.S @@ -49,7 +49,7 @@ td3 .req lr /* we are now half-word aligned */ .less8_wordlp: -#ifdef __ARM_ARCH_4__ +#if __LINUX_ARM_ARCH__ >= 4 ldrh td0, [buf], #2 sub len, len, #2 #else @@ -83,7 +83,7 @@ td3 .req lr adcnes sum, sum, td0, lsl #byte(1) @ update checksum tst buf, #2 @ 32-bit aligned? -#ifdef __ARM_ARCH_4__ +#if __LINUX_ARM_ARCH__ >= 4 ldrneh td0, [buf], #2 @ make 32-bit aligned subne len, len, #2 #else diff --git a/arch/arm/lib/longlong.h b/arch/arm/lib/longlong.h index d0f9b11190e0..05ec1abd6a2c 100644 --- a/arch/arm/lib/longlong.h +++ b/arch/arm/lib/longlong.h @@ -75,7 +75,7 @@ #if defined (__arm__) #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("adds %1, %4, %5 + __asm__ ("adds %1, %4, %5 \n\ adc %0, %2, %3" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ @@ -84,7 +84,7 @@ "%r" ((USItype) (al)), \ "rI" ((USItype) (bl))) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("subs %1, %4, %5 + __asm__ ("subs %1, %4, %5 \n\ sbc %0, %2, %3" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ @@ -94,18 +94,18 @@ "rI" ((USItype) (bl))) #define umul_ppmm(xh, xl, a, b) \ {register USItype __t0, __t1, __t2; \ - __asm__ ("%@ Inlined umul_ppmm - mov %2, %5, lsr #16 - mov %0, %6, lsr #16 - bic %3, %5, %2, lsl #16 - bic %4, %6, %0, lsl #16 - mul %1, %3, %4 - mul %4, %2, %4 - mul %3, %0, %3 - mul %0, %2, %0 - adds %3, %4, %3 - addcs %0, %0, #65536 - adds %1, %1, %3, lsl #16 + __asm__ ("%@ Inlined umul_ppmm \n\ + mov %2, %5, lsr #16 \n\ + mov %0, %6, lsr #16 \n\ + bic %3, %5, %2, lsl #16 \n\ + bic %4, %6, %0, lsl #16 \n\ + mul %1, %3, %4 \n\ + mul %4, %2, %4 \n\ + mul %3, %0, %3 \n\ + mul %0, %2, %0 \n\ + adds %3, %4, %3 \n\ + addcs %0, %0, #65536 \n\ + adds %1, %1, %3, lsl #16 \n\ adc %0, %0, %3, lsr #16" \ : "=&r" ((USItype) (xh)), \ "=r" ((USItype) (xl)), \ diff --git a/arch/arm/lib/muldi3.c b/arch/arm/lib/muldi3.c index 3b5aa51790b1..44d611b1cfdb 100644 --- a/arch/arm/lib/muldi3.c +++ b/arch/arm/lib/muldi3.c @@ -33,18 +33,18 @@ Boston, MA 02111-1307, USA. */ #define umul_ppmm(xh, xl, a, b) \ {register USItype __t0, __t1, __t2; \ - __asm__ ("%@ Inlined umul_ppmm - mov %2, %5, lsr #16 - mov %0, %6, lsr #16 - bic %3, %5, %2, lsl #16 - bic %4, %6, %0, lsl #16 - mul %1, %3, %4 - mul %4, %2, %4 - mul %3, %0, %3 - mul %0, %2, %0 - adds %3, %4, %3 - addcs %0, %0, #65536 - adds %1, %1, %3, lsl #16 + __asm__ ("%@ Inlined umul_ppmm \n\ + mov %2, %5, lsr #16 \n\ + mov %0, %6, lsr #16 \n\ + bic %3, %5, %2, lsl #16 \n\ + bic %4, %6, %0, lsl #16 \n\ + mul %1, %3, %4 \n\ + mul %4, %2, %4 \n\ + mul %3, %0, %3 \n\ + mul %0, %2, %0 \n\ + adds %3, %4, %3 \n\ + addcs %0, %0, #65536 \n\ + adds %1, %1, %3, lsl #16 \n\ adc %0, %0, %3, lsr #16" \ : "=&r" ((USItype) (xh)), \ "=r" ((USItype) (xl)), \ diff --git a/arch/arm/nwfpe/softfloat.c b/arch/arm/nwfpe/softfloat.c index 86f3cf9b51e8..26c1b916e527 100644 --- a/arch/arm/nwfpe/softfloat.c +++ b/arch/arm/nwfpe/softfloat.c @@ -184,9 +184,9 @@ INLINE float32 packFloat32( flag zSign, int16 zExp, bits32 zSig ) { #if 0 float32 f; - __asm__("@ packFloat32; - mov %0, %1, asl #31; - orr %0, %2, asl #23; + __asm__("@ packFloat32; \n\ + mov %0, %1, asl #31; \n\ + orr %0, %2, asl #23; \n\ orr %0, %3" : /* no outputs */ : "g" (f), "g" (zSign), "g" (zExp), "g" (zSig) diff --git a/include/asm-arm/proc-armv/system.h b/include/asm-arm/proc-armv/system.h index bc61642284fa..64ccb9c06c6c 100644 --- a/include/asm-arm/proc-armv/system.h +++ b/include/asm-arm/proc-armv/system.h @@ -36,7 +36,7 @@ extern unsigned long cr_no_alignment; /* defined in entry-armv.S */ extern unsigned long cr_alignment; /* defined in entry-armv.S */ -#ifdef __ARM_ARCH_4__ +#if __LINUX_ARM_ARCH__ >= 4 #define vectors_base() ((cr_alignment & CR_V) ? 0xffff0000 : 0) #else #define vectors_base() (0) @@ -192,7 +192,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size : "memory"); break; #endif - default: __bad_xchg(ptr, size); + default: __bad_xchg(ptr, size), ret = 0; } return ret; -- cgit v1.2.3 From df242954643a5483019b9a4d17fc9efd4c1ec019 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 23 May 2002 02:43:51 +0100 Subject: [ARM] Miscellaneous - Use definitions where possible. - Fix various errors in comments. - Fix missing max_pfn initialisation. - Add missing device.h and errno.h include files. - Ensure thread->flags is unsigned long for bitops. --- arch/arm/boot/compressed/head-l7200.S | 3 ++- arch/arm/mm/abort-lv4t.S | 4 ++-- arch/arm/mm/fault-common.c | 11 +++++------ arch/arm/mm/init.c | 1 + arch/arm/tools/mach-types | 16 ++++++++++++++-- drivers/acorn/char/mouse_rpc.c | 1 + drivers/pcmcia/sa1100_assabet.c | 1 + drivers/pcmcia/sa1100_generic.c | 31 ++++++++++++++++--------------- drivers/pcmcia/sa1100_generic.h | 4 ++-- drivers/pcmcia/sa1100_neponset.c | 4 +++- drivers/pcmcia/sa1111_generic.c | 1 + include/asm-arm/thread_info.h | 2 +- 12 files changed, 49 insertions(+), 30 deletions(-) (limited to 'include') diff --git a/arch/arm/boot/compressed/head-l7200.S b/arch/arm/boot/compressed/head-l7200.S index 1eb2246c3077..b08bd23f8d16 100644 --- a/arch/arm/boot/compressed/head-l7200.S +++ b/arch/arm/boot/compressed/head-l7200.S @@ -8,6 +8,7 @@ */ #include +#include #ifndef CONFIG_ARCH_L7200 #error What am I doing here... @@ -26,4 +27,4 @@ __L7200_start: ble 1b mov r8, #0 @ Zero it out - mov r7, #19 @ Set architecture ID + mov r7, #MACH_TYPE_L7200 @ Set architecture ID diff --git a/arch/arm/mm/abort-lv4t.S b/arch/arm/mm/abort-lv4t.S index 6b768df8fab2..1742f586de85 100644 --- a/arch/arm/mm/abort-lv4t.S +++ b/arch/arm/mm/abort-lv4t.S @@ -66,8 +66,8 @@ ENTRY(v4t_late_abort) add r6, r6, r2, lsr #3 add r6, r6, r6, lsr #8 add r6, r6, r6, lsr #4 - and r6, r6, #15 @ r7 = no. of registers to transfer. - and r5, r8, #15 << 16 @ Extract 'n' form instruction + and r6, r6, #15 @ r6 = no. of registers to transfer. + and r5, r8, #15 << 16 @ Extract 'n' from instruction ldr r7, [sp, r5, lsr #14] @ Get register 'Rn' tst r8, #1 << 23 @ Check U bit subne r7, r7, r6, lsl #2 @ Undo increment diff --git a/arch/arm/mm/fault-common.c b/arch/arm/mm/fault-common.c index b39fd67963f7..37770f82b356 100644 --- a/arch/arm/mm/fault-common.c +++ b/arch/arm/mm/fault-common.c @@ -339,8 +339,7 @@ no_context: int do_translation_fault(unsigned long addr, int error_code, struct pt_regs *regs) { struct task_struct *tsk; - struct mm_struct *mm; - int offset; + unsigned int offset; pgd_t *pgd, *pgd_k; pmd_t *pmd, *pmd_k; @@ -349,16 +348,17 @@ int do_translation_fault(unsigned long addr, int error_code, struct pt_regs *reg offset = __pgd_offset(addr); + /* + * FIXME: CP15 C1 is write only on ARMv3 architectures. + */ pgd = cpu_get_pgd() + offset; pgd_k = init_mm.pgd + offset; if (pgd_none(*pgd_k)) goto bad_area; -#if 0 /* note that we are two-level */ if (!pgd_present(*pgd)) set_pgd(pgd, *pgd_k); -#endif pmd_k = pmd_offset(pgd_k, addr); pmd = pmd_offset(pgd, addr); @@ -371,8 +371,7 @@ int do_translation_fault(unsigned long addr, int error_code, struct pt_regs *reg bad_area: tsk = current; - mm = tsk->active_mm; - do_bad_area(tsk, mm, addr, error_code, regs); + do_bad_area(tsk, tsk->active_mm, addr, error_code, regs); return 0; } diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 2a36b155a813..d4eace179b84 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -244,6 +244,7 @@ find_memend_and_nodes(struct meminfo *mi, struct node_info *np) * also get rid of some of the stuff above as well. */ max_low_pfn = memend_pfn - O_PFN_DOWN(PHYS_OFFSET); + max_pfn = memend_pfn - O_PFN_DOWN(PHYS_OFFSET); mi->end = memend_pfn << PAGE_SHIFT; return bootmem_pages; diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index 76ca193d0112..82dd2c7cf55f 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types @@ -6,7 +6,7 @@ # To add an entry into this database, please see Documentation/arm/README, # or contact rmk@arm.linux.org.uk # -# Last update: Fri Mar 29 15:51:20 2002 +# Last update: Tue May 21 14:19:05 2002 # # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number # @@ -149,7 +149,7 @@ h3800 SA1100_H3800 H3800 137 blue_v1 ARCH_BLUE_V1 BLUE_V1 138 pxa_cerf ARCH_PXA_CERF PXA_CERF 139 arm7tevb ARCH_ARM7TEVB ARM7TEVB 140 -d7400 ARCH_D7400 D7400 141 +d7400 SA1100_D7400 D7400 141 piranha ARCH_PIRANHA PIRANHA 142 sbcamelot SA1100_SBCAMELOT SBCAMELOT 143 kings SA1100_KINGS KINGS 144 @@ -180,3 +180,15 @@ active SA1100_ACTIVE ACTIVE 168 iq80321 ARCH_IQ80321 IQ80321 169 wid SA1100_WID WID 170 sabinal ARCH_SABINAL SABINAL 171 +ixp425_matacumbe ARCH_IXP425_MATACUMBE IXP425_MATACUMBE 172 +miniprint SA1100_MINIPRINT MINIPRINT 173 +adm510x ARCH_ADM510X ADM510X 174 +svs200 SA1100_SVS200 SVS200 175 +atg_tcu ARCH_ATG_TCU ATG_TCU 176 +jornada820 SA1100_JORNADA820 JORNADA820 177 +s3c44b0 ARCH_S3C44B0 S3C44B0 178 +margis2 ARCH_MARGIS2 MARGIS2 179 +ks8695 ARCH_KS8695 KS8695 180 +brh ARCH_BRH BRH 181 +s3c2410 ARCH_S3C2410 S3C2410 182 +possio_px30 ARCH_POSSIO_PX30 POSSIO_PX30 183 diff --git a/drivers/acorn/char/mouse_rpc.c b/drivers/acorn/char/mouse_rpc.c index dbfea910b078..feafc25a7451 100644 --- a/drivers/acorn/char/mouse_rpc.c +++ b/drivers/acorn/char/mouse_rpc.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/drivers/pcmcia/sa1100_assabet.c b/drivers/pcmcia/sa1100_assabet.c index 1a7cc433cf85..eb883f64e239 100644 --- a/drivers/pcmcia/sa1100_assabet.c +++ b/drivers/pcmcia/sa1100_assabet.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index 62a607d605a2..38697b2ee19d 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c @@ -95,10 +95,11 @@ static struct tq_struct sa1100_pcmcia_task; * "Expansion Memory (PCMCIA) Configuration Register (MECR)" * that's section 10.2.5 in _my_ version of the manuial ;) */ -static int sa1100_pcmcia_default_mecr_timing(unsigned int sock, unsigned int cpu_speed, - unsigned int cmd_time ) +static unsigned int +sa1100_pcmcia_default_mecr_timing(unsigned int sock, unsigned int cpu_speed, + unsigned int cmd_time) { - return sa1100_pcmcia_mecr_bs( cmd_time, cpu_speed ); + return sa1100_pcmcia_mecr_bs(cmd_time, cpu_speed); } /* sa1100_pcmcia_set_mecr() @@ -109,7 +110,7 @@ static int sa1100_pcmcia_default_mecr_timing(unsigned int sock, unsigned int cpu * Call board specific BS value calculation to allow boards * to tweak the BS values. */ -static int sa1100_pcmcia_set_mecr( int sock ) +static int sa1100_pcmcia_set_mecr(int sock) { struct sa1100_pcmcia_socket *skt; u32 mecr; @@ -117,15 +118,15 @@ static int sa1100_pcmcia_set_mecr( int sock ) long flags; unsigned int bs; - if ( sock<0 || sock>SA1100_PCMCIA_MAX_SOCK ) + if (sock < 0 || sock > SA1100_PCMCIA_MAX_SOCK) return -1; - skt = PCMCIA_SOCKET( sock ); + skt = PCMCIA_SOCKET(sock); local_irq_save(flags); clock = cpufreq_get(0); - bs = pcmcia_low_level->socket_get_timing( sock, clock, skt->speed_io); + bs = pcmcia_low_level->socket_get_timing(sock, clock, skt->speed_io); mecr = MECR; MECR_FAST_SET(mecr, sock, 0); @@ -136,10 +137,10 @@ static int sa1100_pcmcia_set_mecr( int sock ) local_irq_restore(flags); - DEBUG(4, "%s(): FAST%u %lx BSM%u %lx BSA%u %lx BSIO%u %lx\n", - __FUNCTION__, sock, MECR_FAST_GET(mecr, sock), sock, - MECR_BSM_GET(mecr, sock), sock, MECR_BSA_GET(mecr, sock), - sock, MECR_BSIO_GET(mecr, sock)); + DEBUG(4, "%s(): FAST%u %lx BSM%u %lx BSA%u %lx BSIO%u %lx\n", + __FUNCTION__, sock, MECR_FAST_GET(mecr, sock), sock, + MECR_BSM_GET(mecr, sock), sock, MECR_BSA_GET(mecr, sock), + sock, MECR_BSIO_GET(mecr, sock)); return 0; } @@ -882,11 +883,11 @@ static struct pccard_operations sa1100_pcmcia_operations = { */ static void sa1100_pcmcia_update_mecr(unsigned int clock) { - unsigned int sock; + unsigned int sock; - for (sock = 0; sock < SA1100_PCMCIA_MAX_SOCK; ++sock) { - sa1100_pcmcia_set_mecr( sock ); - } + for (sock = 0; sock < SA1100_PCMCIA_MAX_SOCK; ++sock) { + sa1100_pcmcia_set_mecr(sock); + } } /* sa1100_pcmcia_notifier() diff --git a/drivers/pcmcia/sa1100_generic.h b/drivers/pcmcia/sa1100_generic.h index 3b77e715af9d..daa043b1b523 100644 --- a/drivers/pcmcia/sa1100_generic.h +++ b/drivers/pcmcia/sa1100_generic.h @@ -73,8 +73,8 @@ struct pcmcia_low_level { /* * Calculate MECR timing clock wait states */ - int (*socket_get_timing)(unsigned int sock, unsigned int cpu_speed, - unsigned int cmd_time ); + unsigned int (*socket_get_timing)(unsigned int sock, + unsigned int cpu_speed, unsigned int cmd_time); }; extern int sa1100_register_pcmcia(struct pcmcia_low_level *); diff --git a/drivers/pcmcia/sa1100_neponset.c b/drivers/pcmcia/sa1100_neponset.c index 12408343d653..d8e09192bacc 100644 --- a/drivers/pcmcia/sa1100_neponset.c +++ b/drivers/pcmcia/sa1100_neponset.c @@ -5,6 +5,8 @@ */ #include #include +#include +#include #include #include @@ -133,7 +135,7 @@ int __init pcmcia_neponset_init(void) { int ret = -ENODEV; - if (machine_is_assabet() && machine_has_neponset()) + if (machine_is_assabet() && sa1111) ret = sa1100_register_pcmcia(&neponset_pcmcia_ops); return ret; diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c index bd2b7fb28afd..ef5a8b0bf153 100644 --- a/drivers/pcmcia/sa1111_generic.c +++ b/drivers/pcmcia/sa1111_generic.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h index ede2ac4359b1..154a688c170f 100644 --- a/include/asm-arm/thread_info.h +++ b/include/asm-arm/thread_info.h @@ -28,7 +28,7 @@ typedef unsigned long mm_segment_t; /* domain register */ * low level task data that entry.S needs immediate access to. */ struct thread_info { - __u32 flags; /* low level flags */ + unsigned long flags; /* low level flags */ __s32 preempt_count; /* 0 => preemptable, <0 => bug */ mm_segment_t addr_limit; /* address limit */ __u32 cpu; /* cpu */ -- cgit v1.2.3 From 4b59e57ff304f1887156622233c247afb94207d6 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 23 May 2002 03:00:44 +0100 Subject: [ARM] Acorn DMA/Expansion card fixups - Allow icside to moan if it tries to change DMA settings while the DMA is in progress. - Fix Acorn expansion card IRQ handling. - Clean up IOMD DMA state machine. --- arch/arm/kernel/dma.c | 12 ++++++ arch/arm/kernel/ecard.c | 16 ++++---- arch/arm/mach-rpc/dma.c | 99 +++++++++++++++---------------------------------- include/asm-arm/dma.h | 4 ++ 4 files changed, 53 insertions(+), 78 deletions(-) (limited to 'include') diff --git a/arch/arm/kernel/dma.c b/arch/arm/kernel/dma.c index c5a4c6a09dab..6717f735136a 100644 --- a/arch/arm/kernel/dma.c +++ b/arch/arm/kernel/dma.c @@ -120,6 +120,10 @@ void set_dma_sg (dmach_t channel, struct scatterlist *sg, int nr_sg) { dma_t *dma = dma_chan + channel; + if (dma->active) + printk(KERN_ERR "dma%d: altering DMA SG while " + "DMA active\n", channel); + dma->sg = sg; dma->sgcount = nr_sg; dma->using_sg = 1; @@ -218,6 +222,14 @@ free_dma: BUG(); } +/* + * Is the specified DMA channel active? + */ +int dma_channel_active(dmach_t channel) +{ + return dma_chan[channel].active; +} + void set_dma_page(dmach_t channel, char pagenr) { printk(KERN_ERR "dma%d: trying to set_dma_page\n", channel); diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c index 31a31471388e..2213863f199e 100644 --- a/arch/arm/kernel/ecard.c +++ b/arch/arm/kernel/ecard.c @@ -541,7 +541,7 @@ static expansioncard_ops_t ecard_default_ops = { * * They are not meant to be called directly, but via enable/disable_irq. */ -static void ecard_irq_mask(unsigned int irqnr) +static void ecard_irq_unmask(unsigned int irqnr) { ecard_t *ec = slot_to_ecard(irqnr - 32); @@ -557,7 +557,7 @@ static void ecard_irq_mask(unsigned int irqnr) } } -static void ecard_irq_unmask(unsigned int irqnr) +static void ecard_irq_mask(unsigned int irqnr) { ecard_t *ec = slot_to_ecard(irqnr - 32); @@ -945,20 +945,20 @@ ecard_probe(int slot, card_type_t type) break; } - ec->irq = 32 + slot; -#ifdef IO_EC_MEMC8_BASE - if (slot == 8) - ec->irq = 11; -#endif /* * hook the interrupt handlers */ - if (ec->irq != 0 && ec->irq >= 32) { + if (slot < 8) { + ec->irq = 32 + slot; set_irq_chip(ec->irq, &ecard_chip); set_irq_handler(ec->irq, do_level_IRQ); set_irq_flags(ec->irq, IRQF_VALID); } +#ifdef IO_EC_MEMC8_BASE + if (slot == 8) + ec->irq = 11; +#endif #ifdef CONFIG_ARCH_RPC /* On RiscPC, only first two slots have DMA capability */ if (slot < 2) diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c index cc0dc96ae2ee..6bd602e712e6 100644 --- a/arch/arm/mach-rpc/dma.c +++ b/arch/arm/mach-rpc/dma.c @@ -33,10 +33,6 @@ typedef enum { dma_size_32 = 4, dma_size_128 = 16 } dma_size_t; - -typedef struct { - dma_size_t transfersize; -} dma_t; #endif #define TRANSFER_SIZE 2 @@ -48,10 +44,6 @@ typedef struct { #define CR (IOMD_IO0CR - IOMD_IO0CURA) #define ST (IOMD_IO0ST - IOMD_IO0CURA) -#define state_prog_a 0 -#define state_wait_a 1 -#define state_wait_b 2 - static void iomd_get_next_sg(struct scatterlist *sg, dma_t *dma) { unsigned long end, offset, flags = 0; @@ -91,76 +83,40 @@ static void iomd_get_next_sg(struct scatterlist *sg, dma_t *dma) sg->length |= flags; } -static inline void iomd_setup_dma_a(struct scatterlist *sg, dma_t *dma) -{ - iomd_writel(sg->dma_address, dma->dma_base + CURA); - iomd_writel(sg->length, dma->dma_base + ENDA); -} - -static inline void iomd_setup_dma_b(struct scatterlist *sg, dma_t *dma) -{ - iomd_writel(sg->dma_address, dma->dma_base + CURB); - iomd_writel(sg->length, dma->dma_base + ENDB); -} - static void iomd_dma_handle(int irq, void *dev_id, struct pt_regs *regs) { dma_t *dma = (dma_t *)dev_id; - unsigned int status = 0, no_buffer = dma->sg == NULL; + unsigned long base = dma->dma_base; do { - switch (dma->state) { - case state_prog_a: - iomd_get_next_sg(&dma->cur_sg, dma); - iomd_setup_dma_a(&dma->cur_sg, dma); - dma->state = state_wait_a; - - case state_wait_a: - status = iomd_readb(dma->dma_base + ST); - switch (status & (DMA_ST_OFL|DMA_ST_INT|DMA_ST_AB)) { - case DMA_ST_OFL|DMA_ST_INT: - iomd_get_next_sg(&dma->cur_sg, dma); - iomd_setup_dma_a(&dma->cur_sg, dma); - break; - - case DMA_ST_INT: - iomd_get_next_sg(&dma->cur_sg, dma); - iomd_setup_dma_b(&dma->cur_sg, dma); - dma->state = state_wait_b; - break; - - case DMA_ST_OFL|DMA_ST_INT|DMA_ST_AB: - iomd_setup_dma_b(&dma->cur_sg, dma); - dma->state = state_wait_b; - break; - } + unsigned int status; + + status = iomd_readb(base + ST); + if (!(status & DMA_ST_INT)) + return; + + if (status & DMA_ST_OFL && !dma->sg) break; - case state_wait_b: - status = iomd_readb(dma->dma_base + ST); - switch (status & (DMA_ST_OFL|DMA_ST_INT|DMA_ST_AB)) { - case DMA_ST_OFL|DMA_ST_INT|DMA_ST_AB: - iomd_get_next_sg(&dma->cur_sg, dma); - iomd_setup_dma_b(&dma->cur_sg, dma); - break; - - case DMA_ST_INT|DMA_ST_AB: - iomd_get_next_sg(&dma->cur_sg, dma); - iomd_setup_dma_a(&dma->cur_sg, dma); - dma->state = state_wait_a; - break; - - case DMA_ST_OFL|DMA_ST_INT: - iomd_setup_dma_a(&dma->cur_sg, dma); - dma->state = state_wait_a; - break; - } + iomd_get_next_sg(&dma->cur_sg, dma); + + switch (status & (DMA_ST_OFL | DMA_ST_AB)) { + case DMA_ST_OFL: /* OIA */ + case DMA_ST_AB: /* .IB */ + iomd_writel(dma->cur_sg.dma_address, base + CURA); + iomd_writel(dma->cur_sg.length, base + ENDA); + break; + + case DMA_ST_OFL | DMA_ST_AB: /* OIB */ + case 0: /* .IA */ + iomd_writel(dma->cur_sg.dma_address, base + CURB); + iomd_writel(dma->cur_sg.length, base + ENDB); break; } - } while (dma->sg && (status & DMA_ST_INT)); + } while (1); - if (no_buffer) - disable_irq(irq); + iomd_writeb(0, dma->dma_base + CR); + disable_irq(irq); } static int iomd_request_dma(dmach_t channel, dma_t *dma) @@ -194,7 +150,6 @@ static void iomd_enable_dma(dmach_t channel, dma_t *dma) } iomd_writeb(DMA_CR_C, dma_base + CR); - dma->state = state_prog_a; } if (dma->dma_mode == DMA_MODE_READ) @@ -207,11 +162,15 @@ static void iomd_enable_dma(dmach_t channel, dma_t *dma) static void iomd_disable_dma(dmach_t channel, dma_t *dma) { unsigned long dma_base = dma->dma_base; + unsigned long flags; unsigned int ctrl; - disable_irq(dma->dma_irq); + local_irq_save(flags); ctrl = iomd_readb(dma_base + CR); + if (ctrl & DMA_CR_E) + disable_irq(dma->dma_irq); iomd_writeb(ctrl & ~DMA_CR_E, dma_base + CR); + local_irq_restore(flags); } static int iomd_set_dma_speed(dmach_t channel, dma_t *dma, int cycle) diff --git a/include/asm-arm/dma.h b/include/asm-arm/dma.h index f42a8cf158ca..0dee33c1aad8 100644 --- a/include/asm-arm/dma.h +++ b/include/asm-arm/dma.h @@ -74,6 +74,10 @@ extern void enable_dma(dmach_t channel); */ extern void disable_dma(dmach_t channel); +/* Test whether the specified channel has an active DMA transfer + */ +extern int dma_channel_active(dmach_t channel); + /* Set the DMA scatter gather list for this channel * * This should not be called if a DMA channel is enabled, -- cgit v1.2.3