Skip to content

Commit 2e03285

Browse files
committed
Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm
Pull ARM updates from Russell King: "This set includes adding support for Neon acceleration of RAID6 XOR code from Ard Biesheuvel, cache flushing and barrier updates from Will Deacon, and a cleanup to the ARM debug code which reduces the amount of code by about 500 lines. A few other cleanups, such as constifying the machine descriptors which already shouldn't be written to, cleaning up the printing of the L2 cache size" * 'for-linus' of git://git.linaro.org/people/rmk/linux-arm: (55 commits) ARM: 7826/1: debug: support debug ll on hisilicon soc ARM: 7830/1: delay: don't bother reporting bogomips in /proc/cpuinfo ARM: 7829/1: Add ".text.unlikely" and ".text.hot" to arm unwind tables ARM: 7828/1: ARMv7-M: implement restart routine common to all v7-M machines ARM: 7827/1: highbank: fix debug uart virtual address for LPAE ARM: 7823/1: errata: workaround Cortex-A15 erratum 773022 ARM: 7806/1: allow DEBUG_UNCOMPRESS for Tegra ARM: 7793/1: debug: use generic option for ep93xx PL10x debug port ARM: debug: move SPEAr debug to generic PL01x code ARM: debug: move davinci debug to generic 8250 code ARM: debug: move keystone debug to generic 8250 code ARM: debug: remove DEBUG_ROCKCHIP_UART ARM: debug: provide generic option choices for 8250 and PL01x ports ARM: debug: move PL01X debug include into arch/arm/include/debug/ ARM: debug: provide PL01x debug uart phys/virt address configuration options ARM: debug: add support for word accesses to debug/8250.S ARM: debug: move 8250 debug include into arch/arm/include/debug/ ARM: debug: provide 8250 debug uart phys/virt address configuration options ARM: debug: provide 8250 debug uart register shift configuration option ARM: debug: provide 8250 debug uart flow control configuration option ...
2 parents 356f9e7 + 141b974 commit 2e03285

103 files changed

Lines changed: 1590 additions & 1343 deletions

File tree

Some content is hidden

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

‎Documentation/arm/Booting‎

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ following:
1818
2. Initialise one serial port.
1919
3. Detect the machine type.
2020
4. Setup the kernel tagged list.
21-
5. Call the kernel image.
21+
5. Load initramfs.
22+
6. Call the kernel image.
2223

2324

2425
1. Setup and initialise RAM
@@ -120,12 +121,27 @@ tagged list.
120121
The boot loader must pass at a minimum the size and location of the
121122
system memory, and the root filesystem location. The dtb must be
122123
placed in a region of memory where the kernel decompressor will not
123-
overwrite it. The recommended placement is in the first 16KiB of RAM
124-
with the caveat that it may not be located at physical address 0 since
125-
the kernel interprets a value of 0 in r2 to mean neither a tagged list
126-
nor a dtb were passed.
124+
overwrite it, whilst remaining within the region which will be covered
125+
by the kernel's low-memory mapping.
127126

128-
5. Calling the kernel image
127+
A safe location is just above the 128MiB boundary from start of RAM.
128+
129+
5. Load initramfs.
130+
------------------
131+
132+
Existing boot loaders: OPTIONAL
133+
New boot loaders: OPTIONAL
134+
135+
If an initramfs is in use then, as with the dtb, it must be placed in
136+
a region of memory where the kernel decompressor will not overwrite it
137+
while also with the region which will be covered by the kernel's
138+
low-memory mapping.
139+
140+
A safe location is just above the device tree blob which itself will
141+
be loaded just above the 128MiB boundary from the start of RAM as
142+
recommended above.
143+
144+
6. Calling the kernel image
129145
---------------------------
130146

131147
Existing boot loaders: MANDATORY
@@ -136,11 +152,17 @@ is stored in flash, and is linked correctly to be run from flash,
136152
then it is legal for the boot loader to call the zImage in flash
137153
directly.
138154

