]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 02:34:03 +0000 (18:34 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 02:34:03 +0000 (18:34 -0800)
Pull ARM updates from Russell King:
 "In this set, we have:
   - Refactoring of some of the old StrongARM-1100 GPIO code to make
     things simpler by Dmitry Eremin-Solenikov
   - Read-only and non-executable support for modules on ARM from Laura
     Abbot
   - Removal of unnecessary set_drvdata() calls in AMBA code
   - Some non-executable support for kernel lowmem mappings at the 1MB
     section granularity, and dumping of kernel page tables via debugfs
   - Some improvements for the timer/clock code on Footbridge platforms,
     and cleanup some of the LED code there
   - Fix fls/ffs() signatures to match x86 to prevent build warnings,
     particularly where these are used with min/max() macros
   - Avoid using the bootmem allocator on ARM (patches from Santosh
     Shilimkar)
   - Various asid/unaligned access updates from Will Deacon"

* 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: (51 commits)
  ARM: SMP implementations are not supposed to return from smp_ops.cpu_die()
  ARM: ignore memory below PHYS_OFFSET
  Fix select-induced Kconfig warning for ZBOOT_ROM
  ARM: fix ffs/fls implementations to match x86
  ARM: 7935/1: sa1100: collie: add gpio-keys configuration
  ARM: 7932/1: bcm: Add DEBUG_LL console support
  ARM: 7929/1: Remove duplicate SCHED_HRTICK config option
  ARM: 7928/1: kconfig: select HAVE_EFFICIENT_UNALIGNED_ACCESS for CPUv6+ && MMU
  ARM: 7927/1: dcache: select DCACHE_WORD_ACCESS for big-endian CPUs
  ARM: 7926/1: mm: flesh out and fix the comments in the ASID allocator
  ARM: 7925/1: mm: keep track of last ASID allocation to improve bitmap searching
  ARM: 7924/1: mm: don't bother with reserved ttbr0 when running with LPAE
  ARM: PCI: add legacy IDE IRQ implementation
  ARM: footbridge: cleanup LEDs code
  ARM: pgd allocation: retry on failure
  ARM: footbridge: add one-shot mode for DC21285 timer
  ARM: footbridge: add sched_clock implementation
  ARM: 7922/1: l2x0: add Marvell Tauros3 support
  ARM: 7877/1: use built-in byte swap function
  ARM: 7921/1: mcpm: remove redundant dsb instructions prior to sev
  ...

1  2 
arch/arm/Kconfig
arch/arm/kernel/setup.c
arch/arm/mm/init.c

diff --combined arch/arm/Kconfig
index ab1689c96a719d65407a4180d97f10010d64e340,c2dbf1416b9482eb2888e8e815d075c9dbde48e9..0b6d8bf1bc34021f0fec3d20e3634c88879486fe
@@@ -6,12 -6,13 +6,13 @@@ config AR
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_HAVE_CUSTOM_GPIO_H
        select ARCH_MIGHT_HAVE_PC_PARPORT
+       select ARCH_USE_BUILTIN_BSWAP
        select ARCH_USE_CMPXCHG_LOCKREF
        select ARCH_WANT_IPC_PARSE_VERSION
        select BUILDTIME_EXTABLE_SORT if MMU
        select CLONE_BACKWARDS
        select CPU_PM if (SUSPEND || CPU_IDLE)
-       select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN && MMU
+       select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS
        select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI)
        select GENERIC_CLOCKEVENTS_BROADCAST if SMP
        select GENERIC_IDLE_POLL_SETUP
        select HAVE_BPF_JIT
        select HAVE_CONTEXT_TRACKING
        select HAVE_C_RECORDMCOUNT
 +      select HAVE_CC_STACKPROTECTOR
        select HAVE_DEBUG_KMEMLEAK
        select HAVE_DMA_API_DEBUG
        select HAVE_DMA_ATTRS
        select HAVE_DMA_CONTIGUOUS if MMU
        select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
+       select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
        select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
        select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
        select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
@@@ -63,6 -64,7 +65,7 @@@
        select IRQ_FORCED_THREADING
        select KTIME_SCALAR
        select MODULES_USE_ELF_REL
+       select NO_BOOTMEM
        select OLD_SIGACTION
        select OLD_SIGSUSPEND3
        select PERF_USE_VMALLOC
@@@ -711,6 -713,7 +714,6 @@@ config ARCH_S3C24X
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_S3C_RTC if RTC_CLASS
        select MULTI_IRQ_HANDLER
 -      select NEED_MACH_GPIO_H
        select NEED_MACH_IO_H
        select SAMSUNG_ATAGS
        help
