]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'dma-mapping/dma-mapping-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 6 Sep 2012 05:51:34 +0000 (15:51 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 6 Sep 2012 05:51:34 +0000 (15:51 +1000)
1  2 
arch/arm/Kconfig
arch/arm/mach-kirkwood/common.c
arch/arm/mm/mmu.c

diff --combined arch/arm/Kconfig
index d275c5f04c3531fc14a100272e27a2dc154f5613,2f88d8d9770116014f7ff55e80d98c65fbb191ed..198713c916eaa3c6616dade9b55e74e3c6cd7ce5
@@@ -6,7 -6,7 +6,7 @@@ config AR
        select HAVE_DMA_API_DEBUG
        select HAVE_IDE if PCI || ISA || PCMCIA
        select HAVE_DMA_ATTRS
-       select HAVE_DMA_CONTIGUOUS if (CPU_V6 || CPU_V6K || CPU_V7)
+       select HAVE_DMA_CONTIGUOUS if MMU
        select HAVE_MEMBLOCK
        select RTC_LIB
        select SYS_SUPPORTS_APM_EMULATION
@@@ -49,8 -49,6 +49,8 @@@
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
        select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
 +      select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
 +      select MODULES_USE_ELF_REL
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
@@@ -281,6 -279,7 +281,6 @@@ config ARCH_INTEGRATO
        select GENERIC_CLOCKEVENTS
        select PLAT_VERSATILE
        select PLAT_VERSATILE_FPGA_IRQ
 -      select NEED_MACH_IO_H
        select NEED_MACH_MEMORY_H
        select SPARSE_IRQ
        select MULTI_IRQ_HANDLER
@@@ -313,6 -312,7 +313,6 @@@ config ARCH_VERSATIL
        select ICST
        select GENERIC_CLOCKEVENTS
        select ARCH_WANT_OPTIONAL_GPIOLIB
 -      select NEED_MACH_IO_H if PCI
        select PLAT_VERSATILE
        select PLAT_VERSATILE_CLOCK
        select PLAT_VERSATILE_CLCD
@@@ -407,19 -407,21 +407,19 @@@ config ARCH_GEMIN
        help
          Support for the Cortina Systems Gemini family SoCs
  
 -config ARCH_PRIMA2
 -      bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
 -      select CPU_V7
 +config ARCH_SIRF
 +      bool "CSR SiRF"
        select NO_IOPORT
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
 -      select CLKDEV_LOOKUP
 +      select COMMON_CLK
        select GENERIC_IRQ_CHIP
        select MIGHT_HAVE_CACHE_L2X0
        select PINCTRL
        select PINCTRL_SIRF
        select USE_OF
 -      select ZONE_DMA
        help
 -          Support for CSR SiRFSoC ARM Cortex A9 Platform
 +        Support for CSR SiRFprimaII/Marco/Polo platforms
  
  config ARCH_EBSA110
        bool "EBSA-110"
@@@ -454,7 -456,7 +454,7 @@@ config ARCH_FOOTBRIDG
        select FOOTBRIDGE
        select GENERIC_CLOCKEVENTS
        select HAVE_IDE
 -      select NEED_MACH_IO_H
 +      select NEED_MACH_IO_H if !MMU
        select NEED_MACH_MEMORY_H
        help
          Support for systems based on the DC21285 companion chip
@@@ -511,6 -513,7 +511,6 @@@ config ARCH_IOP13X
        select PCI
        select ARCH_SUPPORTS_MSI
        select VMSPLIT_1G
 -      select NEED_MACH_IO_H
        select NEED_MACH_MEMORY_H
        select NEED_RET_TO_USER
        help
@@@ -520,6 -523,7 +520,6 @@@ config ARCH_IOP32
        bool "IOP32x-based"
        depends on MMU
        select CPU_XSCALE
 -      select NEED_MACH_IO_H
        select NEED_RET_TO_USER
        select PLAT_IOP
        select PCI
@@@ -532,6 -536,7 +532,6 @@@ config ARCH_IOP33
        bool "IOP33x-based"
        depends on MMU
        select CPU_XSCALE
 -      select NEED_MACH_IO_H
        select NEED_RET_TO_USER
        select PLAT_IOP
        select PCI
@@@ -571,6 -576,7 +571,6 @@@ config ARCH_DOV
        select PCI
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
 -      select NEED_MACH_IO_H
        select PLAT_ORION
        help
          Support for the Marvell Dove SoC 88AP510