139-
The zImage may also be placed in system RAM (at any location) and
140-
called there. Note that the kernel uses 16K of RAM below the image
141-
to store page tables. The recommended placement is 32KiB into RAM.
155+
The zImage may also be placed in system RAM and called there. The
156+
kernel should be placed in the first 128MiB of RAM. It is recommended
157+
that it is loaded above 32MiB in order to avoid the need to relocate
158+
prior to decompression, which will make the boot process slightly
159+
faster.
160+
161+
When booting a raw (non-zImage) kernel the constraints are tighter.
162+
In this case the kernel must be loaded at an offset into system equal
163+
to TEXT_OFFSET - PAGE_OFFSET.
142164

143-
In either case, the following conditions must be met:
165+
In any case, the following conditions must be met:
144166

145167
- Quiesce all DMA capable devices so that memory does not get
146168
corrupted by bogus network packets or disk data. This will save
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
Kernel mode NEON
2+
================
3+
4+
TL;DR summary
5+
-------------
6+
* Use only NEON instructions, or VFP instructions that don't rely on support
7+
code
8+
* Isolate your NEON code in a separate compilation unit, and compile it with
9+
'-mfpu=neon -mfloat-abi=softfp'
10+
* Put kernel_neon_begin() and kernel_neon_end() calls around the calls into your
11+
NEON code
12+
* Don't sleep in your NEON code, and be aware that it will be executed with
13+
preemption disabled
14+
15+
16+
Introduction
17+
------------
18+
It is possible to use NEON instructions (and in some cases, VFP instructions) in
19+
code that runs in kernel mode. However, for performance reasons, the NEON/VFP
20+
register file is not preserved and restored at every context switch or taken
21+
exception like the normal register file is, so some manual intervention is
22+
required. Furthermore, special care is required for code that may sleep [i.e.,
23+
may call schedule()], as NEON or VFP instructions will be executed in a
24+
non-preemptible section for reasons outlined below.
25+
26+
27+
Lazy preserve and restore
28+
-------------------------
29+
The NEON/VFP register file is managed using lazy preserve (on UP systems) and
30+
lazy restore (on both SMP and UP systems). This means that the register file is
31+
kept 'live', and is only preserved and restored when multiple tasks are
32+
contending for the NEON/VFP unit (or, in the SMP case, when a task migrates to
33+
another core). Lazy restore is implemented by disabling the NEON/VFP unit after
34+
every context switch, resulting in a trap when subsequently a NEON/VFP
35+
instruction is issued, allowing the kernel to step in and perform the restore if
36+
necessary.
37+
38+
Any use of the NEON/VFP unit in kernel mode should not interfere with this, so
39+
it is required to do an 'eager' preserve of the NEON/VFP register file, and
40+
enable the NEON/VFP unit explicitly so no exceptions are generated on first
41+
subsequent use. This is handled by the function kernel_neon_begin(), which
42+
should be called before any kernel mode NEON or VFP instructions are issued.
43+
Likewise, the NEON/VFP unit should be disabled again after use to make sure user
44+
mode will hit the lazy restore trap upon next use. This is handled by the
45+
function kernel_neon_end().
46+
47+
48+
Interruptions in kernel mode
49+
----------------------------
50+
For reasons of performance and simplicity, it was decided that there shall be no
51+
preserve/restore mechanism for the kernel mode NEON/VFP register contents. This
52+
implies that interruptions of a kernel mode NEON section can only be allowed if
53+
they are guaranteed not to touch the NEON/VFP registers. For this reason, the
54+
following rules and restrictions apply in the kernel:
55+
* NEON/VFP code is not allowed in interrupt context;
56+
* NEON/VFP code is not allowed to sleep;
57+
* NEON/VFP code is executed with preemption disabled.
58+
59+
If latency is a concern, it is possible to put back to back calls to
60+
kernel_neon_end() and kernel_neon_begin() in places in your code where none of
61+
the NEON registers are live. (Additional calls to kernel_neon_begin() should be
62+
reasonably cheap if no context switch occurred in the meantime)
63+
64+
65+
VFP and support code
66+
--------------------
67+
Earlier versions of VFP (prior to version 3) rely on software support for things
68+
like IEEE-754 compliant underflow handling etc. When the VFP unit needs such
69+
software assistance, it signals the kernel by raising an undefined instruction
70+
exception. The kernel responds by inspecting the VFP control registers and the
71+
current instruction and arguments, and emulates the instruction in software.
72+
73+
Such software assistance is currently not implemented for VFP instructions
74+
executed in kernel mode. If such a condition is encountered, the kernel will
75+
fail and generate an OOPS.
76+
77+
78+
Separating NEON code from ordinary code
79+
---------------------------------------
80+
The compiler is not aware of the special significance of kernel_neon_begin() and
81+
kernel_neon_end(), i.e., that it is only allowed to issue NEON/VFP instructions
82+
between calls to these respective functions. Furthermore, GCC may generate NEON
83+
instructions of its own at -O3 level if -mfpu=neon is selected, and even if the
84+
kernel is currently compiled at -O2, future changes may result in NEON/VFP
85+
instructions appearing in unexpected places if no special care is taken.
86+
87+
Therefore, the recommended and only supported way of using NEON/VFP in the
88+
kernel is by adhering to the following rules:
89+
* isolate the NEON code in a separate compilation unit and compile it with
90+
'-mfpu=neon -mfloat-abi=softfp';
91+
* issue the calls to kernel_neon_begin(), kernel_neon_end() as well as the calls
92+
into the unit containing the NEON code from a compilation unit which is *not*
93+
built with the GCC flag '-mfpu=neon' set.
94+
95+
As the kernel is compiled with '-msoft-float', the above will guarantee that
96+
both NEON and VFP instructions will only ever appear in designated compilation
97+
units at any optimization level.
98+
99+
100+
NEON assembler
101+
--------------
102+
NEON assembler is supported with no additional caveats as long as the rules
103+
above are followed.
104+
105+
106+
NEON code generated by GCC
107+
--------------------------
108+
The GCC option -ftree-vectorize (implied by -O3) tries to exploit implicit
109+
parallelism, and generates NEON code from ordinary C source code. This is fully
110+
supported as long as the rules above are followed.
111+
112+
113+
NEON intrinsics
114+
---------------
115+
NEON intrinsics are also supported. However, as code using NEON intrinsics
116+
relies on the GCC header <arm_neon.h>, (which #includes <stdint.h>), you should
117+
observe the following in addition to the rules above:
118+
* Compile the unit containing the NEON intrinsics with '-ffreestanding' so GCC
119+
uses its builtin version of <stdint.h> (this is a C99 header which the kernel
120+
does not supply);
121+
* Include <arm_neon.h> last, or at least after <linux/types.h>

‎Documentation/devicetree/bindings/arm/l2cc.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ Required properties:
1616
performs the same operation).
1717
"marvell,"aurora-outer-cache: Marvell Controller designed to be
1818
compatible with the ARM one with outer cache mode.
19-
"bcm,bcm11351-a2-pl310-cache": For Broadcom bcm11351 chipset where an
19+
"brcm,bcm11351-a2-pl310-cache": For Broadcom bcm11351 chipset where an
2020
offset needs to be added to the address before passing down to the L2
2121
cache controller
22+
"bcm,bcm11351-a2-pl310-cache": DEPRECATED by
23+
"brcm,bcm11351-a2-pl310-cache"
2224
- cache-unified : Specifies the cache is a unified cache.
2325
- cache-level : Should be set to 2 for a level 2 cache.
2426
- reg : Physical base address and size of cache controller's memory mapped

