Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 20 May 2011 01:08:06 +0000 (18:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 20 May 2011 01:08:06 +0000 (18:08 -0700)
* 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Introduce pci_map_biosrom()
  x86, olpc: Use device tree for platform identification

1  2 
arch/x86/Kconfig
arch/x86/include/asm/setup.h
arch/x86/kernel/Makefile
arch/x86/kernel/head32.c
arch/x86/kernel/x86_init.c
arch/x86/platform/olpc/olpc_dt.c

diff --combined arch/x86/Kconfig
@@@ -8,7 -8,6 +8,7 @@@ config 64BI
  
  config X86_32
        def_bool !64BIT
 +      select CLKSRC_I8253
  
  config X86_64
        def_bool 64BIT
@@@ -65,12 -64,8 +65,12 @@@ config X8
        select HAVE_TEXT_POKE_SMP
        select HAVE_GENERIC_HARDIRQS
        select HAVE_SPARSE_IRQ
 +      select GENERIC_FIND_FIRST_BIT
 +      select GENERIC_FIND_NEXT_BIT
        select GENERIC_IRQ_PROBE
        select GENERIC_PENDING_IRQ if SMP
 +      select GENERIC_IRQ_SHOW
 +      select IRQ_FORCED_THREADING
        select USE_GENERIC_SMP_HELPERS if SMP
  
  config INSTRUCTION_DECODER
@@@ -112,14 -107,7 +112,14 @@@ config MM
        def_bool y
  
  config ZONE_DMA
 -      def_bool y
 +      bool "DMA memory allocation support" if EXPERT
 +      default y
 +      help
 +        DMA memory allocation support allows devices with less than 32-bit
 +        addressing to allocate within the first 16MB of address space.
 +        Disable if no such devices will be used.
 +
 +        If unsure, say Y.
  
  config SBUS
        bool
@@@ -131,7 -119,7 +131,7 @@@ config NEED_SG_DMA_LENGT
        def_bool y
  
  config GENERIC_ISA_DMA
 -      def_bool y
 +      def_bool ISA_DMA_API
  
  config GENERIC_IOMAP
        def_bool y
@@@ -151,7 -139,7 +151,7 @@@ config GENERIC_GPI
        bool
  
  config ARCH_MAY_HAVE_PC_FDC
 -      def_bool y
 +      def_bool ISA_DMA_API
  
  config RWSEM_GENERIC_SPINLOCK
        def_bool !X86_XADD
@@@ -229,6 -217,10 +229,6 @@@ config X86_H
        def_bool y
        depends on SMP
  
 -config X86_TRAMPOLINE
 -      def_bool y
 -      depends on SMP || (64BIT && ACPI_SLEEP)
 -
  config X86_32_LAZY_GS
        def_bool y
        depends on X86_32 && !CC_STACKPROTECTOR
@@@ -372,6 -364,17 +372,6 @@@ config X86_U
  # Following is an alphabetically sorted list of 32 bit extended platforms
  # Please maintain the alphabetic order if and when there are additions
  
 -config X86_ELAN
 -      bool "AMD Elan"
 -      depends on X86_32
 -      depends on X86_EXTENDED_PLATFORM
 -      ---help---
 -        Select this for an AMD Elan processor.
 -
 -        Do not use this option for K6/Athlon/Opteron processors!
 -
 -        If unsure, choose "PC-compatible" instead.
 -
  config X86_INTEL_CE
        bool "CE4100 TV platform"
        depends on PCI
@@@ -686,7 -689,6 +686,7 @@@ config AMD_IOMM
        bool "AMD IOMMU support"
        select SWIOTLB
        select PCI_MSI
 +      select PCI_IOV
        depends on X86_64 && PCI && ACPI
        ---help---
          With this option you can enable support for AMD IOMMU hardware in
@@@ -1171,7 -1173,7 +1171,7 @@@ comment "NUMA (Summit) requires SMP, 64
  config AMD_NUMA
        def_bool y
        prompt "Old style AMD Opteron NUMA detection"
 -      depends on X86_64 && NUMA && PCI
 +      depends on NUMA && PCI
        ---help---
          Enable AMD NUMA node topology detection.  You should say Y here if
          you have a multi processor AMD system. This uses an old method to
@@@ -1198,7 -1200,7 +1198,7 @@@ config NODES_SPAN_OTHER_NODE
  
  config NUMA_EMU
        bool "NUMA emulation"
 -      depends on X86_64 && NUMA
 +      depends on NUMA
        ---help---
          Enable NUMA emulation. A flat machine will be split
          into virtual nodes when booted with "numa=fake=N", where N is the
@@@ -1220,10 -1222,6 +1220,10 @@@ config HAVE_ARCH_BOOTME
        def_bool y
        depends on X86_32 && NUMA
  
 +config HAVE_ARCH_ALLOC_REMAP
 +      def_bool y
 +      depends on X86_32 && NUMA
 +
  config ARCH_HAVE_MEMORY_PRESENT
        def_bool y
        depends on X86_32 && DISCONTIGMEM
@@@ -1232,9 -1230,13 +1232,9 @@@ config NEED_NODE_MEMMAP_SIZ
        def_bool y
        depends on X86_32 && (DISCONTIGMEM || SPARSEMEM)
  
 -config HAVE_ARCH_ALLOC_REMAP
 -      def_bool y
 -      depends on X86_32 && NUMA
 -
  config ARCH_FLATMEM_ENABLE
        def_bool y
 -      depends on X86_32 && ARCH_SELECT_MEMORY_MODEL && !NUMA
 +      depends on X86_32 && !NUMA
  
  config ARCH_DISCONTIGMEM_ENABLE
        def_bool y
@@@ -1244,16 -1246,20 +1244,16 @@@ config ARCH_DISCONTIGMEM_DEFAUL
        def_bool y
        depends on NUMA && X86_32
  
 -config ARCH_PROC_KCORE_TEXT
 -      def_bool y
 -      depends on X86_64 && PROC_KCORE
 -
 -config ARCH_SPARSEMEM_DEFAULT
 -      def_bool y
 -      depends on X86_64
 -
  config ARCH_SPARSEMEM_ENABLE
        def_bool y
        depends on X86_64 || NUMA || (EXPERIMENTAL && X86_32) || X86_32_NON_STANDARD
        select SPARSEMEM_STATIC if X86_32
        select SPARSEMEM_VMEMMAP_ENABLE if X86_64
  
 +config ARCH_SPARSEMEM_DEFAULT
 +      def_bool y
 +      depends on X86_64
 +
  config ARCH_SELECT_MEMORY_MODEL
        def_bool y
        depends on ARCH_SPARSEMEM_ENABLE
@@@ -1262,10 -1268,6 +1262,10 @@@ config ARCH_MEMORY_PROB
        def_bool X86_64
        depends on MEMORY_HOTPLUG
  
 +config ARCH_PROC_KCORE_TEXT
 +      def_bool y
 +      depends on X86_64 && PROC_KCORE
 +
  config ILLEGAL_POINTER_VALUE
         hex
         default 0 if X86_32
@@@ -1700,8 -1702,12 +1700,8 @@@ config ARCH_ENABLE_MEMORY_HOTREMOV
        def_bool y
        depends on MEMORY_HOTPLUG
  
 -config HAVE_ARCH_EARLY_PFN_TO_NID
 -      def_bool X86_64
 -      depends on NUMA
 -
  config USE_PERCPU_NUMA_NODE_ID
 -      def_bool X86_64
 +      def_bool y
        depends on NUMA
  
  menu "Power management and ACPI options"
@@@ -1841,7 -1847,7 +1841,7 @@@ config APM_ALLOW_INT
  
  endif # APM
  
 -source "arch/x86/kernel/cpu/cpufreq/Kconfig"
 +source "drivers/cpufreq/Kconfig"
  
  source "drivers/cpuidle/Kconfig"
  
@@@ -1996,13 -2002,9 +1996,13 @@@ source "drivers/pci/pcie/Kconfig
  
  source "drivers/pci/Kconfig"
  
 -# x86_64 have no ISA slots, but do have ISA-style DMA.
 +# x86_64 have no ISA slots, but can have ISA-style DMA.
  config ISA_DMA_API
 -      def_bool y
 +      bool "ISA-style DMA support" if (X86_64 && EXPERT)
 +      default y
 +      help
 +        Enables ISA-style DMA support for devices requiring such controllers.
 +        If unsure, say Y.
  
  if X86_32
  
@@@ -2069,7 -2071,7 +2069,7 @@@ config OLP
        depends on !X86_PAE
        select GPIOLIB
        select OF
-       select OF_PROMTREE if PROC_DEVICETREE
+       select OF_PROMTREE
        ---help---
          Add support for detecting the unique features of the OLPC
          XO hardware.
@@@ -2090,16 -2092,6 +2090,16 @@@ source "drivers/pcmcia/Kconfig
  
  source "drivers/pci/hotplug/Kconfig"
  
 +config RAPIDIO
 +      bool "RapidIO support"
 +      depends on PCI
 +      default n
 +      help
 +        If you say Y here, the kernel will include drivers and
 +        infrastructure code to support RapidIO interconnect devices.
 +
 +source "drivers/rapidio/Kconfig"
 +
  endmenu
  
  
@@@ -2134,11 -2126,6 +2134,11 @@@ config SYSVIPC_COMPA
        def_bool y
        depends on COMPAT && SYSVIPC
  
 +config KEYS_COMPAT
 +      bool
 +      depends on COMPAT && KEYS
 +      default y
 +
  endmenu
  
  
@@@ -88,7 -88,7 +88,7 @@@ void *extend_brk(size_t size, size_t al
   * executable.)
   */
  #define RESERVE_BRK(name,sz)                                          \
 -      static void __section(.discard.text) __used                     \
 +      static void __section(.discard.text) __used notrace             \
        __brk_reservation_fn_##name##__(void) {                         \
                asm volatile (                                          \
                        ".pushsection .brk_reservation,\"aw\",@nobits;" \
        type *name;                                     \
        RESERVE_BRK(name, sizeof(type) * entries)
  
+ extern void probe_roms(void);
  #ifdef __i386__
  
  void __init i386_start_kernel(void);
- extern void probe_roms(void);
  
  #else
  void __init x86_64_start_kernel(char *real_mode);
diff --combined arch/x86/kernel/Makefile
@@@ -36,18 -36,18 +36,18 @@@ obj-y                      += traps.o irq.o irq_$(BITS).o 
  obj-y                 += time.o ioport.o ldt.o dumpstack.o
  obj-y                 += setup.o x86_init.o i8259.o irqinit.o jump_label.o
  obj-$(CONFIG_IRQ_WORK)  += irq_work.o
- obj-$(CONFIG_X86_32)  += probe_roms_32.o
+ obj-y                 += probe_roms.o
  obj-$(CONFIG_X86_32)  += sys_i386_32.o i386_ksyms_32.o
  obj-$(CONFIG_X86_64)  += sys_x86_64.o x8664_ksyms_64.o
  obj-$(CONFIG_X86_64)  += syscall_64.o vsyscall_64.o
  obj-y                 += bootflag.o e820.o
 -obj-y                 += pci-dma.o quirks.o i8237.o topology.o kdebugfs.o
 +obj-y                 += pci-dma.o quirks.o topology.o kdebugfs.o
  obj-y                 += alternative.o i8253.o pci-nommu.o hw_breakpoint.o
  obj-y                 += tsc.o io_delay.o rtc.o
  obj-y                 += pci-iommu_table.o
  obj-y                 += resource.o
  
 -obj-$(CONFIG_X86_TRAMPOLINE)  += trampoline.o
 +obj-y                         += trampoline.o trampoline_$(BITS).o
  obj-y                         += process.o
  obj-y                         += i387.o xsave.o
  obj-y                         += ptrace.o
@@@ -55,12 -55,10 +55,12 @@@ obj-$(CONFIG_X86_32)               += tls.
  obj-$(CONFIG_IA32_EMULATION)  += tls.o
  obj-y                         += step.o
  obj-$(CONFIG_INTEL_TXT)               += tboot.o
 +obj-$(CONFIG_ISA_DMA_API)     += i8237.o
  obj-$(CONFIG_STACKTRACE)      += stacktrace.o
  obj-y                         += cpu/
  obj-y                         += acpi/
  obj-y                         += reboot.o
 +obj-$(CONFIG_X86_32)          += reboot_32.o
  obj-$(CONFIG_MCA)             += mca_32.o
  obj-$(CONFIG_X86_MSR)         += msr.o
  obj-$(CONFIG_X86_CPUID)               += cpuid.o
@@@ -71,6 -69,7 +71,6 @@@ obj-$(CONFIG_SMP)             += smp.
  obj-$(CONFIG_SMP)             += smpboot.o
  obj-$(CONFIG_SMP)             += tsc_sync.o
  obj-$(CONFIG_SMP)             += setup_percpu.o
 -obj-$(CONFIG_X86_TRAMPOLINE)  += trampoline_$(BITS).o
  obj-$(CONFIG_X86_MPPARSE)     += mpparse.o
  obj-y                         += apic/
  obj-$(CONFIG_X86_REBOOTFIXUPS)        += reboot_fixups_32.o
@@@ -117,7 -116,7 +117,7 @@@ obj-$(CONFIG_OF)                   += devicetree.
  ifeq ($(CONFIG_X86_64),y)
        obj-$(CONFIG_AUDIT)             += audit_64.o
  
 -      obj-$(CONFIG_GART_IOMMU)        += pci-gart_64.o aperture_64.o
 +      obj-$(CONFIG_GART_IOMMU)        += amd_gart_64.o aperture_64.o
        obj-$(CONFIG_CALGARY_IOMMU)     += pci-calgary_64.o tce_64.o
        obj-$(CONFIG_AMD_IOMMU)         += amd_iommu_init.o amd_iommu.o
  
diff --combined arch/x86/kernel/head32.c
@@@ -23,7 -23,6 +23,6 @@@
  static void __init i386_default_early_setup(void)
  {
        /* Initialize 32bit specific setup functions */
-       x86_init.resources.probe_roms = probe_roms;
        x86_init.resources.reserve_resources = i386_reserve_resources;
        x86_init.mpparse.setup_ioapic_ids = setup_ioapic_ids_from_mpc;
  
@@@ -34,6 -33,15 +33,6 @@@ void __init i386_start_kernel(void
  {
        memblock_init();
  
 -#ifdef CONFIG_X86_TRAMPOLINE
 -      /*
 -       * But first pinch a few for the stack/trampoline stuff
 -       * FIXME: Don't need the extra page at 4K, but need to fix
 -       * trampoline before removing it. (see the GDT stuff)
 -       */
 -      memblock_x86_reserve_range(PAGE_SIZE, PAGE_SIZE + PAGE_SIZE, "EX TRAMPOLINE");
 -#endif
 -
        memblock_x86_reserve_range(__pa_symbol(&_text), __pa_symbol(&__bss_stop), "TEXT DATA BSS");
  
  #ifdef CONFIG_BLK_DEV_INITRD
@@@ -35,7 -35,7 +35,7 @@@ void iommu_shutdown_noop(void) { 
  struct x86_init_ops x86_init __initdata = {
  
        .resources = {
-               .probe_roms             = x86_init_noop,
+               .probe_roms             = probe_roms,
                .reserve_resources      = reserve_standard_io_resources,
                .memory_setup           = default_machine_specific_memory_setup,
        },
                .banner                 = default_banner,
        },
  
 +      .mapping = {
 +              .pagetable_reserve              = native_pagetable_reserve,
 +      },
 +
        .paging = {
                .pagetable_setup_start  = native_pagetable_setup_start,
                .pagetable_setup_done   = native_pagetable_setup_done,
@@@ -19,7 -19,9 +19,9 @@@
  #include <linux/kernel.h>
  #include <linux/bootmem.h>
  #include <linux/of.h>
+ #include <linux/of_platform.h>
  #include <linux/of_pdt.h>
+ #include <asm/olpc.h>
  #include <asm/olpc_ofw.h>
  
  static phandle __init olpc_dt_getsibling(phandle node)
@@@ -140,7 -142,8 +142,7 @@@ void * __init prom_early_alloc(unsigne
                 * wasted bootmem) and hand off chunks of it to callers.
                 */
                res = alloc_bootmem(chunk_size);
 -              if (!res)
 -                      return NULL;
 +              BUG_ON(!res);
                prom_early_allocated += chunk_size;
                memset(res, 0, chunk_size);
                free_mem = chunk_size;
@@@ -180,3 -183,20 +182,20 @@@ void __init olpc_dt_build_devicetree(vo
        pr_info("PROM DT: Built device tree with %u bytes of memory.\n",
                        prom_early_allocated);
  }
+ /* A list of DT node/bus matches that we want to expose as platform devices */
+ static struct of_device_id __initdata of_ids[] = {
+       { .compatible = "olpc,xo1-battery" },
+       { .compatible = "olpc,xo1-dcon" },
+       { .compatible = "olpc,xo1-rtc" },
+       {},
+ };
+ static int __init olpc_create_platform_devices(void)
+ {
+       if (machine_is_olpc())
+               return of_platform_bus_probe(NULL, of_ids, NULL);
+       else
+               return 0;
+ }
+ device_initcall(olpc_create_platform_devices);