aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/module.c8
-rw-r--r--arch/alpha/kernel/osf_sys.c4
-rw-r--r--arch/alpha/kernel/sys_marvel.c5
-rw-r--r--arch/arm/common/locomo.c101
-rw-r--r--arch/arm/configs/s3c2410_defconfig218
-rw-r--r--arch/arm/mach-clps7500/core.c2
-rw-r--r--arch/arm/mach-ebsa110/core.c2
-rw-r--r--arch/arm/mach-epxa10db/arch.c2
-rw-r--r--arch/arm/mach-footbridge/isa.c2
-rw-r--r--arch/arm/mach-h720x/cpu-h7202.c2
-rw-r--r--arch/arm/mach-ixp2000/core.c2
-rw-r--r--arch/arm/mach-ixp4xx/coyote-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c2
-rw-r--r--arch/arm/mach-omap1/Kconfig8
-rw-r--r--arch/arm/mach-omap1/Makefile3
-rw-r--r--arch/arm/mach-omap1/board-generic.c38
-rw-r--r--arch/arm/mach-omap1/board-h2.c27
-rw-r--r--arch/arm/mach-omap1/board-h3.c17
-rw-r--r--arch/arm/mach-omap1/board-innovator.c13
-rw-r--r--arch/arm/mach-omap1/board-netstar.c9
-rw-r--r--arch/arm/mach-omap1/board-osk.c124
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c5
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c64
-rw-r--r--arch/arm/mach-omap1/devices.c351
-rw-r--r--arch/arm/mach-omap1/fpga.c4
-rw-r--r--arch/arm/mach-omap1/io.c30
-rw-r--r--arch/arm/mach-omap1/irq.c2
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c3
-rw-r--r--arch/arm/mach-omap1/leds-innovator.c2
-rw-r--r--arch/arm/mach-omap1/leds-osk.c8
-rw-r--r--arch/arm/mach-omap1/leds.c12
-rw-r--r--arch/arm/mach-omap1/serial.c86
-rw-r--r--arch/arm/mach-omap1/time.c40
-rw-r--r--arch/arm/mach-pxa/corgi_ssp.c2
-rw-r--r--arch/arm/mach-rpc/riscpc.c2
-rw-r--r--arch/arm/mach-s3c2410/devs.c11
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c51
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c2
-rw-r--r--arch/arm/mach-shark/core.c2
-rw-r--r--arch/arm/mm/flush.c52
-rw-r--r--arch/i386/boot/video.S7
-rw-r--r--arch/i386/kernel/cpu/cpufreq/longhaul.c4
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c20
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-smi.c2
-rw-r--r--arch/i386/kernel/io_apic.c4
-rw-r--r--arch/i386/kernel/mpparse.c24
-rw-r--r--arch/i386/kernel/ptrace.c22
-rw-r--r--arch/i386/kernel/setup.c17
-rw-r--r--arch/i386/kernel/sigframe.h8
-rw-r--r--arch/i386/kernel/time.c3
-rw-r--r--arch/i386/pci/i386.c6
-rw-r--r--arch/ia64/Kconfig6
-rw-r--r--arch/ia64/configs/sn2_defconfig1
-rw-r--r--arch/ia64/configs/tiger_defconfig1
-rw-r--r--arch/ia64/configs/zx1_defconfig1
-rw-r--r--arch/ia64/defconfig3
-rw-r--r--arch/ia64/kernel/acpi.c2
-rw-r--r--arch/ia64/kernel/entry.S29
-rw-r--r--arch/ia64/kernel/iosapic.c2
-rw-r--r--arch/ia64/kernel/perfmon.c9
-rw-r--r--arch/ia64/lib/memcpy_mck.S3
-rw-r--r--arch/ia64/mm/fault.c6
-rw-r--r--arch/ia64/pci/pci.c2
-rw-r--r--arch/ia64/sn/kernel/setup.c2
-rw-r--r--arch/ia64/sn/kernel/xpc_main.c4
-rw-r--r--arch/ia64/sn/kernel/xpnet.c6
-rw-r--r--arch/m68k/amiga/amisound.c2
-rw-r--r--arch/m68k/mac/macboing.c3
-rw-r--r--arch/m68knommu/platform/523x/Makefile19
-rw-r--r--arch/m68knommu/platform/5272/config.c6
-rw-r--r--arch/m68knommu/platform/5307/Makefile1
-rw-r--r--arch/m68knommu/platform/68328/config.c94
-rw-r--r--arch/m68knommu/platform/68328/timers.c106
-rw-r--r--arch/m68knommu/platform/68EZ328/config.c80
-rw-r--r--arch/m68knommu/platform/68VZ328/config.c (renamed from arch/m68knommu/platform/68VZ328/de2/config.c)141
-rw-r--r--arch/m68knommu/platform/68VZ328/ucdimm/config.c117
-rw-r--r--arch/mips/Kconfig7
-rw-r--r--arch/mips/configs/tb0287_defconfig1041
-rw-r--r--arch/mips/kernel/genrtc.c2
-rw-r--r--arch/mips/kernel/i8259.c2
-rw-r--r--arch/mips/kernel/irixioctl.c5
-rw-r--r--arch/mips/pci/Makefile1
-rw-r--r--arch/mips/pci/fixup-tb0287.c65
-rw-r--r--arch/ppc/8xx_io/cs4218_tdm.c2
-rw-r--r--arch/ppc/Kconfig10
-rw-r--r--arch/ppc/boot/common/ns16550.c8
-rw-r--r--arch/ppc/boot/common/util.S2
-rw-r--r--arch/ppc/kernel/Makefile3
-rw-r--r--arch/ppc/kernel/pci.c1
-rw-r--r--arch/ppc/kernel/syscalls.c4
-rw-r--r--arch/ppc/kernel/traps.c2
-rw-r--r--arch/ppc/platforms/4xx/ebony.c13
-rw-r--r--arch/ppc/platforms/hdpu.c2
-rw-r--r--arch/ppc/syslib/ibm440gx_common.c7
-rw-r--r--arch/ppc/syslib/mpc10x_common.c4
-rw-r--r--arch/ppc/syslib/mpc83xx_devices.c2
-rw-r--r--arch/ppc/syslib/mpc85xx_devices.c2
-rw-r--r--arch/ppc/syslib/mv64x60.c2
-rw-r--r--arch/ppc/syslib/qspan_pci.c2
-rw-r--r--arch/ppc64/Makefile21
-rw-r--r--arch/ppc64/boot/Makefile53
-rw-r--r--arch/ppc64/boot/main.c31
-rw-r--r--arch/ppc64/kernel/bpa_iic.c28
-rw-r--r--arch/ppc64/kernel/eeh.c86
-rw-r--r--arch/ppc64/kernel/iSeries_VpdInfo.c5
-rw-r--r--arch/ppc64/kernel/iomap.c32
-rw-r--r--arch/ppc64/kernel/iommu.c3
-rw-r--r--arch/ppc64/kernel/maple_pci.c4
-rw-r--r--arch/ppc64/kernel/misc.S6
-rw-r--r--arch/ppc64/kernel/pSeries_iommu.c72
-rw-r--r--arch/ppc64/kernel/pci.c67
-rw-r--r--arch/ppc64/kernel/pci.h1
-rw-r--r--arch/ppc64/kernel/pci_dn.c47
-rw-r--r--arch/ppc64/kernel/pci_iommu.c2
-rw-r--r--arch/ppc64/kernel/pmac_feature.c8
-rw-r--r--arch/ppc64/kernel/pmac_pci.c6
-rw-r--r--arch/ppc64/kernel/pmc.c2
-rw-r--r--arch/ppc64/kernel/prom.c1
-rw-r--r--arch/ppc64/kernel/rtas_pci.c39
-rw-r--r--arch/ppc64/kernel/setup.c2
-rw-r--r--arch/ppc64/kernel/sys_ppc32.c55
-rw-r--r--arch/ppc64/kernel/syscalls.c4
-rw-r--r--arch/ppc64/kernel/u3_iommu.c4
-rw-r--r--arch/ppc64/kernel/udbg.c6
-rw-r--r--arch/ppc64/mm/init.c4
-rw-r--r--arch/s390/Makefile2
-rw-r--r--arch/sparc/lib/atomic32.c2
-rw-r--r--arch/sparc64/kernel/pci.c127
-rw-r--r--arch/sparc64/kernel/pci_psycho.c34
-rw-r--r--arch/sparc64/kernel/pci_sabre.c36
-rw-r--r--arch/sparc64/kernel/pci_schizo.c48
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c9
-rw-r--r--arch/sparc64/lib/Makefile2
-rw-r--r--arch/sparc64/lib/mb.S73
-rw-r--r--arch/sparc64/solaris/ioctl.c15
-rw-r--r--arch/sparc64/solaris/timod.c29
-rw-r--r--arch/um/Makefile-x86_641
-rw-r--r--arch/um/kernel/skas/include/uaccess-skas.h14
-rw-r--r--arch/um/kernel/tt/include/uaccess-tt.h14
-rw-r--r--arch/um/scripts/Makefile.rules5
-rw-r--r--arch/x86_64/ia32/ia32_ioctl.c17
-rw-r--r--arch/x86_64/kernel/e820.c16
-rw-r--r--arch/x86_64/kernel/genapic_flat.c10
-rw-r--r--arch/x86_64/kernel/io_apic.c4
-rw-r--r--arch/x86_64/kernel/smpboot.c19
147 files changed, 3134 insertions, 1208 deletions
diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c
index fc271e316a38..aac6d4b22f7a 100644
--- a/arch/alpha/kernel/module.c
+++ b/arch/alpha/kernel/module.c
@@ -47,7 +47,7 @@ module_free(struct module *mod, void *module_region)
47 47
48struct got_entry { 48struct got_entry {
49 struct got_entry *next; 49 struct got_entry *next;
50 Elf64_Addr r_offset; 50 Elf64_Sxword r_addend;
51 int got_offset; 51 int got_offset;
52}; 52};
53 53
@@ -57,14 +57,14 @@ process_reloc_for_got(Elf64_Rela *rela,
57{ 57{
58 unsigned long r_sym = ELF64_R_SYM (rela->r_info); 58 unsigned long r_sym = ELF64_R_SYM (rela->r_info);
59 unsigned long r_type = ELF64_R_TYPE (rela->r_info); 59 unsigned long r_type = ELF64_R_TYPE (rela->r_info);
60 Elf64_Addr r_offset = rela->r_offset; 60 Elf64_Sxword r_addend = rela->r_addend;
61 struct got_entry *g; 61 struct got_entry *g;
62 62
63 if (r_type != R_ALPHA_LITERAL) 63 if (r_type != R_ALPHA_LITERAL)
64 return; 64 return;
65 65
66 for (g = chains + r_sym; g ; g = g->next) 66 for (g = chains + r_sym; g ; g = g->next)
67 if (g->r_offset == r_offset) { 67 if (g->r_addend == r_addend) {
68 if (g->got_offset == 0) { 68 if (g->got_offset == 0) {
69 g->got_offset = *poffset; 69 g->got_offset = *poffset;
70 *poffset += 8; 70 *poffset += 8;
@@ -74,7 +74,7 @@ process_reloc_for_got(Elf64_Rela *rela,
74 74
75 g = kmalloc (sizeof (*g), GFP_KERNEL); 75 g = kmalloc (sizeof (*g), GFP_KERNEL);
76 g->next = chains[r_sym].next; 76 g->next = chains[r_sym].next;
77 g->r_offset = r_offset; 77 g->r_addend = r_addend;
78 g->got_offset = *poffset; 78 g->got_offset = *poffset;
79 *poffset += 8; 79 *poffset += 8;
80 chains[r_sym].next = g; 80 chains[r_sym].next = g;
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 167fd89f8707..2b034182a0ca 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -974,6 +974,7 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
974 size_t size; 974 size_t size;
975 long timeout; 975 long timeout;
976 int ret = -EINVAL; 976 int ret = -EINVAL;
977 struct fdtable *fdt;
977 978
978 timeout = MAX_SCHEDULE_TIMEOUT; 979 timeout = MAX_SCHEDULE_TIMEOUT;
979 if (tvp) { 980 if (tvp) {
@@ -995,7 +996,8 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
995 } 996 }
996 } 997 }
997 998
998 if (n < 0 || n > current->files->max_fdset) 999 fdt = files_fdtable(current->files);
1000 if (n < 0 || n > fdt->max_fdset)
999 goto out_nofds; 1001 goto out_nofds;
1000 1002
1001 /* 1003 /*
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index 804727853d25..e32fee505220 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -373,12 +373,11 @@ marvel_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
373 irq += 0x80; /* offset for lsi */ 373 irq += 0x80; /* offset for lsi */
374 374
375#if 1 375#if 1
376 printk("PCI:%d:%d:%d (hose %d) [%s] is using MSI\n", 376 printk("PCI:%d:%d:%d (hose %d) is using MSI\n",
377 dev->bus->number, 377 dev->bus->number,
378 PCI_SLOT(dev->devfn), 378 PCI_SLOT(dev->devfn),
379 PCI_FUNC(dev->devfn), 379 PCI_FUNC(dev->devfn),
380 hose->index, 380 hose->index);
381 pci_pretty_name (dev));
382 printk(" %d message(s) from 0x%04x\n", 381 printk(" %d message(s) from 0x%04x\n",
383 1 << ((msg_ctl & PCI_MSI_FLAGS_QSIZE) >> 4), 382 1 << ((msg_ctl & PCI_MSI_FLAGS_QSIZE) >> 4),
384 msg_dat); 383 msg_dat);
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index 51f430cc2fbf..2786f7c34b3f 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -541,6 +541,103 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
541 return ret; 541 return ret;
542} 542}
543 543
544#ifdef CONFIG_PM
545
546struct locomo_save_data {
547 u16 LCM_GPO;
548 u16 LCM_SPICT;
549 u16 LCM_GPE;
550 u16 LCM_ASD;
551 u16 LCM_SPIMD;
552};
553
554static int locomo_suspend(struct device *dev, u32 pm_message_t, u32 level)
555{
556 struct locomo *lchip = dev_get_drvdata(dev);
557 struct locomo_save_data *save;
558 unsigned long flags;
559
560 if (level != SUSPEND_DISABLE)
561 return 0;
562
563 save = kmalloc(sizeof(struct locomo_save_data), GFP_KERNEL);
564 if (!save)
565 return -ENOMEM;
566
567 dev->power.saved_state = (void *) save;
568
569 spin_lock_irqsave(&lchip->lock, flags);
570
571 save->LCM_GPO = locomo_readl(lchip->base + LOCOMO_GPO); /* GPIO */
572 locomo_writel(0x00, lchip->base + LOCOMO_GPO);
573 save->LCM_SPICT = locomo_readl(lchip->base + LOCOMO_SPICT); /* SPI */
574 locomo_writel(0x40, lchip->base + LOCOMO_SPICT);
575 save->LCM_GPE = locomo_readl(lchip->base + LOCOMO_GPE); /* GPIO */
576 locomo_writel(0x00, lchip->base + LOCOMO_GPE);
577 save->LCM_ASD = locomo_readl(lchip->base + LOCOMO_ASD); /* ADSTART */
578 locomo_writel(0x00, lchip->base + LOCOMO_ASD);
579 save->LCM_SPIMD = locomo_readl(lchip->base + LOCOMO_SPIMD); /* SPI */
580 locomo_writel(0x3C14, lchip->base + LOCOMO_SPIMD);
581
582 locomo_writel(0x00, lchip->base + LOCOMO_PAIF);
583 locomo_writel(0x00, lchip->base + LOCOMO_DAC);
584 locomo_writel(0x00, lchip->base + LOCOMO_BACKLIGHT + LOCOMO_TC);
585
586 if ( (locomo_readl(lchip->base + LOCOMO_LED + LOCOMO_LPT0) & 0x88) && (locomo_readl(lchip->base + LOCOMO_LED + LOCOMO_LPT1) & 0x88) )
587 locomo_writel(0x00, lchip->base + LOCOMO_C32K); /* CLK32 off */
588 else
589 /* 18MHz already enabled, so no wait */
590 locomo_writel(0xc1, lchip->base + LOCOMO_C32K); /* CLK32 on */
591
592 locomo_writel(0x00, lchip->base + LOCOMO_TADC); /* 18MHz clock off*/
593 locomo_writel(0x00, lchip->base + LOCOMO_AUDIO + LOCOMO_ACC); /* 22MHz/24MHz clock off */
594 locomo_writel(0x00, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS); /* FL */
595
596 spin_unlock_irqrestore(&lchip->lock, flags);
597
598 return 0;
599}
600
601static int locomo_resume(struct device *dev, u32 level)
602{
603 struct locomo *lchip = dev_get_drvdata(dev);
604 struct locomo_save_data *save;
605 unsigned long r;
606 unsigned long flags;
607
608 if (level != RESUME_ENABLE)
609 return 0;
610
611 save = (struct locomo_save_data *) dev->power.saved_state;
612 if (!save)
613 return 0;
614
615 spin_lock_irqsave(&lchip->lock, flags);
616
617 locomo_writel(save->LCM_GPO, lchip->base + LOCOMO_GPO);
618 locomo_writel(save->LCM_SPICT, lchip->base + LOCOMO_SPICT);
619 locomo_writel(save->LCM_GPE, lchip->base + LOCOMO_GPE);
620 locomo_writel(save->LCM_ASD, lchip->base + LOCOMO_ASD);
621 locomo_writel(save->LCM_SPIMD, lchip->base + LOCOMO_SPIMD);
622
623 locomo_writel(0x00, lchip->base + LOCOMO_C32K);
624 locomo_writel(0x90, lchip->base + LOCOMO_TADC);
625
626 locomo_writel(0, lchip->base + LOCOMO_KEYBOARD + LOCOMO_KSC);
627 r = locomo_readl(lchip->base + LOCOMO_KEYBOARD + LOCOMO_KIC);
628 r &= 0xFEFF;
629 locomo_writel(r, lchip->base + LOCOMO_KEYBOARD + LOCOMO_KIC);
630 locomo_writel(0x1, lchip->base + LOCOMO_KEYBOARD + LOCOMO_KCMD);
631
632 spin_unlock_irqrestore(&lchip->lock, flags);
633
634 dev->power.saved_state = NULL;
635 kfree(save);
636
637 return 0;
638}
639#endif
640
544/** 641/**
545 * locomo_probe - probe for a single LoCoMo chip. 642 * locomo_probe - probe for a single LoCoMo chip.
546 * @phys_addr: physical address of device. 643 * @phys_addr: physical address of device.
@@ -707,6 +804,10 @@ static struct device_driver locomo_device_driver = {
707 .bus = &platform_bus_type, 804 .bus = &platform_bus_type,
708 .probe = locomo_probe, 805 .probe = locomo_probe,
709 .remove = locomo_remove, 806 .remove = locomo_remove,
807#ifdef CONFIG_PM
808 .suspend = locomo_suspend,
809 .resume = locomo_resume,
810#endif
710}; 811};
711 812
712/* 813/*
diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
index 96a794d8de84..756348bf5170 100644
--- a/arch/arm/configs/s3c2410_defconfig
+++ b/arch/arm/configs/s3c2410_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-git4 3# Linux kernel version: 2.6.13-git8
4# Wed Jun 22 15:56:42 2005 4# Thu Sep 8 19:24:02 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -22,6 +22,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
22# General setup 22# General setup
23# 23#
24CONFIG_LOCALVERSION="" 24CONFIG_LOCALVERSION=""
25CONFIG_LOCALVERSION_AUTO=y
25CONFIG_SWAP=y 26CONFIG_SWAP=y
26CONFIG_SYSVIPC=y 27CONFIG_SYSVIPC=y
27# CONFIG_POSIX_MQUEUE is not set 28# CONFIG_POSIX_MQUEUE is not set
@@ -31,6 +32,7 @@ CONFIG_SYSCTL=y
31# CONFIG_HOTPLUG is not set 32# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y 33CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set 34# CONFIG_IKCONFIG is not set
35CONFIG_INITRAMFS_SOURCE=""
34# CONFIG_EMBEDDED is not set 36# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y 37CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 38# CONFIG_KALLSYMS_ALL is not set
@@ -88,7 +90,9 @@ CONFIG_ARCH_S3C2410=y
88# 90#
89# S3C24XX Implementations 91# S3C24XX Implementations
90# 92#
93CONFIG_MACH_ANUBIS=y
91CONFIG_ARCH_BAST=y 94CONFIG_ARCH_BAST=y
95CONFIG_BAST_PC104_IRQ=y
92CONFIG_ARCH_H1940=y 96CONFIG_ARCH_H1940=y
93CONFIG_MACH_N30=y 97CONFIG_MACH_N30=y
94CONFIG_ARCH_SMDK2410=y 98CONFIG_ARCH_SMDK2410=y
@@ -112,6 +116,7 @@ CONFIG_S3C2410_DMA=y
112# CONFIG_S3C2410_DMA_DEBUG is not set 116# CONFIG_S3C2410_DMA_DEBUG is not set
113# CONFIG_S3C2410_PM_DEBUG is not set 117# CONFIG_S3C2410_PM_DEBUG is not set
114# CONFIG_S3C2410_PM_CHECK is not set 118# CONFIG_S3C2410_PM_CHECK is not set
119CONFIG_PM_SIMTEC=y
115CONFIG_S3C2410_LOWLEVEL_UART_PORT=0 120CONFIG_S3C2410_LOWLEVEL_UART_PORT=0
116 121
117# 122#
@@ -149,7 +154,15 @@ CONFIG_ISA_DMA_API=y
149# 154#
150# CONFIG_SMP is not set 155# CONFIG_SMP is not set
151# CONFIG_PREEMPT is not set 156# CONFIG_PREEMPT is not set
152# CONFIG_DISCONTIGMEM is not set 157# CONFIG_NO_IDLE_HZ is not set
158# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
159CONFIG_SELECT_MEMORY_MODEL=y
160CONFIG_FLATMEM_MANUAL=y
161# CONFIG_DISCONTIGMEM_MANUAL is not set
162# CONFIG_SPARSEMEM_MANUAL is not set
163CONFIG_FLATMEM=y
164CONFIG_FLAT_NODE_MEM_MAP=y
165# CONFIG_SPARSEMEM_STATIC is not set
153CONFIG_ALIGNMENT_TRAP=y 166CONFIG_ALIGNMENT_TRAP=y
154 167
155# 168#
@@ -186,6 +199,74 @@ CONFIG_PM=y
186CONFIG_APM=y 199CONFIG_APM=y
187 200
188# 201#
202# Networking
203#
204CONFIG_NET=y
205
206#
207# Networking options
208#
209# CONFIG_PACKET is not set
210CONFIG_UNIX=y
211# CONFIG_NET_KEY is not set
212CONFIG_INET=y
213# CONFIG_IP_MULTICAST is not set
214# CONFIG_IP_ADVANCED_ROUTER is not set
215CONFIG_IP_FIB_HASH=y
216CONFIG_IP_PNP=y
217# CONFIG_IP_PNP_DHCP is not set
218CONFIG_IP_PNP_BOOTP=y
219# CONFIG_IP_PNP_RARP is not set
220# CONFIG_NET_IPIP is not set
221# CONFIG_NET_IPGRE is not set
222# CONFIG_ARPD is not set
223# CONFIG_SYN_COOKIES is not set
224# CONFIG_INET_AH is not set
225# CONFIG_INET_ESP is not set
226# CONFIG_INET_IPCOMP is not set
227# CONFIG_INET_TUNNEL is not set
228CONFIG_INET_DIAG=y
229CONFIG_INET_TCP_DIAG=y
230# CONFIG_TCP_CONG_ADVANCED is not set
231CONFIG_TCP_CONG_BIC=y
232# CONFIG_IPV6 is not set
233# CONFIG_NETFILTER is not set
234
235#
236# DCCP Configuration (EXPERIMENTAL)
237#
238# CONFIG_IP_DCCP is not set
239
240#
241# SCTP Configuration (EXPERIMENTAL)
242#
243# CONFIG_IP_SCTP is not set
244# CONFIG_ATM is not set
245# CONFIG_BRIDGE is not set
246# CONFIG_VLAN_8021Q is not set
247# CONFIG_DECNET is not set
248# CONFIG_LLC2 is not set
249# CONFIG_IPX is not set
250# CONFIG_ATALK is not set
251# CONFIG_X25 is not set
252# CONFIG_LAPB is not set
253# CONFIG_NET_DIVERT is not set
254# CONFIG_ECONET is not set
255# CONFIG_WAN_ROUTER is not set
256# CONFIG_NET_SCHED is not set
257# CONFIG_NET_CLS_ROUTE is not set
258
259#
260# Network testing
261#
262# CONFIG_NET_PKTGEN is not set
263# CONFIG_NETFILTER_NETLINK is not set
264# CONFIG_HAMRADIO is not set
265# CONFIG_IRDA is not set
266# CONFIG_BT is not set
267# CONFIG_IEEE80211 is not set
268
269#
189# Device Drivers 270# Device Drivers
190# 271#
191 272
@@ -258,6 +339,7 @@ CONFIG_MTD_ROM=y
258# CONFIG_MTD_IMPA7 is not set 339# CONFIG_MTD_IMPA7 is not set
259CONFIG_MTD_BAST=y 340CONFIG_MTD_BAST=y
260CONFIG_MTD_BAST_MAXSIZE=4 341CONFIG_MTD_BAST_MAXSIZE=4
342# CONFIG_MTD_PLATRAM is not set
261 343
262# 344#
263# Self-contained MTD device drivers 345# Self-contained MTD device drivers
@@ -312,7 +394,6 @@ CONFIG_BLK_DEV_RAM=y
312CONFIG_BLK_DEV_RAM_COUNT=16 394CONFIG_BLK_DEV_RAM_COUNT=16
313CONFIG_BLK_DEV_RAM_SIZE=4096 395CONFIG_BLK_DEV_RAM_SIZE=4096
314CONFIG_BLK_DEV_INITRD=y 396CONFIG_BLK_DEV_INITRD=y
315CONFIG_INITRAMFS_SOURCE=""
316# CONFIG_CDROM_PKTCDVD is not set 397# CONFIG_CDROM_PKTCDVD is not set
317 398
318# 399#
@@ -354,6 +435,7 @@ CONFIG_BLK_DEV_IDE_BAST=y
354# 435#
355# SCSI device support 436# SCSI device support
356# 437#
438# CONFIG_RAID_ATTRS is not set
357# CONFIG_SCSI is not set 439# CONFIG_SCSI is not set
358 440
359# 441#
@@ -376,70 +458,8 @@ CONFIG_BLK_DEV_IDE_BAST=y
376# 458#
377 459
378# 460#
379# Networking support 461# Network device support
380#
381CONFIG_NET=y
382
383#
384# Networking options
385# 462#
386# CONFIG_PACKET is not set
387CONFIG_UNIX=y
388# CONFIG_NET_KEY is not set
389CONFIG_INET=y
390CONFIG_IP_FIB_HASH=y
391# CONFIG_IP_FIB_TRIE is not set
392# CONFIG_IP_MULTICAST is not set
393# CONFIG_IP_ADVANCED_ROUTER is not set
394CONFIG_IP_PNP=y
395# CONFIG_IP_PNP_DHCP is not set
396CONFIG_IP_PNP_BOOTP=y
397# CONFIG_IP_PNP_RARP is not set
398# CONFIG_NET_IPIP is not set
399# CONFIG_NET_IPGRE is not set
400# CONFIG_ARPD is not set
401# CONFIG_SYN_COOKIES is not set
402# CONFIG_INET_AH is not set
403# CONFIG_INET_ESP is not set
404# CONFIG_INET_IPCOMP is not set
405# CONFIG_INET_TUNNEL is not set
406CONFIG_IP_TCPDIAG=y
407# CONFIG_IP_TCPDIAG_IPV6 is not set
408# CONFIG_IPV6 is not set
409# CONFIG_NETFILTER is not set
410
411#
412# SCTP Configuration (EXPERIMENTAL)
413#
414# CONFIG_IP_SCTP is not set
415# CONFIG_ATM is not set
416# CONFIG_BRIDGE is not set
417# CONFIG_VLAN_8021Q is not set
418# CONFIG_DECNET is not set
419# CONFIG_LLC2 is not set
420# CONFIG_IPX is not set
421# CONFIG_ATALK is not set
422# CONFIG_X25 is not set
423# CONFIG_LAPB is not set
424# CONFIG_NET_DIVERT is not set
425# CONFIG_ECONET is not set
426# CONFIG_WAN_ROUTER is not set
427
428#
429# QoS and/or fair queueing
430#
431# CONFIG_NET_SCHED is not set
432# CONFIG_NET_CLS_ROUTE is not set
433
434#
435# Network testing
436#
437# CONFIG_NET_PKTGEN is not set
438# CONFIG_NETPOLL is not set
439# CONFIG_NET_POLL_CONTROLLER is not set
440# CONFIG_HAMRADIO is not set
441# CONFIG_IRDA is not set
442# CONFIG_BT is not set
443CONFIG_NETDEVICES=y 463CONFIG_NETDEVICES=y
444# CONFIG_DUMMY is not set 464# CONFIG_DUMMY is not set
445# CONFIG_BONDING is not set 465# CONFIG_BONDING is not set
@@ -447,6 +467,11 @@ CONFIG_NETDEVICES=y
447# CONFIG_TUN is not set 467# CONFIG_TUN is not set
448 468
449# 469#
470# PHY device support
471#
472# CONFIG_PHYLIB is not set
473
474#
450# Ethernet (10 or 100Mbit) 475# Ethernet (10 or 100Mbit)
451# 476#
452CONFIG_NET_ETHERNET=y 477CONFIG_NET_ETHERNET=y
@@ -480,6 +505,8 @@ CONFIG_DM9000=m
480# CONFIG_SLIP is not set 505# CONFIG_SLIP is not set
481# CONFIG_SHAPER is not set 506# CONFIG_SHAPER is not set
482# CONFIG_NETCONSOLE is not set 507# CONFIG_NETCONSOLE is not set
508# CONFIG_NETPOLL is not set
509# CONFIG_NET_POLL_CONTROLLER is not set
483 510
484# 511#
485# ISDN subsystem 512# ISDN subsystem
@@ -562,7 +589,6 @@ CONFIG_SERIAL_8250_EXTENDED=y
562CONFIG_SERIAL_8250_MANY_PORTS=y 589CONFIG_SERIAL_8250_MANY_PORTS=y
563CONFIG_SERIAL_8250_SHARE_IRQ=y 590CONFIG_SERIAL_8250_SHARE_IRQ=y
564# CONFIG_SERIAL_8250_DETECT_IRQ is not set 591# CONFIG_SERIAL_8250_DETECT_IRQ is not set
565# CONFIG_SERIAL_8250_MULTIPORT is not set
566# CONFIG_SERIAL_8250_RSA is not set 592# CONFIG_SERIAL_8250_RSA is not set
567 593
568# 594#
@@ -605,7 +631,6 @@ CONFIG_S3C2410_RTC=y
605# 631#
606# Ftape, the floppy tape device driver 632# Ftape, the floppy tape device driver
607# 633#
608# CONFIG_DRM is not set
609# CONFIG_RAW_DRIVER is not set 634# CONFIG_RAW_DRIVER is not set
610 635
611# 636#
@@ -628,7 +653,7 @@ CONFIG_I2C_ALGOBIT=m
628# 653#
629# I2C Hardware Bus support 654# I2C Hardware Bus support
630# 655#
631# CONFIG_I2C_ISA is not set 656CONFIG_I2C_ISA=m
632# CONFIG_I2C_PARPORT is not set 657# CONFIG_I2C_PARPORT is not set
633# CONFIG_I2C_PARPORT_LIGHT is not set 658# CONFIG_I2C_PARPORT_LIGHT is not set
634CONFIG_I2C_S3C2410=y 659CONFIG_I2C_S3C2410=y
@@ -636,14 +661,33 @@ CONFIG_I2C_S3C2410=y
636# CONFIG_I2C_PCA_ISA is not set 661# CONFIG_I2C_PCA_ISA is not set
637 662
638# 663#
639# Hardware Sensors Chip support 664# Miscellaneous I2C Chip support
640# 665#
641CONFIG_I2C_SENSOR=m 666# CONFIG_SENSORS_DS1337 is not set
667# CONFIG_SENSORS_DS1374 is not set
668CONFIG_SENSORS_EEPROM=m
669# CONFIG_SENSORS_PCF8574 is not set
670# CONFIG_SENSORS_PCA9539 is not set
671# CONFIG_SENSORS_PCF8591 is not set
672# CONFIG_SENSORS_RTC8564 is not set
673# CONFIG_SENSORS_MAX6875 is not set
674# CONFIG_I2C_DEBUG_CORE is not set
675# CONFIG_I2C_DEBUG_ALGO is not set
676# CONFIG_I2C_DEBUG_BUS is not set
677# CONFIG_I2C_DEBUG_CHIP is not set
678
679#
680# Hardware Monitoring support
681#
682CONFIG_HWMON=y
683CONFIG_HWMON_VID=m
642# CONFIG_SENSORS_ADM1021 is not set 684# CONFIG_SENSORS_ADM1021 is not set
643# CONFIG_SENSORS_ADM1025 is not set 685# CONFIG_SENSORS_ADM1025 is not set
644# CONFIG_SENSORS_ADM1026 is not set 686# CONFIG_SENSORS_ADM1026 is not set
645# CONFIG_SENSORS_ADM1031 is not set 687# CONFIG_SENSORS_ADM1031 is not set
688# CONFIG_SENSORS_ADM9240 is not set
646# CONFIG_SENSORS_ASB100 is not set 689# CONFIG_SENSORS_ASB100 is not set
690# CONFIG_SENSORS_ATXP1 is not set
647# CONFIG_SENSORS_DS1621 is not set 691# CONFIG_SENSORS_DS1621 is not set
648# CONFIG_SENSORS_FSCHER is not set 692# CONFIG_SENSORS_FSCHER is not set
649# CONFIG_SENSORS_FSCPOS is not set 693# CONFIG_SENSORS_FSCPOS is not set
@@ -662,27 +706,21 @@ CONFIG_SENSORS_LM85=m
662# CONFIG_SENSORS_LM92 is not set 706# CONFIG_SENSORS_LM92 is not set
663# CONFIG_SENSORS_MAX1619 is not set 707# CONFIG_SENSORS_MAX1619 is not set
664# CONFIG_SENSORS_PC87360 is not set 708# CONFIG_SENSORS_PC87360 is not set
665# CONFIG_SENSORS_SMSC47B397 is not set
666# CONFIG_SENSORS_SMSC47M1 is not set 709# CONFIG_SENSORS_SMSC47M1 is not set
710# CONFIG_SENSORS_SMSC47B397 is not set
667# CONFIG_SENSORS_W83781D is not set 711# CONFIG_SENSORS_W83781D is not set
712# CONFIG_SENSORS_W83792D is not set
668# CONFIG_SENSORS_W83L785TS is not set 713# CONFIG_SENSORS_W83L785TS is not set
669# CONFIG_SENSORS_W83627HF is not set 714# CONFIG_SENSORS_W83627HF is not set
715# CONFIG_SENSORS_W83627EHF is not set
716# CONFIG_HWMON_DEBUG_CHIP is not set
670 717
671# 718#
672# Other I2C Chip support 719# Misc devices
673# 720#
674# CONFIG_SENSORS_DS1337 is not set
675CONFIG_SENSORS_EEPROM=m
676# CONFIG_SENSORS_PCF8574 is not set
677# CONFIG_SENSORS_PCF8591 is not set
678# CONFIG_SENSORS_RTC8564 is not set
679# CONFIG_I2C_DEBUG_CORE is not set
680# CONFIG_I2C_DEBUG_ALGO is not set
681# CONFIG_I2C_DEBUG_BUS is not set
682# CONFIG_I2C_DEBUG_CHIP is not set
683 721
684# 722#
685# Misc devices 723# Multimedia Capabilities Port drivers
686# 724#
687 725
688# 726#
@@ -731,7 +769,7 @@ CONFIG_DUMMY_CONSOLE=y
731# USB support 769# USB support
732# 770#
733CONFIG_USB_ARCH_HAS_HCD=y 771CONFIG_USB_ARCH_HAS_HCD=y
734# CONFIG_USB_ARCH_HAS_OHCI is not set 772CONFIG_USB_ARCH_HAS_OHCI=y
735# CONFIG_USB is not set 773# CONFIG_USB is not set
736 774
737# 775#
@@ -749,6 +787,7 @@ CONFIG_USB_ARCH_HAS_HCD=y
749# 787#
750CONFIG_EXT2_FS=y 788CONFIG_EXT2_FS=y
751# CONFIG_EXT2_FS_XATTR is not set 789# CONFIG_EXT2_FS_XATTR is not set
790# CONFIG_EXT2_FS_XIP is not set
752CONFIG_EXT3_FS=y 791CONFIG_EXT3_FS=y
753CONFIG_EXT3_FS_XATTR=y 792CONFIG_EXT3_FS_XATTR=y
754# CONFIG_EXT3_FS_POSIX_ACL is not set 793# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -758,6 +797,7 @@ CONFIG_JBD=y
758CONFIG_FS_MBCACHE=y 797CONFIG_FS_MBCACHE=y
759# CONFIG_REISERFS_FS is not set 798# CONFIG_REISERFS_FS is not set
760# CONFIG_JFS_FS is not set 799# CONFIG_JFS_FS is not set
800# CONFIG_FS_POSIX_ACL is not set
761 801
762# 802#
763# XFS support 803# XFS support
@@ -765,6 +805,7 @@ CONFIG_FS_MBCACHE=y
765# CONFIG_XFS_FS is not set 805# CONFIG_XFS_FS is not set
766# CONFIG_MINIX_FS is not set 806# CONFIG_MINIX_FS is not set
767CONFIG_ROMFS_FS=y 807CONFIG_ROMFS_FS=y
808CONFIG_INOTIFY=y
768# CONFIG_QUOTA is not set 809# CONFIG_QUOTA is not set
769CONFIG_DNOTIFY=y 810CONFIG_DNOTIFY=y
770# CONFIG_AUTOFS_FS is not set 811# CONFIG_AUTOFS_FS is not set
@@ -791,11 +832,11 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
791# 832#
792CONFIG_PROC_FS=y 833CONFIG_PROC_FS=y
793CONFIG_SYSFS=y 834CONFIG_SYSFS=y
794# CONFIG_DEVPTS_FS_XATTR is not set
795# CONFIG_TMPFS is not set 835# CONFIG_TMPFS is not set
796# CONFIG_HUGETLBFS is not set 836# CONFIG_HUGETLBFS is not set
797# CONFIG_HUGETLB_PAGE is not set 837# CONFIG_HUGETLB_PAGE is not set
798CONFIG_RAMFS=y 838CONFIG_RAMFS=y
839# CONFIG_RELAYFS_FS is not set
799 840
800# 841#
801# Miscellaneous filesystems 842# Miscellaneous filesystems
@@ -812,8 +853,7 @@ CONFIG_JFFS_FS_VERBOSE=0
812# CONFIG_JFFS_PROC_FS is not set 853# CONFIG_JFFS_PROC_FS is not set
813CONFIG_JFFS2_FS=y 854CONFIG_JFFS2_FS=y
814CONFIG_JFFS2_FS_DEBUG=0 855CONFIG_JFFS2_FS_DEBUG=0
815# CONFIG_JFFS2_FS_NAND is not set 856CONFIG_JFFS2_FS_WRITEBUFFER=y
816# CONFIG_JFFS2_FS_NOR_ECC is not set
817# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 857# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
818CONFIG_JFFS2_ZLIB=y 858CONFIG_JFFS2_ZLIB=y
819CONFIG_JFFS2_RTIME=y 859CONFIG_JFFS2_RTIME=y
@@ -835,6 +875,7 @@ CONFIG_NFS_FS=y
835# CONFIG_NFSD is not set 875# CONFIG_NFSD is not set
836CONFIG_ROOT_NFS=y 876CONFIG_ROOT_NFS=y
837CONFIG_LOCKD=y 877CONFIG_LOCKD=y
878CONFIG_NFS_COMMON=y
838CONFIG_SUNRPC=y 879CONFIG_SUNRPC=y
839# CONFIG_RPCSEC_GSS_KRB5 is not set 880# CONFIG_RPCSEC_GSS_KRB5 is not set
840# CONFIG_RPCSEC_GSS_SPKM3 is not set 881# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -920,6 +961,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
920CONFIG_DEBUG_KERNEL=y 961CONFIG_DEBUG_KERNEL=y
921# CONFIG_MAGIC_SYSRQ is not set 962# CONFIG_MAGIC_SYSRQ is not set
922CONFIG_LOG_BUF_SHIFT=16 963CONFIG_LOG_BUF_SHIFT=16
964CONFIG_DETECT_SOFTLOCKUP=y
923# CONFIG_SCHEDSTATS is not set 965# CONFIG_SCHEDSTATS is not set
924# CONFIG_DEBUG_SLAB is not set 966# CONFIG_DEBUG_SLAB is not set
925# CONFIG_DEBUG_SPINLOCK is not set 967# CONFIG_DEBUG_SPINLOCK is not set
diff --git a/arch/arm/mach-clps7500/core.c b/arch/arm/mach-clps7500/core.c
index 112f1d68fb2b..e216ab8b9e8f 100644
--- a/arch/arm/mach-clps7500/core.c
+++ b/arch/arm/mach-clps7500/core.c
@@ -354,7 +354,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
354 354
355static struct platform_device serial_device = { 355static struct platform_device serial_device = {
356 .name = "serial8250", 356 .name = "serial8250",
357 .id = 0, 357 .id = PLAT8250_DEV_PLATFORM,
358 .dev = { 358 .dev = {
359 .platform_data = serial_platform_data, 359 .platform_data = serial_platform_data,
360 }, 360 },
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c
index 23c4da10101b..5aeadfd72143 100644
--- a/arch/arm/mach-ebsa110/core.c
+++ b/arch/arm/mach-ebsa110/core.c
@@ -219,7 +219,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
219 219
220static struct platform_device serial_device = { 220static struct platform_device serial_device = {
221 .name = "serial8250", 221 .name = "serial8250",
222 .id = 0, 222 .id = PLAT8250_DEV_PLATFORM,
223 .dev = { 223 .dev = {
224 .platform_data = serial_platform_data, 224 .platform_data = serial_platform_data,
225 }, 225 },
diff --git a/arch/arm/mach-epxa10db/arch.c b/arch/arm/mach-epxa10db/arch.c
index 7daa021676d0..44c56571d183 100644
--- a/arch/arm/mach-epxa10db/arch.c
+++ b/arch/arm/mach-epxa10db/arch.c
@@ -52,7 +52,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
52 52
53static struct platform_device serial_device = { 53static struct platform_device serial_device = {
54 .name = "serial8250", 54 .name = "serial8250",
55 .id = 0, 55 .id = PLAT8250_DEV_PLATFORM,
56 .dev = { 56 .dev = {
57 .platform_data = serial_platform_data, 57 .platform_data = serial_platform_data,
58 }, 58 },
diff --git a/arch/arm/mach-footbridge/isa.c b/arch/arm/mach-footbridge/isa.c
index aa3a1fef563e..28846c7edaaf 100644
--- a/arch/arm/mach-footbridge/isa.c
+++ b/arch/arm/mach-footbridge/isa.c
@@ -34,7 +34,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
34 34
35static struct platform_device serial_device = { 35static struct platform_device serial_device = {
36 .name = "serial8250", 36 .name = "serial8250",
37 .id = 0, 37 .id = PLAT8250_DEV_PLATFORM,
38 .dev = { 38 .dev = {
39 .platform_data = serial_platform_data, 39 .platform_data = serial_platform_data,
40 }, 40 },
diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c
index 4b3199319e68..a4a7c0125d03 100644
--- a/arch/arm/mach-h720x/cpu-h7202.c
+++ b/arch/arm/mach-h720x/cpu-h7202.c
@@ -90,7 +90,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
90 90
91static struct platform_device serial_device = { 91static struct platform_device serial_device = {
92 .name = "serial8250", 92 .name = "serial8250",
93 .id = 0, 93 .id = PLAT8250_DEV_PLATFORM,
94 .dev = { 94 .dev = {
95 .platform_data = serial_platform_data, 95 .platform_data = serial_platform_data,
96 }, 96 },
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index 098c817a7fb8..74bd2fd602d4 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -174,7 +174,7 @@ static struct resource ixp2000_uart_resource = {
174 174
175static struct platform_device ixp2000_serial_device = { 175static struct platform_device ixp2000_serial_device = {
176 .name = "serial8250", 176 .name = "serial8250",
177 .id = 0, 177 .id = PLAT8250_DEV_PLATFORM,
178 .dev = { 178 .dev = {
179 .platform_data = ixp2000_serial_port, 179 .platform_data = ixp2000_serial_port,
180 }, 180 },
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
index 8b2f25322452..050c92768913 100644
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -66,7 +66,7 @@ static struct plat_serial8250_port coyote_uart_data[] = {
66 66
67static struct platform_device coyote_uart = { 67static struct platform_device coyote_uart = {
68 .name = "serial8250", 68 .name = "serial8250",
69 .id = 0, 69 .id = PLAT8250_DEV_PLATFORM,
70 .dev = { 70 .dev = {
71 .platform_data = coyote_uart_data, 71 .platform_data = coyote_uart_data,
72 }, 72 },
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
index 3fd92c5cbaa8..29a6d02fa851 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -93,7 +93,7 @@ static struct plat_serial8250_port gtwx5715_uart_platform_data[] = {
93 93
94static struct platform_device gtwx5715_uart_device = { 94static struct platform_device gtwx5715_uart_device = {
95 .name = "serial8250", 95 .name = "serial8250",
96 .id = 0, 96 .id = PLAT8250_DEV_PLATFORM,
97 .dev = { 97 .dev = {
98 .platform_data = gtwx5715_uart_platform_data, 98 .platform_data = gtwx5715_uart_platform_data,
99 }, 99 },
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index 6c14ff3c23a0..ae1fa099d5fa 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -96,7 +96,7 @@ static struct plat_serial8250_port ixdp425_uart_data[] = {
96 96
97static struct platform_device ixdp425_uart = { 97static struct platform_device ixdp425_uart = {
98 .name = "serial8250", 98 .name = "serial8250",
99 .id = 0, 99 .id = PLAT8250_DEV_PLATFORM,
100 .dev.platform_data = ixdp425_uart_data, 100 .dev.platform_data = ixdp425_uart_data,
101 .num_resources = 2, 101 .num_resources = 2,
102 .resource = ixdp425_uart_resources 102 .resource = ixdp425_uart_resources
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 7408ac94f771..27fc2e8e5fca 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -47,6 +47,14 @@ config MACH_OMAP_OSK
47 TI OMAP 5912 OSK (OMAP Starter Kit) board support. Say Y here 47 TI OMAP 5912 OSK (OMAP Starter Kit) board support. Say Y here
48 if you have such a board. 48 if you have such a board.
49 49
50config OMAP_OSK_MISTRAL
51 bool "Mistral QVGA board Support"
52 depends on MACH_OMAP_OSK
53 help
54 The OSK supports an optional add-on board with a Quarter-VGA
55 touchscreen, PDA-ish buttons, a resume button, bicolor LED,
56 and camera connector. Say Y here if you have this board.
57
50config MACH_OMAP_PERSEUS2 58config MACH_OMAP_PERSEUS2
51 bool "TI Perseus2" 59 bool "TI Perseus2"
52 depends on ARCH_OMAP1 && ARCH_OMAP730 60 depends on ARCH_OMAP1 && ARCH_OMAP730
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index d386fd913f0c..181a93deaaee 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := io.o id.o irq.o time.o serial.o 6obj-y := io.o id.o irq.o time.o serial.o devices.o
7led-y := leds.o 7led-y := leds.o
8 8
9# Specific board support 9# Specific board support
@@ -23,6 +23,7 @@ endif
23 23
24# LEDs support 24# LEDs support
25led-$(CONFIG_MACH_OMAP_H2) += leds-h2p2-debug.o 25led-$(CONFIG_MACH_OMAP_H2) += leds-h2p2-debug.o
26led-$(CONFIG_MACH_OMAP_H3) += leds-h2p2-debug.o
26led-$(CONFIG_MACH_OMAP_INNOVATOR) += leds-innovator.o 27led-$(CONFIG_MACH_OMAP_INNOVATOR) += leds-innovator.o
27led-$(CONFIG_MACH_OMAP_PERSEUS2) += leds-h2p2-debug.o 28led-$(CONFIG_MACH_OMAP_PERSEUS2) += leds-h2p2-debug.o
28led-$(CONFIG_MACH_OMAP_OSK) += leds-osk.o 29led-$(CONFIG_MACH_OMAP_OSK) += leds-osk.o
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index 122796ebe8f5..c209c7172a9a 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -48,19 +48,43 @@ static struct omap_usb_config generic1510_usb_config __initdata = {
48 48
49#if defined(CONFIG_ARCH_OMAP16XX) 49#if defined(CONFIG_ARCH_OMAP16XX)
50static struct omap_usb_config generic1610_usb_config __initdata = { 50static struct omap_usb_config generic1610_usb_config __initdata = {
51#ifdef CONFIG_USB_OTG
52 .otg = 1,
53#endif
51 .register_host = 1, 54 .register_host = 1,
52 .register_dev = 1, 55 .register_dev = 1,
53 .hmc_mode = 16, 56 .hmc_mode = 16,
54 .pins[0] = 6, 57 .pins[0] = 6,
55}; 58};
59
60static struct omap_mmc_config generic_mmc_config __initdata = {
61 .mmc [0] = {
62 .enabled = 0,
63 .wire4 = 0,
64 .wp_pin = -1,
65 .power_pin = -1,
66 .switch_pin = -1,
67 },
68 .mmc [1] = {
69 .enabled = 0,
70 .wire4 = 0,
71 .wp_pin = -1,
72 .power_pin = -1,
73 .switch_pin = -1,
74 },
75};
76
56#endif 77#endif
57 78
58static struct omap_board_config_kernel generic_config[] = { 79static struct omap_board_config_kernel generic_config[] = {
59 { OMAP_TAG_USB, NULL }, 80 { OMAP_TAG_USB, NULL },
81 { OMAP_TAG_MMC, &generic_mmc_config },
60}; 82};
61 83
62static void __init omap_generic_init(void) 84static void __init omap_generic_init(void)
63{ 85{
86 const struct omap_uart_config *uart_conf;
87
64 /* 88 /*
65 * Make sure the serial ports are muxed on at this point. 89 * Make sure the serial ports are muxed on at this point.
66 * You have to mux them off in device drivers later on 90 * You have to mux them off in device drivers later on
@@ -76,6 +100,18 @@ static void __init omap_generic_init(void)
76 generic_config[0].data = &generic1610_usb_config; 100 generic_config[0].data = &generic1610_usb_config;
77 } 101 }
78#endif 102#endif
103
104 uart_conf = omap_get_config(OMAP_TAG_UART, struct omap_uart_config);
105 if (uart_conf != NULL) {
106 unsigned int enabled_ports, i;
107
108 enabled_ports = uart_conf->enabled_uarts;
109 for (i = 0; i < 3; i++) {
110 if (!(enabled_ports & (1 << i)))
111 generic_serial_ports[i] = 0;
112 }
113 }
114
79 omap_board_config = generic_config; 115 omap_board_config = generic_config;
80 omap_board_config_size = ARRAY_SIZE(generic_config); 116 omap_board_config_size = ARRAY_SIZE(generic_config);
81 omap_serial_init(generic_serial_ports); 117 omap_serial_init(generic_serial_ports);
@@ -83,7 +119,7 @@ static void __init omap_generic_init(void)
83 119
84static void __init omap_generic_map_io(void) 120static void __init omap_generic_map_io(void)
85{ 121{
86 omap_map_common_io() 122 omap_map_common_io();
87} 123}
88 124
89MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710") 125MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index f4983ee95ab4..d46a70063b0c 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -33,6 +33,7 @@
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34 34
35#include <asm/arch/gpio.h> 35#include <asm/arch/gpio.h>
36#include <asm/arch/mux.h>
36#include <asm/arch/tc.h> 37#include <asm/arch/tc.h>
37#include <asm/arch/usb.h> 38#include <asm/arch/usb.h>
38#include <asm/arch/common.h> 39#include <asm/arch/common.h>
@@ -80,8 +81,7 @@ static struct flash_platform_data h2_flash_data = {
80}; 81};
81 82
82static struct resource h2_flash_resource = { 83static struct resource h2_flash_resource = {
83 .start = OMAP_CS2B_PHYS, 84 /* This is on CS3, wherever it's mapped */
84 .end = OMAP_CS2B_PHYS + OMAP_CS2B_SIZE - 1,
85 .flags = IORESOURCE_MEM, 85 .flags = IORESOURCE_MEM,
86}; 86};
87 87
@@ -126,10 +126,9 @@ static void __init h2_init_smc91x(void)
126 printk("Error requesting gpio 0 for smc91x irq\n"); 126 printk("Error requesting gpio 0 for smc91x irq\n");
127 return; 127 return;
128 } 128 }
129 omap_set_gpio_edge_ctrl(0, OMAP_GPIO_FALLING_EDGE);
130} 129}
131 130
132void h2_init_irq(void) 131static void __init h2_init_irq(void)
133{ 132{
134 omap_init_irq(); 133 omap_init_irq();
135 omap_gpio_init(); 134 omap_gpio_init();
@@ -152,9 +151,13 @@ static struct omap_usb_config h2_usb_config __initdata = {
152}; 151};
153 152
154static struct omap_mmc_config h2_mmc_config __initdata = { 153static struct omap_mmc_config h2_mmc_config __initdata = {
155 .mmc_blocks = 1, 154 .mmc [0] = {
156 .mmc1_power_pin = -1, /* tps65010 gpio3 */ 155 .enabled = 1,
157 .mmc1_switch_pin = OMAP_MPUIO(1), 156 .wire4 = 1,
157 .wp_pin = OMAP_MPUIO(3),
158 .power_pin = -1, /* tps65010 gpio3 */
159 .switch_pin = OMAP_MPUIO(1),
160 },
158}; 161};
159 162
160static struct omap_board_config_kernel h2_config[] = { 163static struct omap_board_config_kernel h2_config[] = {
@@ -164,6 +167,16 @@ static struct omap_board_config_kernel h2_config[] = {
164 167
165static void __init h2_init(void) 168static void __init h2_init(void)
166{ 169{
170 /* NOTE: revC boards support NAND-boot, which can put NOR on CS2B
171 * and NAND (either 16bit or 8bit) on CS3.
172 */
173 h2_flash_resource.end = h2_flash_resource.start = omap_cs3_phys();
174 h2_flash_resource.end += SZ_32M - 1;
175
176 /* MMC: card detect and WP */
177 // omap_cfg_reg(U19_ARMIO1); /* CD */
178 omap_cfg_reg(BALLOUT_V8_ARMIO3); /* WP */
179
167 platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); 180 platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
168 omap_board_config = h2_config; 181 omap_board_config = h2_config;
169 omap_board_config_size = ARRAY_SIZE(h2_config); 182 omap_board_config_size = ARRAY_SIZE(h2_config);
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 7cd419d61b40..2798613696fa 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -82,8 +82,7 @@ static struct flash_platform_data h3_flash_data = {
82}; 82};
83 83
84static struct resource h3_flash_resource = { 84static struct resource h3_flash_resource = {
85 .start = OMAP_CS2B_PHYS, 85 /* This is on CS3, wherever it's mapped */
86 .end = OMAP_CS2B_PHYS + OMAP_CS2B_SIZE - 1,
87 .flags = IORESOURCE_MEM, 86 .flags = IORESOURCE_MEM,
88}; 87};
89 88
@@ -161,13 +160,26 @@ static struct omap_usb_config h3_usb_config __initdata = {
161 .pins[1] = 3, 160 .pins[1] = 3,
162}; 161};
163 162
163static struct omap_mmc_config h3_mmc_config __initdata = {
164 .mmc[0] = {
165 .enabled = 1,
166 .power_pin = -1, /* tps65010 GPIO4 */
167 .switch_pin = OMAP_MPUIO(1),
168 },
169};
170
164static struct omap_board_config_kernel h3_config[] = { 171static struct omap_board_config_kernel h3_config[] = {
165 { OMAP_TAG_USB, &h3_usb_config }, 172 { OMAP_TAG_USB, &h3_usb_config },
173 { OMAP_TAG_MMC, &h3_mmc_config },
166}; 174};
167 175
168static void __init h3_init(void) 176static void __init h3_init(void)
169{ 177{
178 h3_flash_resource.end = h3_flash_resource.start = omap_cs3_phys();
179 h3_flash_resource.end += OMAP_CS3_SIZE - 1;
170 (void) platform_add_devices(devices, ARRAY_SIZE(devices)); 180 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
181 omap_board_config = h3_config;
182 omap_board_config_size = ARRAY_SIZE(h3_config);
171} 183}
172 184
173static void __init h3_init_smc91x(void) 185static void __init h3_init_smc91x(void)
@@ -177,7 +189,6 @@ static void __init h3_init_smc91x(void)
177 printk("Error requesting gpio 40 for smc91x irq\n"); 189 printk("Error requesting gpio 40 for smc91x irq\n");
178 return; 190 return;
179 } 191 }
180 omap_set_gpio_edge_ctrl(40, OMAP_GPIO_FALLING_EDGE);
181} 192}
182 193
183void h3_init_irq(void) 194void h3_init_irq(void)
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 91de60a91ef8..df0312b596e4 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -29,6 +29,7 @@
29#include <asm/mach/flash.h> 29#include <asm/mach/flash.h>
30#include <asm/mach/map.h> 30#include <asm/mach/map.h>
31 31
32#include <asm/arch/mux.h>
32#include <asm/arch/fpga.h> 33#include <asm/arch/fpga.h>
33#include <asm/arch/gpio.h> 34#include <asm/arch/gpio.h>
34#include <asm/arch/tc.h> 35#include <asm/arch/tc.h>
@@ -173,7 +174,6 @@ static void __init innovator_init_smc91x(void)
173 printk("Error requesting gpio 0 for smc91x irq\n"); 174 printk("Error requesting gpio 0 for smc91x irq\n");
174 return; 175 return;
175 } 176 }
176 omap_set_gpio_edge_ctrl(0, OMAP_GPIO_RISING_EDGE);
177 } 177 }
178} 178}
179 179
@@ -220,8 +220,19 @@ static struct omap_usb_config h2_usb_config __initdata = {
220}; 220};
221#endif 221#endif
222 222
223static struct omap_mmc_config innovator_mmc_config __initdata = {
224 .mmc [0] = {
225 .enabled = 1,
226 .wire4 = 1,
227 .wp_pin = OMAP_MPUIO(3),
228 .power_pin = -1, /* FPGA F3 UIO42 */
229 .switch_pin = -1, /* FPGA F4 UIO43 */
230 },
231};
232
223static struct omap_board_config_kernel innovator_config[] = { 233static struct omap_board_config_kernel innovator_config[] = {
224 { OMAP_TAG_USB, NULL }, 234 { OMAP_TAG_USB, NULL },
235 { OMAP_TAG_MMC, &innovator_mmc_config },
225}; 236};
226 237
227static void __init innovator_init(void) 238static void __init innovator_init(void)
diff --git a/arch/arm/mach-omap1/board-netstar.c b/arch/arm/mach-omap1/board-netstar.c
index 6750b2014092..d904e643f5ec 100644
--- a/arch/arm/mach-omap1/board-netstar.c
+++ b/arch/arm/mach-omap1/board-netstar.c
@@ -75,16 +75,15 @@ static void __init netstar_init(void)
75 mdelay(50); /* 50ms until PHY ready */ 75 mdelay(50); /* 50ms until PHY ready */
76 /* smc91x interrupt pin */ 76 /* smc91x interrupt pin */
77 omap_request_gpio(8); 77 omap_request_gpio(8);
78 omap_set_gpio_edge_ctrl(8, OMAP_GPIO_RISING_EDGE);
79 78
80 omap_request_gpio(12); 79 omap_request_gpio(12);
81 omap_request_gpio(13); 80 omap_request_gpio(13);
82 omap_request_gpio(14); 81 omap_request_gpio(14);
83 omap_request_gpio(15); 82 omap_request_gpio(15);
84 omap_set_gpio_edge_ctrl(12, OMAP_GPIO_FALLING_EDGE); 83 set_irq_type(OMAP_GPIO_IRQ(12), IRQT_FALLING);
85 omap_set_gpio_edge_ctrl(13, OMAP_GPIO_FALLING_EDGE); 84 set_irq_type(OMAP_GPIO_IRQ(13), IRQT_FALLING);
86 omap_set_gpio_edge_ctrl(14, OMAP_GPIO_FALLING_EDGE); 85 set_irq_type(OMAP_GPIO_IRQ(14), IRQT_FALLING);
87 omap_set_gpio_edge_ctrl(15, OMAP_GPIO_FALLING_EDGE); 86 set_irq_type(OMAP_GPIO_IRQ(15), IRQT_FALLING);
88 87
89 platform_add_devices(netstar_devices, ARRAY_SIZE(netstar_devices)); 88 platform_add_devices(netstar_devices, ARRAY_SIZE(netstar_devices));
90 89
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 6844e536c698..21103df50415 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -29,11 +29,16 @@
29#include <linux/kernel.h> 29#include <linux/kernel.h>
30#include <linux/init.h> 30#include <linux/init.h>
31#include <linux/device.h> 31#include <linux/device.h>
32#include <linux/interrupt.h>
33
34#include <linux/mtd/mtd.h>
35#include <linux/mtd/partitions.h>
32 36
33#include <asm/hardware.h> 37#include <asm/hardware.h>
34#include <asm/mach-types.h> 38#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
36#include <asm/mach/map.h> 40#include <asm/mach/map.h>
41#include <asm/mach/flash.h>
37 42
38#include <asm/arch/gpio.h> 43#include <asm/arch/gpio.h>
39#include <asm/arch/usb.h> 44#include <asm/arch/usb.h>
@@ -41,12 +46,56 @@
41#include <asm/arch/tc.h> 46#include <asm/arch/tc.h>
42#include <asm/arch/common.h> 47#include <asm/arch/common.h>
43 48
44static struct map_desc osk5912_io_desc[] __initdata = { 49static int __initdata osk_serial_ports[OMAP_MAX_NR_PORTS] = {1, 0, 0};
45{ OMAP_OSK_NOR_FLASH_BASE, OMAP_OSK_NOR_FLASH_START, OMAP_OSK_NOR_FLASH_SIZE, 50
46 MT_DEVICE }, 51static struct mtd_partition osk_partitions[] = {
52 /* bootloader (U-Boot, etc) in first sector */
53 {
54 .name = "bootloader",
55 .offset = 0,
56 .size = SZ_128K,
57 .mask_flags = MTD_WRITEABLE, /* force read-only */
58 },
59 /* bootloader params in the next sector */
60 {
61 .name = "params",
62 .offset = MTDPART_OFS_APPEND,
63 .size = SZ_128K,
64 .mask_flags = 0,
65 }, {
66 .name = "kernel",
67 .offset = MTDPART_OFS_APPEND,
68 .size = SZ_2M,
69 .mask_flags = 0
70 }, {
71 .name = "filesystem",
72 .offset = MTDPART_OFS_APPEND,
73 .size = MTDPART_SIZ_FULL,
74 .mask_flags = 0
75 }
47}; 76};
48 77
49static int __initdata osk_serial_ports[OMAP_MAX_NR_PORTS] = {1, 0, 0}; 78static struct flash_platform_data osk_flash_data = {
79 .map_name = "cfi_probe",
80 .width = 2,
81 .parts = osk_partitions,
82 .nr_parts = ARRAY_SIZE(osk_partitions),
83};
84
85static struct resource osk_flash_resource = {
86 /* this is on CS3, wherever it's mapped */
87 .flags = IORESOURCE_MEM,
88};
89
90static struct platform_device osk5912_flash_device = {
91 .name = "omapflash",
92 .id = 0,
93 .dev = {
94 .platform_data = &osk_flash_data,
95 },
96 .num_resources = 1,
97 .resource = &osk_flash_resource,
98};
50 99
51static struct resource osk5912_smc91x_resources[] = { 100static struct resource osk5912_smc91x_resources[] = {
52 [0] = { 101 [0] = {
@@ -86,9 +135,16 @@ static struct platform_device osk5912_cf_device = {
86 .resource = osk5912_cf_resources, 135 .resource = osk5912_cf_resources,
87}; 136};
88 137
138static struct platform_device osk5912_mcbsp1_device = {
139 .name = "omap_mcbsp",
140 .id = 1,
141};
142
89static struct platform_device *osk5912_devices[] __initdata = { 143static struct platform_device *osk5912_devices[] __initdata = {
144 &osk5912_flash_device,
90 &osk5912_smc91x_device, 145 &osk5912_smc91x_device,
91 &osk5912_cf_device, 146 &osk5912_cf_device,
147 &osk5912_mcbsp1_device,
92}; 148};
93 149
94static void __init osk_init_smc91x(void) 150static void __init osk_init_smc91x(void)
@@ -97,7 +153,6 @@ static void __init osk_init_smc91x(void)
97 printk("Error requesting gpio 0 for smc91x irq\n"); 153 printk("Error requesting gpio 0 for smc91x irq\n");
98 return; 154 return;
99 } 155 }
100 omap_set_gpio_edge_ctrl(0, OMAP_GPIO_RISING_EDGE);
101 156
102 /* Check EMIFS wait states to fix errors with SMC_GET_PKT_HDR */ 157 /* Check EMIFS wait states to fix errors with SMC_GET_PKT_HDR */
103 EMIFS_CCS(1) |= 0x2; 158 EMIFS_CCS(1) |= 0x2;
@@ -110,11 +165,11 @@ static void __init osk_init_cf(void)
110 printk("Error requesting gpio 62 for CF irq\n"); 165 printk("Error requesting gpio 62 for CF irq\n");
111 return; 166 return;
112 } 167 }
113 /* it's really active-low */ 168 /* the CF I/O IRQ is really active-low */
114 omap_set_gpio_edge_ctrl(62, OMAP_GPIO_FALLING_EDGE); 169 set_irq_type(OMAP_GPIO_IRQ(62), IRQT_FALLING);
115} 170}
116 171
117void osk_init_irq(void) 172static void __init osk_init_irq(void)
118{ 173{
119 omap_init_irq(); 174 omap_init_irq();
120 omap_gpio_init(); 175 omap_gpio_init();
@@ -142,18 +197,69 @@ static struct omap_board_config_kernel osk_config[] = {
142 { OMAP_TAG_USB, &osk_usb_config }, 197 { OMAP_TAG_USB, &osk_usb_config },
143}; 198};
144 199
200#ifdef CONFIG_OMAP_OSK_MISTRAL
201
202#ifdef CONFIG_PM
203static irqreturn_t
204osk_mistral_wake_interrupt(int irq, void *ignored, struct pt_regs *regs)
205{
206 return IRQ_HANDLED;
207}
208#endif
209
210static void __init osk_mistral_init(void)
211{
212 /* FIXME here's where to feed in framebuffer, touchpad, and
213 * keyboard setup ... not in the drivers for those devices!
214 *
215 * NOTE: we could actually tell if there's a Mistral board
216 * attached, e.g. by trying to read something from the ads7846.
217 * But this is too early for that...
218 */
219
220 /* the sideways button (SW1) is for use as a "wakeup" button */
221 omap_cfg_reg(N15_1610_MPUIO2);
222 if (omap_request_gpio(OMAP_MPUIO(2)) == 0) {
223 int ret = 0;
224 omap_set_gpio_direction(OMAP_MPUIO(2), 1);
225 set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQT_RISING);
226#ifdef CONFIG_PM
227 /* share the IRQ in case someone wants to use the
228 * button for more than wakeup from system sleep.
229 */
230 ret = request_irq(OMAP_GPIO_IRQ(OMAP_MPUIO(2)),
231 &osk_mistral_wake_interrupt,
232 SA_SHIRQ, "mistral_wakeup",
233 &osk_mistral_wake_interrupt);
234 if (ret != 0) {
235 omap_free_gpio(OMAP_MPUIO(2));
236 printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n",
237 ret);
238 } else
239 enable_irq_wake(OMAP_GPIO_IRQ(OMAP_MPUIO(2)));
240#endif
241 } else
242 printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n");
243}
244#else
245static void __init osk_mistral_init(void) { }
246#endif
247
145static void __init osk_init(void) 248static void __init osk_init(void)
146{ 249{
250 osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys();
251 osk_flash_resource.end += SZ_32M - 1;
147 platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices)); 252 platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices));
148 omap_board_config = osk_config; 253 omap_board_config = osk_config;
149 omap_board_config_size = ARRAY_SIZE(osk_config); 254 omap_board_config_size = ARRAY_SIZE(osk_config);
150 USB_TRANSCEIVER_CTRL_REG |= (3 << 1); 255 USB_TRANSCEIVER_CTRL_REG |= (3 << 1);
256
257 osk_mistral_init();
151} 258}
152 259
153static void __init osk_map_io(void) 260static void __init osk_map_io(void)
154{ 261{
155 omap_map_common_io(); 262 omap_map_common_io();
156 iotable_init(osk5912_io_desc, ARRAY_SIZE(osk5912_io_desc));
157 omap_serial_init(osk_serial_ports); 263 omap_serial_init(osk_serial_ports);
158} 264}
159 265
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 213317392d9b..107c68c8ab54 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -24,6 +24,7 @@
24#include <asm/mach/flash.h> 24#include <asm/mach/flash.h>
25#include <asm/mach/map.h> 25#include <asm/mach/map.h>
26 26
27#include <asm/arch/tc.h>
27#include <asm/arch/gpio.h> 28#include <asm/arch/gpio.h>
28#include <asm/arch/mux.h> 29#include <asm/arch/mux.h>
29#include <asm/arch/fpga.h> 30#include <asm/arch/fpga.h>
@@ -83,8 +84,8 @@ static struct flash_platform_data p2_flash_data = {
83}; 84};
84 85
85static struct resource p2_flash_resource = { 86static struct resource p2_flash_resource = {
86 .start = OMAP_FLASH_0_START, 87 .start = OMAP_CS0_PHYS,
87 .end = OMAP_FLASH_0_START + OMAP_FLASH_0_SIZE - 1, 88 .end = OMAP_CS0_PHYS + SZ_32M - 1,
88 .flags = IORESOURCE_MEM, 89 .flags = IORESOURCE_MEM,
89}; 90};
90 91
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index e42281988990..bf30b1acda0b 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -25,13 +25,14 @@
25#include <asm/hardware.h> 25#include <asm/hardware.h>
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/mach/flash.h>
28#include <asm/mach/map.h> 29#include <asm/mach/map.h>
29 30
31#include <asm/arch/common.h>
30#include <asm/arch/gpio.h> 32#include <asm/arch/gpio.h>
31#include <asm/arch/tc.h>
32#include <asm/arch/mux.h> 33#include <asm/arch/mux.h>
34#include <asm/arch/tc.h>
33#include <asm/arch/usb.h> 35#include <asm/arch/usb.h>
34#include <asm/arch/common.h>
35 36
36extern void omap_init_time(void); 37extern void omap_init_time(void);
37extern int omap_gpio_init(void); 38extern int omap_gpio_init(void);
@@ -74,7 +75,7 @@ static struct plat_serial8250_port voiceblue_ports[] = {
74 75
75static struct platform_device serial_device = { 76static struct platform_device serial_device = {
76 .name = "serial8250", 77 .name = "serial8250",
77 .id = 1, 78 .id = PLAT8250_DEV_PLATFORM1,
78 .dev = { 79 .dev = {
79 .platform_data = voiceblue_ports, 80 .platform_data = voiceblue_ports,
80 }, 81 },
@@ -86,6 +87,27 @@ static int __init ext_uart_init(void)
86} 87}
87arch_initcall(ext_uart_init); 88arch_initcall(ext_uart_init);
88 89
90static struct flash_platform_data voiceblue_flash_data = {
91 .map_name = "cfi_probe",
92 .width = 2,
93};
94
95static struct resource voiceblue_flash_resource = {
96 .start = OMAP_CS0_PHYS,
97 .end = OMAP_CS0_PHYS + SZ_32M - 1,
98 .flags = IORESOURCE_MEM,
99};
100
101static struct platform_device voiceblue_flash_device = {
102 .name = "omapflash",
103 .id = 0,
104 .dev = {
105 .platform_data = &voiceblue_flash_data,
106 },
107 .num_resources = 1,
108 .resource = &voiceblue_flash_resource,
109};
110
89static struct resource voiceblue_smc91x_resources[] = { 111static struct resource voiceblue_smc91x_resources[] = {
90 [0] = { 112 [0] = {
91 .start = OMAP_CS2_PHYS + 0x300, 113 .start = OMAP_CS2_PHYS + 0x300,
@@ -107,6 +129,7 @@ static struct platform_device voiceblue_smc91x_device = {
107}; 129};
108 130
109static struct platform_device *voiceblue_devices[] __initdata = { 131static struct platform_device *voiceblue_devices[] __initdata = {
132 &voiceblue_flash_device,
110 &voiceblue_smc91x_device, 133 &voiceblue_smc91x_device,
111}; 134};
112 135
@@ -119,8 +142,17 @@ static struct omap_usb_config voiceblue_usb_config __initdata = {
119 .pins[2] = 6, 142 .pins[2] = 6,
120}; 143};
121 144
145static struct omap_mmc_config voiceblue_mmc_config __initdata = {
146 .mmc[0] = {
147 .enabled = 1,
148 .power_pin = 2,
149 .switch_pin = -1,
150 },
151};
152
122static struct omap_board_config_kernel voiceblue_config[] = { 153static struct omap_board_config_kernel voiceblue_config[] = {
123 { OMAP_TAG_USB, &voiceblue_usb_config }, 154 { OMAP_TAG_USB, &voiceblue_usb_config },
155 { OMAP_TAG_MMC, &voiceblue_mmc_config },
124}; 156};
125 157
126static void __init voiceblue_init_irq(void) 158static void __init voiceblue_init_irq(void)
@@ -131,9 +163,6 @@ static void __init voiceblue_init_irq(void)
131 163
132static void __init voiceblue_init(void) 164static void __init voiceblue_init(void)
133{ 165{
134 /* There is a good chance board is going up, so enable Power LED
135 * (it is connected through invertor) */
136 omap_writeb(0x00, OMAP_LPG1_LCR);
137 /* Watchdog */ 166 /* Watchdog */
138 omap_request_gpio(0); 167 omap_request_gpio(0);
139 /* smc91x reset */ 168 /* smc91x reset */
@@ -145,7 +174,6 @@ static void __init voiceblue_init(void)
145 mdelay(50); /* 50ms until PHY ready */ 174 mdelay(50); /* 50ms until PHY ready */
146 /* smc91x interrupt pin */ 175 /* smc91x interrupt pin */
147 omap_request_gpio(8); 176 omap_request_gpio(8);
148 omap_set_gpio_edge_ctrl(8, OMAP_GPIO_RISING_EDGE);
149 /* 16C554 reset*/ 177 /* 16C554 reset*/
150 omap_request_gpio(6); 178 omap_request_gpio(6);
151 omap_set_gpio_direction(6, 0); 179 omap_set_gpio_direction(6, 0);
@@ -155,14 +183,19 @@ static void __init voiceblue_init(void)
155 omap_request_gpio(13); 183 omap_request_gpio(13);
156 omap_request_gpio(14); 184 omap_request_gpio(14);
157 omap_request_gpio(15); 185 omap_request_gpio(15);
158 omap_set_gpio_edge_ctrl(12, OMAP_GPIO_RISING_EDGE); 186 set_irq_type(OMAP_GPIO_IRQ(12), IRQT_RISING);
159 omap_set_gpio_edge_ctrl(13, OMAP_GPIO_RISING_EDGE); 187 set_irq_type(OMAP_GPIO_IRQ(13), IRQT_RISING);
160 omap_set_gpio_edge_ctrl(14, OMAP_GPIO_RISING_EDGE); 188 set_irq_type(OMAP_GPIO_IRQ(14), IRQT_RISING);
161 omap_set_gpio_edge_ctrl(15, OMAP_GPIO_RISING_EDGE); 189 set_irq_type(OMAP_GPIO_IRQ(15), IRQT_RISING);
162 190
163 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); 191 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
164 omap_board_config = voiceblue_config; 192 omap_board_config = voiceblue_config;
165 omap_board_config_size = ARRAY_SIZE(voiceblue_config); 193 omap_board_config_size = ARRAY_SIZE(voiceblue_config);
194
195 /* There is a good chance board is going up, so enable power LED
196 * (it is connected through invertor) */
197 omap_writeb(0x00, OMAP_LPG1_LCR);
198 omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */
166} 199}
167 200
168static int __initdata omap_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1}; 201static int __initdata omap_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1};
@@ -184,9 +217,9 @@ static int panic_event(struct notifier_block *this, unsigned long event,
184 if (test_and_set_bit(MACHINE_PANICED, &machine_state)) 217 if (test_and_set_bit(MACHINE_PANICED, &machine_state))
185 return NOTIFY_DONE; 218 return NOTIFY_DONE;
186 219
187 /* Flash Power LED 220 /* Flash power LED */
188 * (TODO: Enable clock right way (enabled in bootloader already)) */
189 omap_writeb(0x78, OMAP_LPG1_LCR); 221 omap_writeb(0x78, OMAP_LPG1_LCR);
222 omap_writeb(0x01, OMAP_LPG1_PMR); /* Enable clock */
190 223
191 return NOTIFY_DONE; 224 return NOTIFY_DONE;
192} 225}
@@ -195,15 +228,14 @@ static struct notifier_block panic_block = {
195 .notifier_call = panic_event, 228 .notifier_call = panic_event,
196}; 229};
197 230
198static int __init setup_notifier(void) 231static int __init voiceblue_setup(void)
199{ 232{
200 /* Setup panic notifier */ 233 /* Setup panic notifier */
201 notifier_chain_register(&panic_notifier_list, &panic_block); 234 notifier_chain_register(&panic_notifier_list, &panic_block);
202 235
203 return 0; 236 return 0;
204} 237}
205 238postcore_initcall(voiceblue_setup);
206postcore_initcall(setup_notifier);
207 239
208static int wdt_gpio_state; 240static int wdt_gpio_state;
209 241
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
new file mode 100644
index 000000000000..e8b3981444cd
--- /dev/null
+++ b/arch/arm/mach-omap1/devices.c
@@ -0,0 +1,351 @@
1/*
2 * linux/arch/arm/mach-omap1/devices.c
3 *
4 * OMAP1 platform device setup/initialization
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#include <linux/config.h>
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/device.h>
17
18#include <asm/hardware.h>
19#include <asm/io.h>
20#include <asm/mach-types.h>
21#include <asm/mach/map.h>
22
23#include <asm/arch/tc.h>
24#include <asm/arch/board.h>
25#include <asm/arch/mux.h>
26#include <asm/arch/gpio.h>
27
28
29static void omap_nop_release(struct device *dev)
30{
31 /* Nothing */
32}
33
34/*-------------------------------------------------------------------------*/
35
36#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
37
38#define OMAP_I2C_BASE 0xfffb3800
39
40static struct resource i2c_resources[] = {
41 {
42 .start = OMAP_I2C_BASE,
43 .end = OMAP_I2C_BASE + 0x3f,
44 .flags = IORESOURCE_MEM,
45 },
46 {
47 .start = INT_I2C,
48 .flags = IORESOURCE_IRQ,
49 },
50};
51
52/* DMA not used; works around erratum writing to non-empty i2c fifo */
53
54static struct platform_device omap_i2c_device = {
55 .name = "i2c_omap",
56 .id = -1,
57 .dev = {
58 .release = omap_nop_release,
59 },
60 .num_resources = ARRAY_SIZE(i2c_resources),
61 .resource = i2c_resources,
62};
63
64static void omap_init_i2c(void)
65{
66 /* FIXME define and use a boot tag, in case of boards that
67 * either don't wire up I2C, or chips that mux it differently...
68 * it can include clocking and address info, maybe more.
69 */
70 omap_cfg_reg(I2C_SCL);
71 omap_cfg_reg(I2C_SDA);
72
73 (void) platform_device_register(&omap_i2c_device);
74}
75#else
76static inline void omap_init_i2c(void) {}
77#endif
78
79/*-------------------------------------------------------------------------*/
80
81#if defined(CONFIG_OMAP1610_IR) || defined(CONFIG_OMAP161O_IR_MODULE)
82
83static u64 irda_dmamask = 0xffffffff;
84
85static struct platform_device omap1610ir_device = {
86 .name = "omap1610-ir",
87 .id = -1,
88 .dev = {
89 .release = omap_nop_release,
90 .dma_mask = &irda_dmamask,
91 },
92};
93
94static void omap_init_irda(void)
95{
96 /* FIXME define and use a boot tag, members something like:
97 * u8 uart; // uart1, or uart3
98 * ... but driver only handles uart3 for now
99 * s16 fir_sel; // gpio for SIR vs FIR
100 * ... may prefer a callback for SIR/MIR/FIR mode select;
101 * while h2 uses a GPIO, H3 uses a gpio expander
102 */
103 if (machine_is_omap_h2()
104 || machine_is_omap_h3())
105 (void) platform_device_register(&omap1610ir_device);
106}
107#else
108static inline void omap_init_irda(void) {}
109#endif
110
111/*-------------------------------------------------------------------------*/
112
113#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
114
115#define OMAP_MMC1_BASE 0xfffb7800
116#define OMAP_MMC2_BASE 0xfffb7c00 /* omap16xx only */
117
118static struct omap_mmc_conf mmc1_conf;
119
120static u64 mmc1_dmamask = 0xffffffff;
121
122static struct resource mmc1_resources[] = {
123 {
124 .start = IO_ADDRESS(OMAP_MMC1_BASE),
125 .end = IO_ADDRESS(OMAP_MMC1_BASE) + 0x7f,
126 .flags = IORESOURCE_MEM,
127 },
128 {
129 .start = INT_MMC,
130 .flags = IORESOURCE_IRQ,
131 },
132};
133
134static struct platform_device mmc_omap_device1 = {
135 .name = "mmci-omap",
136 .id = 1,
137 .dev = {
138 .release = omap_nop_release,
139 .dma_mask = &mmc1_dmamask,
140 .platform_data = &mmc1_conf,
141 },
142 .num_resources = ARRAY_SIZE(mmc1_resources),
143 .resource = mmc1_resources,
144};
145
146#ifdef CONFIG_ARCH_OMAP16XX
147
148static struct omap_mmc_conf mmc2_conf;
149
150static u64 mmc2_dmamask = 0xffffffff;
151
152static struct resource mmc2_resources[] = {
153 {
154 .start = IO_ADDRESS(OMAP_MMC2_BASE),
155 .end = IO_ADDRESS(OMAP_MMC2_BASE) + 0x7f,
156 .flags = IORESOURCE_MEM,
157 },
158 {
159 .start = INT_1610_MMC2,
160 .flags = IORESOURCE_IRQ,
161 },
162};
163
164static struct platform_device mmc_omap_device2 = {
165 .name = "mmci-omap",
166 .id = 2,
167 .dev = {
168 .release = omap_nop_release,
169 .dma_mask = &mmc2_dmamask,
170 .platform_data = &mmc2_conf,
171 },
172 .num_resources = ARRAY_SIZE(mmc2_resources),
173 .resource = mmc2_resources,
174};
175#endif
176
177static void __init omap_init_mmc(void)
178{
179 const struct omap_mmc_config *mmc_conf;
180 const struct omap_mmc_conf *mmc;
181
182 /* NOTE: assumes MMC was never (wrongly) enabled */
183 mmc_conf = omap_get_config(OMAP_TAG_MMC, struct omap_mmc_config);
184 if (!mmc_conf)
185 return;
186
187 /* block 1 is always available and has just one pinout option */
188 mmc = &mmc_conf->mmc[0];
189 if (mmc->enabled) {
190 omap_cfg_reg(MMC_CMD);
191 omap_cfg_reg(MMC_CLK);
192 omap_cfg_reg(MMC_DAT0);
193 if (cpu_is_omap1710()) {
194 omap_cfg_reg(M15_1710_MMC_CLKI);
195 omap_cfg_reg(P19_1710_MMC_CMDDIR);
196 omap_cfg_reg(P20_1710_MMC_DATDIR0);
197 }
198 if (mmc->wire4) {
199 omap_cfg_reg(MMC_DAT1);
200 /* NOTE: DAT2 can be on W10 (here) or M15 */
201 if (!mmc->nomux)
202 omap_cfg_reg(MMC_DAT2);
203 omap_cfg_reg(MMC_DAT3);
204 }
205 mmc1_conf = *mmc;
206 (void) platform_device_register(&mmc_omap_device1);
207 }
208
209#ifdef CONFIG_ARCH_OMAP16XX
210 /* block 2 is on newer chips, and has many pinout options */
211 mmc = &mmc_conf->mmc[1];
212 if (mmc->enabled) {
213 if (!mmc->nomux) {
214 omap_cfg_reg(Y8_1610_MMC2_CMD);
215 omap_cfg_reg(Y10_1610_MMC2_CLK);
216 omap_cfg_reg(R18_1610_MMC2_CLKIN);
217 omap_cfg_reg(W8_1610_MMC2_DAT0);
218 if (mmc->wire4) {
219 omap_cfg_reg(V8_1610_MMC2_DAT1);
220 omap_cfg_reg(W15_1610_MMC2_DAT2);
221 omap_cfg_reg(R10_1610_MMC2_DAT3);
222 }
223
224 /* These are needed for the level shifter */
225 omap_cfg_reg(V9_1610_MMC2_CMDDIR);
226 omap_cfg_reg(V5_1610_MMC2_DATDIR0);
227 omap_cfg_reg(W19_1610_MMC2_DATDIR1);
228 }
229
230 /* Feedback clock must be set on OMAP-1710 MMC2 */
231 if (cpu_is_omap1710())
232 omap_writel(omap_readl(MOD_CONF_CTRL_1) | (1 << 24),
233 MOD_CONF_CTRL_1);
234 mmc2_conf = *mmc;
235 (void) platform_device_register(&mmc_omap_device2);
236 }
237#endif
238 return;
239}
240#else
241static inline void omap_init_mmc(void) {}
242#endif
243
244#if defined(CONFIG_OMAP_RTC) || defined(CONFIG_OMAP_RTC)
245
246#define OMAP_RTC_BASE 0xfffb4800
247
248static struct resource rtc_resources[] = {
249 {
250 .start = OMAP_RTC_BASE,
251 .end = OMAP_RTC_BASE + 0x5f,
252 .flags = IORESOURCE_MEM,
253 },
254 {
255 .start = INT_RTC_TIMER,
256 .flags = IORESOURCE_IRQ,
257 },
258 {
259 .start = INT_RTC_ALARM,
260 .flags = IORESOURCE_IRQ,
261 },
262};
263
264static struct platform_device omap_rtc_device = {
265 .name = "omap_rtc",
266 .id = -1,
267 .dev = {
268 .release = omap_nop_release,
269 },
270 .num_resources = ARRAY_SIZE(rtc_resources),
271 .resource = rtc_resources,
272};
273
274static void omap_init_rtc(void)
275{
276 (void) platform_device_register(&omap_rtc_device);
277}
278#else
279static inline void omap_init_rtc(void) {}
280#endif
281
282/*-------------------------------------------------------------------------*/
283
284#if defined(CONFIG_OMAP16XX_WATCHDOG) || defined(CONFIG_OMAP16XX_WATCHDOG_MODULE)
285
286#define OMAP_WDT_BASE 0xfffeb000
287
288static struct resource wdt_resources[] = {
289 {
290 .start = OMAP_WDT_BASE,
291 .end = OMAP_WDT_BASE + 0x4f,
292 .flags = IORESOURCE_MEM,
293 },
294};
295
296static struct platform_device omap_wdt_device = {
297 .name = "omap1610_wdt",
298 .id = -1,
299 .dev = {
300 .release = omap_nop_release,
301 },
302 .num_resources = ARRAY_SIZE(wdt_resources),
303 .resource = wdt_resources,
304};
305
306static void omap_init_wdt(void)
307{
308 (void) platform_device_register(&omap_wdt_device);
309}
310#else
311static inline void omap_init_wdt(void) {}
312#endif
313
314
315/*-------------------------------------------------------------------------*/
316
317/*
318 * This gets called after board-specific INIT_MACHINE, and initializes most
319 * on-chip peripherals accessible on this board (except for few like USB):
320 *
321 * (a) Does any "standard config" pin muxing needed. Board-specific
322 * code will have muxed GPIO pins and done "nonstandard" setup;
323 * that code could live in the boot loader.
324 * (b) Populating board-specific platform_data with the data drivers
325 * rely on to handle wiring variations.
326 * (c) Creating platform devices as meaningful on this board and
327 * with this kernel configuration.
328 *
329 * Claiming GPIOs, and setting their direction and initial values, is the
330 * responsibility of the device drivers. So is responding to probe().
331 *
332 * Board-specific knowlege like creating devices or pin setup is to be
333 * kept out of drivers as much as possible. In particular, pin setup
334 * may be handled by the boot loader, and drivers should expect it will
335 * normally have been done by the time they're probed.
336 */
337static int __init omap_init_devices(void)
338{
339 /* please keep these calls, and their implementations above,
340 * in alphabetical order so they're easier to sort through.
341 */
342 omap_init_i2c();
343 omap_init_irda();
344 omap_init_mmc();
345 omap_init_rtc();
346 omap_init_wdt();
347
348 return 0;
349}
350arch_initcall(omap_init_devices);
351
diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c
index c12a78335625..aca2a120813a 100644
--- a/arch/arm/mach-omap1/fpga.c
+++ b/arch/arm/mach-omap1/fpga.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-omap/fpga.c 2 * linux/arch/arm/mach-omap1/fpga.c
3 * 3 *
4 * Interrupt handler for OMAP-1510 Innovator FPGA 4 * Interrupt handler for OMAP-1510 Innovator FPGA
5 * 5 *
@@ -181,7 +181,7 @@ void omap1510_fpga_init_irq(void)
181 */ 181 */
182 omap_request_gpio(13); 182 omap_request_gpio(13);
183 omap_set_gpio_direction(13, 1); 183 omap_set_gpio_direction(13, 1);
184 omap_set_gpio_edge_ctrl(13, OMAP_GPIO_RISING_EDGE); 184 set_irq_type(OMAP_GPIO_IRQ(13), IRQT_RISING);
185 set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux); 185 set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux);
186} 186}
187 187
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index 207df0fe934d..eb8261d7dead 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -19,6 +19,7 @@
19 19
20extern int clk_init(void); 20extern int clk_init(void);
21extern void omap_check_revision(void); 21extern void omap_check_revision(void);
22extern void omap_sram_init(void);
22 23
23/* 24/*
24 * The machine specific code may provide the extra mapping besides the 25 * The machine specific code may provide the extra mapping besides the
@@ -32,7 +33,6 @@ static struct map_desc omap_io_desc[] __initdata = {
32static struct map_desc omap730_io_desc[] __initdata = { 33static struct map_desc omap730_io_desc[] __initdata = {
33 { OMAP730_DSP_BASE, OMAP730_DSP_START, OMAP730_DSP_SIZE, MT_DEVICE }, 34 { OMAP730_DSP_BASE, OMAP730_DSP_START, OMAP730_DSP_SIZE, MT_DEVICE },
34 { OMAP730_DSPREG_BASE, OMAP730_DSPREG_START, OMAP730_DSPREG_SIZE, MT_DEVICE }, 35 { OMAP730_DSPREG_BASE, OMAP730_DSPREG_START, OMAP730_DSPREG_SIZE, MT_DEVICE },
35 { OMAP730_SRAM_BASE, OMAP730_SRAM_START, OMAP730_SRAM_SIZE, MT_DEVICE }
36}; 36};
37#endif 37#endif
38 38
@@ -40,27 +40,13 @@ static struct map_desc omap730_io_desc[] __initdata = {
40static struct map_desc omap1510_io_desc[] __initdata = { 40static struct map_desc omap1510_io_desc[] __initdata = {
41 { OMAP1510_DSP_BASE, OMAP1510_DSP_START, OMAP1510_DSP_SIZE, MT_DEVICE }, 41 { OMAP1510_DSP_BASE, OMAP1510_DSP_START, OMAP1510_DSP_SIZE, MT_DEVICE },
42 { OMAP1510_DSPREG_BASE, OMAP1510_DSPREG_START, OMAP1510_DSPREG_SIZE, MT_DEVICE }, 42 { OMAP1510_DSPREG_BASE, OMAP1510_DSPREG_START, OMAP1510_DSPREG_SIZE, MT_DEVICE },
43 { OMAP1510_SRAM_BASE, OMAP1510_SRAM_START, OMAP1510_SRAM_SIZE, MT_DEVICE }
44}; 43};
45#endif 44#endif
46 45
47#if defined(CONFIG_ARCH_OMAP16XX) 46#if defined(CONFIG_ARCH_OMAP16XX)
48static struct map_desc omap1610_io_desc[] __initdata = { 47static struct map_desc omap16xx_io_desc[] __initdata = {
49 { OMAP16XX_DSP_BASE, OMAP16XX_DSP_START, OMAP16XX_DSP_SIZE, MT_DEVICE }, 48 { OMAP16XX_DSP_BASE, OMAP16XX_DSP_START, OMAP16XX_DSP_SIZE, MT_DEVICE },
50 { OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_START, OMAP16XX_DSPREG_SIZE, MT_DEVICE }, 49 { OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_START, OMAP16XX_DSPREG_SIZE, MT_DEVICE },
51 { OMAP16XX_SRAM_BASE, OMAP16XX_SRAM_START, OMAP1610_SRAM_SIZE, MT_DEVICE }
52};
53
54static struct map_desc omap5912_io_desc[] __initdata = {
55 { OMAP16XX_DSP_BASE, OMAP16XX_DSP_START, OMAP16XX_DSP_SIZE, MT_DEVICE },
56 { OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_START, OMAP16XX_DSPREG_SIZE, MT_DEVICE },
57/*
58 * The OMAP5912 has 250kByte internal SRAM. Because the mapping is baseed on page
59 * size (4kByte), it seems that the last 2kByte (=0x800) of the 250kByte are not mapped.
60 * Add additional 2kByte (0x800) so that the last page is mapped and the last 2kByte
61 * can be used.
62 */
63 { OMAP16XX_SRAM_BASE, OMAP16XX_SRAM_START, OMAP5912_SRAM_SIZE + 0x800, MT_DEVICE }
64}; 50};
65#endif 51#endif
66 52
@@ -86,14 +72,13 @@ static void __init _omap_map_io(void)
86 } 72 }
87#endif 73#endif
88#if defined(CONFIG_ARCH_OMAP16XX) 74#if defined(CONFIG_ARCH_OMAP16XX)
89 if (cpu_is_omap1610() || cpu_is_omap1710()) { 75 if (cpu_is_omap16xx()) {
90 iotable_init(omap1610_io_desc, ARRAY_SIZE(omap1610_io_desc)); 76 iotable_init(omap16xx_io_desc, ARRAY_SIZE(omap16xx_io_desc));
91 }
92 if (cpu_is_omap5912()) {
93 iotable_init(omap5912_io_desc, ARRAY_SIZE(omap5912_io_desc));
94 } 77 }
95#endif 78#endif
96 79
80 omap_sram_init();
81
97 /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort 82 /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
98 * on a Posted Write in the TIPB Bridge". 83 * on a Posted Write in the TIPB Bridge".
99 */ 84 */
@@ -108,8 +93,9 @@ static void __init _omap_map_io(void)
108/* 93/*
109 * This should only get called from board specific init 94 * This should only get called from board specific init
110 */ 95 */
111void omap_map_common_io(void) 96void __init omap_map_common_io(void)
112{ 97{
113 if (!initialized) 98 if (!initialized)
114 _omap_map_io(); 99 _omap_map_io();
115} 100}
101
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index afd5d67e4ae7..192ce6055faa 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-omap/irq.c 2 * linux/arch/arm/mach-omap1/irq.c
3 * 3 *
4 * Interrupt handler for all OMAP boards 4 * Interrupt handler for all OMAP boards
5 * 5 *
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c
index ec0d8285f243..be283cda63dd 100644
--- a/arch/arm/mach-omap1/leds-h2p2-debug.c
+++ b/arch/arm/mach-omap1/leds-h2p2-debug.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-omap/leds-h2p2-debug.c 2 * linux/arch/arm/mach-omap1/leds-h2p2-debug.c
3 * 3 *
4 * Copyright 2003 by Texas Instruments Incorporated 4 * Copyright 2003 by Texas Instruments Incorporated
5 * 5 *
@@ -13,6 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/kernel_stat.h> 14#include <linux/kernel_stat.h>
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/version.h>
16 17
17#include <asm/io.h> 18#include <asm/io.h>
18#include <asm/hardware.h> 19#include <asm/hardware.h>
diff --git a/arch/arm/mach-omap1/leds-innovator.c b/arch/arm/mach-omap1/leds-innovator.c
index 8043b7d0f66e..c8ffd1ddcded 100644
--- a/arch/arm/mach-omap1/leds-innovator.c
+++ b/arch/arm/mach-omap1/leds-innovator.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-omap/leds-innovator.c 2 * linux/arch/arm/mach-omap1/leds-innovator.c
3 */ 3 */
4#include <linux/config.h> 4#include <linux/config.h>
5#include <linux/init.h> 5#include <linux/init.h>
diff --git a/arch/arm/mach-omap1/leds-osk.c b/arch/arm/mach-omap1/leds-osk.c
index 4a0e8b9d4fc3..2c8bda847c18 100644
--- a/arch/arm/mach-omap1/leds-osk.c
+++ b/arch/arm/mach-omap1/leds-osk.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-omap/leds-osk.c 2 * linux/arch/arm/mach-omap1/leds-osk.c
3 * 3 *
4 * LED driver for OSK, and optionally Mistral QVGA, boards 4 * LED driver for OSK, and optionally Mistral QVGA, boards
5 */ 5 */
@@ -64,7 +64,7 @@ static void tps_work(void *unused)
64 64
65static DECLARE_WORK(work, tps_work, NULL); 65static DECLARE_WORK(work, tps_work, NULL);
66 66
67#ifdef CONFIG_FB_OMAP 67#ifdef CONFIG_OMAP_OSK_MISTRAL
68 68
69/* For now, all system indicators require the Mistral board, since that 69/* For now, all system indicators require the Mistral board, since that
70 * LED can be manipulated without a task context. This LED is either red, 70 * LED can be manipulated without a task context. This LED is either red,
@@ -127,7 +127,7 @@ void osk_leds_event(led_event_t evt)
127 hw_led_state = 0; 127 hw_led_state = 0;
128 break; 128 break;
129 129
130#ifdef CONFIG_FB_OMAP 130#ifdef CONFIG_OMAP_OSK_MISTRAL
131 131
132 case led_timer: 132 case led_timer:
133 hw_led_state ^= TIMER_LED; 133 hw_led_state ^= TIMER_LED;
@@ -144,7 +144,7 @@ void osk_leds_event(led_event_t evt)
144 mistral_setled(); 144 mistral_setled();
145 break; 145 break;
146 146
147#endif /* CONFIG_FB_OMAP */ 147#endif /* CONFIG_OMAP_OSK_MISTRAL */
148 148
149 /* "green" == tps LED1 (leftmost, normally power-good) 149 /* "green" == tps LED1 (leftmost, normally power-good)
150 * works only with DC adapter, not on battery power! 150 * works only with DC adapter, not on battery power!
diff --git a/arch/arm/mach-omap1/leds.c b/arch/arm/mach-omap1/leds.c
index 8ab21fe98e1b..5c6b1bb6e722 100644
--- a/arch/arm/mach-omap1/leds.c
+++ b/arch/arm/mach-omap1/leds.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-omap/leds.c 2 * linux/arch/arm/mach-omap1/leds.c
3 * 3 *
4 * OMAP LEDs dispatcher 4 * OMAP LEDs dispatcher
5 */ 5 */
@@ -20,7 +20,9 @@ omap_leds_init(void)
20 if (machine_is_omap_innovator()) 20 if (machine_is_omap_innovator())
21 leds_event = innovator_leds_event; 21 leds_event = innovator_leds_event;
22 22
23 else if (machine_is_omap_h2() || machine_is_omap_perseus2()) 23 else if (machine_is_omap_h2()
24 || machine_is_omap_h3()
25 || machine_is_omap_perseus2())
24 leds_event = h2p2_dbg_leds_event; 26 leds_event = h2p2_dbg_leds_event;
25 27
26 else if (machine_is_omap_osk()) 28 else if (machine_is_omap_osk())
@@ -30,8 +32,12 @@ omap_leds_init(void)
30 return -1; 32 return -1;
31 33
32 if (machine_is_omap_h2() 34 if (machine_is_omap_h2()
35 || machine_is_omap_h3()
33 || machine_is_omap_perseus2() 36 || machine_is_omap_perseus2()
34 || machine_is_omap_osk()) { 37#ifdef CONFIG_OMAP_OSK_MISTRAL
38 || machine_is_omap_osk()
39#endif
40 ) {
35 41
36 /* LED1/LED2 pins can be used as GPIO (as done here), or by 42 /* LED1/LED2 pins can be used as GPIO (as done here), or by
37 * the LPG (works even in deep sleep!), to drive a bicolor 43 * the LPG (works even in deep sleep!), to drive a bicolor
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 214e5d17c8b5..40c4f7c40e73 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -24,7 +24,11 @@
24 24
25#include <asm/arch/board.h> 25#include <asm/arch/board.h>
26#include <asm/arch/mux.h> 26#include <asm/arch/mux.h>
27#include <asm/arch/gpio.h>
27#include <asm/arch/fpga.h> 28#include <asm/arch/fpga.h>
29#ifdef CONFIG_PM
30#include <asm/arch/pm.h>
31#endif
28 32
29static struct clk * uart1_ck = NULL; 33static struct clk * uart1_ck = NULL;
30static struct clk * uart2_ck = NULL; 34static struct clk * uart2_ck = NULL;
@@ -94,7 +98,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
94 98
95static struct platform_device serial_device = { 99static struct platform_device serial_device = {
96 .name = "serial8250", 100 .name = "serial8250",
97 .id = 0, 101 .id = PLAT8250_DEV_PLATFORM,
98 .dev = { 102 .dev = {
99 .platform_data = serial_platform_data, 103 .platform_data = serial_platform_data,
100 }, 104 },
@@ -193,6 +197,86 @@ void __init omap_serial_init(int ports[OMAP_MAX_NR_PORTS])
193 } 197 }
194} 198}
195 199
200#ifdef CONFIG_OMAP_SERIAL_WAKE
201
202static irqreturn_t omap_serial_wake_interrupt(int irq, void *dev_id,
203 struct pt_regs *regs)
204{
205 /* Need to do something with serial port right after wake-up? */
206 return IRQ_HANDLED;
207}
208
209/*
210 * Reroutes serial RX lines to GPIO lines for the duration of
211 * sleep to allow waking up the device from serial port even
212 * in deep sleep.
213 */
214void omap_serial_wake_trigger(int enable)
215{
216 if (!cpu_is_omap16xx())
217 return;
218
219 if (uart1_ck != NULL) {
220 if (enable)
221 omap_cfg_reg(V14_16XX_GPIO37);
222 else
223 omap_cfg_reg(V14_16XX_UART1_RX);
224 }
225 if (uart2_ck != NULL) {
226 if (enable)
227 omap_cfg_reg(R9_16XX_GPIO18);
228 else
229 omap_cfg_reg(R9_16XX_UART2_RX);
230 }
231 if (uart3_ck != NULL) {
232 if (enable)
233 omap_cfg_reg(L14_16XX_GPIO49);
234 else
235 omap_cfg_reg(L14_16XX_UART3_RX);
236 }
237}
238
239static void __init omap_serial_set_port_wakeup(int gpio_nr)
240{
241 int ret;
242
243 ret = omap_request_gpio(gpio_nr);
244 if (ret < 0) {
245 printk(KERN_ERR "Could not request UART wake GPIO: %i\n",
246 gpio_nr);
247 return;
248 }
249 omap_set_gpio_direction(gpio_nr, 1);
250 set_irq_type(OMAP_GPIO_IRQ(gpio_nr), IRQT_RISING);
251 ret = request_irq(OMAP_GPIO_IRQ(gpio_nr), &omap_serial_wake_interrupt,
252 0, "serial wakeup", NULL);
253 if (ret) {
254 omap_free_gpio(gpio_nr);
255 printk(KERN_ERR "No interrupt for UART wake GPIO: %i\n",
256 gpio_nr);
257 return;
258 }
259 enable_irq_wake(OMAP_GPIO_IRQ(gpio_nr));
260}
261
262static int __init omap_serial_wakeup_init(void)
263{
264 if (!cpu_is_omap16xx())
265 return 0;
266
267 if (uart1_ck != NULL)
268 omap_serial_set_port_wakeup(37);
269 if (uart2_ck != NULL)
270 omap_serial_set_port_wakeup(18);
271 if (uart3_ck != NULL)
272 omap_serial_set_port_wakeup(49);
273
274 return 0;
275}
276late_initcall(omap_serial_wakeup_init);
277
278#endif /* CONFIG_OMAP_SERIAL_WAKE */
279
196static int __init omap_init(void) 280static int __init omap_init(void)
197{ 281{
198 return platform_device_register(&serial_device); 282 return platform_device_register(&serial_device);
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index d540539c9bbb..191a9b1ee9b7 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -247,13 +247,6 @@ unsigned long long sched_clock(void)
247#define OMAP_32K_TIMER_TCR 0x04 247#define OMAP_32K_TIMER_TCR 0x04
248 248
249#define OMAP_32K_TICKS_PER_HZ (32768 / HZ) 249#define OMAP_32K_TICKS_PER_HZ (32768 / HZ)
250#if (32768 % HZ) != 0
251/* We cannot ignore modulo.
252 * Potential error can be as high as several percent.
253 */
254#define OMAP_32K_TICK_MODULO (32768 % HZ)
255static unsigned modulo_count = 0; /* Counts 1/HZ units */
256#endif
257 250
258/* 251/*
259 * TRM says 1 / HZ = ( TVR + 1) / 32768, so TRV = (32768 / HZ) - 1 252 * TRM says 1 / HZ = ( TVR + 1) / 32768, so TRV = (32768 / HZ) - 1
@@ -296,13 +289,22 @@ static inline void omap_32k_timer_stop(void)
296} 289}
297 290
298/* 291/*
299 * Rounds down to nearest usec 292 * Rounds down to nearest usec. Note that this will overflow for larger values.
300 */ 293 */
301static inline unsigned long omap_32k_ticks_to_usecs(unsigned long ticks_32k) 294static inline unsigned long omap_32k_ticks_to_usecs(unsigned long ticks_32k)
302{ 295{
303 return (ticks_32k * 5*5*5*5*5*5) >> 9; 296 return (ticks_32k * 5*5*5*5*5*5) >> 9;
304} 297}
305 298
299/*
300 * Rounds down to nearest nsec.
301 */
302static inline unsigned long long
303omap_32k_ticks_to_nsecs(unsigned long ticks_32k)
304{
305 return (unsigned long long) ticks_32k * 1000 * 5*5*5*5*5*5 >> 9;
306}
307
306static unsigned long omap_32k_last_tick = 0; 308static unsigned long omap_32k_last_tick = 0;
307 309
308/* 310/*
@@ -315,6 +317,15 @@ static unsigned long omap_32k_timer_gettimeoffset(void)
315} 317}
316 318
317/* 319/*
320 * Returns current time from boot in nsecs. It's OK for this to wrap
321 * around for now, as it's just a relative time stamp.
322 */
323unsigned long long sched_clock(void)
324{
325 return omap_32k_ticks_to_nsecs(omap_32k_sync_timer_read());
326}
327
328/*
318 * Timer interrupt for 32KHz timer. When dynamic tick is enabled, this 329 * Timer interrupt for 32KHz timer. When dynamic tick is enabled, this
319 * function is also called from other interrupts to remove latency 330 * function is also called from other interrupts to remove latency
320 * issues with dynamic tick. In the dynamic tick case, we need to lock 331 * issues with dynamic tick. In the dynamic tick case, we need to lock
@@ -330,19 +341,6 @@ static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id,
330 now = omap_32k_sync_timer_read(); 341 now = omap_32k_sync_timer_read();
331 342
332 while (now - omap_32k_last_tick >= OMAP_32K_TICKS_PER_HZ) { 343 while (now - omap_32k_last_tick >= OMAP_32K_TICKS_PER_HZ) {
333#ifdef OMAP_32K_TICK_MODULO
334 /* Modulo addition may put omap_32k_last_tick ahead of now
335 * and cause unwanted repetition of the while loop.
336 */
337 if (unlikely(now - omap_32k_last_tick == ~0))
338 break;
339
340 modulo_count += OMAP_32K_TICK_MODULO;
341 if (modulo_count > HZ) {
342 ++omap_32k_last_tick;
343 modulo_count -= HZ;
344 }
345#endif
346 omap_32k_last_tick += OMAP_32K_TICKS_PER_HZ; 344 omap_32k_last_tick += OMAP_32K_TICKS_PER_HZ;
347 timer_tick(regs); 345 timer_tick(regs);
348 } 346 }
diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index 8ccffba0018f..366a9bde3d8b 100644
--- a/arch/arm/mach-pxa/corgi_ssp.c
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -22,7 +22,7 @@
22#include <asm/arch/corgi.h> 22#include <asm/arch/corgi.h>
23#include <asm/arch/pxa-regs.h> 23#include <asm/arch/pxa-regs.h>
24 24
25static spinlock_t corgi_ssp_lock = SPIN_LOCK_UNLOCKED; 25static DEFINE_SPINLOCK(corgi_ssp_lock);
26static struct ssp_dev corgi_ssp_dev; 26static struct ssp_dev corgi_ssp_dev;
27static struct ssp_state corgi_ssp_state; 27static struct ssp_state corgi_ssp_state;
28 28
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index a10268618f74..e3587efec4bf 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -140,7 +140,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
140 140
141static struct platform_device serial_device = { 141static struct platform_device serial_device = {
142 .name = "serial8250", 142 .name = "serial8250",
143 .id = 0, 143 .id = PLAT8250_DEV_PLATFORM,
144 .dev = { 144 .dev = {
145 .platform_data = serial_platform_data, 145 .platform_data = serial_platform_data,
146 }, 146 },
diff --git a/arch/arm/mach-s3c2410/devs.c b/arch/arm/mach-s3c2410/devs.c
index 4664bd11adc1..0077937a7ab8 100644
--- a/arch/arm/mach-s3c2410/devs.c
+++ b/arch/arm/mach-s3c2410/devs.c
@@ -29,7 +29,7 @@
29#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 30#include <asm/mach/map.h>
31#include <asm/mach/irq.h> 31#include <asm/mach/irq.h>
32 32#include <asm/arch/fb.h>
33#include <asm/hardware.h> 33#include <asm/hardware.h>
34#include <asm/io.h> 34#include <asm/io.h>
35#include <asm/irq.h> 35#include <asm/irq.h>
@@ -103,6 +103,15 @@ struct platform_device s3c_device_lcd = {
103 103
104EXPORT_SYMBOL(s3c_device_lcd); 104EXPORT_SYMBOL(s3c_device_lcd);
105 105
106static struct s3c2410fb_mach_info s3c2410fb_info;
107
108void __init set_s3c2410fb_info(struct s3c2410fb_mach_info *hard_s3c2410fb_info)
109{
110 memcpy(&s3c2410fb_info,hard_s3c2410fb_info,sizeof(struct s3c2410fb_mach_info));
111 s3c_device_lcd.dev.platform_data = &s3c2410fb_info;
112}
113EXPORT_SYMBOL(set_s3c2410fb_info);
114
106/* NAND Controller */ 115/* NAND Controller */
107 116
108static struct resource s3c_nand_resource[] = { 117static struct resource s3c_nand_resource[] = {
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index e9182242da95..1a3367da6408 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -381,7 +381,7 @@ static struct plat_serial8250_port bast_sio_data[] = {
381 381
382static struct platform_device bast_sio = { 382static struct platform_device bast_sio = {
383 .name = "serial8250", 383 .name = "serial8250",
384 .id = 0, 384 .id = PLAT8250_DEV_PLATFORM,
385 .dev = { 385 .dev = {
386 .platform_data = &bast_sio_data, 386 .platform_data = &bast_sio_data,
387 }, 387 },
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index ea4fb1a97a50..6ff1889fbd21 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -45,6 +45,9 @@
45 45
46//#include <asm/debug-ll.h> 46//#include <asm/debug-ll.h>
47#include <asm/arch/regs-serial.h> 47#include <asm/arch/regs-serial.h>
48#include <asm/arch/regs-lcd.h>
49
50#include <asm/arch/fb.h>
48 51
49#include <linux/serial_core.h> 52#include <linux/serial_core.h>
50 53
@@ -88,6 +91,48 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = {
88 91
89 92
90 93
94/**
95 * Set lcd on or off
96 **/
97static struct s3c2410fb_mach_info h1940_lcdcfg __initdata = {
98 .fixed_syncs= 1,
99 .regs={
100 .lcdcon1= S3C2410_LCDCON1_TFT16BPP | \
101 S3C2410_LCDCON1_TFT | \
102 S3C2410_LCDCON1_CLKVAL(0x0C),
103
104 .lcdcon2= S3C2410_LCDCON2_VBPD(7) | \
105 S3C2410_LCDCON2_LINEVAL(319) | \
106 S3C2410_LCDCON2_VFPD(6) | \
107 S3C2410_LCDCON2_VSPW(0),
108
109 .lcdcon3= S3C2410_LCDCON3_HBPD(19) | \
110 S3C2410_LCDCON3_HOZVAL(239) | \
111 S3C2410_LCDCON3_HFPD(7),
112
113 .lcdcon4= S3C2410_LCDCON4_MVAL(0) | \
114 S3C2410_LCDCON4_HSPW(3),
115
116 .lcdcon5= S3C2410_LCDCON5_FRM565 | \
117 S3C2410_LCDCON5_INVVLINE | \
118 S3C2410_LCDCON5_HWSWP,
119 },
120 .lpcsel= 0x02,
121 .gpccon= 0xaa940659,
122 .gpccon_mask= 0xffffffff,
123 .gpcup= 0x0000ffff,
124 .gpcup_mask= 0xffffffff,
125 .gpdcon= 0xaa84aaa0,
126 .gpdcon_mask= 0xffffffff,
127 .gpdup= 0x0000faff,
128 .gpdup_mask= 0xffffffff,
129
130 .width= 240,
131 .height= 320,
132 .xres= {240,240,240},
133 .yres= {320,320,320},
134 .bpp= {16,16,16},
135};
91 136
92static struct platform_device *h1940_devices[] __initdata = { 137static struct platform_device *h1940_devices[] __initdata = {
93 &s3c_device_usb, 138 &s3c_device_usb,
@@ -116,6 +161,11 @@ void __init h1940_init_irq(void)
116 161
117} 162}
118 163
164void __init h1940_init(void)
165{
166 set_s3c2410fb_info(&h1940_lcdcfg);
167}
168
119MACHINE_START(H1940, "IPAQ-H1940") 169MACHINE_START(H1940, "IPAQ-H1940")
120 /* Maintainer: Ben Dooks <ben@fluff.org> */ 170 /* Maintainer: Ben Dooks <ben@fluff.org> */
121 .phys_ram = S3C2410_SDRAM_PA, 171 .phys_ram = S3C2410_SDRAM_PA,
@@ -124,5 +174,6 @@ MACHINE_START(H1940, "IPAQ-H1940")
124 .boot_params = S3C2410_SDRAM_PA + 0x100, 174 .boot_params = S3C2410_SDRAM_PA + 0x100,
125 .map_io = h1940_map_io, 175 .map_io = h1940_map_io,
126 .init_irq = h1940_init_irq, 176 .init_irq = h1940_init_irq,
177 .init_machine = h1940_init,
127 .timer = &s3c24xx_timer, 178 .timer = &s3c24xx_timer,
128MACHINE_END 179MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 924e8464c212..8f9ab2893df4 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -221,7 +221,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
221 221
222static struct platform_device serial_device = { 222static struct platform_device serial_device = {
223 .name = "serial8250", 223 .name = "serial8250",
224 .id = 0, 224 .id = PLAT8250_DEV_PLATFORM,
225 .dev = { 225 .dev = {
226 .platform_data = serial_platform_data, 226 .platform_data = serial_platform_data,
227 }, 227 },
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index e737eae4521f..946c0d11c73b 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -41,7 +41,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
41 41
42static struct platform_device serial_device = { 42static struct platform_device serial_device = {
43 .name = "serial8250", 43 .name = "serial8250",
44 .id = 0, 44 .id = PLAT8250_DEV_PLATFORM,
45 .dev = { 45 .dev = {
46 .platform_data = serial_platform_data, 46 .platform_data = serial_platform_data,
47 }, 47 },
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 191788fb18d1..b0208c992576 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -16,6 +16,58 @@
16#include <asm/tlbflush.h> 16#include <asm/tlbflush.h>
17 17
18#ifdef CONFIG_CPU_CACHE_VIPT 18#ifdef CONFIG_CPU_CACHE_VIPT
19
20void flush_cache_mm(struct mm_struct *mm)
21{
22 if (cache_is_vivt()) {
23 if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask))
24 __cpuc_flush_user_all();
25 return;
26 }
27
28 if (cache_is_vipt_aliasing()) {
29 asm( "mcr p15, 0, %0, c7, c14, 0\n"
30 " mcr p15, 0, %0, c7, c5, 0\n"
31 " mcr p15, 0, %0, c7, c10, 4"
32 :
33 : "r" (0)
34 : "cc");
35 }
36}
37
38void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
39{
40 if (cache_is_vivt()) {
41 if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask))
42 __cpuc_flush_user_range(start & PAGE_MASK, PAGE_ALIGN(end),
43 vma->vm_flags);
44 return;
45 }
46
47 if (cache_is_vipt_aliasing()) {
48 asm( "mcr p15, 0, %0, c7, c14, 0\n"
49 " mcr p15, 0, %0, c7, c5, 0\n"
50 " mcr p15, 0, %0, c7, c10, 4"
51 :
52 : "r" (0)
53 : "cc");
54 }
55}
56
57void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn)
58{
59 if (cache_is_vivt()) {
60 if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
61 unsigned long addr = user_addr & PAGE_MASK;
62 __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags);
63 }
64 return;
65 }
66
67 if (cache_is_vipt_aliasing())
68 flush_pfn_alias(pfn, user_addr);
69}
70
19#define ALIAS_FLUSH_START 0xffff4000 71#define ALIAS_FLUSH_START 0xffff4000
20 72
21#define TOP_PTE(x) pte_offset_kernel(top_pmd, x) 73#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
diff --git a/arch/i386/boot/video.S b/arch/i386/boot/video.S
index 0587477c99f2..92f669470142 100644
--- a/arch/i386/boot/video.S
+++ b/arch/i386/boot/video.S
@@ -97,6 +97,7 @@
97#define PARAM_VESAPM_OFF 0x30 97#define PARAM_VESAPM_OFF 0x30
98#define PARAM_LFB_PAGES 0x32 98#define PARAM_LFB_PAGES 0x32
99#define PARAM_VESA_ATTRIB 0x34 99#define PARAM_VESA_ATTRIB 0x34
100#define PARAM_CAPABILITIES 0x36
100 101
101/* Define DO_STORE according to CONFIG_VIDEO_RETAIN */ 102/* Define DO_STORE according to CONFIG_VIDEO_RETAIN */
102#ifdef CONFIG_VIDEO_RETAIN 103#ifdef CONFIG_VIDEO_RETAIN
@@ -233,6 +234,10 @@ mopar_gr:
233 movw 18(%di), %ax 234 movw 18(%di), %ax
234 movl %eax, %fs:(PARAM_LFB_SIZE) 235 movl %eax, %fs:(PARAM_LFB_SIZE)
235 236
237# store mode capabilities
238 movl 10(%di), %eax
239 movl %eax, %fs:(PARAM_CAPABILITIES)
240
236# switching the DAC to 8-bit is for <= 8 bpp only 241# switching the DAC to 8-bit is for <= 8 bpp only
237 movw %fs:(PARAM_LFB_DEPTH), %ax 242 movw %fs:(PARAM_LFB_DEPTH), %ax
238 cmpw $8, %ax 243 cmpw $8, %ax
@@ -1944,7 +1949,7 @@ store_edid:
1944 movw $0x4f15, %ax # do VBE/DDC 1949 movw $0x4f15, %ax # do VBE/DDC
1945 movw $0x01, %bx 1950 movw $0x01, %bx
1946 movw $0x00, %cx 1951 movw $0x00, %cx
1947 movw $0x01, %dx 1952 movw $0x00, %dx
1948 movw $0x140, %di 1953 movw $0x140, %di
1949 int $0x10 1954 int $0x10
1950 1955
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
index bf02b5026e62..8ef38544453c 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -467,11 +467,11 @@ static void __init longhaul_setup_voltagescaling(void)
467 } 467 }
468 468
469 if (vrmrev==0) { 469 if (vrmrev==0) {
470 dprintk ("VRM 8.5 \n"); 470 dprintk ("VRM 8.5\n");
471 memcpy (voltage_table, vrm85scales, sizeof(voltage_table)); 471 memcpy (voltage_table, vrm85scales, sizeof(voltage_table));
472 numvscales = (voltage_table[maxvid]-voltage_table[minvid])/25; 472 numvscales = (voltage_table[maxvid]-voltage_table[minvid])/25;
473 } else { 473 } else {
474 dprintk ("Mobile VRM \n"); 474 dprintk ("Mobile VRM\n");
475 memcpy (voltage_table, mobilevrmscales, sizeof(voltage_table)); 475 memcpy (voltage_table, mobilevrmscales, sizeof(voltage_table));
476 numvscales = (voltage_table[maxvid]-voltage_table[minvid])/5; 476 numvscales = (voltage_table[maxvid]-voltage_table[minvid])/5;
477 } 477 }
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index 327a55d4d1c6..c397b6220430 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -259,7 +259,7 @@ static int centrino_cpu_init_table(struct cpufreq_policy *policy)
259 259
260 if (model->op_points == NULL) { 260 if (model->op_points == NULL) {
261 /* Matched a non-match */ 261 /* Matched a non-match */
262 dprintk(KERN_INFO PFX "no table support for CPU model \"%s\": \n", 262 dprintk(KERN_INFO PFX "no table support for CPU model \"%s\"\n",
263 cpu->x86_model_id); 263 cpu->x86_model_id);
264#ifndef CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI 264#ifndef CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI
265 dprintk(KERN_INFO PFX "try compiling with CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI enabled\n"); 265 dprintk(KERN_INFO PFX "try compiling with CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI enabled\n");
@@ -402,7 +402,7 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
402 402
403 for (i=0; i<p.state_count; i++) { 403 for (i=0; i<p.state_count; i++) {
404 if (p.states[i].control != p.states[i].status) { 404 if (p.states[i].control != p.states[i].status) {
405 dprintk("Different control (%x) and status values (%x)\n", 405 dprintk("Different control (%llu) and status values (%llu)\n",
406 p.states[i].control, p.states[i].status); 406 p.states[i].control, p.states[i].status);
407 result = -EINVAL; 407 result = -EINVAL;
408 goto err_unreg; 408 goto err_unreg;
@@ -415,7 +415,7 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
415 } 415 }
416 416
417 if (p.states[i].core_frequency > p.states[0].core_frequency) { 417 if (p.states[i].core_frequency > p.states[0].core_frequency) {
418 dprintk("P%u has larger frequency (%u) than P0 (%u), skipping\n", i, 418 dprintk("P%u has larger frequency (%llu) than P0 (%llu), skipping\n", i,
419 p.states[i].core_frequency, p.states[0].core_frequency); 419 p.states[i].core_frequency, p.states[0].core_frequency);
420 p.states[i].core_frequency = 0; 420 p.states[i].core_frequency = 0;
421 continue; 421 continue;
@@ -498,13 +498,6 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
498 if (cpu->x86_vendor != X86_VENDOR_INTEL || !cpu_has(cpu, X86_FEATURE_EST)) 498 if (cpu->x86_vendor != X86_VENDOR_INTEL || !cpu_has(cpu, X86_FEATURE_EST))
499 return -ENODEV; 499 return -ENODEV;
500 500
501 for (i = 0; i < N_IDS; i++)
502 if (centrino_verify_cpu_id(cpu, &cpu_ids[i]))
503 break;
504
505 if (i != N_IDS)
506 centrino_cpu[policy->cpu] = &cpu_ids[i];
507
508 if (is_const_loops_cpu(policy->cpu)) { 501 if (is_const_loops_cpu(policy->cpu)) {
509 centrino_driver.flags |= CPUFREQ_CONST_LOOPS; 502 centrino_driver.flags |= CPUFREQ_CONST_LOOPS;
510 } 503 }
@@ -513,6 +506,13 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
513 if (policy->cpu != 0) 506 if (policy->cpu != 0)
514 return -ENODEV; 507 return -ENODEV;
515 508
509 for (i = 0; i < N_IDS; i++)
510 if (centrino_verify_cpu_id(cpu, &cpu_ids[i]))
511 break;
512
513 if (i != N_IDS)
514 centrino_cpu[policy->cpu] = &cpu_ids[i];
515
516 if (!centrino_cpu[policy->cpu]) { 516 if (!centrino_cpu[policy->cpu]) {
517 dprintk(KERN_INFO PFX "found unsupported CPU with " 517 dprintk(KERN_INFO PFX "found unsupported CPU with "
518 "Enhanced SpeedStep: send /proc/cpuinfo to " 518 "Enhanced SpeedStep: send /proc/cpuinfo to "
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
index b25fb6b635ae..2718fb6f6aba 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
@@ -99,7 +99,7 @@ static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high)
99 u32 function = GET_SPEEDSTEP_FREQS; 99 u32 function = GET_SPEEDSTEP_FREQS;
100 100
101 if (!(ist_info.event & 0xFFFF)) { 101 if (!(ist_info.event & 0xFFFF)) {
102 dprintk("bug #1422 -- can't read freqs from BIOS\n", result); 102 dprintk("bug #1422 -- can't read freqs from BIOS\n");
103 return -ENODEV; 103 return -ENODEV;
104 } 104 }
105 105
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 889eda2d7b17..1efdc76ae96d 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -1634,9 +1634,9 @@ void disable_IO_APIC(void)
1634 clear_IO_APIC(); 1634 clear_IO_APIC();
1635 1635
1636 /* 1636 /*
1637 * If the i82559 is routed through an IOAPIC 1637 * If the i8259 is routed through an IOAPIC
1638 * Put that IOAPIC in virtual wire mode 1638 * Put that IOAPIC in virtual wire mode
1639 * so legacy interrups can be delivered. 1639 * so legacy interrupts can be delivered.
1640 */ 1640 */
1641 pin = find_isa_irq_pin(0, mp_ExtINT); 1641 pin = find_isa_irq_pin(0, mp_ExtINT);
1642 if (pin != -1) { 1642 if (pin != -1) {
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index cafaeffe3818..15949fd08109 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -122,8 +122,8 @@ static int MP_valid_apicid(int apicid, int version)
122 122
123static void __init MP_processor_info (struct mpc_config_processor *m) 123static void __init MP_processor_info (struct mpc_config_processor *m)
124{ 124{
125 int ver, apicid, cpu, found_bsp = 0; 125 int ver, apicid;
126 physid_mask_t tmp; 126 physid_mask_t phys_cpu;
127 127
128 if (!(m->mpc_cpuflag & CPU_ENABLED)) 128 if (!(m->mpc_cpuflag & CPU_ENABLED))
129 return; 129 return;
@@ -181,7 +181,6 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
181 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { 181 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
182 Dprintk(" Bootup CPU\n"); 182 Dprintk(" Bootup CPU\n");
183 boot_cpu_physical_apicid = m->mpc_apicid; 183 boot_cpu_physical_apicid = m->mpc_apicid;
184 found_bsp = 1;
185 } 184 }
186 185
187 if (num_processors >= NR_CPUS) { 186 if (num_processors >= NR_CPUS) {
@@ -195,29 +194,26 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
195 " Processor ignored.\n", maxcpus); 194 " Processor ignored.\n", maxcpus);
196 return; 195 return;
197 } 196 }
198 num_processors++;
199 ver = m->mpc_apicver; 197 ver = m->mpc_apicver;
200 198
201 if (!MP_valid_apicid(apicid, ver)) { 199 if (!MP_valid_apicid(apicid, ver)) {
202 printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n", 200 printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n",
203 m->mpc_apicid, MAX_APICS); 201 m->mpc_apicid, MAX_APICS);
204 --num_processors;
205 return; 202 return;
206 } 203 }
207 204
208 if (found_bsp) 205 cpu_set(num_processors, cpu_possible_map);
209 cpu = 0; 206 num_processors++;
210 else 207 phys_cpu = apicid_to_cpu_present(apicid);
211 cpu = num_processors - 1; 208 physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu);
212 cpu_set(cpu, cpu_possible_map); 209
213 tmp = apicid_to_cpu_present(apicid);
214 physids_or(phys_cpu_present_map, phys_cpu_present_map, tmp);
215
216 /* 210 /*
217 * Validate version 211 * Validate version
218 */ 212 */
219 if (ver == 0x0) { 213 if (ver == 0x0) {
220 printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! fixing up to 0x10. (tell your hw vendor)\n", m->mpc_apicid); 214 printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! "
215 "fixing up to 0x10. (tell your hw vendor)\n",
216 m->mpc_apicid);
221 ver = 0x10; 217 ver = 0x10;
222 } 218 }
223 apic_version[m->mpc_apicid] = ver; 219 apic_version[m->mpc_apicid] = ver;
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c
index 340980203b09..7b6368bf8974 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/i386/kernel/ptrace.c
@@ -694,17 +694,22 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code)
694__attribute__((regparm(3))) 694__attribute__((regparm(3)))
695int do_syscall_trace(struct pt_regs *regs, int entryexit) 695int do_syscall_trace(struct pt_regs *regs, int entryexit)
696{ 696{
697 int is_sysemu = test_thread_flag(TIF_SYSCALL_EMU), ret = 0; 697 int is_sysemu = test_thread_flag(TIF_SYSCALL_EMU);
698 /* With TIF_SYSCALL_EMU set we want to ignore TIF_SINGLESTEP for syscall 698 /*
699 * interception. */ 699 * With TIF_SYSCALL_EMU set we want to ignore TIF_SINGLESTEP for syscall
700 * interception
701 */
700 int is_singlestep = !is_sysemu && test_thread_flag(TIF_SINGLESTEP); 702 int is_singlestep = !is_sysemu && test_thread_flag(TIF_SINGLESTEP);
703 int ret = 0;
701 704
702 /* do the secure computing check first */ 705 /* do the secure computing check first */
703 secure_computing(regs->orig_eax); 706 if (!entryexit)
707 secure_computing(regs->orig_eax);
704 708
705 if (unlikely(current->audit_context)) { 709 if (unlikely(current->audit_context)) {
706 if (entryexit) 710 if (entryexit)
707 audit_syscall_exit(current, AUDITSC_RESULT(regs->eax), regs->eax); 711 audit_syscall_exit(current, AUDITSC_RESULT(regs->eax),
712 regs->eax);
708 /* Debug traps, when using PTRACE_SINGLESTEP, must be sent only 713 /* Debug traps, when using PTRACE_SINGLESTEP, must be sent only
709 * on the syscall exit path. Normally, when TIF_SYSCALL_AUDIT is 714 * on the syscall exit path. Normally, when TIF_SYSCALL_AUDIT is
710 * not used, entry.S will call us only on syscall exit, not 715 * not used, entry.S will call us only on syscall exit, not
@@ -738,7 +743,7 @@ int do_syscall_trace(struct pt_regs *regs, int entryexit)
738 /* the 0x80 provides a way for the tracing parent to distinguish 743 /* the 0x80 provides a way for the tracing parent to distinguish
739 between a syscall stop and SIGTRAP delivery */ 744 between a syscall stop and SIGTRAP delivery */
740 /* Note that the debugger could change the result of test_thread_flag!*/ 745 /* Note that the debugger could change the result of test_thread_flag!*/
741 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) ? 0x80 : 0)); 746 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) ? 0x80:0));
742 747
743 /* 748 /*
744 * this isn't the same as continuing with a signal, but it will do 749 * this isn't the same as continuing with a signal, but it will do
@@ -750,7 +755,7 @@ int do_syscall_trace(struct pt_regs *regs, int entryexit)
750 current->exit_code = 0; 755 current->exit_code = 0;
751 } 756 }
752 ret = is_sysemu; 757 ret = is_sysemu;
753 out: 758out:
754 if (unlikely(current->audit_context) && !entryexit) 759 if (unlikely(current->audit_context) && !entryexit)
755 audit_syscall_entry(current, AUDIT_ARCH_I386, regs->orig_eax, 760 audit_syscall_entry(current, AUDIT_ARCH_I386, regs->orig_eax,
756 regs->ebx, regs->ecx, regs->edx, regs->esi); 761 regs->ebx, regs->ecx, regs->edx, regs->esi);
@@ -759,6 +764,7 @@ int do_syscall_trace(struct pt_regs *regs, int entryexit)
759 764
760 regs->orig_eax = -1; /* force skip of syscall restarting */ 765 regs->orig_eax = -1; /* force skip of syscall restarting */
761 if (unlikely(current->audit_context)) 766 if (unlikely(current->audit_context))
762 audit_syscall_exit(current, AUDITSC_RESULT(regs->eax), regs->eax); 767 audit_syscall_exit(current, AUDITSC_RESULT(regs->eax),
768 regs->eax);
763 return 1; 769 return 1;
764} 770}
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index a659d274914c..f3d808451d25 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -139,6 +139,7 @@ struct sys_desc_table_struct {
139 unsigned char table[0]; 139 unsigned char table[0];
140}; 140};
141struct edid_info edid_info; 141struct edid_info edid_info;
142EXPORT_SYMBOL_GPL(edid_info);
142struct ist_info ist_info; 143struct ist_info ist_info;
143#if defined(CONFIG_X86_SPEEDSTEP_SMI) || \ 144#if defined(CONFIG_X86_SPEEDSTEP_SMI) || \
144 defined(CONFIG_X86_SPEEDSTEP_SMI_MODULE) 145 defined(CONFIG_X86_SPEEDSTEP_SMI_MODULE)
@@ -1299,7 +1300,7 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat
1299 */ 1300 */
1300static void __init register_memory(void) 1301static void __init register_memory(void)
1301{ 1302{
1302 unsigned long gapstart, gapsize; 1303 unsigned long gapstart, gapsize, round;
1303 unsigned long long last; 1304 unsigned long long last;
1304 int i; 1305 int i;
1305 1306
@@ -1344,14 +1345,14 @@ static void __init register_memory(void)
1344 } 1345 }
1345 1346
1346 /* 1347 /*
1347 * Start allocating dynamic PCI memory a bit into the gap, 1348 * See how much we want to round up: start off with
1348 * aligned up to the nearest megabyte. 1349 * rounding to the next 1MB area.
1349 *
1350 * Question: should we try to pad it up a bit (do something
1351 * like " + (gapsize >> 3)" in there too?). We now have the
1352 * technology.
1353 */ 1350 */
1354 pci_mem_start = (gapstart + 0xfffff) & ~0xfffff; 1351 round = 0x100000;
1352 while ((gapsize >> 4) > round)
1353 round += round;
1354 /* Fun with two's complement */
1355 pci_mem_start = (gapstart + round) & -round;
1355 1356
1356 printk("Allocating PCI resources starting at %08lx (gap: %08lx:%08lx)\n", 1357 printk("Allocating PCI resources starting at %08lx (gap: %08lx:%08lx)\n",
1357 pci_mem_start, gapstart, gapsize); 1358 pci_mem_start, gapstart, gapsize);
diff --git a/arch/i386/kernel/sigframe.h b/arch/i386/kernel/sigframe.h
index d21b14f5c25c..0b2221711dad 100644
--- a/arch/i386/kernel/sigframe.h
+++ b/arch/i386/kernel/sigframe.h
@@ -1,6 +1,6 @@
1struct sigframe 1struct sigframe
2{ 2{
3 char *pretcode; 3 char __user *pretcode;
4 int sig; 4 int sig;
5 struct sigcontext sc; 5 struct sigcontext sc;
6 struct _fpstate fpstate; 6 struct _fpstate fpstate;
@@ -10,10 +10,10 @@ struct sigframe
10 10
11struct rt_sigframe 11struct rt_sigframe
12{ 12{
13 char *pretcode; 13 char __user *pretcode;
14 int sig; 14 int sig;
15 struct siginfo *pinfo; 15 struct siginfo __user *pinfo;
16 void *puc; 16 void __user *puc;
17 struct siginfo info; 17 struct siginfo info;
18 struct ucontext uc; 18 struct ucontext uc;
19 struct _fpstate fpstate; 19 struct _fpstate fpstate;
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
index eefea7c55008..2883a4d4f01f 100644
--- a/arch/i386/kernel/time.c
+++ b/arch/i386/kernel/time.c
@@ -329,8 +329,7 @@ EXPORT_SYMBOL(get_cmos_time);
329 329
330static void sync_cmos_clock(unsigned long dummy); 330static void sync_cmos_clock(unsigned long dummy);
331 331
332static struct timer_list sync_cmos_timer = 332static DEFINE_TIMER(sync_cmos_timer, sync_cmos_clock, 0, 0);
333 TIMER_INITIALIZER(sync_cmos_clock, 0, 0);
334 333
335static void sync_cmos_clock(unsigned long dummy) 334static void sync_cmos_clock(unsigned long dummy)
336{ 335{
diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c
index 3cc480998a47..6d6338500c3c 100644
--- a/arch/i386/pci/i386.c
+++ b/arch/i386/pci/i386.c
@@ -283,9 +283,9 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
283 /* Write-combine setting is ignored, it is changed via the mtrr 283 /* Write-combine setting is ignored, it is changed via the mtrr
284 * interfaces on this platform. 284 * interfaces on this platform.
285 */ 285 */
286 if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, 286 if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
287 vma->vm_end - vma->vm_start, 287 vma->vm_end - vma->vm_start,
288 vma->vm_page_prot)) 288 vma->vm_page_prot))
289 return -EAGAIN; 289 return -EAGAIN;
290 290
291 return 0; 291 return 0;
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 00151a8320d8..ed25d66c8d50 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -339,12 +339,6 @@ config IA64_PALINFO
339 To use this option, you have to ensure that the "/proc file system 339 To use this option, you have to ensure that the "/proc file system
340 support" (CONFIG_PROC_FS) is enabled, too. 340 support" (CONFIG_PROC_FS) is enabled, too.
341 341
342config ACPI_DEALLOCATE_IRQ
343 bool
344 depends on ACPI
345 depends on IOSAPIC && EXPERIMENTAL
346 default y
347
348source "drivers/firmware/Kconfig" 342source "drivers/firmware/Kconfig"
349 343
350source "fs/Kconfig.binfmt" 344source "fs/Kconfig.binfmt"
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index 1ca6e6e11b42..08112ab38468 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -111,7 +111,6 @@ CONFIG_COMPAT=y
111CONFIG_IA64_MCA_RECOVERY=y 111CONFIG_IA64_MCA_RECOVERY=y
112CONFIG_PERFMON=y 112CONFIG_PERFMON=y
113CONFIG_IA64_PALINFO=y 113CONFIG_IA64_PALINFO=y
114CONFIG_ACPI_DEALLOCATE_IRQ=y
115 114
116# 115#
117# Firmware Drivers 116# Firmware Drivers
diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig
index 3ec94a12eac0..d452e18ac494 100644
--- a/arch/ia64/configs/tiger_defconfig
+++ b/arch/ia64/configs/tiger_defconfig
@@ -109,7 +109,6 @@ CONFIG_COMPAT=y
109CONFIG_IA64_MCA_RECOVERY=y 109CONFIG_IA64_MCA_RECOVERY=y
110CONFIG_PERFMON=y 110CONFIG_PERFMON=y
111CONFIG_IA64_PALINFO=y 111CONFIG_IA64_PALINFO=y
112CONFIG_ACPI_DEALLOCATE_IRQ=y
113 112
114# 113#
115# Firmware Drivers 114# Firmware Drivers
diff --git a/arch/ia64/configs/zx1_defconfig b/arch/ia64/configs/zx1_defconfig
index d4cf73d124bc..80b0e9eb7fb3 100644
--- a/arch/ia64/configs/zx1_defconfig
+++ b/arch/ia64/configs/zx1_defconfig
@@ -109,7 +109,6 @@ CONFIG_COMPAT=y
109CONFIG_IA64_MCA_RECOVERY=y 109CONFIG_IA64_MCA_RECOVERY=y
110CONFIG_PERFMON=y 110CONFIG_PERFMON=y
111CONFIG_IA64_PALINFO=y 111CONFIG_IA64_PALINFO=y
112CONFIG_ACPI_DEALLOCATE_IRQ=y
113 112
114# 113#
115# Firmware Drivers 114# Firmware Drivers
diff --git a/arch/ia64/defconfig b/arch/ia64/defconfig
index b6ec8d32c346..5da208115ea1 100644
--- a/arch/ia64/defconfig
+++ b/arch/ia64/defconfig
@@ -99,7 +99,6 @@ CONFIG_COMPAT=y
99CONFIG_IA64_MCA_RECOVERY=y 99CONFIG_IA64_MCA_RECOVERY=y
100CONFIG_PERFMON=y 100CONFIG_PERFMON=y
101CONFIG_IA64_PALINFO=y 101CONFIG_IA64_PALINFO=y
102CONFIG_ACPI_DEALLOCATE_IRQ=y
103 102
104# 103#
105# Firmware Drivers 104# Firmware Drivers
@@ -335,7 +334,7 @@ CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
335CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 334CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
336# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 335# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
337# CONFIG_SCSI_IPR is not set 336# CONFIG_SCSI_IPR is not set
338CONFIG_SCSI_QLOGIC_FC=y 337# CONFIG_SCSI_QLOGIC_FC is not set
339# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set 338# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set
340CONFIG_SCSI_QLOGIC_1280=y 339CONFIG_SCSI_QLOGIC_1280=y
341# CONFIG_SCSI_QLOGIC_1280_1040 is not set 340# CONFIG_SCSI_QLOGIC_1280_1040 is not set
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 318787c84ac0..28a4529fdd60 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -583,14 +583,12 @@ int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
583 583
584EXPORT_SYMBOL(acpi_register_gsi); 584EXPORT_SYMBOL(acpi_register_gsi);
585 585
586#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
587void acpi_unregister_gsi(u32 gsi) 586void acpi_unregister_gsi(u32 gsi)
588{ 587{
589 iosapic_unregister_intr(gsi); 588 iosapic_unregister_intr(gsi);
590} 589}
591 590
592EXPORT_SYMBOL(acpi_unregister_gsi); 591EXPORT_SYMBOL(acpi_unregister_gsi);
593#endif /* CONFIG_ACPI_DEALLOCATE_IRQ */
594 592
595static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size) 593static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size)
596{ 594{
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 6d70fec82d0e..ba0b6a1f429f 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -204,9 +204,6 @@ GLOBAL_ENTRY(ia64_switch_to)
204(p6) br.cond.dpnt .map 204(p6) br.cond.dpnt .map
205 ;; 205 ;;
206.done: 206.done:
207(p6) ssm psr.ic // if we had to map, reenable the psr.ic bit FIRST!!!
208 ;;
209(p6) srlz.d
210 ld8 sp=[r21] // load kernel stack pointer of new task 207 ld8 sp=[r21] // load kernel stack pointer of new task
211 mov IA64_KR(CURRENT)=in0 // update "current" application register 208 mov IA64_KR(CURRENT)=in0 // update "current" application register
212 mov r8=r13 // return pointer to previously running task 209 mov r8=r13 // return pointer to previously running task
@@ -234,6 +231,9 @@ GLOBAL_ENTRY(ia64_switch_to)
234 mov IA64_KR(CURRENT_STACK)=r26 // remember last page we mapped... 231 mov IA64_KR(CURRENT_STACK)=r26 // remember last page we mapped...
235 ;; 232 ;;
236 itr.d dtr[r25]=r23 // wire in new mapping... 233 itr.d dtr[r25]=r23 // wire in new mapping...
234 ssm psr.ic // reenable the psr.ic bit
235 ;;
236 srlz.d
237 br.cond.sptk .done 237 br.cond.sptk .done
238END(ia64_switch_to) 238END(ia64_switch_to)
239 239
@@ -470,6 +470,29 @@ ENTRY(load_switch_stack)
470 br.cond.sptk.many b7 470 br.cond.sptk.many b7
471END(load_switch_stack) 471END(load_switch_stack)
472 472
473GLOBAL_ENTRY(prefetch_stack)
474 add r14 = -IA64_SWITCH_STACK_SIZE, sp
475 add r15 = IA64_TASK_THREAD_KSP_OFFSET, in0
476 ;;
477 ld8 r16 = [r15] // load next's stack pointer
478 lfetch.fault.excl [r14], 128
479 ;;
480 lfetch.fault.excl [r14], 128
481 lfetch.fault [r16], 128
482 ;;
483 lfetch.fault.excl [r14], 128
484 lfetch.fault [r16], 128
485 ;;
486 lfetch.fault.excl [r14], 128
487 lfetch.fault [r16], 128
488 ;;
489 lfetch.fault.excl [r14], 128
490 lfetch.fault [r16], 128
491 ;;
492 lfetch.fault [r16], 128
493 br.ret.sptk.many rp
494END(prefetch_switch_stack)
495
473GLOBAL_ENTRY(execve) 496GLOBAL_ENTRY(execve)
474 mov r15=__NR_execve // put syscall number in place 497 mov r15=__NR_execve // put syscall number in place
475 break __BREAK_SYSCALL 498 break __BREAK_SYSCALL
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index a13df592ebf7..574084f343fa 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -782,7 +782,6 @@ again:
782 return vector; 782 return vector;
783} 783}
784 784
785#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
786void 785void
787iosapic_unregister_intr (unsigned int gsi) 786iosapic_unregister_intr (unsigned int gsi)
788{ 787{
@@ -865,7 +864,6 @@ iosapic_unregister_intr (unsigned int gsi)
865 spin_unlock(&iosapic_lock); 864 spin_unlock(&iosapic_lock);
866 spin_unlock_irqrestore(&idesc->lock, flags); 865 spin_unlock_irqrestore(&idesc->lock, flags);
867} 866}
868#endif /* CONFIG_ACPI_DEALLOCATE_IRQ */
869 867
870/* 868/*
871 * ACPI calls this when it finds an entry for a platform interrupt. 869 * ACPI calls this when it finds an entry for a platform interrupt.
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index f1201ac8a116..1650353e3f77 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -38,6 +38,7 @@
38#include <linux/pagemap.h> 38#include <linux/pagemap.h>
39#include <linux/mount.h> 39#include <linux/mount.h>
40#include <linux/bitops.h> 40#include <linux/bitops.h>
41#include <linux/rcupdate.h>
41 42
42#include <asm/errno.h> 43#include <asm/errno.h>
43#include <asm/intrinsics.h> 44#include <asm/intrinsics.h>
@@ -496,7 +497,7 @@ typedef struct {
496static pfm_stats_t pfm_stats[NR_CPUS]; 497static pfm_stats_t pfm_stats[NR_CPUS];
497static pfm_session_t pfm_sessions; /* global sessions information */ 498static pfm_session_t pfm_sessions; /* global sessions information */
498 499
499static spinlock_t pfm_alt_install_check = SPIN_LOCK_UNLOCKED; 500static DEFINE_SPINLOCK(pfm_alt_install_check);
500static pfm_intr_handler_desc_t *pfm_alt_intr_handler; 501static pfm_intr_handler_desc_t *pfm_alt_intr_handler;
501 502
502static struct proc_dir_entry *perfmon_dir; 503static struct proc_dir_entry *perfmon_dir;
@@ -2217,15 +2218,17 @@ static void
2217pfm_free_fd(int fd, struct file *file) 2218pfm_free_fd(int fd, struct file *file)
2218{ 2219{
2219 struct files_struct *files = current->files; 2220 struct files_struct *files = current->files;
2221 struct fdtable *fdt = files_fdtable(files);
2220 2222
2221 /* 2223 /*
2222 * there ie no fd_uninstall(), so we do it here 2224 * there ie no fd_uninstall(), so we do it here
2223 */ 2225 */
2224 spin_lock(&files->file_lock); 2226 spin_lock(&files->file_lock);
2225 files->fd[fd] = NULL; 2227 rcu_assign_pointer(fdt->fd[fd], NULL);
2226 spin_unlock(&files->file_lock); 2228 spin_unlock(&files->file_lock);
2227 2229
2228 if (file) put_filp(file); 2230 if (file)
2231 put_filp(file);
2229 put_unused_fd(fd); 2232 put_unused_fd(fd);
2230} 2233}
2231 2234
diff --git a/arch/ia64/lib/memcpy_mck.S b/arch/ia64/lib/memcpy_mck.S
index 6f308e62c137..46c9331e7ab5 100644
--- a/arch/ia64/lib/memcpy_mck.S
+++ b/arch/ia64/lib/memcpy_mck.S
@@ -625,8 +625,11 @@ EK(.ex_handler, (p17) st8 [dst1]=r39,8); \
625 clrrrb 625 clrrrb
626 ;; 626 ;;
627 alloc saved_pfs_stack=ar.pfs,3,3,3,0 627 alloc saved_pfs_stack=ar.pfs,3,3,3,0
628 cmp.lt p8,p0=A,r0
628 sub B = dst0, saved_in0 // how many byte copied so far 629 sub B = dst0, saved_in0 // how many byte copied so far
629 ;; 630 ;;
631(p8) mov A = 0; // A shouldn't be negative, cap it
632 ;;
630 sub C = A, B 633 sub C = A, B
631 sub D = saved_in2, A 634 sub D = saved_in2, A
632 ;; 635 ;;
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c
index 24614869e866..3c32af910d60 100644
--- a/arch/ia64/mm/fault.c
+++ b/arch/ia64/mm/fault.c
@@ -230,9 +230,6 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
230 return; 230 return;
231 } 231 }
232 232
233 if (ia64_done_with_exception(regs))
234 return;
235
236 /* 233 /*
237 * Since we have no vma's for region 5, we might get here even if the address is 234 * Since we have no vma's for region 5, we might get here even if the address is
238 * valid, due to the VHPT walker inserting a non present translation that becomes 235 * valid, due to the VHPT walker inserting a non present translation that becomes
@@ -243,6 +240,9 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
243 if (REGION_NUMBER(address) == 5 && mapped_kernel_page_is_present(address)) 240 if (REGION_NUMBER(address) == 5 && mapped_kernel_page_is_present(address))
244 return; 241 return;
245 242
243 if (ia64_done_with_exception(regs))
244 return;
245
246 /* 246 /*
247 * Oops. The kernel tried to access some bad page. We'll have to terminate things 247 * Oops. The kernel tried to access some bad page. We'll have to terminate things
248 * with extreme prejudice. 248 * with extreme prejudice.
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 9977c122e9fa..9b5de589b82f 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -498,13 +498,11 @@ pcibios_enable_device (struct pci_dev *dev, int mask)
498 return acpi_pci_irq_enable(dev); 498 return acpi_pci_irq_enable(dev);
499} 499}
500 500
501#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
502void 501void
503pcibios_disable_device (struct pci_dev *dev) 502pcibios_disable_device (struct pci_dev *dev)
504{ 503{
505 acpi_pci_irq_disable(dev); 504 acpi_pci_irq_disable(dev);
506} 505}
507#endif /* CONFIG_ACPI_DEALLOCATE_IRQ */
508 506
509void 507void
510pcibios_align_resource (void *data, struct resource *res, 508pcibios_align_resource (void *data, struct resource *res,
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index a594aca959e6..14908ad7db8c 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -56,7 +56,7 @@
56 56
57DEFINE_PER_CPU(struct pda_s, pda_percpu); 57DEFINE_PER_CPU(struct pda_s, pda_percpu);
58 58
59#define MAX_PHYS_MEMORY (1UL << 49) /* 1 TB */ 59#define MAX_PHYS_MEMORY (1UL << IA64_MAX_PHYS_BITS) /* Max physical address supported */
60 60
61lboard_t *root_lboard[MAX_COMPACT_NODES]; 61lboard_t *root_lboard[MAX_COMPACT_NODES];
62 62
diff --git a/arch/ia64/sn/kernel/xpc_main.c b/arch/ia64/sn/kernel/xpc_main.c
index bb1d5cf30440..ed7c21586e98 100644
--- a/arch/ia64/sn/kernel/xpc_main.c
+++ b/arch/ia64/sn/kernel/xpc_main.c
@@ -885,6 +885,10 @@ xpc_init(void)
885 pid_t pid; 885 pid_t pid;
886 886
887 887
888 if (!ia64_platform_is("sn2")) {
889 return -ENODEV;
890 }
891
888 /* 892 /*
889 * xpc_remote_copy_buffer is used as a temporary buffer for bte_copy'ng 893 * xpc_remote_copy_buffer is used as a temporary buffer for bte_copy'ng
890 * both a partition's reserved page and its XPC variables. Its size was 894 * both a partition's reserved page and its XPC variables. Its size was
diff --git a/arch/ia64/sn/kernel/xpnet.c b/arch/ia64/sn/kernel/xpnet.c
index 78c13d676fa6..e5c6d3c0a8e9 100644
--- a/arch/ia64/sn/kernel/xpnet.c
+++ b/arch/ia64/sn/kernel/xpnet.c
@@ -130,7 +130,7 @@ struct net_device *xpnet_device;
130 */ 130 */
131static u64 xpnet_broadcast_partitions; 131static u64 xpnet_broadcast_partitions;
132/* protect above */ 132/* protect above */
133static spinlock_t xpnet_broadcast_lock = SPIN_LOCK_UNLOCKED; 133static DEFINE_SPINLOCK(xpnet_broadcast_lock);
134 134
135/* 135/*
136 * Since the Block Transfer Engine (BTE) is being used for the transfer 136 * Since the Block Transfer Engine (BTE) is being used for the transfer
@@ -636,6 +636,10 @@ xpnet_init(void)
636 int result = -ENOMEM; 636 int result = -ENOMEM;
637 637
638 638
639 if (!ia64_platform_is("sn2")) {
640 return -ENODEV;
641 }
642
639 dev_info(xpnet, "registering network device %s\n", XPNET_DEVICE_NAME); 643 dev_info(xpnet, "registering network device %s\n", XPNET_DEVICE_NAME);
640 644
641 /* 645 /*
diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c
index cb5d93630467..bd5d134e9f12 100644
--- a/arch/m68k/amiga/amisound.c
+++ b/arch/m68k/amiga/amisound.c
@@ -63,7 +63,7 @@ void __init amiga_init_sound(void)
63} 63}
64 64
65static void nosound( unsigned long ignored ); 65static void nosound( unsigned long ignored );
66static struct timer_list sound_timer = TIMER_INITIALIZER(nosound, 0, 0); 66static DEFINE_TIMER(sound_timer, nosound, 0, 0);
67 67
68void amiga_mksound( unsigned int hz, unsigned int ticks ) 68void amiga_mksound( unsigned int hz, unsigned int ticks )
69{ 69{
diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c
index 44c5cd2ad6a8..8f0640847ad2 100644
--- a/arch/m68k/mac/macboing.c
+++ b/arch/m68k/mac/macboing.c
@@ -56,8 +56,7 @@ static void ( *mac_special_bell )( unsigned int, unsigned int, unsigned int );
56/* 56/*
57 * our timer to start/continue/stop the bell 57 * our timer to start/continue/stop the bell
58 */ 58 */
59static struct timer_list mac_sound_timer = 59static DEFINE_TIMER(mac_sound_timer, mac_nosound, 0, 0);
60 TIMER_INITIALIZER(mac_nosound, 0, 0);
61 60
62/* 61/*
63 * Sort of initialize the sound chip (called from mac_mksound on the first 62 * Sort of initialize the sound chip (called from mac_mksound on the first
diff --git a/arch/m68knommu/platform/523x/Makefile b/arch/m68knommu/platform/523x/Makefile
new file mode 100644
index 000000000000..c1578b016160
--- /dev/null
+++ b/arch/m68knommu/platform/523x/Makefile
@@ -0,0 +1,19 @@
1#
2# Makefile for the m68knommu linux kernel.
3#
4
5#
6# If you want to play with the HW breakpoints then you will
7# need to add define this, which will give you a stack backtrace
8# on the console port whenever a DBG interrupt occurs. You have to
9# set up you HW breakpoints to trigger a DBG interrupt:
10#
11# EXTRA_CFLAGS += -DTRAP_DBG_INTERRUPT
12# EXTRA_AFLAGS += -DTRAP_DBG_INTERRUPT
13#
14
15ifdef CONFIG_FULLDEBUG
16AFLAGS += -DDEBUGGER_COMPATIBLE_CACHE=1
17endif
18
19obj-y := config.o
diff --git a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c
index 5cb28690f89a..cf36e7d007b9 100644
--- a/arch/m68knommu/platform/5272/config.c
+++ b/arch/m68knommu/platform/5272/config.c
@@ -104,11 +104,11 @@ int mcf_timerirqpending(int timer)
104 104
105void config_BSP(char *commandp, int size) 105void config_BSP(char *commandp, int size)
106{ 106{
107#if 0 107#if defined (CONFIG_MOD5272)
108 volatile unsigned long *pivrp; 108 volatile unsigned char *pivrp;
109 109
110 /* Set base of device vectors to be 64 */ 110 /* Set base of device vectors to be 64 */
111 pivrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_PIVR); 111 pivrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_PIVR);
112 *pivrp = 0x40; 112 *pivrp = 0x40;
113#endif 113#endif
114 114
diff --git a/arch/m68knommu/platform/5307/Makefile b/arch/m68knommu/platform/5307/Makefile
index 84b6b70641e1..6fe5a2b8fb08 100644
--- a/arch/m68knommu/platform/5307/Makefile
+++ b/arch/m68knommu/platform/5307/Makefile
@@ -19,6 +19,7 @@ endif
19obj-$(CONFIG_COLDFIRE) += entry.o vectors.o ints.o 19obj-$(CONFIG_COLDFIRE) += entry.o vectors.o ints.o
20obj-$(CONFIG_M5206) += timers.o 20obj-$(CONFIG_M5206) += timers.o
21obj-$(CONFIG_M5206e) += timers.o 21obj-$(CONFIG_M5206e) += timers.o
22obj-$(CONFIG_M523x) += pit.o
22obj-$(CONFIG_M5249) += timers.o 23obj-$(CONFIG_M5249) += timers.o
23obj-$(CONFIG_M527x) += pit.o 24obj-$(CONFIG_M527x) += pit.o
24obj-$(CONFIG_M5272) += timers.o 25obj-$(CONFIG_M5272) += timers.o
diff --git a/arch/m68knommu/platform/68328/config.c b/arch/m68knommu/platform/68328/config.c
index fd7c93f86481..bcfa5d7fe1e2 100644
--- a/arch/m68knommu/platform/68328/config.c
+++ b/arch/m68knommu/platform/68328/config.c
@@ -1,5 +1,7 @@
1/***************************************************************************/
2
1/* 3/*
2 * linux/arch/$(ARCH)/platform/$(PLATFORM)/config.c 4 * linux/arch/m68knommu/platform/68328/config.c
3 * 5 *
4 * Copyright (C) 1993 Hamish Macdonald 6 * Copyright (C) 1993 Hamish Macdonald
5 * Copyright (C) 1999 D. Jeff Dionne 7 * Copyright (C) 1999 D. Jeff Dionne
@@ -11,6 +13,8 @@
11 * VZ Support/Fixes Evan Stawnyczy <e@lineo.ca> 13 * VZ Support/Fixes Evan Stawnyczy <e@lineo.ca>
12 */ 14 */
13 15
16/***************************************************************************/
17
14#include <asm/dbg.h> 18#include <asm/dbg.h>
15#include <stdarg.h> 19#include <stdarg.h>
16#include <linux/config.h> 20#include <linux/config.h>
@@ -29,76 +33,16 @@
29#include <asm/machdep.h> 33#include <asm/machdep.h>
30#include <asm/MC68328.h> 34#include <asm/MC68328.h>
31 35
36/***************************************************************************/
32 37
33void BSP_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)) 38void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *));
34{ 39void m68328_timer_tick(void);
35 40unsigned long m68328_timer_gettimeoffset(void);
36#ifdef CONFIG_XCOPILOT_BUGS 41void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec);
37 /*
38 * The only thing I know is that CLK32 is not available on Xcopilot
39 * I have little idea about what frequency SYSCLK has on Xcopilot.
40 * The values for prescaler and compare registers were simply
41 * taken from the original source
42 */
43
44 /* Restart mode, Enable int, SYSCLK, Enable timer */
45 TCTL2 = TCTL_OM | TCTL_IRQEN | TCTL_CLKSOURCE_SYSCLK | TCTL_TEN;
46 /* Set prescaler */
47 TPRER2 = 2;
48 /* Set compare register */
49 TCMP2 = 0xd7e4;
50#else
51 /* Restart mode, Enable int, 32KHz, Enable timer */
52 TCTL2 = TCTL_OM | TCTL_IRQEN | TCTL_CLKSOURCE_32KHZ | TCTL_TEN;
53 /* Set prescaler (Divide 32KHz by 32)*/
54 TPRER2 = 31;
55 /* Set compare register 32Khz / 32 / 10 = 100 */
56 TCMP2 = 10;
57#endif
58
59 request_irq(TMR2_IRQ_NUM, timer_routine, IRQ_FLG_LOCK, "timer", NULL);
60}
61
62void BSP_tick(void)
63{
64 /* Reset Timer2 */
65 TSTAT2 &= 0;
66}
67 42
68unsigned long BSP_gettimeoffset (void) 43/***************************************************************************/
69{
70 return 0;
71}
72 44
73void BSP_gettod (int *yearp, int *monp, int *dayp, 45void m68328_reset (void)
74 int *hourp, int *minp, int *secp)
75{
76}
77
78int BSP_hwclk(int op, struct hwclk_time *t)
79{
80 if (!op) {
81 /* read */
82 } else {
83 /* write */
84 }
85 return 0;
86}
87
88int BSP_set_clock_mmss (unsigned long nowtime)
89{
90#if 0
91 short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
92
93 tod->second1 = real_seconds / 10;
94 tod->second2 = real_seconds % 10;
95 tod->minute1 = real_minutes / 10;
96 tod->minute2 = real_minutes % 10;
97#endif
98 return 0;
99}
100
101void BSP_reset (void)
102{ 46{
103 local_irq_disable(); 47 local_irq_disable();
104 asm volatile ("moveal #0x10c00000, %a0;\n\t" 48 asm volatile ("moveal #0x10c00000, %a0;\n\t"
@@ -108,18 +52,22 @@ void BSP_reset (void)
108 "jmp (%a0);"); 52 "jmp (%a0);");
109} 53}
110 54
55/***************************************************************************/
56
111void config_BSP(char *command, int len) 57void config_BSP(char *command, int len)
112{ 58{
113 printk(KERN_INFO "\n68328 support D. Jeff Dionne <jeff@uclinux.org>\n"); 59 printk(KERN_INFO "\n68328 support D. Jeff Dionne <jeff@uclinux.org>\n");
114 printk(KERN_INFO "68328 support Kenneth Albanowski <kjahds@kjshds.com>\n"); 60 printk(KERN_INFO "68328 support Kenneth Albanowski <kjahds@kjshds.com>\n");
115 printk(KERN_INFO "68328/Pilot support Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de>\n"); 61 printk(KERN_INFO "68328/Pilot support Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de>\n");
116 62
117 mach_sched_init = BSP_sched_init; 63 mach_sched_init = m68328_timer_init;
118 mach_tick = BSP_tick; 64 mach_tick = m68328_timer_tick;
119 mach_gettimeoffset = BSP_gettimeoffset; 65 mach_gettimeoffset = m68328_timer_gettimeoffset;
120 mach_gettod = BSP_gettod; 66 mach_gettod = m68328_timer_gettod;
121 mach_hwclk = NULL; 67 mach_hwclk = NULL;
122 mach_set_clock_mmss = NULL; 68 mach_set_clock_mmss = NULL;
123 mach_reset = BSP_reset; 69 mach_reset = m68328_reset;
124 *command = '\0'; 70 *command = '\0';
125} 71}
72
73/***************************************************************************/
diff --git a/arch/m68knommu/platform/68328/timers.c b/arch/m68knommu/platform/68328/timers.c
new file mode 100644
index 000000000000..68c2cd6b0030
--- /dev/null
+++ b/arch/m68knommu/platform/68328/timers.c
@@ -0,0 +1,106 @@
1/***************************************************************************/
2
3/*
4 * linux/arch/m68knommu/platform/68328/timers.c
5 *
6 * Copyright (C) 1993 Hamish Macdonald
7 * Copyright (C) 1999 D. Jeff Dionne
8 * Copyright (C) 2001 Georges Menie, Ken Desmet
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file COPYING in the main directory of this archive
12 * for more details.
13 */
14
15/***************************************************************************/
16
17#include <linux/config.h>
18#include <linux/types.h>
19#include <linux/kernel.h>
20#include <linux/mm.h>
21#include <asm/setup.h>
22#include <asm/system.h>
23#include <asm/pgtable.h>
24#include <asm/irq.h>
25#include <asm/machdep.h>
26#include <asm/MC68VZ328.h>
27
28/***************************************************************************/
29
30#if defined(CONFIG_DRAGEN2)
31/* with a 33.16 MHz clock, this will give usec resolution to the time functions */
32#define CLOCK_SOURCE TCTL_CLKSOURCE_SYSCLK
33#define CLOCK_PRE 7
34#define TICKS_PER_JIFFY 41450
35
36#elif defined(CONFIG_XCOPILOT_BUGS)
37/*
38 * The only thing I know is that CLK32 is not available on Xcopilot
39 * I have little idea about what frequency SYSCLK has on Xcopilot.
40 * The values for prescaler and compare registers were simply
41 * taken from the original source
42 */
43#define CLOCK_SOURCE TCTL_CLKSOURCE_SYSCLK
44#define CLOCK_PRE 2
45#define TICKS_PER_JIFFY 0xd7e4
46
47#else
48/* default to using the 32Khz clock */
49#define CLOCK_SOURCE TCTL_CLKSOURCE_32KHZ
50#define CLOCK_PRE 31
51#define TICKS_PER_JIFFY 10
52#endif
53
54/***************************************************************************/
55
56void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *))
57{
58 /* disable timer 1 */
59 TCTL = 0;
60
61 /* set ISR */
62 if (request_irq(TMR_IRQ_NUM, timer_routine, IRQ_FLG_LOCK, "timer", NULL))
63 panic("Unable to attach timer interrupt\n");
64
65 /* Restart mode, Enable int, Set clock source */
66 TCTL = TCTL_OM | TCTL_IRQEN | CLOCK_SOURCE;
67 TPRER = CLOCK_PRE;
68 TCMP = TICKS_PER_JIFFY;
69
70 /* Enable timer 1 */
71 TCTL |= TCTL_TEN;
72}
73
74/***************************************************************************/
75
76void m68328_timer_tick(void)
77{
78 /* Reset Timer1 */
79 TSTAT &= 0;
80}
81/***************************************************************************/
82
83unsigned long m68328_timer_gettimeoffset(void)
84{
85 unsigned long ticks = TCN, offset = 0;
86
87 /* check for pending interrupt */
88 if (ticks < (TICKS_PER_JIFFY >> 1) && (ISR & (1 << TMR_IRQ_NUM)))
89 offset = 1000000 / HZ;
90 ticks = (ticks * 1000000 / HZ) / TICKS_PER_JIFFY;
91 return ticks + offset;
92}
93
94/***************************************************************************/
95
96void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec)
97{
98 long now = RTCTIME;
99
100 *year = *mon = *day = 1;
101 *hour = (now >> 24) % 24;
102 *min = (now >> 16) % 60;
103 *sec = now % 60;
104}
105
106/***************************************************************************/
diff --git a/arch/m68knommu/platform/68EZ328/config.c b/arch/m68knommu/platform/68EZ328/config.c
index c21971971ff5..d8d56e5de310 100644
--- a/arch/m68knommu/platform/68EZ328/config.c
+++ b/arch/m68knommu/platform/68EZ328/config.c
@@ -1,5 +1,7 @@
1/***************************************************************************/
2
1/* 3/*
2 * linux/arch/$(ARCH)/platform/$(PLATFORM)/config.c 4 * linux/arch/m68knommu/platform/68EZ328/config.c
3 * 5 *
4 * Copyright (C) 1993 Hamish Macdonald 6 * Copyright (C) 1993 Hamish Macdonald
5 * Copyright (C) 1999 D. Jeff Dionne 7 * Copyright (C) 1999 D. Jeff Dionne
@@ -9,6 +11,8 @@
9 * for more details. 11 * for more details.
10 */ 12 */
11 13
14/***************************************************************************/
15
12#include <stdarg.h> 16#include <stdarg.h>
13#include <linux/config.h> 17#include <linux/config.h>
14#include <linux/types.h> 18#include <linux/types.h>
@@ -20,68 +24,22 @@
20#include <asm/setup.h> 24#include <asm/setup.h>
21#include <asm/system.h> 25#include <asm/system.h>
22#include <asm/pgtable.h> 26#include <asm/pgtable.h>
23#include <asm/irq.h>
24#include <asm/machdep.h> 27#include <asm/machdep.h>
25#include <asm/MC68EZ328.h> 28#include <asm/MC68EZ328.h>
26#ifdef CONFIG_UCSIMM 29#ifdef CONFIG_UCSIMM
27#include <asm/bootstd.h> 30#include <asm/bootstd.h>
28#endif 31#endif
29#ifdef CONFIG_PILOT
30#include "PalmV/romfs.h"
31#endif
32
33void BSP_sched_init(void (*timer_routine)(int, void *, struct pt_regs *))
34{
35 /* Restart mode, Enable int, 32KHz, Enable timer */
36 TCTL = TCTL_OM | TCTL_IRQEN | TCTL_CLKSOURCE_32KHZ | TCTL_TEN;
37 /* Set prescaler (Divide 32KHz by 32)*/
38 TPRER = 31;
39 /* Set compare register 32Khz / 32 / 10 = 100 */
40 TCMP = 10;
41
42 request_irq(TMR_IRQ_NUM, timer_routine, IRQ_FLG_LOCK, "timer", NULL);
43}
44
45void BSP_tick(void)
46{
47 /* Reset Timer1 */
48 TSTAT &= 0;
49}
50
51unsigned long BSP_gettimeoffset (void)
52{
53 return 0;
54}
55 32
56void BSP_gettod (int *yearp, int *monp, int *dayp, 33/***************************************************************************/
57 int *hourp, int *minp, int *secp)
58{
59}
60 34
61int BSP_hwclk(int op, struct hwclk_time *t) 35void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *));
62{ 36void m68328_timer_tick(void);
63 if (!op) { 37unsigned long m68328_timer_gettimeoffset(void);
64 /* read */ 38void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec);
65 } else {
66 /* write */
67 }
68 return 0;
69}
70 39
71int BSP_set_clock_mmss (unsigned long nowtime) 40/***************************************************************************/
72{
73#if 0
74 short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
75 41
76 tod->second1 = real_seconds / 10; 42void m68ez328_reset(void)
77 tod->second2 = real_seconds % 10;
78 tod->minute1 = real_minutes / 10;
79 tod->minute2 = real_minutes % 10;
80#endif
81 return 0;
82}
83
84void BSP_reset (void)
85{ 43{
86 local_irq_disable(); 44 local_irq_disable();
87 asm volatile (" 45 asm volatile ("
@@ -93,6 +51,8 @@ void BSP_reset (void)
93 "); 51 ");
94} 52}
95 53
54/***************************************************************************/
55
96unsigned char *cs8900a_hwaddr; 56unsigned char *cs8900a_hwaddr;
97static int errno; 57static int errno;
98 58
@@ -119,11 +79,13 @@ void config_BSP(char *command, int len)
119 else command[0] = 0; 79 else command[0] = 0;
120#endif 80#endif
121 81
122 mach_sched_init = BSP_sched_init; 82 mach_sched_init = m68328_timer_init;
123 mach_tick = BSP_tick; 83 mach_tick = m68328_timer_tick;
124 mach_gettimeoffset = BSP_gettimeoffset; 84 mach_gettimeoffset = m68328_timer_gettimeoffset;
125 mach_gettod = BSP_gettod; 85 mach_gettod = m68328_timer_gettod;
126 mach_hwclk = NULL; 86 mach_hwclk = NULL;
127 mach_set_clock_mmss = NULL; 87 mach_set_clock_mmss = NULL;
128 mach_reset = BSP_reset; 88 mach_reset = m68ez328_reset;
129} 89}
90
91/***************************************************************************/
diff --git a/arch/m68knommu/platform/68VZ328/de2/config.c b/arch/m68knommu/platform/68VZ328/config.c
index d0586197f113..d926524cdf82 100644
--- a/arch/m68knommu/platform/68VZ328/de2/config.c
+++ b/arch/m68knommu/platform/68VZ328/config.c
@@ -1,5 +1,7 @@
1/***************************************************************************/
2
1/* 3/*
2 * linux/arch/m68knommu/platform/MC68VZ328/de2/config.c 4 * linux/arch/m68knommu/platform/68VZ328/config.c
3 * 5 *
4 * Copyright (C) 1993 Hamish Macdonald 6 * Copyright (C) 1993 Hamish Macdonald
5 * Copyright (C) 1999 D. Jeff Dionne 7 * Copyright (C) 1999 D. Jeff Dionne
@@ -10,6 +12,8 @@
10 * for more details. 12 * for more details.
11 */ 13 */
12 14
15/***************************************************************************/
16
13#include <linux/config.h> 17#include <linux/config.h>
14#include <linux/types.h> 18#include <linux/types.h>
15#include <linux/kernel.h> 19#include <linux/kernel.h>
@@ -25,66 +29,25 @@
25#include <asm/irq.h> 29#include <asm/irq.h>
26#include <asm/machdep.h> 30#include <asm/machdep.h>
27#include <asm/MC68VZ328.h> 31#include <asm/MC68VZ328.h>
32#include <asm/bootstd.h>
28 33
29#ifdef CONFIG_INIT_LCD 34#ifdef CONFIG_INIT_LCD
30#include "screen.h" 35#include "bootlogo.h"
31#endif 36#endif
32 37
33/* with a 33.16 MHz clock, this will give usec resolution to the time functions */ 38/***************************************************************************/
34#define CLOCK_SOURCE TCTL_CLKSOURCE_SYSCLK
35#define CLOCK_PRE 7
36#define TICKS_PER_JIFFY 41450
37
38static void
39dragen2_sched_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *))
40{
41 /* disable timer 1 */
42 TCTL = 0;
43
44 /* set ISR */
45 if (request_irq(TMR_IRQ_NUM, timer_routine, IRQ_FLG_LOCK, "timer", NULL))
46 panic("Unable to attach timer interrupt\n");
47
48 /* Restart mode, Enable int, Set clock source */
49 TCTL = TCTL_OM | TCTL_IRQEN | CLOCK_SOURCE;
50 TPRER = CLOCK_PRE;
51 TCMP = TICKS_PER_JIFFY;
52
53 /* Enable timer 1 */
54 TCTL |= TCTL_TEN;
55}
56
57static void dragen2_tick(void)
58{
59 /* Reset Timer1 */
60 TSTAT &= 0;
61}
62
63static unsigned long dragen2_gettimeoffset(void)
64{
65 unsigned long ticks = TCN, offset = 0;
66
67 /* check for pending interrupt */
68 if (ticks < (TICKS_PER_JIFFY >> 1) && (ISR & (1 << TMR_IRQ_NUM)))
69 offset = 1000000 / HZ;
70
71 ticks = (ticks * 1000000 / HZ) / TICKS_PER_JIFFY;
72 39
73 return ticks + offset; 40void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *));
74} 41void m68328_timer_tick(void);
42unsigned long m68328_timer_gettimeoffset(void);
43void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec);
75 44
76static void dragen2_gettod(int *year, int *mon, int *day, int *hour, 45/***************************************************************************/
77 int *min, int *sec) 46/* Init Drangon Engine hardware */
78{ 47/***************************************************************************/
79 long now = RTCTIME; 48#if defined(CONFIG_DRAGEN2)
80 49
81 *year = *mon = *day = 1; 50static void m68vz328_reset(void)
82 *hour = (now >> 24) % 24;
83 *min = (now >> 16) % 60;
84 *sec = now % 60;
85}
86
87static void dragen2_reset(void)
88{ 51{
89 local_irq_disable(); 52 local_irq_disable();
90 53
@@ -103,7 +66,7 @@ static void dragen2_reset(void)
103 ); 66 );
104} 67}
105 68
106static void init_hardware(void) 69static void init_hardware(char *command, int size)
107{ 70{
108#ifdef CONFIG_DIRECT_IO_ACCESS 71#ifdef CONFIG_DIRECT_IO_ACCESS
109 SCR = 0x10; /* allow user access to internal registers */ 72 SCR = 0x10; /* allow user access to internal registers */
@@ -170,6 +133,60 @@ static void init_hardware(void)
170#endif 133#endif
171} 134}
172 135
136/***************************************************************************/
137/* Init RT-Control uCdimm hardware */
138/***************************************************************************/
139#elif defined(CONFIG_UCDIMM)
140
141static void m68vz328_reset(void)
142{
143 local_irq_disable();
144 asm volatile ("
145 moveal #0x10c00000, %a0;
146 moveb #0, 0xFFFFF300;
147 moveal 0(%a0), %sp;
148 moveal 4(%a0), %a0;
149 jmp (%a0);
150 ");
151}
152
153unsigned char *cs8900a_hwaddr;
154static int errno;
155
156_bsc0(char *, getserialnum)
157_bsc1(unsigned char *, gethwaddr, int, a)
158_bsc1(char *, getbenv, char *, a)
159
160static void init_hardware(char *command, int size)
161{
162 char *p;
163
164 printk(KERN_INFO "uCdimm serial string [%s]\n", getserialnum());
165 p = cs8900a_hwaddr = gethwaddr(0);
166 printk(KERN_INFO "uCdimm hwaddr %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
167 p[0], p[1], p[2], p[3], p[4], p[5]);
168 p = getbenv("APPEND");
169 if (p)
170 strcpy(p, command);
171 else
172 command[0] = 0;
173}
174
175/***************************************************************************/
176#else
177
178static void m68vz328_reset(void)
179{
180}
181
182static void init_hardware(char *command, int size)
183{
184}
185
186/***************************************************************************/
187#endif
188/***************************************************************************/
189
173void config_BSP(char *command, int size) 190void config_BSP(char *command, int size)
174{ 191{
175 printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n"); 192 printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
@@ -181,11 +198,13 @@ void config_BSP(char *command, int size)
181 memset(command, 0, size); 198 memset(command, 0, size);
182#endif 199#endif
183 200
184 init_hardware(); 201 init_hardware(command, size);
185 202
186 mach_sched_init = (void *)dragen2_sched_init; 203 mach_sched_init = (void *) m68328_timer_init;
187 mach_tick = dragen2_tick; 204 mach_tick = m68328_timer_tick;
188 mach_gettimeoffset = dragen2_gettimeoffset; 205 mach_gettimeoffset = m68328_timer_gettimeoffset;
189 mach_reset = dragen2_reset; 206 mach_gettod = m68328_timer_gettod;
190 mach_gettod = dragen2_gettod; 207 mach_reset = m68vz328_reset;
191} 208}
209
210/***************************************************************************/
diff --git a/arch/m68knommu/platform/68VZ328/ucdimm/config.c b/arch/m68knommu/platform/68VZ328/ucdimm/config.c
deleted file mode 100644
index 2deadaffd81e..000000000000
--- a/arch/m68knommu/platform/68VZ328/ucdimm/config.c
+++ /dev/null
@@ -1,117 +0,0 @@
1/*
2 * linux/arch/m68knommu/platform/68VZ328/ucdimm/config.c
3 *
4 * Copyright (C) 1993 Hamish Macdonald
5 * Copyright (C) 1999 D. Jeff Dionne
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive
9 * for more details.
10 */
11
12#include <stdarg.h>
13#include <linux/config.h>
14#include <linux/types.h>
15#include <linux/kernel.h>
16#include <linux/mm.h>
17#include <linux/tty.h>
18#include <linux/console.h>
19
20#include <asm/setup.h>
21#include <asm/system.h>
22#include <asm/pgtable.h>
23#include <asm/irq.h>
24#include <asm/machdep.h>
25#include <asm/MC68VZ328.h>
26#include <asm/bootstd.h>
27
28void BSP_sched_init(void (*timer_routine)(int, void *, struct pt_regs *))
29{
30 /* Restart mode, Enable int, 32KHz, Enable timer */
31 TCTL = TCTL_OM | TCTL_IRQEN | TCTL_CLKSOURCE_32KHZ | TCTL_TEN;
32 /* Set prescaler (Divide 32KHz by 32)*/
33 TPRER = 31;
34 /* Set compare register 32Khz / 32 / 10 = 100 */
35 TCMP = 10;
36
37 request_irq(TMR_IRQ_NUM, timer_routine, IRQ_FLG_LOCK, "timer", NULL);
38}
39
40void BSP_tick(void)
41{
42 /* Reset Timer1 */
43 TSTAT &= 0;
44}
45
46unsigned long BSP_gettimeoffset (void)
47{
48 return 0;
49}
50
51void BSP_gettod (int *yearp, int *monp, int *dayp,
52 int *hourp, int *minp, int *secp)
53{
54}
55
56int BSP_hwclk(int op, struct hwclk_time *t)
57{
58 if (!op) {
59 /* read */
60 } else {
61 /* write */
62 }
63 return 0;
64}
65
66int BSP_set_clock_mmss (unsigned long nowtime)
67{
68#if 0
69 short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
70
71 tod->second1 = real_seconds / 10;
72 tod->second2 = real_seconds % 10;
73 tod->minute1 = real_minutes / 10;
74 tod->minute2 = real_minutes % 10;
75#endif
76 return 0;
77}
78
79void BSP_reset (void)
80{
81 local_irq_disable();
82 asm volatile ("
83 moveal #0x10c00000, %a0;
84 moveb #0, 0xFFFFF300;
85 moveal 0(%a0), %sp;
86 moveal 4(%a0), %a0;
87 jmp (%a0);
88 ");
89}
90
91unsigned char *cs8900a_hwaddr;
92static int errno;
93
94_bsc0(char *, getserialnum)
95_bsc1(unsigned char *, gethwaddr, int, a)
96_bsc1(char *, getbenv, char *, a)
97
98void config_BSP(char *command, int len)
99{
100 unsigned char *p;
101
102 printk(KERN_INFO "\n68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
103
104 printk(KERN_INFO "uCdimm serial string [%s]\n",getserialnum());
105 p = cs8900a_hwaddr = gethwaddr(0);
106 printk(KERN_INFO "uCdimm hwaddr %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
107 p[0], p[1], p[2], p[3], p[4], p[5]);
108 p = getbenv("APPEND");
109 if (p) strcpy(p,command);
110 else command[0] = 0;
111
112 mach_sched_init = BSP_sched_init;
113 mach_tick = BSP_tick;
114 mach_gettimeoffset = BSP_gettimeoffset;
115 mach_gettod = BSP_gettod;
116 mach_reset = BSP_reset;
117}
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8d76eb1ff291..0eb71ac303af 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -154,6 +154,13 @@ config TANBAC_TB0226
154 The TANBAC Mbase(TB0226) is a MIPS-based platform manufactured by TANBAC. 154 The TANBAC Mbase(TB0226) is a MIPS-based platform manufactured by TANBAC.
155 Please refer to <http://www.tanbac.co.jp/> about Mbase. 155 Please refer to <http://www.tanbac.co.jp/> about Mbase.
156 156
157config TANBAC_TB0287
158 bool "Support for TANBAC Mini-ITX DIMM base(TB0287)"
159 depends on TANBAC_TB022X
160 help
161 The TANBAC Mini-ITX DIMM base(TB0287) is a MIPS-based platform manufactured by TANBAC.
162 Please refer to <http://www.tanbac.co.jp/> about Mini-ITX DIMM base.
163
157config VICTOR_MPC30X 164config VICTOR_MPC30X
158 bool "Support for Victor MP-C303/304" 165 bool "Support for Victor MP-C303/304"
159 depends on MACH_VR41XX 166 depends on MACH_VR41XX
diff --git a/arch/mips/configs/tb0287_defconfig b/arch/mips/configs/tb0287_defconfig
new file mode 100644
index 000000000000..17b9f2f65ba0
--- /dev/null
+++ b/arch/mips/configs/tb0287_defconfig
@@ -0,0 +1,1041 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-mm1
4# Thu Sep 1 22:58:34 2005
5#
6CONFIG_MIPS=y
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12CONFIG_CLEAN_COMPILE=y
13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
15
16#
17# General setup
18#
19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y
23# CONFIG_POSIX_MQUEUE is not set
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set
27# CONFIG_HOTPLUG is not set
28CONFIG_KOBJECT_UEVENT=y
29# CONFIG_IKCONFIG is not set
30CONFIG_INITRAMFS_SOURCE=""
31CONFIG_EMBEDDED=y
32CONFIG_KALLSYMS=y
33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51CONFIG_MODULES=y
52CONFIG_MODULE_UNLOAD=y
53# CONFIG_MODULE_FORCE_UNLOAD is not set
54CONFIG_OBSOLETE_MODPARM=y
55CONFIG_MODVERSIONS=y
56CONFIG_MODULE_SRCVERSION_ALL=y
57CONFIG_KMOD=y
58CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
59CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
60CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
61CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
62
63#
64# Kernel type
65#
66CONFIG_32BIT=y
67# CONFIG_64BIT is not set
68
69#
70# Machine selection
71#
72# CONFIG_MACH_JAZZ is not set
73CONFIG_MACH_VR41XX=y
74# CONFIG_NEC_CMBVR4133 is not set
75# CONFIG_CASIO_E55 is not set
76# CONFIG_IBM_WORKPAD is not set
77CONFIG_TANBAC_TB022X=y
78# CONFIG_TANBAC_TB0226 is not set
79CONFIG_TANBAC_TB0287=y
80# CONFIG_VICTOR_MPC30X is not set
81# CONFIG_ZAO_CAPCELLA is not set
82CONFIG_PCI_VR41XX=y
83# CONFIG_VRC4173 is not set
84# CONFIG_TOSHIBA_JMR3927 is not set
85# CONFIG_MIPS_COBALT is not set
86# CONFIG_MACH_DECSTATION is not set
87# CONFIG_MIPS_EV64120 is not set
88# CONFIG_MIPS_EV96100 is not set
89# CONFIG_MIPS_IVR is not set
90# CONFIG_LASAT is not set
91# CONFIG_MIPS_ITE8172 is not set
92# CONFIG_MIPS_ATLAS is not set
93# CONFIG_MIPS_MALTA is not set
94# CONFIG_MIPS_SEAD is not set
95# CONFIG_MOMENCO_OCELOT is not set
96# CONFIG_MOMENCO_OCELOT_G is not set
97# CONFIG_MOMENCO_OCELOT_C is not set
98# CONFIG_MOMENCO_OCELOT_3 is not set
99# CONFIG_MOMENCO_JAGUAR_ATX is not set
100# CONFIG_PMC_YOSEMITE is not set
101# CONFIG_DDB5074 is not set
102# CONFIG_DDB5476 is not set
103# CONFIG_DDB5477 is not set
104# CONFIG_QEMU is not set
105# CONFIG_SGI_IP22 is not set
106# CONFIG_SGI_IP27 is not set
107# CONFIG_SGI_IP32 is not set
108# CONFIG_SOC_AU1X00 is not set
109# CONFIG_SIBYTE_SB1xxx_SOC is not set
110# CONFIG_SNI_RM200_PCI is not set
111# CONFIG_TOSHIBA_RBTX4927 is not set
112CONFIG_RWSEM_GENERIC_SPINLOCK=y
113CONFIG_GENERIC_CALIBRATE_DELAY=y
114CONFIG_HAVE_DEC_LOCK=y
115CONFIG_DMA_NONCOHERENT=y
116CONFIG_DMA_NEED_PCI_MAP_STATE=y
117CONFIG_CPU_LITTLE_ENDIAN=y
118CONFIG_IRQ_CPU=y
119CONFIG_MIPS_L1_CACHE_SHIFT=5
120
121#
122# CPU selection
123#
124# CONFIG_CPU_MIPS32 is not set
125# CONFIG_CPU_MIPS64 is not set
126# CONFIG_CPU_R3000 is not set
127# CONFIG_CPU_TX39XX is not set
128CONFIG_CPU_VR41XX=y
129# CONFIG_CPU_R4300 is not set
130# CONFIG_CPU_R4X00 is not set
131# CONFIG_CPU_TX49XX is not set
132# CONFIG_CPU_R5000 is not set
133# CONFIG_CPU_R5432 is not set
134# CONFIG_CPU_R6000 is not set
135# CONFIG_CPU_NEVADA is not set
136# CONFIG_CPU_R8000 is not set
137# CONFIG_CPU_R10000 is not set
138# CONFIG_CPU_RM7000 is not set
139# CONFIG_CPU_RM9000 is not set
140# CONFIG_CPU_SB1 is not set
141CONFIG_PAGE_SIZE_4KB=y
142# CONFIG_PAGE_SIZE_8KB is not set
143# CONFIG_PAGE_SIZE_16KB is not set
144# CONFIG_PAGE_SIZE_64KB is not set
145# CONFIG_CPU_ADVANCED is not set
146CONFIG_CPU_HAS_SYNC=y
147CONFIG_ARCH_FLATMEM_ENABLE=y
148CONFIG_SELECT_MEMORY_MODEL=y
149CONFIG_FLATMEM_MANUAL=y
150# CONFIG_DISCONTIGMEM_MANUAL is not set
151# CONFIG_SPARSEMEM_MANUAL is not set
152CONFIG_FLATMEM=y
153CONFIG_FLAT_NODE_MEM_MAP=y
154# CONFIG_SPARSEMEM_STATIC is not set
155# CONFIG_PREEMPT is not set
156
157#
158# Bus options (PCI, PCMCIA, EISA, ISA, TC)
159#
160CONFIG_HW_HAS_PCI=y
161CONFIG_PCI=y
162# CONFIG_PCI_LEGACY_PROC is not set
163CONFIG_MMU=y
164
165#
166# PCCARD (PCMCIA/CardBus) support
167#
168# CONFIG_PCCARD is not set
169
170#
171# PCI Hotplug Support
172#
173# CONFIG_HOTPLUG_PCI is not set
174
175#
176# Executable file formats
177#
178CONFIG_BINFMT_ELF=y
179# CONFIG_BINFMT_MISC is not set
180CONFIG_TRAD_SIGNALS=y
181
182#
183# Networking
184#
185CONFIG_NET=y
186
187#
188# Networking options
189#
190CONFIG_PACKET=y
191# CONFIG_PACKET_MMAP is not set
192CONFIG_UNIX=y
193CONFIG_XFRM=y
194CONFIG_XFRM_USER=m
195# CONFIG_NET_KEY is not set
196CONFIG_INET=y
197CONFIG_IP_MULTICAST=y
198CONFIG_IP_ADVANCED_ROUTER=y
199CONFIG_ASK_IP_FIB_HASH=y
200# CONFIG_IP_FIB_TRIE is not set
201CONFIG_IP_FIB_HASH=y
202CONFIG_IP_MULTIPLE_TABLES=y
203CONFIG_IP_ROUTE_MULTIPATH=y
204# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
205CONFIG_IP_ROUTE_VERBOSE=y
206CONFIG_IP_PNP=y
207# CONFIG_IP_PNP_DHCP is not set
208CONFIG_IP_PNP_BOOTP=y
209# CONFIG_IP_PNP_RARP is not set
210CONFIG_NET_IPIP=m
211CONFIG_NET_IPGRE=m
212# CONFIG_NET_IPGRE_BROADCAST is not set
213# CONFIG_IP_MROUTE is not set
214# CONFIG_ARPD is not set
215CONFIG_SYN_COOKIES=y
216# CONFIG_INET_AH is not set
217# CONFIG_INET_ESP is not set
218# CONFIG_INET_IPCOMP is not set
219CONFIG_INET_TUNNEL=m
220CONFIG_INET_DIAG=y
221CONFIG_INET_TCP_DIAG=y
222CONFIG_TCP_CONG_ADVANCED=y
223
224#
225# TCP congestion control
226#
227CONFIG_TCP_CONG_BIC=y
228CONFIG_TCP_CONG_WESTWOOD=m
229CONFIG_TCP_CONG_HTCP=m
230# CONFIG_TCP_CONG_HSTCP is not set
231# CONFIG_TCP_CONG_HYBLA is not set
232# CONFIG_TCP_CONG_VEGAS is not set
233# CONFIG_TCP_CONG_SCALABLE is not set
234# CONFIG_IPV6 is not set
235# CONFIG_NETFILTER is not set
236
237#
238# DCCP Configuration (EXPERIMENTAL)
239#
240# CONFIG_IP_DCCP is not set
241
242#
243# SCTP Configuration (EXPERIMENTAL)
244#
245# CONFIG_IP_SCTP is not set
246# CONFIG_ATM is not set
247# CONFIG_BRIDGE is not set
248# CONFIG_VLAN_8021Q is not set
249# CONFIG_DECNET is not set
250# CONFIG_LLC2 is not set
251# CONFIG_IPX is not set
252# CONFIG_ATALK is not set
253# CONFIG_X25 is not set
254# CONFIG_LAPB is not set
255# CONFIG_NET_DIVERT is not set
256# CONFIG_ECONET is not set
257# CONFIG_WAN_ROUTER is not set
258# CONFIG_NET_SCHED is not set
259# CONFIG_NET_CLS_ROUTE is not set
260
261#
262# Network testing
263#
264# CONFIG_NET_PKTGEN is not set
265# CONFIG_NETFILTER_NETLINK is not set
266# CONFIG_HAMRADIO is not set
267# CONFIG_IRDA is not set
268# CONFIG_BT is not set
269# CONFIG_IEEE80211 is not set
270
271#
272# Device Drivers
273#
274
275#
276# Generic Driver Options
277#
278CONFIG_STANDALONE=y
279CONFIG_PREVENT_FIRMWARE_BUILD=y
280# CONFIG_FW_LOADER is not set
281
282#
283# Memory Technology Devices (MTD)
284#
285# CONFIG_MTD is not set
286
287#
288# Parallel port support
289#
290# CONFIG_PARPORT is not set
291
292#
293# Plug and Play support
294#
295
296#
297# Block devices
298#
299# CONFIG_BLK_DEV_FD is not set
300# CONFIG_BLK_CPQ_DA is not set
301# CONFIG_BLK_CPQ_CISS_DA is not set
302# CONFIG_BLK_DEV_DAC960 is not set
303# CONFIG_BLK_DEV_UMEM is not set
304# CONFIG_BLK_DEV_COW_COMMON is not set
305CONFIG_BLK_DEV_LOOP=m
306# CONFIG_BLK_DEV_CRYPTOLOOP is not set
307CONFIG_BLK_DEV_NBD=m
308# CONFIG_BLK_DEV_SX8 is not set
309# CONFIG_BLK_DEV_UB is not set
310CONFIG_BLK_DEV_RAM=y
311CONFIG_BLK_DEV_RAM_COUNT=16
312CONFIG_BLK_DEV_RAM_SIZE=4096
313# CONFIG_BLK_DEV_INITRD is not set
314# CONFIG_LBD is not set
315# CONFIG_CDROM_PKTCDVD is not set
316
317#
318# IO Schedulers
319#
320CONFIG_IOSCHED_NOOP=y
321CONFIG_IOSCHED_AS=y
322CONFIG_IOSCHED_DEADLINE=y
323CONFIG_IOSCHED_CFQ=y
324# CONFIG_ATA_OVER_ETH is not set
325
326#
327# ATA/ATAPI/MFM/RLL support
328#
329CONFIG_IDE=y
330CONFIG_BLK_DEV_IDE=y
331
332#
333# Please see Documentation/ide.txt for help/info on IDE drives
334#
335# CONFIG_BLK_DEV_IDE_SATA is not set
336CONFIG_BLK_DEV_IDEDISK=y
337# CONFIG_IDEDISK_MULTI_MODE is not set
338# CONFIG_BLK_DEV_IDECD is not set
339# CONFIG_BLK_DEV_IDETAPE is not set
340# CONFIG_BLK_DEV_IDEFLOPPY is not set
341# CONFIG_BLK_DEV_IDESCSI is not set
342# CONFIG_IDE_TASK_IOCTL is not set
343
344#
345# IDE chipset support/bugfixes
346#
347CONFIG_IDE_GENERIC=y
348CONFIG_BLK_DEV_IDEPCI=y
349# CONFIG_IDEPCI_SHARE_IRQ is not set
350# CONFIG_BLK_DEV_OFFBOARD is not set
351# CONFIG_BLK_DEV_GENERIC is not set
352# CONFIG_BLK_DEV_OPTI621 is not set
353CONFIG_BLK_DEV_IDEDMA_PCI=y
354# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
355# CONFIG_IDEDMA_PCI_AUTO is not set
356# CONFIG_BLK_DEV_AEC62XX is not set
357# CONFIG_BLK_DEV_ALI15X3 is not set
358# CONFIG_BLK_DEV_AMD74XX is not set
359# CONFIG_BLK_DEV_CMD64X is not set
360# CONFIG_BLK_DEV_TRIFLEX is not set
361# CONFIG_BLK_DEV_CY82C693 is not set
362# CONFIG_BLK_DEV_CS5520 is not set
363# CONFIG_BLK_DEV_CS5530 is not set
364# CONFIG_BLK_DEV_HPT34X is not set
365# CONFIG_BLK_DEV_HPT366 is not set
366# CONFIG_BLK_DEV_SC1200 is not set
367# CONFIG_BLK_DEV_PIIX is not set
368# CONFIG_BLK_DEV_IT821X is not set
369# CONFIG_BLK_DEV_NS87415 is not set
370# CONFIG_BLK_DEV_PDC202XX_OLD is not set
371# CONFIG_BLK_DEV_PDC202XX_NEW is not set
372# CONFIG_BLK_DEV_SVWKS is not set
373CONFIG_BLK_DEV_SIIMAGE=y
374# CONFIG_BLK_DEV_SLC90E66 is not set
375# CONFIG_BLK_DEV_TRM290 is not set
376# CONFIG_BLK_DEV_VIA82CXXX is not set
377# CONFIG_IDE_ARM is not set
378CONFIG_BLK_DEV_IDEDMA=y
379# CONFIG_IDEDMA_IVB is not set
380# CONFIG_IDEDMA_AUTO is not set
381# CONFIG_BLK_DEV_HD is not set
382
383#
384# SCSI device support
385#
386# CONFIG_RAID_ATTRS is not set
387CONFIG_SCSI=y
388CONFIG_SCSI_PROC_FS=y
389
390#
391# SCSI support type (disk, tape, CD-ROM)
392#
393CONFIG_BLK_DEV_SD=y
394# CONFIG_CHR_DEV_ST is not set
395# CONFIG_CHR_DEV_OSST is not set
396# CONFIG_BLK_DEV_SR is not set
397# CONFIG_CHR_DEV_SG is not set
398# CONFIG_CHR_DEV_SCH is not set
399
400#
401# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
402#
403# CONFIG_SCSI_MULTI_LUN is not set
404# CONFIG_SCSI_CONSTANTS is not set
405# CONFIG_SCSI_LOGGING is not set
406
407#
408# SCSI Transport Attributes
409#
410# CONFIG_SCSI_SPI_ATTRS is not set
411# CONFIG_SCSI_FC_ATTRS is not set
412# CONFIG_SCSI_ISCSI_ATTRS is not set
413
414#
415# SCSI low-level drivers
416#
417# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
418# CONFIG_SCSI_3W_9XXX is not set
419# CONFIG_SCSI_ARCMSR is not set
420# CONFIG_SCSI_ACARD is not set
421# CONFIG_SCSI_AACRAID is not set
422# CONFIG_SCSI_AIC7XXX is not set
423# CONFIG_SCSI_AIC7XXX_OLD is not set
424# CONFIG_SCSI_AIC79XX is not set
425# CONFIG_SCSI_DPT_I2O is not set
426# CONFIG_MEGARAID_NEWGEN is not set
427# CONFIG_MEGARAID_LEGACY is not set
428# CONFIG_SCSI_SATA is not set
429# CONFIG_SCSI_BUSLOGIC is not set
430# CONFIG_SCSI_DMX3191D is not set
431# CONFIG_SCSI_EATA is not set
432# CONFIG_SCSI_FUTURE_DOMAIN is not set
433# CONFIG_SCSI_GDTH is not set
434# CONFIG_SCSI_IPS is not set
435# CONFIG_SCSI_INITIO is not set
436# CONFIG_SCSI_INIA100 is not set
437# CONFIG_SCSI_SYM53C8XX_2 is not set
438# CONFIG_SCSI_IPR is not set
439# CONFIG_SCSI_QLOGIC_FC is not set
440# CONFIG_SCSI_QLOGIC_1280 is not set
441CONFIG_SCSI_QLA2XXX=y
442# CONFIG_SCSI_QLA21XX is not set
443# CONFIG_SCSI_QLA22XX is not set
444# CONFIG_SCSI_QLA2300 is not set
445# CONFIG_SCSI_QLA2322 is not set
446# CONFIG_SCSI_QLA6312 is not set
447# CONFIG_SCSI_QLA24XX is not set
448# CONFIG_SCSI_LPFC is not set
449# CONFIG_SCSI_DC395x is not set
450# CONFIG_SCSI_DC390T is not set
451# CONFIG_SCSI_NSP32 is not set
452# CONFIG_SCSI_DEBUG is not set
453
454#
455# Multi-device support (RAID and LVM)
456#
457# CONFIG_MD is not set
458
459#
460# Fusion MPT device support
461#
462# CONFIG_FUSION is not set
463# CONFIG_FUSION_SPI is not set
464# CONFIG_FUSION_FC is not set
465
466#
467# IEEE 1394 (FireWire) support
468#
469CONFIG_IEEE1394=m
470
471#
472# Subsystem Options
473#
474# CONFIG_IEEE1394_VERBOSEDEBUG is not set
475# CONFIG_IEEE1394_OUI_DB is not set
476CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
477CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
478# CONFIG_IEEE1394_EXPORT_FULL_API is not set
479
480#
481# Device Drivers
482#
483
484#
485# Texas Instruments PCILynx requires I2C
486#
487CONFIG_IEEE1394_OHCI1394=m
488
489#
490# Protocol Drivers
491#
492CONFIG_IEEE1394_VIDEO1394=m
493CONFIG_IEEE1394_SBP2=m
494# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
495CONFIG_IEEE1394_ETH1394=m
496CONFIG_IEEE1394_DV1394=m
497CONFIG_IEEE1394_RAWIO=m
498CONFIG_IEEE1394_CMP=m
499CONFIG_IEEE1394_AMDTP=m
500
501#
502# I2O device support
503#
504# CONFIG_I2O is not set
505
506#
507# Network device support
508#
509CONFIG_NETDEVICES=y
510CONFIG_DUMMY=m
511# CONFIG_BONDING is not set
512# CONFIG_EQUALIZER is not set
513# CONFIG_TUN is not set
514
515#
516# ARCnet devices
517#
518# CONFIG_ARCNET is not set
519
520#
521# PHY device support
522#
523# CONFIG_PHYLIB is not set
524
525#
526# Ethernet (10 or 100Mbit)
527#
528CONFIG_NET_ETHERNET=y
529CONFIG_MII=y
530# CONFIG_HAPPYMEAL is not set
531# CONFIG_SUNGEM is not set
532# CONFIG_NET_VENDOR_3COM is not set
533
534#
535# Tulip family network device support
536#
537# CONFIG_NET_TULIP is not set
538# CONFIG_HP100 is not set
539# CONFIG_NET_PCI is not set
540
541#
542# Ethernet (1000 Mbit)
543#
544# CONFIG_ACENIC is not set
545# CONFIG_DL2K is not set
546# CONFIG_E1000 is not set
547# CONFIG_NS83820 is not set
548# CONFIG_HAMACHI is not set
549# CONFIG_YELLOWFIN is not set
550CONFIG_R8169=y
551# CONFIG_R8169_NAPI is not set
552# CONFIG_SIS190 is not set
553# CONFIG_SKGE is not set
554# CONFIG_SKY2 is not set
555# CONFIG_SK98LIN is not set
556# CONFIG_TIGON3 is not set
557# CONFIG_BNX2 is not set
558
559#
560# Ethernet (10000 Mbit)
561#
562# CONFIG_CHELSIO_T1 is not set
563# CONFIG_IXGB is not set
564# CONFIG_S2IO is not set
565
566#
567# Token Ring devices
568#
569# CONFIG_TR is not set
570
571#
572# Wireless LAN (non-hamradio)
573#
574# CONFIG_NET_RADIO is not set
575
576#
577# Wan interfaces
578#
579# CONFIG_WAN is not set
580# CONFIG_FDDI is not set
581# CONFIG_HIPPI is not set
582# CONFIG_PPP is not set
583# CONFIG_SLIP is not set
584# CONFIG_NET_FC is not set
585# CONFIG_SHAPER is not set
586# CONFIG_NETCONSOLE is not set
587# CONFIG_KGDBOE is not set
588# CONFIG_NETPOLL is not set
589# CONFIG_NETPOLL_RX is not set
590# CONFIG_NETPOLL_TRAP is not set
591# CONFIG_NET_POLL_CONTROLLER is not set
592
593#
594# ISDN subsystem
595#
596# CONFIG_ISDN is not set
597
598#
599# Telephony Support
600#
601# CONFIG_PHONE is not set
602
603#
604# Input device support
605#
606CONFIG_INPUT=y
607
608#
609# Userland interfaces
610#
611# CONFIG_INPUT_MOUSEDEV is not set
612# CONFIG_INPUT_JOYDEV is not set
613# CONFIG_INPUT_TSDEV is not set
614# CONFIG_INPUT_EVDEV is not set
615# CONFIG_INPUT_EVBUG is not set
616
617#
618# Input Device Drivers
619#
620# CONFIG_INPUT_KEYBOARD is not set
621# CONFIG_INPUT_MOUSE is not set
622# CONFIG_INPUT_JOYSTICK is not set
623# CONFIG_INPUT_TOUCHSCREEN is not set
624# CONFIG_INPUT_MISC is not set
625
626#
627# Hardware I/O ports
628#
629# CONFIG_SERIO is not set
630# CONFIG_GAMEPORT is not set
631
632#
633# Character devices
634#
635CONFIG_VT=y
636CONFIG_VT_CONSOLE=y
637CONFIG_HW_CONSOLE=y
638# CONFIG_SERIAL_NONSTANDARD is not set
639
640#
641# Serial drivers
642#
643# CONFIG_SERIAL_8250 is not set
644
645#
646# Non-8250 serial port support
647#
648CONFIG_SERIAL_CORE=y
649CONFIG_SERIAL_CORE_CONSOLE=y
650CONFIG_SERIAL_VR41XX=y
651CONFIG_SERIAL_VR41XX_CONSOLE=y
652# CONFIG_SERIAL_JSM is not set
653CONFIG_UNIX98_PTYS=y
654CONFIG_LEGACY_PTYS=y
655CONFIG_LEGACY_PTY_COUNT=256
656
657#
658# IPMI
659#
660# CONFIG_IPMI_HANDLER is not set
661
662#
663# Watchdog Cards
664#
665# CONFIG_WATCHDOG is not set
666# CONFIG_RTC is not set
667# CONFIG_GEN_RTC is not set
668# CONFIG_RTC_VR41XX is not set
669# CONFIG_DTLK is not set
670# CONFIG_R3964 is not set
671# CONFIG_APPLICOM is not set
672# CONFIG_TANBAC_TB0219 is not set
673
674#
675# Ftape, the floppy tape device driver
676#
677# CONFIG_DRM is not set
678CONFIG_GPIO_VR41XX=y
679# CONFIG_RAW_DRIVER is not set
680
681#
682# TPM devices
683#
684# CONFIG_TCG_TPM is not set
685
686#
687# I2C support
688#
689# CONFIG_I2C is not set
690
691#
692# Dallas's 1-wire bus
693#
694# CONFIG_W1 is not set
695
696#
697# Hardware Monitoring support
698#
699# CONFIG_HWMON is not set
700# CONFIG_HWMON_VID is not set
701
702#
703# Misc devices
704#
705
706#
707# Multimedia Capabilities Port drivers
708#
709
710#
711# Multimedia devices
712#
713# CONFIG_VIDEO_DEV is not set
714
715#
716# Digital Video Broadcasting Devices
717#
718# CONFIG_DVB is not set
719
720#
721# Graphics support
722#
723# CONFIG_FB is not set
724
725#
726# Console display driver support
727#
728# CONFIG_VGA_CONSOLE is not set
729CONFIG_DUMMY_CONSOLE=y
730
731#
732# Speakup console speech
733#
734# CONFIG_SPEAKUP is not set
735
736#
737# Sound
738#
739# CONFIG_SOUND is not set
740
741#
742# USB support
743#
744CONFIG_USB_ARCH_HAS_HCD=y
745CONFIG_USB_ARCH_HAS_OHCI=y
746CONFIG_USB=m
747# CONFIG_USB_DEBUG is not set
748
749#
750# Miscellaneous USB options
751#
752# CONFIG_USB_DEVICEFS is not set
753# CONFIG_USB_BANDWIDTH is not set
754# CONFIG_USB_DYNAMIC_MINORS is not set
755# CONFIG_USB_OTG is not set
756
757#
758# USB Host Controller Drivers
759#
760CONFIG_USB_EHCI_HCD=m
761# CONFIG_USB_EHCI_SPLIT_ISO is not set
762# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
763# CONFIG_USB_ISP116X_HCD is not set
764CONFIG_USB_OHCI_HCD=m
765# CONFIG_USB_OHCI_BIG_ENDIAN is not set
766CONFIG_USB_OHCI_LITTLE_ENDIAN=y
767# CONFIG_USB_UHCI_HCD is not set
768# CONFIG_USB_SL811_HCD is not set
769
770#
771# USB Device Class drivers
772#
773# CONFIG_USB_BLUETOOTH_TTY is not set
774# CONFIG_USB_ACM is not set
775# CONFIG_USB_PRINTER is not set
776
777#
778# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
779#
780CONFIG_USB_STORAGE=m
781# CONFIG_USB_STORAGE_DEBUG is not set
782# CONFIG_USB_STORAGE_DATAFAB is not set
783# CONFIG_USB_STORAGE_FREECOM is not set
784# CONFIG_USB_STORAGE_ISD200 is not set
785# CONFIG_USB_STORAGE_DPCM is not set
786# CONFIG_USB_STORAGE_USBAT is not set
787# CONFIG_USB_STORAGE_SDDR09 is not set
788# CONFIG_USB_STORAGE_SDDR55 is not set
789# CONFIG_USB_STORAGE_JUMPSHOT is not set
790
791#
792# USB Input Devices
793#
794CONFIG_USB_HID=m
795CONFIG_USB_HIDINPUT=y
796# CONFIG_HID_FF is not set
797# CONFIG_USB_HIDDEV is not set
798
799#
800# USB HID Boot Protocol drivers
801#
802# CONFIG_USB_KBD is not set
803# CONFIG_USB_MOUSE is not set
804# CONFIG_USB_AIPTEK is not set
805# CONFIG_USB_WACOM is not set
806# CONFIG_USB_ACECAD is not set
807# CONFIG_USB_KBTAB is not set
808# CONFIG_USB_POWERMATE is not set
809# CONFIG_USB_MTOUCH is not set
810# CONFIG_USB_ITMTOUCH is not set
811# CONFIG_USB_EGALAX is not set
812# CONFIG_USB_YEALINK is not set
813# CONFIG_USB_XPAD is not set
814# CONFIG_USB_ATI_REMOTE is not set
815# CONFIG_USB_KEYSPAN_REMOTE is not set
816# CONFIG_USB_APPLETOUCH is not set
817
818#
819# USB Imaging devices
820#
821# CONFIG_USB_MDC800 is not set
822# CONFIG_USB_MICROTEK is not set
823
824#
825# USB Multimedia devices
826#
827# CONFIG_USB_DABUSB is not set
828
829#
830# Video4Linux support is needed for USB Multimedia device support
831#
832
833#
834# USB Network Adapters
835#
836# CONFIG_USB_CATC is not set
837# CONFIG_USB_KAWETH is not set
838# CONFIG_USB_PEGASUS is not set
839# CONFIG_USB_RTL8150 is not set
840# CONFIG_USB_USBNET is not set
841CONFIG_USB_MON=y
842
843#
844# USB port drivers
845#
846
847#
848# USB Serial Converter support
849#
850# CONFIG_USB_SERIAL is not set
851
852#
853# USB Miscellaneous drivers
854#
855# CONFIG_USB_EMI62 is not set
856# CONFIG_USB_EMI26 is not set
857# CONFIG_USB_AUERSWALD is not set
858# CONFIG_USB_RIO500 is not set
859# CONFIG_USB_LEGOTOWER is not set
860# CONFIG_USB_LCD is not set
861# CONFIG_USB_LED is not set
862# CONFIG_USB_CYTHERM is not set
863# CONFIG_USB_GOTEMP is not set
864# CONFIG_USB_PHIDGETKIT is not set
865# CONFIG_USB_PHIDGETSERVO is not set
866# CONFIG_USB_IDMOUSE is not set
867# CONFIG_USB_SISUSBVGA is not set
868# CONFIG_USB_LD is not set
869
870#
871# USB DSL modem support
872#
873
874#
875# USB Gadget Support
876#
877# CONFIG_USB_GADGET is not set
878
879#
880# MMC/SD Card support
881#
882# CONFIG_MMC is not set
883
884#
885# InfiniBand support
886#
887# CONFIG_INFINIBAND is not set
888
889#
890# SN Devices
891#
892
893#
894# Distributed Lock Manager
895#
896# CONFIG_DLM is not set
897
898#
899# File systems
900#
901CONFIG_EXT2_FS=y
902# CONFIG_EXT2_FS_XATTR is not set
903# CONFIG_EXT2_FS_XIP is not set
904# CONFIG_EXT3_FS is not set
905# CONFIG_REISER4_FS is not set
906# CONFIG_REISERFS_FS is not set
907# CONFIG_JFS_FS is not set
908# CONFIG_FS_POSIX_ACL is not set
909
910#
911# XFS support
912#
913CONFIG_XFS_FS=y
914# CONFIG_XFS_RT is not set
915CONFIG_XFS_QUOTA=y
916# CONFIG_XFS_SECURITY is not set
917CONFIG_XFS_POSIX_ACL=y
918# CONFIG_OCFS2_FS is not set
919# CONFIG_MINIX_FS is not set
920CONFIG_ROMFS_FS=m
921CONFIG_INOTIFY=y
922# CONFIG_QUOTA is not set
923CONFIG_QUOTACTL=y
924# CONFIG_DNOTIFY is not set
925# CONFIG_AUTOFS_FS is not set
926CONFIG_AUTOFS4_FS=y
927# CONFIG_FUSE_FS is not set
928
929#
930# CD-ROM/DVD Filesystems
931#
932# CONFIG_ISO9660_FS is not set
933# CONFIG_UDF_FS is not set
934
935#
936# DOS/FAT/NT Filesystems
937#
938# CONFIG_MSDOS_FS is not set
939# CONFIG_VFAT_FS is not set
940# CONFIG_NTFS_FS is not set
941
942#
943# Pseudo filesystems
944#
945CONFIG_PROC_FS=y
946CONFIG_PROC_KCORE=y
947CONFIG_SYSFS=y
948CONFIG_TMPFS=y
949# CONFIG_HUGETLB_PAGE is not set
950CONFIG_RAMFS=y
951# CONFIG_CONFIGFS_FS is not set
952# CONFIG_RELAYFS_FS is not set
953
954#
955# Miscellaneous filesystems
956#
957# CONFIG_ADFS_FS is not set
958# CONFIG_AFFS_FS is not set
959# CONFIG_ASFS_FS is not set
960# CONFIG_HFS_FS is not set
961# CONFIG_HFSPLUS_FS is not set
962# CONFIG_BEFS_FS is not set
963# CONFIG_BFS_FS is not set
964# CONFIG_EFS_FS is not set
965CONFIG_CRAMFS=m
966# CONFIG_VXFS_FS is not set
967# CONFIG_HPFS_FS is not set
968# CONFIG_QNX4FS_FS is not set
969# CONFIG_SYSV_FS is not set
970# CONFIG_UFS_FS is not set
971
972#
973# Network File Systems
974#
975CONFIG_NFS_FS=y
976CONFIG_NFS_V3=y
977# CONFIG_NFS_V3_ACL is not set
978# CONFIG_NFS_V4 is not set
979# CONFIG_NFS_DIRECTIO is not set
980# CONFIG_NFSD is not set
981CONFIG_ROOT_NFS=y
982CONFIG_LOCKD=y
983CONFIG_LOCKD_V4=y
984CONFIG_NFS_COMMON=y
985CONFIG_SUNRPC=y
986# CONFIG_RPCSEC_GSS_KRB5 is not set
987# CONFIG_RPCSEC_GSS_SPKM3 is not set
988# CONFIG_SMB_FS is not set
989# CONFIG_CIFS is not set
990# CONFIG_NCP_FS is not set
991# CONFIG_CODA_FS is not set
992# CONFIG_AFS_FS is not set
993# CONFIG_9P_FS is not set
994
995#
996# Partition Types
997#
998# CONFIG_PARTITION_ADVANCED is not set
999CONFIG_MSDOS_PARTITION=y
1000
1001#
1002# Native Language Support
1003#
1004# CONFIG_NLS is not set
1005
1006#
1007# Kernel hacking
1008#
1009# CONFIG_PRINTK_TIME is not set
1010# CONFIG_DEBUG_KERNEL is not set
1011CONFIG_LOG_BUF_SHIFT=14
1012CONFIG_CROSSCOMPILE=y
1013CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
1014
1015#
1016# Security options
1017#
1018CONFIG_KEYS=y
1019CONFIG_KEYS_DEBUG_PROC_KEYS=y
1020# CONFIG_SECURITY is not set
1021
1022#
1023# Cryptographic options
1024#
1025# CONFIG_CRYPTO is not set
1026
1027#
1028# Hardware crypto devices
1029#
1030
1031#
1032# Library routines
1033#
1034# CONFIG_CRC_CCITT is not set
1035# CONFIG_CRC16 is not set
1036CONFIG_CRC32=y
1037# CONFIG_LIBCRC32C is not set
1038CONFIG_ZLIB_INFLATE=m
1039CONFIG_GENERIC_HARDIRQS=y
1040CONFIG_GENERIC_IRQ_PROBE=y
1041CONFIG_ISA_DMA_API=y
diff --git a/arch/mips/kernel/genrtc.c b/arch/mips/kernel/genrtc.c
index 288bf51ad4ec..71416e7bbbaa 100644
--- a/arch/mips/kernel/genrtc.c
+++ b/arch/mips/kernel/genrtc.c
@@ -14,7 +14,7 @@
14#include <asm/rtc.h> 14#include <asm/rtc.h>
15#include <asm/time.h> 15#include <asm/time.h>
16 16
17static spinlock_t mips_rtc_lock = SPIN_LOCK_UNLOCKED; 17static DEFINE_SPINLOCK(mips_rtc_lock);
18 18
19unsigned int get_rtc_time(struct rtc_time *time) 19unsigned int get_rtc_time(struct rtc_time *time)
20{ 20{
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index 7eec7568bfea..447759201d1d 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
@@ -31,7 +31,7 @@ void disable_8259A_irq(unsigned int irq);
31 * moves to arch independent land 31 * moves to arch independent land
32 */ 32 */
33 33
34spinlock_t i8259A_lock = SPIN_LOCK_UNLOCKED; 34spinlock_t DEFINE_SPINLOCK(i8259A_lock);
35 35
36static void end_8259A_irq (unsigned int irq) 36static void end_8259A_irq (unsigned int irq)
37{ 37{
diff --git a/arch/mips/kernel/irixioctl.c b/arch/mips/kernel/irixioctl.c
index 4cd3d38a22c2..3cdc22346f4c 100644
--- a/arch/mips/kernel/irixioctl.c
+++ b/arch/mips/kernel/irixioctl.c
@@ -14,6 +14,7 @@
14#include <linux/syscalls.h> 14#include <linux/syscalls.h>
15#include <linux/tty.h> 15#include <linux/tty.h>
16#include <linux/file.h> 16#include <linux/file.h>
17#include <linux/rcupdate.h>
17 18
18#include <asm/uaccess.h> 19#include <asm/uaccess.h>
19#include <asm/ioctl.h> 20#include <asm/ioctl.h>
@@ -33,7 +34,7 @@ static struct tty_struct *get_tty(int fd)
33 struct file *filp; 34 struct file *filp;
34 struct tty_struct *ttyp = NULL; 35 struct tty_struct *ttyp = NULL;
35 36
36 spin_lock(&current->files->file_lock); 37 rcu_read_lock();
37 filp = fcheck(fd); 38 filp = fcheck(fd);
38 if(filp && filp->private_data) { 39 if(filp && filp->private_data) {
39 ttyp = (struct tty_struct *) filp->private_data; 40 ttyp = (struct tty_struct *) filp->private_data;
@@ -41,7 +42,7 @@ static struct tty_struct *get_tty(int fd)
41 if(ttyp->magic != TTY_MAGIC) 42 if(ttyp->magic != TTY_MAGIC)
42 ttyp =NULL; 43 ttyp =NULL;
43 } 44 }
44 spin_unlock(&current->files->file_lock); 45 rcu_read_unlock();
45 return ttyp; 46 return ttyp;
46} 47}
47 48
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index c53e4cb359ba..83d81c9cdc2b 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -48,6 +48,7 @@ obj-$(CONFIG_SIBYTE_SB1250) += fixup-sb1250.o pci-sb1250.o
48obj-$(CONFIG_SNI_RM200_PCI) += fixup-sni.o ops-sni.o 48obj-$(CONFIG_SNI_RM200_PCI) += fixup-sni.o ops-sni.o
49obj-$(CONFIG_TANBAC_TB0219) += fixup-tb0219.o 49obj-$(CONFIG_TANBAC_TB0219) += fixup-tb0219.o
50obj-$(CONFIG_TANBAC_TB0226) += fixup-tb0226.o 50obj-$(CONFIG_TANBAC_TB0226) += fixup-tb0226.o
51obj-$(CONFIG_TANBAC_TB0287) += fixup-tb0287.o
51obj-$(CONFIG_TOSHIBA_JMR3927) += fixup-jmr3927.o pci-jmr3927.o 52obj-$(CONFIG_TOSHIBA_JMR3927) += fixup-jmr3927.o pci-jmr3927.o
52obj-$(CONFIG_TOSHIBA_RBTX4927) += fixup-rbtx4927.o ops-tx4927.o 53obj-$(CONFIG_TOSHIBA_RBTX4927) += fixup-rbtx4927.o ops-tx4927.o
53obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o 54obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o
diff --git a/arch/mips/pci/fixup-tb0287.c b/arch/mips/pci/fixup-tb0287.c
new file mode 100644
index 000000000000..8436d7f1fdb2
--- /dev/null
+++ b/arch/mips/pci/fixup-tb0287.c
@@ -0,0 +1,65 @@
1/*
2 * fixup-tb0287.c, The TANBAC TB0287 specific PCI fixups.
3 *
4 * Copyright (C) 2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/init.h>
21#include <linux/pci.h>
22
23#include <asm/vr41xx/tb0287.h>
24
25int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
26{
27 unsigned char bus;
28 int irq = -1;
29
30 bus = dev->bus->number;
31 if (bus == 0) {
32 switch (slot) {
33 case 16:
34 irq = TB0287_SM501_IRQ;
35 break;
36 case 17:
37 irq = TB0287_SIL680A_IRQ;
38 break;
39 default:
40 break;
41 }
42 } else if (bus == 1) {
43 switch (PCI_SLOT(dev->devfn)) {
44 case 0:
45 irq = TB0287_PCI_SLOT_IRQ;
46 break;
47 case 2:
48 case 3:
49 irq = TB0287_RTL8110_IRQ;
50 break;
51 default:
52 break;
53 }
54 } else if (bus > 1) {
55 irq = TB0287_PCI_SLOT_IRQ;
56 }
57
58 return irq;
59}
60
61/* Do platform specific device initialization at pci_enable_device() time */
62int pcibios_plat_dev_init(struct pci_dev *dev)
63{
64 return 0;
65}
diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c
index 89fe0ceeaa40..2ca9ec7ec3a7 100644
--- a/arch/ppc/8xx_io/cs4218_tdm.c
+++ b/arch/ppc/8xx_io/cs4218_tdm.c
@@ -1380,7 +1380,7 @@ static void cs_nosound(unsigned long xx)
1380 spin_unlock_irqrestore(&cs4218_lock, flags); 1380 spin_unlock_irqrestore(&cs4218_lock, flags);
1381} 1381}
1382 1382
1383static struct timer_list beep_timer = TIMER_INITIALIZER(cs_nosound, 0, 0); 1383static DEFINE_TIMER(beep_timer, cs_nosound, 0, 0);
1384}; 1384};
1385 1385
1386static void cs_mksound(unsigned int hz, unsigned int ticks) 1386static void cs_mksound(unsigned int hz, unsigned int ticks)
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 6ab7e5ea5fcf..e3f1ce33e642 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -499,11 +499,6 @@ config WINCEPT
499 MPC821 PowerPC, introduced in 1998 and designed to be used in 499 MPC821 PowerPC, introduced in 1998 and designed to be used in
500 thin-client machines. Say Y to support it directly. 500 thin-client machines. Say Y to support it directly.
501 501
502 Be aware that PCI buses can only function when SYS board is plugged
503 into the PIB (Platform IO Board) board from Freescale which provide
504 3 PCI slots. The PIBs PCI initialization is the bootloader's
505 responsiblilty.
506
507endchoice 502endchoice
508 503
509choice 504choice
@@ -680,6 +675,11 @@ config MPC834x_SYS
680 help 675 help
681 This option enables support for the MPC 834x SYS evaluation board. 676 This option enables support for the MPC 834x SYS evaluation board.
682 677
678 Be aware that PCI buses can only function when SYS board is plugged
679 into the PIB (Platform IO Board) board from Freescale which provide
680 3 PCI slots. The PIBs PCI initialization is the bootloader's
681 responsiblilty.
682
683config EV64360 683config EV64360
684 bool "Marvell-EV64360BP" 684 bool "Marvell-EV64360BP"
685 help 685 help
diff --git a/arch/ppc/boot/common/ns16550.c b/arch/ppc/boot/common/ns16550.c
index 9017c547a6f6..26818bbb6cff 100644
--- a/arch/ppc/boot/common/ns16550.c
+++ b/arch/ppc/boot/common/ns16550.c
@@ -23,7 +23,7 @@ static int shift;
23 23
24unsigned long serial_init(int chan, void *ignored) 24unsigned long serial_init(int chan, void *ignored)
25{ 25{
26 unsigned long com_port; 26 unsigned long com_port, base_baud;
27 unsigned char lcr, dlm; 27 unsigned char lcr, dlm;
28 28
29 /* We need to find out which type io we're expecting. If it's 29 /* We need to find out which type io we're expecting. If it's
@@ -43,6 +43,8 @@ unsigned long serial_init(int chan, void *ignored)
43 43
44 /* How far apart the registers are. */ 44 /* How far apart the registers are. */
45 shift = rs_table[chan].iomem_reg_shift; 45 shift = rs_table[chan].iomem_reg_shift;
46 /* Base baud.. */
47 base_baud = rs_table[chan].baud_base;
46 48
47 /* save the LCR */ 49 /* save the LCR */
48 lcr = inb(com_port + (UART_LCR << shift)); 50 lcr = inb(com_port + (UART_LCR << shift));
@@ -62,9 +64,9 @@ unsigned long serial_init(int chan, void *ignored)
62 else { 64 else {
63 /* Input clock. */ 65 /* Input clock. */
64 outb(com_port + (UART_DLL << shift), 66 outb(com_port + (UART_DLL << shift),
65 (BASE_BAUD / SERIAL_BAUD) & 0xFF); 67 (base_baud / SERIAL_BAUD) & 0xFF);
66 outb(com_port + (UART_DLM << shift), 68 outb(com_port + (UART_DLM << shift),
67 (BASE_BAUD / SERIAL_BAUD) >> 8); 69 (base_baud / SERIAL_BAUD) >> 8);
68 /* 8 data, 1 stop, no parity */ 70 /* 8 data, 1 stop, no parity */
69 outb(com_port + (UART_LCR << shift), 0x03); 71 outb(com_port + (UART_LCR << shift), 0x03);
70 /* RTS/DTR */ 72 /* RTS/DTR */
diff --git a/arch/ppc/boot/common/util.S b/arch/ppc/boot/common/util.S
index 47e641455bc5..c96c9f80521e 100644
--- a/arch/ppc/boot/common/util.S
+++ b/arch/ppc/boot/common/util.S
@@ -252,7 +252,7 @@ _GLOBAL(flush_instruction_cache)
2521: dcbf r0,r3 # Flush the data cache 2521: dcbf r0,r3 # Flush the data cache
253 icbi r0,r3 # Invalidate the instruction cache 253 icbi r0,r3 # Invalidate the instruction cache
254 addi r3,r3,0x10 # Increment by one cache line 254 addi r3,r3,0x10 # Increment by one cache line
255 cmplwi cr0,r3,r4 # Are we at the end yet? 255 cmplw cr0,r3,r4 # Are we at the end yet?
256 blt 1b # No, keep flushing and invalidating 256 blt 1b # No, keep flushing and invalidating
257#else 257#else
258 /* Enable, invalidate and then disable the L1 icache/dcache. */ 258 /* Enable, invalidate and then disable the L1 icache/dcache. */
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
index b1457a8a9c0f..1fb92f16acd6 100644
--- a/arch/ppc/kernel/Makefile
+++ b/arch/ppc/kernel/Makefile
@@ -15,8 +15,9 @@ extra-y += vmlinux.lds
15obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ 15obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
16 process.o signal.o ptrace.o align.o \ 16 process.o signal.o ptrace.o align.o \
17 semaphore.o syscalls.o setup.o \ 17 semaphore.o syscalls.o setup.o \
18 cputable.o ppc_htab.o perfmon.o 18 cputable.o ppc_htab.o
19obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o 19obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o
20obj-$(CONFIG_E500) += perfmon.o
20obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o 21obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o
21obj-$(CONFIG_POWER4) += cpu_setup_power4.o 22obj-$(CONFIG_POWER4) += cpu_setup_power4.o
22obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o 23obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 7b3586a3bf30..854e45beb387 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -80,7 +80,6 @@ fixup_broken_pcnet32(struct pci_dev* dev)
80 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) { 80 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
81 dev->vendor = PCI_VENDOR_ID_AMD; 81 dev->vendor = PCI_VENDOR_ID_AMD;
82 pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD); 82 pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
83 pci_name_device(dev);
84 } 83 }
85} 84}
86DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32); 85DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
diff --git a/arch/ppc/kernel/syscalls.c b/arch/ppc/kernel/syscalls.c
index 124313ce3c09..127f040de9de 100644
--- a/arch/ppc/kernel/syscalls.c
+++ b/arch/ppc/kernel/syscalls.c
@@ -41,10 +41,6 @@
41#include <asm/ipc.h> 41#include <asm/ipc.h>
42#include <asm/semaphore.h> 42#include <asm/semaphore.h>
43 43
44void
45check_bugs(void)
46{
47}
48 44
49/* 45/*
50 * sys_ipc() is the de-multiplexer for the SysV IPC calls.. 46 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index d87423d1003a..8356d544fa60 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -849,10 +849,12 @@ void AltivecAssistException(struct pt_regs *regs)
849} 849}
850#endif /* CONFIG_ALTIVEC */ 850#endif /* CONFIG_ALTIVEC */
851 851
852#ifdef CONFIG_E500
852void PerformanceMonitorException(struct pt_regs *regs) 853void PerformanceMonitorException(struct pt_regs *regs)
853{ 854{
854 perf_irq(regs); 855 perf_irq(regs);
855} 856}
857#endif
856 858
857#ifdef CONFIG_FSL_BOOKE 859#ifdef CONFIG_FSL_BOOKE
858void CacheLockingException(struct pt_regs *regs, unsigned long address, 860void CacheLockingException(struct pt_regs *regs, unsigned long address,
diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c
index 0fd3442f5131..d6b2b1965dcb 100644
--- a/arch/ppc/platforms/4xx/ebony.c
+++ b/arch/ppc/platforms/4xx/ebony.c
@@ -91,15 +91,10 @@ ebony_calibrate_decr(void)
91 * on Rev. C silicon then errata forces us to 91 * on Rev. C silicon then errata forces us to
92 * use the internal clock. 92 * use the internal clock.
93 */ 93 */
94 switch (PVR_REV(mfspr(SPRN_PVR))) { 94 if (strcmp(cur_cpu_spec[0]->cpu_name, "440GP Rev. B") == 0)
95 case PVR_REV(PVR_440GP_RB): 95 freq = EBONY_440GP_RB_SYSCLK;
96 freq = EBONY_440GP_RB_SYSCLK; 96 else
97 break; 97 freq = EBONY_440GP_RC_SYSCLK;
98 case PVR_REV(PVR_440GP_RC1):
99 default:
100 freq = EBONY_440GP_RC_SYSCLK;
101 break;
102 }
103 98
104 ibm44x_calibrate_decr(freq); 99 ibm44x_calibrate_decr(freq);
105} 100}
diff --git a/arch/ppc/platforms/hdpu.c b/arch/ppc/platforms/hdpu.c
index b659d7b3d747..ff3796860123 100644
--- a/arch/ppc/platforms/hdpu.c
+++ b/arch/ppc/platforms/hdpu.c
@@ -58,7 +58,7 @@ static void parse_bootinfo(unsigned long r3,
58static void hdpu_set_l1pe(void); 58static void hdpu_set_l1pe(void);
59static void hdpu_cpustate_set(unsigned char new_state); 59static void hdpu_cpustate_set(unsigned char new_state);
60#ifdef CONFIG_SMP 60#ifdef CONFIG_SMP
61static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED; 61static DEFINE_SPINLOCK(timebase_lock);
62static unsigned int timebase_upper = 0, timebase_lower = 0; 62static unsigned int timebase_upper = 0, timebase_lower = 0;
63extern int smp_tb_synchronized; 63extern int smp_tb_synchronized;
64 64
diff --git a/arch/ppc/syslib/ibm440gx_common.c b/arch/ppc/syslib/ibm440gx_common.c
index d4776af6a3ca..0bb919859b8b 100644
--- a/arch/ppc/syslib/ibm440gx_common.c
+++ b/arch/ppc/syslib/ibm440gx_common.c
@@ -236,9 +236,10 @@ void __init ibm440gx_l2c_setup(struct ibm44x_clocks* p)
236 /* Disable L2C on rev.A, rev.B and 800MHz version of rev.C, 236 /* Disable L2C on rev.A, rev.B and 800MHz version of rev.C,
237 enable it on all other revisions 237 enable it on all other revisions
238 */ 238 */
239 u32 pvr = mfspr(SPRN_PVR); 239 if (strcmp(cur_cpu_spec[0]->cpu_name, "440GX Rev. A") == 0 ||
240 if (pvr == PVR_440GX_RA || pvr == PVR_440GX_RB || 240 strcmp(cur_cpu_spec[0]->cpu_name, "440GX Rev. B") == 0
241 (pvr == PVR_440GX_RC && p->cpu > 667000000)) 241 || (strcmp(cur_cpu_spec[0]->cpu_name, "440GX Rev. C")
242 == 0 && p->cpu > 667000000))
242 ibm440gx_l2c_disable(); 243 ibm440gx_l2c_disable();
243 else 244 else
244 ibm440gx_l2c_enable(); 245 ibm440gx_l2c_enable();
diff --git a/arch/ppc/syslib/mpc10x_common.c b/arch/ppc/syslib/mpc10x_common.c
index 87065e2e4c5f..3e039706bdbc 100644
--- a/arch/ppc/syslib/mpc10x_common.c
+++ b/arch/ppc/syslib/mpc10x_common.c
@@ -140,12 +140,12 @@ struct platform_device ppc_sys_platform_devices[] = {
140 }, 140 },
141 [MPC10X_UART0] = { 141 [MPC10X_UART0] = {
142 .name = "serial8250", 142 .name = "serial8250",
143 .id = 0, 143 .id = PLAT8250_DEV_PLATFORM,
144 .dev.platform_data = serial_plat_uart0, 144 .dev.platform_data = serial_plat_uart0,
145 }, 145 },
146 [MPC10X_UART1] = { 146 [MPC10X_UART1] = {
147 .name = "serial8250", 147 .name = "serial8250",
148 .id = 1, 148 .id = PLAT8250_DEV_PLATFORM1,
149 .dev.platform_data = serial_plat_uart1, 149 .dev.platform_data = serial_plat_uart1,
150 }, 150 },
151 151
diff --git a/arch/ppc/syslib/mpc83xx_devices.c b/arch/ppc/syslib/mpc83xx_devices.c
index 5aaf0e58e1f9..95b3b8a7f0ba 100644
--- a/arch/ppc/syslib/mpc83xx_devices.c
+++ b/arch/ppc/syslib/mpc83xx_devices.c
@@ -165,7 +165,7 @@ struct platform_device ppc_sys_platform_devices[] = {
165 }, 165 },
166 [MPC83xx_DUART] = { 166 [MPC83xx_DUART] = {
167 .name = "serial8250", 167 .name = "serial8250",
168 .id = 0, 168 .id = PLAT8250_DEV_PLATFORM,
169 .dev.platform_data = serial_platform_data, 169 .dev.platform_data = serial_platform_data,
170 }, 170 },
171 [MPC83xx_SEC2] = { 171 [MPC83xx_SEC2] = {
diff --git a/arch/ppc/syslib/mpc85xx_devices.c b/arch/ppc/syslib/mpc85xx_devices.c
index 8af322dd476a..bbc5ac0de878 100644
--- a/arch/ppc/syslib/mpc85xx_devices.c
+++ b/arch/ppc/syslib/mpc85xx_devices.c
@@ -282,7 +282,7 @@ struct platform_device ppc_sys_platform_devices[] = {
282 }, 282 },
283 [MPC85xx_DUART] = { 283 [MPC85xx_DUART] = {
284 .name = "serial8250", 284 .name = "serial8250",
285 .id = 0, 285 .id = PLAT8250_DEV_PLATFORM,
286 .dev.platform_data = serial_platform_data, 286 .dev.platform_data = serial_platform_data,
287 }, 287 },
288 [MPC85xx_PERFMON] = { 288 [MPC85xx_PERFMON] = {
diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c
index 6262b11f366f..839f8872826f 100644
--- a/arch/ppc/syslib/mv64x60.c
+++ b/arch/ppc/syslib/mv64x60.c
@@ -31,7 +31,7 @@
31 31
32 32
33u8 mv64x60_pci_exclude_bridge = 1; 33u8 mv64x60_pci_exclude_bridge = 1;
34spinlock_t mv64x60_lock = SPIN_LOCK_UNLOCKED; 34DEFINE_SPINLOCK(mv64x60_lock);
35 35
36static phys_addr_t mv64x60_bridge_pbase; 36static phys_addr_t mv64x60_bridge_pbase;
37static void *mv64x60_bridge_vbase; 37static void *mv64x60_bridge_vbase;
diff --git a/arch/ppc/syslib/qspan_pci.c b/arch/ppc/syslib/qspan_pci.c
index 57f4ed5e5ae1..0970b5d30391 100644
--- a/arch/ppc/syslib/qspan_pci.c
+++ b/arch/ppc/syslib/qspan_pci.c
@@ -94,7 +94,7 @@
94#define mk_config_type1(bus, dev, offset) \ 94#define mk_config_type1(bus, dev, offset) \
95 mk_config_addr(bus, dev, offset) | 1; 95 mk_config_addr(bus, dev, offset) | 1;
96 96
97static spinlock_t pcibios_lock = SPIN_LOCK_UNLOCKED; 97static DEFINE_SPINLOCK(pcibios_lock);
98 98
99int qspan_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, 99int qspan_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn,
100 unsigned char offset, unsigned char *val) 100 unsigned char offset, unsigned char *val)
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile
index d795775a5cd7..0a23aeacba88 100644
--- a/arch/ppc64/Makefile
+++ b/arch/ppc64/Makefile
@@ -89,11 +89,12 @@ drivers-$(CONFIG_OPROFILE) += arch/ppc64/oprofile/
89 89
90boot := arch/ppc64/boot 90boot := arch/ppc64/boot
91 91
92boottarget-$(CONFIG_PPC_PSERIES) := zImage zImage.initrd 92boottargets-$(CONFIG_PPC_PSERIES) += zImage zImage.initrd
93boottarget-$(CONFIG_PPC_MAPLE) := zImage zImage.initrd 93boottargets-$(CONFIG_PPC_PMAC) += zImage.vmode zImage.initrd.vmode
94boottarget-$(CONFIG_PPC_ISERIES) := vmlinux.sminitrd vmlinux.initrd vmlinux.sm 94boottargets-$(CONFIG_PPC_MAPLE) += zImage zImage.initrd
95boottarget-$(CONFIG_PPC_BPA) := zImage zImage.initrd 95boottargets-$(CONFIG_PPC_ISERIES) += vmlinux.sminitrd vmlinux.initrd vmlinux.sm
96$(boottarget-y): vmlinux 96boottargets-$(CONFIG_PPC_BPA) += zImage zImage.initrd
97$(boottargets-y): vmlinux
97 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 98 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
98 99
99bootimage-$(CONFIG_PPC_PSERIES) := $(boot)/zImage 100bootimage-$(CONFIG_PPC_PSERIES) := $(boot)/zImage
@@ -124,8 +125,10 @@ include3/asm:
124 $(Q)ln -fsn $(srctree)/include/asm-powerpc include3/asm 125 $(Q)ln -fsn $(srctree)/include/asm-powerpc include3/asm
125 126
126define archhelp 127define archhelp
127 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' 128 echo ' zImage.vmode - Compressed kernel image (arch/$(ARCH)/boot/zImage.vmode)'
128 echo ' zImage.initrd- Compressed kernel image with initrd attached,' 129 echo ' zImage.initrd.vmode - Compressed kernel image with initrd attached,'
129 echo ' sourced from arch/$(ARCH)/boot/ramdisk.image.gz' 130 echo ' sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
130 echo ' (arch/$(ARCH)/boot/zImage.initrd)' 131 echo ' (arch/$(ARCH)/boot/zImage.initrd.vmode)'
132 echo ' zImage - zImage for pSeries machines'
133 echo ' zImage.initrd - zImage with initrd for pSeries machines'
131endef 134endef
diff --git a/arch/ppc64/boot/Makefile b/arch/ppc64/boot/Makefile
index 2c5f5e73d00c..33fdc8710891 100644
--- a/arch/ppc64/boot/Makefile
+++ b/arch/ppc64/boot/Makefile
@@ -37,6 +37,9 @@ quiet_cmd_bootcc = BOOTCC $@
37quiet_cmd_bootas = BOOTAS $@ 37quiet_cmd_bootas = BOOTAS $@
38 cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $< 38 cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $<
39 39
40quiet_cmd_bootld = BOOTLD $@
41 cmd_bootld = $(CROSS32LD) $(BOOTLFLAGS) -o $@ $(2)
42
40$(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c 43$(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c
41 $(call if_changed_dep,bootcc) 44 $(call if_changed_dep,bootcc)
42$(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S 45$(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S
@@ -53,7 +56,7 @@ src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section)))
53gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section))) 56gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section)))
54 57
55hostprogs-y := addnote addRamDisk 58hostprogs-y := addnote addRamDisk
56targets += zImage zImage.initrd imagesize.c \ 59targets += zImage.vmode zImage.initrd.vmode zImage zImage.initrd imagesize.c \
57 $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \ 60 $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \
58 $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \ 61 $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \
59 $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \ 62 $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \
@@ -63,7 +66,7 @@ extra-y := initrd.o
63quiet_cmd_ramdisk = RAMDISK $@ 66quiet_cmd_ramdisk = RAMDISK $@
64 cmd_ramdisk = $(obj)/addRamDisk $(obj)/ramdisk.image.gz $< $@ 67 cmd_ramdisk = $(obj)/addRamDisk $(obj)/ramdisk.image.gz $< $@
65 68
66quiet_cmd_stripvm = STRIP $@ 69quiet_cmd_stripvm = STRIP $@
67 cmd_stripvm = $(STRIP) -s $< -o $@ 70 cmd_stripvm = $(STRIP) -s $< -o $@
68 71
69vmlinux.strip: vmlinux FORCE 72vmlinux.strip: vmlinux FORCE
@@ -71,12 +74,20 @@ vmlinux.strip: vmlinux FORCE
71$(obj)/vmlinux.initrd: vmlinux.strip $(obj)/addRamDisk $(obj)/ramdisk.image.gz FORCE 74$(obj)/vmlinux.initrd: vmlinux.strip $(obj)/addRamDisk $(obj)/ramdisk.image.gz FORCE
72 $(call if_changed,ramdisk) 75 $(call if_changed,ramdisk)
73 76
74addsection = $(CROSS32OBJCOPY) $(1) \ 77quiet_cmd_addsection = ADDSEC $@
75 --add-section=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $(1)))=$(patsubst %.o,%.gz, $(1)) \ 78 cmd_addsection = $(CROSS32OBJCOPY) $@ \
76 --set-section-flags=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $(1)))=$(OBJCOPYFLAGS) 79 --add-section=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(patsubst %.o,%.gz, $@) \
80 --set-section-flags=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(OBJCOPYFLAGS)
81
82quiet_cmd_imagesize = GENSIZE $@
83 cmd_imagesize = ls -l vmlinux.strip | \
84 awk '{printf "/* generated -- do not edit! */\n" "unsigned long vmlinux_filesize = %d;\n", $$5}' \
85 > $(obj)/imagesize.c && \
86 $(CROSS_COMPILE)nm -n vmlinux | tail -n 1 | \
87 awk '{printf "unsigned long vmlinux_memsize = 0x%s;\n", substr($$1,8)}' >> $(obj)/imagesize.c
77 88
78quiet_cmd_addnote = ADDNOTE $@ 89quiet_cmd_addnote = ADDNOTE $@
79 cmd_addnote = $(CROSS32LD) $(BOOTLFLAGS) -o $@ $(obj-boot) && $(obj)/addnote $@ 90 cmd_addnote = $(obj)/addnote $@
80 91
81$(call gz-sec, $(required)): $(obj)/kernel-%.gz: % FORCE 92$(call gz-sec, $(required)): $(obj)/kernel-%.gz: % FORCE
82 $(call if_changed,gzip) 93 $(call if_changed,gzip)
@@ -85,28 +96,30 @@ $(obj)/kernel-initrd.gz: $(obj)/ramdisk.image.gz
85 cp -f $(obj)/ramdisk.image.gz $@ 96 cp -f $(obj)/ramdisk.image.gz $@
86 97
87$(call src-sec, $(required) $(initrd)): $(obj)/kernel-%.c: $(obj)/kernel-%.gz FORCE 98$(call src-sec, $(required) $(initrd)): $(obj)/kernel-%.c: $(obj)/kernel-%.gz FORCE
88 touch $@ 99 @touch $@
89 100
90$(call obj-sec, $(required) $(initrd)): $(obj)/kernel-%.o: $(obj)/kernel-%.c FORCE 101$(call obj-sec, $(required) $(initrd)): $(obj)/kernel-%.o: $(obj)/kernel-%.c FORCE
91 $(call if_changed_dep,bootcc) 102 $(call if_changed_dep,bootcc)
92 $(call addsection, $@) 103 $(call cmd,addsection)
104
105$(obj)/zImage.vmode: obj-boot += $(call obj-sec, $(required))
106$(obj)/zImage.vmode: $(call obj-sec, $(required)) $(obj-boot) FORCE
107 $(call cmd,bootld,$(obj-boot))
108
109$(obj)/zImage.initrd.vmode: obj-boot += $(call obj-sec, $(required) $(initrd))
110$(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) FORCE
111 $(call cmd,bootld,$(obj-boot))
93 112
94$(obj)/zImage: obj-boot += $(call obj-sec, $(required)) 113$(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote FORCE
95$(obj)/zImage: $(call obj-sec, $(required)) $(obj-boot) $(obj)/addnote FORCE 114 @cp -f $< $@
96 $(call if_changed,addnote) 115 $(call if_changed,addnote)
97 116
98$(obj)/zImage.initrd: obj-boot += $(call obj-sec, $(required) $(initrd)) 117$(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote FORCE
99$(obj)/zImage.initrd: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(obj)/addnote FORCE 118 @cp -f $< $@
100 $(call if_changed,addnote) 119 $(call if_changed,addnote)
101 120
102$(obj)/imagesize.c: vmlinux.strip 121$(obj)/imagesize.c: vmlinux.strip
103 @echo Generating $@ 122 $(call cmd,imagesize)
104 ls -l vmlinux.strip | \
105 awk '{printf "/* generated -- do not edit! */\n" \
106 "unsigned long vmlinux_filesize = %d;\n", $$5}' > $(obj)/imagesize.c
107 $(CROSS_COMPILE)nm -n vmlinux | tail -n 1 | \
108 awk '{printf "unsigned long vmlinux_memsize = 0x%s;\n", substr($$1,8)}' \
109 >> $(obj)/imagesize.c
110 123
111install: $(CONFIGURE) $(BOOTIMAGE) 124install: $(CONFIGURE) $(BOOTIMAGE)
112 sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" "$(BOOTIMAGE)" 125 sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" "$(BOOTIMAGE)"
diff --git a/arch/ppc64/boot/main.c b/arch/ppc64/boot/main.c
index 99e68cfbe688..f7ec19a2d0b0 100644
--- a/arch/ppc64/boot/main.c
+++ b/arch/ppc64/boot/main.c
@@ -23,7 +23,8 @@ extern void flush_cache(void *, unsigned long);
23 23
24/* Value picked to match that used by yaboot */ 24/* Value picked to match that used by yaboot */
25#define PROG_START 0x01400000 25#define PROG_START 0x01400000
26#define RAM_END (256<<20) // Fixme: use OF */ 26#define RAM_END (512<<20) // Fixme: use OF */
27#define ONE_MB 0x100000
27 28
28static char *avail_ram; 29static char *avail_ram;
29static char *begin_avail, *end_avail; 30static char *begin_avail, *end_avail;
@@ -32,6 +33,7 @@ static unsigned int heap_use;
32static unsigned int heap_max; 33static unsigned int heap_max;
33 34
34extern char _start[]; 35extern char _start[];
36extern char _end[];
35extern char _vmlinux_start[]; 37extern char _vmlinux_start[];
36extern char _vmlinux_end[]; 38extern char _vmlinux_end[];
37extern char _initrd_start[]; 39extern char _initrd_start[];
@@ -58,13 +60,13 @@ typedef void (*kernel_entry_t)( unsigned long,
58 60
59#undef DEBUG 61#undef DEBUG
60 62
61static unsigned long claim_base = PROG_START; 63static unsigned long claim_base;
62 64
63static unsigned long try_claim(unsigned long size) 65static unsigned long try_claim(unsigned long size)
64{ 66{
65 unsigned long addr = 0; 67 unsigned long addr = 0;
66 68
67 for(; claim_base < RAM_END; claim_base += 0x100000) { 69 for(; claim_base < RAM_END; claim_base += ONE_MB) {
68#ifdef DEBUG 70#ifdef DEBUG
69 printf(" trying: 0x%08lx\n\r", claim_base); 71 printf(" trying: 0x%08lx\n\r", claim_base);
70#endif 72#endif
@@ -95,7 +97,26 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
95 if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4) 97 if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4)
96 exit(); 98 exit();
97 99
98 printf("\n\rzImage starting: loaded at 0x%x\n\r", (unsigned)_start); 100 printf("\n\rzImage starting: loaded at 0x%lx\n\r", (unsigned long) _start);
101
102 /*
103 * The first available claim_base must be above the end of the
104 * the loaded kernel wrapper file (_start to _end includes the
105 * initrd image if it is present) and rounded up to a nice
106 * 1 MB boundary for good measure.
107 */
108
109 claim_base = _ALIGN_UP((unsigned long)_end, ONE_MB);
110
111#if defined(PROG_START)
112 /*
113 * Maintain a "magic" minimum address. This keeps some older
114 * firmware platforms running.
115 */
116
117 if (claim_base < PROG_START)
118 claim_base = PROG_START;
119#endif
99 120
100 /* 121 /*
101 * Now we try to claim some memory for the kernel itself 122 * Now we try to claim some memory for the kernel itself
@@ -105,7 +126,7 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
105 * size... In practice we add 1Mb, that is enough, but we should really 126 * size... In practice we add 1Mb, that is enough, but we should really
106 * consider fixing the Makefile to put a _raw_ kernel in there ! 127 * consider fixing the Makefile to put a _raw_ kernel in there !
107 */ 128 */
108 vmlinux_memsize += 0x100000; 129 vmlinux_memsize += ONE_MB;
109 printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux_memsize); 130 printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux_memsize);
110 vmlinux.addr = try_claim(vmlinux_memsize); 131 vmlinux.addr = try_claim(vmlinux_memsize);
111 if (vmlinux.addr == 0) { 132 if (vmlinux.addr == 0) {
diff --git a/arch/ppc64/kernel/bpa_iic.c b/arch/ppc64/kernel/bpa_iic.c
index c8f3dc3fad70..0aaa878e19d3 100644
--- a/arch/ppc64/kernel/bpa_iic.c
+++ b/arch/ppc64/kernel/bpa_iic.c
@@ -205,6 +205,18 @@ static struct iic_regs __iomem *find_iic(int cpu)
205} 205}
206 206
207#ifdef CONFIG_SMP 207#ifdef CONFIG_SMP
208
209/* Use the highest interrupt priorities for IPI */
210static inline int iic_ipi_to_irq(int ipi)
211{
212 return IIC_IPI_OFFSET + IIC_NUM_IPIS - 1 - ipi;
213}
214
215static inline int iic_irq_to_ipi(int irq)
216{
217 return IIC_NUM_IPIS - 1 - (irq - IIC_IPI_OFFSET);
218}
219
208void iic_setup_cpu(void) 220void iic_setup_cpu(void)
209{ 221{
210 out_be64(&__get_cpu_var(iic).regs->prio, 0xff); 222 out_be64(&__get_cpu_var(iic).regs->prio, 0xff);
@@ -212,18 +224,20 @@ void iic_setup_cpu(void)
212 224
213void iic_cause_IPI(int cpu, int mesg) 225void iic_cause_IPI(int cpu, int mesg)
214{ 226{
215 out_be64(&per_cpu(iic, cpu).regs->generate, mesg); 227 out_be64(&per_cpu(iic, cpu).regs->generate, (IIC_NUM_IPIS - 1 - mesg) << 4);
216} 228}
217 229
218static irqreturn_t iic_ipi_action(int irq, void *dev_id, struct pt_regs *regs) 230static irqreturn_t iic_ipi_action(int irq, void *dev_id, struct pt_regs *regs)
219{ 231{
220 232 smp_message_recv(iic_irq_to_ipi(irq), regs);
221 smp_message_recv(irq - IIC_IPI_OFFSET, regs);
222 return IRQ_HANDLED; 233 return IRQ_HANDLED;
223} 234}
224 235
225static void iic_request_ipi(int irq, const char *name) 236static void iic_request_ipi(int ipi, const char *name)
226{ 237{
238 int irq;
239
240 irq = iic_ipi_to_irq(ipi);
227 /* IPIs are marked SA_INTERRUPT as they must run with irqs 241 /* IPIs are marked SA_INTERRUPT as they must run with irqs
228 * disabled */ 242 * disabled */
229 get_irq_desc(irq)->handler = &iic_pic; 243 get_irq_desc(irq)->handler = &iic_pic;
@@ -233,10 +247,10 @@ static void iic_request_ipi(int irq, const char *name)
233 247
234void iic_request_IPIs(void) 248void iic_request_IPIs(void)
235{ 249{
236 iic_request_ipi(IIC_IPI_OFFSET + PPC_MSG_CALL_FUNCTION, "IPI-call"); 250 iic_request_ipi(PPC_MSG_CALL_FUNCTION, "IPI-call");
237 iic_request_ipi(IIC_IPI_OFFSET + PPC_MSG_RESCHEDULE, "IPI-resched"); 251 iic_request_ipi(PPC_MSG_RESCHEDULE, "IPI-resched");
238#ifdef CONFIG_DEBUGGER 252#ifdef CONFIG_DEBUGGER
239 iic_request_ipi(IIC_IPI_OFFSET + PPC_MSG_DEBUGGER_BREAK, "IPI-debug"); 253 iic_request_ipi(PPC_MSG_DEBUGGER_BREAK, "IPI-debug");
240#endif /* CONFIG_DEBUGGER */ 254#endif /* CONFIG_DEBUGGER */
241} 255}
242#endif /* CONFIG_SMP */ 256#endif /* CONFIG_SMP */
diff --git a/arch/ppc64/kernel/eeh.c b/arch/ppc64/kernel/eeh.c
index af5272fedadf..ba93fd731222 100644
--- a/arch/ppc64/kernel/eeh.c
+++ b/arch/ppc64/kernel/eeh.c
@@ -202,10 +202,9 @@ static void pci_addr_cache_print(struct pci_io_addr_cache *cache)
202 while (n) { 202 while (n) {
203 struct pci_io_addr_range *piar; 203 struct pci_io_addr_range *piar;
204 piar = rb_entry(n, struct pci_io_addr_range, rb_node); 204 piar = rb_entry(n, struct pci_io_addr_range, rb_node);
205 printk(KERN_DEBUG "PCI: %s addr range %d [%lx-%lx]: %s %s\n", 205 printk(KERN_DEBUG "PCI: %s addr range %d [%lx-%lx]: %s\n",
206 (piar->flags & IORESOURCE_IO) ? "i/o" : "mem", cnt, 206 (piar->flags & IORESOURCE_IO) ? "i/o" : "mem", cnt,
207 piar->addr_lo, piar->addr_hi, pci_name(piar->pcidev), 207 piar->addr_lo, piar->addr_hi, pci_name(piar->pcidev));
208 pci_pretty_name(piar->pcidev));
209 cnt++; 208 cnt++;
210 n = rb_next(n); 209 n = rb_next(n);
211 } 210 }
@@ -255,22 +254,24 @@ pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo,
255static void __pci_addr_cache_insert_device(struct pci_dev *dev) 254static void __pci_addr_cache_insert_device(struct pci_dev *dev)
256{ 255{
257 struct device_node *dn; 256 struct device_node *dn;
257 struct pci_dn *pdn;
258 int i; 258 int i;
259 int inserted = 0; 259 int inserted = 0;
260 260
261 dn = pci_device_to_OF_node(dev); 261 dn = pci_device_to_OF_node(dev);
262 if (!dn) { 262 if (!dn) {
263 printk(KERN_WARNING "PCI: no pci dn found for dev=%s %s\n", 263 printk(KERN_WARNING "PCI: no pci dn found for dev=%s\n",
264 pci_name(dev), pci_pretty_name(dev)); 264 pci_name(dev));
265 return; 265 return;
266 } 266 }
267 267
268 /* Skip any devices for which EEH is not enabled. */ 268 /* Skip any devices for which EEH is not enabled. */
269 if (!(dn->eeh_mode & EEH_MODE_SUPPORTED) || 269 pdn = dn->data;
270 dn->eeh_mode & EEH_MODE_NOCHECK) { 270 if (!(pdn->eeh_mode & EEH_MODE_SUPPORTED) ||
271 pdn->eeh_mode & EEH_MODE_NOCHECK) {
271#ifdef DEBUG 272#ifdef DEBUG
272 printk(KERN_INFO "PCI: skip building address cache for=%s %s\n", 273 printk(KERN_INFO "PCI: skip building address cache for=%s\n",
273 pci_name(dev), pci_pretty_name(dev)); 274 pci_name(dev));
274#endif 275#endif
275 return; 276 return;
276 } 277 }
@@ -416,6 +417,7 @@ int eeh_unregister_notifier(struct notifier_block *nb)
416static int read_slot_reset_state(struct device_node *dn, int rets[]) 417static int read_slot_reset_state(struct device_node *dn, int rets[])
417{ 418{
418 int token, outputs; 419 int token, outputs;
420 struct pci_dn *pdn = dn->data;
419 421
420 if (ibm_read_slot_reset_state2 != RTAS_UNKNOWN_SERVICE) { 422 if (ibm_read_slot_reset_state2 != RTAS_UNKNOWN_SERVICE) {
421 token = ibm_read_slot_reset_state2; 423 token = ibm_read_slot_reset_state2;
@@ -425,8 +427,8 @@ static int read_slot_reset_state(struct device_node *dn, int rets[])
425 outputs = 3; 427 outputs = 3;
426 } 428 }
427 429
428 return rtas_call(token, 3, outputs, rets, dn->eeh_config_addr, 430 return rtas_call(token, 3, outputs, rets, pdn->eeh_config_addr,
429 BUID_HI(dn->phb->buid), BUID_LO(dn->phb->buid)); 431 BUID_HI(pdn->phb->buid), BUID_LO(pdn->phb->buid));
430} 432}
431 433
432/** 434/**
@@ -447,12 +449,12 @@ static void eeh_panic(struct pci_dev *dev, int reset_state)
447 * in light of potential corruption, we can use it here. 449 * in light of potential corruption, we can use it here.
448 */ 450 */
449 if (panic_on_oops) 451 if (panic_on_oops)
450 panic("EEH: MMIO failure (%d) on device:%s %s\n", reset_state, 452 panic("EEH: MMIO failure (%d) on device:%s\n", reset_state,
451 pci_name(dev), pci_pretty_name(dev)); 453 pci_name(dev));
452 else { 454 else {
453 __get_cpu_var(ignored_failures)++; 455 __get_cpu_var(ignored_failures)++;
454 printk(KERN_INFO "EEH: Ignored MMIO failure (%d) on device:%s %s\n", 456 printk(KERN_INFO "EEH: Ignored MMIO failure (%d) on device:%s\n",
455 reset_state, pci_name(dev), pci_pretty_name(dev)); 457 reset_state, pci_name(dev));
456 } 458 }
457} 459}
458 460
@@ -482,8 +484,8 @@ static void eeh_event_handler(void *dummy)
482 break; 484 break;
483 485
484 printk(KERN_INFO "EEH: MMIO failure (%d), notifiying device " 486 printk(KERN_INFO "EEH: MMIO failure (%d), notifiying device "
485 "%s %s\n", event->reset_state, 487 "%s\n", event->reset_state,
486 pci_name(event->dev), pci_pretty_name(event->dev)); 488 pci_name(event->dev));
487 489
488 atomic_set(&eeh_fail_count, 0); 490 atomic_set(&eeh_fail_count, 0);
489 notifier_call_chain (&eeh_notifier_chain, 491 notifier_call_chain (&eeh_notifier_chain,
@@ -535,6 +537,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
535 unsigned long flags; 537 unsigned long flags;
536 int rc, reset_state; 538 int rc, reset_state;
537 struct eeh_event *event; 539 struct eeh_event *event;
540 struct pci_dn *pdn;
538 541
539 __get_cpu_var(total_mmio_ffs)++; 542 __get_cpu_var(total_mmio_ffs)++;
540 543
@@ -543,14 +546,15 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
543 546
544 if (!dn) 547 if (!dn)
545 return 0; 548 return 0;
549 pdn = dn->data;
546 550
547 /* Access to IO BARs might get this far and still not want checking. */ 551 /* Access to IO BARs might get this far and still not want checking. */
548 if (!(dn->eeh_mode & EEH_MODE_SUPPORTED) || 552 if (!pdn->eeh_capable || !(pdn->eeh_mode & EEH_MODE_SUPPORTED) ||
549 dn->eeh_mode & EEH_MODE_NOCHECK) { 553 pdn->eeh_mode & EEH_MODE_NOCHECK) {
550 return 0; 554 return 0;
551 } 555 }
552 556
553 if (!dn->eeh_config_addr) { 557 if (!pdn->eeh_config_addr) {
554 return 0; 558 return 0;
555 } 559 }
556 560
@@ -558,7 +562,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
558 * If we already have a pending isolation event for this 562 * If we already have a pending isolation event for this
559 * slot, we know it's bad already, we don't need to check... 563 * slot, we know it's bad already, we don't need to check...
560 */ 564 */
561 if (dn->eeh_mode & EEH_MODE_ISOLATED) { 565 if (pdn->eeh_mode & EEH_MODE_ISOLATED) {
562 atomic_inc(&eeh_fail_count); 566 atomic_inc(&eeh_fail_count);
563 if (atomic_read(&eeh_fail_count) >= EEH_MAX_FAILS) { 567 if (atomic_read(&eeh_fail_count) >= EEH_MAX_FAILS) {
564 /* re-read the slot reset state */ 568 /* re-read the slot reset state */
@@ -583,7 +587,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
583 } 587 }
584 588
585 /* prevent repeated reports of this failure */ 589 /* prevent repeated reports of this failure */
586 dn->eeh_mode |= EEH_MODE_ISOLATED; 590 pdn->eeh_mode |= EEH_MODE_ISOLATED;
587 591
588 reset_state = rets[0]; 592 reset_state = rets[0];
589 593
@@ -591,9 +595,9 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
591 memset(slot_errbuf, 0, eeh_error_buf_size); 595 memset(slot_errbuf, 0, eeh_error_buf_size);
592 596
593 rc = rtas_call(ibm_slot_error_detail, 597 rc = rtas_call(ibm_slot_error_detail,
594 8, 1, NULL, dn->eeh_config_addr, 598 8, 1, NULL, pdn->eeh_config_addr,
595 BUID_HI(dn->phb->buid), 599 BUID_HI(pdn->phb->buid),
596 BUID_LO(dn->phb->buid), NULL, 0, 600 BUID_LO(pdn->phb->buid), NULL, 0,
597 virt_to_phys(slot_errbuf), 601 virt_to_phys(slot_errbuf),
598 eeh_error_buf_size, 602 eeh_error_buf_size,
599 1 /* Temporary Error */); 603 1 /* Temporary Error */);
@@ -680,8 +684,9 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
680 u32 *device_id = (u32 *)get_property(dn, "device-id", NULL); 684 u32 *device_id = (u32 *)get_property(dn, "device-id", NULL);
681 u32 *regs; 685 u32 *regs;
682 int enable; 686 int enable;
687 struct pci_dn *pdn = dn->data;
683 688
684 dn->eeh_mode = 0; 689 pdn->eeh_mode = 0;
685 690
686 if (status && strcmp(status, "ok") != 0) 691 if (status && strcmp(status, "ok") != 0)
687 return NULL; /* ignore devices with bad status */ 692 return NULL; /* ignore devices with bad status */
@@ -692,7 +697,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
692 697
693 /* There is nothing to check on PCI to ISA bridges */ 698 /* There is nothing to check on PCI to ISA bridges */
694 if (dn->type && !strcmp(dn->type, "isa")) { 699 if (dn->type && !strcmp(dn->type, "isa")) {
695 dn->eeh_mode |= EEH_MODE_NOCHECK; 700 pdn->eeh_mode |= EEH_MODE_NOCHECK;
696 return NULL; 701 return NULL;
697 } 702 }
698 703
@@ -709,7 +714,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
709 enable = 0; 714 enable = 0;
710 715
711 if (!enable) 716 if (!enable)
712 dn->eeh_mode |= EEH_MODE_NOCHECK; 717 pdn->eeh_mode |= EEH_MODE_NOCHECK;
713 718
714 /* Ok... see if this device supports EEH. Some do, some don't, 719 /* Ok... see if this device supports EEH. Some do, some don't,
715 * and the only way to find out is to check each and every one. */ 720 * and the only way to find out is to check each and every one. */
@@ -722,8 +727,8 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
722 EEH_ENABLE); 727 EEH_ENABLE);
723 if (ret == 0) { 728 if (ret == 0) {
724 eeh_subsystem_enabled = 1; 729 eeh_subsystem_enabled = 1;
725 dn->eeh_mode |= EEH_MODE_SUPPORTED; 730 pdn->eeh_mode |= EEH_MODE_SUPPORTED;
726 dn->eeh_config_addr = regs[0]; 731 pdn->eeh_config_addr = regs[0];
727#ifdef DEBUG 732#ifdef DEBUG
728 printk(KERN_DEBUG "EEH: %s: eeh enabled\n", dn->full_name); 733 printk(KERN_DEBUG "EEH: %s: eeh enabled\n", dn->full_name);
729#endif 734#endif
@@ -731,10 +736,11 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
731 736
732 /* This device doesn't support EEH, but it may have an 737 /* This device doesn't support EEH, but it may have an
733 * EEH parent, in which case we mark it as supported. */ 738 * EEH parent, in which case we mark it as supported. */
734 if (dn->parent && (dn->parent->eeh_mode & EEH_MODE_SUPPORTED)) { 739 if (dn->parent && dn->parent->data
740 && (PCI_DN(dn->parent)->eeh_mode & EEH_MODE_SUPPORTED)) {
735 /* Parent supports EEH. */ 741 /* Parent supports EEH. */
736 dn->eeh_mode |= EEH_MODE_SUPPORTED; 742 pdn->eeh_mode |= EEH_MODE_SUPPORTED;
737 dn->eeh_config_addr = dn->parent->eeh_config_addr; 743 pdn->eeh_config_addr = PCI_DN(dn->parent)->eeh_config_addr;
738 return NULL; 744 return NULL;
739 } 745 }
740 } 746 }
@@ -791,11 +797,13 @@ void __init eeh_init(void)
791 for (phb = of_find_node_by_name(NULL, "pci"); phb; 797 for (phb = of_find_node_by_name(NULL, "pci"); phb;
792 phb = of_find_node_by_name(phb, "pci")) { 798 phb = of_find_node_by_name(phb, "pci")) {
793 unsigned long buid; 799 unsigned long buid;
800 struct pci_dn *pci;
794 801
795 buid = get_phb_buid(phb); 802 buid = get_phb_buid(phb);
796 if (buid == 0) 803 if (buid == 0 || phb->data == NULL)
797 continue; 804 continue;
798 805
806 pci = phb->data;
799 info.buid_lo = BUID_LO(buid); 807 info.buid_lo = BUID_LO(buid);
800 info.buid_hi = BUID_HI(buid); 808 info.buid_hi = BUID_HI(buid);
801 traverse_pci_devices(phb, early_enable_eeh, &info); 809 traverse_pci_devices(phb, early_enable_eeh, &info);
@@ -824,9 +832,9 @@ void eeh_add_device_early(struct device_node *dn)
824 struct pci_controller *phb; 832 struct pci_controller *phb;
825 struct eeh_early_enable_info info; 833 struct eeh_early_enable_info info;
826 834
827 if (!dn) 835 if (!dn || !dn->data)
828 return; 836 return;
829 phb = dn->phb; 837 phb = PCI_DN(dn)->phb;
830 if (NULL == phb || 0 == phb->buid) { 838 if (NULL == phb || 0 == phb->buid) {
831 printk(KERN_WARNING "EEH: Expected buid but found none\n"); 839 printk(KERN_WARNING "EEH: Expected buid but found none\n");
832 return; 840 return;
@@ -851,8 +859,7 @@ void eeh_add_device_late(struct pci_dev *dev)
851 return; 859 return;
852 860
853#ifdef DEBUG 861#ifdef DEBUG
854 printk(KERN_DEBUG "EEH: adding device %s %s\n", pci_name(dev), 862 printk(KERN_DEBUG "EEH: adding device %s\n", pci_name(dev));
855 pci_pretty_name(dev));
856#endif 863#endif
857 864
858 pci_addr_cache_insert_device (dev); 865 pci_addr_cache_insert_device (dev);
@@ -873,8 +880,7 @@ void eeh_remove_device(struct pci_dev *dev)
873 880
874 /* Unregister the device with the EEH/PCI address search system */ 881 /* Unregister the device with the EEH/PCI address search system */
875#ifdef DEBUG 882#ifdef DEBUG
876 printk(KERN_DEBUG "EEH: remove device %s %s\n", pci_name(dev), 883 printk(KERN_DEBUG "EEH: remove device %s\n", pci_name(dev));
877 pci_pretty_name(dev));
878#endif 884#endif
879 pci_addr_cache_remove_device(dev); 885 pci_addr_cache_remove_device(dev);
880} 886}
diff --git a/arch/ppc64/kernel/iSeries_VpdInfo.c b/arch/ppc64/kernel/iSeries_VpdInfo.c
index d11c732daf81..5d921792571f 100644
--- a/arch/ppc64/kernel/iSeries_VpdInfo.c
+++ b/arch/ppc64/kernel/iSeries_VpdInfo.c
@@ -264,8 +264,5 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
264 printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, Card %4s ", 264 printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, Card %4s ",
265 count, bus, PCI_SLOT(PciDev->devfn), PciDev->vendor, 265 count, bus, PCI_SLOT(PciDev->devfn), PciDev->vendor,
266 frame, card); 266 frame, card);
267 if (pci_class_name(PciDev->class >> 8) == 0) 267 printk("0x%04X\n", (int)(PciDev->class >> 8));
268 printk("0x%04X\n", (int)(PciDev->class >> 8));
269 else
270 printk("%s\n", pci_class_name(PciDev->class >> 8));
271} 268}
diff --git a/arch/ppc64/kernel/iomap.c b/arch/ppc64/kernel/iomap.c
index 153cc8b0f136..6160c8dbb7c5 100644
--- a/arch/ppc64/kernel/iomap.c
+++ b/arch/ppc64/kernel/iomap.c
@@ -22,13 +22,23 @@ unsigned int fastcall ioread16(void __iomem *addr)
22{ 22{
23 return readw(addr); 23 return readw(addr);
24} 24}
25unsigned int fastcall ioread16be(void __iomem *addr)
26{
27 return in_be16(addr);
28}
25unsigned int fastcall ioread32(void __iomem *addr) 29unsigned int fastcall ioread32(void __iomem *addr)
26{ 30{
27 return readl(addr); 31 return readl(addr);
28} 32}
33unsigned int fastcall ioread32be(void __iomem *addr)
34{
35 return in_be32(addr);
36}
29EXPORT_SYMBOL(ioread8); 37EXPORT_SYMBOL(ioread8);
30EXPORT_SYMBOL(ioread16); 38EXPORT_SYMBOL(ioread16);
39EXPORT_SYMBOL(ioread16be);
31EXPORT_SYMBOL(ioread32); 40EXPORT_SYMBOL(ioread32);
41EXPORT_SYMBOL(ioread32be);
32 42
33void fastcall iowrite8(u8 val, void __iomem *addr) 43void fastcall iowrite8(u8 val, void __iomem *addr)
34{ 44{
@@ -38,13 +48,23 @@ void fastcall iowrite16(u16 val, void __iomem *addr)
38{ 48{
39 writew(val, addr); 49 writew(val, addr);
40} 50}
51void fastcall iowrite16be(u16 val, void __iomem *addr)
52{
53 out_be16(addr, val);
54}
41void fastcall iowrite32(u32 val, void __iomem *addr) 55void fastcall iowrite32(u32 val, void __iomem *addr)
42{ 56{
43 writel(val, addr); 57 writel(val, addr);
44} 58}
59void fastcall iowrite32be(u32 val, void __iomem *addr)
60{
61 out_be32(addr, val);
62}
45EXPORT_SYMBOL(iowrite8); 63EXPORT_SYMBOL(iowrite8);
46EXPORT_SYMBOL(iowrite16); 64EXPORT_SYMBOL(iowrite16);
65EXPORT_SYMBOL(iowrite16be);
47EXPORT_SYMBOL(iowrite32); 66EXPORT_SYMBOL(iowrite32);
67EXPORT_SYMBOL(iowrite32be);
48 68
49/* 69/*
50 * These are the "repeat read/write" functions. Note the 70 * These are the "repeat read/write" functions. Note the
@@ -56,15 +76,15 @@ EXPORT_SYMBOL(iowrite32);
56 */ 76 */
57void ioread8_rep(void __iomem *addr, void *dst, unsigned long count) 77void ioread8_rep(void __iomem *addr, void *dst, unsigned long count)
58{ 78{
59 _insb((u8 __force *) addr, dst, count); 79 _insb((u8 __iomem *) addr, dst, count);
60} 80}
61void ioread16_rep(void __iomem *addr, void *dst, unsigned long count) 81void ioread16_rep(void __iomem *addr, void *dst, unsigned long count)
62{ 82{
63 _insw_ns((u16 __force *) addr, dst, count); 83 _insw_ns((u16 __iomem *) addr, dst, count);
64} 84}
65void ioread32_rep(void __iomem *addr, void *dst, unsigned long count) 85void ioread32_rep(void __iomem *addr, void *dst, unsigned long count)
66{ 86{
67 _insl_ns((u32 __force *) addr, dst, count); 87 _insl_ns((u32 __iomem *) addr, dst, count);
68} 88}
69EXPORT_SYMBOL(ioread8_rep); 89EXPORT_SYMBOL(ioread8_rep);
70EXPORT_SYMBOL(ioread16_rep); 90EXPORT_SYMBOL(ioread16_rep);
@@ -72,15 +92,15 @@ EXPORT_SYMBOL(ioread32_rep);
72 92
73void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count) 93void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count)
74{ 94{
75 _outsb((u8 __force *) addr, src, count); 95 _outsb((u8 __iomem *) addr, src, count);
76} 96}
77void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count) 97void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count)
78{ 98{
79 _outsw_ns((u16 __force *) addr, src, count); 99 _outsw_ns((u16 __iomem *) addr, src, count);
80} 100}
81void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count) 101void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count)
82{ 102{
83 _outsl_ns((u32 __force *) addr, src, count); 103 _outsl_ns((u32 __iomem *) addr, src, count);
84} 104}
85EXPORT_SYMBOL(iowrite8_rep); 105EXPORT_SYMBOL(iowrite8_rep);
86EXPORT_SYMBOL(iowrite16_rep); 106EXPORT_SYMBOL(iowrite16_rep);
diff --git a/arch/ppc64/kernel/iommu.c b/arch/ppc64/kernel/iommu.c
index 845eebd1e28d..9032b6bfe036 100644
--- a/arch/ppc64/kernel/iommu.c
+++ b/arch/ppc64/kernel/iommu.c
@@ -438,7 +438,8 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl)
438 438
439void iommu_free_table(struct device_node *dn) 439void iommu_free_table(struct device_node *dn)
440{ 440{
441 struct iommu_table *tbl = dn->iommu_table; 441 struct pci_dn *pdn = dn->data;
442 struct iommu_table *tbl = pdn->iommu_table;
442 unsigned long bitmap_sz, i; 443 unsigned long bitmap_sz, i;
443 unsigned int order; 444 unsigned int order;
444 445
diff --git a/arch/ppc64/kernel/maple_pci.c b/arch/ppc64/kernel/maple_pci.c
index 53993999b265..5a8b4d8c2dd6 100644
--- a/arch/ppc64/kernel/maple_pci.c
+++ b/arch/ppc64/kernel/maple_pci.c
@@ -447,9 +447,9 @@ void __init maple_pci_init(void)
447 */ 447 */
448 if (u3_agp) { 448 if (u3_agp) {
449 struct device_node *np = u3_agp->arch_data; 449 struct device_node *np = u3_agp->arch_data;
450 np->busno = 0xf0; 450 PCI_DN(np)->busno = 0xf0;
451 for (np = np->child; np; np = np->sibling) 451 for (np = np->child; np; np = np->sibling)
452 np->busno = 0xf0; 452 PCI_DN(np)->busno = 0xf0;
453 } 453 }
454 454
455 /* Tell pci.c to use the common resource allocation mecanism */ 455 /* Tell pci.c to use the common resource allocation mecanism */
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index 757903544e24..e7241ad80a08 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -1431,9 +1431,9 @@ _GLOBAL(sys_call_table)
1431 .llong .sys_ni_syscall /* 195 - 32bit only stat64 */ 1431 .llong .sys_ni_syscall /* 195 - 32bit only stat64 */
1432 .llong .sys_ni_syscall /* 32bit only lstat64 */ 1432 .llong .sys_ni_syscall /* 32bit only lstat64 */
1433 .llong .sys_ni_syscall /* 32bit only fstat64 */ 1433 .llong .sys_ni_syscall /* 32bit only fstat64 */
1434 .llong .sys_ni_syscall /* 32bit only pciconfig_read */ 1434 .llong .sys_pciconfig_read
1435 .llong .sys_ni_syscall /* 32bit only pciconfig_write */ 1435 .llong .sys_pciconfig_write
1436 .llong .sys_ni_syscall /* 32bit only pciconfig_iobase */ 1436 .llong .sys_pciconfig_iobase /* 200 - pciconfig_iobase */
1437 .llong .sys_ni_syscall /* reserved for MacOnLinux */ 1437 .llong .sys_ni_syscall /* reserved for MacOnLinux */
1438 .llong .sys_getdents64 1438 .llong .sys_getdents64
1439 .llong .sys_pivot_root 1439 .llong .sys_pivot_root
diff --git a/arch/ppc64/kernel/pSeries_iommu.c b/arch/ppc64/kernel/pSeries_iommu.c
index 9d5e1e7fc389..f0fd7fbd6531 100644
--- a/arch/ppc64/kernel/pSeries_iommu.c
+++ b/arch/ppc64/kernel/pSeries_iommu.c
@@ -295,7 +295,7 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,
295 struct iommu_table *tbl, 295 struct iommu_table *tbl,
296 unsigned int *dma_window) 296 unsigned int *dma_window)
297{ 297{
298 tbl->it_busno = dn->bussubno; 298 tbl->it_busno = PCI_DN(dn)->bussubno;
299 299
300 /* TODO: Parse field size properties properly. */ 300 /* TODO: Parse field size properties properly. */
301 tbl->it_size = (((unsigned long)dma_window[4] << 32) | 301 tbl->it_size = (((unsigned long)dma_window[4] << 32) |
@@ -311,6 +311,7 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,
311static void iommu_bus_setup_pSeries(struct pci_bus *bus) 311static void iommu_bus_setup_pSeries(struct pci_bus *bus)
312{ 312{
313 struct device_node *dn, *pdn; 313 struct device_node *dn, *pdn;
314 struct pci_dn *pci;
314 struct iommu_table *tbl; 315 struct iommu_table *tbl;
315 316
316 DBG("iommu_bus_setup_pSeries, bus %p, bus->self %p\n", bus, bus->self); 317 DBG("iommu_bus_setup_pSeries, bus %p, bus->self %p\n", bus, bus->self);
@@ -325,6 +326,7 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus)
325 */ 326 */
326 327
327 dn = pci_bus_to_OF_node(bus); 328 dn = pci_bus_to_OF_node(bus);
329 pci = dn->data;
328 330
329 if (!bus->self) { 331 if (!bus->self) {
330 /* Root bus */ 332 /* Root bus */
@@ -341,18 +343,18 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus)
341 * alltogether. This leaves 768MB for the window. 343 * alltogether. This leaves 768MB for the window.
342 */ 344 */
343 DBG("PHB has io-hole, reserving 256MB\n"); 345 DBG("PHB has io-hole, reserving 256MB\n");
344 dn->phb->dma_window_size = 3 << 28; 346 pci->phb->dma_window_size = 3 << 28;
345 dn->phb->dma_window_base_cur = 1 << 28; 347 pci->phb->dma_window_base_cur = 1 << 28;
346 } else { 348 } else {
347 /* 1GB window by default */ 349 /* 1GB window by default */
348 dn->phb->dma_window_size = 1 << 30; 350 pci->phb->dma_window_size = 1 << 30;
349 dn->phb->dma_window_base_cur = 0; 351 pci->phb->dma_window_base_cur = 0;
350 } 352 }
351 353
352 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); 354 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
353 355
354 iommu_table_setparms(dn->phb, dn, tbl); 356 iommu_table_setparms(pci->phb, dn, tbl);
355 dn->iommu_table = iommu_init_table(tbl); 357 pci->iommu_table = iommu_init_table(tbl);
356 } else { 358 } else {
357 /* Do a 128MB table at root. This is used for the IDE 359 /* Do a 128MB table at root. This is used for the IDE
358 * controller on some SMP-mode POWER4 machines. It 360 * controller on some SMP-mode POWER4 machines. It
@@ -363,16 +365,16 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus)
363 * Allocate at offset 128MB to avoid having to deal 365 * Allocate at offset 128MB to avoid having to deal
364 * with ISA holes; 128MB table for IDE is plenty. 366 * with ISA holes; 128MB table for IDE is plenty.
365 */ 367 */
366 dn->phb->dma_window_size = 1 << 27; 368 pci->phb->dma_window_size = 1 << 27;
367 dn->phb->dma_window_base_cur = 1 << 27; 369 pci->phb->dma_window_base_cur = 1 << 27;
368 370
369 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); 371 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
370 372
371 iommu_table_setparms(dn->phb, dn, tbl); 373 iommu_table_setparms(pci->phb, dn, tbl);
372 dn->iommu_table = iommu_init_table(tbl); 374 pci->iommu_table = iommu_init_table(tbl);
373 375
374 /* All child buses have 256MB tables */ 376 /* All child buses have 256MB tables */
375 dn->phb->dma_window_size = 1 << 28; 377 pci->phb->dma_window_size = 1 << 28;
376 } 378 }
377 } else { 379 } else {
378 pdn = pci_bus_to_OF_node(bus->parent); 380 pdn = pci_bus_to_OF_node(bus->parent);
@@ -386,12 +388,12 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus)
386 388
387 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); 389 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
388 390
389 iommu_table_setparms(dn->phb, dn, tbl); 391 iommu_table_setparms(pci->phb, dn, tbl);
390 392
391 dn->iommu_table = iommu_init_table(tbl); 393 pci->iommu_table = iommu_init_table(tbl);
392 } else { 394 } else {
393 /* Lower than first child or under python, use parent table */ 395 /* Lower than first child or under python, use parent table */
394 dn->iommu_table = pdn->iommu_table; 396 pci->iommu_table = PCI_DN(pdn)->iommu_table;
395 } 397 }
396 } 398 }
397} 399}
@@ -401,6 +403,7 @@ static void iommu_bus_setup_pSeriesLP(struct pci_bus *bus)
401{ 403{
402 struct iommu_table *tbl; 404 struct iommu_table *tbl;
403 struct device_node *dn, *pdn; 405 struct device_node *dn, *pdn;
406 struct pci_dn *ppci;
404 unsigned int *dma_window = NULL; 407 unsigned int *dma_window = NULL;
405 408
406 DBG("iommu_bus_setup_pSeriesLP, bus %p, bus->self %p\n", bus, bus->self); 409 DBG("iommu_bus_setup_pSeriesLP, bus %p, bus->self %p\n", bus, bus->self);
@@ -419,22 +422,24 @@ static void iommu_bus_setup_pSeriesLP(struct pci_bus *bus)
419 return; 422 return;
420 } 423 }
421 424
422 if (!pdn->iommu_table) { 425 ppci = pdn->data;
426 if (!ppci->iommu_table) {
423 /* Bussubno hasn't been copied yet. 427 /* Bussubno hasn't been copied yet.
424 * Do it now because iommu_table_setparms_lpar needs it. 428 * Do it now because iommu_table_setparms_lpar needs it.
425 */ 429 */
426 pdn->bussubno = bus->number; 430
431 ppci->bussubno = bus->number;
427 432
428 tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table), 433 tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table),
429 GFP_KERNEL); 434 GFP_KERNEL);
430 435
431 iommu_table_setparms_lpar(pdn->phb, pdn, tbl, dma_window); 436 iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window);
432 437
433 pdn->iommu_table = iommu_init_table(tbl); 438 ppci->iommu_table = iommu_init_table(tbl);
434 } 439 }
435 440
436 if (pdn != dn) 441 if (pdn != dn)
437 dn->iommu_table = pdn->iommu_table; 442 PCI_DN(dn)->iommu_table = ppci->iommu_table;
438} 443}
439 444
440 445
@@ -449,11 +454,11 @@ static void iommu_dev_setup_pSeries(struct pci_dev *dev)
449 */ 454 */
450 mydn = dn = pci_device_to_OF_node(dev); 455 mydn = dn = pci_device_to_OF_node(dev);
451 456
452 while (dn && dn->iommu_table == NULL) 457 while (dn && dn->data && PCI_DN(dn)->iommu_table == NULL)
453 dn = dn->parent; 458 dn = dn->parent;
454 459
455 if (dn) { 460 if (dn && dn->data) {
456 mydn->iommu_table = dn->iommu_table; 461 PCI_DN(mydn)->iommu_table = PCI_DN(dn)->iommu_table;
457 } else { 462 } else {
458 DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, dev->pretty_name); 463 DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, dev->pretty_name);
459 } 464 }
@@ -463,10 +468,11 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti
463{ 468{
464 int err = NOTIFY_OK; 469 int err = NOTIFY_OK;
465 struct device_node *np = node; 470 struct device_node *np = node;
471 struct pci_dn *pci = np->data;
466 472
467 switch (action) { 473 switch (action) {
468 case PSERIES_RECONFIG_REMOVE: 474 case PSERIES_RECONFIG_REMOVE:
469 if (np->iommu_table && 475 if (pci->iommu_table &&
470 get_property(np, "ibm,dma-window", NULL)) 476 get_property(np, "ibm,dma-window", NULL))
471 iommu_free_table(np); 477 iommu_free_table(np);
472 break; 478 break;
@@ -486,6 +492,7 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
486 struct device_node *pdn, *dn; 492 struct device_node *pdn, *dn;
487 struct iommu_table *tbl; 493 struct iommu_table *tbl;
488 int *dma_window = NULL; 494 int *dma_window = NULL;
495 struct pci_dn *pci;
489 496
490 DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, dev->pretty_name); 497 DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, dev->pretty_name);
491 498
@@ -497,8 +504,10 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
497 */ 504 */
498 dn = pci_device_to_OF_node(dev); 505 dn = pci_device_to_OF_node(dev);
499 506
500 for (pdn = dn; pdn && !pdn->iommu_table; pdn = pdn->parent) { 507 for (pdn = dn; pdn && pdn->data && !PCI_DN(pdn)->iommu_table;
501 dma_window = (unsigned int *)get_property(pdn, "ibm,dma-window", NULL); 508 pdn = pdn->parent) {
509 dma_window = (unsigned int *)
510 get_property(pdn, "ibm,dma-window", NULL);
502 if (dma_window) 511 if (dma_window)
503 break; 512 break;
504 } 513 }
@@ -515,20 +524,21 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
515 DBG("Found DMA window, allocating table\n"); 524 DBG("Found DMA window, allocating table\n");
516 } 525 }
517 526
518 if (!pdn->iommu_table) { 527 pci = pdn->data;
528 if (!pci->iommu_table) {
519 /* iommu_table_setparms_lpar needs bussubno. */ 529 /* iommu_table_setparms_lpar needs bussubno. */
520 pdn->bussubno = pdn->phb->bus->number; 530 pci->bussubno = pci->phb->bus->number;
521 531
522 tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table), 532 tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table),
523 GFP_KERNEL); 533 GFP_KERNEL);
524 534
525 iommu_table_setparms_lpar(pdn->phb, pdn, tbl, dma_window); 535 iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window);
526 536
527 pdn->iommu_table = iommu_init_table(tbl); 537 pci->iommu_table = iommu_init_table(tbl);
528 } 538 }
529 539
530 if (pdn != dn) 540 if (pdn != dn)
531 dn->iommu_table = pdn->iommu_table; 541 PCI_DN(dn)->iommu_table = pci->iommu_table;
532} 542}
533 543
534static void iommu_bus_setup_null(struct pci_bus *b) { } 544static void iommu_bus_setup_null(struct pci_bus *b) { }
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index d0d55c7908ef..8447dcc2c2b3 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -21,6 +21,7 @@
21#include <linux/bootmem.h> 21#include <linux/bootmem.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/list.h> 23#include <linux/list.h>
24#include <linux/syscalls.h>
24 25
25#include <asm/processor.h> 26#include <asm/processor.h>
26#include <asm/io.h> 27#include <asm/io.h>
@@ -84,7 +85,6 @@ static void fixup_broken_pcnet32(struct pci_dev* dev)
84 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) { 85 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
85 dev->vendor = PCI_VENDOR_ID_AMD; 86 dev->vendor = PCI_VENDOR_ID_AMD;
86 pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD); 87 pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
87 pci_name_device(dev);
88 } 88 }
89} 89}
90DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32); 90DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
@@ -838,9 +838,11 @@ int pcibios_scan_all_fns(struct pci_bus *bus, int devfn)
838 * device tree. If they are then we need to scan all the 838 * device tree. If they are then we need to scan all the
839 * functions of this slot. 839 * functions of this slot.
840 */ 840 */
841 for (dn = busdn->child; dn; dn = dn->sibling) 841 for (dn = busdn->child; dn; dn = dn->sibling) {
842 if ((dn->devfn >> 3) == (devfn >> 3)) 842 struct pci_dn *pdn = dn->data;
843 if (pdn && (pdn->devfn >> 3) == (devfn >> 3))
843 return 1; 844 return 1;
845 }
844 846
845 return 0; 847 return 0;
846} 848}
@@ -983,3 +985,62 @@ void pci_resource_to_user(const struct pci_dev *dev, int bar,
983} 985}
984 986
985#endif /* CONFIG_PPC_MULTIPLATFORM */ 987#endif /* CONFIG_PPC_MULTIPLATFORM */
988
989
990#define IOBASE_BRIDGE_NUMBER 0
991#define IOBASE_MEMORY 1
992#define IOBASE_IO 2
993#define IOBASE_ISA_IO 3
994#define IOBASE_ISA_MEM 4
995
996long sys_pciconfig_iobase(long which, unsigned long in_bus,
997 unsigned long in_devfn)
998{
999 struct pci_controller* hose;
1000 struct list_head *ln;
1001 struct pci_bus *bus = NULL;
1002 struct device_node *hose_node;
1003
1004 /* Argh ! Please forgive me for that hack, but that's the
1005 * simplest way to get existing XFree to not lockup on some
1006 * G5 machines... So when something asks for bus 0 io base
1007 * (bus 0 is HT root), we return the AGP one instead.
1008 */
1009#ifdef CONFIG_PPC_PMAC
1010 if (systemcfg->platform == PLATFORM_POWERMAC &&
1011 machine_is_compatible("MacRISC4"))
1012 if (in_bus == 0)
1013 in_bus = 0xf0;
1014#endif /* CONFIG_PPC_PMAC */
1015
1016 /* That syscall isn't quite compatible with PCI domains, but it's
1017 * used on pre-domains setup. We return the first match
1018 */
1019
1020 for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
1021 bus = pci_bus_b(ln);
1022 if (in_bus >= bus->number && in_bus < (bus->number + bus->subordinate))
1023 break;
1024 bus = NULL;
1025 }
1026 if (bus == NULL || bus->sysdata == NULL)
1027 return -ENODEV;
1028
1029 hose_node = (struct device_node *)bus->sysdata;
1030 hose = PCI_DN(hose_node)->phb;
1031
1032 switch (which) {
1033 case IOBASE_BRIDGE_NUMBER:
1034 return (long)hose->first_busno;
1035 case IOBASE_MEMORY:
1036 return (long)hose->pci_mem_offset;
1037 case IOBASE_IO:
1038 return (long)hose->io_base_phys;
1039 case IOBASE_ISA_IO:
1040 return (long)isa_io_base;
1041 case IOBASE_ISA_MEM:
1042 return -EINVAL;
1043 }
1044
1045 return -EOPNOTSUPP;
1046}
diff --git a/arch/ppc64/kernel/pci.h b/arch/ppc64/kernel/pci.h
index 26be78b13af1..5eb2cc320566 100644
--- a/arch/ppc64/kernel/pci.h
+++ b/arch/ppc64/kernel/pci.h
@@ -34,7 +34,6 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
34 34
35void pci_devs_phb_init(void); 35void pci_devs_phb_init(void);
36void pci_devs_phb_init_dynamic(struct pci_controller *phb); 36void pci_devs_phb_init_dynamic(struct pci_controller *phb);
37struct device_node *fetch_dev_dn(struct pci_dev *dev);
38 37
39/* PCI address cache management routines */ 38/* PCI address cache management routines */
40void pci_addr_cache_insert_device(struct pci_dev *dev); 39void pci_addr_cache_insert_device(struct pci_dev *dev);
diff --git a/arch/ppc64/kernel/pci_dn.c b/arch/ppc64/kernel/pci_dn.c
index ec345462afc3..a86389d07d57 100644
--- a/arch/ppc64/kernel/pci_dn.c
+++ b/arch/ppc64/kernel/pci_dn.c
@@ -23,6 +23,8 @@
23#include <linux/pci.h> 23#include <linux/pci.h>
24#include <linux/string.h> 24#include <linux/string.h>
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/slab.h>
27#include <linux/bootmem.h>
26 28
27#include <asm/io.h> 29#include <asm/io.h>
28#include <asm/prom.h> 30#include <asm/prom.h>
@@ -40,16 +42,26 @@ static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
40 struct pci_controller *phb = data; 42 struct pci_controller *phb = data;
41 int *type = (int *)get_property(dn, "ibm,pci-config-space-type", NULL); 43 int *type = (int *)get_property(dn, "ibm,pci-config-space-type", NULL);
42 u32 *regs; 44 u32 *regs;
43 45 struct pci_dn *pdn;
44 dn->phb = phb; 46
47 if (phb->is_dynamic)
48 pdn = kmalloc(sizeof(*pdn), GFP_KERNEL);
49 else
50 pdn = alloc_bootmem(sizeof(*pdn));
51 if (pdn == NULL)
52 return NULL;
53 memset(pdn, 0, sizeof(*pdn));
54 dn->data = pdn;
55 pdn->node = dn;
56 pdn->phb = phb;
45 regs = (u32 *)get_property(dn, "reg", NULL); 57 regs = (u32 *)get_property(dn, "reg", NULL);
46 if (regs) { 58 if (regs) {
47 /* First register entry is addr (00BBSS00) */ 59 /* First register entry is addr (00BBSS00) */
48 dn->busno = (regs[0] >> 16) & 0xff; 60 pdn->busno = (regs[0] >> 16) & 0xff;
49 dn->devfn = (regs[0] >> 8) & 0xff; 61 pdn->devfn = (regs[0] >> 8) & 0xff;
50 } 62 }
51 63
52 dn->pci_ext_config_space = (type && *type == 1); 64 pdn->pci_ext_config_space = (type && *type == 1);
53 return NULL; 65 return NULL;
54} 66}
55 67
@@ -112,10 +124,15 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
112void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb) 124void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb)
113{ 125{
114 struct device_node * dn = (struct device_node *) phb->arch_data; 126 struct device_node * dn = (struct device_node *) phb->arch_data;
127 struct pci_dn *pdn;
115 128
116 /* PHB nodes themselves must not match */ 129 /* PHB nodes themselves must not match */
117 dn->devfn = dn->busno = -1; 130 update_dn_pci_info(dn, phb);
118 dn->phb = phb; 131 pdn = dn->data;
132 if (pdn) {
133 pdn->devfn = pdn->busno = -1;
134 pdn->phb = phb;
135 }
119 136
120 /* Update dn->phb ptrs for new phb and children devices */ 137 /* Update dn->phb ptrs for new phb and children devices */
121 traverse_pci_devices(dn, update_dn_pci_info, phb); 138 traverse_pci_devices(dn, update_dn_pci_info, phb);
@@ -123,14 +140,17 @@ void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb)
123 140
124/* 141/*
125 * Traversal func that looks for a <busno,devfcn> value. 142 * Traversal func that looks for a <busno,devfcn> value.
126 * If found, the device_node is returned (thus terminating the traversal). 143 * If found, the pci_dn is returned (thus terminating the traversal).
127 */ 144 */
128static void *is_devfn_node(struct device_node *dn, void *data) 145static void *is_devfn_node(struct device_node *dn, void *data)
129{ 146{
130 int busno = ((unsigned long)data >> 8) & 0xff; 147 int busno = ((unsigned long)data >> 8) & 0xff;
131 int devfn = ((unsigned long)data) & 0xff; 148 int devfn = ((unsigned long)data) & 0xff;
149 struct pci_dn *pci = dn->data;
132 150
133 return ((devfn == dn->devfn) && (busno == dn->busno)) ? dn : NULL; 151 if (pci && (devfn == pci->devfn) && (busno == pci->busno))
152 return dn;
153 return NULL;
134} 154}
135 155
136/* 156/*
@@ -149,13 +169,10 @@ static void *is_devfn_node(struct device_node *dn, void *data)
149struct device_node *fetch_dev_dn(struct pci_dev *dev) 169struct device_node *fetch_dev_dn(struct pci_dev *dev)
150{ 170{
151 struct device_node *orig_dn = dev->sysdata; 171 struct device_node *orig_dn = dev->sysdata;
152 struct pci_controller *phb = orig_dn->phb; /* assume same phb as orig_dn */
153 struct device_node *phb_dn;
154 struct device_node *dn; 172 struct device_node *dn;
155 unsigned long searchval = (dev->bus->number << 8) | dev->devfn; 173 unsigned long searchval = (dev->bus->number << 8) | dev->devfn;
156 174
157 phb_dn = phb->arch_data; 175 dn = traverse_pci_devices(orig_dn, is_devfn_node, (void *)searchval);
158 dn = traverse_pci_devices(phb_dn, is_devfn_node, (void *)searchval);
159 if (dn) 176 if (dn)
160 dev->sysdata = dn; 177 dev->sysdata = dn;
161 return dn; 178 return dn;
@@ -165,11 +182,13 @@ EXPORT_SYMBOL(fetch_dev_dn);
165static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node) 182static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
166{ 183{
167 struct device_node *np = node; 184 struct device_node *np = node;
185 struct pci_dn *pci;
168 int err = NOTIFY_OK; 186 int err = NOTIFY_OK;
169 187
170 switch (action) { 188 switch (action) {
171 case PSERIES_RECONFIG_ADD: 189 case PSERIES_RECONFIG_ADD:
172 update_dn_pci_info(np, np->parent->phb); 190 pci = np->parent->data;
191 update_dn_pci_info(np, pci->phb);
173 break; 192 break;
174 default: 193 default:
175 err = NOTIFY_DONE; 194 err = NOTIFY_DONE;
diff --git a/arch/ppc64/kernel/pci_iommu.c b/arch/ppc64/kernel/pci_iommu.c
index ef0a62b916be..14647e09c9cd 100644
--- a/arch/ppc64/kernel/pci_iommu.c
+++ b/arch/ppc64/kernel/pci_iommu.c
@@ -66,7 +66,7 @@ static inline struct iommu_table *devnode_table(struct device *dev)
66#endif /* CONFIG_PPC_ISERIES */ 66#endif /* CONFIG_PPC_ISERIES */
67 67
68#ifdef CONFIG_PPC_MULTIPLATFORM 68#ifdef CONFIG_PPC_MULTIPLATFORM
69 return PCI_GET_DN(pdev)->iommu_table; 69 return PCI_DN(PCI_GET_DN(pdev))->iommu_table;
70#endif /* CONFIG_PPC_MULTIPLATFORM */ 70#endif /* CONFIG_PPC_MULTIPLATFORM */
71} 71}
72 72
diff --git a/arch/ppc64/kernel/pmac_feature.c b/arch/ppc64/kernel/pmac_feature.c
index 98ed2bccab1a..eb4e6c3f694d 100644
--- a/arch/ppc64/kernel/pmac_feature.c
+++ b/arch/ppc64/kernel/pmac_feature.c
@@ -674,6 +674,7 @@ void __init pmac_check_ht_link(void)
674#if 0 /* Disabled for now */ 674#if 0 /* Disabled for now */
675 u32 ufreq, freq, ucfg, cfg; 675 u32 ufreq, freq, ucfg, cfg;
676 struct device_node *pcix_node; 676 struct device_node *pcix_node;
677 struct pci_dn *pdn;
677 u8 px_bus, px_devfn; 678 u8 px_bus, px_devfn;
678 struct pci_controller *px_hose; 679 struct pci_controller *px_hose;
679 680
@@ -687,9 +688,10 @@ void __init pmac_check_ht_link(void)
687 printk("No PCI-X bridge found\n"); 688 printk("No PCI-X bridge found\n");
688 return; 689 return;
689 } 690 }
690 px_hose = pcix_node->phb; 691 pdn = pcix_node->data;
691 px_bus = pcix_node->busno; 692 px_hose = pdn->phb;
692 px_devfn = pcix_node->devfn; 693 px_bus = pdn->busno;
694 px_devfn = pdn->devfn;
693 695
694 early_read_config_dword(px_hose, px_bus, px_devfn, 0xc4, &cfg); 696 early_read_config_dword(px_hose, px_bus, px_devfn, 0xc4, &cfg);
695 early_read_config_dword(px_hose, px_bus, px_devfn, 0xcc, &freq); 697 early_read_config_dword(px_hose, px_bus, px_devfn, 0xcc, &freq);
diff --git a/arch/ppc64/kernel/pmac_pci.c b/arch/ppc64/kernel/pmac_pci.c
index 71fe911ad183..d37bff2d7d40 100644
--- a/arch/ppc64/kernel/pmac_pci.c
+++ b/arch/ppc64/kernel/pmac_pci.c
@@ -242,7 +242,7 @@ static int u3_ht_skip_device(struct pci_controller *hose,
242 else 242 else
243 busdn = hose->arch_data; 243 busdn = hose->arch_data;
244 for (dn = busdn->child; dn; dn = dn->sibling) 244 for (dn = busdn->child; dn; dn = dn->sibling)
245 if (dn->devfn == devfn) 245 if (dn->data && PCI_DN(dn)->devfn == devfn)
246 break; 246 break;
247 if (dn == NULL) 247 if (dn == NULL)
248 return -1; 248 return -1;
@@ -746,9 +746,9 @@ void __init pmac_pci_init(void)
746 */ 746 */
747 if (u3_agp) { 747 if (u3_agp) {
748 struct device_node *np = u3_agp->arch_data; 748 struct device_node *np = u3_agp->arch_data;
749 np->busno = 0xf0; 749 PCI_DN(np)->busno = 0xf0;
750 for (np = np->child; np; np = np->sibling) 750 for (np = np->child; np; np = np->sibling)
751 np->busno = 0xf0; 751 PCI_DN(np)->busno = 0xf0;
752 } 752 }
753 753
754 pmac_check_ht_link(); 754 pmac_check_ht_link();
diff --git a/arch/ppc64/kernel/pmc.c b/arch/ppc64/kernel/pmc.c
index cdfec7438d01..63d9481c3ec2 100644
--- a/arch/ppc64/kernel/pmc.c
+++ b/arch/ppc64/kernel/pmc.c
@@ -26,7 +26,7 @@ static void dummy_perf(struct pt_regs *regs)
26 mtspr(SPRN_MMCR0, mmcr0); 26 mtspr(SPRN_MMCR0, mmcr0);
27} 27}
28 28
29static spinlock_t pmc_owner_lock = SPIN_LOCK_UNLOCKED; 29static DEFINE_SPINLOCK(pmc_owner_lock);
30static void *pmc_owner_caller; /* mostly for debugging */ 30static void *pmc_owner_caller; /* mostly for debugging */
31perf_irq_t perf_irq = dummy_perf; 31perf_irq_t perf_irq = dummy_perf;
32 32
diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c
index 6ad5a8467f87..7035deb6de92 100644
--- a/arch/ppc64/kernel/prom.c
+++ b/arch/ppc64/kernel/prom.c
@@ -1733,6 +1733,7 @@ static void of_node_release(struct kref *kref)
1733 kfree(node->intrs); 1733 kfree(node->intrs);
1734 kfree(node->addrs); 1734 kfree(node->addrs);
1735 kfree(node->full_name); 1735 kfree(node->full_name);
1736 kfree(node->data);
1736 kfree(node); 1737 kfree(node);
1737} 1738}
1738 1739
diff --git a/arch/ppc64/kernel/rtas_pci.c b/arch/ppc64/kernel/rtas_pci.c
index 1dccadaddd1d..4a9719b48abe 100644
--- a/arch/ppc64/kernel/rtas_pci.c
+++ b/arch/ppc64/kernel/rtas_pci.c
@@ -48,7 +48,7 @@ static int write_pci_config;
48static int ibm_read_pci_config; 48static int ibm_read_pci_config;
49static int ibm_write_pci_config; 49static int ibm_write_pci_config;
50 50
51static int config_access_valid(struct device_node *dn, int where) 51static int config_access_valid(struct pci_dn *dn, int where)
52{ 52{
53 if (where < 256) 53 if (where < 256)
54 return 1; 54 return 1;
@@ -78,15 +78,17 @@ static int rtas_read_config(struct device_node *dn, int where, int size, u32 *va
78 int returnval = -1; 78 int returnval = -1;
79 unsigned long buid, addr; 79 unsigned long buid, addr;
80 int ret; 80 int ret;
81 struct pci_dn *pdn;
81 82
82 if (!dn) 83 if (!dn || !dn->data)
83 return PCIBIOS_DEVICE_NOT_FOUND; 84 return PCIBIOS_DEVICE_NOT_FOUND;
84 if (!config_access_valid(dn, where)) 85 pdn = dn->data;
86 if (!config_access_valid(pdn, where))
85 return PCIBIOS_BAD_REGISTER_NUMBER; 87 return PCIBIOS_BAD_REGISTER_NUMBER;
86 88
87 addr = ((where & 0xf00) << 20) | (dn->busno << 16) | 89 addr = ((where & 0xf00) << 20) | (pdn->busno << 16) |
88 (dn->devfn << 8) | (where & 0xff); 90 (pdn->devfn << 8) | (where & 0xff);
89 buid = dn->phb->buid; 91 buid = pdn->phb->buid;
90 if (buid) { 92 if (buid) {
91 ret = rtas_call(ibm_read_pci_config, 4, 2, &returnval, 93 ret = rtas_call(ibm_read_pci_config, 4, 2, &returnval,
92 addr, buid >> 32, buid & 0xffffffff, size); 94 addr, buid >> 32, buid & 0xffffffff, size);
@@ -98,8 +100,8 @@ static int rtas_read_config(struct device_node *dn, int where, int size, u32 *va
98 if (ret) 100 if (ret)
99 return PCIBIOS_DEVICE_NOT_FOUND; 101 return PCIBIOS_DEVICE_NOT_FOUND;
100 102
101 if (returnval == EEH_IO_ERROR_VALUE(size) 103 if (returnval == EEH_IO_ERROR_VALUE(size) &&
102 && eeh_dn_check_failure (dn, NULL)) 104 eeh_dn_check_failure (dn, NULL))
103 return PCIBIOS_DEVICE_NOT_FOUND; 105 return PCIBIOS_DEVICE_NOT_FOUND;
104 106
105 return PCIBIOS_SUCCESSFUL; 107 return PCIBIOS_SUCCESSFUL;
@@ -118,24 +120,28 @@ static int rtas_pci_read_config(struct pci_bus *bus,
118 120
119 /* Search only direct children of the bus */ 121 /* Search only direct children of the bus */
120 for (dn = busdn->child; dn; dn = dn->sibling) 122 for (dn = busdn->child; dn; dn = dn->sibling)
121 if (dn->devfn == devfn && of_device_available(dn)) 123 if (dn->data && PCI_DN(dn)->devfn == devfn
124 && of_device_available(dn))
122 return rtas_read_config(dn, where, size, val); 125 return rtas_read_config(dn, where, size, val);
126
123 return PCIBIOS_DEVICE_NOT_FOUND; 127 return PCIBIOS_DEVICE_NOT_FOUND;
124} 128}
125 129
126static int rtas_write_config(struct device_node *dn, int where, int size, u32 val) 130int rtas_write_config(struct device_node *dn, int where, int size, u32 val)
127{ 131{
128 unsigned long buid, addr; 132 unsigned long buid, addr;
129 int ret; 133 int ret;
134 struct pci_dn *pdn;
130 135
131 if (!dn) 136 if (!dn || !dn->data)
132 return PCIBIOS_DEVICE_NOT_FOUND; 137 return PCIBIOS_DEVICE_NOT_FOUND;
133 if (!config_access_valid(dn, where)) 138 pdn = dn->data;
139 if (!config_access_valid(pdn, where))
134 return PCIBIOS_BAD_REGISTER_NUMBER; 140 return PCIBIOS_BAD_REGISTER_NUMBER;
135 141
136 addr = ((where & 0xf00) << 20) | (dn->busno << 16) | 142 addr = ((where & 0xf00) << 20) | (pdn->busno << 16) |
137 (dn->devfn << 8) | (where & 0xff); 143 (pdn->devfn << 8) | (where & 0xff);
138 buid = dn->phb->buid; 144 buid = pdn->phb->buid;
139 if (buid) { 145 if (buid) {
140 ret = rtas_call(ibm_write_pci_config, 5, 1, NULL, addr, buid >> 32, buid & 0xffffffff, size, (ulong) val); 146 ret = rtas_call(ibm_write_pci_config, 5, 1, NULL, addr, buid >> 32, buid & 0xffffffff, size, (ulong) val);
141 } else { 147 } else {
@@ -161,7 +167,8 @@ static int rtas_pci_write_config(struct pci_bus *bus,
161 167
162 /* Search only direct children of the bus */ 168 /* Search only direct children of the bus */
163 for (dn = busdn->child; dn; dn = dn->sibling) 169 for (dn = busdn->child; dn; dn = dn->sibling)
164 if (dn->devfn == devfn && of_device_available(dn)) 170 if (dn->data && PCI_DN(dn)->devfn == devfn
171 && of_device_available(dn))
165 return rtas_write_config(dn, where, size, val); 172 return rtas_write_config(dn, where, size, val);
166 return PCIBIOS_DEVICE_NOT_FOUND; 173 return PCIBIOS_DEVICE_NOT_FOUND;
167} 174}
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c
index d0bb68af0ea4..bfa8791c9807 100644
--- a/arch/ppc64/kernel/setup.c
+++ b/arch/ppc64/kernel/setup.c
@@ -1283,7 +1283,7 @@ void __init generic_find_legacy_serial_ports(u64 *physport,
1283 1283
1284static struct platform_device serial_device = { 1284static struct platform_device serial_device = {
1285 .name = "serial8250", 1285 .name = "serial8250",
1286 .id = 0, 1286 .id = PLAT8250_DEV_PLATFORM,
1287 .dev = { 1287 .dev = {
1288 .platform_data = serial_ports, 1288 .platform_data = serial_ports,
1289 }, 1289 },
diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c
index 214914a95a50..e93c13458910 100644
--- a/arch/ppc64/kernel/sys_ppc32.c
+++ b/arch/ppc64/kernel/sys_ppc32.c
@@ -708,62 +708,9 @@ asmlinkage int sys32_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubu
708 compat_ptr(ubuf)); 708 compat_ptr(ubuf));
709} 709}
710 710
711#define IOBASE_BRIDGE_NUMBER 0
712#define IOBASE_MEMORY 1
713#define IOBASE_IO 2
714#define IOBASE_ISA_IO 3
715#define IOBASE_ISA_MEM 4
716
717asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn) 711asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn)
718{ 712{
719#ifdef CONFIG_PCI 713 return sys_pciconfig_iobase(which, in_bus, in_devfn);
720 struct pci_controller* hose;
721 struct list_head *ln;
722 struct pci_bus *bus = NULL;
723 struct device_node *hose_node;
724
725 /* Argh ! Please forgive me for that hack, but that's the
726 * simplest way to get existing XFree to not lockup on some
727 * G5 machines... So when something asks for bus 0 io base
728 * (bus 0 is HT root), we return the AGP one instead.
729 */
730#ifdef CONFIG_PPC_PMAC
731 if (systemcfg->platform == PLATFORM_POWERMAC &&
732 machine_is_compatible("MacRISC4"))
733 if (in_bus == 0)
734 in_bus = 0xf0;
735#endif /* CONFIG_PPC_PMAC */
736
737 /* That syscall isn't quite compatible with PCI domains, but it's
738 * used on pre-domains setup. We return the first match
739 */
740
741 for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
742 bus = pci_bus_b(ln);
743 if (in_bus >= bus->number && in_bus < (bus->number + bus->subordinate))
744 break;
745 bus = NULL;
746 }
747 if (bus == NULL || bus->sysdata == NULL)
748 return -ENODEV;
749
750 hose_node = (struct device_node *)bus->sysdata;
751 hose = hose_node->phb;
752
753 switch (which) {
754 case IOBASE_BRIDGE_NUMBER:
755 return (long)hose->first_busno;
756 case IOBASE_MEMORY:
757 return (long)hose->pci_mem_offset;
758 case IOBASE_IO:
759 return (long)hose->io_base_phys;
760 case IOBASE_ISA_IO:
761 return (long)isa_io_base;
762 case IOBASE_ISA_MEM:
763 return -EINVAL;
764 }
765#endif /* CONFIG_PCI */
766 return -EOPNOTSUPP;
767} 714}
768 715
769 716
diff --git a/arch/ppc64/kernel/syscalls.c b/arch/ppc64/kernel/syscalls.c
index a8cbb202b8cd..05f16633bd2c 100644
--- a/arch/ppc64/kernel/syscalls.c
+++ b/arch/ppc64/kernel/syscalls.c
@@ -46,10 +46,6 @@
46 46
47extern unsigned long wall_jiffies; 47extern unsigned long wall_jiffies;
48 48
49void
50check_bugs(void)
51{
52}
53 49
54/* 50/*
55 * sys_ipc() is the de-multiplexer for the SysV IPC calls.. 51 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
diff --git a/arch/ppc64/kernel/u3_iommu.c b/arch/ppc64/kernel/u3_iommu.c
index b6e3bca4102d..41ea09cb9ac7 100644
--- a/arch/ppc64/kernel/u3_iommu.c
+++ b/arch/ppc64/kernel/u3_iommu.c
@@ -276,7 +276,7 @@ static void iommu_dev_setup_u3(struct pci_dev *dev)
276 dn = pci_device_to_OF_node(dev); 276 dn = pci_device_to_OF_node(dev);
277 277
278 if (dn) 278 if (dn)
279 dn->iommu_table = &iommu_table_u3; 279 PCI_DN(dn)->iommu_table = &iommu_table_u3;
280} 280}
281 281
282static void iommu_bus_setup_u3(struct pci_bus *bus) 282static void iommu_bus_setup_u3(struct pci_bus *bus)
@@ -291,7 +291,7 @@ static void iommu_bus_setup_u3(struct pci_bus *bus)
291 dn = pci_bus_to_OF_node(bus); 291 dn = pci_bus_to_OF_node(bus);
292 292
293 if (dn) 293 if (dn)
294 dn->iommu_table = &iommu_table_u3; 294 PCI_DN(dn)->iommu_table = &iommu_table_u3;
295} 295}
296 296
297static void iommu_dev_setup_null(struct pci_dev *dev) { } 297static void iommu_dev_setup_null(struct pci_dev *dev) { }
diff --git a/arch/ppc64/kernel/udbg.c b/arch/ppc64/kernel/udbg.c
index ed6766e21f5a..d49c3613c8ec 100644
--- a/arch/ppc64/kernel/udbg.c
+++ b/arch/ppc64/kernel/udbg.c
@@ -158,14 +158,20 @@ static struct console udbg_console = {
158 .index = -1, 158 .index = -1,
159}; 159};
160 160
161static int early_console_initialized;
162
161void __init disable_early_printk(void) 163void __init disable_early_printk(void)
162{ 164{
165 if (!early_console_initialized)
166 return;
163 unregister_console(&udbg_console); 167 unregister_console(&udbg_console);
168 early_console_initialized = 0;
164} 169}
165 170
166/* called by setup_system */ 171/* called by setup_system */
167void register_early_udbg_console(void) 172void register_early_udbg_console(void)
168{ 173{
174 early_console_initialized = 1;
169 register_console(&udbg_console); 175 register_console(&udbg_console);
170} 176}
171 177
diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c
index a14ab87df491..c2157c9c3acb 100644
--- a/arch/ppc64/mm/init.c
+++ b/arch/ppc64/mm/init.c
@@ -554,12 +554,12 @@ void __init do_init_bootmem(void)
554 * present. 554 * present.
555 */ 555 */
556 for (i=0; i < lmb.memory.cnt; i++) 556 for (i=0; i < lmb.memory.cnt; i++)
557 free_bootmem(lmb_start_pfn(&lmb.memory, i), 557 free_bootmem(lmb.memory.region[i].base,
558 lmb_size_bytes(&lmb.memory, i)); 558 lmb_size_bytes(&lmb.memory, i));
559 559
560 /* reserve the sections we're already using */ 560 /* reserve the sections we're already using */
561 for (i=0; i < lmb.reserved.cnt; i++) 561 for (i=0; i < lmb.reserved.cnt; i++)
562 reserve_bootmem(lmb_start_pfn(&lmb.reserved, i), 562 reserve_bootmem(lmb.reserved.region[i].base,
563 lmb_size_bytes(&lmb.reserved, i)); 563 lmb_size_bytes(&lmb.reserved, i));
564 564
565 for (i=0; i < lmb.memory.cnt; i++) 565 for (i=0; i < lmb.memory.cnt; i++)
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 189c8f3a369c..98db30481d97 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -19,6 +19,7 @@ CFLAGS += -m31
19AFLAGS += -m31 19AFLAGS += -m31
20UTS_MACHINE := s390 20UTS_MACHINE := s390
21STACK_SIZE := 8192 21STACK_SIZE := 8192
22CHECKFLAGS += -D__s390__
22endif 23endif
23 24
24ifdef CONFIG_ARCH_S390X 25ifdef CONFIG_ARCH_S390X
@@ -28,6 +29,7 @@ CFLAGS += -m64
28AFLAGS += -m64 29AFLAGS += -m64
29UTS_MACHINE := s390x 30UTS_MACHINE := s390x
30STACK_SIZE := 16384 31STACK_SIZE := 16384
32CHECKFLAGS += -D__s390__ -D__s390x__
31endif 33endif
32 34
33cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5) 35cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5)
diff --git a/arch/sparc/lib/atomic32.c b/arch/sparc/lib/atomic32.c
index 19724c5800a7..2e64e8c3e8e5 100644
--- a/arch/sparc/lib/atomic32.c
+++ b/arch/sparc/lib/atomic32.c
@@ -20,7 +20,7 @@ spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] = {
20 20
21#else /* SMP */ 21#else /* SMP */
22 22
23static spinlock_t dummy = SPIN_LOCK_UNLOCKED; 23static DEFINE_SPINLOCK(dummy);
24#define ATOMIC_HASH_SIZE 1 24#define ATOMIC_HASH_SIZE 1
25#define ATOMIC_HASH(a) (&dummy) 25#define ATOMIC_HASH(a) (&dummy)
26 26
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index ec8bf4012c0c..2ff7c32ab0ce 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -359,134 +359,17 @@ void pcibios_fixup_bus(struct pci_bus *pbus)
359 pbus->resource[1] = &pbm->mem_space; 359 pbus->resource[1] = &pbm->mem_space;
360} 360}
361 361
362int pci_claim_resource(struct pci_dev *pdev, int resource) 362struct resource *pcibios_select_root(struct pci_dev *pdev, struct resource *r)
363{ 363{
364 struct pci_pbm_info *pbm = pdev->bus->sysdata; 364 struct pci_pbm_info *pbm = pdev->bus->sysdata;
365 struct resource *res = &pdev->resource[resource]; 365 struct resource *root = NULL;
366 struct resource *root;
367
368 if (!pbm)
369 return -EINVAL;
370 366
371 if (res->flags & IORESOURCE_IO) 367 if (r->flags & IORESOURCE_IO)
372 root = &pbm->io_space; 368 root = &pbm->io_space;
373 else 369 if (r->flags & IORESOURCE_MEM)
374 root = &pbm->mem_space; 370 root = &pbm->mem_space;
375 371
376 pbm->parent->resource_adjust(pdev, res, root); 372 return root;
377
378 return request_resource(root, res);
379}
380
381/*
382 * Given the PCI bus a device resides on, try to
383 * find an acceptable resource allocation for a
384 * specific device resource..
385 */
386static int pci_assign_bus_resource(const struct pci_bus *bus,
387 struct pci_dev *dev,
388 struct resource *res,
389 unsigned long size,
390 unsigned long min,
391 int resno)
392{
393 unsigned int type_mask;
394 int i;
395
396 type_mask = IORESOURCE_IO | IORESOURCE_MEM;
397 for (i = 0 ; i < 4; i++) {
398 struct resource *r = bus->resource[i];
399 if (!r)
400 continue;
401
402 /* type_mask must match */
403 if ((res->flags ^ r->flags) & type_mask)
404 continue;
405
406 /* Ok, try it out.. */
407 if (allocate_resource(r, res, size, min, -1, size, NULL, NULL) < 0)
408 continue;
409
410 /* PCI config space updated by caller. */
411 return 0;
412 }
413 return -EBUSY;
414}
415
416int pci_assign_resource(struct pci_dev *pdev, int resource)
417{
418 struct pcidev_cookie *pcp = pdev->sysdata;
419 struct pci_pbm_info *pbm = pcp->pbm;
420 struct resource *res = &pdev->resource[resource];
421 unsigned long min, size;
422 int err;
423
424 if (res->flags & IORESOURCE_IO)
425 min = pbm->io_space.start + 0x400UL;
426 else
427 min = pbm->mem_space.start;
428
429 size = res->end - res->start + 1;
430
431 err = pci_assign_bus_resource(pdev->bus, pdev, res, size, min, resource);
432
433 if (err < 0) {
434 printk("PCI: Failed to allocate resource %d for %s\n",
435 resource, pci_name(pdev));
436 } else {
437 /* Update PCI config space. */
438 pbm->parent->base_address_update(pdev, resource);
439 }
440
441 return err;
442}
443
444/* Sort resources by alignment */
445void pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
446{
447 int i;
448
449 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
450 struct resource *r;
451 struct resource_list *list, *tmp;
452 unsigned long r_align;
453
454 r = &dev->resource[i];
455 r_align = r->end - r->start;
456
457 if (!(r->flags) || r->parent)
458 continue;
459 if (!r_align) {
460 printk(KERN_WARNING "PCI: Ignore bogus resource %d "
461 "[%lx:%lx] of %s\n",
462 i, r->start, r->end, pci_name(dev));
463 continue;
464 }
465 r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start;
466 for (list = head; ; list = list->next) {
467 unsigned long align = 0;
468 struct resource_list *ln = list->next;
469 int idx;
470
471 if (ln) {
472 idx = ln->res - &ln->dev->resource[0];
473 align = (idx < PCI_BRIDGE_RESOURCES) ?
474 ln->res->end - ln->res->start + 1 :
475 ln->res->start;
476 }
477 if (r_align > align) {
478 tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
479 if (!tmp)
480 panic("pdev_sort_resources(): "
481 "kmalloc() failed!\n");
482 tmp->next = ln;
483 tmp->res = r;
484 tmp->dev = dev;
485 list->next = tmp;
486 break;
487 }
488 }
489 }
490} 373}
491 374
492void pcibios_update_irq(struct pci_dev *pdev, int irq) 375void pcibios_update_irq(struct pci_dev *pdev, int irq)
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c
index 91ab466d6c66..6ed1ef25e0ac 100644
--- a/arch/sparc64/kernel/pci_psycho.c
+++ b/arch/sparc64/kernel/pci_psycho.c
@@ -307,7 +307,7 @@ static unsigned char psycho_pil_table[] = {
307/*0x32*/15, /* Power Management */ 307/*0x32*/15, /* Power Management */
308}; 308};
309 309
310static int __init psycho_ino_to_pil(struct pci_dev *pdev, unsigned int ino) 310static int psycho_ino_to_pil(struct pci_dev *pdev, unsigned int ino)
311{ 311{
312 int ret; 312 int ret;
313 313
@@ -344,9 +344,9 @@ static int __init psycho_ino_to_pil(struct pci_dev *pdev, unsigned int ino)
344 return ret; 344 return ret;
345} 345}
346 346
347static unsigned int __init psycho_irq_build(struct pci_pbm_info *pbm, 347static unsigned int psycho_irq_build(struct pci_pbm_info *pbm,
348 struct pci_dev *pdev, 348 struct pci_dev *pdev,
349 unsigned int ino) 349 unsigned int ino)
350{ 350{
351 struct ino_bucket *bucket; 351 struct ino_bucket *bucket;
352 unsigned long imap, iclr; 352 unsigned long imap, iclr;
@@ -1024,7 +1024,7 @@ static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id, struct pt_regs *reg
1024#define PSYCHO_CE_INO 0x2f 1024#define PSYCHO_CE_INO 0x2f
1025#define PSYCHO_PCIERR_A_INO 0x30 1025#define PSYCHO_PCIERR_A_INO 0x30
1026#define PSYCHO_PCIERR_B_INO 0x31 1026#define PSYCHO_PCIERR_B_INO 0x31
1027static void __init psycho_register_error_handlers(struct pci_controller_info *p) 1027static void psycho_register_error_handlers(struct pci_controller_info *p)
1028{ 1028{
1029 struct pci_pbm_info *pbm = &p->pbm_A; /* arbitrary */ 1029 struct pci_pbm_info *pbm = &p->pbm_A; /* arbitrary */
1030 unsigned long base = p->pbm_A.controller_regs; 1030 unsigned long base = p->pbm_A.controller_regs;
@@ -1091,15 +1091,15 @@ static void __init psycho_register_error_handlers(struct pci_controller_info *p)
1091} 1091}
1092 1092
1093/* PSYCHO boot time probing and initialization. */ 1093/* PSYCHO boot time probing and initialization. */
1094static void __init psycho_resource_adjust(struct pci_dev *pdev, 1094static void psycho_resource_adjust(struct pci_dev *pdev,
1095 struct resource *res, 1095 struct resource *res,
1096 struct resource *root) 1096 struct resource *root)
1097{ 1097{
1098 res->start += root->start; 1098 res->start += root->start;
1099 res->end += root->start; 1099 res->end += root->start;
1100} 1100}
1101 1101
1102static void __init psycho_base_address_update(struct pci_dev *pdev, int resource) 1102static void psycho_base_address_update(struct pci_dev *pdev, int resource)
1103{ 1103{
1104 struct pcidev_cookie *pcp = pdev->sysdata; 1104 struct pcidev_cookie *pcp = pdev->sysdata;
1105 struct pci_pbm_info *pbm = pcp->pbm; 1105 struct pci_pbm_info *pbm = pcp->pbm;
@@ -1144,7 +1144,7 @@ static void __init psycho_base_address_update(struct pci_dev *pdev, int resource
1144 pci_write_config_dword(pdev, where + 4, 0); 1144 pci_write_config_dword(pdev, where + 4, 0);
1145} 1145}
1146 1146
1147static void __init pbm_config_busmastering(struct pci_pbm_info *pbm) 1147static void pbm_config_busmastering(struct pci_pbm_info *pbm)
1148{ 1148{
1149 u8 *addr; 1149 u8 *addr;
1150 1150
@@ -1161,8 +1161,8 @@ static void __init pbm_config_busmastering(struct pci_pbm_info *pbm)
1161 pci_config_write8(addr, 64); 1161 pci_config_write8(addr, 64);
1162} 1162}
1163 1163
1164static void __init pbm_scan_bus(struct pci_controller_info *p, 1164static void pbm_scan_bus(struct pci_controller_info *p,
1165 struct pci_pbm_info *pbm) 1165 struct pci_pbm_info *pbm)
1166{ 1166{
1167 struct pcidev_cookie *cookie = kmalloc(sizeof(*cookie), GFP_KERNEL); 1167 struct pcidev_cookie *cookie = kmalloc(sizeof(*cookie), GFP_KERNEL);
1168 1168
@@ -1189,7 +1189,7 @@ static void __init pbm_scan_bus(struct pci_controller_info *p,
1189 pci_setup_busmastering(pbm, pbm->pci_bus); 1189 pci_setup_busmastering(pbm, pbm->pci_bus);
1190} 1190}
1191 1191
1192static void __init psycho_scan_bus(struct pci_controller_info *p) 1192static void psycho_scan_bus(struct pci_controller_info *p)
1193{ 1193{
1194 pbm_config_busmastering(&p->pbm_B); 1194 pbm_config_busmastering(&p->pbm_B);
1195 p->pbm_B.is_66mhz_capable = 0; 1195 p->pbm_B.is_66mhz_capable = 0;
@@ -1204,7 +1204,7 @@ static void __init psycho_scan_bus(struct pci_controller_info *p)
1204 psycho_register_error_handlers(p); 1204 psycho_register_error_handlers(p);
1205} 1205}
1206 1206
1207static void __init psycho_iommu_init(struct pci_controller_info *p) 1207static void psycho_iommu_init(struct pci_controller_info *p)
1208{ 1208{
1209 struct pci_iommu *iommu = p->pbm_A.iommu; 1209 struct pci_iommu *iommu = p->pbm_A.iommu;
1210 unsigned long tsbbase, i; 1210 unsigned long tsbbase, i;
@@ -1327,8 +1327,8 @@ static void psycho_controller_hwinit(struct pci_controller_info *p)
1327 psycho_write(p->pbm_A.controller_regs + PSYCHO_PCIB_DIAG, tmp); 1327 psycho_write(p->pbm_A.controller_regs + PSYCHO_PCIB_DIAG, tmp);
1328} 1328}
1329 1329
1330static void __init pbm_register_toplevel_resources(struct pci_controller_info *p, 1330static void pbm_register_toplevel_resources(struct pci_controller_info *p,
1331 struct pci_pbm_info *pbm) 1331 struct pci_pbm_info *pbm)
1332{ 1332{
1333 char *name = pbm->name; 1333 char *name = pbm->name;
1334 1334
@@ -1481,7 +1481,7 @@ static void psycho_pbm_init(struct pci_controller_info *p,
1481 1481
1482#define PSYCHO_CONFIGSPACE 0x001000000UL 1482#define PSYCHO_CONFIGSPACE 0x001000000UL
1483 1483
1484void __init psycho_init(int node, char *model_name) 1484void psycho_init(int node, char *model_name)
1485{ 1485{
1486 struct linux_prom64_registers pr_regs[3]; 1486 struct linux_prom64_registers pr_regs[3];
1487 struct pci_controller_info *p; 1487 struct pci_controller_info *p;
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c
index 52bf3431a422..0ee6bd5b9ac6 100644
--- a/arch/sparc64/kernel/pci_sabre.c
+++ b/arch/sparc64/kernel/pci_sabre.c
@@ -554,7 +554,7 @@ static unsigned char sabre_pil_table[] = {
554/*0x32*/15, /* Power Management */ 554/*0x32*/15, /* Power Management */
555}; 555};
556 556
557static int __init sabre_ino_to_pil(struct pci_dev *pdev, unsigned int ino) 557static int sabre_ino_to_pil(struct pci_dev *pdev, unsigned int ino)
558{ 558{
559 int ret; 559 int ret;
560 560
@@ -612,9 +612,9 @@ static void sabre_wsync_handler(struct ino_bucket *bucket, void *_arg1, void *_a
612 sabre_read(sync_reg); 612 sabre_read(sync_reg);
613} 613}
614 614
615static unsigned int __init sabre_irq_build(struct pci_pbm_info *pbm, 615static unsigned int sabre_irq_build(struct pci_pbm_info *pbm,
616 struct pci_dev *pdev, 616 struct pci_dev *pdev,
617 unsigned int ino) 617 unsigned int ino)
618{ 618{
619 struct ino_bucket *bucket; 619 struct ino_bucket *bucket;
620 unsigned long imap, iclr; 620 unsigned long imap, iclr;
@@ -1009,7 +1009,7 @@ static irqreturn_t sabre_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs
1009#define SABRE_UE_INO 0x2e 1009#define SABRE_UE_INO 0x2e
1010#define SABRE_CE_INO 0x2f 1010#define SABRE_CE_INO 0x2f
1011#define SABRE_PCIERR_INO 0x30 1011#define SABRE_PCIERR_INO 0x30
1012static void __init sabre_register_error_handlers(struct pci_controller_info *p) 1012static void sabre_register_error_handlers(struct pci_controller_info *p)
1013{ 1013{
1014 struct pci_pbm_info *pbm = &p->pbm_A; /* arbitrary */ 1014 struct pci_pbm_info *pbm = &p->pbm_A; /* arbitrary */
1015 unsigned long base = pbm->controller_regs; 1015 unsigned long base = pbm->controller_regs;
@@ -1056,9 +1056,9 @@ static void __init sabre_register_error_handlers(struct pci_controller_info *p)
1056 sabre_write(base + SABRE_PCICTRL, tmp); 1056 sabre_write(base + SABRE_PCICTRL, tmp);
1057} 1057}
1058 1058
1059static void __init sabre_resource_adjust(struct pci_dev *pdev, 1059static void sabre_resource_adjust(struct pci_dev *pdev,
1060 struct resource *res, 1060 struct resource *res,
1061 struct resource *root) 1061 struct resource *root)
1062{ 1062{
1063 struct pci_pbm_info *pbm = pdev->bus->sysdata; 1063 struct pci_pbm_info *pbm = pdev->bus->sysdata;
1064 unsigned long base; 1064 unsigned long base;
@@ -1072,7 +1072,7 @@ static void __init sabre_resource_adjust(struct pci_dev *pdev,
1072 res->end += base; 1072 res->end += base;
1073} 1073}
1074 1074
1075static void __init sabre_base_address_update(struct pci_dev *pdev, int resource) 1075static void sabre_base_address_update(struct pci_dev *pdev, int resource)
1076{ 1076{
1077 struct pcidev_cookie *pcp = pdev->sysdata; 1077 struct pcidev_cookie *pcp = pdev->sysdata;
1078 struct pci_pbm_info *pbm = pcp->pbm; 1078 struct pci_pbm_info *pbm = pcp->pbm;
@@ -1118,7 +1118,7 @@ static void __init sabre_base_address_update(struct pci_dev *pdev, int resource)
1118 pci_write_config_dword(pdev, where + 4, 0); 1118 pci_write_config_dword(pdev, where + 4, 0);
1119} 1119}
1120 1120
1121static void __init apb_init(struct pci_controller_info *p, struct pci_bus *sabre_bus) 1121static void apb_init(struct pci_controller_info *p, struct pci_bus *sabre_bus)
1122{ 1122{
1123 struct pci_dev *pdev; 1123 struct pci_dev *pdev;
1124 1124
@@ -1181,7 +1181,7 @@ static struct pcidev_cookie *alloc_bridge_cookie(struct pci_pbm_info *pbm)
1181 return cookie; 1181 return cookie;
1182} 1182}
1183 1183
1184static void __init sabre_scan_bus(struct pci_controller_info *p) 1184static void sabre_scan_bus(struct pci_controller_info *p)
1185{ 1185{
1186 static int once; 1186 static int once;
1187 struct pci_bus *sabre_bus, *pbus; 1187 struct pci_bus *sabre_bus, *pbus;
@@ -1262,9 +1262,9 @@ static void __init sabre_scan_bus(struct pci_controller_info *p)
1262 sabre_register_error_handlers(p); 1262 sabre_register_error_handlers(p);
1263} 1263}
1264 1264
1265static void __init sabre_iommu_init(struct pci_controller_info *p, 1265static void sabre_iommu_init(struct pci_controller_info *p,
1266 int tsbsize, unsigned long dvma_offset, 1266 int tsbsize, unsigned long dvma_offset,
1267 u32 dma_mask) 1267 u32 dma_mask)
1268{ 1268{
1269 struct pci_iommu *iommu = p->pbm_A.iommu; 1269 struct pci_iommu *iommu = p->pbm_A.iommu;
1270 unsigned long tsbbase, i, order; 1270 unsigned long tsbbase, i, order;
@@ -1345,8 +1345,8 @@ static void __init sabre_iommu_init(struct pci_controller_info *p,
1345 } 1345 }
1346} 1346}
1347 1347
1348static void __init pbm_register_toplevel_resources(struct pci_controller_info *p, 1348static void pbm_register_toplevel_resources(struct pci_controller_info *p,
1349 struct pci_pbm_info *pbm) 1349 struct pci_pbm_info *pbm)
1350{ 1350{
1351 char *name = pbm->name; 1351 char *name = pbm->name;
1352 unsigned long ibase = p->pbm_A.controller_regs + SABRE_IOSPACE; 1352 unsigned long ibase = p->pbm_A.controller_regs + SABRE_IOSPACE;
@@ -1415,7 +1415,7 @@ static void __init pbm_register_toplevel_resources(struct pci_controller_info *p
1415 &pbm->mem_space); 1415 &pbm->mem_space);
1416} 1416}
1417 1417
1418static void __init sabre_pbm_init(struct pci_controller_info *p, int sabre_node, u32 dma_begin) 1418static void sabre_pbm_init(struct pci_controller_info *p, int sabre_node, u32 dma_begin)
1419{ 1419{
1420 struct pci_pbm_info *pbm; 1420 struct pci_pbm_info *pbm;
1421 char namebuf[128]; 1421 char namebuf[128];
@@ -1552,7 +1552,7 @@ static void __init sabre_pbm_init(struct pci_controller_info *p, int sabre_node,
1552 } 1552 }
1553} 1553}
1554 1554
1555void __init sabre_init(int pnode, char *model_name) 1555void sabre_init(int pnode, char *model_name)
1556{ 1556{
1557 struct linux_prom64_registers pr_regs[2]; 1557 struct linux_prom64_registers pr_regs[2];
1558 struct pci_controller_info *p; 1558 struct pci_controller_info *p;
diff --git a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c
index 6a182bb66281..331382e1a75d 100644
--- a/arch/sparc64/kernel/pci_schizo.c
+++ b/arch/sparc64/kernel/pci_schizo.c
@@ -285,7 +285,7 @@ static unsigned char schizo_pil_table[] = {
285/*0x3f*/0, /* Reserved for NewLink */ 285/*0x3f*/0, /* Reserved for NewLink */
286}; 286};
287 287
288static int __init schizo_ino_to_pil(struct pci_dev *pdev, unsigned int ino) 288static int schizo_ino_to_pil(struct pci_dev *pdev, unsigned int ino)
289{ 289{
290 int ret; 290 int ret;
291 291
@@ -1221,7 +1221,7 @@ static irqreturn_t schizo_safarierr_intr(int irq, void *dev_id, struct pt_regs *
1221 * PCI bus units of the same Tomatillo. I still have not really 1221 * PCI bus units of the same Tomatillo. I still have not really
1222 * figured this out... 1222 * figured this out...
1223 */ 1223 */
1224static void __init tomatillo_register_error_handlers(struct pci_controller_info *p) 1224static void tomatillo_register_error_handlers(struct pci_controller_info *p)
1225{ 1225{
1226 struct pci_pbm_info *pbm; 1226 struct pci_pbm_info *pbm;
1227 unsigned int irq; 1227 unsigned int irq;
@@ -1359,7 +1359,7 @@ static void __init tomatillo_register_error_handlers(struct pci_controller_info
1359 (SCHIZO_SAFIRQCTRL_EN | (BUS_ERROR_UNMAP))); 1359 (SCHIZO_SAFIRQCTRL_EN | (BUS_ERROR_UNMAP)));
1360} 1360}
1361 1361
1362static void __init schizo_register_error_handlers(struct pci_controller_info *p) 1362static void schizo_register_error_handlers(struct pci_controller_info *p)
1363{ 1363{
1364 struct pci_pbm_info *pbm; 1364 struct pci_pbm_info *pbm;
1365 unsigned int irq; 1365 unsigned int irq;
@@ -1505,7 +1505,7 @@ static void __init schizo_register_error_handlers(struct pci_controller_info *p)
1505 (SCHIZO_SAFIRQCTRL_EN | (BUS_ERROR_UNMAP))); 1505 (SCHIZO_SAFIRQCTRL_EN | (BUS_ERROR_UNMAP)));
1506} 1506}
1507 1507
1508static void __init pbm_config_busmastering(struct pci_pbm_info *pbm) 1508static void pbm_config_busmastering(struct pci_pbm_info *pbm)
1509{ 1509{
1510 u8 *addr; 1510 u8 *addr;
1511 1511
@@ -1522,8 +1522,8 @@ static void __init pbm_config_busmastering(struct pci_pbm_info *pbm)
1522 pci_config_write8(addr, 64); 1522 pci_config_write8(addr, 64);
1523} 1523}
1524 1524
1525static void __init pbm_scan_bus(struct pci_controller_info *p, 1525static void pbm_scan_bus(struct pci_controller_info *p,
1526 struct pci_pbm_info *pbm) 1526 struct pci_pbm_info *pbm)
1527{ 1527{
1528 struct pcidev_cookie *cookie = kmalloc(sizeof(*cookie), GFP_KERNEL); 1528 struct pcidev_cookie *cookie = kmalloc(sizeof(*cookie), GFP_KERNEL);
1529 1529
@@ -1550,8 +1550,8 @@ static void __init pbm_scan_bus(struct pci_controller_info *p,
1550 pci_setup_busmastering(pbm, pbm->pci_bus); 1550 pci_setup_busmastering(pbm, pbm->pci_bus);
1551} 1551}
1552 1552
1553static void __init __schizo_scan_bus(struct pci_controller_info *p, 1553static void __schizo_scan_bus(struct pci_controller_info *p,
1554 int chip_type) 1554 int chip_type)
1555{ 1555{
1556 if (!p->pbm_B.prom_node || !p->pbm_A.prom_node) { 1556 if (!p->pbm_B.prom_node || !p->pbm_A.prom_node) {
1557 printk("PCI: Only one PCI bus module of controller found.\n"); 1557 printk("PCI: Only one PCI bus module of controller found.\n");
@@ -1577,17 +1577,17 @@ static void __init __schizo_scan_bus(struct pci_controller_info *p,
1577 schizo_register_error_handlers(p); 1577 schizo_register_error_handlers(p);
1578} 1578}
1579 1579
1580static void __init schizo_scan_bus(struct pci_controller_info *p) 1580static void schizo_scan_bus(struct pci_controller_info *p)
1581{ 1581{
1582 __schizo_scan_bus(p, PBM_CHIP_TYPE_SCHIZO); 1582 __schizo_scan_bus(p, PBM_CHIP_TYPE_SCHIZO);
1583} 1583}
1584 1584
1585static void __init tomatillo_scan_bus(struct pci_controller_info *p) 1585static void tomatillo_scan_bus(struct pci_controller_info *p)
1586{ 1586{
1587 __schizo_scan_bus(p, PBM_CHIP_TYPE_TOMATILLO); 1587 __schizo_scan_bus(p, PBM_CHIP_TYPE_TOMATILLO);
1588} 1588}
1589 1589
1590static void __init schizo_base_address_update(struct pci_dev *pdev, int resource) 1590static void schizo_base_address_update(struct pci_dev *pdev, int resource)
1591{ 1591{
1592 struct pcidev_cookie *pcp = pdev->sysdata; 1592 struct pcidev_cookie *pcp = pdev->sysdata;
1593 struct pci_pbm_info *pbm = pcp->pbm; 1593 struct pci_pbm_info *pbm = pcp->pbm;
@@ -1632,9 +1632,9 @@ static void __init schizo_base_address_update(struct pci_dev *pdev, int resource
1632 pci_write_config_dword(pdev, where + 4, 0); 1632 pci_write_config_dword(pdev, where + 4, 0);
1633} 1633}
1634 1634
1635static void __init schizo_resource_adjust(struct pci_dev *pdev, 1635static void schizo_resource_adjust(struct pci_dev *pdev,
1636 struct resource *res, 1636 struct resource *res,
1637 struct resource *root) 1637 struct resource *root)
1638{ 1638{
1639 res->start += root->start; 1639 res->start += root->start;
1640 res->end += root->start; 1640 res->end += root->start;
@@ -1702,8 +1702,8 @@ static void schizo_determine_mem_io_space(struct pci_pbm_info *pbm)
1702 pbm->mem_space.start); 1702 pbm->mem_space.start);
1703} 1703}
1704 1704
1705static void __init pbm_register_toplevel_resources(struct pci_controller_info *p, 1705static void pbm_register_toplevel_resources(struct pci_controller_info *p,
1706 struct pci_pbm_info *pbm) 1706 struct pci_pbm_info *pbm)
1707{ 1707{
1708 pbm->io_space.name = pbm->mem_space.name = pbm->name; 1708 pbm->io_space.name = pbm->mem_space.name = pbm->name;
1709 1709
@@ -1932,7 +1932,7 @@ static void schizo_pbm_iommu_init(struct pci_pbm_info *pbm)
1932#define TOMATILLO_PCI_IOC_TDIAG (0x2250UL) 1932#define TOMATILLO_PCI_IOC_TDIAG (0x2250UL)
1933#define TOMATILLO_PCI_IOC_DDIAG (0x2290UL) 1933#define TOMATILLO_PCI_IOC_DDIAG (0x2290UL)
1934 1934
1935static void __init schizo_pbm_hw_init(struct pci_pbm_info *pbm) 1935static void schizo_pbm_hw_init(struct pci_pbm_info *pbm)
1936{ 1936{
1937 u64 tmp; 1937 u64 tmp;
1938 1938
@@ -1986,9 +1986,9 @@ static void __init schizo_pbm_hw_init(struct pci_pbm_info *pbm)
1986 } 1986 }
1987} 1987}
1988 1988
1989static void __init schizo_pbm_init(struct pci_controller_info *p, 1989static void schizo_pbm_init(struct pci_controller_info *p,
1990 int prom_node, u32 portid, 1990 int prom_node, u32 portid,
1991 int chip_type) 1991 int chip_type)
1992{ 1992{
1993 struct linux_prom64_registers pr_regs[4]; 1993 struct linux_prom64_registers pr_regs[4];
1994 unsigned int busrange[2]; 1994 unsigned int busrange[2];
@@ -2145,7 +2145,7 @@ static inline int portid_compare(u32 x, u32 y, int chip_type)
2145 return (x == y); 2145 return (x == y);
2146} 2146}
2147 2147
2148static void __init __schizo_init(int node, char *model_name, int chip_type) 2148static void __schizo_init(int node, char *model_name, int chip_type)
2149{ 2149{
2150 struct pci_controller_info *p; 2150 struct pci_controller_info *p;
2151 struct pci_iommu *iommu; 2151 struct pci_iommu *iommu;
@@ -2213,17 +2213,17 @@ static void __init __schizo_init(int node, char *model_name, int chip_type)
2213 schizo_pbm_init(p, node, portid, chip_type); 2213 schizo_pbm_init(p, node, portid, chip_type);
2214} 2214}
2215 2215
2216void __init schizo_init(int node, char *model_name) 2216void schizo_init(int node, char *model_name)
2217{ 2217{
2218 __schizo_init(node, model_name, PBM_CHIP_TYPE_SCHIZO); 2218 __schizo_init(node, model_name, PBM_CHIP_TYPE_SCHIZO);
2219} 2219}
2220 2220
2221void __init schizo_plus_init(int node, char *model_name) 2221void schizo_plus_init(int node, char *model_name)
2222{ 2222{
2223 __schizo_init(node, model_name, PBM_CHIP_TYPE_SCHIZO_PLUS); 2223 __schizo_init(node, model_name, PBM_CHIP_TYPE_SCHIZO_PLUS);
2224} 2224}
2225 2225
2226void __init tomatillo_init(int node, char *model_name) 2226void tomatillo_init(int node, char *model_name)
2227{ 2227{
2228 __schizo_init(node, model_name, PBM_CHIP_TYPE_TOMATILLO); 2228 __schizo_init(node, model_name, PBM_CHIP_TYPE_TOMATILLO);
2229} 2229}
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index d89fc24808d3..7d9a0f6c437d 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -403,12 +403,3 @@ EXPORT_SYMBOL(xor_vis_4);
403EXPORT_SYMBOL(xor_vis_5); 403EXPORT_SYMBOL(xor_vis_5);
404 404
405EXPORT_SYMBOL(prom_palette); 405EXPORT_SYMBOL(prom_palette);
406
407/* memory barriers */
408EXPORT_SYMBOL(mb);
409EXPORT_SYMBOL(rmb);
410EXPORT_SYMBOL(wmb);
411EXPORT_SYMBOL(membar_storeload);
412EXPORT_SYMBOL(membar_storeload_storestore);
413EXPORT_SYMBOL(membar_storeload_loadload);
414EXPORT_SYMBOL(membar_storestore_loadstore);
diff --git a/arch/sparc64/lib/Makefile b/arch/sparc64/lib/Makefile
index 6201f1040982..40dbeec7e5d6 100644
--- a/arch/sparc64/lib/Makefile
+++ b/arch/sparc64/lib/Makefile
@@ -12,7 +12,7 @@ lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.o \
12 U1memcpy.o U1copy_from_user.o U1copy_to_user.o \ 12 U1memcpy.o U1copy_from_user.o U1copy_to_user.o \
13 U3memcpy.o U3copy_from_user.o U3copy_to_user.o U3patch.o \ 13 U3memcpy.o U3copy_from_user.o U3copy_to_user.o U3patch.o \
14 copy_in_user.o user_fixup.o memmove.o \ 14 copy_in_user.o user_fixup.o memmove.o \
15 mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o mb.o 15 mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o
16 16
17lib-$(CONFIG_DEBUG_SPINLOCK) += debuglocks.o 17lib-$(CONFIG_DEBUG_SPINLOCK) += debuglocks.o
18lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o 18lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
diff --git a/arch/sparc64/lib/mb.S b/arch/sparc64/lib/mb.S
deleted file mode 100644
index 4004f748619f..000000000000
--- a/arch/sparc64/lib/mb.S
+++ /dev/null
@@ -1,73 +0,0 @@
1/* mb.S: Out of line memory barriers.
2 *
3 * Copyright (C) 2005 David S. Miller (davem@davemloft.net)
4 */
5
6 /* These are here in an effort to more fully work around
7 * Spitfire Errata #51. Essentially, if a memory barrier
8 * occurs soon after a mispredicted branch, the chip can stop
9 * executing instructions until a trap occurs. Therefore, if
10 * interrupts are disabled, the chip can hang forever.
11 *
12 * It used to be believed that the memory barrier had to be
13 * right in the delay slot, but a case has been traced
14 * recently wherein the memory barrier was one instruction
15 * after the branch delay slot and the chip still hung. The
16 * offending sequence was the following in sym_wakeup_done()
17 * of the sym53c8xx_2 driver:
18 *
19 * call sym_ccb_from_dsa, 0
20 * movge %icc, 0, %l0
21 * brz,pn %o0, .LL1303
22 * mov %o0, %l2
23 * membar #LoadLoad
24 *
25 * The branch has to be mispredicted for the bug to occur.
26 * Therefore, we put the memory barrier explicitly into a
27 * "branch always, predicted taken" delay slot to avoid the
28 * problem case.
29 */
30
31 .text
32
3399: retl
34 nop
35
36 .globl mb
37mb: ba,pt %xcc, 99b
38 membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad
39 .size mb, .-mb
40
41 .globl rmb
42rmb: ba,pt %xcc, 99b
43 membar #LoadLoad
44 .size rmb, .-rmb
45
46 .globl wmb
47wmb: ba,pt %xcc, 99b
48 membar #StoreStore
49 .size wmb, .-wmb
50
51 .globl membar_storeload
52membar_storeload:
53 ba,pt %xcc, 99b
54 membar #StoreLoad
55 .size membar_storeload, .-membar_storeload
56
57 .globl membar_storeload_storestore
58membar_storeload_storestore:
59 ba,pt %xcc, 99b
60 membar #StoreLoad | #StoreStore
61 .size membar_storeload_storestore, .-membar_storeload_storestore
62
63 .globl membar_storeload_loadload
64membar_storeload_loadload:
65 ba,pt %xcc, 99b
66 membar #StoreLoad | #LoadLoad
67 .size membar_storeload_loadload, .-membar_storeload_loadload
68
69 .globl membar_storestore_loadstore
70membar_storestore_loadstore:
71 ba,pt %xcc, 99b
72 membar #StoreStore | #LoadStore
73 .size membar_storestore_loadstore, .-membar_storestore_loadstore
diff --git a/arch/sparc64/solaris/ioctl.c b/arch/sparc64/solaris/ioctl.c
index cac0a1cf0050..be0a054e3ed6 100644
--- a/arch/sparc64/solaris/ioctl.c
+++ b/arch/sparc64/solaris/ioctl.c
@@ -24,6 +24,7 @@
24#include <linux/netdevice.h> 24#include <linux/netdevice.h>
25#include <linux/mtio.h> 25#include <linux/mtio.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/rcupdate.h>
27#include <linux/compat.h> 28#include <linux/compat.h>
28 29
29#include <net/sock.h> 30#include <net/sock.h>
@@ -293,16 +294,18 @@ static struct module_info {
293static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg) 294static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
294{ 295{
295 struct inode *ino; 296 struct inode *ino;
297 struct fdtable *fdt;
296 /* I wonder which of these tests are superfluous... --patrik */ 298 /* I wonder which of these tests are superfluous... --patrik */
297 spin_lock(&current->files->file_lock); 299 rcu_read_lock();
298 if (! current->files->fd[fd] || 300 fdt = files_fdtable(current->files);
299 ! current->files->fd[fd]->f_dentry || 301 if (! fdt->fd[fd] ||
300 ! (ino = current->files->fd[fd]->f_dentry->d_inode) || 302 ! fdt->fd[fd]->f_dentry ||
303 ! (ino = fdt->fd[fd]->f_dentry->d_inode) ||
301 ! S_ISSOCK(ino->i_mode)) { 304 ! S_ISSOCK(ino->i_mode)) {
302 spin_unlock(&current->files->file_lock); 305 rcu_read_unlock();
303 return TBADF; 306 return TBADF;
304 } 307 }
305 spin_unlock(&current->files->file_lock); 308 rcu_read_unlock();
306 309
307 switch (cmd & 0xff) { 310 switch (cmd & 0xff) {
308 case 109: /* SI_SOCKPARAMS */ 311 case 109: /* SI_SOCKPARAMS */
diff --git a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c
index 022c80f43392..aaad29c35c83 100644
--- a/arch/sparc64/solaris/timod.c
+++ b/arch/sparc64/solaris/timod.c
@@ -143,9 +143,11 @@ static struct T_primsg *timod_mkctl(int size)
143static void timod_wake_socket(unsigned int fd) 143static void timod_wake_socket(unsigned int fd)
144{ 144{
145 struct socket *sock; 145 struct socket *sock;
146 struct fdtable *fdt;
146 147
147 SOLD("wakeing socket"); 148 SOLD("wakeing socket");
148 sock = SOCKET_I(current->files->fd[fd]->f_dentry->d_inode); 149 fdt = files_fdtable(current->files);
150 sock = SOCKET_I(fdt->fd[fd]->f_dentry->d_inode);
149 wake_up_interruptible(&sock->wait); 151 wake_up_interruptible(&sock->wait);
150 read_lock(&sock->sk->sk_callback_lock); 152 read_lock(&sock->sk->sk_callback_lock);
151 if (sock->fasync_list && !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags)) 153 if (sock->fasync_list && !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags))
@@ -157,9 +159,11 @@ static void timod_wake_socket(unsigned int fd)
157static void timod_queue(unsigned int fd, struct T_primsg *it) 159static void timod_queue(unsigned int fd, struct T_primsg *it)
158{ 160{
159 struct sol_socket_struct *sock; 161 struct sol_socket_struct *sock;
162 struct fdtable *fdt;
160 163
161 SOLD("queuing primsg"); 164 SOLD("queuing primsg");
162 sock = (struct sol_socket_struct *)current->files->fd[fd]->private_data; 165 fdt = files_fdtable(current->files);
166 sock = (struct sol_socket_struct *)fdt->fd[fd]->private_data;
163 it->next = sock->pfirst; 167 it->next = sock->pfirst;
164 sock->pfirst = it; 168 sock->pfirst = it;
165 if (!sock->plast) 169 if (!sock->plast)
@@ -171,9 +175,11 @@ static void timod_queue(unsigned int fd, struct T_primsg *it)
171static void timod_queue_end(unsigned int fd, struct T_primsg *it) 175static void timod_queue_end(unsigned int fd, struct T_primsg *it)
172{ 176{
173 struct sol_socket_struct *sock; 177 struct sol_socket_struct *sock;
178 struct fdtable *fdt;
174 179
175 SOLD("queuing primsg at end"); 180 SOLD("queuing primsg at end");
176 sock = (struct sol_socket_struct *)current->files->fd[fd]->private_data; 181 fdt = files_fdtable(current->files);
182 sock = (struct sol_socket_struct *)fdt->fd[fd]->private_data;
177 it->next = NULL; 183 it->next = NULL;
178 if (sock->plast) 184 if (sock->plast)
179 sock->plast->next = it; 185 sock->plast->next = it;
@@ -344,6 +350,7 @@ int timod_putmsg(unsigned int fd, char __user *ctl_buf, int ctl_len,
344 char *buf; 350 char *buf;
345 struct file *filp; 351 struct file *filp;
346 struct inode *ino; 352 struct inode *ino;
353 struct fdtable *fdt;
347 struct sol_socket_struct *sock; 354 struct sol_socket_struct *sock;
348 mm_segment_t old_fs = get_fs(); 355 mm_segment_t old_fs = get_fs();
349 long args[6]; 356 long args[6];
@@ -351,7 +358,9 @@ int timod_putmsg(unsigned int fd, char __user *ctl_buf, int ctl_len,
351 (int (*)(int, unsigned long __user *))SYS(socketcall); 358 (int (*)(int, unsigned long __user *))SYS(socketcall);
352 int (*sys_sendto)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int) = 359 int (*sys_sendto)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int) =
353 (int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int))SYS(sendto); 360 (int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int))SYS(sendto);
354 filp = current->files->fd[fd]; 361
362 fdt = files_fdtable(current->files);
363 filp = fdt->fd[fd];
355 ino = filp->f_dentry->d_inode; 364 ino = filp->f_dentry->d_inode;
356 sock = (struct sol_socket_struct *)filp->private_data; 365 sock = (struct sol_socket_struct *)filp->private_data;
357 SOLD("entry"); 366 SOLD("entry");
@@ -620,6 +629,7 @@ int timod_getmsg(unsigned int fd, char __user *ctl_buf, int ctl_maxlen, s32 __us
620 int oldflags; 629 int oldflags;
621 struct file *filp; 630 struct file *filp;
622 struct inode *ino; 631 struct inode *ino;
632 struct fdtable *fdt;
623 struct sol_socket_struct *sock; 633 struct sol_socket_struct *sock;
624 struct T_unitdata_ind udi; 634 struct T_unitdata_ind udi;
625 mm_segment_t old_fs = get_fs(); 635 mm_segment_t old_fs = get_fs();
@@ -632,7 +642,8 @@ int timod_getmsg(unsigned int fd, char __user *ctl_buf, int ctl_maxlen, s32 __us
632 642
633 SOLD("entry"); 643 SOLD("entry");
634 SOLDD(("%u %p %d %p %p %d %p %d\n", fd, ctl_buf, ctl_maxlen, ctl_len, data_buf, data_maxlen, data_len, *flags_p)); 644 SOLDD(("%u %p %d %p %p %d %p %d\n", fd, ctl_buf, ctl_maxlen, ctl_len, data_buf, data_maxlen, data_len, *flags_p));
635 filp = current->files->fd[fd]; 645 fdt = files_fdtable(current->files);
646 filp = fdt->fd[fd];
636 ino = filp->f_dentry->d_inode; 647 ino = filp->f_dentry->d_inode;
637 sock = (struct sol_socket_struct *)filp->private_data; 648 sock = (struct sol_socket_struct *)filp->private_data;
638 SOLDD(("%p %p\n", sock->pfirst, sock->pfirst ? sock->pfirst->next : NULL)); 649 SOLDD(("%p %p\n", sock->pfirst, sock->pfirst ? sock->pfirst->next : NULL));
@@ -844,12 +855,14 @@ asmlinkage int solaris_getmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
844 int __user *flgptr; 855 int __user *flgptr;
845 int flags; 856 int flags;
846 int error = -EBADF; 857 int error = -EBADF;
858 struct fdtable *fdt;
847 859
848 SOLD("entry"); 860 SOLD("entry");
849 lock_kernel(); 861 lock_kernel();
850 if(fd >= NR_OPEN) goto out; 862 if(fd >= NR_OPEN) goto out;
851 863
852 filp = current->files->fd[fd]; 864 fdt = files_fdtable(current->files);
865 filp = fdt->fd[fd];
853 if(!filp) goto out; 866 if(!filp) goto out;
854 867
855 ino = filp->f_dentry->d_inode; 868 ino = filp->f_dentry->d_inode;
@@ -910,12 +923,14 @@ asmlinkage int solaris_putmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
910 struct strbuf ctl, dat; 923 struct strbuf ctl, dat;
911 int flags = (int) arg3; 924 int flags = (int) arg3;
912 int error = -EBADF; 925 int error = -EBADF;
926 struct fdtable *fdt;
913 927
914 SOLD("entry"); 928 SOLD("entry");
915 lock_kernel(); 929 lock_kernel();
916 if(fd >= NR_OPEN) goto out; 930 if(fd >= NR_OPEN) goto out;
917 931
918 filp = current->files->fd[fd]; 932 fdt = files_fdtable(current->files);
933 filp = fdt->fd[fd];
919 if(!filp) goto out; 934 if(!filp) goto out;
920 935
921 ino = filp->f_dentry->d_inode; 936 ino = filp->f_dentry->d_inode;
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64
index baddb5d64ca5..436abbba409b 100644
--- a/arch/um/Makefile-x86_64
+++ b/arch/um/Makefile-x86_64
@@ -8,6 +8,7 @@ START := 0x60000000
8#it's needed for headers to work! 8#it's needed for headers to work!
9CFLAGS += -U__$(SUBARCH)__ -fno-builtin 9CFLAGS += -U__$(SUBARCH)__ -fno-builtin
10USER_CFLAGS += -fno-builtin 10USER_CFLAGS += -fno-builtin
11CHECKFLAGS += -m64
11 12
12ELF_ARCH := i386:x86-64 13ELF_ARCH := i386:x86-64
13ELF_FORMAT := elf64-x86-64 14ELF_FORMAT := elf64-x86-64
diff --git a/arch/um/kernel/skas/include/uaccess-skas.h b/arch/um/kernel/skas/include/uaccess-skas.h
index cd6c280482cb..6ee3f3902e68 100644
--- a/arch/um/kernel/skas/include/uaccess-skas.h
+++ b/arch/um/kernel/skas/include/uaccess-skas.h
@@ -18,18 +18,18 @@
18 ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \ 18 ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \
19 ((unsigned long) (addr) + (size) >= (unsigned long)(addr)))) 19 ((unsigned long) (addr) + (size) >= (unsigned long)(addr))))
20 20
21static inline int verify_area_skas(int type, const void * addr, 21static inline int verify_area_skas(int type, const void __user * addr,
22 unsigned long size) 22 unsigned long size)
23{ 23{
24 return(access_ok_skas(type, addr, size) ? 0 : -EFAULT); 24 return(access_ok_skas(type, addr, size) ? 0 : -EFAULT);
25} 25}
26 26
27extern int copy_from_user_skas(void *to, const void *from, int n); 27extern int copy_from_user_skas(void *to, const void __user *from, int n);
28extern int copy_to_user_skas(void *to, const void *from, int n); 28extern int copy_to_user_skas(void __user *to, const void *from, int n);
29extern int strncpy_from_user_skas(char *dst, const char *src, int count); 29extern int strncpy_from_user_skas(char *dst, const char __user *src, int count);
30extern int __clear_user_skas(void *mem, int len); 30extern int __clear_user_skas(void __user *mem, int len);
31extern int clear_user_skas(void *mem, int len); 31extern int clear_user_skas(void __user *mem, int len);
32extern int strnlen_user_skas(const void *str, int len); 32extern int strnlen_user_skas(const void __user *str, int len);
33 33
34#endif 34#endif
35 35
diff --git a/arch/um/kernel/tt/include/uaccess-tt.h b/arch/um/kernel/tt/include/uaccess-tt.h
index 3fbb5fe26f49..aa6db384af80 100644
--- a/arch/um/kernel/tt/include/uaccess-tt.h
+++ b/arch/um/kernel/tt/include/uaccess-tt.h
@@ -33,7 +33,7 @@ extern unsigned long uml_physmem;
33 (((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) && \ 33 (((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) && \
34 (under_task_size(addr, size) || is_stack(addr, size)))) 34 (under_task_size(addr, size) || is_stack(addr, size))))
35 35
36static inline int verify_area_tt(int type, const void * addr, 36static inline int verify_area_tt(int type, const void __user * addr,
37 unsigned long size) 37 unsigned long size)
38{ 38{
39 return(access_ok_tt(type, addr, size) ? 0 : -EFAULT); 39 return(access_ok_tt(type, addr, size) ? 0 : -EFAULT);
@@ -50,12 +50,12 @@ extern int __do_clear_user(void *mem, size_t len, void **fault_addr,
50extern int __do_strnlen_user(const char *str, unsigned long n, 50extern int __do_strnlen_user(const char *str, unsigned long n,
51 void **fault_addr, void **fault_catcher); 51 void **fault_addr, void **fault_catcher);
52 52
53extern int copy_from_user_tt(void *to, const void *from, int n); 53extern int copy_from_user_tt(void *to, const void __user *from, int n);
54extern int copy_to_user_tt(void *to, const void *from, int n); 54extern int copy_to_user_tt(void __user *to, const void *from, int n);
55extern int strncpy_from_user_tt(char *dst, const char *src, int count); 55extern int strncpy_from_user_tt(char *dst, const char __user *src, int count);
56extern int __clear_user_tt(void *mem, int len); 56extern int __clear_user_tt(void __user *mem, int len);
57extern int clear_user_tt(void *mem, int len); 57extern int clear_user_tt(void __user *mem, int len);
58extern int strnlen_user_tt(const void *str, int len); 58extern int strnlen_user_tt(const void __user *str, int len);
59 59
60#endif 60#endif
61 61
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index 17f305b6bade..59a1291f477e 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -9,6 +9,11 @@ USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
9 9
10$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) \ 10$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) \
11 $(CFLAGS_$(notdir $@)) 11 $(CFLAGS_$(notdir $@))
12$(USER_OBJS): cmd_checksrc =
13$(USER_OBJS): quiet_cmd_checksrc =
14$(USER_OBJS): cmd_force_checksrc =
15$(USER_OBJS): quiet_cmd_force_checksrc =
16
12 17
13# The stubs and unmap.o can't try to call mcount or update basic block data 18# The stubs and unmap.o can't try to call mcount or update basic block data
14define unprofile 19define unprofile
diff --git a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c
index d259f8a6f811..419758f19ca4 100644
--- a/arch/x86_64/ia32/ia32_ioctl.c
+++ b/arch/x86_64/ia32/ia32_ioctl.c
@@ -24,17 +24,26 @@
24static int tiocgdev(unsigned fd, unsigned cmd, unsigned int __user *ptr) 24static int tiocgdev(unsigned fd, unsigned cmd, unsigned int __user *ptr)
25{ 25{
26 26
27 struct file *file = fget(fd); 27 struct file *file;
28 struct tty_struct *real_tty; 28 struct tty_struct *real_tty;
29 int fput_needed, ret;
29 30
31 file = fget_light(fd, &fput_needed);
30 if (!file) 32 if (!file)
31 return -EBADF; 33 return -EBADF;
34
35 ret = -EINVAL;
32 if (file->f_op->ioctl != tty_ioctl) 36 if (file->f_op->ioctl != tty_ioctl)
33 return -EINVAL; 37 goto out;
34 real_tty = (struct tty_struct *)file->private_data; 38 real_tty = (struct tty_struct *)file->private_data;
35 if (!real_tty) 39 if (!real_tty)
36 return -EINVAL; 40 goto out;
37 return put_user(new_encode_dev(tty_devnum(real_tty)), ptr); 41
42 ret = put_user(new_encode_dev(tty_devnum(real_tty)), ptr);
43
44out:
45 fput_light(file, fput_needed);
46 return ret;
38} 47}
39 48
40#define RTC_IRQP_READ32 _IOR('p', 0x0b, unsigned int) /* Read IRQ rate */ 49#define RTC_IRQP_READ32 _IOR('p', 0x0b, unsigned int) /* Read IRQ rate */
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index 116ac5f53dce..bb0ae18ec02b 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -567,7 +567,7 @@ unsigned long pci_mem_start = 0xaeedbabe;
567 */ 567 */
568__init void e820_setup_gap(void) 568__init void e820_setup_gap(void)
569{ 569{
570 unsigned long gapstart, gapsize; 570 unsigned long gapstart, gapsize, round;
571 unsigned long last; 571 unsigned long last;
572 int i; 572 int i;
573 int found = 0; 573 int found = 0;
@@ -604,14 +604,14 @@ __init void e820_setup_gap(void)
604 } 604 }
605 605
606 /* 606 /*
607 * Start allocating dynamic PCI memory a bit into the gap, 607 * See how much we want to round up: start off with
608 * aligned up to the nearest megabyte. 608 * rounding to the next 1MB area.
609 *
610 * Question: should we try to pad it up a bit (do something
611 * like " + (gapsize >> 3)" in there too?). We now have the
612 * technology.
613 */ 609 */
614 pci_mem_start = (gapstart + 0xfffff) & ~0xfffff; 610 round = 0x100000;
611 while ((gapsize >> 4) > round)
612 round += round;
613 /* Fun with two's complement */
614 pci_mem_start = (gapstart + round) & -round;
615 615
616 printk(KERN_INFO "Allocating PCI resources starting at %lx (gap: %lx:%lx)\n", 616 printk(KERN_INFO "Allocating PCI resources starting at %lx (gap: %lx:%lx)\n",
617 pci_mem_start, gapstart, gapsize); 617 pci_mem_start, gapstart, gapsize);
diff --git a/arch/x86_64/kernel/genapic_flat.c b/arch/x86_64/kernel/genapic_flat.c
index adc96282a9e2..6d57da96bf8c 100644
--- a/arch/x86_64/kernel/genapic_flat.c
+++ b/arch/x86_64/kernel/genapic_flat.c
@@ -78,8 +78,18 @@ static void flat_send_IPI_mask(cpumask_t cpumask, int vector)
78 78
79static void flat_send_IPI_allbutself(int vector) 79static void flat_send_IPI_allbutself(int vector)
80{ 80{
81#ifndef CONFIG_HOTPLUG_CPU
81 if (((num_online_cpus()) - 1) >= 1) 82 if (((num_online_cpus()) - 1) >= 1)
82 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL); 83 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL);
84#else
85 cpumask_t allbutme = cpu_online_map;
86 int me = get_cpu(); /* Ensure we are not preempted when we clear */
87 cpu_clear(me, allbutme);
88
89 if (!cpus_empty(allbutme))
90 flat_send_IPI_mask(allbutme, vector);
91 put_cpu();
92#endif
83} 93}
84 94
85static void flat_send_IPI_all(int vector) 95static void flat_send_IPI_all(int vector)
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 40e0aca088fb..5f1529be1237 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -1167,9 +1167,9 @@ void disable_IO_APIC(void)
1167 clear_IO_APIC(); 1167 clear_IO_APIC();
1168 1168
1169 /* 1169 /*
1170 * If the i82559 is routed through an IOAPIC 1170 * If the i8259 is routed through an IOAPIC
1171 * Put that IOAPIC in virtual wire mode 1171 * Put that IOAPIC in virtual wire mode
1172 * so legacy interrups can be delivered. 1172 * so legacy interrupts can be delivered.
1173 */ 1173 */
1174 pin = find_isa_irq_pin(0, mp_ExtINT); 1174 pin = find_isa_irq_pin(0, mp_ExtINT);
1175 if (pin != -1) { 1175 if (pin != -1) {
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 90aeccd15190..4fb34b5cb1f9 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -894,23 +894,6 @@ static __init void disable_smp(void)
894 cpu_set(0, cpu_core_map[0]); 894 cpu_set(0, cpu_core_map[0]);
895} 895}
896 896
897/*
898 * Handle user cpus=... parameter.
899 */
900static __init void enforce_max_cpus(unsigned max_cpus)
901{
902 int i, k;
903 k = 0;
904 for (i = 0; i < NR_CPUS; i++) {
905 if (!cpu_possible(i))
906 continue;
907 if (++k > max_cpus) {
908 cpu_clear(i, cpu_possible_map);
909 cpu_clear(i, cpu_present_map);
910 }
911 }
912}
913
914#ifdef CONFIG_HOTPLUG_CPU 897#ifdef CONFIG_HOTPLUG_CPU
915/* 898/*
916 * cpu_possible_map should be static, it cannot change as cpu's 899 * cpu_possible_map should be static, it cannot change as cpu's
@@ -999,8 +982,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
999 current_cpu_data = boot_cpu_data; 982 current_cpu_data = boot_cpu_data;
1000 current_thread_info()->cpu = 0; /* needed? */ 983 current_thread_info()->cpu = 0; /* needed? */
1001 984
1002 enforce_max_cpus(max_cpus);
1003
1004#ifdef CONFIG_HOTPLUG_CPU 985#ifdef CONFIG_HOTPLUG_CPU
1005 prefill_possible_map(); 986 prefill_possible_map();
1006#endif 987#endif