‎arch/arm/Kconfig‎

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ config ARM
5252
select HAVE_REGS_AND_STACK_ACCESS_API
5353
select HAVE_SYSCALL_TRACEPOINTS
5454
select HAVE_UID16
55+
select IRQ_FORCED_THREADING
5556
select KTIME_SCALAR
5657
select PERF_USE_VMALLOC
5758
select RTC_LIB
@@ -1372,6 +1373,15 @@ config ARM_ERRATA_798181
13721373
which sends an IPI to the CPUs that are running the same ASID
13731374
as the one being invalidated.
13741375

1376+
config ARM_ERRATA_773022
1377+
bool "ARM errata: incorrect instructions may be executed from loop buffer"
1378+
depends on CPU_V7
1379+
help
1380+
This option enables the workaround for the 773022 Cortex-A15
1381+
(up to r0p4) erratum. In certain rare sequences of code, the
1382+
loop buffer may deliver incorrect instructions. This
1383+
workaround disables the loop buffer to avoid the erratum.
1384+
13751385
endmenu
13761386

13771387
source "arch/arm/common/Kconfig"
@@ -1613,13 +1623,49 @@ config ARCH_NR_GPIO
16131623

16141624
source kernel/Kconfig.preempt
16151625

1616-
config HZ
1626+
config HZ_FIXED
16171627
int
16181628
default 200 if ARCH_EBSA110 || ARCH_S3C24XX || ARCH_S5P64X0 || \
16191629
ARCH_S5PV210 || ARCH_EXYNOS4
16201630
default AT91_TIMER_HZ if ARCH_AT91
16211631
default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE
1622-
default 100
1632+
1633+
choice
1634+
depends on !HZ_FIXED
1635+
prompt "Timer frequency"
1636+
1637+
config HZ_100
1638+
bool "100 Hz"
1639+
1640+
config HZ_200
1641+
bool "200 Hz"
1642+
1643+
config HZ_250
1644+
bool "250 Hz"
1645+
1646+
config HZ_300
1647+
bool "300 Hz"
1648+
1649+
config HZ_500
1650+
bool "500 Hz"
1651+
1652+
config HZ_1000
1653+
bool "1000 Hz"
1654+
1655+
endchoice
1656+
1657+
config HZ
1658+
int
1659+
default HZ_FIXED if HZ_FIXED
1660+
default 100 if HZ_100
1661+
default 200 if HZ_200
1662+
default 250 if HZ_250
1663+
default 300 if HZ_300
1664+
default 500 if HZ_500
1665+
default 1000
1666+
1667+
config SCHED_HRTICK
1668+
def_bool HIGH_RES_TIMERS
16231669