@@@ -723,7 -726,6 +726,7 @@@ config ARCH_S3C64X
        bool "Samsung S3C64XX"
        select ARCH_HAS_CPUFREQ
        select ARCH_REQUIRE_GPIOLIB
 +      select ARM_AMBA
        select ARM_VIC
        select CLKDEV_LOOKUP
        select CLKSRC_SAMSUNG_PWM
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_TCM
 -      select NEED_MACH_GPIO_H
        select NO_IOPORT
        select PLAT_SAMSUNG
        select PM_GENERIC_DOMAINS
@@@ -1593,7 -1596,7 +1596,7 @@@ config ARM_PSC
  config ARCH_NR_GPIO
        int
        default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
 -      default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || SOC_DRA7XX
 +      default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || SOC_DRA7XX || ARCH_S3C24XX || ARCH_S3C64XX
        default 392 if ARCH_U8500
        default 352 if ARCH_VT8500
        default 288 if ARCH_SUNXI
@@@ -1651,9 -1654,6 +1654,6 @@@ config H
  config SCHED_HRTICK
        def_bool HIGH_RES_TIMERS
  
- config SCHED_HRTICK
-       def_bool HIGH_RES_TIMERS
  config THUMB2_KERNEL
        bool "Compile the kernel in Thumb-2 mode" if !CPU_THUMBONLY
        depends on (CPU_V7 || CPU_V7M) && !CPU_V6 && !CPU_V6K
@@@ -1856,6 -1856,18 +1856,6 @@@ config SECCOM
          and the task is only allowed to execute a few safe syscalls
          defined by each seccomp mode.
  
 -config CC_STACKPROTECTOR
 -      bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
 -      help
 -        This option turns on the -fstack-protector GCC feature. This
 -        feature puts, at the beginning of functions, a canary value on
 -        the stack just before the return address, and validates
 -        the value just before actually returning.  Stack based buffer
 -        overflows (that need to overwrite this return address) now also
 -        overwrite the canary, which gets detected and the attack is then
 -        neutralized via a kernel panic.
 -        This feature requires gcc version 4.2 or above.
 -
  config SWIOTLB
        def_bool y
  
@@@ -1934,6 -1946,7 +1934,7 @@@ config ZBOOT_ROM_BS
  config ZBOOT_ROM
        bool "Compressed boot loader in ROM/flash"
        depends on ZBOOT_ROM_TEXT != ZBOOT_ROM_BSS
+       depends on !ARM_APPENDED_DTB && !XIP_KERNEL && !AUTO_ZRELADDR
        help
          Say Y here if you intend to execute your compressed kernel image
          (zImage) directly from ROM or flash.  If unsure, say N.
@@@ -1969,7 -1982,7 +1970,7 @@@ endchoic
  
  config ARM_APPENDED_DTB
        bool "Use appended device tree blob to zImage (EXPERIMENTAL)"
-       depends on OF && !ZBOOT_ROM
+       depends on OF
        help
          With this option, the boot code will look for a device tree binary
          (DTB) appended to zImage
@@@ -2057,7 -2070,7 +2058,7 @@@ endchoic
  
  config XIP_KERNEL
        bool "Kernel Execute-In-Place from ROM"
-       depends on !ZBOOT_ROM && !ARM_LPAE && !ARCH_MULTIPLATFORM
+       depends on !ARM_LPAE && !ARCH_MULTIPLATFORM
        help
          Execute-In-Place allows the kernel to run from non-volatile storage
          directly addressable by the CPU, such as NOR flash. This saves RAM
@@@ -2120,7 -2133,6 +2121,6 @@@ config CRASH_DUM
  
  config AUTO_ZRELADDR
        bool "Auto calculation of the decompressed kernel image address"
-       depends on !ZBOOT_ROM
        help
          ZRELADDR is the physical address where the decompressed kernel
          image will be placed. If AUTO_ZRELADDR is selected, the address
diff --combined arch/arm/kernel/setup.c
index 8ce1cbd08dba29369860d756b0a1a373afd607b2,a4729c6be25dc9aff11a519e0f15de0bcce6a913..1e8b030dbefd8b2b19da27d9ca8ecabfaf610bba
@@@ -334,7 -334,7 +334,7 @@@ static void __init cacheid_init(void
                cacheid = CACHEID_VIVT;
        }
  
