Skip to content

Commit cea8f46

Browse files
committed
Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm
Pull ARM updates from Russell King: "First ARM push of this merge window, post me coming back from holiday. This is what has been in linux-next for the last few weeks. Not much to say which isn't described by the commit summaries." * 'for-linus' of git://git.linaro.org/people/rmk/linux-arm: (32 commits) ARM: 7463/1: topology: Update cpu_power according to DT information ARM: 7462/1: topology: factorize the update of sibling masks ARM: 7461/1: topology: Add arch_scale_freq_power function ARM: 7456/1: ptrace: provide separate functions for tracing syscall {entry,exit} ARM: 7455/1: audit: move syscall auditing until after ptrace SIGTRAP handling ARM: 7454/1: entry: don't bother with syscall tracing on ret_from_fork path ARM: 7453/1: audit: only allow syscall auditing for pure EABI userspace ARM: 7452/1: delay: allow timer-based delay implementation to be selected ARM: 7451/1: arch timer: implement read_current_timer and get_cycles ARM: 7450/1: dcache: select DCACHE_WORD_ACCESS for little-endian ARMv6+ CPUs ARM: 7449/1: use generic strnlen_user and strncpy_from_user functions ARM: 7448/1: perf: remove arm_perf_pmu_ids global enumeration ARM: 7447/1: rwlocks: remove unused branch labels from trylock routines ARM: 7446/1: spinlock: use ticket algorithm for ARMv6+ locking implementation ARM: 7445/1: mm: update CONTEXTIDR register to contain PID of current process ARM: 7444/1: kernel: add arch-timer C3STOP feature ARM: 7460/1: remove asm/locks.h ARM: 7439/1: head.S: simplify initial page table mapping ARM: 7437/1: zImage: Allow DTB command line concatenation with ATAG_CMDLINE ARM: 7436/1: Do not map the vectors page as write-through on UP systems ...
2 parents c1e7179 + 91b006d commit cea8f46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+964
-754
lines changed

arch/arm/Kconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ config ARM
4545
select GENERIC_SMP_IDLE_THREAD
4646
select KTIME_SCALAR
4747
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
48+
select GENERIC_STRNCPY_FROM_USER
49+
select GENERIC_STRNLEN_USER
50+
select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
4851
help
4952
The ARM series is a line of low-power-consumption RISC chip designs
5053
licensed by ARM Ltd and targeted at embedded applications and
@@ -2004,6 +2007,25 @@ config ARM_ATAG_DTB_COMPAT
20042007
bootloaders, this option allows zImage to extract the information
20052008
from the ATAG list and store it at run time into the appended DTB.
20062009

2010+
choice
2011+
prompt "Kernel command line type" if ARM_ATAG_DTB_COMPAT
2012+
default ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER
2013+
2014+
config ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER
2015+
bool "Use bootloader kernel arguments if available"
2016+
help
2017+
Uses the command-line options passed by the boot loader instead of
2018+
the device tree bootargs property. If the boot loader doesn't provide
2019+
any, the device tree bootargs property will be used.
2020+
2021+
config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND
2022+
bool "Extend with bootloader kernel arguments"
2023+
help
2024+
The command-line arguments provided by the boot loader will be
2025+
appended to the the device tree bootargs property.
2026+
2027+
endchoice
2028+
20072029
config CMDLINE
20082030
string "Default kernel command string"
20092031
default ""

arch/arm/Kconfig.debug

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,4 +395,13 @@ config ARM_KPROBES_TEST
395395
help
396396
Perform tests of kprobes API and instruction set simulation.
397397

398+
config PID_IN_CONTEXTIDR
399+
bool "Write the current PID to the CONTEXTIDR register"
400+
depends on CPU_COPY_V6
401+
help
402+
Enabling this option causes the kernel to write the current PID to
403+
the PROCID field of the CONTEXTIDR register, at the expense of some
404+
additional instructions during context switch. Say Y here only if you
405+
are planning to use hardware trace tools with this kernel.
406+
398407
endmenu

arch/arm/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#
1111
# Copyright (C) 1995-2001 by Russell King
1212

13+
# Ensure linker flags are correct
14+
LDFLAGS :=
15+
1316
LDFLAGS_vmlinux :=-p --no-undefined -X
1417
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
1518
LDFLAGS_vmlinux += --be8

arch/arm/boot/compressed/atags_to_fdt.c

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#include <asm/setup.h>
22
#include <libfdt.h>
33