@@@ -581,6 -587,7 +581,6 @@@ config ARCH_KIRKWOO
        select PCI
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
 -      select NEED_MACH_IO_H
        select PLAT_ORION
        help
          Support for the following Marvell Kirkwood series SoCs:
@@@ -607,6 -614,7 +607,6 @@@ config ARCH_MV78XX
        select PCI
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
 -      select NEED_MACH_IO_H
        select PLAT_ORION
        help
          Support for the following Marvell MV78xx0 series SoCs:
@@@ -619,6 -627,7 +619,6 @@@ config ARCH_ORION5
        select PCI
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
 -      select NEED_MACH_IO_H
        select PLAT_ORION
        help
          Support for the following Marvell Orion 5x series SoCs:
@@@ -643,9 -652,8 +643,9 @@@ config ARCH_KS869
        bool "Micrel/Kendin KS8695"
        select CPU_ARM922T
        select ARCH_REQUIRE_GPIOLIB
 -      select ARCH_USES_GETTIMEOFFSET
        select NEED_MACH_MEMORY_H
 +      select CLKSRC_MMIO
 +      select GENERIC_CLOCKEVENTS
        help
          Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
          System-on-Chip devices.
@@@ -675,9 -683,9 +675,9 @@@ config ARCH_TEGR
        select HAVE_CLK
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
 -      select NEED_MACH_IO_H if PCI
        select ARCH_HAS_CPUFREQ
        select USE_OF
 +      select COMMON_CLK
        help
          This enables support for NVIDIA Tegra based systems (Tegra APX,
          Tegra 6xx and Tegra 2 series).
@@@ -701,6 -709,14 +701,6 @@@ config ARCH_PICOXCEL
          family of Femtocell devices.  The picoxcell support requires device tree
          for all boards.
  
 -config ARCH_PNX4008
 -      bool "Philips Nexperia PNX4008 Mobile"
 -      select CPU_ARM926T
 -      select CLKDEV_LOOKUP
 -      select ARCH_USES_GETTIMEOFFSET
 -      help
 -        This enables support for Philips PNX4008 mobile platform.
 -
  config ARCH_PXA
        bool "PXA2xx/PXA3xx-based"
        depends on MMU