-       printk("CPU: %s data cache, %s instruction cache\n",
+       pr_info("CPU: %s data cache, %s instruction cache\n",
                cache_is_vivt() ? "VIVT" :
                cache_is_vipt_aliasing() ? "VIPT aliasing" :
                cache_is_vipt_nonaliasing() ? "PIPT / VIPT nonaliasing" : "unknown",
@@@ -416,7 -416,7 +416,7 @@@ void notrace cpu_init(void
        struct stack *stk = &stacks[cpu];
  
        if (cpu >= NR_CPUS) {
-               printk(KERN_CRIT "CPU%u: bad primary CPU number\n", cpu);
+               pr_crit("CPU%u: bad primary CPU number\n", cpu);
                BUG();
        }
  
@@@ -484,7 -484,7 +484,7 @@@ void __init smp_setup_processor_id(void
         */
        set_my_cpu_offset(0);
  
-       printk(KERN_INFO "Booting Linux on physical CPU 0x%x\n", mpidr);
+       pr_info("Booting Linux on physical CPU 0x%x\n", mpidr);
  }
  
  struct mpidr_hash mpidr_hash;
@@@ -564,8 -564,8 +564,8 @@@ static void __init setup_processor(void
         */
        list = lookup_processor_type(read_cpuid_id());
        if (!list) {
-               printk("CPU configuration botched (ID %08x), unable "
-                      "to continue.\n", read_cpuid_id());
+               pr_err("CPU configuration botched (ID %08x), unable to continue.\n",
+                      read_cpuid_id());
                while (1);
        }
  
        cpu_cache = *list->cache;
  #endif
  
-       printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
-              cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
-              proc_arch[cpu_architecture()], cr_alignment);
+       pr_info("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
+               cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
+               proc_arch[cpu_architecture()], cr_alignment);
  
        snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c",
                 list->arch_name, ENDIANNESS);
@@@ -629,8 -629,8 +629,8 @@@ int __init arm_add_memory(u64 start, u6
        u64 aligned_start;
  
        if (meminfo.nr_banks >= NR_BANKS) {
-               printk(KERN_CRIT "NR_BANKS too low, "
-                       "ignoring memory at 0x%08llx\n", (long long)start);
+               pr_crit("NR_BANKS too low, ignoring memory at 0x%08llx\n",
+                       (long long)start);
                return -EINVAL;
        }
  
  
  #ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT
        if (aligned_start > ULONG_MAX) {
-               printk(KERN_CRIT "Ignoring memory at 0x%08llx outside "
-                      "32-bit physical address space\n", (long long)start);
+               pr_crit("Ignoring memory at 0x%08llx outside 32-bit physical address space\n",
+                       (long long)start);
                return -EINVAL;
        }
  
        if (aligned_start + size > ULONG_MAX) {
-               printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in "
-                       "32-bit physical address space\n", (long long)start);
+               pr_crit("Truncating memory at 0x%08llx to fit in 32-bit physical address space\n",
+                       (long long)start);
                /*
                 * To ensure bank->start + bank->size is representable in
                 * 32 bits, we use ULONG_MAX as the upper limit rather than 4GB.
        }
  #endif
  
+       if (aligned_start < PHYS_OFFSET) {
+               if (aligned_start + size <= PHYS_OFFSET) {
+                       pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n",
+                               aligned_start, aligned_start + size);
+                       return -EINVAL;
+               }
+               pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n",
+                       aligned_start, (u64)PHYS_OFFSET);
+               size -= PHYS_OFFSET - aligned_start;
+               aligned_start = PHYS_OFFSET;
+       }
        bank->start = aligned_start;
        bank->size = size & ~(phys_addr_t)(PAGE_SIZE - 1);
  
@@@ -717,7 -731,7 +731,7 @@@ static void __init request_standard_res
        kernel_data.end     = virt_to_phys(_end - 1);
  
        for_each_memblock(memory, region) {
 -              res = alloc_bootmem_low(sizeof(*res));
 +              res = memblock_virt_alloc(sizeof(*res), 0);
                res->name  = "System RAM";
                res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
                res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
@@@ -817,18 -831,17 +831,17 @@@ static void __init reserve_crashkernel(
        if (ret)
                return;
  
-       ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE);
+       ret = memblock_reserve(crash_base, crash_size);
        if (ret < 0) {
-               printk(KERN_WARNING "crashkernel reservation failed - "
-                      "memory is in use (0x%lx)\n", (unsigned long)crash_base);
+               pr_warn("crashkernel reservation failed - memory is in use (0x%lx)\n",
+                       (unsigned long)crash_base);
                return;
        }
  
-       printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
-              "for crashkernel (System RAM: %ldMB)\n",
-              (unsigned long)(crash_size >> 20),
-              (unsigned long)(crash_base >> 20),
-              (unsigned long)(total_mem >> 20));
+       pr_info("Reserving %ldMB of memory at %ldMB for crashkernel (System RAM: %ldMB)\n",
+               (unsigned long)(crash_size >> 20),
+               (unsigned long)(crash_base >> 20),
+               (unsigned long)(total_mem >> 20));
  
        crashk_res.start = crash_base;
        crashk_res.end = crash_base + crash_size - 1;
diff --combined arch/arm/mm/init.c
index 11eb8add78202f51a86a9d248b792a1771b16081,6dd66a999d9f2c69b291b300d8f79e63577a503b..f57fb338cc8aaa2ee533ca77be3e06994a74b25f
@@@ -92,6 -92,9 +92,6 @@@ void show_mem(unsigned int filter
        printk("Mem-info:\n");
        show_free_areas(filter);
  
 -      if (filter & SHOW_MEM_FILTER_PAGE_COUNT)
 -              return;
 -
        for_each_bank (i, mi) {
                struct membank *bank = &mi->bank[i];
                unsigned int pfn1, pfn2;
@@@ -142,58 -145,6 +142,6 @@@ static void __init find_limits(unsigne
        *max_high = bank_pfn_end(&mi->bank[mi->nr_banks - 1]);
  }
  
- static void __init arm_bootmem_init(unsigned long start_pfn,
-       unsigned long end_pfn)
- {
-       struct memblock_region *reg;
-       unsigned int boot_pages;
-       phys_addr_t bitmap;
-       pg_data_t *pgdat;
-       /*
-        * Allocate the bootmem bitmap page.  This must be in a region
-        * of memory which has already been mapped.
-        */
-       boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn);
-       bitmap = memblock_alloc_base(boot_pages << PAGE_SHIFT, L1_CACHE_BYTES,
-                               __pfn_to_phys(end_pfn));
-       /*
-        * Initialise the bootmem allocator, handing the
-        * memory banks over to bootmem.
-        */
-       node_set_online(0);
-       pgdat = NODE_DATA(0);
-       init_bootmem_node(pgdat, __phys_to_pfn(bitmap), start_pfn, end_pfn);
-       /* Free the lowmem regions from memblock into bootmem. */
-       for_each_memblock(memory, reg) {
-               unsigned long start = memblock_region_memory_base_pfn(reg);
-               unsigned long end = memblock_region_memory_end_pfn(reg);
-               if (end >= end_pfn)
-                       end = end_pfn;
-               if (start >= end)
-                       break;
-               free_bootmem(__pfn_to_phys(start), (end - start) << PAGE_SHIFT);
-       }
-       /* Reserve the lowmem memblock reserved regions in bootmem. */
-       for_each_memblock(reserved, reg) {
-               unsigned long start = memblock_region_reserved_base_pfn(reg);
-               unsigned long end = memblock_region_reserved_end_pfn(reg);
-               if (end >= end_pfn)
-                       end = end_pfn;
-               if (start >= end)
-                       break;
-               reserve_bootmem(__pfn_to_phys(start),
-                               (end - start) << PAGE_SHIFT, BOOTMEM_DEFAULT);
-       }
- }
  #ifdef CONFIG_ZONE_DMA
  
  phys_addr_t arm_dma_zone_size __read_mostly;
@@@ -233,7 -184,7 +181,7 @@@ void __init setup_dma_zone(const struc
  #endif
  }
  
- static void __init arm_bootmem_free(unsigned long min, unsigned long max_low,
+ static void __init zone_sizes_init(unsigned long min, unsigned long max_low,
        unsigned long max_high)
  {
        unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES];
@@@ -381,7 -332,6 +329,6 @@@ void __init arm_memblock_init(struct me
        dma_contiguous_reserve(min(arm_dma_limit, arm_lowmem_limit));
  
        arm_memblock_steal_permitted = false;
-       memblock_allow_resize();
        memblock_dump_all();
  }
  
@@@ -389,12 -339,11 +336,11 @@@ void __init bootmem_init(void
  {
        unsigned long min, max_low, max_high;
  
+       memblock_allow_resize();
        max_low = max_high = 0;
  
        find_limits(&min, &max_low, &max_high);
  
-       arm_bootmem_init(min, max_low);
        /*
         * Sparsemem tries to allocate bootmem in memory_present(),
         * so must be done after the fixed reservations
         * the sparse mem_map arrays initialized by sparse_init()
         * for memmap_init_zone(), otherwise all PFNs are invalid.
         */
-       arm_bootmem_free(min, max_low, max_high);
+       zone_sizes_init(min, max_low, max_high);
  
        /*
         * This doesn't seem to be used by the Linux memory manager any
@@@ -458,7 -407,7 +404,7 @@@ free_memmap(unsigned long start_pfn, un
         * free the section of the memmap array.
         */
        if (pg < pgend)
 -              free_bootmem(pg, pgend - pg);
 +              memblock_free_early(pg, pgend - pg);
  }
  
  /*
@@@ -584,7 -533,7 +530,7 @@@ void __init mem_init(void
        extern u32 itcm_end;
  #endif
  
-       max_mapnr   = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map;
+       set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
  
        /* this will put all unused low memory onto the freelists */
        free_unused_memmap(&meminfo);