From bfb5ded64e742215cf55f797a351b4e8ab963172 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Wed, 8 Jun 2011 15:07:47 -0700 Subject: [PATCH] --- yaml --- r: 253377 b: refs/heads/master c: 1780f2d3839a0d3eb85ee014a708f9e2c8f8ba0e h: refs/heads/master i: 253375: a666078b0bbba5b0cb397123c282ee87080a64d7 v: v3 --- [refs] | 2 +- trunk/MAINTAINERS | 1 - trunk/Makefile | 16 +- trunk/arch/powerpc/boot/.gitignore | 1 + trunk/arch/powerpc/boot/dtc-src/.gitignore | 3 + trunk/arch/powerpc/include/asm/rio.h | 2 +- trunk/arch/powerpc/kernel/cputable.c | 2 +- trunk/arch/powerpc/kernel/prom.c | 27 +- trunk/arch/powerpc/mm/init_32.c | 15 + trunk/arch/powerpc/mm/init_64.c | 14 + trunk/arch/powerpc/mm/mem.c | 19 - trunk/arch/powerpc/sysdev/fsl_lbc.c | 6 +- trunk/arch/sparc/Kconfig | 18 +- trunk/arch/sparc/include/asm/floppy_32.h | 8 +- trunk/arch/sparc/include/asm/floppy_64.h | 4 +- trunk/arch/sparc/include/asm/leon.h | 3 - trunk/arch/sparc/include/asm/leon_pci.h | 21 - trunk/arch/sparc/include/asm/pci_32.h | 24 - trunk/arch/sparc/include/asm/pcic.h | 2 +- trunk/arch/sparc/include/asm/system_32.h | 2 +- trunk/arch/sparc/include/asm/system_64.h | 2 +- trunk/arch/sparc/kernel/Makefile | 4 +- trunk/arch/sparc/kernel/apc.c | 2 +- trunk/arch/sparc/kernel/auxio_32.c | 2 +- trunk/arch/sparc/kernel/chmc.c | 2 +- trunk/arch/sparc/kernel/entry.S | 8 +- trunk/arch/sparc/kernel/leon_kernel.c | 31 - trunk/arch/sparc/kernel/leon_pci.c | 253 ----- trunk/arch/sparc/kernel/leon_pci_grpci2.c | 897 ------------------ trunk/arch/sparc/kernel/module.c | 2 +- trunk/arch/sparc/kernel/pci_common.c | 4 +- trunk/arch/sparc/kernel/pci_schizo.c | 6 +- trunk/arch/sparc/kernel/prom_irqtrans.c | 2 +- trunk/arch/sparc/kernel/psycho_common.c | 2 +- trunk/arch/sparc/kernel/sbus.c | 4 +- trunk/arch/sparc/kernel/setup_32.c | 2 +- trunk/arch/sparc/kernel/setup_64.c | 2 +- trunk/arch/sparc/kernel/smp_32.c | 6 +- trunk/arch/sparc/kernel/sun4d_irq.c | 126 +-- trunk/arch/sparc/kernel/sys_sparc32.c | 2 +- trunk/arch/sparc/kernel/sys_sparc_64.c | 6 +- trunk/arch/sparc/kernel/time_64.c | 2 +- trunk/arch/sparc/kernel/traps_64.c | 2 +- trunk/arch/sparc/kernel/unaligned_64.c | 6 +- trunk/arch/sparc/kernel/us2e_cpufreq.c | 6 +- trunk/arch/sparc/kernel/us3_cpufreq.c | 4 +- trunk/arch/sparc/kernel/viohs.c | 2 +- trunk/arch/sparc/kernel/visemul.c | 14 +- trunk/arch/sparc/mm/fault_32.c | 2 +- trunk/arch/sparc/mm/init_32.c | 2 +- trunk/arch/sparc/mm/init_64.c | 6 +- trunk/arch/sparc/mm/srmmu.c | 4 +- trunk/arch/sparc/mm/sun4c.c | 8 +- trunk/arch/sparc/mm/tsb.c | 6 +- trunk/arch/sparc/prom/console_32.c | 2 +- trunk/arch/sparc/prom/init_32.c | 2 +- trunk/arch/sparc/prom/mp.c | 2 +- trunk/arch/unicore32/Kconfig | 4 + trunk/arch/unicore32/Makefile | 38 +- trunk/arch/unicore32/boot/compressed/Makefile | 2 +- .../{unicore32_defconfig => debug_defconfig} | 8 +- trunk/arch/unicore32/include/asm/Kbuild | 59 -- trunk/arch/unicore32/kernel/Makefile | 1 + .../unicore32/kernel/rtc.c} | 14 +- trunk/arch/unicore32/kernel/vmlinux.lds.S | 2 +- trunk/arch/x86/kernel/process_32.c | 1 + trunk/arch/x86/kernel/process_64.c | 1 + trunk/drivers/ata/libata-eh.c | 12 +- trunk/drivers/firmware/iscsi_ibft_find.c | 2 - .../media/video/cx23885/cx23885-cards.c | 2 +- trunk/drivers/pci/Makefile | 1 - trunk/drivers/rtc/Kconfig | 9 - trunk/drivers/rtc/Makefile | 1 - trunk/drivers/staging/Kconfig | 18 + .../staging/altera-stapl/altera-jtag.c | 2 +- trunk/drivers/staging/altera-stapl/altera.c | 2 +- trunk/drivers/staging/ath6kl/Kconfig | 1 - .../staging/ath6kl/os/linux/cfg80211.c | 3 +- .../staging/brcm80211/brcmfmac/wl_iw.c | 2 + trunk/drivers/staging/gma500/psb_drv.c | 15 +- trunk/drivers/staging/gma500/psb_fb.c | 10 - trunk/drivers/staging/gma500/psb_intel_bios.c | 13 +- trunk/drivers/staging/iio/dac/max517.c | 2 +- .../drivers/staging/iio/imu/adis16400_ring.c | 10 +- .../staging/iio/industrialio-trigger.c | 1 - trunk/drivers/staging/mei/init.c | 4 +- trunk/drivers/staging/olpc_dcon/Kconfig | 1 - trunk/drivers/staging/rts_pstor/sd.c | 2 +- trunk/drivers/staging/usbip/stub_dev.c | 21 - trunk/drivers/staging/usbip/stub_rx.c | 20 +- trunk/drivers/xen/swiotlb-xen.c | 12 +- trunk/fs/exec.c | 5 +- trunk/include/linux/seqlock.h | 1 - trunk/include/linux/swiotlb.h | 1 - .../altera-stapl => include/staging}/altera.h | 0 trunk/lib/swiotlb.c | 5 - trunk/lib/vsprintf.c | 4 +- trunk/scripts/Makefile.asm-generic | 1 - trunk/scripts/depmod.sh | 48 - trunk/security/apparmor/lsm.c | 2 +- trunk/tools/perf/util/PERF-VERSION-GEN | 7 +- 101 files changed, 298 insertions(+), 1697 deletions(-) create mode 100644 trunk/arch/powerpc/boot/dtc-src/.gitignore delete mode 100644 trunk/arch/sparc/include/asm/leon_pci.h delete mode 100644 trunk/arch/sparc/kernel/leon_pci.c delete mode 100644 trunk/arch/sparc/kernel/leon_pci_grpci2.c rename trunk/arch/unicore32/configs/{unicore32_defconfig => debug_defconfig} (97%) rename trunk/{drivers/rtc/rtc-puv3.c => arch/unicore32/kernel/rtc.c} (98%) rename trunk/{drivers/staging/altera-stapl => include/staging}/altera.h (100%) delete mode 100755 trunk/scripts/depmod.sh diff --git a/[refs] b/[refs] index 28171054c359..750058ec919e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 56a210526adb2854d5b7c398a40260720390ee05 +refs/heads/master: 1780f2d3839a0d3eb85ee014a708f9e2c8f8ba0e diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index bbe49d8c22af..b5ea4d033730 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -4945,7 +4945,6 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32.gi F: drivers/input/serio/i8042-unicore32io.h F: drivers/i2c/busses/i2c-puv3.c F: drivers/video/fb-puv3.c -F: drivers/rtc/rtc-puv3.c PMC SIERRA MaxRAID DRIVER M: Anil Ravindranath diff --git a/trunk/Makefile b/trunk/Makefile index 72c0e321f2da..0f1db8d90741 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -378,7 +378,7 @@ KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) -KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) +KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC @@ -1005,7 +1005,7 @@ endef define filechk_version.h (echo \#define LINUX_VERSION_CODE $(shell \ - expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \ + expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) endef @@ -1110,6 +1110,11 @@ modules_install: _modinst_ _modinst_post PHONY += _modinst_ _modinst_: + @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \ + echo "Warning: you may need to install module-init-tools"; \ + echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\ + sleep 1; \ + fi @rm -rf $(MODLIB)/kernel @rm -f $(MODLIB)/source @mkdir -p $(MODLIB)/kernel @@ -1526,7 +1531,12 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)) # Run depmod only if we have System.map and depmod is executable quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) - cmd_depmod = $(srctree)/scripts/depmod.sh $(DEPMOD) $(KERNELRELEASE) + cmd_depmod = \ + if [ -r System.map -a -x $(DEPMOD) ]; then \ + $(DEPMOD) -ae -F System.map \ + $(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) ) \ + $(KERNELRELEASE); \ + fi # Create temporary dir for module support files # clean it up only when building all modules diff --git a/trunk/arch/powerpc/boot/.gitignore b/trunk/arch/powerpc/boot/.gitignore index 12da77ec0228..3d80c3e9cf60 100644 --- a/trunk/arch/powerpc/boot/.gitignore +++ b/trunk/arch/powerpc/boot/.gitignore @@ -1,4 +1,5 @@ addnote +dtc empty.c hack-coff infblock.c diff --git a/trunk/arch/powerpc/boot/dtc-src/.gitignore b/trunk/arch/powerpc/boot/dtc-src/.gitignore new file mode 100644 index 000000000000..a7c3f94e5e75 --- /dev/null +++ b/trunk/arch/powerpc/boot/dtc-src/.gitignore @@ -0,0 +1,3 @@ +dtc-lexer.lex.c +dtc-parser.tab.c +dtc-parser.tab.h diff --git a/trunk/arch/powerpc/include/asm/rio.h b/trunk/arch/powerpc/include/asm/rio.h index b1d2deceeedb..d902abd33995 100644 --- a/trunk/arch/powerpc/include/asm/rio.h +++ b/trunk/arch/powerpc/include/asm/rio.h @@ -14,7 +14,7 @@ #define ASM_PPC_RIO_H extern void platform_rio_init(void); -#ifdef CONFIG_FSL_RIO +#ifdef CONFIG_RAPIDIO extern int fsl_rio_mcheck_exception(struct pt_regs *); #else static inline int fsl_rio_mcheck_exception(struct pt_regs *regs) {return 0; } diff --git a/trunk/arch/powerpc/kernel/cputable.c b/trunk/arch/powerpc/kernel/cputable.c index 9fb933248ab6..34d2722b9451 100644 --- a/trunk/arch/powerpc/kernel/cputable.c +++ b/trunk/arch/powerpc/kernel/cputable.c @@ -1979,7 +1979,7 @@ static struct cpu_spec __initdata cpu_specs[] = { .pvr_value = 0x80240000, .cpu_name = "e5500", .cpu_features = CPU_FTRS_E5500, - .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, + .cpu_user_features = COMMON_USER_BOOKE, .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | MMU_FTR_USE_TLBILX, .icache_bsize = 64, diff --git a/trunk/arch/powerpc/kernel/prom.c b/trunk/arch/powerpc/kernel/prom.c index 8c3112a57cf2..f2c906b1d8d3 100644 --- a/trunk/arch/powerpc/kernel/prom.c +++ b/trunk/arch/powerpc/kernel/prom.c @@ -82,29 +82,11 @@ static int __init early_parse_mem(char *p) } early_param("mem", early_parse_mem); -/* - * overlaps_initrd - check for overlap with page aligned extension of - * initrd. - */ -static inline int overlaps_initrd(unsigned long start, unsigned long size) -{ -#ifdef CONFIG_BLK_DEV_INITRD - if (!initrd_start) - return 0; - - return (start + size) > _ALIGN_DOWN(initrd_start, PAGE_SIZE) && - start <= _ALIGN_UP(initrd_end, PAGE_SIZE); -#else - return 0; -#endif -} - /** * move_device_tree - move tree to an unused area, if needed. * * The device tree may be allocated beyond our memory limit, or inside the - * crash kernel region for kdump, or within the page aligned range of initrd. - * If so, move it out of the way. + * crash kernel region for kdump. If so, move it out of the way. */ static void __init move_device_tree(void) { @@ -117,8 +99,7 @@ static void __init move_device_tree(void) size = be32_to_cpu(initial_boot_params->totalsize); if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) || - overlaps_crashkernel(start, size) || - overlaps_initrd(start, size)) { + overlaps_crashkernel(start, size)) { p = __va(memblock_alloc(size, PAGE_SIZE)); memcpy(p, initial_boot_params, size); initial_boot_params = (struct boot_param_header *)p; @@ -574,9 +555,7 @@ static void __init early_reserve_mem(void) #ifdef CONFIG_BLK_DEV_INITRD /* then reserve the initrd, if any */ if (initrd_start && (initrd_end > initrd_start)) - memblock_reserve(_ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE), - _ALIGN_UP(initrd_end, PAGE_SIZE) - - _ALIGN_DOWN(initrd_start, PAGE_SIZE)); + memblock_reserve(__pa(initrd_start), initrd_end - initrd_start); #endif /* CONFIG_BLK_DEV_INITRD */ #ifdef CONFIG_PPC32 diff --git a/trunk/arch/powerpc/mm/init_32.c b/trunk/arch/powerpc/mm/init_32.c index 5de0f254dbb5..d65b591e5556 100644 --- a/trunk/arch/powerpc/mm/init_32.c +++ b/trunk/arch/powerpc/mm/init_32.c @@ -223,6 +223,21 @@ void free_initmem(void) #undef FREESEC } +#ifdef CONFIG_BLK_DEV_INITRD +void free_initrd_mem(unsigned long start, unsigned long end) +{ + if (start < end) + printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10); + for (; start < end; start += PAGE_SIZE) { + ClearPageReserved(virt_to_page(start)); + init_page_count(virt_to_page(start)); + free_page(start); + totalram_pages++; + } +} +#endif + + #ifdef CONFIG_8xx /* No 8xx specific .c file to put that in ... */ void setup_initial_memory_limit(phys_addr_t first_memblock_base, phys_addr_t first_memblock_size) diff --git a/trunk/arch/powerpc/mm/init_64.c b/trunk/arch/powerpc/mm/init_64.c index f6dbb4c20e64..6374b2196a17 100644 --- a/trunk/arch/powerpc/mm/init_64.c +++ b/trunk/arch/powerpc/mm/init_64.c @@ -99,6 +99,20 @@ void free_initmem(void) ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10); } +#ifdef CONFIG_BLK_DEV_INITRD +void free_initrd_mem(unsigned long start, unsigned long end) +{ + if (start < end) + printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10); + for (; start < end; start += PAGE_SIZE) { + ClearPageReserved(virt_to_page(start)); + init_page_count(virt_to_page(start)); + free_page(start); + totalram_pages++; + } +} +#endif + static void pgd_ctor(void *addr) { memset(addr, 0, PGD_TABLE_SIZE); diff --git a/trunk/arch/powerpc/mm/mem.c b/trunk/arch/powerpc/mm/mem.c index 29d4dde65c45..57e545b84bf1 100644 --- a/trunk/arch/powerpc/mm/mem.c +++ b/trunk/arch/powerpc/mm/mem.c @@ -382,25 +382,6 @@ void __init mem_init(void) mem_init_done = 1; } -#ifdef CONFIG_BLK_DEV_INITRD -void __init free_initrd_mem(unsigned long start, unsigned long end) -{ - if (start >= end) - return; - - start = _ALIGN_DOWN(start, PAGE_SIZE); - end = _ALIGN_UP(end, PAGE_SIZE); - pr_info("Freeing initrd memory: %ldk freed\n", (end - start) >> 10); - - for (; start < end; start += PAGE_SIZE) { - ClearPageReserved(virt_to_page(start)); - init_page_count(virt_to_page(start)); - free_page(start); - totalram_pages++; - } -} -#endif - /* * This is called when a page has been modified by the kernel. * It just marks the page as not i-cache clean. We do the i-cache diff --git a/trunk/arch/powerpc/sysdev/fsl_lbc.c b/trunk/arch/powerpc/sysdev/fsl_lbc.c index d917573cf1a8..0608b1657da4 100644 --- a/trunk/arch/powerpc/sysdev/fsl_lbc.c +++ b/trunk/arch/powerpc/sysdev/fsl_lbc.c @@ -196,6 +196,9 @@ static int __devinit fsl_lbc_ctrl_init(struct fsl_lbc_ctrl *ctrl, out_be32(&lbc->lteccr, LTECCR_CLEAR); out_be32(&lbc->ltedr, LTEDR_ENABLE); + /* Enable interrupts for any detected events */ + out_be32(&lbc->lteir, LTEIR_ENABLE); + /* Set the monitor timeout value to the maximum for erratum A001 */ if (of_device_is_compatible(node, "fsl,elbc")) clrsetbits_be32(&lbc->lbcr, LBCR_BMT, LBCR_BMTPS); @@ -319,9 +322,6 @@ static int __devinit fsl_lbc_ctrl_probe(struct platform_device *dev) goto err; } - /* Enable interrupts for any detected events */ - out_be32(&fsl_lbc_ctrl_dev->regs->lteir, LTEIR_ENABLE); - return 0; err: diff --git a/trunk/arch/sparc/Kconfig b/trunk/arch/sparc/Kconfig index 253986bd6bb6..af32e17fa170 100644 --- a/trunk/arch/sparc/Kconfig +++ b/trunk/arch/sparc/Kconfig @@ -26,6 +26,7 @@ config SPARC select HAVE_DMA_API_DEBUG select HAVE_ARCH_JUMP_LABEL select HAVE_GENERIC_HARDIRQS + select GENERIC_HARDIRQS_NO_DEPRECATED select GENERIC_IRQ_SHOW select USE_GENERIC_SMP_HELPERS if SMP @@ -527,23 +528,6 @@ config PCI_DOMAINS config PCI_SYSCALL def_bool PCI -config PCIC_PCI - bool - depends on PCI && SPARC32 && !SPARC_LEON - default y - -config LEON_PCI - bool - depends on PCI && SPARC_LEON - default y - -config GRPCI2 - bool "GRPCI2 Host Bridge Support" - depends on LEON_PCI - default y - help - Say Y here to include the GRPCI2 Host Bridge Driver. - source "drivers/pci/Kconfig" source "drivers/pcmcia/Kconfig" diff --git a/trunk/arch/sparc/include/asm/floppy_32.h b/trunk/arch/sparc/include/asm/floppy_32.h index 7440915e86d8..482c79e2a416 100644 --- a/trunk/arch/sparc/include/asm/floppy_32.h +++ b/trunk/arch/sparc/include/asm/floppy_32.h @@ -138,7 +138,7 @@ static unsigned char sun_82072_fd_inb(int port) return sun_fdc->data_82072; case 7: /* FD_DIR */ return sun_read_dir(); - } + }; panic("sun_82072_fd_inb: How did I get here?"); } @@ -161,7 +161,7 @@ static void sun_82072_fd_outb(unsigned char value, int port) case 4: /* FD_STATUS */ sun_fdc->status_82072 = value; break; - } + }; return; } @@ -186,7 +186,7 @@ static unsigned char sun_82077_fd_inb(int port) return sun_fdc->data_82077; case 7: /* FD_DIR */ return sun_read_dir(); - } + }; panic("sun_82077_fd_inb: How did I get here?"); } @@ -212,7 +212,7 @@ static void sun_82077_fd_outb(unsigned char value, int port) case 3: /* FD_TDR */ sun_fdc->tapectl_82077 = value; break; - } + }; return; } diff --git a/trunk/arch/sparc/include/asm/floppy_64.h b/trunk/arch/sparc/include/asm/floppy_64.h index bcef1f5a2a6d..6597ce874d78 100644 --- a/trunk/arch/sparc/include/asm/floppy_64.h +++ b/trunk/arch/sparc/include/asm/floppy_64.h @@ -111,7 +111,7 @@ static unsigned char sun_82077_fd_inb(unsigned long port) case 7: /* FD_DIR */ /* XXX: Is DCL on 0x80 in sun4m? */ return sbus_readb(&sun_fdc->dir_82077); - } + }; panic("sun_82072_fd_inb: How did I get here?"); } @@ -135,7 +135,7 @@ static void sun_82077_fd_outb(unsigned char value, unsigned long port) case 4: /* FD_STATUS */ sbus_writeb(value, &sun_fdc->status_82077); break; - } + }; return; } diff --git a/trunk/arch/sparc/include/asm/leon.h b/trunk/arch/sparc/include/asm/leon.h index a4e457f003ed..6bdaf1e43d2a 100644 --- a/trunk/arch/sparc/include/asm/leon.h +++ b/trunk/arch/sparc/include/asm/leon.h @@ -318,9 +318,6 @@ struct device_node; extern unsigned int leon_build_device_irq(unsigned int real_irq, irq_flow_handler_t flow_handler, const char *name, int do_ack); -extern void leon_update_virq_handling(unsigned int virq, - irq_flow_handler_t flow_handler, - const char *name, int do_ack); extern void leon_clear_clock_irq(void); extern void leon_load_profile_irq(int cpu, unsigned int limit); extern void leon_init_timers(irq_handler_t counter_fn); diff --git a/trunk/arch/sparc/include/asm/leon_pci.h b/trunk/arch/sparc/include/asm/leon_pci.h deleted file mode 100644 index 42b4b31a82fe..000000000000 --- a/trunk/arch/sparc/include/asm/leon_pci.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * asm/leon_pci.h - * - * Copyright (C) 2011 Aeroflex Gaisler AB, Daniel Hellstrom - */ - -#ifndef _ASM_LEON_PCI_H_ -#define _ASM_LEON_PCI_H_ - -/* PCI related definitions */ -struct leon_pci_info { - struct pci_ops *ops; - struct resource io_space; - struct resource mem_space; - int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin); -}; - -extern void leon_pci_init(struct platform_device *ofdev, - struct leon_pci_info *info); - -#endif /* _ASM_LEON_PCI_H_ */ diff --git a/trunk/arch/sparc/include/asm/pci_32.h b/trunk/arch/sparc/include/asm/pci_32.h index 862e3ce92b15..332ac9ab36bc 100644 --- a/trunk/arch/sparc/include/asm/pci_32.h +++ b/trunk/arch/sparc/include/asm/pci_32.h @@ -47,31 +47,7 @@ extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev); #endif /* __KERNEL__ */ -#ifndef CONFIG_LEON_PCI /* generic pci stuff */ #include -#else -/* - * On LEON PCI Memory space is mapped 1:1 with physical address space. - * - * I/O space is located at low 64Kbytes in PCI I/O space. The I/O addresses - * are converted into CPU addresses to virtual addresses that are mapped with - * MMU to the PCI Host PCI I/O space window which are translated to the low - * 64Kbytes by the Host controller. - */ - -extern void -pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, - struct resource *res); - -extern void -pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, - struct pci_bus_region *region); - -static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) -{ - return PCI_IRQ_NONE; -} -#endif #endif /* __SPARC_PCI_H */ diff --git a/trunk/arch/sparc/include/asm/pcic.h b/trunk/arch/sparc/include/asm/pcic.h index 6676cbcc8b6a..7eb5d78f5211 100644 --- a/trunk/arch/sparc/include/asm/pcic.h +++ b/trunk/arch/sparc/include/asm/pcic.h @@ -29,7 +29,7 @@ struct linux_pcic { int pcic_imdim; }; -#ifdef CONFIG_PCIC_PCI +#ifdef CONFIG_PCI extern int pcic_present(void); extern int pcic_probe(void); extern void pci_time_init(void); diff --git a/trunk/arch/sparc/include/asm/system_32.h b/trunk/arch/sparc/include/asm/system_32.h index aba16092a81b..47a7e862474e 100644 --- a/trunk/arch/sparc/include/asm/system_32.h +++ b/trunk/arch/sparc/include/asm/system_32.h @@ -220,7 +220,7 @@ static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int switch (size) { case 4: return xchg_u32(ptr, x); - } + }; __xchg_called_with_bad_pointer(); return x; } diff --git a/trunk/arch/sparc/include/asm/system_64.h b/trunk/arch/sparc/include/asm/system_64.h index 10bcabce97b2..3c96d3bb9f15 100644 --- a/trunk/arch/sparc/include/asm/system_64.h +++ b/trunk/arch/sparc/include/asm/system_64.h @@ -234,7 +234,7 @@ static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, return xchg32(ptr, x); case 8: return xchg64(ptr, x); - } + }; __xchg_called_with_bad_pointer(); return x; } diff --git a/trunk/arch/sparc/kernel/Makefile b/trunk/arch/sparc/kernel/Makefile index b90b4a1d070a..9cff2709a96d 100644 --- a/trunk/arch/sparc/kernel/Makefile +++ b/trunk/arch/sparc/kernel/Makefile @@ -73,9 +73,7 @@ obj-$(CONFIG_SPARC64_SMP) += cpumap.o obj-y += dma.o -obj-$(CONFIG_PCIC_PCI) += pcic.o -obj-$(CONFIG_LEON_PCI) += leon_pci.o -obj-$(CONFIG_GRPCI2) += leon_pci_grpci2.o +obj-$(CONFIG_SPARC32_PCI) += pcic.o obj-$(CONFIG_SMP) += trampoline_$(BITS).o smp_$(BITS).o obj-$(CONFIG_SPARC32_SMP) += sun4m_smp.o sun4d_smp.o leon_smp.o diff --git a/trunk/arch/sparc/kernel/apc.c b/trunk/arch/sparc/kernel/apc.c index caef9deb5866..1e34f29e58bb 100644 --- a/trunk/arch/sparc/kernel/apc.c +++ b/trunk/arch/sparc/kernel/apc.c @@ -123,7 +123,7 @@ static long apc_ioctl(struct file *f, unsigned int cmd, unsigned long __arg) default: return -EINVAL; - } + }; return 0; } diff --git a/trunk/arch/sparc/kernel/auxio_32.c b/trunk/arch/sparc/kernel/auxio_32.c index acf5151f3c1d..8505e0ac78ba 100644 --- a/trunk/arch/sparc/kernel/auxio_32.c +++ b/trunk/arch/sparc/kernel/auxio_32.c @@ -101,7 +101,7 @@ void set_auxio(unsigned char bits_on, unsigned char bits_off) break; default: panic("Can't set AUXIO register on this machine."); - } + }; spin_unlock_irqrestore(&auxio_lock, flags); } EXPORT_SYMBOL(set_auxio); diff --git a/trunk/arch/sparc/kernel/chmc.c b/trunk/arch/sparc/kernel/chmc.c index 5f450260981d..668c7be5d365 100644 --- a/trunk/arch/sparc/kernel/chmc.c +++ b/trunk/arch/sparc/kernel/chmc.c @@ -664,7 +664,7 @@ static void chmc_interpret_one_decode_reg(struct chmc *p, int which_bank, u64 va case 0x0: bp->interleave = 16; break; - } + }; /* UK[10] is reserved, and UK[11] is not set for the SDRAM * bank size definition. diff --git a/trunk/arch/sparc/kernel/entry.S b/trunk/arch/sparc/kernel/entry.S index 9fe08a1ea6c6..8341963f4c84 100644 --- a/trunk/arch/sparc/kernel/entry.S +++ b/trunk/arch/sparc/kernel/entry.S @@ -229,7 +229,7 @@ real_irq_entry: #ifdef CONFIG_SMP .globl patchme_maybe_smp_msg - cmp %l7, 11 + cmp %l7, 12 patchme_maybe_smp_msg: bgu maybe_smp4m_msg nop @@ -293,7 +293,7 @@ maybe_smp4m_msg: WRITE_PAUSE wr %l4, PSR_ET, %psr WRITE_PAUSE - sll %o3, 28, %o2 ! shift for simpler checks below + sll %o2, 28, %o2 ! shift for simpler checks below maybe_smp4m_msg_check_single: andcc %o2, 0x1, %g0 beq,a maybe_smp4m_msg_check_mask @@ -1604,7 +1604,7 @@ restore_current: retl nop -#ifdef CONFIG_PCIC_PCI +#ifdef CONFIG_PCI #include .align 4 @@ -1650,7 +1650,7 @@ pcic_nmi_trap_patch: rd %psr, %l0 .word 0 -#endif /* CONFIG_PCIC_PCI */ +#endif /* CONFIG_PCI */ .globl flushw_all flushw_all: diff --git a/trunk/arch/sparc/kernel/leon_kernel.c b/trunk/arch/sparc/kernel/leon_kernel.c index d17255a2bbac..2f538ac2e139 100644 --- a/trunk/arch/sparc/kernel/leon_kernel.c +++ b/trunk/arch/sparc/kernel/leon_kernel.c @@ -236,21 +236,6 @@ static unsigned int _leon_build_device_irq(struct platform_device *op, return leon_build_device_irq(real_irq, handle_simple_irq, "edge", 0); } -void leon_update_virq_handling(unsigned int virq, - irq_flow_handler_t flow_handler, - const char *name, int do_ack) -{ - unsigned long mask = (unsigned long)irq_get_chip_data(virq); - - mask &= ~LEON_DO_ACK_HW; - if (do_ack) - mask |= LEON_DO_ACK_HW; - - irq_set_chip_and_handler_name(virq, &leon_irq, - flow_handler, name); - irq_set_chip_data(virq, (void *)mask); -} - void __init leon_init_timers(irq_handler_t counter_fn) { int irq, eirq; @@ -376,22 +361,6 @@ void __init leon_init_timers(irq_handler_t counter_fn) prom_halt(); } -#ifdef CONFIG_SMP - { - unsigned long flags; - - /* - * In SMP, sun4m adds a IPI handler to IRQ trap handler that - * LEON never must take, sun4d and LEON overwrites the branch - * with a NOP. - */ - local_irq_save(flags); - patchme_maybe_smp_msg[0] = 0x01000000; /* NOP out the branch */ - local_flush_cache_all(); - local_irq_restore(flags); - } -#endif - LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[leon3_gptimer_idx].ctrl, LEON3_GPTIMER_EN | LEON3_GPTIMER_RL | diff --git a/trunk/arch/sparc/kernel/leon_pci.c b/trunk/arch/sparc/kernel/leon_pci.c deleted file mode 100644 index a8a9a275037d..000000000000 --- a/trunk/arch/sparc/kernel/leon_pci.c +++ /dev/null @@ -1,253 +0,0 @@ -/* - * leon_pci.c: LEON Host PCI support - * - * Copyright (C) 2011 Aeroflex Gaisler AB, Daniel Hellstrom - * - * Code is partially derived from pcic.c - */ - -#include -#include -#include -#include -#include - -/* The LEON architecture does not rely on a BIOS or bootloader to setup - * PCI for us. The Linux generic routines are used to setup resources, - * reset values of confuration-space registers settings ae preseved. - */ -void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info) -{ - struct pci_bus *root_bus; - - root_bus = pci_scan_bus_parented(&ofdev->dev, 0, info->ops, info); - if (root_bus) { - root_bus->resource[0] = &info->io_space; - root_bus->resource[1] = &info->mem_space; - root_bus->resource[2] = NULL; - - /* Init all PCI devices into PCI tree */ - pci_bus_add_devices(root_bus); - - /* Setup IRQs of all devices using custom routines */ - pci_fixup_irqs(pci_common_swizzle, info->map_irq); - - /* Assign devices with resources */ - pci_assign_unassigned_resources(); - } -} - -/* PCI Memory and Prefetchable Memory is direct-mapped. However I/O Space is - * accessed through a Window which is translated to low 64KB in PCI space, the - * first 4KB is not used so 60KB is available. - * - * This function is used by generic code to translate resource addresses into - * PCI addresses. - */ -void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, - struct resource *res) -{ - struct leon_pci_info *info = dev->bus->sysdata; - - region->start = res->start; - region->end = res->end; - - if (res->flags & IORESOURCE_IO) { - region->start -= (info->io_space.start - 0x1000); - region->end -= (info->io_space.start - 0x1000); - } -} -EXPORT_SYMBOL(pcibios_resource_to_bus); - -/* see pcibios_resource_to_bus() comment */ -void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, - struct pci_bus_region *region) -{ - struct leon_pci_info *info = dev->bus->sysdata; - - res->start = region->start; - res->end = region->end; - - if (res->flags & IORESOURCE_IO) { - res->start += (info->io_space.start - 0x1000); - res->end += (info->io_space.start - 0x1000); - } -} -EXPORT_SYMBOL(pcibios_bus_to_resource); - -void __devinit pcibios_fixup_bus(struct pci_bus *pbus) -{ - struct leon_pci_info *info = pbus->sysdata; - struct pci_dev *dev; - int i, has_io, has_mem; - u16 cmd; - - /* Generic PCI bus probing sets these to point at - * &io{port,mem}_resouce which is wrong for us. - */ - if (pbus->self == NULL) { - pbus->resource[0] = &info->io_space; - pbus->resource[1] = &info->mem_space; - pbus->resource[2] = NULL; - } - - list_for_each_entry(dev, &pbus->devices, bus_list) { - /* - * We can not rely on that the bootloader has enabled I/O - * or memory access to PCI devices. Instead we enable it here - * if the device has BARs of respective type. - */ - has_io = has_mem = 0; - for (i = 0; i < PCI_ROM_RESOURCE; i++) { - unsigned long f = dev->resource[i].flags; - if (f & IORESOURCE_IO) - has_io = 1; - else if (f & IORESOURCE_MEM) - has_mem = 1; - } - /* ROM BARs are mapped into 32-bit memory space */ - if (dev->resource[PCI_ROM_RESOURCE].end != 0) { - dev->resource[PCI_ROM_RESOURCE].flags |= - IORESOURCE_ROM_ENABLE; - has_mem = 1; - } - pci_bus_read_config_word(pbus, dev->devfn, PCI_COMMAND, &cmd); - if (has_io && !(cmd & PCI_COMMAND_IO)) { -#ifdef CONFIG_PCI_DEBUG - printk(KERN_INFO "LEONPCI: Enabling I/O for dev %s\n", - pci_name(dev)); -#endif - cmd |= PCI_COMMAND_IO; - pci_bus_write_config_word(pbus, dev->devfn, PCI_COMMAND, - cmd); - } - if (has_mem && !(cmd & PCI_COMMAND_MEMORY)) { -#ifdef CONFIG_PCI_DEBUG - printk(KERN_INFO "LEONPCI: Enabling MEMORY for dev" - "%s\n", pci_name(dev)); -#endif - cmd |= PCI_COMMAND_MEMORY; - pci_bus_write_config_word(pbus, dev->devfn, PCI_COMMAND, - cmd); - } - } -} - -/* - * Other archs parse arguments here. - */ -char * __devinit pcibios_setup(char *str) -{ - return str; -} - -resource_size_t pcibios_align_resource(void *data, const struct resource *res, - resource_size_t size, resource_size_t align) -{ - return res->start; -} - -int pcibios_enable_device(struct pci_dev *dev, int mask) -{ - return pci_enable_resources(dev, mask); -} - -struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) -{ - /* - * Currently the OpenBoot nodes are not connected with the PCI device, - * this is because the LEON PROM does not create PCI nodes. Eventually - * this will change and the same approach as pcic.c can be used to - * match PROM nodes with pci devices. - */ - return NULL; -} -EXPORT_SYMBOL(pci_device_to_OF_node); - -void __devinit pcibios_update_irq(struct pci_dev *dev, int irq) -{ -#ifdef CONFIG_PCI_DEBUG - printk(KERN_DEBUG "LEONPCI: Assigning IRQ %02d to %s\n", irq, - pci_name(dev)); -#endif - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); -} - -/* in/out routines taken from pcic.c - * - * This probably belongs here rather than ioport.c because - * we do not want this crud linked into SBus kernels. - * Also, think for a moment about likes of floppy.c that - * include architecture specific parts. They may want to redefine ins/outs. - * - * We do not use horrible macros here because we want to - * advance pointer by sizeof(size). - */ -void outsb(unsigned long addr, const void *src, unsigned long count) -{ - while (count) { - count -= 1; - outb(*(const char *)src, addr); - src += 1; - /* addr += 1; */ - } -} -EXPORT_SYMBOL(outsb); - -void outsw(unsigned long addr, const void *src, unsigned long count) -{ - while (count) { - count -= 2; - outw(*(const short *)src, addr); - src += 2; - /* addr += 2; */ - } -} -EXPORT_SYMBOL(outsw); - -void outsl(unsigned long addr, const void *src, unsigned long count) -{ - while (count) { - count -= 4; - outl(*(const long *)src, addr); - src += 4; - /* addr += 4; */ - } -} -EXPORT_SYMBOL(outsl); - -void insb(unsigned long addr, void *dst, unsigned long count) -{ - while (count) { - count -= 1; - *(unsigned char *)dst = inb(addr); - dst += 1; - /* addr += 1; */ - } -} -EXPORT_SYMBOL(insb); - -void insw(unsigned long addr, void *dst, unsigned long count) -{ - while (count) { - count -= 2; - *(unsigned short *)dst = inw(addr); - dst += 2; - /* addr += 2; */ - } -} -EXPORT_SYMBOL(insw); - -void insl(unsigned long addr, void *dst, unsigned long count) -{ - while (count) { - count -= 4; - /* - * XXX I am sure we are in for an unaligned trap here. - */ - *(unsigned long *)dst = inl(addr); - dst += 4; - /* addr += 4; */ - } -} -EXPORT_SYMBOL(insl); diff --git a/trunk/arch/sparc/kernel/leon_pci_grpci2.c b/trunk/arch/sparc/kernel/leon_pci_grpci2.c deleted file mode 100644 index 44dc093ee33a..000000000000 --- a/trunk/arch/sparc/kernel/leon_pci_grpci2.c +++ /dev/null @@ -1,897 +0,0 @@ -/* - * leon_pci_grpci2.c: GRPCI2 Host PCI driver - * - * Copyright (C) 2011 Aeroflex Gaisler AB, Daniel Hellstrom - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "irq.h" - -struct grpci2_barcfg { - unsigned long pciadr; /* PCI Space Address */ - unsigned long ahbadr; /* PCI Base address mapped to this AHB addr */ -}; - -/* Device Node Configuration options: - * - barcfgs : Custom Configuration of Host's 6 target BARs - * - irq_mask : Limit which PCI interrupts are enabled - * - do_reset : Force PCI Reset on startup - * - * barcfgs - * ======= - * - * Optional custom Target BAR configuration (see struct grpci2_barcfg). All - * addresses are physical. Array always contains 6 elements (len=2*4*6 bytes) - * - * -1 means not configured (let host driver do default setup). - * - * [i*2+0] = PCI Address of BAR[i] on target interface - * [i*2+1] = Accessing PCI address of BAR[i] result in this AMBA address - * - * - * irq_mask - * ======== - * - * Limit which PCI interrupts are enabled. 0=Disable, 1=Enable. By default - * all are enabled. Use this when PCI interrupt pins are floating on PCB. - * int, len=4. - * bit0 = PCI INTA# - * bit1 = PCI INTB# - * bit2 = PCI INTC# - * bit3 = PCI INTD# - * - * - * reset - * ===== - * - * Force PCI reset on startup. int, len=4 - */ - -/* Enable Debugging Configuration Space Access */ -#undef GRPCI2_DEBUG_CFGACCESS - -/* - * GRPCI2 APB Register MAP - */ -struct grpci2_regs { - unsigned int ctrl; /* 0x00 Control */ - unsigned int sts_cap; /* 0x04 Status / Capabilities */ - int res1; /* 0x08 */ - unsigned int io_map; /* 0x0C I/O Map address */ - unsigned int dma_ctrl; /* 0x10 DMA */ - unsigned int dma_bdbase; /* 0x14 DMA */ - int res2[2]; /* 0x18 */ - unsigned int bars[6]; /* 0x20 read-only PCI BARs */ - int res3[2]; /* 0x38 */ - unsigned int ahbmst_map[16]; /* 0x40 AHB->PCI Map per AHB Master */ - - /* PCI Trace Buffer Registers (OPTIONAL) */ - unsigned int t_ctrl; /* 0x80 */ - unsigned int t_cnt; /* 0x84 */ - unsigned int t_adpat; /* 0x88 */ - unsigned int t_admask; /* 0x8C */ - unsigned int t_sigpat; /* 0x90 */ - unsigned int t_sigmask; /* 0x94 */ - unsigned int t_adstate; /* 0x98 */ - unsigned int t_sigstate; /* 0x9C */ -}; - -#define REGLOAD(a) (be32_to_cpu(__raw_readl(&(a)))) -#define REGSTORE(a, v) (__raw_writel(cpu_to_be32(v), &(a))) - -#define CTRL_BUS_BIT 16 - -#define CTRL_RESET (1<<31) -#define CTRL_SI (1<<27) -#define CTRL_PE (1<<26) -#define CTRL_EI (1<<25) -#define CTRL_ER (1<<24) -#define CTRL_BUS (0xff<bus->sysdata; - int irq_group; - - /* Use default IRQ decoding on PCI BUS0 according slot numbering */ - irq_group = slot & 0x3; - pin = ((pin - 1) + irq_group) & 0x3; - - return priv->irq_map[pin]; -} - -static int grpci2_cfg_r32(struct grpci2_priv *priv, unsigned int bus, - unsigned int devfn, int where, u32 *val) -{ - unsigned int *pci_conf; - unsigned long flags; - u32 tmp; - - if (where & 0x3) - return -EINVAL; - - if (bus == 0 && PCI_SLOT(devfn) != 0) - devfn += (0x8 * 6); - - /* Select bus */ - spin_lock_irqsave(&grpci2_dev_lock, flags); - REGSTORE(priv->regs->ctrl, (REGLOAD(priv->regs->ctrl) & ~(0xff << 16)) | - (bus << 16)); - spin_unlock_irqrestore(&grpci2_dev_lock, flags); - - /* clear old status */ - REGSTORE(priv->regs->sts_cap, (STS_CFGERR | STS_CFGERRVALID)); - - pci_conf = (unsigned int *) (priv->pci_conf | - (devfn << 8) | (where & 0xfc)); - tmp = LEON3_BYPASS_LOAD_PA(pci_conf); - - /* Wait until GRPCI2 signals that CFG access is done, it should be - * done instantaneously unless a DMA operation is ongoing... - */ - while ((REGLOAD(priv->regs->sts_cap) & STS_CFGERRVALID) == 0) - ; - - if (REGLOAD(priv->regs->sts_cap) & STS_CFGERR) { - *val = 0xffffffff; - } else { - /* Bus always little endian (unaffected by byte-swapping) */ - *val = flip_dword(tmp); - } - - return 0; -} - -static int grpci2_cfg_r16(struct grpci2_priv *priv, unsigned int bus, - unsigned int devfn, int where, u32 *val) -{ - u32 v; - int ret; - - if (where & 0x1) - return -EINVAL; - ret = grpci2_cfg_r32(priv, bus, devfn, where & ~0x3, &v); - *val = 0xffff & (v >> (8 * (where & 0x3))); - return ret; -} - -static int grpci2_cfg_r8(struct grpci2_priv *priv, unsigned int bus, - unsigned int devfn, int where, u32 *val) -{ - u32 v; - int ret; - - ret = grpci2_cfg_r32(priv, bus, devfn, where & ~0x3, &v); - *val = 0xff & (v >> (8 * (where & 3))); - - return ret; -} - -static int grpci2_cfg_w32(struct grpci2_priv *priv, unsigned int bus, - unsigned int devfn, int where, u32 val) -{ - unsigned int *pci_conf; - unsigned long flags; - - if (where & 0x3) - return -EINVAL; - - if (bus == 0 && PCI_SLOT(devfn) != 0) - devfn += (0x8 * 6); - - /* Select bus */ - spin_lock_irqsave(&grpci2_dev_lock, flags); - REGSTORE(priv->regs->ctrl, (REGLOAD(priv->regs->ctrl) & ~(0xff << 16)) | - (bus << 16)); - spin_unlock_irqrestore(&grpci2_dev_lock, flags); - - /* clear old status */ - REGSTORE(priv->regs->sts_cap, (STS_CFGERR | STS_CFGERRVALID)); - - pci_conf = (unsigned int *) (priv->pci_conf | - (devfn << 8) | (where & 0xfc)); - LEON3_BYPASS_STORE_PA(pci_conf, flip_dword(val)); - - /* Wait until GRPCI2 signals that CFG access is done, it should be - * done instantaneously unless a DMA operation is ongoing... - */ - while ((REGLOAD(priv->regs->sts_cap) & STS_CFGERRVALID) == 0) - ; - - return 0; -} - -static int grpci2_cfg_w16(struct grpci2_priv *priv, unsigned int bus, - unsigned int devfn, int where, u32 val) -{ - int ret; - u32 v; - - if (where & 0x1) - return -EINVAL; - ret = grpci2_cfg_r32(priv, bus, devfn, where&~3, &v); - if (ret) - return ret; - v = (v & ~(0xffff << (8 * (where & 0x3)))) | - ((0xffff & val) << (8 * (where & 0x3))); - return grpci2_cfg_w32(priv, bus, devfn, where & ~0x3, v); -} - -static int grpci2_cfg_w8(struct grpci2_priv *priv, unsigned int bus, - unsigned int devfn, int where, u32 val) -{ - int ret; - u32 v; - - ret = grpci2_cfg_r32(priv, bus, devfn, where & ~0x3, &v); - if (ret != 0) - return ret; - v = (v & ~(0xff << (8 * (where & 0x3)))) | - ((0xff & val) << (8 * (where & 0x3))); - return grpci2_cfg_w32(priv, bus, devfn, where & ~0x3, v); -} - -/* Read from Configuration Space. When entering here the PCI layer has taken - * the pci_lock spinlock and IRQ is off. - */ -static int grpci2_read_config(struct pci_bus *bus, unsigned int devfn, - int where, int size, u32 *val) -{ - struct grpci2_priv *priv = grpci2priv; - unsigned int busno = bus->number; - int ret; - - if (PCI_SLOT(devfn) > 15 || (PCI_SLOT(devfn) == 0 && busno == 0)) { - *val = ~0; - return 0; - } - - switch (size) { - case 1: - ret = grpci2_cfg_r8(priv, busno, devfn, where, val); - break; - case 2: - ret = grpci2_cfg_r16(priv, busno, devfn, where, val); - break; - case 4: - ret = grpci2_cfg_r32(priv, busno, devfn, where, val); - break; - default: - ret = -EINVAL; - break; - } - -#ifdef GRPCI2_DEBUG_CFGACCESS - printk(KERN_INFO "grpci2_read_config: [%02x:%02x:%x] ofs=%d val=%x " - "size=%d\n", busno, PCI_SLOT(devfn), PCI_FUNC(devfn), where, - *val, size); -#endif - - return ret; -} - -/* Write to Configuration Space. When entering here the PCI layer has taken - * the pci_lock spinlock and IRQ is off. - */ -static int grpci2_write_config(struct pci_bus *bus, unsigned int devfn, - int where, int size, u32 val) -{ - struct grpci2_priv *priv = grpci2priv; - unsigned int busno = bus->number; - - if (PCI_SLOT(devfn) > 15 || (PCI_SLOT(devfn) == 0 && busno == 0)) - return 0; - -#ifdef GRPCI2_DEBUG_CFGACCESS - printk(KERN_INFO "grpci2_write_config: [%02x:%02x:%x] ofs=%d size=%d " - "val=%x\n", busno, PCI_SLOT(devfn), PCI_FUNC(devfn), - where, size, val); -#endif - - switch (size) { - default: - return -EINVAL; - case 1: - return grpci2_cfg_w8(priv, busno, devfn, where, val); - case 2: - return grpci2_cfg_w16(priv, busno, devfn, where, val); - case 4: - return grpci2_cfg_w32(priv, busno, devfn, where, val); - } -} - -static struct pci_ops grpci2_ops = { - .read = grpci2_read_config, - .write = grpci2_write_config, -}; - -/* GENIRQ IRQ chip implementation for GRPCI2 irqmode=0..2. In configuration - * 3 where all PCI Interrupts has a separate IRQ on the system IRQ controller - * this is not needed and the standard IRQ controller can be used. - */ - -static void grpci2_mask_irq(struct irq_data *data) -{ - unsigned long flags; - unsigned int irqidx; - struct grpci2_priv *priv = grpci2priv; - - irqidx = (unsigned int)data->chip_data - 1; - if (irqidx > 3) /* only mask PCI interrupts here */ - return; - - spin_lock_irqsave(&grpci2_dev_lock, flags); - REGSTORE(priv->regs->ctrl, REGLOAD(priv->regs->ctrl) & ~(1 << irqidx)); - spin_unlock_irqrestore(&grpci2_dev_lock, flags); -} - -static void grpci2_unmask_irq(struct irq_data *data) -{ - unsigned long flags; - unsigned int irqidx; - struct grpci2_priv *priv = grpci2priv; - - irqidx = (unsigned int)data->chip_data - 1; - if (irqidx > 3) /* only unmask PCI interrupts here */ - return; - - spin_lock_irqsave(&grpci2_dev_lock, flags); - REGSTORE(priv->regs->ctrl, REGLOAD(priv->regs->ctrl) | (1 << irqidx)); - spin_unlock_irqrestore(&grpci2_dev_lock, flags); -} - -static unsigned int grpci2_startup_irq(struct irq_data *data) -{ - grpci2_unmask_irq(data); - return 0; -} - -static void grpci2_shutdown_irq(struct irq_data *data) -{ - grpci2_mask_irq(data); -} - -static struct irq_chip grpci2_irq = { - .name = "grpci2", - .irq_startup = grpci2_startup_irq, - .irq_shutdown = grpci2_shutdown_irq, - .irq_mask = grpci2_mask_irq, - .irq_unmask = grpci2_unmask_irq, -}; - -/* Handle one or multiple IRQs from the PCI core */ -static void grpci2_pci_flow_irq(unsigned int irq, struct irq_desc *desc) -{ - struct grpci2_priv *priv = grpci2priv; - int i, ack = 0; - unsigned int ctrl, sts_cap, pci_ints; - - ctrl = REGLOAD(priv->regs->ctrl); - sts_cap = REGLOAD(priv->regs->sts_cap); - - /* Error Interrupt? */ - if (sts_cap & STS_ERR_IRQ) { - generic_handle_irq(priv->virq_err); - ack = 1; - } - - /* PCI Interrupt? */ - pci_ints = ((~sts_cap) >> STS_INTSTS_BIT) & ctrl & CTRL_HOSTINT; - if (pci_ints) { - /* Call respective PCI Interrupt handler */ - for (i = 0; i < 4; i++) { - if (pci_ints & (1 << i)) - generic_handle_irq(priv->irq_map[i]); - } - ack = 1; - } - - /* - * Decode DMA Interrupt only when shared with Err and PCI INTX#, when - * the DMA is a unique IRQ the DMA interrupts doesn't end up here, they - * goes directly to DMA ISR. - */ - if ((priv->irq_mode == 0) && (sts_cap & (STS_IDMA | STS_IDMAERR))) { - generic_handle_irq(priv->virq_dma); - ack = 1; - } - - /* - * Call "first level" IRQ chip end-of-irq handler. It will ACK LEON IRQ - * Controller, this must be done after IRQ sources have been handled to - * avoid double IRQ generation - */ - if (ack) - desc->irq_data.chip->irq_eoi(&desc->irq_data); -} - -/* Create a virtual IRQ */ -static unsigned int grpci2_build_device_irq(unsigned int irq) -{ - unsigned int virq = 0, pil; - - pil = 1 << 8; - virq = irq_alloc(irq, pil); - if (virq == 0) - goto out; - - irq_set_chip_and_handler_name(virq, &grpci2_irq, handle_simple_irq, - "pcilvl"); - irq_set_chip_data(virq, (void *)irq); - -out: - return virq; -} - -void grpci2_hw_init(struct grpci2_priv *priv) -{ - u32 ahbadr, pciadr, bar_sz, capptr, io_map, data; - struct grpci2_regs *regs = priv->regs; - int i; - struct grpci2_barcfg *barcfg = priv->tgtbars; - - /* Reset any earlier setup */ - if (priv->do_reset) { - printk(KERN_INFO "GRPCI2: Resetting PCI bus\n"); - REGSTORE(regs->ctrl, CTRL_RESET); - ssleep(1); /* Wait for boards to settle */ - } - REGSTORE(regs->ctrl, 0); - REGSTORE(regs->sts_cap, ~0); /* Clear Status */ - REGSTORE(regs->dma_ctrl, 0); - REGSTORE(regs->dma_bdbase, 0); - - /* Translate I/O accesses to 0, I/O Space always @ PCI low 64Kbytes */ - REGSTORE(regs->io_map, REGLOAD(regs->io_map) & 0x0000ffff); - - /* set 1:1 mapping between AHB -> PCI memory space, for all Masters - * Each AHB master has it's own mapping registers. Max 16 AHB masters. - */ - for (i = 0; i < 16; i++) - REGSTORE(regs->ahbmst_map[i], priv->pci_area); - - /* Get the GRPCI2 Host PCI ID */ - grpci2_cfg_r32(priv, 0, 0, PCI_VENDOR_ID, &priv->pciid); - - /* Get address to first (always defined) capability structure */ - grpci2_cfg_r8(priv, 0, 0, PCI_CAPABILITY_LIST, &capptr); - - /* Enable/Disable Byte twisting */ - grpci2_cfg_r32(priv, 0, 0, capptr+CAP9_IOMAP_OFS, &io_map); - io_map = (io_map & ~0x1) | (priv->bt_enabled ? 1 : 0); - grpci2_cfg_w32(priv, 0, 0, capptr+CAP9_IOMAP_OFS, io_map); - - /* Setup the Host's PCI Target BARs for other peripherals to access, - * and do DMA to the host's memory. The target BARs can be sized and - * enabled individually. - * - * User may set custom target BARs, but default is: - * The first BARs is used to map kernel low (DMA is part of normal - * region on sparc which is SRMMU_MAXMEM big) main memory 1:1 to the - * PCI bus, the other BARs are disabled. We assume that the first BAR - * is always available. - */ - for (i = 0; i < 6; i++) { - if (barcfg[i].pciadr != ~0 && barcfg[i].ahbadr != ~0) { - /* Target BARs must have the proper alignment */ - ahbadr = barcfg[i].ahbadr; - pciadr = barcfg[i].pciadr; - bar_sz = ((pciadr - 1) & ~pciadr) + 1; - } else { - if (i == 0) { - /* Map main memory */ - bar_sz = 0xf0000008; /* 256MB prefetchable */ - ahbadr = 0xf0000000 & (u32)__pa(PAGE_ALIGN( - (unsigned long) &_end)); - pciadr = ahbadr; - } else { - bar_sz = 0; - ahbadr = 0; - pciadr = 0; - } - } - grpci2_cfg_w32(priv, 0, 0, capptr+CAP9_BARSIZE_OFS+i*4, bar_sz); - grpci2_cfg_w32(priv, 0, 0, PCI_BASE_ADDRESS_0+i*4, pciadr); - grpci2_cfg_w32(priv, 0, 0, capptr+CAP9_BAR_OFS+i*4, ahbadr); - printk(KERN_INFO " TGT BAR[%d]: 0x%08x (PCI)-> 0x%08x\n", - i, pciadr, ahbadr); - } - - /* set as bus master and enable pci memory responses */ - grpci2_cfg_r32(priv, 0, 0, PCI_COMMAND, &data); - data |= (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); - grpci2_cfg_w32(priv, 0, 0, PCI_COMMAND, data); - - /* Enable Error respone (CPU-TRAP) on illegal memory access. */ - REGSTORE(regs->ctrl, CTRL_ER | CTRL_PE); -} - -static irqreturn_t grpci2_jump_interrupt(int irq, void *arg) -{ - printk(KERN_ERR "GRPCI2: Jump IRQ happened\n"); - return IRQ_NONE; -} - -/* Handle GRPCI2 Error Interrupt */ -static irqreturn_t grpci2_err_interrupt(int irq, void *arg) -{ - struct grpci2_priv *priv = arg; - struct grpci2_regs *regs = priv->regs; - unsigned int status; - - status = REGLOAD(regs->sts_cap); - if ((status & STS_ERR_IRQ) == 0) - return IRQ_NONE; - - if (status & STS_IPARERR) - printk(KERN_ERR "GRPCI2: Parity Error\n"); - - if (status & STS_ITGTABRT) - printk(KERN_ERR "GRPCI2: Target Abort\n"); - - if (status & STS_IMSTABRT) - printk(KERN_ERR "GRPCI2: Master Abort\n"); - - if (status & STS_ISYSERR) - printk(KERN_ERR "GRPCI2: System Error\n"); - - /* Clear handled INT TYPE IRQs */ - REGSTORE(regs->sts_cap, status & STS_ERR_IRQ); - - return IRQ_HANDLED; -} - -static int __devinit grpci2_of_probe(struct platform_device *ofdev) -{ - struct grpci2_regs *regs; - struct grpci2_priv *priv; - int err, i, len; - const int *tmp; - unsigned int capability; - - if (grpci2priv) { - printk(KERN_ERR "GRPCI2: only one GRPCI2 core supported\n"); - return -ENODEV; - } - - if (ofdev->num_resources < 3) { - printk(KERN_ERR "GRPCI2: not enough APB/AHB resources\n"); - return -EIO; - } - - /* Find Device Address */ - regs = of_ioremap(&ofdev->resource[0], 0, - resource_size(&ofdev->resource[0]), - "grlib-grpci2 regs"); - if (regs == NULL) { - printk(KERN_ERR "GRPCI2: ioremap failed\n"); - return -EIO; - } - - /* - * Check that we're in Host Slot and that we can act as a Host Bridge - * and not only as target. - */ - capability = REGLOAD(regs->sts_cap); - if ((capability & STS_HOST) || !(capability & STS_MST)) { - printk(KERN_INFO "GRPCI2: not in host system slot\n"); - err = -EIO; - goto err1; - } - - priv = grpci2priv = kzalloc(sizeof(struct grpci2_priv), GFP_KERNEL); - if (grpci2priv == NULL) { - err = -ENOMEM; - goto err1; - } - memset(grpci2priv, 0, sizeof(*grpci2priv)); - priv->regs = regs; - priv->irq = ofdev->archdata.irqs[0]; /* BASE IRQ */ - priv->irq_mode = (capability & STS_IRQMODE) >> STS_IRQMODE_BIT; - - printk(KERN_INFO "GRPCI2: host found at %p, irq%d\n", regs, priv->irq); - - /* Byte twisting should be made configurable from kernel command line */ - priv->bt_enabled = 1; - - /* Let user do custom Target BAR assignment */ - tmp = of_get_property(ofdev->dev.of_node, "barcfg", &len); - if (tmp && (len == 2*4*6)) - memcpy(priv->tgtbars, tmp, 2*4*6); - else - memset(priv->tgtbars, -1, 2*4*6); - - /* Limit IRQ unmasking in irq_mode 2 and 3 */ - tmp = of_get_property(ofdev->dev.of_node, "irq_mask", &len); - if (tmp && (len == 4)) - priv->do_reset = *tmp; - else - priv->irq_mask = 0xf; - - /* Optional PCI reset. Force PCI reset on startup */ - tmp = of_get_property(ofdev->dev.of_node, "reset", &len); - if (tmp && (len == 4)) - priv->do_reset = *tmp; - else - priv->do_reset = 0; - - /* Find PCI Memory, I/O and Configuration Space Windows */ - priv->pci_area = ofdev->resource[1].start; - priv->pci_area_end = ofdev->resource[1].end+1; - priv->pci_io = ofdev->resource[2].start; - priv->pci_conf = ofdev->resource[2].start + 0x10000; - priv->pci_conf_end = priv->pci_conf + 0x10000; - priv->pci_io_va = (unsigned long)ioremap(priv->pci_io, 0x10000); - if (!priv->pci_io_va) { - err = -EIO; - goto err2; - } - - printk(KERN_INFO - "GRPCI2: MEMORY SPACE [0x%08lx - 0x%08lx]\n" - " I/O SPACE [0x%08lx - 0x%08lx]\n" - " CONFIG SPACE [0x%08lx - 0x%08lx]\n", - priv->pci_area, priv->pci_area_end-1, - priv->pci_io, priv->pci_conf-1, - priv->pci_conf, priv->pci_conf_end-1); - - /* - * I/O Space resources in I/O Window mapped into Virtual Adr Space - * We never use low 4KB because some devices seem have problems using - * address 0. - */ - memset(&priv->info.io_space, 0, sizeof(struct resource)); - priv->info.io_space.name = "GRPCI2 PCI I/O Space"; - priv->info.io_space.start = priv->pci_io_va + 0x1000; - priv->info.io_space.end = priv->pci_io_va + 0x10000 - 1; - priv->info.io_space.flags = IORESOURCE_IO; - - /* - * GRPCI2 has no prefetchable memory, map everything as - * non-prefetchable memory - */ - memset(&priv->info.mem_space, 0, sizeof(struct resource)); - priv->info.mem_space.name = "GRPCI2 PCI MEM Space"; - priv->info.mem_space.start = priv->pci_area; - priv->info.mem_space.end = priv->pci_area_end - 1; - priv->info.mem_space.flags = IORESOURCE_MEM; - - if (request_resource(&iomem_resource, &priv->info.mem_space) < 0) - goto err3; - if (request_resource(&ioport_resource, &priv->info.io_space) < 0) - goto err4; - - grpci2_hw_init(priv); - - /* - * Get PCI Interrupt to System IRQ mapping and setup IRQ handling - * Error IRQ always on PCI INTA. - */ - if (priv->irq_mode < 2) { - /* All PCI interrupts are shared using the same system IRQ */ - leon_update_virq_handling(priv->irq, grpci2_pci_flow_irq, - "pcilvl", 0); - - priv->irq_map[0] = grpci2_build_device_irq(1); - priv->irq_map[1] = grpci2_build_device_irq(2); - priv->irq_map[2] = grpci2_build_device_irq(3); - priv->irq_map[3] = grpci2_build_device_irq(4); - - priv->virq_err = grpci2_build_device_irq(5); - if (priv->irq_mode & 1) - priv->virq_dma = ofdev->archdata.irqs[1]; - else - priv->virq_dma = grpci2_build_device_irq(6); - - /* Enable IRQs on LEON IRQ controller */ - err = request_irq(priv->irq, grpci2_jump_interrupt, 0, - "GRPCI2_JUMP", priv); - if (err) - printk(KERN_ERR "GRPCI2: ERR IRQ request failed\n"); - } else { - /* All PCI interrupts have an unique IRQ interrupt */ - for (i = 0; i < 4; i++) { - /* Make LEON IRQ layer handle level IRQ by acking */ - leon_update_virq_handling(ofdev->archdata.irqs[i], - handle_fasteoi_irq, "pcilvl", - 1); - priv->irq_map[i] = ofdev->archdata.irqs[i]; - } - priv->virq_err = priv->irq_map[0]; - if (priv->irq_mode & 1) - priv->virq_dma = ofdev->archdata.irqs[4]; - else - priv->virq_dma = priv->irq_map[0]; - - /* Unmask all PCI interrupts, request_irq will not do that */ - REGSTORE(regs->ctrl, REGLOAD(regs->ctrl)|(priv->irq_mask&0xf)); - } - - /* Setup IRQ handler for non-configuration space access errors */ - err = request_irq(priv->virq_err, grpci2_err_interrupt, IRQF_SHARED, - "GRPCI2_ERR", priv); - if (err) { - printk(KERN_DEBUG "GRPCI2: ERR VIRQ request failed: %d\n", err); - goto err5; - } - - /* - * Enable Error Interrupts. PCI interrupts are unmasked once request_irq - * is called by the PCI Device drivers - */ - REGSTORE(regs->ctrl, REGLOAD(regs->ctrl) | CTRL_EI | CTRL_SI); - - /* Init common layer and scan buses */ - priv->info.ops = &grpci2_ops; - priv->info.map_irq = grpci2_map_irq; - leon_pci_init(ofdev, &priv->info); - - return 0; - -err5: - release_resource(&priv->info.io_space); -err4: - release_resource(&priv->info.mem_space); -err3: - err = -ENOMEM; - iounmap((void *)priv->pci_io_va); -err2: - kfree(priv); -err1: - of_iounmap(&ofdev->resource[0], regs, - resource_size(&ofdev->resource[0])); - return err; -} - -static struct of_device_id grpci2_of_match[] = { - { - .name = "GAISLER_GRPCI2", - }, - { - .name = "01_07c", - }, - {}, -}; - -static struct platform_driver grpci2_of_driver = { - .driver = { - .name = "grpci2", - .owner = THIS_MODULE, - .of_match_table = grpci2_of_match, - }, - .probe = grpci2_of_probe, -}; - -static int __init grpci2_init(void) -{ - return platform_driver_register(&grpci2_of_driver); -} - -subsys_initcall(grpci2_init); diff --git a/trunk/arch/sparc/kernel/module.c b/trunk/arch/sparc/kernel/module.c index 99ba5baa9497..8d348c474a2f 100644 --- a/trunk/arch/sparc/kernel/module.c +++ b/trunk/arch/sparc/kernel/module.c @@ -214,7 +214,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, me->name, (int) (ELF_R_TYPE(rel[i].r_info) & 0xff)); return -ENOEXEC; - } + }; } return 0; } diff --git a/trunk/arch/sparc/kernel/pci_common.c b/trunk/arch/sparc/kernel/pci_common.c index a6895987fb70..6e3874b64488 100644 --- a/trunk/arch/sparc/kernel/pci_common.c +++ b/trunk/arch/sparc/kernel/pci_common.c @@ -281,7 +281,7 @@ static int sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, case 4: *value = ret & 0xffffffff; break; - } + }; return PCIBIOS_SUCCESSFUL; @@ -456,7 +456,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm) default: break; - } + }; } if (!saw_io || !saw_mem) { diff --git a/trunk/arch/sparc/kernel/pci_schizo.c b/trunk/arch/sparc/kernel/pci_schizo.c index f030b02edddd..283fbc329a43 100644 --- a/trunk/arch/sparc/kernel/pci_schizo.c +++ b/trunk/arch/sparc/kernel/pci_schizo.c @@ -264,7 +264,7 @@ static void schizo_check_iommu_error_pbm(struct pci_pbm_info *pbm, default: type_string = "ECC Error"; break; - } + }; printk("%s: IOMMU Error, type[%s]\n", pbm->name, type_string); @@ -319,7 +319,7 @@ static void schizo_check_iommu_error_pbm(struct pci_pbm_info *pbm, default: type_string = "ECC Error"; break; - } + }; printk("%s: IOMMU TAG(%d)[error(%s) ctx(%x) wr(%d) str(%d) " "sz(%dK) vpg(%08lx)]\n", pbm->name, i, type_string, @@ -1328,7 +1328,7 @@ static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm, default: chipset_name = "SCHIZO"; break; - } + }; /* For SCHIZO, three OBP regs: * 1) PBM controller regs diff --git a/trunk/arch/sparc/kernel/prom_irqtrans.c b/trunk/arch/sparc/kernel/prom_irqtrans.c index 40e4936bd479..570b98f6e897 100644 --- a/trunk/arch/sparc/kernel/prom_irqtrans.c +++ b/trunk/arch/sparc/kernel/prom_irqtrans.c @@ -694,7 +694,7 @@ static unsigned int sbus_of_build_irq(struct device_node *dp, case 3: iclr = reg_base + SYSIO_ICLR_SLOT3; break; - } + }; iclr += ((unsigned long)sbus_level - 1UL) * 8UL; } diff --git a/trunk/arch/sparc/kernel/psycho_common.c b/trunk/arch/sparc/kernel/psycho_common.c index 8db48e808ed4..fe2af66bb198 100644 --- a/trunk/arch/sparc/kernel/psycho_common.c +++ b/trunk/arch/sparc/kernel/psycho_common.c @@ -228,7 +228,7 @@ void psycho_check_iommu_error(struct pci_pbm_info *pbm, default: type_str = "ECC Error"; break; - } + }; printk(KERN_ERR "%s: IOMMU Error, type[%s]\n", pbm->name, type_str); diff --git a/trunk/arch/sparc/kernel/sbus.c b/trunk/arch/sparc/kernel/sbus.c index a161b9c77f05..2ca32d13abcf 100644 --- a/trunk/arch/sparc/kernel/sbus.c +++ b/trunk/arch/sparc/kernel/sbus.c @@ -97,7 +97,7 @@ void sbus_set_sbus64(struct device *dev, int bursts) default: return; - } + }; val = upa_readq(cfg_reg); if (val & (1UL << 14UL)) { @@ -244,7 +244,7 @@ static unsigned int sbus_build_irq(struct platform_device *op, unsigned int ino) case 3: iclr = reg_base + SYSIO_ICLR_SLOT3; break; - } + }; iclr += ((unsigned long)sbus_level - 1UL) * 8UL; } diff --git a/trunk/arch/sparc/kernel/setup_32.c b/trunk/arch/sparc/kernel/setup_32.c index d26e1f6c717a..3249d3f3234d 100644 --- a/trunk/arch/sparc/kernel/setup_32.c +++ b/trunk/arch/sparc/kernel/setup_32.c @@ -267,7 +267,7 @@ void __init setup_arch(char **cmdline_p) default: printk("UNKNOWN!\n"); break; - } + }; #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; diff --git a/trunk/arch/sparc/kernel/setup_64.c b/trunk/arch/sparc/kernel/setup_64.c index c4dd0999da86..f3b6850cc8db 100644 --- a/trunk/arch/sparc/kernel/setup_64.c +++ b/trunk/arch/sparc/kernel/setup_64.c @@ -209,7 +209,7 @@ void __init per_cpu_patch(void) default: prom_printf("Unknown cpu type, halting.\n"); prom_halt(); - } + }; *(unsigned int *) (addr + 0) = insns[0]; wmb(); diff --git a/trunk/arch/sparc/kernel/smp_32.c b/trunk/arch/sparc/kernel/smp_32.c index 21b125341bf7..d5b3958be0b4 100644 --- a/trunk/arch/sparc/kernel/smp_32.c +++ b/trunk/arch/sparc/kernel/smp_32.c @@ -114,7 +114,7 @@ void __init smp_cpus_done(unsigned int max_cpus) printk("UNKNOWN!\n"); BUG(); break; - } + }; } void cpu_panic(void) @@ -374,7 +374,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) printk("UNKNOWN!\n"); BUG(); break; - } + }; } /* Set this up early so that things like the scheduler can init @@ -447,7 +447,7 @@ int __cpuinit __cpu_up(unsigned int cpu) printk("UNKNOWN!\n"); BUG(); break; - } + }; if (!ret) { cpumask_set_cpu(cpu, &smp_commenced_mask); diff --git a/trunk/arch/sparc/kernel/sun4d_irq.c b/trunk/arch/sparc/kernel/sun4d_irq.c index 1d13c5bda0b1..a9ea60eb2c10 100644 --- a/trunk/arch/sparc/kernel/sun4d_irq.c +++ b/trunk/arch/sparc/kernel/sun4d_irq.c @@ -103,9 +103,10 @@ static void sun4d_sbus_handler_irq(int sbusl) sbil = (sbusl << 2); /* Loop for each pending SBI */ - for (sbino = 0; bus_mask; sbino++, bus_mask >>= 1) { + for (sbino = 0; bus_mask; sbino++) { unsigned int idx, mask; + bus_mask >>= 1; if (!(bus_mask & 1)) continue; /* XXX This seems to ACK the irq twice. acquire_sbi() @@ -117,16 +118,19 @@ static void sun4d_sbus_handler_irq(int sbusl) mask &= (0xf << sbil); /* Loop for each pending SBI slot */ + idx = 0; slot = (1 << sbil); - for (idx = 0; mask != 0; idx++, slot <<= 1) { + while (mask != 0) { unsigned int pil; struct irq_bucket *p; + idx++; + slot <<= 1; if (!(mask & slot)) continue; mask &= ~slot; - pil = sun4d_encode_irq(sbino, sbusl, idx); + pil = sun4d_encode_irq(sbino, sbil, idx); p = irq_map[pil]; while (p) { @@ -214,10 +218,10 @@ static void sun4d_unmask_irq(struct irq_data *data) #ifdef CONFIG_SMP spin_lock_irqsave(&sun4d_imsk_lock, flags); - cc_set_imsk_other(cpuid, cc_get_imsk_other(cpuid) & ~(1 << real_irq)); + cc_set_imsk_other(cpuid, cc_get_imsk_other(cpuid) | ~(1 << real_irq)); spin_unlock_irqrestore(&sun4d_imsk_lock, flags); #else - cc_set_imsk(cc_get_imsk() & ~(1 << real_irq)); + cc_set_imsk(cc_get_imsk() | ~(1 << real_irq)); #endif } @@ -295,68 +299,26 @@ static void __init sun4d_load_profile_irqs(void) } } -unsigned int _sun4d_build_device_irq(unsigned int real_irq, - unsigned int pil, - unsigned int board) -{ - struct sun4d_handler_data *handler_data; - unsigned int irq; - - irq = irq_alloc(real_irq, pil); - if (irq == 0) { - prom_printf("IRQ: allocate for %d %d %d failed\n", - real_irq, pil, board); - goto err_out; - } - - handler_data = irq_get_handler_data(irq); - if (unlikely(handler_data)) - goto err_out; - - handler_data = kzalloc(sizeof(struct sun4d_handler_data), GFP_ATOMIC); - if (unlikely(!handler_data)) { - prom_printf("IRQ: kzalloc(sun4d_handler_data) failed.\n"); - prom_halt(); - } - handler_data->cpuid = board_to_cpu[board]; - handler_data->real_irq = real_irq; - irq_set_chip_and_handler_name(irq, &sun4d_irq, - handle_level_irq, "level"); - irq_set_handler_data(irq, handler_data); - -err_out: - return irq; -} - - - unsigned int sun4d_build_device_irq(struct platform_device *op, unsigned int real_irq) { struct device_node *dp = op->dev.of_node; - struct device_node *board_parent, *bus = dp->parent; - char *bus_connection; + struct device_node *io_unit, *sbi = dp->parent; const struct linux_prom_registers *regs; + struct sun4d_handler_data *handler_data; unsigned int pil; unsigned int irq; int board, slot; int sbusl; - irq = real_irq; - while (bus) { - if (!strcmp(bus->name, "sbi")) { - bus_connection = "io-unit"; - break; - } - - if (!strcmp(bus->name, "bootbus")) { - bus_connection = "cpu-unit"; + irq = 0; + while (sbi) { + if (!strcmp(sbi->name, "sbi")) break; - } - bus = bus->parent; + sbi = sbi->parent; } - if (!bus) + if (!sbi) goto err_out; regs = of_get_property(dp, "reg", NULL); @@ -366,19 +328,17 @@ unsigned int sun4d_build_device_irq(struct platform_device *op, slot = regs->which_io; /* - * If Bus nodes parent is not io-unit/cpu-unit or the io-unit/cpu-unit - * lacks a "board#" property, something is very wrong. + * If SBI's parent is not io-unit or the io-unit lacks + * a "board#" property, something is very wrong. */ - if (!bus->parent || strcmp(bus->parent->name, bus_connection)) { - printk(KERN_ERR "%s: Error, parent is not %s.\n", - bus->full_name, bus_connection); + if (!sbi->parent || strcmp(sbi->parent->name, "io-unit")) { + printk("%s: Error, parent is not io-unit.\n", sbi->full_name); goto err_out; } - board_parent = bus->parent; - board = of_getintprop_default(board_parent, "board#", -1); + io_unit = sbi->parent; + board = of_getintprop_default(io_unit, "board#", -1); if (board == -1) { - printk(KERN_ERR "%s: Error, lacks board# property.\n", - board_parent->full_name); + printk("%s: Error, lacks board# property.\n", io_unit->full_name); goto err_out; } @@ -388,16 +348,28 @@ unsigned int sun4d_build_device_irq(struct platform_device *op, else pil = real_irq; - irq = _sun4d_build_device_irq(real_irq, pil, board); -err_out: - return irq; -} + irq = irq_alloc(real_irq, pil); + if (irq == 0) + goto err_out; -unsigned int sun4d_build_timer_irq(unsigned int board, unsigned int real_irq) -{ - return _sun4d_build_device_irq(real_irq, real_irq, board); -} + handler_data = irq_get_handler_data(irq); + if (unlikely(handler_data)) + goto err_out; + handler_data = kzalloc(sizeof(struct sun4d_handler_data), GFP_ATOMIC); + if (unlikely(!handler_data)) { + prom_printf("IRQ: kzalloc(sun4d_handler_data) failed.\n"); + prom_halt(); + } + handler_data->cpuid = board_to_cpu[board]; + handler_data->real_irq = real_irq; + irq_set_chip_and_handler_name(irq, &sun4d_irq, + handle_level_irq, "level"); + irq_set_handler_data(irq, handler_data); + +err_out: + return real_irq; +} static void __init sun4d_fixup_trap_table(void) { @@ -430,7 +402,6 @@ static void __init sun4d_init_timers(irq_handler_t counter_fn) unsigned int irq; const u32 *reg; int err; - int board; dp = of_find_node_by_name(NULL, "cpu-unit"); if (!dp) { @@ -443,19 +414,12 @@ static void __init sun4d_init_timers(irq_handler_t counter_fn) * bootbus. */ reg = of_get_property(dp, "reg", NULL); + of_node_put(dp); if (!reg) { prom_printf("sun4d_init_timers: No reg property\n"); prom_halt(); } - board = of_getintprop_default(dp, "board#", -1); - if (board == -1) { - prom_printf("sun4d_init_timers: No board# property on cpu-unit\n"); - prom_halt(); - } - - of_node_put(dp); - res.start = reg[1]; res.end = reg[2] - 1; res.flags = reg[0] & 0xff; @@ -470,7 +434,7 @@ static void __init sun4d_init_timers(irq_handler_t counter_fn) master_l10_counter = &sun4d_timers->l10_cur_count; - irq = sun4d_build_timer_irq(board, SUN4D_TIMER_IRQ); + irq = sun4d_build_device_irq(NULL, SUN4D_TIMER_IRQ); err = request_irq(irq, counter_fn, IRQF_TIMER, "timer", NULL); if (err) { prom_printf("sun4d_init_timers: request_irq() failed with %d\n", diff --git a/trunk/arch/sparc/kernel/sys_sparc32.c b/trunk/arch/sparc/kernel/sys_sparc32.c index 170cd8e8eb2a..6db18c6927fb 100644 --- a/trunk/arch/sparc/kernel/sys_sparc32.c +++ b/trunk/arch/sparc/kernel/sys_sparc32.c @@ -109,7 +109,7 @@ asmlinkage long compat_sys_ipc(u32 call, u32 first, u32 second, u32 third, compa default: return -ENOSYS; - } + }; return -ENOSYS; } diff --git a/trunk/arch/sparc/kernel/sys_sparc_64.c b/trunk/arch/sparc/kernel/sys_sparc_64.c index 908b47a5ee24..96082d30def0 100644 --- a/trunk/arch/sparc/kernel/sys_sparc_64.c +++ b/trunk/arch/sparc/kernel/sys_sparc_64.c @@ -460,7 +460,7 @@ SYSCALL_DEFINE6(sparc_ipc, unsigned int, call, int, first, unsigned long, second default: err = -ENOSYS; goto out; - } + }; } if (call <= MSGCTL) { switch (call) { @@ -481,7 +481,7 @@ SYSCALL_DEFINE6(sparc_ipc, unsigned int, call, int, first, unsigned long, second default: err = -ENOSYS; goto out; - } + }; } if (call <= SHMCTL) { switch (call) { @@ -507,7 +507,7 @@ SYSCALL_DEFINE6(sparc_ipc, unsigned int, call, int, first, unsigned long, second default: err = -ENOSYS; goto out; - } + }; } else { err = -ENOSYS; } diff --git a/trunk/arch/sparc/kernel/time_64.c b/trunk/arch/sparc/kernel/time_64.c index 1db6b18964d2..2b8d54b2d850 100644 --- a/trunk/arch/sparc/kernel/time_64.c +++ b/trunk/arch/sparc/kernel/time_64.c @@ -708,7 +708,7 @@ static void sparc64_timer_setup(enum clock_event_mode mode, case CLOCK_EVT_MODE_UNUSED: WARN_ON(1); break; - } + }; } static struct clock_event_device sparc64_clockevent = { diff --git a/trunk/arch/sparc/kernel/traps_64.c b/trunk/arch/sparc/kernel/traps_64.c index 0cbdaa41cd1e..1ed547bd850f 100644 --- a/trunk/arch/sparc/kernel/traps_64.c +++ b/trunk/arch/sparc/kernel/traps_64.c @@ -1804,7 +1804,7 @@ static const char *sun4v_err_type_to_str(u32 type) return "warning resumable"; default: return "unknown"; - } + }; } static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, int cpu, const char *pfx, atomic_t *ocnt) diff --git a/trunk/arch/sparc/kernel/unaligned_64.c b/trunk/arch/sparc/kernel/unaligned_64.c index b2b019ea8caa..c752c4c479bd 100644 --- a/trunk/arch/sparc/kernel/unaligned_64.c +++ b/trunk/arch/sparc/kernel/unaligned_64.c @@ -211,7 +211,7 @@ static inline int do_int_store(int reg_num, int size, unsigned long *dst_addr, default: BUG(); break; - } + }; } return __do_int_store(dst_addr, size, src_val, asi); } @@ -328,7 +328,7 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn) case ASI_SNFL: asi &= ~0x08; break; - } + }; switch (dir) { case load: reg_addr = fetch_reg_addr(((insn>>25)&0x1f), regs); @@ -351,7 +351,7 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn) default: BUG(); break; - } + }; *reg_addr = val_in; } break; diff --git a/trunk/arch/sparc/kernel/us2e_cpufreq.c b/trunk/arch/sparc/kernel/us2e_cpufreq.c index 489fc15f3194..531d54fc9829 100644 --- a/trunk/arch/sparc/kernel/us2e_cpufreq.c +++ b/trunk/arch/sparc/kernel/us2e_cpufreq.c @@ -176,7 +176,7 @@ static unsigned long index_to_estar_mode(unsigned int index) default: BUG(); - } + }; } static unsigned long index_to_divisor(unsigned int index) @@ -199,7 +199,7 @@ static unsigned long index_to_divisor(unsigned int index) default: BUG(); - } + }; } static unsigned long estar_to_divisor(unsigned long estar) @@ -224,7 +224,7 @@ static unsigned long estar_to_divisor(unsigned long estar) break; default: BUG(); - } + }; return ret; } diff --git a/trunk/arch/sparc/kernel/us3_cpufreq.c b/trunk/arch/sparc/kernel/us3_cpufreq.c index eb1624b931d9..9a8ceb700833 100644 --- a/trunk/arch/sparc/kernel/us3_cpufreq.c +++ b/trunk/arch/sparc/kernel/us3_cpufreq.c @@ -71,7 +71,7 @@ static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg break; default: BUG(); - } + }; return ret; } @@ -125,7 +125,7 @@ static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) default: BUG(); - } + }; reg = read_safari_cfg(); diff --git a/trunk/arch/sparc/kernel/viohs.c b/trunk/arch/sparc/kernel/viohs.c index 29348ea139c3..aa6ac70d4fd5 100644 --- a/trunk/arch/sparc/kernel/viohs.c +++ b/trunk/arch/sparc/kernel/viohs.c @@ -363,7 +363,7 @@ static int process_ver(struct vio_driver_state *vio, struct vio_ver_info *pkt) default: return handshake_failure(vio); - } + }; } static int process_attr(struct vio_driver_state *vio, void *pkt) diff --git a/trunk/arch/sparc/kernel/visemul.c b/trunk/arch/sparc/kernel/visemul.c index 36357717d691..9dfd2ebcb157 100644 --- a/trunk/arch/sparc/kernel/visemul.c +++ b/trunk/arch/sparc/kernel/visemul.c @@ -334,7 +334,7 @@ static void edge(struct pt_regs *regs, unsigned int insn, unsigned int opf) left = edge32_tab_l[(rs1 >> 2) & 0x1].left; right = edge32_tab_l[(rs2 >> 2) & 0x1].right; break; - } + }; if ((rs1 & ~0x7UL) == (rs2 & ~0x7UL)) rd_val = right & left; @@ -360,7 +360,7 @@ static void edge(struct pt_regs *regs, unsigned int insn, unsigned int opf) tstate = regs->tstate & ~(TSTATE_XCC | TSTATE_ICC); regs->tstate = tstate | (ccr << 32UL); } - } + }; } static void array(struct pt_regs *regs, unsigned int insn, unsigned int opf) @@ -392,7 +392,7 @@ static void array(struct pt_regs *regs, unsigned int insn, unsigned int opf) case ARRAY32_OPF: rd_val <<= 2; - } + }; store_reg(regs, rd_val, RD(insn)); } @@ -577,7 +577,7 @@ static void pformat(struct pt_regs *regs, unsigned int insn, unsigned int opf) *fpd_regaddr(f, RD(insn)) = rd_val; break; } - } + }; } static void pmul(struct pt_regs *regs, unsigned int insn, unsigned int opf) @@ -693,7 +693,7 @@ static void pmul(struct pt_regs *regs, unsigned int insn, unsigned int opf) *fpd_regaddr(f, RD(insn)) = rd_val; break; } - } + }; } static void pcmp(struct pt_regs *regs, unsigned int insn, unsigned int opf) @@ -786,7 +786,7 @@ static void pcmp(struct pt_regs *regs, unsigned int insn, unsigned int opf) rd_val |= 1 << i; } break; - } + }; maybe_flush_windows(0, 0, RD(insn), 0); store_reg(regs, rd_val, RD(insn)); @@ -885,7 +885,7 @@ int vis_emul(struct pt_regs *regs, unsigned int insn) case BSHUFFLE_OPF: bshuffle(regs, insn); break; - } + }; regs->tpc = regs->tnpc; regs->tnpc += 4; diff --git a/trunk/arch/sparc/mm/fault_32.c b/trunk/arch/sparc/mm/fault_32.c index 7543ddbdadb2..b10ac4d62378 100644 --- a/trunk/arch/sparc/mm/fault_32.c +++ b/trunk/arch/sparc/mm/fault_32.c @@ -135,7 +135,7 @@ asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc, default: break; - } + }; memset(®s, 0, sizeof (regs)); regs.pc = pc; diff --git a/trunk/arch/sparc/mm/init_32.c b/trunk/arch/sparc/mm/init_32.c index 7b00de61c5f1..ca217327e8d2 100644 --- a/trunk/arch/sparc/mm/init_32.c +++ b/trunk/arch/sparc/mm/init_32.c @@ -340,7 +340,7 @@ void __init paging_init(void) prom_printf("paging_init: sparc_cpu_model = %d\n", sparc_cpu_model); prom_printf("paging_init: Halting...\n"); prom_halt(); - } + }; /* Initialize the protection map with non-constant, MMU dependent values. */ protection_map[0] = PAGE_NONE; diff --git a/trunk/arch/sparc/mm/init_64.c b/trunk/arch/sparc/mm/init_64.c index 3fd8e18bed80..e10cd03fab80 100644 --- a/trunk/arch/sparc/mm/init_64.c +++ b/trunk/arch/sparc/mm/init_64.c @@ -1625,7 +1625,7 @@ static void __init sun4v_ktsb_init(void) ktsb_descr[0].pgsz_idx = HV_PGSZ_IDX_4MB; ktsb_descr[0].pgsz_mask = HV_PGSZ_MASK_4MB; break; - } + }; ktsb_descr[0].assoc = 1; ktsb_descr[0].num_ttes = KERNEL_TSB_NENTRIES; @@ -2266,7 +2266,7 @@ unsigned long pte_sz_bits(unsigned long sz) return _PAGE_SZ512K_4V; case 4 * 1024 * 1024: return _PAGE_SZ4MB_4V; - } + }; } else { switch (sz) { case 8 * 1024: @@ -2278,7 +2278,7 @@ unsigned long pte_sz_bits(unsigned long sz) return _PAGE_SZ512K_4U; case 4 * 1024 * 1024: return _PAGE_SZ4MB_4U; - } + }; } } diff --git a/trunk/arch/sparc/mm/srmmu.c b/trunk/arch/sparc/mm/srmmu.c index cbef74e793b8..fe09fd8be695 100644 --- a/trunk/arch/sparc/mm/srmmu.c +++ b/trunk/arch/sparc/mm/srmmu.c @@ -1665,7 +1665,7 @@ static void __init init_swift(void) default: srmmu_modtype = Swift_ok; break; - } + }; BTFIXUPSET_CALL(flush_cache_all, swift_flush_cache_all, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(flush_cache_mm, swift_flush_cache_mm, BTFIXUPCALL_NORM); @@ -2069,7 +2069,7 @@ static void __init get_srmmu_type(void) /* Some other Cypress revision, assume a 605. */ init_cypress_605(mod_rev); break; - } + }; return; } diff --git a/trunk/arch/sparc/mm/sun4c.c b/trunk/arch/sparc/mm/sun4c.c index 1cf4f198709a..a2350b5e68aa 100644 --- a/trunk/arch/sparc/mm/sun4c.c +++ b/trunk/arch/sparc/mm/sun4c.c @@ -318,7 +318,7 @@ void __init sun4c_probe_vac(void) prom_printf("probe_vac: Didn't expect vac-linesize of %d, halting\n", sun4c_vacinfo.linesize); prom_halt(); - } + }; sun4c_flush_all(); sun4c_enable_vac(); @@ -364,7 +364,7 @@ static void __init patch_kernel_fault_handler(void) prom_printf("Unhandled number of segmaps: %d\n", num_segmaps); prom_halt(); - } + }; switch (num_contexts) { case 8: /* Default, nothing to do. */ @@ -377,7 +377,7 @@ static void __init patch_kernel_fault_handler(void) prom_printf("Unhandled number of contexts: %d\n", num_contexts); prom_halt(); - } + }; if (sun4c_vacinfo.do_hwflushes != 0) { PATCH_INSN(vac_hwflush_patch1_on, vac_hwflush_patch1); @@ -394,7 +394,7 @@ static void __init patch_kernel_fault_handler(void) prom_printf("Impossible VAC linesize %d, halting...\n", sun4c_vacinfo.linesize); prom_halt(); - } + }; } } diff --git a/trunk/arch/sparc/mm/tsb.c b/trunk/arch/sparc/mm/tsb.c index a5f51b22fcbe..948461513499 100644 --- a/trunk/arch/sparc/mm/tsb.c +++ b/trunk/arch/sparc/mm/tsb.c @@ -180,7 +180,7 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsign printk(KERN_ERR "TSB[%s:%d]: Impossible TSB size %lu, killing process.\n", current->comm, current->pid, tsb_bytes); do_exit(SIGSEGV); - } + }; tte |= pte_sz_bits(page_sz); if (tlb_type == cheetah_plus || tlb_type == hypervisor) { @@ -215,7 +215,7 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsign #endif default: BUG(); - } + }; hp->assoc = 1; hp->num_ttes = tsb_bytes / 16; hp->ctx_idx = 0; @@ -230,7 +230,7 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsign #endif default: BUG(); - } + }; hp->tsb_base = tsb_paddr; hp->resv = 0; } diff --git a/trunk/arch/sparc/prom/console_32.c b/trunk/arch/sparc/prom/console_32.c index a00f47b16c10..b05e3db5fa63 100644 --- a/trunk/arch/sparc/prom/console_32.c +++ b/trunk/arch/sparc/prom/console_32.c @@ -38,7 +38,7 @@ static int prom_nbputchar(const char *buf) break; default: break; - } + }; restore_current(); spin_unlock_irqrestore(&prom_lock, flags); return i; /* Ugh, we could spin forever on unsupported proms ;( */ diff --git a/trunk/arch/sparc/prom/init_32.c b/trunk/arch/sparc/prom/init_32.c index 26c64cea3c9c..0a601b300639 100644 --- a/trunk/arch/sparc/prom/init_32.c +++ b/trunk/arch/sparc/prom/init_32.c @@ -53,7 +53,7 @@ void __init prom_init(struct linux_romvec *rp) romvec->pv_romvers); prom_halt(); break; - } + }; prom_rev = romvec->pv_plugin_revision; prom_prev = romvec->pv_printrev; diff --git a/trunk/arch/sparc/prom/mp.c b/trunk/arch/sparc/prom/mp.c index 0da8256cf76f..97c44c9ddbc8 100644 --- a/trunk/arch/sparc/prom/mp.c +++ b/trunk/arch/sparc/prom/mp.c @@ -35,7 +35,7 @@ prom_startcpu(int cpunode, struct linux_prom_registers *ctable_reg, int ctx, cha case PROM_V3: ret = (*(romvec->v3_cpustart))(cpunode, (int) ctable_reg, ctx, pc); break; - } + }; restore_current(); spin_unlock_irqrestore(&prom_lock, flags); diff --git a/trunk/arch/unicore32/Kconfig b/trunk/arch/unicore32/Kconfig index e57dcce9bfda..d3a303246c9f 100644 --- a/trunk/arch/unicore32/Kconfig +++ b/trunk/arch/unicore32/Kconfig @@ -231,6 +231,10 @@ config PUV3_PWM help Enable support for NB0916 PWM controllers +config PUV3_RTC + tristate "PKUnity v3 RTC Support" + depends on !ARCH_FPGA + if PUV3_NB0916 menu "PKUnity NetBook-0916 Features" diff --git a/trunk/arch/unicore32/Makefile b/trunk/arch/unicore32/Makefile index 6af4bc415f2b..76a8beec7d03 100644 --- a/trunk/arch/unicore32/Makefile +++ b/trunk/arch/unicore32/Makefile @@ -40,10 +40,42 @@ core-y += arch/unicore32/mm/ libs-y += arch/unicore32/lib/ +ASM_GENERATED_DIR := $(srctree)/arch/unicore32/include/generated +LINUXINCLUDE += -I$(ASM_GENERATED_DIR) + +ASM_GENERIC_HEADERS := atomic.h auxvec.h +ASM_GENERIC_HEADERS += bitsperlong.h bug.h bugs.h +ASM_GENERIC_HEADERS += cputime.h current.h +ASM_GENERIC_HEADERS += device.h div64.h +ASM_GENERIC_HEADERS += emergency-restart.h errno.h +ASM_GENERIC_HEADERS += fb.h fcntl.h ftrace.h futex.h +ASM_GENERIC_HEADERS += hardirq.h hw_irq.h +ASM_GENERIC_HEADERS += ioctl.h ioctls.h ipcbuf.h irq_regs.h +ASM_GENERIC_HEADERS += kdebug.h kmap_types.h +ASM_GENERIC_HEADERS += local.h +ASM_GENERIC_HEADERS += mman.h module.h msgbuf.h +ASM_GENERIC_HEADERS += param.h parport.h percpu.h poll.h posix_types.h +ASM_GENERIC_HEADERS += resource.h +ASM_GENERIC_HEADERS += scatterlist.h sections.h segment.h sembuf.h serial.h +ASM_GENERIC_HEADERS += setup.h shmbuf.h shmparam.h +ASM_GENERIC_HEADERS += siginfo.h signal.h sizes.h +ASM_GENERIC_HEADERS += socket.h sockios.h stat.h statfs.h swab.h syscalls.h +ASM_GENERIC_HEADERS += termbits.h termios.h topology.h types.h +ASM_GENERIC_HEADERS += ucontext.h unaligned.h user.h +ASM_GENERIC_HEADERS += vga.h +ASM_GENERIC_HEADERS += xor.h + +archprepare: +ifneq ($(ASM_GENERATED_DIR), $(wildcard $(ASM_GENERATED_DIR))) + $(Q)mkdir -p $(ASM_GENERATED_DIR)/asm + $(Q)$(foreach a, $(ASM_GENERIC_HEADERS), \ + echo '#include ' \ + > $(ASM_GENERATED_DIR)/asm/$a; ) +endif + boot := arch/unicore32/boot -# Default defconfig and target when executing plain make -KBUILD_DEFCONFIG := $(ARCH)_defconfig +# Default target when executing plain make KBUILD_IMAGE := zImage all: $(KBUILD_IMAGE) @@ -51,6 +83,8 @@ all: $(KBUILD_IMAGE) zImage Image uImage: vmlinux $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ +MRPROPER_DIRS += $(ASM_GENERATED_DIR) + archclean: $(Q)$(MAKE) $(clean)=$(boot) diff --git a/trunk/arch/unicore32/boot/compressed/Makefile b/trunk/arch/unicore32/boot/compressed/Makefile index b0954a2d23cf..95373428cb3d 100644 --- a/trunk/arch/unicore32/boot/compressed/Makefile +++ b/trunk/arch/unicore32/boot/compressed/Makefile @@ -59,7 +59,7 @@ $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/head.o $(obj)/piggy.o \ # We now have a PIC decompressor implementation. Decompressors running # from RAM should not define ZTEXTADDR. Decompressors running directly # from ROM or Flash must define ZTEXTADDR (preferably via the config) -ZTEXTADDR := 0x03000000 +ZTEXTADDR := 0 ZBSSADDR := ALIGN(4) SEDFLAGS_lds = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ diff --git a/trunk/arch/unicore32/configs/unicore32_defconfig b/trunk/arch/unicore32/configs/debug_defconfig similarity index 97% rename from trunk/arch/unicore32/configs/unicore32_defconfig rename to trunk/arch/unicore32/configs/debug_defconfig index c9dd3198b6f7..b5fbde9f1cb2 100644 --- a/trunk/arch/unicore32/configs/unicore32_defconfig +++ b/trunk/arch/unicore32/configs/debug_defconfig @@ -1,6 +1,6 @@ ### General setup CONFIG_EXPERIMENTAL=y -CONFIG_LOCALVERSION="-unicore32" +CONFIG_LOCALVERSION="-debug" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y @@ -64,6 +64,7 @@ CONFIG_I2C_BATTERY_BQ27200=n CONFIG_I2C_EEPROM_AT24=n CONFIG_LCD_BACKLIGHT=n +CONFIG_PUV3_RTC=y CONFIG_PUV3_UMAL=y CONFIG_PUV3_MUSB=n CONFIG_PUV3_AC97=n @@ -166,9 +167,8 @@ CONFIG_LEDS_TRIGGER_IDE_DISK=y CONFIG_LEDS_TRIGGER_HEARTBEAT=y # Real Time Clock -CONFIG_RTC_LIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_PUV3=y +CONFIG_RTC_LIB=m +CONFIG_RTC_CLASS=m ### File systems CONFIG_EXT2_FS=m diff --git a/trunk/arch/unicore32/include/asm/Kbuild b/trunk/arch/unicore32/include/asm/Kbuild index ca113d6999c5..b200fdaca44d 100644 --- a/trunk/arch/unicore32/include/asm/Kbuild +++ b/trunk/arch/unicore32/include/asm/Kbuild @@ -1,61 +1,2 @@ include include/asm-generic/Kbuild.asm -generic-y += atomic.h -generic-y += auxvec.h -generic-y += bitsperlong.h -generic-y += bug.h -generic-y += bugs.h -generic-y += cputime.h -generic-y += current.h -generic-y += device.h -generic-y += div64.h -generic-y += emergency-restart.h -generic-y += errno.h -generic-y += fb.h -generic-y += fcntl.h -generic-y += ftrace.h -generic-y += futex.h -generic-y += hardirq.h -generic-y += hw_irq.h -generic-y += ioctl.h -generic-y += ioctls.h -generic-y += ipcbuf.h -generic-y += irq_regs.h -generic-y += kdebug.h -generic-y += kmap_types.h -generic-y += local.h -generic-y += mman.h -generic-y += module.h -generic-y += msgbuf.h -generic-y += param.h -generic-y += parport.h -generic-y += percpu.h -generic-y += poll.h -generic-y += posix_types.h -generic-y += resource.h -generic-y += scatterlist.h -generic-y += sections.h -generic-y += segment.h -generic-y += sembuf.h -generic-y += serial.h -generic-y += setup.h -generic-y += shmbuf.h -generic-y += shmparam.h -generic-y += siginfo.h -generic-y += signal.h -generic-y += sizes.h -generic-y += socket.h -generic-y += sockios.h -generic-y += stat.h -generic-y += statfs.h -generic-y += swab.h -generic-y += syscalls.h -generic-y += termbits.h -generic-y += termios.h -generic-y += topology.h -generic-y += types.h -generic-y += ucontext.h -generic-y += unaligned.h -generic-y += user.h -generic-y += vga.h -generic-y += xor.h diff --git a/trunk/arch/unicore32/kernel/Makefile b/trunk/arch/unicore32/kernel/Makefile index aeb0f181568e..ec23a2fb2f50 100644 --- a/trunk/arch/unicore32/kernel/Makefile +++ b/trunk/arch/unicore32/kernel/Makefile @@ -16,6 +16,7 @@ obj-$(CONFIG_UNICORE_FPU_F64) += fpu-ucf64.o obj-$(CONFIG_ARCH_PUV3) += clock.o irq.o time.o obj-$(CONFIG_PUV3_GPIO) += gpio.o +obj-$(CONFIG_PUV3_RTC) += rtc.o obj-$(CONFIG_PUV3_PWM) += pwm.o obj-$(CONFIG_PUV3_PM) += pm.o sleep.o obj-$(CONFIG_HIBERNATION) += hibernate.o hibernate_asm.o diff --git a/trunk/drivers/rtc/rtc-puv3.c b/trunk/arch/unicore32/kernel/rtc.c similarity index 98% rename from trunk/drivers/rtc/rtc-puv3.c rename to trunk/arch/unicore32/kernel/rtc.c index 46f14b82f3ab..8cad70b3302c 100644 --- a/trunk/drivers/rtc/rtc-puv3.c +++ b/trunk/arch/unicore32/kernel/rtc.c @@ -1,5 +1,7 @@ /* - * RTC driver code specific to PKUnity SoC and UniCore ISA + * linux/arch/unicore32/kernel/rtc.c + * + * Code specific to PKUnity SoC and UniCore ISA * * Maintained by GUAN Xue-tao * Copyright (C) 2001-2010 Guan Xuetao @@ -34,6 +36,7 @@ static int puv3_rtc_tickno = IRQ_RTC; static DEFINE_SPINLOCK(puv3_rtc_pie_lock); /* IRQ Handlers */ + static irqreturn_t puv3_rtc_alarmirq(int irq, void *id) { struct rtc_device *rdev = id; @@ -86,6 +89,7 @@ static int puv3_rtc_setpie(struct device *dev, int enabled) } /* Time read/write */ + static int puv3_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) { rtc_time_to_tm(readl(RTC_RCNR), rtc_tm); @@ -192,6 +196,7 @@ static void puv3_rtc_release(struct device *dev) struct rtc_device *rtc_dev = platform_get_drvdata(pdev); /* do not clear AIE here, it may be needed for wake */ + puv3_rtc_setpie(dev, 0); free_irq(puv3_rtc_alarmno, rtc_dev); free_irq(puv3_rtc_tickno, rtc_dev); @@ -213,6 +218,7 @@ static void puv3_rtc_enable(struct platform_device *pdev, int en) writel(readl(RTC_RTSR) & ~RTC_RTSR_HZE, RTC_RTSR); } else { /* re-enable the device, and check it is ok */ + if ((readl(RTC_RTSR) & RTC_RTSR_HZE) == 0) { dev_info(&pdev->dev, "rtc disabled, re-enabling\n"); writel(readl(RTC_RTSR) | RTC_RTSR_HZE, RTC_RTSR); @@ -245,6 +251,7 @@ static int puv3_rtc_probe(struct platform_device *pdev) pr_debug("%s: probe=%p\n", __func__, pdev); /* find the IRQs */ + puv3_rtc_tickno = platform_get_irq(pdev, 1); if (puv3_rtc_tickno < 0) { dev_err(&pdev->dev, "no irq for rtc tick\n"); @@ -261,6 +268,7 @@ static int puv3_rtc_probe(struct platform_device *pdev) puv3_rtc_tickno, puv3_rtc_alarmno); /* get the memory region */ + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (res == NULL) { dev_err(&pdev->dev, "failed to get memory region resource\n"); @@ -280,6 +288,7 @@ static int puv3_rtc_probe(struct platform_device *pdev) puv3_rtc_enable(pdev, 1); /* register RTC and exit */ + rtc = rtc_device_register("pkunity", &pdev->dev, &puv3_rtcops, THIS_MODULE); @@ -306,6 +315,8 @@ static int puv3_rtc_probe(struct platform_device *pdev) #ifdef CONFIG_PM +/* RTC Power management control */ + static int ticnt_save; static int puv3_rtc_suspend(struct platform_device *pdev, pm_message_t state) @@ -357,3 +368,4 @@ module_exit(puv3_rtc_exit); MODULE_DESCRIPTION("RTC Driver for the PKUnity v3 chip"); MODULE_AUTHOR("Hu Dongliang"); MODULE_LICENSE("GPL v2"); + diff --git a/trunk/arch/unicore32/kernel/vmlinux.lds.S b/trunk/arch/unicore32/kernel/vmlinux.lds.S index 77e407e49a63..9bf7f7af52c5 100644 --- a/trunk/arch/unicore32/kernel/vmlinux.lds.S +++ b/trunk/arch/unicore32/kernel/vmlinux.lds.S @@ -30,7 +30,7 @@ SECTIONS HEAD_TEXT_SECTION INIT_TEXT_SECTION(PAGE_SIZE) INIT_DATA_SECTION(16) - PERCPU_SECTION(L1_CACHE_BYTES) + PERCPU(L1_CACHE_BYTES, PAGE_SIZE) __init_end = .; _stext = .; diff --git a/trunk/arch/x86/kernel/process_32.c b/trunk/arch/x86/kernel/process_32.c index a3d0dc59067b..8d128783af47 100644 --- a/trunk/arch/x86/kernel/process_32.c +++ b/trunk/arch/x86/kernel/process_32.c @@ -245,6 +245,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) { set_user_gs(regs, 0); regs->fs = 0; + set_fs(USER_DS); regs->ds = __USER_DS; regs->es = __USER_DS; regs->ss = __USER_DS; diff --git a/trunk/arch/x86/kernel/process_64.c b/trunk/arch/x86/kernel/process_64.c index ca6f7ab8df33..6c9dd922ac0d 100644 --- a/trunk/arch/x86/kernel/process_64.c +++ b/trunk/arch/x86/kernel/process_64.c @@ -338,6 +338,7 @@ start_thread_common(struct pt_regs *regs, unsigned long new_ip, regs->cs = _cs; regs->ss = _ss; regs->flags = X86_EFLAGS_IF; + set_fs(USER_DS); /* * Free the old FP and other extended state */ diff --git a/trunk/drivers/ata/libata-eh.c b/trunk/drivers/ata/libata-eh.c index 7f099d6e4e0b..dfb6e9d3d759 100644 --- a/trunk/drivers/ata/libata-eh.c +++ b/trunk/drivers/ata/libata-eh.c @@ -2802,11 +2802,10 @@ int ata_eh_reset(struct ata_link *link, int classify, } /* - * Some controllers can't be frozen very well and may set spurious - * error conditions during reset. Clear accumulated error - * information and re-thaw the port if frozen. As reset is the - * final recovery action and we cross check link onlineness against - * device classification later, no hotplug event is lost by this. + * Some controllers can't be frozen very well and may set + * spuruious error conditions during reset. Clear accumulated + * error information. As reset is the final recovery action, + * nothing is lost by doing this. */ spin_lock_irqsave(link->ap->lock, flags); memset(&link->eh_info, 0, sizeof(link->eh_info)); @@ -2815,9 +2814,6 @@ int ata_eh_reset(struct ata_link *link, int classify, ap->pflags &= ~ATA_PFLAG_EH_PENDING; spin_unlock_irqrestore(link->ap->lock, flags); - if (ap->pflags & ATA_PFLAG_FROZEN) - ata_eh_thaw_port(ap); - /* * Make sure onlineness and classification result correspond. * Hotplug could have happened during reset and some diff --git a/trunk/drivers/firmware/iscsi_ibft_find.c b/trunk/drivers/firmware/iscsi_ibft_find.c index bfe723266fd8..f032e446fc11 100644 --- a/trunk/drivers/firmware/iscsi_ibft_find.c +++ b/trunk/drivers/firmware/iscsi_ibft_find.c @@ -108,9 +108,7 @@ static int __init find_ibft_in_mem(void) */ unsigned long __init find_ibft_region(unsigned long *sizep) { -#ifdef CONFIG_ACPI int i; -#endif ibft_addr = NULL; #ifdef CONFIG_ACPI diff --git a/trunk/drivers/media/video/cx23885/cx23885-cards.c b/trunk/drivers/media/video/cx23885/cx23885-cards.c index 934185cca758..2354336862cf 100644 --- a/trunk/drivers/media/video/cx23885/cx23885-cards.c +++ b/trunk/drivers/media/video/cx23885/cx23885-cards.c @@ -25,8 +25,8 @@ #include #include #include +#include -#include "../../../staging/altera-stapl/altera.h" #include "cx23885.h" #include "tuner-xc2028.h" #include "netup-init.h" diff --git a/trunk/drivers/pci/Makefile b/trunk/drivers/pci/Makefile index 094308e41be5..c85f744270a5 100644 --- a/trunk/drivers/pci/Makefile +++ b/trunk/drivers/pci/Makefile @@ -51,7 +51,6 @@ obj-$(CONFIG_X86_VISWS) += setup-irq.o obj-$(CONFIG_MN10300) += setup-bus.o obj-$(CONFIG_MICROBLAZE) += setup-bus.o obj-$(CONFIG_TILE) += setup-bus.o setup-irq.o -obj-$(CONFIG_SPARC_LEON) += setup-bus.o setup-irq.o # # ACPI Related PCI FW Functions diff --git a/trunk/drivers/rtc/Kconfig b/trunk/drivers/rtc/Kconfig index ce2aabf5c550..f822e13dc04b 100644 --- a/trunk/drivers/rtc/Kconfig +++ b/trunk/drivers/rtc/Kconfig @@ -1051,13 +1051,4 @@ config RTC_DRV_TILE Enable support for the Linux driver side of the Tilera hypervisor's real-time clock interface. -config RTC_DRV_PUV3 - tristate "PKUnity v3 RTC support" - depends on ARCH_PUV3 - help - This enables support for the RTC in the PKUnity-v3 SoCs. - - This drive can also be built as a module. If so, the module - will be called rtc-puv3. - endif # RTC_CLASS diff --git a/trunk/drivers/rtc/Makefile b/trunk/drivers/rtc/Makefile index 0ffefe877bfa..213d725f16d4 100644 --- a/trunk/drivers/rtc/Makefile +++ b/trunk/drivers/rtc/Makefile @@ -78,7 +78,6 @@ obj-$(CONFIG_RTC_DRV_PCF50633) += rtc-pcf50633.o obj-$(CONFIG_RTC_DRV_PL030) += rtc-pl030.o obj-$(CONFIG_RTC_DRV_PL031) += rtc-pl031.o obj-$(CONFIG_RTC_DRV_PS3) += rtc-ps3.o -obj-$(CONFIG_RTC_DRV_PUV3) += rtc-puv3.o obj-$(CONFIG_RTC_DRV_PXA) += rtc-pxa.o obj-$(CONFIG_RTC_DRV_R9701) += rtc-r9701.o obj-$(CONFIG_RTC_DRV_RP5C01) += rtc-rp5c01.o diff --git a/trunk/drivers/staging/Kconfig b/trunk/drivers/staging/Kconfig index 196284dc2f36..dfc16f955eb8 100644 --- a/trunk/drivers/staging/Kconfig +++ b/trunk/drivers/staging/Kconfig @@ -24,6 +24,23 @@ menuconfig STAGING if STAGING +config STAGING_EXCLUDE_BUILD + bool "Exclude Staging drivers from being built" if STAGING + default y + ---help--- + Are you sure you really want to build the staging drivers? + They taint your kernel, don't live up to the normal Linux + kernel quality standards, are a bit crufty around the edges, + and might go off and kick your dog when you aren't paying + attention. + + Say N here to be able to select and build the Staging drivers. + This option is primarily here to prevent them from being built + when selecting 'make allyesconfg' and 'make allmodconfig' so + don't be all that put off, your dog will be just fine. + +if !STAGING_EXCLUDE_BUILD + source "drivers/staging/tty/Kconfig" source "drivers/staging/generic_serial/Kconfig" @@ -160,4 +177,5 @@ source "drivers/staging/mei/Kconfig" source "drivers/staging/nvec/Kconfig" +endif # !STAGING_EXCLUDE_BUILD endif # STAGING diff --git a/trunk/drivers/staging/altera-stapl/altera-jtag.c b/trunk/drivers/staging/altera-stapl/altera-jtag.c index 8b1620b1b2d0..876308858b82 100644 --- a/trunk/drivers/staging/altera-stapl/altera-jtag.c +++ b/trunk/drivers/staging/altera-stapl/altera-jtag.c @@ -26,7 +26,7 @@ #include #include #include -#include "altera.h" +#include #include "altera-exprt.h" #include "altera-jtag.h" diff --git a/trunk/drivers/staging/altera-stapl/altera.c b/trunk/drivers/staging/altera-stapl/altera.c index 9cd5e76880c0..05aad351b120 100644 --- a/trunk/drivers/staging/altera-stapl/altera.c +++ b/trunk/drivers/staging/altera-stapl/altera.c @@ -28,7 +28,7 @@ #include #include #include -#include "altera.h" +#include #include "altera-exprt.h" #include "altera-jtag.h" diff --git a/trunk/drivers/staging/ath6kl/Kconfig b/trunk/drivers/staging/ath6kl/Kconfig index afd6cc16a2b8..1f15e1fb1ab2 100644 --- a/trunk/drivers/staging/ath6kl/Kconfig +++ b/trunk/drivers/staging/ath6kl/Kconfig @@ -1,7 +1,6 @@ config ATH6K_LEGACY tristate "Atheros AR6003 support (non mac80211)" depends on MMC && WLAN - depends on CFG80211 select WIRELESS_EXT select WEXT_PRIV help diff --git a/trunk/drivers/staging/ath6kl/os/linux/cfg80211.c b/trunk/drivers/staging/ath6kl/os/linux/cfg80211.c index d3a774dbb7e8..77dfb4070c1d 100644 --- a/trunk/drivers/staging/ath6kl/os/linux/cfg80211.c +++ b/trunk/drivers/staging/ath6kl/os/linux/cfg80211.c @@ -870,8 +870,7 @@ ar6k_cfg80211_scanComplete_event(struct ar6_softc *ar, int status) if(ar->scan_request) { /* Translate data to cfg80211 mgmt format */ - if (ar->arWmi) - wmi_iterate_nodes(ar->arWmi, ar6k_cfg80211_scan_node, ar->wdev->wiphy); + wmi_iterate_nodes(ar->arWmi, ar6k_cfg80211_scan_node, ar->wdev->wiphy); cfg80211_scan_done(ar->scan_request, ((status & A_ECANCELED) || (status & A_EBUSY)) ? true : false); diff --git a/trunk/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/trunk/drivers/staging/brcm80211/brcmfmac/wl_iw.c index 15e1b05ca92d..929ceaf363be 100644 --- a/trunk/drivers/staging/brcm80211/brcmfmac/wl_iw.c +++ b/trunk/drivers/staging/brcm80211/brcmfmac/wl_iw.c @@ -64,6 +64,8 @@ wl_iw_extra_params_t g_wl_iw_params; extern bool wl_iw_conn_status_str(u32 event_type, u32 status, u32 reason, char *stringBuf, uint buflen); +uint wl_msg_level = WL_ERROR_VAL; + #define MAX_WLIW_IOCTL_LEN 1024 #ifdef CONFIG_WIRELESS_EXT diff --git a/trunk/drivers/staging/gma500/psb_drv.c b/trunk/drivers/staging/gma500/psb_drv.c index aa87b1b6a44a..1c45c11a774e 100644 --- a/trunk/drivers/staging/gma500/psb_drv.c +++ b/trunk/drivers/staging/gma500/psb_drv.c @@ -542,8 +542,6 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset) unsigned long irqflags; int ret = -ENOMEM; uint32_t tt_pages; - struct drm_connector *connector; - struct psb_intel_output *psb_intel_output; dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL); if (dev_priv == NULL) @@ -665,18 +663,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset) drm_kms_helper_poll_init(dev); } - /* Only add backlight support if we have LVDS output */ - list_for_each_entry(connector, &dev->mode_config.connector_list, - head) { - psb_intel_output = to_psb_intel_output(connector); - - switch (psb_intel_output->type) { - case INTEL_OUTPUT_LVDS: - ret = psb_backlight_init(dev); - break; - } - } - + ret = psb_backlight_init(dev); if (ret) return ret; #if 0 diff --git a/trunk/drivers/staging/gma500/psb_fb.c b/trunk/drivers/staging/gma500/psb_fb.c index 084c36bbfe86..99c03a2e06bd 100644 --- a/trunk/drivers/staging/gma500/psb_fb.c +++ b/trunk/drivers/staging/gma500/psb_fb.c @@ -441,16 +441,6 @@ static int psbfb_create(struct psb_fbdev *fbdev, info->screen_size = size; memset(info->screen_base, 0, size); - if (dev_priv->pg->stolen_size) { - info->apertures = alloc_apertures(1); - if (!info->apertures) { - ret = -ENOMEM; - goto out_err0; - } - info->apertures->ranges[0].base = dev->mode_config.fb_base; - info->apertures->ranges[0].size = dev_priv->pg->stolen_size; - } - drm_fb_helper_fill_fix(info, fb->pitch, fb->depth); drm_fb_helper_fill_var(info, &fbdev->psb_fb_helper, sizes->fb_width, sizes->fb_height); diff --git a/trunk/drivers/staging/gma500/psb_intel_bios.c b/trunk/drivers/staging/gma500/psb_intel_bios.c index 417965da5e24..48ac8ba7f40b 100644 --- a/trunk/drivers/staging/gma500/psb_intel_bios.c +++ b/trunk/drivers/staging/gma500/psb_intel_bios.c @@ -154,15 +154,10 @@ static void parse_lfp_panel_data(struct drm_psb_private *dev_priv, fill_detail_timing_data(panel_fixed_mode, dvo_timing); - if (panel_fixed_mode->htotal > 0 && panel_fixed_mode->vtotal > 0) { - dev_priv->lfp_lvds_vbt_mode = panel_fixed_mode; - DRM_DEBUG("Found panel mode in BIOS VBT tables:\n"); - drm_mode_debug_printmodeline(panel_fixed_mode); - } else { - DRM_DEBUG("Ignoring bogus LVDS VBT mode.\n"); - dev_priv->lvds_vbt = 0; - kfree(panel_fixed_mode); - } + dev_priv->lfp_lvds_vbt_mode = panel_fixed_mode; + + DRM_DEBUG("Found panel mode in BIOS VBT tables:\n"); + drm_mode_debug_printmodeline(panel_fixed_mode); return; } diff --git a/trunk/drivers/staging/iio/dac/max517.c b/trunk/drivers/staging/iio/dac/max517.c index 2fe34d21b6aa..881768df47a6 100644 --- a/trunk/drivers/staging/iio/dac/max517.c +++ b/trunk/drivers/staging/iio/dac/max517.c @@ -195,7 +195,7 @@ static const struct iio_info max517_info = { }; static const struct iio_info max518_info = { - .attrs = &max518_attribute_group, + .attrs = &max517_attribute_group, .driver_module = THIS_MODULE, }; diff --git a/trunk/drivers/staging/iio/imu/adis16400_ring.c b/trunk/drivers/staging/iio/imu/adis16400_ring.c index 3612373ddede..2589a7e167e4 100644 --- a/trunk/drivers/staging/iio/imu/adis16400_ring.c +++ b/trunk/drivers/staging/iio/imu/adis16400_ring.c @@ -137,13 +137,13 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) if (st->variant->flags & ADIS16400_NO_BURST) { ret = adis16350_spi_read_all(&indio_dev->dev, st->rx); if (ret < 0) - goto err; + return ret; for (; i < ring->scan_count; i++) data[i] = *(s16 *)(st->rx + i*2); } else { ret = adis16400_spi_read_burst(&indio_dev->dev, st->rx); if (ret < 0) - goto err; + return ret; for (; i < indio_dev->ring->scan_count; i++) { j = __ffs(mask); mask &= ~(1 << j); @@ -158,13 +158,9 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) ring->access->store_to(indio_dev->ring, (u8 *) data, pf->timestamp); iio_trigger_notify_done(indio_dev->trig); - kfree(data); - return IRQ_HANDLED; -err: - kfree(data); - return ret; + return IRQ_HANDLED; } void adis16400_unconfigure_ring(struct iio_dev *indio_dev) diff --git a/trunk/drivers/staging/iio/industrialio-trigger.c b/trunk/drivers/staging/iio/industrialio-trigger.c index d504aa251ced..615902333fb0 100644 --- a/trunk/drivers/staging/iio/industrialio-trigger.c +++ b/trunk/drivers/staging/iio/industrialio-trigger.c @@ -294,7 +294,6 @@ struct iio_poll_func pf->h = h; pf->thread = thread; pf->type = type; - pf->private_data = private; return pf; } diff --git a/trunk/drivers/staging/mei/init.c b/trunk/drivers/staging/mei/init.c index d1ffa32cd141..2818851c0761 100644 --- a/trunk/drivers/staging/mei/init.c +++ b/trunk/drivers/staging/mei/init.c @@ -205,10 +205,10 @@ int mei_hw_init(struct mei_device *dev) "host_hw_state = 0x%08x, me_hw_state = 0x%08x.\n", dev->host_hw_state, dev->me_hw_state); - if (!(dev->host_hw_state & H_RDY)) + if (!(dev->host_hw_state & H_RDY) != H_RDY) dev_dbg(&dev->pdev->dev, "host turn off H_RDY.\n"); - if (!(dev->me_hw_state & ME_RDY_HRA)) + if (!(dev->me_hw_state & ME_RDY_HRA) != ME_RDY_HRA) dev_dbg(&dev->pdev->dev, "ME turn off ME_RDY.\n"); printk(KERN_ERR "mei: link layer initialization failed.\n"); diff --git a/trunk/drivers/staging/olpc_dcon/Kconfig b/trunk/drivers/staging/olpc_dcon/Kconfig index fe40e0b6f675..b05306766870 100644 --- a/trunk/drivers/staging/olpc_dcon/Kconfig +++ b/trunk/drivers/staging/olpc_dcon/Kconfig @@ -2,7 +2,6 @@ config FB_OLPC_DCON tristate "One Laptop Per Child Display CONtroller support" depends on OLPC && FB select I2C - select BACKLIGHT_CLASS_DEVICE ---help--- Add support for the OLPC XO DCON controller. This controller is only available on OLPC platforms. Unless you have one of these diff --git a/trunk/drivers/staging/rts_pstor/sd.c b/trunk/drivers/staging/rts_pstor/sd.c index cdae497d5467..bddb0312b31e 100644 --- a/trunk/drivers/staging/rts_pstor/sd.c +++ b/trunk/drivers/staging/rts_pstor/sd.c @@ -2328,7 +2328,7 @@ static int reset_sd(struct rtsx_chip *chip) retval = sd_send_cmd_get_rsp(chip, IO_SEND_OP_COND, 0, SD_RSP_TYPE_R4, rsp, 5); if (retval == STATUS_SUCCESS) { - int func_num = (rsp[1] >> 4) & 0x07; + int func_num = (rsp[1] >> 4) && 0x07; if (func_num) { RTSX_DEBUGP("SD_IO card (Function number: %d)!\n", func_num); chip->sd_io = 1; diff --git a/trunk/drivers/staging/usbip/stub_dev.c b/trunk/drivers/staging/usbip/stub_dev.c index 8cbea42b69bc..6e99ec87fee0 100644 --- a/trunk/drivers/staging/usbip/stub_dev.c +++ b/trunk/drivers/staging/usbip/stub_dev.c @@ -26,8 +26,6 @@ static int stub_probe(struct usb_interface *interface, const struct usb_device_id *id); static void stub_disconnect(struct usb_interface *interface); -static int stub_pre_reset(struct usb_interface *interface); -static int stub_post_reset(struct usb_interface *interface); /* * Define device IDs here if you want to explicitly limit exportable devices. @@ -61,8 +59,6 @@ struct usb_driver stub_driver = { .probe = stub_probe, .disconnect = stub_disconnect, .id_table = stub_table, - .pre_reset = stub_pre_reset, - .post_reset = stub_post_reset, }; /* @@ -545,20 +541,3 @@ static void stub_disconnect(struct usb_interface *interface) del_match_busid((char *)udev_busid); } } - -/* - * Presence of pre_reset and post_reset prevents the driver from being unbound - * when the device is being reset - */ - -int stub_pre_reset(struct usb_interface *interface) -{ - dev_dbg(&interface->dev, "pre_reset\n"); - return 0; -} - -int stub_post_reset(struct usb_interface *interface) -{ - dev_dbg(&interface->dev, "post_reset\n"); - return 0; -} diff --git a/trunk/drivers/staging/usbip/stub_rx.c b/trunk/drivers/staging/usbip/stub_rx.c index bc57844600b9..a5c1fa1f0430 100644 --- a/trunk/drivers/staging/usbip/stub_rx.c +++ b/trunk/drivers/staging/usbip/stub_rx.c @@ -175,18 +175,16 @@ static int tweak_reset_device_cmd(struct urb *urb) dev_info(&urb->dev->dev, "usb_queue_reset_device\n"); /* - * With the implementation of pre_reset and post_reset the driver no - * longer unbinds. This allows the use of synchronous reset. + * usb_lock_device_for_reset caused a deadlock: it causes the driver + * to unbind. In the shutdown the rx thread is signalled to shut down + * but this thread is pending in the usb_lock_device_for_reset. + * + * Instead queue the reset. + * + * Unfortunatly an existing usbip connection will be dropped due to + * driver unbinding. */ - - if (usb_lock_device_for_reset(sdev->udev, sdev->interface)<0) - { - dev_err(&urb->dev->dev, "could not obtain lock to reset device\n"); - return 0; - } - usb_reset_device(sdev->udev); - usb_unlock_device(sdev->udev); - + usb_queue_reset_device(sdev->interface); return 0; } diff --git a/trunk/drivers/xen/swiotlb-xen.c b/trunk/drivers/xen/swiotlb-xen.c index 6e8c15a23201..65ea21a97492 100644 --- a/trunk/drivers/xen/swiotlb-xen.c +++ b/trunk/drivers/xen/swiotlb-xen.c @@ -147,15 +147,9 @@ void __init xen_swiotlb_init(int verbose) { unsigned long bytes; int rc; - unsigned long nr_tbl; - - nr_tbl = swioltb_nr_tbl(); - if (nr_tbl) - xen_io_tlb_nslabs = nr_tbl; - else { - xen_io_tlb_nslabs = (64 * 1024 * 1024 >> IO_TLB_SHIFT); - xen_io_tlb_nslabs = ALIGN(xen_io_tlb_nslabs, IO_TLB_SEGSIZE); - } + + xen_io_tlb_nslabs = (64 * 1024 * 1024 >> IO_TLB_SHIFT); + xen_io_tlb_nslabs = ALIGN(xen_io_tlb_nslabs, IO_TLB_SEGSIZE); bytes = xen_io_tlb_nslabs << IO_TLB_SHIFT; diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 97e0d52d72fd..ea5f748906a8 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -1093,7 +1093,6 @@ int flush_old_exec(struct linux_binprm * bprm) bprm->mm = NULL; /* We're using it now */ - set_fs(USER_DS); current->flags &= ~(PF_RANDOMIZE | PF_KTHREAD); flush_thread(); current->personality &= ~bprm->per_clear; @@ -1358,6 +1357,10 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) if (retval) return retval; + /* kernel module loader fixup */ + /* so we don't try to load run modprobe in kernel space. */ + set_fs(USER_DS); + retval = audit_bprm(bprm); if (retval) return retval; diff --git a/trunk/include/linux/seqlock.h b/trunk/include/linux/seqlock.h index c6db9fb33c44..e9811892844f 100644 --- a/trunk/include/linux/seqlock.h +++ b/trunk/include/linux/seqlock.h @@ -28,7 +28,6 @@ #include #include -#include typedef struct { unsigned sequence; diff --git a/trunk/include/linux/swiotlb.h b/trunk/include/linux/swiotlb.h index 445702c60d04..8c0e349f4a6c 100644 --- a/trunk/include/linux/swiotlb.h +++ b/trunk/include/linux/swiotlb.h @@ -24,7 +24,6 @@ extern int swiotlb_force; extern void swiotlb_init(int verbose); extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); -extern unsigned long swioltb_nr_tbl(void); /* * Enumeration for sync targets diff --git a/trunk/drivers/staging/altera-stapl/altera.h b/trunk/include/staging/altera.h similarity index 100% rename from trunk/drivers/staging/altera-stapl/altera.h rename to trunk/include/staging/altera.h diff --git a/trunk/lib/swiotlb.c b/trunk/lib/swiotlb.c index 99093b396145..93ca08b8a451 100644 --- a/trunk/lib/swiotlb.c +++ b/trunk/lib/swiotlb.c @@ -110,11 +110,6 @@ setup_io_tlb_npages(char *str) __setup("swiotlb=", setup_io_tlb_npages); /* make io_tlb_overflow tunable too? */ -unsigned long swioltb_nr_tbl(void) -{ - return io_tlb_nslabs; -} - /* Note that this doesn't work with highmem page */ static dma_addr_t swiotlb_virt_to_bus(struct device *hwdev, volatile void *address) diff --git a/trunk/lib/vsprintf.c b/trunk/lib/vsprintf.c index 4365df31a1d5..c11205688fb4 100644 --- a/trunk/lib/vsprintf.c +++ b/trunk/lib/vsprintf.c @@ -666,8 +666,6 @@ char *ip6_compressed_string(char *p, const char *addr) colonpos = i; } } - if (longest == 1) /* don't compress a single 0 */ - colonpos = -1; /* emit address */ for (i = 0; i < range; i++) { @@ -828,7 +826,7 @@ int kptr_restrict __read_mostly; * IPv4 uses dot-separated decimal with leading 0's (010.123.045.006) * - '[Ii]4[hnbl]' IPv4 addresses in host, network, big or little endian order * - 'I6c' for IPv6 addresses printed as specified by - * http://tools.ietf.org/html/rfc5952 + * http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-00 * - 'U' For a 16 byte UUID/GUID, it prints the UUID/GUID in the form * "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" * Options for %pU are: diff --git a/trunk/scripts/Makefile.asm-generic b/trunk/scripts/Makefile.asm-generic index 40caf3c26cd5..490122c3e2aa 100644 --- a/trunk/scripts/Makefile.asm-generic +++ b/trunk/scripts/Makefile.asm-generic @@ -17,7 +17,6 @@ quiet_cmd_wrap = WRAP $@ cmd_wrap = echo "\#include " >$@ all: $(patsubst %, $(obj)/%, $(generic-y)) - @: $(obj)/%.h: $(call cmd,wrap) diff --git a/trunk/scripts/depmod.sh b/trunk/scripts/depmod.sh deleted file mode 100755 index 3b029cba2baf..000000000000 --- a/trunk/scripts/depmod.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# -# A depmod wrapper used by the toplevel Makefile - -if test $# -ne 2; then - echo "Usage: $0 /sbin/depmod " >&2 - exit 1 -fi -DEPMOD=$1 -KERNELRELEASE=$2 - -if ! "$DEPMOD" -V 2>/dev/null | grep -q module-init-tools; then - echo "Warning: you may need to install module-init-tools" >&2 - echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt" >&2 - sleep 1 -fi - -if ! test -r System.map -a -x "$DEPMOD"; then - exit 0 -fi -# older versions of depmod require the version string to start with three -# numbers, so we cheat with a symlink here -depmod_hack_needed=true -mkdir -p .tmp_depmod/lib/modules/$KERNELRELEASE -if "$DEPMOD" -b .tmp_depmod $KERNELRELEASE 2>/dev/null; then - if test -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep -o \ - -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep.bin; then - depmod_hack_needed=false - fi -fi -if $depmod_hack_needed; then - symlink="$INSTALL_MOD_PATH/lib/modules/99.98.$KERNELRELEASE" - ln -s "$KERNELRELEASE" "$symlink" - KERNELRELEASE=99.98.$KERNELRELEASE -fi - -set -- -ae -F System.map -if test -n "$INSTALL_MOD_PATH"; then - set -- "$@" -b "$INSTALL_MOD_PATH" -fi -"$DEPMOD" "$@" "$KERNELRELEASE" -ret=$? - -if $depmod_hack_needed; then - rm -f "$symlink" -fi - -exit $ret diff --git a/trunk/security/apparmor/lsm.c b/trunk/security/apparmor/lsm.c index ec1bcecf2cda..3d2fd141dff7 100644 --- a/trunk/security/apparmor/lsm.c +++ b/trunk/security/apparmor/lsm.c @@ -612,7 +612,7 @@ static int apparmor_setprocattr(struct task_struct *task, char *name, static int apparmor_task_setrlimit(struct task_struct *task, unsigned int resource, struct rlimit *new_rlim) { - struct aa_profile *profile = aa_current_profile(); + struct aa_profile *profile = __aa_current_profile(); int error = 0; if (!unconfined(profile)) diff --git a/trunk/tools/perf/util/PERF-VERSION-GEN b/trunk/tools/perf/util/PERF-VERSION-GEN index 9c5fb4d93824..26d4d3fd6deb 100755 --- a/trunk/tools/perf/util/PERF-VERSION-GEN +++ b/trunk/tools/perf/util/PERF-VERSION-GEN @@ -23,7 +23,12 @@ if test -d ../../.git -o -f ../../.git && then VN=$(echo "$VN" | sed -e 's/-/./g'); else - VN=$(make -sC ../.. kernelversion) + eval $(grep '^VERSION[[:space:]]*=' ../../Makefile|tr -d ' ') + eval $(grep '^PATCHLEVEL[[:space:]]*=' ../../Makefile|tr -d ' ') + eval $(grep '^SUBLEVEL[[:space:]]*=' ../../Makefile|tr -d ' ') + eval $(grep '^EXTRAVERSION[[:space:]]*=' ../../Makefile|tr -d ' ') + + VN="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}" fi VN=$(expr "$VN" : v*'\(.*\)')