@@@ -896,6 -912,7 +896,6 @@@ config ARCH_SHAR
        select PCI
        select ARCH_USES_GETTIMEOFFSET
        select NEED_MACH_MEMORY_H
 -      select NEED_MACH_IO_H
        help
          Support for the StrongARM based Digital DNARD machine, also known
          as "Shark" (<http://www.shark-linux.de/shark.html>).
@@@ -914,7 -931,6 +914,7 @@@ config ARCH_U30
        select COMMON_CLK
        select GENERIC_GPIO
        select ARCH_REQUIRE_GPIOLIB
 +      select SPARSE_IRQ
        help
          Support for ST-Ericsson U300 series mobile platforms.
  
@@@ -940,7 -956,6 +940,7 @@@ config ARCH_NOMADI
        select COMMON_CLK
        select GENERIC_CLOCKEVENTS
        select PINCTRL
 +      select PINCTRL_STN8815
        select MIGHT_HAVE_CACHE_L2X0
        select ARCH_REQUIRE_GPIOLIB
        help
@@@ -1103,8 -1118,6 +1103,8 @@@ source "arch/arm/mach-exynos/Kconfig
  
  source "arch/arm/mach-shmobile/Kconfig"
  
 +source "arch/arm/mach-prima2/Kconfig"
 +
  source "arch/arm/mach-tegra/Kconfig"
  
  source "arch/arm/mach-u300/Kconfig"
@@@ -1166,6 -1179,12 +1166,6 @@@ config XSCALE_PM
        depends on CPU_XSCALE
        default y
  
 -config CPU_HAS_PMU
 -      depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
 -                 (!ARCH_OMAP3 || OMAP3_EMU)
 -      default y
 -      bool
 -
  config MULTI_IRQ_HANDLER
        bool
        help
@@@ -1738,7 -1757,7 +1738,7 @@@ config HIGHPT
  
  config HW_PERF_EVENTS
        bool "Enable hardware performance counter support for perf events"
 -      depends on PERF_EVENTS && CPU_HAS_PMU
 +      depends on PERF_EVENTS
        default y
        help
          Enable hardware performance counter support for perf events. If
@@@ -1762,6 -1781,59 +1762,6 @@@ config FORCE_MAX_ZONEORDE
          This config option is actually maximum order plus one. For example,
          a value of 11 means that the largest free memory block is 2^10 pages.
  
 -config LEDS
 -      bool "Timer and CPU usage LEDs"
 -      depends on ARCH_CDB89712 || ARCH_EBSA110 || \
 -                 ARCH_EBSA285 || ARCH_INTEGRATOR || \
 -                 ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \
 -                 ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \
 -                 ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \
 -                 ARCH_AT91 || ARCH_DAVINCI || \
 -                 ARCH_KS8695 || MACH_RD88F5182 || ARCH_REALVIEW
 -      help
 -        If you say Y here, the LEDs on your machine will be used
 -        to provide useful information about your current system status.
 -
 -        If you are compiling a kernel for a NetWinder or EBSA-285, you will
 -        be able to select which LEDs are active using the options below. If
 -        you are compiling a kernel for the EBSA-110 or the LART however, the
 -        red LED will simply flash regularly to indicate that the system is
 -        still functional. It is safe to say Y here if you have a CATS
 -        system, but the driver will do nothing.
 -
 -config LEDS_TIMER
 -      bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \
 -                          OMAP_OSK_MISTRAL || MACH_OMAP_H2 \
 -                          || MACH_OMAP_PERSEUS2
 -      depends on LEDS
 -      depends on !GENERIC_CLOCKEVENTS
 -      default y if ARCH_EBSA110
 -      help
 -        If you say Y here, one of the system LEDs (the green one on the
 -        NetWinder, the amber one on the EBSA285, or the red one on the LART)
 -        will flash regularly to indicate that the system is still
 -        operational. This is mainly useful to kernel hackers who are
 -        debugging unstable kernels.
 -
 -        The LART uses the same LED for both Timer LED and CPU usage LED
 -        functions. You may choose to use both, but the Timer LED function
 -        will overrule the CPU usage LED.
 -
 -config LEDS_CPU
 -      bool "CPU usage LED" if (!ARCH_CDB89712 && !ARCH_EBSA110 && \
 -                      !ARCH_OMAP) \
 -                      || OMAP_OSK_MISTRAL || MACH_OMAP_H2 \
 -                      || MACH_OMAP_PERSEUS2
 -      depends on LEDS
 -      help
 -        If you say Y here, the red LED will be used to give a good real
 -        time indication of CPU usage, by lighting whenever the idle task
 -        is not currently executing.
 -
 -        The LART uses the same LED for both Timer LED and CPU usage LED
 -        functions. You may choose to use both, but the Timer LED function
 -        will overrule the CPU usage LED.
 -
  config ALIGNMENT_TRAP
        bool
        depends on CPU_CP15_MMU
index 936b31df644c5ac75e0dc224634a2de454aef7be,1201191d7f1bb24c386df88f5fe4de14e172b006..3f7b05f30b46bb2cf1366a3a6d41c6a20e27845f
   ****************************************************************************/
  static struct map_desc kirkwood_io_desc[] __initdata = {
        {
 -              .virtual        = KIRKWOOD_PCIE_IO_VIRT_BASE,
 -              .pfn            = __phys_to_pfn(KIRKWOOD_PCIE_IO_PHYS_BASE),
 -              .length         = KIRKWOOD_PCIE_IO_SIZE,
 -              .type           = MT_DEVICE,
 -      }, {
 -              .virtual        = KIRKWOOD_PCIE1_IO_VIRT_BASE,
 -              .pfn            = __phys_to_pfn(KIRKWOOD_PCIE1_IO_PHYS_BASE),
 -              .length         = KIRKWOOD_PCIE1_IO_SIZE,
 -              .type           = MT_DEVICE,
 -      }, {
                .virtual        = KIRKWOOD_REGS_VIRT_BASE,
                .pfn            = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE),
                .length         = KIRKWOOD_REGS_SIZE,
@@@ -507,6 -517,13 +507,13 @@@ void __init kirkwood_wdt_init(void
  void __init kirkwood_init_early(void)
  {
        orion_time_set_base(TIMER_VIRT_BASE);
+       /*
+        * Some Kirkwood devices allocate their coherent buffers from atomic
+        * context. Increase size of atomic coherent pool to make sure such
+        * the allocations won't fail.
+        */
+       init_dma_coherent_pool_size(SZ_1M);
  }
  
  int kirkwood_tclk;
diff --combined arch/arm/mm/mmu.c
index 18144e6a3115ea0e333b37c13395ce229abc5384,ee2a6f0fafd5136bbced6a45bdd429cd5a67c902..941dfb9e9a78635680d85225169d0edd187aea8c
@@@ -31,7 -31,6 +31,7 @@@
  
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
 +#include <asm/mach/pci.h>
  
  #include "mm.h"
  
@@@ -422,17 -421,6 +422,6 @@@ static void __init build_mem_type_table
        cp = &cache_policies[cachepolicy];
        vecs_pgprot = kern_pgprot = user_pgprot = cp->pte;
  
-       /*
-        * Enable CPU-specific coherency if supported.
-        * (Only available on XSC3 at the moment.)
-        */
-       if (arch_is_coherent() && cpu_is_xsc3()) {
-               mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S;
-               mem_types[MT_MEMORY].prot_pte |= L_PTE_SHARED;
-               mem_types[MT_MEMORY_DMA_READY].prot_pte |= L_PTE_SHARED;
-               mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S;
-               mem_types[MT_MEMORY_NONCACHED].prot_pte |= L_PTE_SHARED;
-       }
        /*
         * ARMv6 and above have extended page tables.
         */
@@@ -786,19 -774,6 +775,19 @@@ void __init iotable_init(struct map_des
        }
  }
  
 +void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
 +                                void *caller)
 +{
 +      struct vm_struct *vm;
 +
 +      vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm));
 +      vm->addr = (void *)addr;
 +      vm->size = size;
 +      vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING;
 +      vm->caller = caller;
 +      vm_area_add_early(vm);
 +}
 +
  #ifndef CONFIG_ARM_LPAE
  
  /*
  
  static void __init pmd_empty_section_gap(unsigned long addr)
  {
 -      struct vm_struct *vm;
 -
 -      vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm));
 -      vm->addr = (void *)addr;
 -      vm->size = SECTION_SIZE;
 -      vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
 -      vm->caller = pmd_empty_section_gap;
 -      vm_area_add_early(vm);
 +      vm_reserve_area_early(addr, SECTION_SIZE, pmd_empty_section_gap);
  }
  
  static void __init fill_pmd_gaps(void)
  
        /* we're still single threaded hence no lock needed here */
        for (vm = vmlist; vm; vm = vm->next) {
 -              if (!(vm->flags & VM_ARM_STATIC_MAPPING))
 +              if (!(vm->flags & (VM_ARM_STATIC_MAPPING | VM_ARM_EMPTY_MAPPING)))
                        continue;
                addr = (unsigned long)vm->addr;
                if (addr < next)
  #define fill_pmd_gaps() do { } while (0)
  #endif
  
 +#if defined(CONFIG_PCI) && !defined(CONFIG_NEED_MACH_IO_H)
 +static void __init pci_reserve_io(void)
 +{
 +      struct vm_struct *vm;
 +      unsigned long addr;
 +
 +      /* we're still single threaded hence no lock needed here */
 +      for (vm = vmlist; vm; vm = vm->next) {
 +              if (!(vm->flags & VM_ARM_STATIC_MAPPING))
 +                      continue;
 +              addr = (unsigned long)vm->addr;
 +              addr &= ~(SZ_2M - 1);
 +              if (addr == PCI_IO_VIRT_BASE)
 +                      return;
 +
 +      }
 +      vm_reserve_area_early(PCI_IO_VIRT_BASE, SZ_2M, pci_reserve_io);
 +}
 +#else
 +#define pci_reserve_io() do { } while (0)
 +#endif
 +
  static void * __initdata vmalloc_min =
        (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET);
  
@@@ -990,8 -950,8 +979,8 @@@ void __init sanity_check_meminfo(void
                 * Check whether this memory bank would partially overlap
                 * the vmalloc area.
                 */
 -              if (__va(bank->start + bank->size) > vmalloc_min ||
 -                  __va(bank->start + bank->size) < __va(bank->start)) {
 +              if (__va(bank->start + bank->size - 1) >= vmalloc_min ||
 +                  __va(bank->start + bank->size - 1) <= __va(bank->start)) {
                        unsigned long newsize = vmalloc_min - __va(bank->start);
                        printk(KERN_NOTICE "Truncating RAM at %.8llx-%.8llx "
                               "to -%.8llx (vmalloc region overlap).\n",
@@@ -1170,9 -1130,6 +1159,9 @@@ static void __init devicemaps_init(stru
                mdesc->map_io();
        fill_pmd_gaps();
  
 +      /* Reserve fixed i/o space in VMALLOC region */
 +      pci_reserve_io();
 +
        /*
         * Finally flush the caches and tlb to ensure that we're in a
         * consistent state wrt the writebuffer.  This also ensures that