16241670
config SCHED_HRTICK
16251671
def_bool HIGH_RES_TIMERS
@@ -1756,6 +1802,9 @@ config HAVE_ARCH_TRANSPARENT_HUGEPAGE
17561802
def_bool y
17571803
depends on ARM_LPAE
17581804

1805+
config ARCH_WANT_GENERAL_HUGETLB
1806+
def_bool y
1807+
17591808
source "mm/Kconfig"
17601809

17611810
config FORCE_MAX_ZONEORDER
@@ -2174,6 +2223,13 @@ config NEON
21742223
Say Y to include support code for NEON, the ARMv7 Advanced SIMD
21752224
Extension.
21762225

2226+
config KERNEL_MODE_NEON
2227+
bool "Support for NEON in kernel mode"
2228+
default n
2229+
depends on NEON
2230+
help
2231+
Say Y to include support for NEON in kernel mode.
2232+
21772233
endmenu
21782234

21792235
menu "Userspace binary formats"
@@ -2198,7 +2254,7 @@ source "kernel/power/Kconfig"
21982254

21992255
config ARCH_SUSPEND_POSSIBLE
22002256
depends on !ARCH_S5PC100
2201-
depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \
2257+
depends on CPU_ARM920T || CPU_ARM926T || CPU_FEROCEON || CPU_SA1100 || \
22022258
CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK
22032259
def_bool y
22042260

0 commit comments

Comments
 (0)