4+
#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND)
5+
#define do_extend_cmdline 1
6+
#else
7+
#define do_extend_cmdline 0
8+
#endif
9+
410
static int node_offset(void *fdt, const char *node_path)
511
{
612
int offset = fdt_path_offset(fdt, node_path);
@@ -36,6 +42,48 @@ static int setprop_cell(void *fdt, const char *node_path,
3642
return fdt_setprop_cell(fdt, offset, property, val);
3743
}
3844

45+
static const void *getprop(const void *fdt, const char *node_path,
46+
const char *property, int *len)
47+
{
48+
int offset = fdt_path_offset(fdt, node_path);
49+
50+
if (offset == -FDT_ERR_NOTFOUND)
51+
return NULL;
52+
53+
return fdt_getprop(fdt, offset, property, len);
54+
}
55+
56+
static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
57+
{
58+
char cmdline[COMMAND_LINE_SIZE];
59+
const char *fdt_bootargs;
60+
char *ptr = cmdline;
61+
int len = 0;
62+
63+
/* copy the fdt command line into the buffer */
64+
fdt_bootargs = getprop(fdt, "/chosen", "bootargs", &len);
65+
if (fdt_bootargs)
66+
if (len < COMMAND_LINE_SIZE) {
67+
memcpy(ptr, fdt_bootargs, len);
68+
/* len is the length of the string
69+
* including the NULL terminator */
70+
ptr += len - 1;
71+
}
72+
73+
/* and append the ATAG_CMDLINE */
74+
if (fdt_cmdline) {
75+
len = strlen(fdt_cmdline);
76+
if (ptr - cmdline + len + 2 < COMMAND_LINE_SIZE) {
77+
*ptr++ = ' ';
78+
memcpy(ptr, fdt_cmdline, len);
79+
ptr += len;
80+
}
81+
}
82+
*ptr = '\0';
83+
84+
setprop_string(fdt, "/chosen", "bootargs", cmdline);
85+
}
86+
3987
/*
4088
* Convert and fold provided ATAGs into the provided FDT.
4189
*
@@ -72,8 +120,18 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space)
72120

73121
for_each_tag(atag, atag_list) {
74122
if (atag->hdr.tag == ATAG_CMDLINE) {
75-
setprop_string(fdt, "/chosen", "bootargs",
76-
atag->u.cmdline.cmdline);
123+
/* Append the ATAGS command line to the device tree
124+
* command line.
125+
* NB: This means that if the same parameter is set in
126+
* the device tree and in the tags, the one from the
127+
* tags will be chosen.
128+
*/
129+
if (do_extend_cmdline)
130+
merge_fdt_bootargs(fdt,
131+
atag->u.cmdline.cmdline);
132+
else
133+
setprop_string(fdt, "/chosen", "bootargs",
134+
atag->u.cmdline.cmdline);
77135
} else if (atag->hdr.tag == ATAG_MEM) {
78136
if (memcount >= sizeof(mem_reg_property)/4)
79137
continue;

arch/arm/include/asm/arch_timer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#ifndef __ASMARM_ARCH_TIMER_H
22
#define __ASMARM_ARCH_TIMER_H
33

4+
#include <asm/errno.h>
5+
46
#ifdef CONFIG_ARM_ARCH_TIMER
7+
#define ARCH_HAS_READ_CURRENT_TIMER
58
int arch_timer_of_register(void);
69
int arch_timer_sched_clock_init(void);
710
#else

arch/arm/include/asm/delay.h

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,22 @@
66
#ifndef __ASM_ARM_DELAY_H
77
#define __ASM_ARM_DELAY_H
88

9+
#include <asm/memory.h>
910
#include <asm/param.h> /* HZ */
1011

11-
extern void __delay(int loops);
12+
#define MAX_UDELAY_MS 2
13+
#define UDELAY_MULT ((UL(2199023) * HZ) >> 11)
14+
#define UDELAY_SHIFT 30
15+
16+
#ifndef __ASSEMBLY__
17+
18+
extern struct arm_delay_ops {
19+
void (*delay)(unsigned long);
20+
void (*const_udelay)(unsigned long);
21+
void (*udelay)(unsigned long);
22+
} arm_delay_ops;
23+
24+
#define __delay(n) arm_delay_ops.delay(n)
1225

1326
/*
1427
* This function intentionally does not exist; if you see references to
@@ -23,22 +36,27 @@ extern void __bad_udelay(void);
2336
* division by multiplication: you don't have to worry about
2437
* loss of precision.
2538
*
26-
* Use only for very small delays ( < 1 msec). Should probably use a
39+
* Use only for very small delays ( < 2 msec). Should probably use a
2740
* lookup table, really, as the multiplications take much too long with
2841
* short delays. This is a "reasonable" implementation, though (and the
2942
* first constant multiplications gets optimized away if the delay is
3043
* a constant)
3144
*/
32-
extern void __udelay(unsigned long usecs);
33-
extern void __const_udelay(unsigned long);
34-
35-
#define MAX_UDELAY_MS 2
45+
#define __udelay(n) arm_delay_ops.udelay(n)
46+
#define __const_udelay(n) arm_delay_ops.const_udelay(n)
3647

3748
#define udelay(n) \
3849
(__builtin_constant_p(n) ? \
3950
((n) > (MAX_UDELAY_MS * 1000) ? __bad_udelay() : \
40-
__const_udelay((n) * ((2199023U*HZ)>>11))) : \
51+
__const_udelay((n) * UDELAY_MULT)) : \
4152
__udelay(n))
4253

54+
/* Loop-based definitions for assembly code. */
55+
extern void __loop_delay(unsigned long loops);
56+
extern void __loop_udelay(unsigned long usecs);
57+
extern void __loop_const_udelay(unsigned long);
58+
59+
#endif /* __ASSEMBLY__ */
60+
4361
#endif /* defined(_ARM_DELAY_H) */
4462

0 commit comments

Comments
 (0)