mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-31 08:28:13 +00:00
Merge branch 'for-rmk/perf' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into devel-stable
* Support for Qualcomm Krait processors (run perf on your phone!) * Support for Cortex-A12 (run perf stat on your FPGA!) * Support for perf_sample_event_took, allowing us to automatically decrease the sample rate if we can't handle the PMU interrupts quickly enough (run perf record on your FPGA!). As part of the Krait support, we also gain support for PPI generation by the PMU.
This commit is contained in:
commit
3ba4cea219
548 changed files with 7089 additions and 3198 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -92,3 +92,6 @@ extra_certificates
|
|||
signing_key.priv
|
||||
signing_key.x509
|
||||
x509.genkey
|
||||
|
||||
# Kconfig presets
|
||||
all.config
|
||||
|
|
|
@ -29,6 +29,8 @@ DMA-ISA-LPC.txt
|
|||
- How to do DMA with ISA (and LPC) devices.
|
||||
DMA-attributes.txt
|
||||
- listing of the various possible attributes a DMA region can have
|
||||
dmatest.txt
|
||||
- how to compile, configure and use the dmatest system.
|
||||
DocBook/
|
||||
- directory with DocBook templates etc. for kernel documentation.
|
||||
EDID/
|
||||
|
@ -77,6 +79,8 @@ arm/
|
|||
- directory with info about Linux on the ARM architecture.
|
||||
arm64/
|
||||
- directory with info about Linux on the 64 bit ARM architecture.
|
||||
assoc_array.txt
|
||||
- generic associative array intro.
|
||||
atomic_ops.txt
|
||||
- semantics and behavior of atomic and bitmask operations.
|
||||
auxdisplay/
|
||||
|
@ -87,6 +91,8 @@ bad_memory.txt
|
|||
- how to use kernel parameters to exclude bad RAM regions.
|
||||
basic_profiling.txt
|
||||
- basic instructions for those who wants to profile Linux kernel.
|
||||
bcache.txt
|
||||
- Block-layer cache on fast SSDs to improve slow (raid) I/O performance.
|
||||
binfmt_misc.txt
|
||||
- info on the kernel support for extra binary formats.
|
||||
blackfin/
|
||||
|
@ -171,6 +177,8 @@ early-userspace/
|
|||
- info about initramfs, klibc, and userspace early during boot.
|
||||
edac.txt
|
||||
- information on EDAC - Error Detection And Correction
|
||||
efi-stub.txt
|
||||
- How to use the EFI boot stub to bypass GRUB or elilo on EFI systems.
|
||||
eisa.txt
|
||||
- info on EISA bus support.
|
||||
email-clients.txt
|
||||
|
@ -195,8 +203,8 @@ futex-requeue-pi.txt
|
|||
- info on requeueing of tasks from a non-PI futex to a PI futex
|
||||
gcov.txt
|
||||
- use of GCC's coverage testing tool "gcov" with the Linux kernel
|
||||
gpio.txt
|
||||
- overview of GPIO (General Purpose Input/Output) access conventions.
|
||||
gpio/
|
||||
- gpio related documentation
|
||||
hid/
|
||||
- directory with information on human interface devices
|
||||
highuid.txt
|
||||
|
@ -255,6 +263,8 @@ kernel-docs.txt
|
|||
- listing of various WWW + books that document kernel internals.
|
||||
kernel-parameters.txt
|
||||
- summary listing of command line / boot prompt args for the kernel.
|
||||
kernel-per-CPU-kthreads.txt
|
||||
- List of all per-CPU kthreads and how they introduce jitter.
|
||||
kmemcheck.txt
|
||||
- info on dynamic checker that detects uses of uninitialized memory.
|
||||
kmemleak.txt
|
||||
|
@ -299,8 +309,6 @@ memory-devices/
|
|||
- directory with info on parts like the Texas Instruments EMIF driver
|
||||
memory-hotplug.txt
|
||||
- Hotpluggable memory support, how to use and current status.
|
||||
memory.txt
|
||||
- info on typical Linux memory problems.
|
||||
metag/
|
||||
- directory with info about Linux on Meta architecture.
|
||||
mips/
|
||||
|
@ -311,6 +319,8 @@ mmc/
|
|||
- directory with info about the MMC subsystem
|
||||
mn10300/
|
||||
- directory with info about the mn10300 architecture port
|
||||
module-signing.txt
|
||||
- Kernel module signing for increased security when loading modules.
|
||||
mtd/
|
||||
- directory with info about memory technology devices (flash)
|
||||
mono.txt
|
||||
|
@ -343,6 +353,8 @@ pcmcia/
|
|||
- info on the Linux PCMCIA driver.
|
||||
percpu-rw-semaphore.txt
|
||||
- RCU based read-write semaphore optimized for locking for reading
|
||||
phy.txt
|
||||
- Description of the generic PHY framework.
|
||||
pi-futex.txt
|
||||
- documentation on lightweight priority inheritance futexes.
|
||||
pinctrl.txt
|
||||
|
@ -431,6 +443,8 @@ sysrq.txt
|
|||
- info on the magic SysRq key.
|
||||
target/
|
||||
- directory with info on generating TCM v4 fabric .ko modules
|
||||
this_cpu_ops.txt
|
||||
- List rationale behind and the way to use this_cpu operations.
|
||||
thermal/
|
||||
- directory with information on managing thermal issues (CPU/temp)
|
||||
trace/
|
||||
|
@ -469,6 +483,8 @@ wimax/
|
|||
- directory with info about Intel Wireless Wimax Connections
|
||||
workqueue.txt
|
||||
- information on the Concurrency Managed Workqueue implementation
|
||||
ww-mutex-design.txt
|
||||
- Intro to Mutex wait/would deadlock handling.s
|
||||
x86/x86_64/
|
||||
- directory with info on Linux support for AMD x86-64 (Hammer) machines.
|
||||
xtensa/
|
||||
|
|
|
@ -3,7 +3,8 @@ Date: Nov 2010
|
|||
Contact: Kay Sievers <kay.sievers@vrfy.org>
|
||||
Description:
|
||||
Shows the list of currently configured
|
||||
console devices, like 'tty1 ttyS0'.
|
||||
tty devices used for the console,
|
||||
like 'tty1 ttyS0'.
|
||||
The last entry in the file is the active
|
||||
device connected to /dev/console.
|
||||
The file supports poll() to detect virtual
|
||||
|
|
|
@ -8,6 +8,8 @@ listRCU.txt
|
|||
- Using RCU to Protect Read-Mostly Linked Lists
|
||||
lockdep.txt
|
||||
- RCU and lockdep checking
|
||||
lockdep-splat.txt
|
||||
- RCU Lockdep splats explained.
|
||||
NMI-RCU.txt
|
||||
- Using RCU to Protect Dynamic NMI Handlers
|
||||
rcubarrier.txt
|
||||
|
|
|
@ -4,6 +4,8 @@ Booting
|
|||
- requirements for booting
|
||||
Interrupts
|
||||
- ARM Interrupt subsystem documentation
|
||||
IXP4xx
|
||||
- Intel IXP4xx Network processor.
|
||||
msm
|
||||
- MSM specific documentation
|
||||
Netwinder
|
||||
|
@ -24,8 +26,16 @@ SPEAr
|
|||
- ST SPEAr platform Linux Overview
|
||||
VFP/
|
||||
- Release notes for Linux Kernel Vector Floating Point support code
|
||||
cluster-pm-race-avoidance.txt
|
||||
- Algorithm for CPU and Cluster setup/teardown
|
||||
empeg/
|
||||
- Ltd's Empeg MP3 Car Audio Player
|
||||
firmware.txt
|
||||
- Secure firmware registration and calling.
|
||||
kernel_mode_neon.txt
|
||||
- How to use NEON instructions in kernel mode
|
||||
kernel_user_helpers.txt
|
||||
- Helper functions in kernel space made available for userspace.
|
||||
mem_alignment
|
||||
- alignment abort handler documentation
|
||||
memory.txt
|
||||
|
@ -34,3 +44,7 @@ nwfpe/
|
|||
- NWFPE floating point emulator documentation
|
||||
swp_emulation
|
||||
- SWP/SWPB emulation handler/logging description
|
||||
tcm.txt
|
||||
- ARM Tightly Coupled Memory
|
||||
vlocks.txt
|
||||
- Voting locks, low-level mechanism relying on memory system atomic writes.
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
00-INDEX
|
||||
- This file
|
||||
|
||||
Makefile
|
||||
- Makefile for gptimers example file.
|
||||
bfin-gpio-notes.txt
|
||||
- Notes in developing/using bfin-gpio driver.
|
||||
|
||||
bfin-spi-notes.txt
|
||||
- Notes for using bfin spi bus driver.
|
||||
gptimers-example.c
|
||||
- gptimers example
|
||||
|
|
|
@ -14,6 +14,8 @@ deadline-iosched.txt
|
|||
- Deadline IO scheduler tunables
|
||||
ioprio.txt
|
||||
- Block io priorities (in CFQ scheduler)
|
||||
null_blk.txt
|
||||
- Null block for block-layer benchmarking.
|
||||
queue-sysfs.txt
|
||||
- Queue's sysfs entries
|
||||
request.txt
|
||||
|
|
|
@ -8,3 +8,5 @@ https://lists.ozlabs.org/listinfo/devicetree-discuss
|
|||
- this file
|
||||
booting-without-of.txt
|
||||
- Booting Linux without Open Firmware, describes history and format of device trees.
|
||||
usage-model.txt
|
||||
- How Linux uses DT and what DT aims to solve.
|
|
@ -9,6 +9,7 @@ Required properties:
|
|||
- compatible : should be one of
|
||||
"arm,armv8-pmuv3"
|
||||
"arm,cortex-a15-pmu"
|
||||
"arm,cortex-a12-pmu"
|
||||
"arm,cortex-a9-pmu"
|
||||
"arm,cortex-a8-pmu"
|
||||
"arm,cortex-a7-pmu"
|
||||
|
@ -16,7 +17,14 @@ Required properties:
|
|||
"arm,arm11mpcore-pmu"
|
||||
"arm,arm1176-pmu"
|
||||
"arm,arm1136-pmu"
|
||||
- interrupts : 1 combined interrupt or 1 per core.
|
||||
"qcom,krait-pmu"
|
||||
- interrupts : 1 combined interrupt or 1 per core. If the interrupt is a per-cpu
|
||||
interrupt (PPI) then 1 interrupt should be specified.
|
||||
|
||||
Optional properties:
|
||||
|
||||
- qcom,no-pc-write : Indicates that this PMU doesn't support the 0xc and 0xd
|
||||
events.
|
||||
|
||||
Example:
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@ Required properties:
|
|||
- #address-cells: should be one. The cell is the slot id.
|
||||
- #size-cells: should be zero.
|
||||
- at least one slot node
|
||||
- clock-names: tuple listing input clock names.
|
||||
Required elements: "mci_clk"
|
||||
- clocks: phandles to input clocks.
|
||||
|
||||
The node contains child nodes for each slot that the platform uses
|
||||
|
||||
|
@ -24,6 +27,8 @@ mmc0: mmc@f0008000 {
|
|||
interrupts = <12 4>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
clock-names = "mci_clk";
|
||||
clocks = <&mci0_clk>;
|
||||
|
||||
[ child node definitions...]
|
||||
};
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
* Allwinner EMAC ethernet controller
|
||||
|
||||
Required properties:
|
||||
- compatible: should be "allwinner,sun4i-emac".
|
||||
- compatible: should be "allwinner,sun4i-a10-emac" (Deprecated:
|
||||
"allwinner,sun4i-emac")
|
||||
- reg: address and length of the register set for the device.
|
||||
- interrupts: interrupt for the device
|
||||
- phy: A phandle to a phy node defining the PHY address (as the reg
|
||||
|
@ -14,7 +15,7 @@ Optional properties:
|
|||
Example:
|
||||
|
||||
emac: ethernet@01c0b000 {
|
||||
compatible = "allwinner,sun4i-emac";
|
||||
compatible = "allwinner,sun4i-a10-emac";
|
||||
reg = <0x01c0b000 0x1000>;
|
||||
interrupts = <55>;
|
||||
clocks = <&ahb_gates 17>;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
* Allwinner A10 MDIO Ethernet Controller interface
|
||||
|
||||
Required properties:
|
||||
- compatible: should be "allwinner,sun4i-mdio".
|
||||
- compatible: should be "allwinner,sun4i-a10-mdio"
|
||||
(Deprecated: "allwinner,sun4i-mdio").
|
||||
- reg: address and length of the register set for the device.
|
||||
|
||||
Optional properties:
|
||||
|
@ -9,7 +10,7 @@ Optional properties:
|
|||
|
||||
Example at the SoC level:
|
||||
mdio@01c0b080 {
|
||||
compatible = "allwinner,sun4i-mdio";
|
||||
compatible = "allwinner,sun4i-a10-mdio";
|
||||
reg = <0x01c0b080 0x14>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
|
47
Documentation/devicetree/bindings/power/bq2415x.txt
Normal file
47
Documentation/devicetree/bindings/power/bq2415x.txt
Normal file
|
@ -0,0 +1,47 @@
|
|||
Binding for TI bq2415x Li-Ion Charger
|
||||
|
||||
Required properties:
|
||||
- compatible: Should contain one of the following:
|
||||
* "ti,bq24150"
|
||||
* "ti,bq24150"
|
||||
* "ti,bq24150a"
|
||||
* "ti,bq24151"
|
||||
* "ti,bq24151a"
|
||||
* "ti,bq24152"
|
||||
* "ti,bq24153"
|
||||
* "ti,bq24153a"
|
||||
* "ti,bq24155"
|
||||
* "ti,bq24156"
|
||||
* "ti,bq24156a"
|
||||
* "ti,bq24158"
|
||||
- reg: integer, i2c address of the device.
|
||||
- ti,current-limit: integer, initial maximum current charger can pull
|
||||
from power supply in mA.
|
||||
- ti,weak-battery-voltage: integer, weak battery voltage threshold in mV.
|
||||
The chip will use slow precharge if battery voltage
|
||||
is below this value.
|
||||
- ti,battery-regulation-voltage: integer, maximum charging voltage in mV.
|
||||
- ti,charge-current: integer, maximum charging current in mA.
|
||||
- ti,termination-current: integer, charge will be terminated when current in
|
||||
constant-voltage phase drops below this value (in mA).
|
||||
- ti,resistor-sense: integer, value of sensing resistor in milliohm.
|
||||
|
||||
Optional properties:
|
||||
- ti,usb-charger-detection: phandle to usb charger detection device.
|
||||
(required for auto mode)
|
||||
|
||||
Example from Nokia N900:
|
||||
|
||||
bq24150a {
|
||||
compatible = "ti,bq24150a";
|
||||
reg = <0x6b>;
|
||||
|
||||
ti,current-limit = <100>;
|
||||
ti,weak-battery-voltage = <3400>;
|
||||
ti,battery-regulation-voltage = <4200>;
|
||||
ti,charge-current = <650>;
|
||||
ti,termination-current = <100>;
|
||||
ti,resistor-sense = <68>;
|
||||
|
||||
ti,usb-charger-detection = <&isp1704>;
|
||||
};
|
|
@ -5,6 +5,9 @@ Required properties:
|
|||
- reg: Address and length of the register set for the device
|
||||
- interrupts: Should contain spi interrupt
|
||||
- cs-gpios: chipselects
|
||||
- clock-names: tuple listing input clock names.
|
||||
Required elements: "spi_clk"
|
||||
- clocks: phandles to input clocks.
|
||||
|
||||
Example:
|
||||
|
||||
|
@ -14,6 +17,8 @@ spi1: spi@fffcc000 {
|
|||
interrupts = <13 4 5>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
clocks = <&spi1_clk>;
|
||||
clock-names = "spi_clk";
|
||||
cs-gpios = <&pioB 3 0>;
|
||||
status = "okay";
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ ad Avionic Design GmbH
|
|||
adi Analog Devices, Inc.
|
||||
aeroflexgaisler Aeroflex Gaisler AB
|
||||
ak Asahi Kasei Corp.
|
||||
allwinner Allwinner Technology Co., Ltd.
|
||||
altr Altera Corp.
|
||||
amcc Applied Micro Circuits Corporation (APM, formally AMCC)
|
||||
amstaos AMS-Taos Inc.
|
||||
|
@ -40,6 +41,7 @@ gmt Global Mixed-mode Technology, Inc.
|
|||
gumstix Gumstix, Inc.
|
||||
haoyu Haoyu Microelectronic Co. Ltd.
|
||||
hisilicon Hisilicon Limited.
|
||||
honeywell Honeywell
|
||||
hp Hewlett Packard
|
||||
ibm International Business Machines (IBM)
|
||||
idt Integrated Device Technologies, Inc.
|
||||
|
@ -55,6 +57,7 @@ maxim Maxim Integrated Products
|
|||
microchip Microchip Technology Inc.
|
||||
mosaixtech Mosaix Technologies, Inc.
|
||||
national National Semiconductor
|
||||
neonode Neonode Inc.
|
||||
nintendo Nintendo
|
||||
nvidia NVIDIA
|
||||
nxp NXP Semiconductors
|
||||
|
@ -64,7 +67,7 @@ phytec PHYTEC Messtechnik GmbH
|
|||
picochip Picochip Ltd
|
||||
powervr PowerVR (deprecated, use img)
|
||||
qca Qualcomm Atheros, Inc.
|
||||
qcom Qualcomm, Inc.
|
||||
qcom Qualcomm Technologies, Inc
|
||||
ralink Mediatek/Ralink Technology Corp.
|
||||
ramtron Ramtron International
|
||||
realtek Realtek Semiconductor Corp.
|
||||
|
@ -78,6 +81,7 @@ silabs Silicon Laboratories
|
|||
simtek
|
||||
sirf SiRF Technology, Inc.
|
||||
snps Synopsys, Inc.
|
||||
spansion Spansion Inc.
|
||||
st STMicroelectronics
|
||||
ste ST-Ericsson
|
||||
stericsson ST-Ericsson
|
||||
|
|
|
@ -5,6 +5,8 @@ please mail me.
|
|||
|
||||
00-INDEX
|
||||
- this file.
|
||||
api.txt
|
||||
- The frame buffer API between applications and buffer devices.
|
||||
arkfb.txt
|
||||
- info on the fbdev driver for ARK Logic chips.
|
||||
aty128fb.txt
|
||||
|
@ -51,12 +53,16 @@ sh7760fb.txt
|
|||
- info on the SH7760/SH7763 integrated LCDC Framebuffer driver.
|
||||
sisfb.txt
|
||||
- info on the framebuffer device driver for various SiS chips.
|
||||
sm501.txt
|
||||
- info on the framebuffer device driver for sm501 videoframebuffer.
|
||||
sstfb.txt
|
||||
- info on the frame buffer driver for 3dfx' Voodoo Graphics boards.
|
||||
tgafb.txt
|
||||
- info on the TGA (DECChip 21030) frame buffer driver.
|
||||
tridentfb.txt
|
||||
info on the framebuffer driver for some Trident chip based cards.
|
||||
udlfb.txt
|
||||
- Driver for DisplayLink USB 2.0 chips.
|
||||
uvesafb.txt
|
||||
- info on the userspace VESA (VBE2+ compliant) frame buffer device.
|
||||
vesafb.txt
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
- this file (info on some of the filesystems supported by linux).
|
||||
Locking
|
||||
- info on locking rules as they pertain to Linux VFS.
|
||||
Makefile
|
||||
- Makefile for building the filsystems-part of DocBook.
|
||||
9p.txt
|
||||
- 9p (v9fs) is an implementation of the Plan 9 remote fs protocol.
|
||||
adfs.txt
|
||||
|
|
|
@ -12,6 +12,8 @@ nfs41-server.txt
|
|||
- info on the Linux server implementation of NFSv4 minor version 1.
|
||||
nfs-rdma.txt
|
||||
- how to install and setup the Linux NFS/RDMA client and server software
|
||||
nfsd-admin-interfaces.txt
|
||||
- Administrative interfaces for nfsd.
|
||||
nfsroot.txt
|
||||
- short guide on setting up a diskless box with NFS root filesystem.
|
||||
pnfs.txt
|
||||
|
@ -20,5 +22,5 @@ rpc-cache.txt
|
|||
- introduction to the caching mechanisms in the sunrpc layer.
|
||||
idmapper.txt
|
||||
- information for configuring request-keys to be used by idmapper
|
||||
knfsd-rpcgss.txt
|
||||
rpc-server-gss.txt
|
||||
- Information on GSS authentication support in the NFS Server
|
||||
|
|
|
@ -8,8 +8,8 @@ reason, the kernel code must instantiate I2C devices explicitly. There are
|
|||
several ways to achieve this, depending on the context and requirements.
|
||||
|
||||
|
||||
Method 1: Declare the I2C devices by bus number
|
||||
-----------------------------------------------
|
||||
Method 1a: Declare the I2C devices by bus number
|
||||
------------------------------------------------
|
||||
|
||||
This method is appropriate when the I2C bus is a system bus as is the case
|
||||
for many embedded systems. On such systems, each I2C bus has a number
|
||||
|
@ -51,6 +51,43 @@ The devices will be automatically unbound and destroyed when the I2C bus
|
|||
they sit on goes away (if ever.)
|
||||
|
||||
|
||||
Method 1b: Declare the I2C devices via devicetree
|
||||
-------------------------------------------------
|
||||
|
||||
This method has the same implications as method 1a. The declaration of I2C
|
||||
devices is here done via devicetree as subnodes of the master controller.
|
||||
|
||||
Example:
|
||||
|
||||
i2c1: i2c@400a0000 {
|
||||
/* ... master properties skipped ... */
|
||||
clock-frequency = <100000>;
|
||||
|
||||
flash@50 {
|
||||
compatible = "atmel,24c256";
|
||||
reg = <0x50>;
|
||||
};
|
||||
|
||||
pca9532: gpio@60 {
|
||||
compatible = "nxp,pca9532";
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
reg = <0x60>;
|
||||
};
|
||||
};
|
||||
|
||||
Here, two devices are attached to the bus using a speed of 100kHz. For
|
||||
additional properties which might be needed to set up the device, please refer
|
||||
to its devicetree documentation in Documentation/devicetree/bindings/.
|
||||
|
||||
|
||||
Method 1c: Declare the I2C devices via ACPI
|
||||
-------------------------------------------
|
||||
|
||||
ACPI can also describe I2C devices. There is special documentation for this
|
||||
which is currently located at Documentation/acpi/enumeration.txt.
|
||||
|
||||
|
||||
Method 2: Instantiate the devices explicitly
|
||||
--------------------------------------------
|
||||
|
||||
|
|
|
@ -10,3 +10,5 @@ ide-tape.txt
|
|||
- info on the IDE ATAPI streaming tape driver
|
||||
ide.txt
|
||||
- important info for users of ATA devices (IDE/EIDE disks and CD-ROMS).
|
||||
warm-plug-howto.txt
|
||||
- using sysfs to remove and add IDE devices.
|
|
@ -1,13 +1,15 @@
|
|||
00-INDEX
|
||||
- This file
|
||||
acer-wmi.txt
|
||||
- information on the Acer Laptop WMI Extras driver.
|
||||
Makefile
|
||||
- Makefile for building dslm example program.
|
||||
asus-laptop.txt
|
||||
- information on the Asus Laptop Extras driver.
|
||||
disk-shock-protection.txt
|
||||
- information on hard disk shock protection.
|
||||
dslm.c
|
||||
- Simple Disk Sleep Monitor program
|
||||
hpfall.c
|
||||
- (HP) laptop accelerometer program for disk protection.
|
||||
laptop-mode.txt
|
||||
- how to conserve battery power using laptop-mode.
|
||||
sony-laptop.txt
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
00-INDEX
|
||||
- This file
|
||||
leds-blinkm.txt
|
||||
- Driver for BlinkM LED-devices.
|
||||
leds-class.txt
|
||||
- documents LED handling under Linux.
|
||||
leds-lp3944.txt
|
||||
|
@ -12,3 +16,7 @@ leds-lp55xx.txt
|
|||
- description about lp55xx common driver.
|
||||
leds-lm3556.txt
|
||||
- notes on how to use the leds-lm3556 driver.
|
||||
ledtrig-oneshot.txt
|
||||
- One-shot LED trigger for both sporadic and dense events.
|
||||
ledtrig-transient.txt
|
||||
- LED Transient Trigger, one shot timer activation.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
00-INDEX
|
||||
- this file
|
||||
README.buddha
|
||||
- Amiga Buddha and Catweasel IDE Driver
|
||||
kernel-options.txt
|
||||
- command line options for Linux/m68k
|
||||
|
||||
|
|
|
@ -6,8 +6,14 @@
|
|||
- information on the 3Com Etherlink III Series Ethernet cards.
|
||||
6pack.txt
|
||||
- info on the 6pack protocol, an alternative to KISS for AX.25
|
||||
DLINK.txt
|
||||
- info on the D-Link DE-600/DE-620 parallel port pocket adapters
|
||||
LICENSE.qla3xxx
|
||||
- GPLv2 for QLogic Linux Networking HBA Driver
|
||||
LICENSE.qlge
|
||||
- GPLv2 for QLogic Linux qlge NIC Driver
|
||||
LICENSE.qlcnic
|
||||
- GPLv2 for QLogic Linux qlcnic NIC Driver
|
||||
Makefile
|
||||
- Makefile for docsrc.
|
||||
PLIP.txt
|
||||
- PLIP: The Parallel Line Internet Protocol device driver
|
||||
README.ipw2100
|
||||
|
@ -17,7 +23,7 @@ README.ipw2200
|
|||
README.sb1000
|
||||
- info on General Instrument/NextLevel SURFboard1000 cable modem.
|
||||
alias.txt
|
||||
- info on using alias network devices
|
||||
- info on using alias network devices.
|
||||
arcnet-hardware.txt
|
||||
- tons of info on ARCnet, hubs, jumper settings for ARCnet cards, etc.
|
||||
arcnet.txt
|
||||
|
@ -80,7 +86,7 @@ framerelay.txt
|
|||
- info on using Frame Relay/Data Link Connection Identifier (DLCI).
|
||||
gen_stats.txt
|
||||
- Generic networking statistics for netlink users.
|
||||
generic_hdlc.txt
|
||||
generic-hdlc.txt
|
||||
- The generic High Level Data Link Control (HDLC) layer.
|
||||
generic_netlink.txt
|
||||
- info on Generic Netlink
|
||||
|
@ -88,6 +94,8 @@ gianfar.txt
|
|||
- Gianfar Ethernet Driver.
|
||||
i40e.txt
|
||||
- README for the Intel Ethernet Controller XL710 Driver (i40e).
|
||||
i40evf.txt
|
||||
- Short note on the Driver for the Intel(R) XL710 X710 Virtual Function
|
||||
ieee802154.txt
|
||||
- Linux IEEE 802.15.4 implementation, API and drivers
|
||||
igb.txt
|
||||
|
@ -102,6 +110,8 @@ ipddp.txt
|
|||
- AppleTalk-IP Decapsulation and AppleTalk-IP Encapsulation
|
||||
iphase.txt
|
||||
- Interphase PCI ATM (i)Chip IA Linux driver info.
|
||||
ipsec.txt
|
||||
- Note on not compressing IPSec payload and resulting failed policy check.
|
||||
ipv6.txt
|
||||
- Options to the ipv6 kernel module.
|
||||
ipvs-sysctl.txt
|
||||
|
@ -120,6 +130,8 @@ lapb-module.txt
|
|||
- programming information of the LAPB module.
|
||||
ltpc.txt
|
||||
- the Apple or Farallon LocalTalk PC card driver
|
||||
mac80211-auth-assoc-deauth.txt
|
||||
- authentication and association / deauth-disassoc with max80211
|
||||
mac80211-injection.txt
|
||||
- HOWTO use packet injection with mac80211
|
||||
multiqueue.txt
|
||||
|
@ -134,6 +146,10 @@ netdevices.txt
|
|||
- info on network device driver functions exported to the kernel.
|
||||
netif-msg.txt
|
||||
- Design of the network interface message level setting (NETIF_MSG_*).
|
||||
netlink_mmap.txt
|
||||
- memory mapped I/O with netlink
|
||||
nf_conntrack-sysctl.txt
|
||||
- list of netfilter-sysctl knobs.
|
||||
nfc.txt
|
||||
- The Linux Near Field Communication (NFS) subsystem.
|
||||
openvswitch.txt
|
||||
|
@ -176,7 +192,7 @@ skfp.txt
|
|||
- SysKonnect FDDI (SK-5xxx, Compaq Netelligent) driver info.
|
||||
smc9.txt
|
||||
- the driver for SMC's 9000 series of Ethernet cards
|
||||
spider-net.txt
|
||||
spider_net.txt
|
||||
- README for the Spidernet Driver (as found in PS3 / Cell BE).
|
||||
stmmac.txt
|
||||
- README for the STMicro Synopsys Ethernet driver.
|
||||
|
@ -188,6 +204,8 @@ tcp.txt
|
|||
- short blurb on how TCP output takes place.
|
||||
tcp-thin.txt
|
||||
- kernel tuning options for low rate 'thin' TCP streams.
|
||||
team.txt
|
||||
- pointer to information for ethernet teaming devices.
|
||||
tlan.txt
|
||||
- ThunderLAN (Compaq Netelligent 10/100, Olicom OC-2xxx) driver info.
|
||||
tproxy.txt
|
||||
|
@ -200,6 +218,8 @@ vortex.txt
|
|||
- info on using 3Com Vortex (3c590, 3c592, 3c595, 3c597) Ethernet cards.
|
||||
vxge.txt
|
||||
- README for the Neterion X3100 PCIe Server Adapter.
|
||||
vxlan.txt
|
||||
- Virtual extensible LAN overview
|
||||
x25.txt
|
||||
- general info on X.25 development.
|
||||
x25-iface.txt
|
||||
|
|
|
@ -75,14 +75,26 @@ Before the controller can make use of the PHY, it has to get a reference to
|
|||
it. This framework provides the following APIs to get a reference to the PHY.
|
||||
|
||||
struct phy *phy_get(struct device *dev, const char *string);
|
||||
struct phy *phy_optional_get(struct device *dev, const char *string);
|
||||
struct phy *devm_phy_get(struct device *dev, const char *string);
|
||||
struct phy *devm_phy_optional_get(struct device *dev, const char *string);
|
||||
|
||||
phy_get and devm_phy_get can be used to get the PHY. In the case of dt boot,
|
||||
the string arguments should contain the phy name as given in the dt data and
|
||||
in the case of non-dt boot, it should contain the label of the PHY.
|
||||
The only difference between the two APIs is that devm_phy_get associates the
|
||||
device with the PHY using devres on successful PHY get. On driver detach,
|
||||
release function is invoked on the the devres data and devres data is freed.
|
||||
phy_get, phy_optional_get, devm_phy_get and devm_phy_optional_get can
|
||||
be used to get the PHY. In the case of dt boot, the string arguments
|
||||
should contain the phy name as given in the dt data and in the case of
|
||||
non-dt boot, it should contain the label of the PHY. The two
|
||||
devm_phy_get associates the device with the PHY using devres on
|
||||
successful PHY get. On driver detach, release function is invoked on
|
||||
the the devres data and devres data is freed. phy_optional_get and
|
||||
devm_phy_optional_get should be used when the phy is optional. These
|
||||
two functions will never return -ENODEV, but instead returns NULL when
|
||||
the phy cannot be found.
|
||||
|
||||
It should be noted that NULL is a valid phy reference. All phy
|
||||
consumer calls on the NULL phy become NOPs. That is the release calls,
|
||||
the phy_init() and phy_exit() calls, and phy_power_on() and
|
||||
phy_power_off() calls are all NOP when applied to a NULL phy. The NULL
|
||||
phy is useful in devices for handling optional phy devices.
|
||||
|
||||
5. Releasing a reference to the PHY
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@ apm-acpi.txt
|
|||
- basic info about the APM and ACPI support.
|
||||
basic-pm-debugging.txt
|
||||
- Debugging suspend and resume
|
||||
charger-manager.txt
|
||||
- Battery charger management.
|
||||
devices.txt
|
||||
- How drivers interact with system-wide power management
|
||||
drivers-testing.txt
|
||||
|
@ -22,6 +24,8 @@ pm_qos_interface.txt
|
|||
- info on Linux PM Quality of Service interface
|
||||
power_supply_class.txt
|
||||
- Tells userspace about battery, UPS, AC or DC power supply properties
|
||||
runtime_pm.txt
|
||||
- Power management framework for I/O devices.
|
||||
s2ram.txt
|
||||
- How to get suspend to ram working (and debug it when it isn't)
|
||||
states.txt
|
||||
|
@ -38,7 +42,5 @@ tricks.txt
|
|||
- How to trick software suspend (to disk) into working when it isn't
|
||||
userland-swsusp.txt
|
||||
- Experimental implementation of software suspend in userspace
|
||||
video_extension.txt
|
||||
- ACPI video extensions
|
||||
video.txt
|
||||
- Video issues during resume from suspend
|
||||
|
|
|
@ -117,6 +117,7 @@ static void usage(char *progname)
|
|||
" -f val adjust the ptp clock frequency by 'val' ppb\n"
|
||||
" -g get the ptp clock time\n"
|
||||
" -h prints this message\n"
|
||||
" -i val index for event/trigger\n"
|
||||
" -k val measure the time offset between system and phc clock\n"
|
||||
" for 'val' times (Maximum 25)\n"
|
||||
" -p val enable output with a period of 'val' nanoseconds\n"
|
||||
|
@ -154,6 +155,7 @@ int main(int argc, char *argv[])
|
|||
int capabilities = 0;
|
||||
int extts = 0;
|
||||
int gettime = 0;
|
||||
int index = 0;
|
||||
int oneshot = 0;
|
||||
int pct_offset = 0;
|
||||
int n_samples = 0;
|
||||
|
@ -167,7 +169,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
progname = strrchr(argv[0], '/');
|
||||
progname = progname ? 1+progname : argv[0];
|
||||
while (EOF != (c = getopt(argc, argv, "a:A:cd:e:f:ghk:p:P:sSt:v"))) {
|
||||
while (EOF != (c = getopt(argc, argv, "a:A:cd:e:f:ghi:k:p:P:sSt:v"))) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
oneshot = atoi(optarg);
|
||||
|
@ -190,6 +192,9 @@ int main(int argc, char *argv[])
|
|||
case 'g':
|
||||
gettime = 1;
|
||||
break;
|
||||
case 'i':
|
||||
index = atoi(optarg);
|
||||
break;
|
||||
case 'k':
|
||||
pct_offset = 1;
|
||||
n_samples = atoi(optarg);
|
||||
|
@ -301,7 +306,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (extts) {
|
||||
memset(&extts_request, 0, sizeof(extts_request));
|
||||
extts_request.index = 0;
|
||||
extts_request.index = index;
|
||||
extts_request.flags = PTP_ENABLE_FEATURE;
|
||||
if (ioctl(fd, PTP_EXTTS_REQUEST, &extts_request)) {
|
||||
perror("PTP_EXTTS_REQUEST");
|
||||
|
@ -375,7 +380,7 @@ int main(int argc, char *argv[])
|
|||
return -1;
|
||||
}
|
||||
memset(&perout_request, 0, sizeof(perout_request));
|
||||
perout_request.index = 0;
|
||||
perout_request.index = index;
|
||||
perout_request.start.sec = ts.tv_sec + 2;
|
||||
perout_request.start.nsec = 0;
|
||||
perout_request.period.sec = 0;
|
||||
|
|
|
@ -16,11 +16,13 @@ Debugging390.txt
|
|||
- hints for debugging on s390 systems.
|
||||
driver-model.txt
|
||||
- information on s390 devices and the driver model.
|
||||
kvm.txt
|
||||
- ioctl calls to /dev/kvm on s390.
|
||||
monreader.txt
|
||||
- information on accessing the z/VM monitor stream from Linux.
|
||||
qeth.txt
|
||||
- HiperSockets Bridge Port Support.
|
||||
s390dbf.txt
|
||||
- information on using the s390 debug feature.
|
||||
TAPE
|
||||
- information on the driver for channel-attached tapes.
|
||||
zfcpdump
|
||||
zfcpdump.txt
|
||||
- information on the s390 SCSI dump tool.
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
- this file.
|
||||
sched-arch.txt
|
||||
- CPU Scheduler implementation hints for architecture specific code.
|
||||
sched-bwc.txt
|
||||
- CFS bandwidth control overview.
|
||||
sched-design-CFS.txt
|
||||
- goals, design and implementation of the Completely Fair Scheduler.
|
||||
sched-domains.txt
|
||||
|
|
|
@ -36,6 +36,8 @@ NinjaSCSI.txt
|
|||
- info on WorkBiT NinjaSCSI-32/32Bi driver
|
||||
aacraid.txt
|
||||
- Driver supporting Adaptec RAID controllers
|
||||
advansys.txt
|
||||
- List of Advansys Host Adapters
|
||||
aha152x.txt
|
||||
- info on driver for Adaptec AHA152x based adapters
|
||||
aic79xx.txt
|
||||
|
@ -44,6 +46,12 @@ aic7xxx.txt
|
|||
- info on driver for Adaptec controllers
|
||||
arcmsr_spec.txt
|
||||
- ARECA FIRMWARE SPEC (for IOP331 adapter)
|
||||
bfa.txt
|
||||
- Brocade FC/FCOE adapter driver.
|
||||
bnx2fc.txt
|
||||
- FCoE hardware offload for Broadcom network interfaces.
|
||||
cxgb3i.txt
|
||||
- Chelsio iSCSI Linux Driver
|
||||
dc395x.txt
|
||||
- README file for the dc395x SCSI driver
|
||||
dpti.txt
|
||||
|
@ -52,18 +60,24 @@ dtc3x80.txt
|
|||
- info on driver for DTC 2x80 based adapters
|
||||
g_NCR5380.txt
|
||||
- info on driver for NCR5380 and NCR53c400 based adapters
|
||||
hpsa.txt
|
||||
- HP Smart Array Controller SCSI driver.
|
||||
hptiop.txt
|
||||
- HIGHPOINT ROCKETRAID 3xxx RAID DRIVER
|
||||
in2000.txt
|
||||
- info on in2000 driver
|
||||
libsas.txt
|
||||
- Serial Attached SCSI management layer.
|
||||
link_power_management_policy.txt
|
||||
- Link power management options.
|
||||
lpfc.txt
|
||||
- LPFC driver release notes
|
||||
megaraid.txt
|
||||
- Common Management Module, shared code handling ioctls for LSI drivers
|
||||
ncr53c8xx.txt
|
||||
- info on driver for NCR53c8xx based adapters
|
||||
osd.txt
|
||||
Object-Based Storage Device, command set introduction.
|
||||
osst.txt
|
||||
- info on driver for OnStream SC-x0 SCSI tape
|
||||
ppa.txt
|
||||
|
@ -74,6 +88,8 @@ scsi-changer.txt
|
|||
- README for the SCSI media changer driver
|
||||
scsi-generic.txt
|
||||
- info on the sg driver for generic (non-disk/CD/tape) SCSI devices.
|
||||
scsi-parameters.txt
|
||||
- List of SCSI-parameters to pass to the kernel at module load-time.
|
||||
scsi.txt
|
||||
- short blurb on using SCSI support as a module.
|
||||
scsi_mid_low_api.txt
|
||||
|
|
|
@ -4,10 +4,12 @@ README.cycladesZ
|
|||
- info on Cyclades-Z firmware loading.
|
||||
digiepca.txt
|
||||
- info on Digi Intl. {PC,PCI,EISA}Xx and Xem series cards.
|
||||
hayes-esp.txt
|
||||
- info on using the Hayes ESP serial driver.
|
||||
driver
|
||||
- intro to the low level serial driver.
|
||||
moxa-smartio
|
||||
- file with info on installing/using Moxa multiport serial driver.
|
||||
n_gsm.txt
|
||||
- GSM 0710 tty multiplexer howto.
|
||||
riscom8.txt
|
||||
- notes on using the RISCom/8 multi-port serial driver.
|
||||
rocket.txt
|
||||
|
|
22
Documentation/spi/00-INDEX
Normal file
22
Documentation/spi/00-INDEX
Normal file
|
@ -0,0 +1,22 @@
|
|||
00-INDEX
|
||||
- this file.
|
||||
Makefile
|
||||
- Makefile for the example sourcefiles.
|
||||
butterfly
|
||||
- AVR Butterfly SPI driver overview and pin configuration.
|
||||
ep93xx_spi
|
||||
- Basic EP93xx SPI driver configuration.
|
||||
pxa2xx
|
||||
- PXA2xx SPI master controller build by spi_message fifo wq
|
||||
spidev
|
||||
- Intro to the userspace API for spi devices
|
||||
spidev_fdx.c
|
||||
- spidev example file
|
||||
spi-lm70llp
|
||||
- Connecting an LM70-LLP sensor to the kernel via the SPI subsys.
|
||||
spi-sc18is602
|
||||
- NXP SC18IS602/603 I2C-bus to SPI bridge
|
||||
spi-summary
|
||||
- (Linux) SPI overview. If unsure about SPI or SPI in Linux, start here.
|
||||
spidev_test.c
|
||||
- SPI testing utility.
|
|
@ -543,7 +543,22 @@ SPI MASTER METHODS
|
|||
queuing transfers that arrive in the meantime. When the driver is
|
||||
finished with this message, it must call
|
||||
spi_finalize_current_message() so the subsystem can issue the next
|
||||
transfer. This may sleep.
|
||||
message. This may sleep.
|
||||
|
||||
master->transfer_one(struct spi_master *master, struct spi_device *spi,
|
||||
struct spi_transfer *transfer)
|
||||
The subsystem calls the driver to transfer a single transfer while
|
||||
queuing transfers that arrive in the meantime. When the driver is
|
||||
finished with this transfer, it must call
|
||||
spi_finalize_current_transfer() so the subsystem can issue the next
|
||||
transfer. This may sleep. Note: transfer_one and transfer_one_message
|
||||
are mutually exclusive; when both are set, the generic subsystem does
|
||||
not call your transfer_one callback.
|
||||
|
||||
Return values:
|
||||
negative errno: error
|
||||
0: transfer is finished
|
||||
1: transfer is still in progress
|
||||
|
||||
DEPRECATED METHODS
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@ hpet_example.c
|
|||
- sample hpet timer test program
|
||||
hrtimers.txt
|
||||
- subsystem for high-resolution kernel timers
|
||||
Makefile
|
||||
- Build and link hpet_example
|
||||
NO_HZ.txt
|
||||
- Summary of the different methods for the scheduler clock-interrupts management.
|
||||
timers-howto.txt
|
||||
|
|
|
@ -20,5 +20,7 @@ ppc-pv.txt
|
|||
- the paravirtualization interface on PowerPC.
|
||||
review-checklist.txt
|
||||
- review checklist for KVM patches.
|
||||
s390-diag.txt
|
||||
- Diagnose hypercall description (for IBM S/390)
|
||||
timekeeping.txt
|
||||
- timekeeping virtualization for x86-based architectures.
|
||||
|
|
|
@ -16,8 +16,6 @@ hwpoison.txt
|
|||
- explains what hwpoison is
|
||||
ksm.txt
|
||||
- how to use the Kernel Samepage Merging feature.
|
||||
locking
|
||||
- info on how locking and synchronization is done in the Linux vm code.
|
||||
numa
|
||||
- information about NUMA specific code in the Linux vm.
|
||||
numa_memory_policy.txt
|
||||
|
@ -32,6 +30,8 @@ slub.txt
|
|||
- a short users guide for SLUB.
|
||||
soft-dirty.txt
|
||||
- short explanation for soft-dirty PTEs
|
||||
split_page_table_lock
|
||||
- Separate per-table lock to improve scalability of the old page_table_lock.
|
||||
transhuge.txt
|
||||
- Transparent Hugepage Support, alternative way of using hugepages.
|
||||
unevictable-lru.txt
|
||||
|
|
|
@ -4,7 +4,9 @@ ds2482
|
|||
- The Maxim/Dallas Semiconductor DS2482 provides 1-wire busses.
|
||||
ds2490
|
||||
- The Maxim/Dallas Semiconductor DS2490 builds USB <-> W1 bridges.
|
||||
mxc_w1
|
||||
mxc-w1
|
||||
- W1 master controller driver found on Freescale MX2/MX3 SoCs
|
||||
omap-hdq
|
||||
- HDQ/1-wire module of TI OMAP 2430/3430.
|
||||
w1-gpio
|
||||
- GPIO 1-wire bus master driver.
|
||||
|
|
|
@ -4,3 +4,5 @@ w1_therm
|
|||
- The Maxim/Dallas Semiconductor ds18*20 temperature sensor.
|
||||
w1_ds2423
|
||||
- The Maxim/Dallas Semiconductor ds2423 counter device.
|
||||
w1_ds28e04
|
||||
- The Maxim/Dallas Semiconductor ds28e04 eeprom.
|
||||
|
|
|
@ -1,6 +1,20 @@
|
|||
00-INDEX
|
||||
- this file
|
||||
mtrr.txt
|
||||
- how to use x86 Memory Type Range Registers to increase performance
|
||||
boot.txt
|
||||
- List of boot protocol versions
|
||||
early-microcode.txt
|
||||
- How to load microcode from an initrd-CPIO archive early to fix CPU issues.
|
||||
earlyprintk.txt
|
||||
- Using earlyprintk with a USB2 debug port key.
|
||||
entry_64.txt
|
||||
- Describe (some of the) kernel entry points for x86.
|
||||
exception-tables.txt
|
||||
- why and how Linux kernel uses exception tables on x86
|
||||
mtrr.txt
|
||||
- how to use x86 Memory Type Range Registers to increase performance
|
||||
pat.txt
|
||||
- Page Attribute Table intro and API
|
||||
usb-legacy-support.txt
|
||||
- how to fix/avoid quirks when using emulated PS/2 mouse/keyboard.
|
||||
zero-page.txt
|
||||
- layout of the first page of memory.
|
||||
|
|
|
@ -7,7 +7,7 @@ help. Contact the Chinese maintainer if this translation is outdated
|
|||
or if there is a problem with the translation.
|
||||
|
||||
Maintainer: Will Deacon <will.deacon@arm.com>
|
||||
Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
|
||||
Chinese maintainer: Fu Wei <wefu@redhat.com>
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/booting.txt 的中文翻译
|
||||
|
||||
|
@ -16,9 +16,9 @@ Documentation/arm64/booting.txt 的中文翻译
|
|||
译存在问题,请联系中文版维护者。
|
||||
|
||||
英文版维护者: Will Deacon <will.deacon@arm.com>
|
||||
中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
|
||||
中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
|
||||
中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
|
||||
中文版维护者: 傅炜 Fu Wei <wefu@redhat.com>
|
||||
中文版翻译者: 傅炜 Fu Wei <wefu@redhat.com>
|
||||
中文版校译者: 傅炜 Fu Wei <wefu@redhat.com>
|
||||
|
||||
以下为正文
|
||||
---------------------------------------------------------------------
|
||||
|
@ -64,8 +64,8 @@ RAM,或可能使用对这个设备已知的 RAM 信息,还可能使用任何
|
|||
|
||||
必要性: 强制
|
||||
|
||||
设备树数据块(dtb)大小必须不大于 2 MB,且位于从内核映像起始算起第一个
|
||||
512MB 内的 2MB 边界上。这使得内核可以通过初始页表中的单个节描述符来
|
||||
设备树数据块(dtb)必须 8 字节对齐,并位于从内核映像起始算起第一个 512MB
|
||||
内,且不得跨越 2MB 对齐边界。这使得内核可以通过初始页表中的单个节描述符来
|
||||
映射此数据块。
|
||||
|
||||
|
||||
|
@ -84,13 +84,23 @@ AArch64 内核当前没有提供自解压代码,因此如果使用了压缩内
|
|||
|
||||
必要性: 强制
|
||||
|
||||
已解压的内核映像包含一个 32 字节的头,内容如下:
|
||||
已解压的内核映像包含一个 64 字节的头,内容如下:
|
||||
|
||||
u32 magic = 0x14000008; /* 跳转到 stext, 小端 */
|
||||
u32 res0 = 0; /* 保留 */
|
||||
u32 code0; /* 可执行代码 */
|
||||
u32 code1; /* 可执行代码 */
|
||||
u64 text_offset; /* 映像装载偏移 */
|
||||
u64 res0 = 0; /* 保留 */
|
||||
u64 res1 = 0; /* 保留 */
|
||||
u64 res2 = 0; /* 保留 */
|
||||
u64 res3 = 0; /* 保留 */
|
||||
u64 res4 = 0; /* 保留 */
|
||||
u32 magic = 0x644d5241; /* 魔数, 小端, "ARM\x64" */
|
||||
u32 res5 = 0; /* 保留 */
|
||||
|
||||
|
||||
映像头注释:
|
||||
|
||||
- code0/code1 负责跳转到 stext.
|
||||
|
||||
映像必须位于系统 RAM 起始处的特定偏移(当前是 0x80000)。系统 RAM
|
||||
的起始地址必须是以 2MB 对齐的。
|
||||
|
@ -118,9 +128,9 @@ AArch64 内核当前没有提供自解压代码,因此如果使用了压缩内
|
|||
外部高速缓存(如果存在)必须配置并禁用。
|
||||
|
||||
- 架构计时器
|
||||
CNTFRQ 必须设定为计时器的频率。
|
||||
如果在 EL1 模式下进入内核,则 CNTHCTL_EL2 中的 EL1PCTEN (bit 0)
|
||||
必须置位。
|
||||
CNTFRQ 必须设定为计时器的频率,且 CNTVOFF 必须设定为对所有 CPU
|
||||
都一致的值。如果在 EL1 模式下进入内核,则 CNTHCTL_EL2 中的
|
||||
EL1PCTEN (bit 0) 必须置位。
|
||||
|
||||
- 一致性
|
||||
通过内核启动的所有 CPU 在内核入口地址上必须处于相同的一致性域中。
|
||||
|
@ -131,23 +141,40 @@ AArch64 内核当前没有提供自解压代码,因此如果使用了压缩内
|
|||
在进入内核映像的异常级中,所有构架中可写的系统寄存器必须通过软件
|
||||
在一个更高的异常级别下初始化,以防止在 未知 状态下运行。
|
||||
|
||||
以上对于 CPU 模式、高速缓存、MMU、架构计时器、一致性、系统寄存器的
|
||||
必要条件描述适用于所有 CPU。所有 CPU 必须在同一异常级别跳入内核。
|
||||
|
||||
引导装载程序必须在每个 CPU 处于以下状态时跳入内核入口:
|
||||
|
||||
- 主 CPU 必须直接跳入内核映像的第一条指令。通过此 CPU 传递的设备树
|
||||
数据块必须在每个 CPU 节点中包含以下内容:
|
||||
|
||||
1、‘enable-method’属性。目前,此字段支持的值仅为字符串“spin-table”。
|
||||
|
||||
2、‘cpu-release-addr’标识一个 64-bit、初始化为零的内存位置。
|
||||
数据块必须在每个 CPU 节点中包含一个 ‘enable-method’ 属性,所
|
||||
支持的 enable-method 请见下文。
|
||||
|
||||
引导装载程序必须生成这些设备树属性,并在跳入内核入口之前将其插入
|
||||
数据块。
|
||||
|
||||
- 任何辅助 CPU 必须在内存保留区(通过设备树中的 /memreserve/ 域传递
|
||||
- enable-method 为 “spin-table” 的 CPU 必须在它们的 CPU
|
||||
节点中包含一个 ‘cpu-release-addr’ 属性。这个属性标识了一个
|
||||
64 位自然对齐且初始化为零的内存位置。
|
||||
|
||||
这些 CPU 必须在内存保留区(通过设备树中的 /memreserve/ 域传递
|
||||
给内核)中自旋于内核之外,轮询它们的 cpu-release-addr 位置(必须
|
||||
包含在保留区中)。可通过插入 wfe 指令来降低忙循环开销,而主 CPU 将
|
||||
发出 sev 指令。当对 cpu-release-addr 所指位置的读取操作返回非零值
|
||||
时,CPU 必须直接跳入此值所指向的地址。
|
||||
时,CPU 必须跳入此值所指向的地址。此值为一个单独的 64 位小端值,
|
||||
因此 CPU 须在跳转前将所读取的值转换为其本身的端模式。
|
||||
|
||||
- enable-method 为 “psci” 的 CPU 保持在内核外(比如,在
|
||||
memory 节点中描述为内核空间的内存区外,或在通过设备树 /memreserve/
|
||||
域中描述为内核保留区的空间中)。内核将会发起在 ARM 文档(编号
|
||||
ARM DEN 0022A:用于 ARM 上的电源状态协调接口系统软件)中描述的
|
||||
CPU_ON 调用来将 CPU 带入内核。
|
||||
|
||||
*译者注:到文档翻译时,此文档已更新为 ARM DEN 0022B。
|
||||
|
||||
设备树必须包含一个 ‘psci’ 节点,请参考以下文档:
|
||||
Documentation/devicetree/bindings/arm/psci.txt
|
||||
|
||||
|
||||
- 辅助 CPU 通用寄存器设置
|
||||
x0 = 0 (保留,将来可能使用)
|
||||
|
|
|
@ -7,7 +7,7 @@ help. Contact the Chinese maintainer if this translation is outdated
|
|||
or if there is a problem with the translation.
|
||||
|
||||
Maintainer: Catalin Marinas <catalin.marinas@arm.com>
|
||||
Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
|
||||
Chinese maintainer: Fu Wei <wefu@redhat.com>
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/memory.txt 的中文翻译
|
||||
|
||||
|
@ -16,9 +16,9 @@ Documentation/arm64/memory.txt 的中文翻译
|
|||
译存在问题,请联系中文版维护者。
|
||||
|
||||
英文版维护者: Catalin Marinas <catalin.marinas@arm.com>
|
||||
中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
|
||||
中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
|
||||
中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
|
||||
中文版维护者: 傅炜 Fu Wei <wefu@redhat.com>
|
||||
中文版翻译者: 傅炜 Fu Wei <wefu@redhat.com>
|
||||
中文版校译者: 傅炜 Fu Wei <wefu@redhat.com>
|
||||
|
||||
以下为正文
|
||||
---------------------------------------------------------------------
|
||||
|
@ -41,7 +41,7 @@ AArch64 Linux 使用页大小为 4KB 的 3 级转换表配置,对于用户和
|
|||
TTBR1 中,且从不写入 TTBR0。
|
||||
|
||||
|
||||
AArch64 Linux 内存布局:
|
||||
AArch64 Linux 在页大小为 4KB 时的内存布局:
|
||||
|
||||
起始地址 结束地址 大小 用途
|
||||
-----------------------------------------------------------------------
|
||||
|
@ -55,15 +55,42 @@ ffffffbc00000000 ffffffbdffffffff 8GB vmemmap
|
|||
|
||||
ffffffbe00000000 ffffffbffbbfffff ~8GB [防护页,未来用于 vmmemap]
|
||||
|
||||
ffffffbffbc00000 ffffffbffbdfffff 2MB earlyprintk 设备
|
||||
|
||||
ffffffbffbe00000 ffffffbffbe0ffff 64KB PCI I/O 空间
|
||||
|
||||
ffffffbbffff0000 ffffffbcffffffff ~2MB [防护页]
|
||||
ffffffbffbe10000 ffffffbcffffffff ~2MB [防护页]
|
||||
|
||||
ffffffbffc000000 ffffffbfffffffff 64MB 模块
|
||||
|
||||
ffffffc000000000 ffffffffffffffff 256GB 内核逻辑内存映射
|
||||
|
||||
|
||||
AArch64 Linux 在页大小为 64KB 时的内存布局:
|
||||
|
||||
起始地址 结束地址 大小 用途
|
||||
-----------------------------------------------------------------------
|
||||
0000000000000000 000003ffffffffff 4TB 用户空间
|
||||
|
||||
fffffc0000000000 fffffdfbfffeffff ~2TB vmalloc
|
||||
|
||||
fffffdfbffff0000 fffffdfbffffffff 64KB [防护页]
|
||||
|
||||
fffffdfc00000000 fffffdfdffffffff 8GB vmemmap
|
||||
|
||||
fffffdfe00000000 fffffdfffbbfffff ~8GB [防护页,未来用于 vmmemap]
|
||||
|
||||
fffffdfffbc00000 fffffdfffbdfffff 2MB earlyprintk 设备
|
||||
|
||||
fffffdfffbe00000 fffffdfffbe0ffff 64KB PCI I/O 空间
|
||||
|
||||
fffffdfffbe10000 fffffdfffbffffff ~2MB [防护页]
|
||||
|
||||
fffffdfffc000000 fffffdffffffffff 64MB 模块
|
||||
|
||||
fffffe0000000000 ffffffffffffffff 2TB 内核逻辑内存映射
|
||||
|
||||
|
||||
4KB 页大小的转换表查找:
|
||||
|
||||
+--------+--------+--------+--------+--------+--------+--------+--------+
|
||||
|
@ -91,3 +118,10 @@ ffffffc000000000 ffffffffffffffff 256GB 内核逻辑内存映射
|
|||
| | +--------------------------> [41:29] L2 索引 (仅使用 38:29 )
|
||||
| +-------------------------------> [47:42] L1 索引 (未使用)
|
||||
+-------------------------------------------------> [63] TTBR0/1
|
||||
|
||||
当使用 KVM 时, 管理程序(hypervisor)在 EL2 中通过相对内核虚拟地址的
|
||||
一个固定偏移来映射内核页(内核虚拟地址的高 24 位设为零):
|
||||
|
||||
起始地址 结束地址 大小 用途
|
||||
-----------------------------------------------------------------------
|
||||
0000004000000000 0000007fffffffff 256GB 在 HYP 中映射的内核对象
|
||||
|
|
52
Documentation/zh_CN/arm64/tagged-pointers.txt
Normal file
52
Documentation/zh_CN/arm64/tagged-pointers.txt
Normal file
|
@ -0,0 +1,52 @@
|
|||
Chinese translated version of Documentation/arm64/tagged-pointers.txt
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
communicating in English you can also ask the Chinese maintainer for
|
||||
help. Contact the Chinese maintainer if this translation is outdated
|
||||
or if there is a problem with the translation.
|
||||
|
||||
Maintainer: Will Deacon <will.deacon@arm.com>
|
||||
Chinese maintainer: Fu Wei <wefu@redhat.com>
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/tagged-pointers.txt 的中文翻译
|
||||
|
||||
如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
|
||||
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
|
||||
译存在问题,请联系中文版维护者。
|
||||
|
||||
英文版维护者: Will Deacon <will.deacon@arm.com>
|
||||
中文版维护者: 傅炜 Fu Wei <wefu@redhat.com>
|
||||
中文版翻译者: 傅炜 Fu Wei <wefu@redhat.com>
|
||||
中文版校译者: 傅炜 Fu Wei <wefu@redhat.com>
|
||||
|
||||
以下为正文
|
||||
---------------------------------------------------------------------
|
||||
Linux 在 AArch64 中带标记的虚拟地址
|
||||
=================================
|
||||
|
||||
作者: Will Deacon <will.deacon@arm.com>
|
||||
日期: 2013 年 06 月 12 日
|
||||
|
||||
本文档简述了在 AArch64 地址转换系统中提供的带标记的虚拟地址及其在
|
||||
AArch64 Linux 中的潜在用途。
|
||||
|
||||
内核提供的地址转换表配置使通过 TTBR0 完成的虚拟地址转换(即用户空间
|
||||
映射),其虚拟地址的最高 8 位(63:56)会被转换硬件所忽略。这种机制
|
||||
让这些位可供应用程序自由使用,其注意事项如下:
|
||||
|
||||
(1) 内核要求所有传递到 EL1 的用户空间地址带有 0x00 标记。
|
||||
这意味着任何携带用户空间虚拟地址的系统调用(syscall)
|
||||
参数 *必须* 在陷入内核前使它们的最高字节被清零。
|
||||
|
||||
(2) 非零标记在传递信号时不被保存。这意味着在应用程序中利用了
|
||||
标记的信号处理函数无法依赖 siginfo_t 的用户空间虚拟
|
||||
地址所携带的包含其内部域信息的标记。此规则的一个例外是
|
||||
当信号是在调试观察点的异常处理程序中产生的,此时标记的
|
||||
信息将被保存。
|
||||
|
||||
(3) 当使用带标记的指针时需特别留心,因为仅对两个虚拟地址
|
||||
的高字节,C 编译器很可能无法判断它们是不同的。
|
||||
|
||||
此构架会阻止对带标记的 PC 指针的利用,因此在异常返回时,其高字节
|
||||
将被设置成一个为 “55” 的扩展符。
|
|
@ -2367,7 +2367,7 @@ F: include/linux/cpufreq.h
|
|||
|
||||
CPU FREQUENCY DRIVERS - ARM BIG LITTLE
|
||||
M: Viresh Kumar <viresh.kumar@linaro.org>
|
||||
M: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
|
||||
M: Sudeep Holla <sudeep.holla@arm.com>
|
||||
L: cpufreq@vger.kernel.org
|
||||
L: linux-pm@vger.kernel.org
|
||||
W: http://www.arm.com/products/processors/technologies/biglittleprocessing.php
|
||||
|
@ -2857,7 +2857,7 @@ M: Jani Nikula <jani.nikula@linux.intel.com>
|
|||
L: intel-gfx@lists.freedesktop.org
|
||||
L: dri-devel@lists.freedesktop.org
|
||||
Q: http://patchwork.freedesktop.org/project/intel-gfx/
|
||||
T: git git://people.freedesktop.org/~danvet/drm-intel
|
||||
T: git git://anongit.freedesktop.org/drm-intel
|
||||
S: Supported
|
||||
F: drivers/gpu/drm/i915/
|
||||
F: include/drm/i915*
|
||||
|
@ -7196,7 +7196,7 @@ S: Maintained
|
|||
F: drivers/net/ethernet/rdc/r6040.c
|
||||
|
||||
RDS - RELIABLE DATAGRAM SOCKETS
|
||||
M: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
|
||||
M: Chien Yen <chien.yen@oracle.com>
|
||||
L: rds-devel@oss.oracle.com (moderated for non-subscribers)
|
||||
S: Supported
|
||||
F: net/rds/
|
||||
|
|
2
Makefile
2
Makefile
|
@ -1,7 +1,7 @@
|
|||
VERSION = 3
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc2
|
||||
EXTRAVERSION = -rc3
|
||||
NAME = Shuffling Zombie Juror
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
|
|
@ -38,6 +38,7 @@ dtb-$(CONFIG_ARCH_AT91) += at91sam9g35ek.dtb
|
|||
dtb-$(CONFIG_ARCH_AT91) += at91sam9x25ek.dtb
|
||||
dtb-$(CONFIG_ARCH_AT91) += at91sam9x35ek.dtb
|
||||
# sama5d3
|
||||
dtb-$(CONFIG_ARCH_AT91) += at91-sama5d3_xplained.dtb
|
||||
dtb-$(CONFIG_ARCH_AT91) += sama5d31ek.dtb
|
||||
dtb-$(CONFIG_ARCH_AT91) += sama5d33ek.dtb
|
||||
dtb-$(CONFIG_ARCH_AT91) += sama5d34ek.dtb
|
||||
|
|
229
arch/arm/boot/dts/at91-sama5d3_xplained.dts
Normal file
229
arch/arm/boot/dts/at91-sama5d3_xplained.dts
Normal file
|
@ -0,0 +1,229 @@
|
|||
/*
|
||||
* at91-sama5d3_xplained.dts - Device Tree file for the SAMA5D3 Xplained board
|
||||
*
|
||||
* Copyright (C) 2014 Atmel,
|
||||
* 2014 Nicolas Ferre <nicolas.ferre@atmel.com>
|
||||
*
|
||||
* Licensed under GPLv2 or later.
|
||||
*/
|
||||
/dts-v1/;
|
||||
#include "sama5d36.dtsi"
|
||||
|
||||
/ {
|
||||
model = "SAMA5D3 Xplained";
|
||||
compatible = "atmel,sama5d3-xplained", "atmel,sama5d3", "atmel,sama5";
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyS0,115200";
|
||||
};
|
||||
|
||||
memory {
|
||||
reg = <0x20000000 0x10000000>;
|
||||
};
|
||||
|
||||
ahb {
|
||||
apb {
|
||||
mmc0: mmc@f0000000 {
|
||||
pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_dat4_7 &pinctrl_mmc0_cd>;
|
||||
status = "okay";
|
||||
slot@0 {
|
||||
reg = <0>;
|
||||
bus-width = <8>;
|
||||
cd-gpios = <&pioE 0 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
spi0: spi@f0004000 {
|
||||
cs-gpios = <&pioD 13 0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
can0: can@f000c000 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
i2c0: i2c@f0014000 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
i2c1: i2c@f0018000 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
macb0: ethernet@f0028000 {
|
||||
phy-mode = "rgmii";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
usart0: serial@f001c000 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
usart1: serial@f0020000 {
|
||||
pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts_cts>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
uart0: serial@f0024000 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
mmc1: mmc@f8000000 {
|
||||
pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3 &pinctrl_mmc1_cd>;
|
||||
status = "okay";
|
||||
slot@0 {
|
||||
reg = <0>;
|
||||
bus-width = <4>;
|
||||
cd-gpios = <&pioE 1 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
spi1: spi@f8008000 {
|
||||
cs-gpios = <&pioC 25 0>, <0>, <0>, <&pioD 16 0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
adc0: adc@f8018000 {
|
||||
pinctrl-0 = <
|
||||
&pinctrl_adc0_adtrg
|
||||
&pinctrl_adc0_ad0
|
||||
&pinctrl_adc0_ad1
|
||||
&pinctrl_adc0_ad2
|
||||
&pinctrl_adc0_ad3
|
||||
&pinctrl_adc0_ad4
|
||||
&pinctrl_adc0_ad5
|
||||
&pinctrl_adc0_ad6
|
||||
&pinctrl_adc0_ad7
|
||||
&pinctrl_adc0_ad8
|
||||
&pinctrl_adc0_ad9
|
||||
>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
i2c2: i2c@f801c000 {
|
||||
dmas = <0>, <0>; /* Do not use DMA for i2c2 */
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
macb1: ethernet@f802c000 {
|
||||
phy-mode = "rmii";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
dbgu: serial@ffffee00 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
pinctrl@fffff200 {
|
||||
board {
|
||||
pinctrl_mmc0_cd: mmc0_cd {
|
||||
atmel,pins =
|
||||
<AT91_PIOE 0 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
|
||||
};
|
||||
|
||||
pinctrl_mmc1_cd: mmc1_cd {
|
||||
atmel,pins =
|
||||
<AT91_PIOE 1 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
|
||||
};
|
||||
|
||||
pinctrl_usba_vbus: usba_vbus {
|
||||
atmel,pins =
|
||||
<AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PE9, conflicts with A9 */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
pmc: pmc@fffffc00 {
|
||||
main: mainck {
|
||||
clock-frequency = <12000000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nand0: nand@60000000 {
|
||||
nand-bus-width = <8>;
|
||||
nand-ecc-mode = "hw";
|
||||
atmel,has-pmecc;
|
||||
atmel,pmecc-cap = <4>;
|
||||
atmel,pmecc-sector-size = <512>;
|
||||
nand-on-flash-bbt;
|
||||
status = "okay";
|
||||
|
||||
at91bootstrap@0 {
|
||||
label = "at91bootstrap";
|
||||
reg = <0x0 0x40000>;
|
||||
};
|
||||
|
||||
bootloader@40000 {
|
||||
label = "bootloader";
|
||||
reg = <0x40000 0x80000>;
|
||||
};
|
||||
|
||||
bootloaderenv@c0000 {
|
||||
label = "bootloader env";
|
||||
reg = <0xc0000 0xc0000>;
|
||||
};
|
||||
|
||||
dtb@180000 {
|
||||
label = "device tree";
|
||||
reg = <0x180000 0x80000>;
|
||||
};
|
||||
|
||||
kernel@200000 {
|
||||
label = "kernel";
|
||||
reg = <0x200000 0x600000>;
|
||||
};
|
||||
|
||||
rootfs@800000 {
|
||||
label = "rootfs";
|
||||
reg = <0x800000 0x0f800000>;
|
||||
};
|
||||
};
|
||||
|
||||
usb0: gadget@00500000 {
|
||||
atmel,vbus-gpio = <&pioE 9 GPIO_ACTIVE_HIGH>; /* PE9, conflicts with A9 */
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_usba_vbus>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
usb1: ohci@00600000 {
|
||||
num-ports = <3>;
|
||||
atmel,vbus-gpio = <0
|
||||
&pioE 3 GPIO_ACTIVE_LOW
|
||||
&pioE 4 GPIO_ACTIVE_LOW
|
||||
>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
usb2: ehci@00700000 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
bp3 {
|
||||
label = "PB_USER";
|
||||
gpios = <&pioE 29 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <0x104>;
|
||||
gpio-key,wakeup;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
d2 {
|
||||
label = "d2";
|
||||
gpios = <&pioE 23 GPIO_ACTIVE_LOW>; /* PE23, conflicts with A23, CTS2 */
|
||||
linux,default-trigger = "heartbeat";
|
||||
};
|
||||
|
||||
d3 {
|
||||
label = "d3";
|
||||
gpios = <&pioE 24 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -523,7 +523,7 @@ usb1: gadget@fff78000 {
|
|||
};
|
||||
|
||||
i2c0: i2c@fff88000 {
|
||||
compatible = "atmel,at91sam9263-i2c";
|
||||
compatible = "atmel,at91sam9260-i2c";
|
||||
reg = <0xfff88000 0x100>;
|
||||
interrupts = <13 IRQ_TYPE_LEVEL_HIGH 6>;
|
||||
#address-cells = <1>;
|
||||
|
|
|
@ -124,6 +124,10 @@ nand0: nand@40000000 {
|
|||
nand-on-flash-bbt;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
usb0: ohci@00500000 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
|
|
|
@ -1228,7 +1228,7 @@ usb1: ohci@00600000 {
|
|||
compatible = "atmel,at91rm9200-ohci", "usb-ohci";
|
||||
reg = <0x00600000 0x100000>;
|
||||
interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>;
|
||||
clocks = <&usb>, <&uhphs_clk>, <&udphs_clk>,
|
||||
clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>,
|
||||
<&uhpck>;
|
||||
clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
|
||||
status = "disabled";
|
||||
|
|
|
@ -188,7 +188,6 @@ msp1: msp@80124000 {
|
|||
msp2: msp@80117000 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&msp2_default_mode>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
msp3: msp@80125000 {
|
||||
|
|
|
@ -315,7 +315,7 @@ soc@01c00000 {
|
|||
ranges;
|
||||
|
||||
emac: ethernet@01c0b000 {
|
||||
compatible = "allwinner,sun4i-emac";
|
||||
compatible = "allwinner,sun4i-a10-emac";
|
||||
reg = <0x01c0b000 0x1000>;
|
||||
interrupts = <55>;
|
||||
clocks = <&ahb_gates 17>;
|
||||
|
@ -323,7 +323,7 @@ emac: ethernet@01c0b000 {
|
|||
};
|
||||
|
||||
mdio@01c0b080 {
|
||||
compatible = "allwinner,sun4i-mdio";
|
||||
compatible = "allwinner,sun4i-a10-mdio";
|
||||
reg = <0x01c0b080 0x14>;
|
||||
status = "disabled";
|
||||
#address-cells = <1>;
|
||||
|
|
|
@ -278,7 +278,7 @@ soc@01c00000 {
|
|||
ranges;
|
||||
|
||||
emac: ethernet@01c0b000 {
|
||||
compatible = "allwinner,sun4i-emac";
|
||||
compatible = "allwinner,sun4i-a10-emac";
|
||||
reg = <0x01c0b000 0x1000>;
|
||||
interrupts = <55>;
|
||||
clocks = <&ahb_gates 17>;
|
||||
|
@ -286,7 +286,7 @@ emac: ethernet@01c0b000 {
|
|||
};
|
||||
|
||||
mdio@01c0b080 {
|
||||
compatible = "allwinner,sun4i-mdio";
|
||||
compatible = "allwinner,sun4i-a10-mdio";
|
||||
reg = <0x01c0b080 0x14>;
|
||||
status = "disabled";
|
||||
#address-cells = <1>;
|
||||
|
|
|
@ -340,7 +340,7 @@ soc@01c00000 {
|
|||
ranges;
|
||||
|
||||
emac: ethernet@01c0b000 {
|
||||
compatible = "allwinner,sun4i-emac";
|
||||
compatible = "allwinner,sun4i-a10-emac";
|
||||
reg = <0x01c0b000 0x1000>;
|
||||
interrupts = <0 55 4>;
|
||||
clocks = <&ahb_gates 17>;
|
||||
|
@ -348,7 +348,7 @@ emac: ethernet@01c0b000 {
|
|||
};
|
||||
|
||||
mdio@01c0b080 {
|
||||
compatible = "allwinner,sun4i-mdio";
|
||||
compatible = "allwinner,sun4i-a10-mdio";
|
||||
reg = <0x01c0b080 0x14>;
|
||||
status = "disabled";
|
||||
#address-cells = <1>;
|
||||
|
|
|
@ -29,6 +29,7 @@ CONFIG_ARCH_OMAP3=y
|
|||
CONFIG_ARCH_OMAP4=y
|
||||
CONFIG_SOC_OMAP5=y
|
||||
CONFIG_SOC_AM33XX=y
|
||||
CONFIG_SOC_DRA7XX=y
|
||||
CONFIG_SOC_AM43XX=y
|
||||
CONFIG_ARCH_ROCKCHIP=y
|
||||
CONFIG_ARCH_SOCFPGA=y
|
||||
|
|
|
@ -71,6 +71,8 @@ struct arm_pmu {
|
|||
void (*disable)(struct perf_event *event);
|
||||
int (*get_event_idx)(struct pmu_hw_events *hw_events,
|
||||
struct perf_event *event);
|
||||
void (*clear_event_idx)(struct pmu_hw_events *hw_events,
|
||||
struct perf_event *event);
|
||||
int (*set_event_filter)(struct hw_perf_event *evt,
|
||||
struct perf_event_attr *attr);
|
||||
u32 (*read_counter)(struct perf_event *event);
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/irqdesc.h>
|
||||
|
||||
#include <asm/irq_regs.h>
|
||||
#include <asm/pmu.h>
|
||||
|
@ -205,6 +207,8 @@ armpmu_del(struct perf_event *event, int flags)
|
|||
armpmu_stop(event, PERF_EF_UPDATE);
|
||||
hw_events->events[idx] = NULL;
|
||||
clear_bit(idx, hw_events->used_mask);
|
||||
if (armpmu->clear_event_idx)
|
||||
armpmu->clear_event_idx(hw_events, event);
|
||||
|
||||
perf_event_update_userpage(event);
|
||||
}
|
||||
|
@ -295,14 +299,27 @@ validate_group(struct perf_event *event)
|
|||
|
||||
static irqreturn_t armpmu_dispatch_irq(int irq, void *dev)
|
||||
{
|
||||
struct arm_pmu *armpmu = (struct arm_pmu *) dev;
|
||||
struct platform_device *plat_device = armpmu->plat_device;
|
||||
struct arm_pmu_platdata *plat = dev_get_platdata(&plat_device->dev);
|
||||
struct arm_pmu *armpmu;
|
||||
struct platform_device *plat_device;
|
||||
struct arm_pmu_platdata *plat;
|
||||
int ret;
|
||||
u64 start_clock, finish_clock;
|
||||
|
||||
if (irq_is_percpu(irq))
|
||||
dev = *(void **)dev;
|
||||
armpmu = dev;
|
||||
plat_device = armpmu->plat_device;
|
||||
plat = dev_get_platdata(&plat_device->dev);
|
||||
|
||||
start_clock = sched_clock();
|
||||
if (plat && plat->handle_irq)
|
||||
return plat->handle_irq(irq, dev, armpmu->handle_irq);
|
||||
ret = plat->handle_irq(irq, dev, armpmu->handle_irq);
|
||||
else
|
||||
return armpmu->handle_irq(irq, dev);
|
||||
ret = armpmu->handle_irq(irq, dev);
|
||||
finish_clock = sched_clock();
|
||||
|
||||
perf_sample_event_took(finish_clock - start_clock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include <linux/platform_device.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/irqdesc.h>
|
||||
|
||||
#include <asm/cputype.h>
|
||||
#include <asm/irq_regs.h>
|
||||
|
@ -33,6 +35,7 @@
|
|||
/* Set at runtime when we know what CPU type we are. */
|
||||
static struct arm_pmu *cpu_pmu;
|
||||
|
||||
static DEFINE_PER_CPU(struct arm_pmu *, percpu_pmu);
|
||||
static DEFINE_PER_CPU(struct perf_event * [ARMPMU_MAX_HWEVENTS], hw_events);
|
||||
static DEFINE_PER_CPU(unsigned long [BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)], used_mask);
|
||||
static DEFINE_PER_CPU(struct pmu_hw_events, cpu_hw_events);
|
||||
|
@ -71,6 +74,26 @@ static struct pmu_hw_events *cpu_pmu_get_cpu_events(void)
|
|||
return this_cpu_ptr(&cpu_hw_events);
|
||||
}
|
||||
|
||||
static void cpu_pmu_enable_percpu_irq(void *data)
|
||||
{
|
||||
struct arm_pmu *cpu_pmu = data;
|
||||
struct platform_device *pmu_device = cpu_pmu->plat_device;
|
||||
int irq = platform_get_irq(pmu_device, 0);
|
||||
|
||||
enable_percpu_irq(irq, IRQ_TYPE_NONE);
|
||||
cpumask_set_cpu(smp_processor_id(), &cpu_pmu->active_irqs);
|
||||
}
|
||||
|
||||
static void cpu_pmu_disable_percpu_irq(void *data)
|
||||
{
|
||||
struct arm_pmu *cpu_pmu = data;
|
||||
struct platform_device *pmu_device = cpu_pmu->plat_device;
|
||||
int irq = platform_get_irq(pmu_device, 0);
|
||||
|
||||
cpumask_clear_cpu(smp_processor_id(), &cpu_pmu->active_irqs);
|
||||
disable_percpu_irq(irq);
|
||||
}
|
||||
|
||||
static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
int i, irq, irqs;
|
||||
|
@ -78,12 +101,18 @@ static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu)
|
|||
|
||||
irqs = min(pmu_device->num_resources, num_possible_cpus());
|
||||
|
||||
for (i = 0; i < irqs; ++i) {
|
||||
if (!cpumask_test_and_clear_cpu(i, &cpu_pmu->active_irqs))
|
||||
continue;
|
||||
irq = platform_get_irq(pmu_device, i);
|
||||
if (irq >= 0)
|
||||
free_irq(irq, cpu_pmu);
|
||||
irq = platform_get_irq(pmu_device, 0);
|
||||
if (irq >= 0 && irq_is_percpu(irq)) {
|
||||
on_each_cpu(cpu_pmu_disable_percpu_irq, cpu_pmu, 1);
|
||||
free_percpu_irq(irq, &percpu_pmu);
|
||||
} else {
|
||||
for (i = 0; i < irqs; ++i) {
|
||||
if (!cpumask_test_and_clear_cpu(i, &cpu_pmu->active_irqs))
|
||||
continue;
|
||||
irq = platform_get_irq(pmu_device, i);
|
||||
if (irq >= 0)
|
||||
free_irq(irq, cpu_pmu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,33 +130,44 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
for (i = 0; i < irqs; ++i) {
|
||||
err = 0;
|
||||
irq = platform_get_irq(pmu_device, i);
|
||||
if (irq < 0)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* If we have a single PMU interrupt that we can't shift,
|
||||
* assume that we're running on a uniprocessor machine and
|
||||
* continue. Otherwise, continue without this interrupt.
|
||||
*/
|
||||
if (irq_set_affinity(irq, cpumask_of(i)) && irqs > 1) {
|
||||
pr_warning("unable to set irq affinity (irq=%d, cpu=%u)\n",
|
||||
irq, i);
|
||||
continue;
|
||||
}
|
||||
|
||||
err = request_irq(irq, handler,
|
||||
IRQF_NOBALANCING | IRQF_NO_THREAD, "arm-pmu",
|
||||
cpu_pmu);
|
||||
irq = platform_get_irq(pmu_device, 0);
|
||||
if (irq >= 0 && irq_is_percpu(irq)) {
|
||||
err = request_percpu_irq(irq, handler, "arm-pmu", &percpu_pmu);
|
||||
if (err) {
|
||||
pr_err("unable to request IRQ%d for ARM PMU counters\n",
|
||||
irq);
|
||||
return err;
|
||||
}
|
||||
on_each_cpu(cpu_pmu_enable_percpu_irq, cpu_pmu, 1);
|
||||
} else {
|
||||
for (i = 0; i < irqs; ++i) {
|
||||
err = 0;
|
||||
irq = platform_get_irq(pmu_device, i);
|
||||
if (irq < 0)
|
||||
continue;
|
||||
|
||||
cpumask_set_cpu(i, &cpu_pmu->active_irqs);
|
||||
/*
|
||||
* If we have a single PMU interrupt that we can't shift,
|
||||
* assume that we're running on a uniprocessor machine and
|
||||
* continue. Otherwise, continue without this interrupt.
|
||||
*/
|
||||
if (irq_set_affinity(irq, cpumask_of(i)) && irqs > 1) {
|
||||
pr_warning("unable to set irq affinity (irq=%d, cpu=%u)\n",
|
||||
irq, i);
|
||||
continue;
|
||||
}
|
||||
|
||||
err = request_irq(irq, handler,
|
||||
IRQF_NOBALANCING | IRQF_NO_THREAD, "arm-pmu",
|
||||
cpu_pmu);
|
||||
if (err) {
|
||||
pr_err("unable to request IRQ%d for ARM PMU counters\n",
|
||||
irq);
|
||||
return err;
|
||||
}
|
||||
|
||||
cpumask_set_cpu(i, &cpu_pmu->active_irqs);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -141,6 +181,7 @@ static void cpu_pmu_init(struct arm_pmu *cpu_pmu)
|
|||
events->events = per_cpu(hw_events, cpu);
|
||||
events->used_mask = per_cpu(used_mask, cpu);
|
||||
raw_spin_lock_init(&events->pmu_lock);
|
||||
per_cpu(percpu_pmu, cpu) = cpu_pmu;
|
||||
}
|
||||
|
||||
cpu_pmu->get_hw_events = cpu_pmu_get_cpu_events;
|
||||
|
@ -181,6 +222,7 @@ static struct notifier_block cpu_pmu_hotplug_notifier = {
|
|||
*/
|
||||
static struct of_device_id cpu_pmu_of_device_ids[] = {
|
||||
{.compatible = "arm,cortex-a15-pmu", .data = armv7_a15_pmu_init},
|
||||
{.compatible = "arm,cortex-a12-pmu", .data = armv7_a12_pmu_init},
|
||||
{.compatible = "arm,cortex-a9-pmu", .data = armv7_a9_pmu_init},
|
||||
{.compatible = "arm,cortex-a8-pmu", .data = armv7_a8_pmu_init},
|
||||
{.compatible = "arm,cortex-a7-pmu", .data = armv7_a7_pmu_init},
|
||||
|
@ -188,6 +230,7 @@ static struct of_device_id cpu_pmu_of_device_ids[] = {
|
|||
{.compatible = "arm,arm11mpcore-pmu", .data = armv6mpcore_pmu_init},
|
||||
{.compatible = "arm,arm1176-pmu", .data = armv6pmu_init},
|
||||
{.compatible = "arm,arm1136-pmu", .data = armv6pmu_init},
|
||||
{.compatible = "qcom,krait-pmu", .data = krait_pmu_init},
|
||||
{},
|
||||
};
|
||||
|
||||
|
@ -225,15 +268,6 @@ static int probe_current_pmu(struct arm_pmu *pmu)
|
|||
case ARM_CPU_PART_CORTEX_A9:
|
||||
ret = armv7_a9_pmu_init(pmu);
|
||||
break;
|
||||
case ARM_CPU_PART_CORTEX_A5:
|
||||
ret = armv7_a5_pmu_init(pmu);
|
||||
break;
|
||||
case ARM_CPU_PART_CORTEX_A15:
|
||||
ret = armv7_a15_pmu_init(pmu);
|
||||
break;
|
||||
case ARM_CPU_PART_CORTEX_A7:
|
||||
ret = armv7_a7_pmu_init(pmu);
|
||||
break;
|
||||
}
|
||||
/* Intel CPUs [xscale]. */
|
||||
} else if (implementor == ARM_CPU_IMP_INTEL) {
|
||||
|
@ -270,6 +304,9 @@ static int cpu_pmu_device_probe(struct platform_device *pdev)
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
cpu_pmu = pmu;
|
||||
cpu_pmu->plat_device = pdev;
|
||||
|
||||
if (node && (of_id = of_match_node(cpu_pmu_of_device_ids, pdev->dev.of_node))) {
|
||||
init_fn = of_id->data;
|
||||
ret = init_fn(pmu);
|
||||
|
@ -282,8 +319,6 @@ static int cpu_pmu_device_probe(struct platform_device *pdev)
|
|||
goto out_free;
|
||||
}
|
||||
|
||||
cpu_pmu = pmu;
|
||||
cpu_pmu->plat_device = pdev;
|
||||
cpu_pmu_init(cpu_pmu);
|
||||
ret = armpmu_register(cpu_pmu, PERF_TYPE_RAW);
|
||||
|
||||
|
|
|
@ -18,6 +18,10 @@
|
|||
|
||||
#ifdef CONFIG_CPU_V7
|
||||
|
||||
#include <asm/cp15.h>
|
||||
#include <asm/vfp.h>
|
||||
#include "../vfp/vfpinstr.h"
|
||||
|
||||
/*
|
||||
* Common ARMv7 event types
|
||||
*
|
||||
|
@ -109,6 +113,33 @@ enum armv7_a15_perf_types {
|
|||
ARMV7_A15_PERFCTR_PC_WRITE_SPEC = 0x76,
|
||||
};
|
||||
|
||||
/* ARMv7 Cortex-A12 specific event types */
|
||||
enum armv7_a12_perf_types {
|
||||
ARMV7_A12_PERFCTR_L1_DCACHE_ACCESS_READ = 0x40,
|
||||
ARMV7_A12_PERFCTR_L1_DCACHE_ACCESS_WRITE = 0x41,
|
||||
|
||||
ARMV7_A12_PERFCTR_L2_CACHE_ACCESS_READ = 0x50,
|
||||
ARMV7_A12_PERFCTR_L2_CACHE_ACCESS_WRITE = 0x51,
|
||||
|
||||
ARMV7_A12_PERFCTR_PC_WRITE_SPEC = 0x76,
|
||||
|
||||
ARMV7_A12_PERFCTR_PF_TLB_REFILL = 0xe7,
|
||||
};
|
||||
|
||||
/* ARMv7 Krait specific event types */
|
||||
enum krait_perf_types {
|
||||
KRAIT_PMRESR0_GROUP0 = 0xcc,
|
||||
KRAIT_PMRESR1_GROUP0 = 0xd0,
|
||||
KRAIT_PMRESR2_GROUP0 = 0xd4,
|
||||
KRAIT_VPMRESR0_GROUP0 = 0xd8,
|
||||
|
||||
KRAIT_PERFCTR_L1_ICACHE_ACCESS = 0x10011,
|
||||
KRAIT_PERFCTR_L1_ICACHE_MISS = 0x10010,
|
||||
|
||||
KRAIT_PERFCTR_L1_ITLB_ACCESS = 0x12222,
|
||||
KRAIT_PERFCTR_L1_DTLB_ACCESS = 0x12210,
|
||||
};
|
||||
|
||||
/*
|
||||
* Cortex-A8 HW events mapping
|
||||
*
|
||||
|
@ -731,6 +762,262 @@ static const unsigned armv7_a7_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
|
|||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* Cortex-A12 HW events mapping
|
||||
*/
|
||||
static const unsigned armv7_a12_perf_map[PERF_COUNT_HW_MAX] = {
|
||||
[PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
|
||||
[PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED,
|
||||
[PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
|
||||
[PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
|
||||
[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_A12_PERFCTR_PC_WRITE_SPEC,
|
||||
[PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
|
||||
[PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_BUS_CYCLES,
|
||||
[PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = HW_OP_UNSUPPORTED,
|
||||
[PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = HW_OP_UNSUPPORTED,
|
||||
};
|
||||
|
||||
static const unsigned armv7_a12_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
|
||||
[PERF_COUNT_HW_CACHE_OP_MAX]
|
||||
[PERF_COUNT_HW_CACHE_RESULT_MAX] = {
|
||||
[C(L1D)] = {
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = ARMV7_A12_PERFCTR_L1_DCACHE_ACCESS_READ,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = ARMV7_A12_PERFCTR_L1_DCACHE_ACCESS_WRITE,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
[C(L1I)] = {
|
||||
/*
|
||||
* Not all performance counters differentiate between read
|
||||
* and write accesses/misses so we're not always strictly
|
||||
* correct, but it's the best we can do. Writes and reads get
|
||||
* combined in these cases.
|
||||
*/
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
[C(LL)] = {
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = ARMV7_A12_PERFCTR_L2_CACHE_ACCESS_READ,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_L2_CACHE_REFILL,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = ARMV7_A12_PERFCTR_L2_CACHE_ACCESS_WRITE,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_L2_CACHE_REFILL,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
[C(DTLB)] = {
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = ARMV7_A12_PERFCTR_PF_TLB_REFILL,
|
||||
},
|
||||
},
|
||||
[C(ITLB)] = {
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_REFILL,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_REFILL,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
[C(BPU)] = {
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
[C(NODE)] = {
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* Krait HW events mapping
|
||||
*/
|
||||
static const unsigned krait_perf_map[PERF_COUNT_HW_MAX] = {
|
||||
[PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
|
||||
[PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED,
|
||||
[PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED,
|
||||
[PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED,
|
||||
[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE,
|
||||
[PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
|
||||
[PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES,
|
||||
};
|
||||
|
||||
static const unsigned krait_perf_map_no_branch[PERF_COUNT_HW_MAX] = {
|
||||
[PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
|
||||
[PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED,
|
||||
[PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED,
|
||||
[PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED,
|
||||
[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = HW_OP_UNSUPPORTED,
|
||||
[PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
|
||||
[PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES,
|
||||
};
|
||||
|
||||
static const unsigned krait_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
|
||||
[PERF_COUNT_HW_CACHE_OP_MAX]
|
||||
[PERF_COUNT_HW_CACHE_RESULT_MAX] = {
|
||||
[C(L1D)] = {
|
||||
/*
|
||||
* The performance counters don't differentiate between read
|
||||
* and write accesses/misses so this isn't strictly correct,
|
||||
* but it's the best we can do. Writes and reads get
|
||||
* combined.
|
||||
*/
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
[C(L1I)] = {
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_ICACHE_ACCESS,
|
||||
[C(RESULT_MISS)] = KRAIT_PERFCTR_L1_ICACHE_MISS,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
[C(LL)] = {
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
[C(DTLB)] = {
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_DTLB_ACCESS,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_DTLB_ACCESS,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
[C(ITLB)] = {
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_ITLB_ACCESS,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_ITLB_ACCESS,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
[C(BPU)] = {
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
|
||||
[C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
[C(NODE)] = {
|
||||
[C(OP_READ)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
[C(OP_WRITE)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
[C(OP_PREFETCH)] = {
|
||||
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
|
||||
[C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* Perf Events' indices
|
||||
*/
|
||||
|
@ -1212,6 +1499,24 @@ static int armv7_a7_map_event(struct perf_event *event)
|
|||
&armv7_a7_perf_cache_map, 0xFF);
|
||||
}
|
||||
|
||||
static int armv7_a12_map_event(struct perf_event *event)
|
||||
{
|
||||
return armpmu_map_event(event, &armv7_a12_perf_map,
|
||||
&armv7_a12_perf_cache_map, 0xFF);
|
||||
}
|
||||
|
||||
static int krait_map_event(struct perf_event *event)
|
||||
{
|
||||
return armpmu_map_event(event, &krait_perf_map,
|
||||
&krait_perf_cache_map, 0xFFFFF);
|
||||
}
|
||||
|
||||
static int krait_map_event_no_branch(struct perf_event *event)
|
||||
{
|
||||
return armpmu_map_event(event, &krait_perf_map_no_branch,
|
||||
&krait_perf_cache_map, 0xFFFFF);
|
||||
}
|
||||
|
||||
static void armv7pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
cpu_pmu->handle_irq = armv7pmu_handle_irq;
|
||||
|
@ -1283,6 +1588,408 @@ static int armv7_a7_pmu_init(struct arm_pmu *cpu_pmu)
|
|||
cpu_pmu->set_event_filter = armv7pmu_set_event_filter;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int armv7_a12_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
armv7pmu_init(cpu_pmu);
|
||||
cpu_pmu->name = "ARMv7 Cortex-A12";
|
||||
cpu_pmu->map_event = armv7_a12_map_event;
|
||||
cpu_pmu->num_events = armv7_read_num_pmnc_events();
|
||||
cpu_pmu->set_event_filter = armv7pmu_set_event_filter;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Krait Performance Monitor Region Event Selection Register (PMRESRn)
|
||||
*
|
||||
* 31 30 24 16 8 0
|
||||
* +--------------------------------+
|
||||
* PMRESR0 | EN | CC | CC | CC | CC | N = 1, R = 0
|
||||
* +--------------------------------+
|
||||
* PMRESR1 | EN | CC | CC | CC | CC | N = 1, R = 1
|
||||
* +--------------------------------+
|
||||
* PMRESR2 | EN | CC | CC | CC | CC | N = 1, R = 2
|
||||
* +--------------------------------+
|
||||
* VPMRESR0 | EN | CC | CC | CC | CC | N = 2, R = ?
|
||||
* +--------------------------------+
|
||||
* EN | G=3 | G=2 | G=1 | G=0
|
||||
*
|
||||
* Event Encoding:
|
||||
*
|
||||
* hwc->config_base = 0xNRCCG
|
||||
*
|
||||
* N = prefix, 1 for Krait CPU (PMRESRn), 2 for Venum VFP (VPMRESR)
|
||||
* R = region register
|
||||
* CC = class of events the group G is choosing from
|
||||
* G = group or particular event
|
||||
*
|
||||
* Example: 0x12021 is a Krait CPU event in PMRESR2's group 1 with code 2
|
||||
*
|
||||
* A region (R) corresponds to a piece of the CPU (execution unit, instruction
|
||||
* unit, etc.) while the event code (CC) corresponds to a particular class of
|
||||
* events (interrupts for example). An event code is broken down into
|
||||
* groups (G) that can be mapped into the PMU (irq, fiqs, and irq+fiqs for
|
||||
* example).
|
||||
*/
|
||||
|
||||
#define KRAIT_EVENT (1 << 16)
|
||||
#define VENUM_EVENT (2 << 16)
|
||||
#define KRAIT_EVENT_MASK (KRAIT_EVENT | VENUM_EVENT)
|
||||
#define PMRESRn_EN BIT(31)
|
||||
|
||||
static u32 krait_read_pmresrn(int n)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
switch (n) {
|
||||
case 0:
|
||||
asm volatile("mrc p15, 1, %0, c9, c15, 0" : "=r" (val));
|
||||
break;
|
||||
case 1:
|
||||
asm volatile("mrc p15, 1, %0, c9, c15, 1" : "=r" (val));
|
||||
break;
|
||||
case 2:
|
||||
asm volatile("mrc p15, 1, %0, c9, c15, 2" : "=r" (val));
|
||||
break;
|
||||
default:
|
||||
BUG(); /* Should be validated in krait_pmu_get_event_idx() */
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static void krait_write_pmresrn(int n, u32 val)
|
||||
{
|
||||
switch (n) {
|
||||
case 0:
|
||||
asm volatile("mcr p15, 1, %0, c9, c15, 0" : : "r" (val));
|
||||
break;
|
||||
case 1:
|
||||
asm volatile("mcr p15, 1, %0, c9, c15, 1" : : "r" (val));
|
||||
break;
|
||||
case 2:
|
||||
asm volatile("mcr p15, 1, %0, c9, c15, 2" : : "r" (val));
|
||||
break;
|
||||
default:
|
||||
BUG(); /* Should be validated in krait_pmu_get_event_idx() */
|
||||
}
|
||||
}
|
||||
|
||||
static u32 krait_read_vpmresr0(void)
|
||||
{
|
||||
u32 val;
|
||||
asm volatile("mrc p10, 7, %0, c11, c0, 0" : "=r" (val));
|
||||
return val;
|
||||
}
|
||||
|
||||
static void krait_write_vpmresr0(u32 val)
|
||||
{
|
||||
asm volatile("mcr p10, 7, %0, c11, c0, 0" : : "r" (val));
|
||||
}
|
||||
|
||||
static void krait_pre_vpmresr0(u32 *venum_orig_val, u32 *fp_orig_val)
|
||||
{
|
||||
u32 venum_new_val;
|
||||
u32 fp_new_val;
|
||||
|
||||
BUG_ON(preemptible());
|
||||
/* CPACR Enable CP10 and CP11 access */
|
||||
*venum_orig_val = get_copro_access();
|
||||
venum_new_val = *venum_orig_val | CPACC_SVC(10) | CPACC_SVC(11);
|
||||
set_copro_access(venum_new_val);
|
||||
|
||||
/* Enable FPEXC */
|
||||
*fp_orig_val = fmrx(FPEXC);
|
||||
fp_new_val = *fp_orig_val | FPEXC_EN;
|
||||
fmxr(FPEXC, fp_new_val);
|
||||
}
|
||||
|
||||
static void krait_post_vpmresr0(u32 venum_orig_val, u32 fp_orig_val)
|
||||
{
|
||||
BUG_ON(preemptible());
|
||||
/* Restore FPEXC */
|
||||
fmxr(FPEXC, fp_orig_val);
|
||||
isb();
|
||||
/* Restore CPACR */
|
||||
set_copro_access(venum_orig_val);
|
||||
}
|
||||
|
||||
static u32 krait_get_pmresrn_event(unsigned int region)
|
||||
{
|
||||
static const u32 pmresrn_table[] = { KRAIT_PMRESR0_GROUP0,
|
||||
KRAIT_PMRESR1_GROUP0,
|
||||
KRAIT_PMRESR2_GROUP0 };
|
||||
return pmresrn_table[region];
|
||||
}
|
||||
|
||||
static void krait_evt_setup(int idx, u32 config_base)
|
||||
{
|
||||
u32 val;
|
||||
u32 mask;
|
||||
u32 vval, fval;
|
||||
unsigned int region;
|
||||
unsigned int group;
|
||||
unsigned int code;
|
||||
unsigned int group_shift;
|
||||
bool venum_event;
|
||||
|
||||
venum_event = !!(config_base & VENUM_EVENT);
|
||||
region = (config_base >> 12) & 0xf;
|
||||
code = (config_base >> 4) & 0xff;
|
||||
group = (config_base >> 0) & 0xf;
|
||||
|
||||
group_shift = group * 8;
|
||||
mask = 0xff << group_shift;
|
||||
|
||||
/* Configure evtsel for the region and group */
|
||||
if (venum_event)
|
||||
val = KRAIT_VPMRESR0_GROUP0;
|
||||
else
|
||||
val = krait_get_pmresrn_event(region);
|
||||
val += group;
|
||||
/* Mix in mode-exclusion bits */
|
||||
val |= config_base & (ARMV7_EXCLUDE_USER | ARMV7_EXCLUDE_PL1);
|
||||
armv7_pmnc_write_evtsel(idx, val);
|
||||
|
||||
asm volatile("mcr p15, 0, %0, c9, c15, 0" : : "r" (0));
|
||||
|
||||
if (venum_event) {
|
||||
krait_pre_vpmresr0(&vval, &fval);
|
||||
val = krait_read_vpmresr0();
|
||||
val &= ~mask;
|
||||
val |= code << group_shift;
|
||||
val |= PMRESRn_EN;
|
||||
krait_write_vpmresr0(val);
|
||||
krait_post_vpmresr0(vval, fval);
|
||||
} else {
|
||||
val = krait_read_pmresrn(region);
|
||||
val &= ~mask;
|
||||
val |= code << group_shift;
|
||||
val |= PMRESRn_EN;
|
||||
krait_write_pmresrn(region, val);
|
||||
}
|
||||
}
|
||||
|
||||
static u32 krait_clear_pmresrn_group(u32 val, int group)
|
||||
{
|
||||
u32 mask;
|
||||
int group_shift;
|
||||
|
||||
group_shift = group * 8;
|
||||
mask = 0xff << group_shift;
|
||||
val &= ~mask;
|
||||
|
||||
/* Don't clear enable bit if entire region isn't disabled */
|
||||
if (val & ~PMRESRn_EN)
|
||||
return val |= PMRESRn_EN;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void krait_clearpmu(u32 config_base)
|
||||
{
|
||||
u32 val;
|
||||
u32 vval, fval;
|
||||
unsigned int region;
|
||||
unsigned int group;
|
||||
bool venum_event;
|
||||
|
||||
venum_event = !!(config_base & VENUM_EVENT);
|
||||
region = (config_base >> 12) & 0xf;
|
||||
group = (config_base >> 0) & 0xf;
|
||||
|
||||
if (venum_event) {
|
||||
krait_pre_vpmresr0(&vval, &fval);
|
||||
val = krait_read_vpmresr0();
|
||||
val = krait_clear_pmresrn_group(val, group);
|
||||
krait_write_vpmresr0(val);
|
||||
krait_post_vpmresr0(vval, fval);
|
||||
} else {
|
||||
val = krait_read_pmresrn(region);
|
||||
val = krait_clear_pmresrn_group(val, group);
|
||||
krait_write_pmresrn(region, val);
|
||||
}
|
||||
}
|
||||
|
||||
static void krait_pmu_disable_event(struct perf_event *event)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct hw_perf_event *hwc = &event->hw;
|
||||
int idx = hwc->idx;
|
||||
struct pmu_hw_events *events = cpu_pmu->get_hw_events();
|
||||
|
||||
/* Disable counter and interrupt */
|
||||
raw_spin_lock_irqsave(&events->pmu_lock, flags);
|
||||
|
||||
/* Disable counter */
|
||||
armv7_pmnc_disable_counter(idx);
|
||||
|
||||
/*
|
||||
* Clear pmresr code (if destined for PMNx counters)
|
||||
*/
|
||||
if (hwc->config_base & KRAIT_EVENT_MASK)
|
||||
krait_clearpmu(hwc->config_base);
|
||||
|
||||
/* Disable interrupt for this counter */
|
||||
armv7_pmnc_disable_intens(idx);
|
||||
|
||||
raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
|
||||
}
|
||||
|
||||
static void krait_pmu_enable_event(struct perf_event *event)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct hw_perf_event *hwc = &event->hw;
|
||||
int idx = hwc->idx;
|
||||
struct pmu_hw_events *events = cpu_pmu->get_hw_events();
|
||||
|
||||
/*
|
||||
* Enable counter and interrupt, and set the counter to count
|
||||
* the event that we're interested in.
|
||||
*/
|
||||
raw_spin_lock_irqsave(&events->pmu_lock, flags);
|
||||
|
||||
/* Disable counter */
|
||||
armv7_pmnc_disable_counter(idx);
|
||||
|
||||
/*
|
||||
* Set event (if destined for PMNx counters)
|
||||
* We set the event for the cycle counter because we
|
||||
* have the ability to perform event filtering.
|
||||
*/
|
||||
if (hwc->config_base & KRAIT_EVENT_MASK)
|
||||
krait_evt_setup(idx, hwc->config_base);
|
||||
else
|
||||
armv7_pmnc_write_evtsel(idx, hwc->config_base);
|
||||
|
||||
/* Enable interrupt for this counter */
|
||||
armv7_pmnc_enable_intens(idx);
|
||||
|
||||
/* Enable counter */
|
||||
armv7_pmnc_enable_counter(idx);
|
||||
|
||||
raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
|
||||
}
|
||||
|
||||
static void krait_pmu_reset(void *info)
|
||||
{
|
||||
u32 vval, fval;
|
||||
|
||||
armv7pmu_reset(info);
|
||||
|
||||
/* Clear all pmresrs */
|
||||
krait_write_pmresrn(0, 0);
|
||||
krait_write_pmresrn(1, 0);
|
||||
krait_write_pmresrn(2, 0);
|
||||
|
||||
krait_pre_vpmresr0(&vval, &fval);
|
||||
krait_write_vpmresr0(0);
|
||||
krait_post_vpmresr0(vval, fval);
|
||||
}
|
||||
|
||||
static int krait_event_to_bit(struct perf_event *event, unsigned int region,
|
||||
unsigned int group)
|
||||
{
|
||||
int bit;
|
||||
struct hw_perf_event *hwc = &event->hw;
|
||||
struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu);
|
||||
|
||||
if (hwc->config_base & VENUM_EVENT)
|
||||
bit = KRAIT_VPMRESR0_GROUP0;
|
||||
else
|
||||
bit = krait_get_pmresrn_event(region);
|
||||
bit -= krait_get_pmresrn_event(0);
|
||||
bit += group;
|
||||
/*
|
||||
* Lower bits are reserved for use by the counters (see
|
||||
* armv7pmu_get_event_idx() for more info)
|
||||
*/
|
||||
bit += ARMV7_IDX_COUNTER_LAST(cpu_pmu) + 1;
|
||||
|
||||
return bit;
|
||||
}
|
||||
|
||||
/*
|
||||
* We check for column exclusion constraints here.
|
||||
* Two events cant use the same group within a pmresr register.
|
||||
*/
|
||||
static int krait_pmu_get_event_idx(struct pmu_hw_events *cpuc,
|
||||
struct perf_event *event)
|
||||
{
|
||||
int idx;
|
||||
int bit;
|
||||
unsigned int prefix;
|
||||
unsigned int region;
|
||||
unsigned int code;
|
||||
unsigned int group;
|
||||
bool krait_event;
|
||||
struct hw_perf_event *hwc = &event->hw;
|
||||
|
||||
region = (hwc->config_base >> 12) & 0xf;
|
||||
code = (hwc->config_base >> 4) & 0xff;
|
||||
group = (hwc->config_base >> 0) & 0xf;
|
||||
krait_event = !!(hwc->config_base & KRAIT_EVENT_MASK);
|
||||
|
||||
if (krait_event) {
|
||||
/* Ignore invalid events */
|
||||
if (group > 3 || region > 2)
|
||||
return -EINVAL;
|
||||
prefix = hwc->config_base & KRAIT_EVENT_MASK;
|
||||
if (prefix != KRAIT_EVENT && prefix != VENUM_EVENT)
|
||||
return -EINVAL;
|
||||
if (prefix == VENUM_EVENT && (code & 0xe0))
|
||||
return -EINVAL;
|
||||
|
||||
bit = krait_event_to_bit(event, region, group);
|
||||
if (test_and_set_bit(bit, cpuc->used_mask))
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
idx = armv7pmu_get_event_idx(cpuc, event);
|
||||
if (idx < 0 && krait_event)
|
||||
clear_bit(bit, cpuc->used_mask);
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
static void krait_pmu_clear_event_idx(struct pmu_hw_events *cpuc,
|
||||
struct perf_event *event)
|
||||
{
|
||||
int bit;
|
||||
struct hw_perf_event *hwc = &event->hw;
|
||||
unsigned int region;
|
||||
unsigned int group;
|
||||
bool krait_event;
|
||||
|
||||
region = (hwc->config_base >> 12) & 0xf;
|
||||
group = (hwc->config_base >> 0) & 0xf;
|
||||
krait_event = !!(hwc->config_base & KRAIT_EVENT_MASK);
|
||||
|
||||
if (krait_event) {
|
||||
bit = krait_event_to_bit(event, region, group);
|
||||
clear_bit(bit, cpuc->used_mask);
|
||||
}
|
||||
}
|
||||
|
||||
static int krait_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
armv7pmu_init(cpu_pmu);
|
||||
cpu_pmu->name = "ARMv7 Krait";
|
||||
/* Some early versions of Krait don't support PC write events */
|
||||
if (of_property_read_bool(cpu_pmu->plat_device->dev.of_node,
|
||||
"qcom,no-pc-write"))
|
||||
cpu_pmu->map_event = krait_map_event_no_branch;
|
||||
else
|
||||
cpu_pmu->map_event = krait_map_event;
|
||||
cpu_pmu->num_events = armv7_read_num_pmnc_events();
|
||||
cpu_pmu->set_event_filter = armv7pmu_set_event_filter;
|
||||
cpu_pmu->reset = krait_pmu_reset;
|
||||
cpu_pmu->enable = krait_pmu_enable_event;
|
||||
cpu_pmu->disable = krait_pmu_disable_event;
|
||||
cpu_pmu->get_event_idx = krait_pmu_get_event_idx;
|
||||
cpu_pmu->clear_event_idx = krait_pmu_clear_event_idx;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static inline int armv7_a8_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
|
@ -1308,4 +2015,14 @@ static inline int armv7_a7_pmu_init(struct arm_pmu *cpu_pmu)
|
|||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int armv7_a12_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int krait_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif /* CONFIG_CPU_V7 */
|
||||
|
|
|
@ -8,7 +8,7 @@ config ARCH_HI3xxx
|
|||
select CLKSRC_OF
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select HAVE_ARM_SCU
|
||||
select HAVE_ARM_TWD
|
||||
select HAVE_ARM_TWD if SMP
|
||||
select HAVE_SMP
|
||||
select PINCTRL
|
||||
select PINCTRL_SINGLE
|
||||
|
|
|
@ -482,6 +482,9 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
|
|||
if (IS_ENABLED(CONFIG_PCI_IMX6))
|
||||
clk_set_parent(clk[lvds1_sel], clk[sata_ref]);
|
||||
|
||||
/* Set initial power mode */
|
||||
imx6q_set_lpm(WAIT_CLOCKED);
|
||||
|
||||
np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt");
|
||||
base = of_iomap(np, 0);
|
||||
WARN_ON(!base);
|
||||
|
|
|
@ -266,6 +266,9 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
|
|||
/* Audio-related clocks configuration */
|
||||
clk_set_parent(clks[IMX6SL_CLK_SPDIF0_SEL], clks[IMX6SL_CLK_PLL3_PFD3]);
|
||||
|
||||
/* Set initial power mode */
|
||||
imx6q_set_lpm(WAIT_CLOCKED);
|
||||
|
||||
np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-gpt");
|
||||
base = of_iomap(np, 0);
|
||||
WARN_ON(!base);
|
||||
|
|
|
@ -236,8 +236,6 @@ void __init imx6q_pm_init(void)
|
|||
regmap_update_bits(gpr, IOMUXC_GPR1, IMX6Q_GPR1_GINT,
|
||||
IMX6Q_GPR1_GINT);
|
||||
|
||||
/* Set initial power mode */
|
||||
imx6q_set_lpm(WAIT_CLOCKED);
|
||||
|
||||
suspend_set_ops(&imx6q_pm_ops);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ config ARCH_MOXART
|
|||
bool "MOXA ART SoC" if ARCH_MULTI_V4T
|
||||
select CPU_FA526
|
||||
select ARM_DMA_MEM_BUFFERABLE
|
||||
select DMA_OF
|
||||
select USE_OF
|
||||
select CLKSRC_OF
|
||||
select CLKSRC_MMIO
|
||||
|
|
|
@ -54,7 +54,7 @@ config SOC_OMAP5
|
|||
select ARM_GIC
|
||||
select CPU_V7
|
||||
select HAVE_ARM_SCU if SMP
|
||||
select HAVE_ARM_TWD if LOCAL_TIMERS
|
||||
select HAVE_ARM_TWD if SMP
|
||||
select HAVE_SMP
|
||||
select HAVE_ARM_ARCH_TIMER
|
||||
select ARM_ERRATA_798181 if SMP
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <mach/gumstix.h>
|
||||
#include <mach/mfp-pxa25x.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <linux/platform_data/video-pxafb.h>
|
||||
|
||||
#include "generic.h"
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#ifndef ASM_ARCH_BALLOON3_H
|
||||
#define ASM_ARCH_BALLOON3_H
|
||||
|
||||
#include "irqs.h" /* PXA_NR_BUILTIN_GPIO */
|
||||
|
||||
enum balloon3_features {
|
||||
BALLOON3_FEATURE_OHCI,
|
||||
BALLOON3_FEATURE_MMC,
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#ifndef __ASM_ARCH_CORGI_H
|
||||
#define __ASM_ARCH_CORGI_H 1
|
||||
|
||||
#include "irqs.h" /* PXA_NR_BUILTIN_GPIO */
|
||||
|
||||
/*
|
||||
* Corgi (Non Standard) GPIO Definitions
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
#ifndef CSB726_H
|
||||
#define CSB726_H
|
||||
|
||||
#include "irqs.h" /* PXA_GPIO_TO_IRQ */
|
||||
|
||||
#define CSB726_GPIO_IRQ_LAN 52
|
||||
#define CSB726_GPIO_IRQ_SM501 53
|
||||
#define CSB726_GPIO_MMC_DETECT 100
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include "irqs.h" /* PXA_GPIO_TO_IRQ */
|
||||
|
||||
/* BTRESET - Reset line to Bluetooth module, active low signal. */
|
||||
#define GPIO_GUMSTIX_BTRESET 7
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
* IDP hardware.
|
||||
*/
|
||||
|
||||
#include "irqs.h" /* PXA_GPIO_TO_IRQ */
|
||||
|
||||
#define IDP_FLASH_PHYS (PXA_CS0_PHYS)
|
||||
#define IDP_ALT_FLASH_PHYS (PXA_CS1_PHYS)
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#ifndef _INCLUDE_PALMLD_H_
|
||||
#define _INCLUDE_PALMLD_H_
|
||||
|
||||
#include "irqs.h" /* PXA_GPIO_TO_IRQ */
|
||||
|
||||
/** HERE ARE GPIOs **/
|
||||
|
||||
/* GPIOs */
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#ifndef _INCLUDE_PALMT5_H_
|
||||
#define _INCLUDE_PALMT5_H_
|
||||
|
||||
#include "irqs.h" /* PXA_GPIO_TO_IRQ */
|
||||
|
||||
/** HERE ARE GPIOs **/
|
||||
|
||||
/* GPIOs */
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#ifndef _INCLUDE_PALMTC_H_
|
||||
#define _INCLUDE_PALMTC_H_
|
||||
|
||||
#include "irqs.h" /* PXA_GPIO_TO_IRQ */
|
||||
|
||||
/** HERE ARE GPIOs **/
|
||||
|
||||
/* GPIOs */
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#ifndef _INCLUDE_PALMTX_H_
|
||||
#define _INCLUDE_PALMTX_H_
|
||||
|
||||
#include "irqs.h" /* PXA_GPIO_TO_IRQ */
|
||||
|
||||
/** HERE ARE GPIOs **/
|
||||
|
||||
/* GPIOs */
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
* Definitions of CPU card resources only
|
||||
*/
|
||||
|
||||
#include "irqs.h" /* PXA_GPIO_TO_IRQ */
|
||||
|
||||
/* phyCORE-PXA270 (PCM027) Interrupts */
|
||||
#define PCM027_IRQ(x) (IRQ_BOARD_START + (x))
|
||||
#define PCM027_BTDET_IRQ PCM027_IRQ(0)
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
*/
|
||||
|
||||
#include <mach/pcm027.h>
|
||||
#include "irqs.h" /* PXA_GPIO_TO_IRQ */
|
||||
|
||||
/*
|
||||
* definitions relevant only when the PCM-990
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#ifndef __ASM_ARCH_POODLE_H
|
||||
#define __ASM_ARCH_POODLE_H 1
|
||||
|
||||
#include "irqs.h" /* PXA_GPIO_TO_IRQ */
|
||||
|
||||
/*
|
||||
* GPIOs
|
||||
*/
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
#define __ASM_ARCH_SPITZ_H 1
|
||||
#endif
|
||||
|
||||
#include "irqs.h" /* PXA_NR_BUILTIN_GPIO, PXA_GPIO_TO_IRQ */
|
||||
#include <linux/fb.h>
|
||||
#include <linux/gpio.h>
|
||||
|
||||
/* Spitz/Akita GPIOs */
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#ifndef _ASM_ARCH_TOSA_H_
|
||||
#define _ASM_ARCH_TOSA_H_ 1
|
||||
|
||||
#include "irqs.h" /* PXA_NR_BUILTIN_GPIO */
|
||||
|
||||
/* TOSA Chip selects */
|
||||
#define TOSA_LCDC_PHYS PXA_CS4_PHYS
|
||||
/* Internel Scoop */
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#ifndef _TRIPEPS4_H_
|
||||
#define _TRIPEPS4_H_
|
||||
|
||||
#include "irqs.h" /* PXA_GPIO_TO_IRQ */
|
||||
|
||||
/* physical memory regions */
|
||||
#define TRIZEPS4_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */
|
||||
#define TRIZEPS4_DISK_PHYS (PXA_CS1_PHYS) /* Disk On Chip region */
|
||||
|
|
|
@ -8,7 +8,7 @@ config ARCH_SHMOBILE_MULTI
|
|||
select CPU_V7
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select HAVE_ARM_SCU if SMP
|
||||
select HAVE_ARM_TWD if LOCAL_TIMERS
|
||||
select HAVE_ARM_TWD if SMP
|
||||
select HAVE_SMP
|
||||
select ARM_GIC
|
||||
select MIGHT_HAVE_CACHE_L2X0
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <linux/of_irq.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/irqchip.h>
|
||||
#include <linux/irqchip/arm-gic.h>
|
||||
|
||||
|
@ -41,6 +42,18 @@
|
|||
|
||||
void __iomem *zynq_scu_base;
|
||||
|
||||
/**
|
||||
* zynq_memory_init - Initialize special memory
|
||||
*
|
||||
* We need to stop things allocating the low memory as DMA can't work in
|
||||
* the 1st 512K of memory.
|
||||
*/
|
||||
static void __init zynq_memory_init(void)
|
||||
{
|
||||
if (!__pa(PAGE_OFFSET))
|
||||
memblock_reserve(__pa(PAGE_OFFSET), __pa(swapper_pg_dir));
|
||||
}
|
||||
|
||||
static struct platform_device zynq_cpuidle_device = {
|
||||
.name = "cpuidle-zynq",
|
||||
};
|
||||
|
@ -117,5 +130,6 @@ DT_MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform")
|
|||
.init_machine = zynq_init_machine,
|
||||
.init_time = zynq_timer_init,
|
||||
.dt_compat = zynq_dt_match,
|
||||
.reserve = zynq_memory_init,
|
||||
.restart = zynq_system_reset,
|
||||
MACHINE_END
|
||||
|
|
|
@ -148,6 +148,15 @@ struct kvm_arch_memory_slot {
|
|||
#define KVM_REG_ARM_TIMER_CNT ARM64_SYS_REG(3, 3, 14, 3, 2)
|
||||
#define KVM_REG_ARM_TIMER_CVAL ARM64_SYS_REG(3, 3, 14, 0, 2)
|
||||
|
||||
/* Device Control API: ARM VGIC */
|
||||
#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
|
||||
#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
|
||||
#define KVM_DEV_ARM_VGIC_GRP_CPU_REGS 2
|
||||
#define KVM_DEV_ARM_VGIC_CPUID_SHIFT 32
|
||||
#define KVM_DEV_ARM_VGIC_CPUID_MASK (0xffULL << KVM_DEV_ARM_VGIC_CPUID_SHIFT)
|
||||
#define KVM_DEV_ARM_VGIC_OFFSET_SHIFT 0
|
||||
#define KVM_DEV_ARM_VGIC_OFFSET_MASK (0xffffffffULL << KVM_DEV_ARM_VGIC_OFFSET_SHIFT)
|
||||
|
||||
/* KVM_IRQ_LINE irq field index values */
|
||||
#define KVM_ARM_IRQ_TYPE_SHIFT 24
|
||||
#define KVM_ARM_IRQ_TYPE_MASK 0xff
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#ifndef _ASM_MICROBLAZE_DELAY_H
|
||||
#define _ASM_MICROBLAZE_DELAY_H
|
||||
|
||||
#include <linux/param.h>
|
||||
|
||||
extern inline void __delay(unsigned long loops)
|
||||
{
|
||||
asm volatile ("# __delay \n\t" \
|
||||
|
|
|
@ -89,6 +89,11 @@ static inline unsigned int readl(const volatile void __iomem *addr)
|
|||
{
|
||||
return le32_to_cpu(*(volatile unsigned int __force *)addr);
|
||||
}
|
||||
#define readq readq
|
||||
static inline u64 readq(const volatile void __iomem *addr)
|
||||
{
|
||||
return le64_to_cpu(__raw_readq(addr));
|
||||
}
|
||||
static inline void writeb(unsigned char v, volatile void __iomem *addr)
|
||||
{
|
||||
*(volatile unsigned char __force *)addr = v;
|
||||
|
@ -101,6 +106,7 @@ static inline void writel(unsigned int v, volatile void __iomem *addr)
|
|||
{
|
||||
*(volatile unsigned int __force *)addr = cpu_to_le32(v);
|
||||
}
|
||||
#define writeq(b, addr) __raw_writeq(cpu_to_le64(b), addr)
|
||||
|
||||
/* ioread and iowrite variants. thease are for now same as __raw_
|
||||
* variants of accessors. we might check for endianess in the feature
|
||||
|
|
|
@ -66,7 +66,7 @@ real_start:
|
|||
mts rmsr, r0
|
||||
/* Disable stack protection from bootloader */
|
||||
mts rslr, r0
|
||||
addi r8, r0, 0xFFFFFFF
|
||||
addi r8, r0, 0xFFFFFFFF
|
||||
mts rshr, r8
|
||||
/*
|
||||
* According to Xilinx, msrclr instruction behaves like 'mfs rX,rpc'
|
||||
|
|
|
@ -134,6 +134,7 @@ static inline int dma_supported(struct device *dev, u64 mask)
|
|||
}
|
||||
|
||||
extern int dma_set_mask(struct device *dev, u64 dma_mask);
|
||||
extern int __dma_set_mask(struct device *dev, u64 dma_mask);
|
||||
|
||||
#define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL)
|
||||
|
||||
|
|
|
@ -77,6 +77,7 @@ struct iommu_table {
|
|||
#ifdef CONFIG_IOMMU_API
|
||||
struct iommu_group *it_group;
|
||||
#endif
|
||||
void (*set_bypass)(struct iommu_table *tbl, bool enable);
|
||||
};
|
||||
|
||||
/* Pure 2^n version of get_order */
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#ifdef __powerpc64__
|
||||
|
||||
extern char __start_interrupts[];
|
||||
extern char __end_interrupts[];
|
||||
|
||||
extern char __prom_init_toc_start[];
|
||||
|
@ -21,6 +22,17 @@ static inline int in_kernel_text(unsigned long addr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int overlaps_interrupt_vector_text(unsigned long start,
|
||||
unsigned long end)
|
||||
{
|
||||
unsigned long real_start, real_end;
|
||||
real_start = __start_interrupts - _stext;
|
||||
real_end = __end_interrupts - _stext;
|
||||
|
||||
return start < (unsigned long)__va(real_end) &&
|
||||
(unsigned long)__va(real_start) < end;
|
||||
}
|
||||
|
||||
static inline int overlaps_kernel_text(unsigned long start, unsigned long end)
|
||||
{
|
||||
return start < (unsigned long)__init_end &&
|
||||
|
|
|
@ -191,12 +191,10 @@ EXPORT_SYMBOL(dma_direct_ops);
|
|||
|
||||
#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)
|
||||
|
||||
int dma_set_mask(struct device *dev, u64 dma_mask)
|
||||
int __dma_set_mask(struct device *dev, u64 dma_mask)
|
||||
{
|
||||
struct dma_map_ops *dma_ops = get_dma_ops(dev);
|
||||
|
||||
if (ppc_md.dma_set_mask)
|
||||
return ppc_md.dma_set_mask(dev, dma_mask);
|
||||
if ((dma_ops != NULL) && (dma_ops->set_dma_mask != NULL))
|
||||
return dma_ops->set_dma_mask(dev, dma_mask);
|
||||
if (!dev->dma_mask || !dma_supported(dev, dma_mask))
|
||||
|
@ -204,6 +202,12 @@ int dma_set_mask(struct device *dev, u64 dma_mask)
|
|||
*dev->dma_mask = dma_mask;
|
||||
return 0;
|
||||
}
|
||||
int dma_set_mask(struct device *dev, u64 dma_mask)
|
||||
{
|
||||
if (ppc_md.dma_set_mask)
|
||||
return ppc_md.dma_set_mask(dev, dma_mask);
|
||||
return __dma_set_mask(dev, dma_mask);
|
||||
}
|
||||
EXPORT_SYMBOL(dma_set_mask);
|
||||
|
||||
u64 dma_get_required_mask(struct device *dev)
|
||||
|
|
|
@ -362,9 +362,13 @@ static void *eeh_rmv_device(void *data, void *userdata)
|
|||
*/
|
||||
if (!dev || (dev->hdr_type & PCI_HEADER_TYPE_BRIDGE))
|
||||
return NULL;
|
||||
|
||||
driver = eeh_pcid_get(dev);
|
||||
if (driver && driver->err_handler)
|
||||
return NULL;
|
||||
if (driver) {
|
||||
eeh_pcid_put(dev);
|
||||
if (driver->err_handler)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Remove it from PCI subsystem */
|
||||
pr_debug("EEH: Removing %s without EEH sensitive driver\n",
|
||||
|
|
|
@ -1088,6 +1088,14 @@ int iommu_take_ownership(struct iommu_table *tbl)
|
|||
memset(tbl->it_map, 0xff, sz);
|
||||
iommu_clear_tces_and_put_pages(tbl, tbl->it_offset, tbl->it_size);
|
||||
|
||||
/*
|
||||
* Disable iommu bypass, otherwise the user can DMA to all of
|
||||
* our physical memory via the bypass window instead of just
|
||||
* the pages that has been explicitly mapped into the iommu
|
||||
*/
|
||||
if (tbl->set_bypass)
|
||||
tbl->set_bypass(tbl, false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iommu_take_ownership);
|
||||
|
@ -1102,6 +1110,10 @@ void iommu_release_ownership(struct iommu_table *tbl)
|
|||
/* Restore bit#0 set by iommu_init_table() */
|
||||
if (tbl->it_offset == 0)
|
||||
set_bit(0, tbl->it_map);
|
||||
|
||||
/* The kernel owns the device now, we can restore the iommu bypass */
|
||||
if (tbl->set_bypass)
|
||||
tbl->set_bypass(tbl, true);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iommu_release_ownership);
|
||||
|
||||
|
|
|
@ -559,8 +559,13 @@ void exc_lvl_ctx_init(void)
|
|||
#ifdef CONFIG_PPC64
|
||||
cpu_nr = i;
|
||||
#else
|
||||
#ifdef CONFIG_SMP
|
||||
cpu_nr = get_hard_smp_processor_id(i);
|
||||
#else
|
||||
cpu_nr = 0;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
memset((void *)critirq_ctx[cpu_nr], 0, THREAD_SIZE);
|
||||
tp = critirq_ctx[cpu_nr];
|
||||
tp->cpu = cpu_nr;
|
||||
|
|
|
@ -196,7 +196,9 @@ int overlaps_crashkernel(unsigned long start, unsigned long size)
|
|||
|
||||
/* Values we need to export to the second kernel via the device tree. */
|
||||
static phys_addr_t kernel_end;
|
||||
static phys_addr_t crashk_base;
|
||||
static phys_addr_t crashk_size;
|
||||
static unsigned long long mem_limit;
|
||||
|
||||
static struct property kernel_end_prop = {
|
||||
.name = "linux,kernel-end",
|
||||
|
@ -207,7 +209,7 @@ static struct property kernel_end_prop = {
|
|||
static struct property crashk_base_prop = {
|
||||
.name = "linux,crashkernel-base",
|
||||
.length = sizeof(phys_addr_t),
|
||||
.value = &crashk_res.start,
|
||||
.value = &crashk_base
|
||||
};
|
||||
|
||||
static struct property crashk_size_prop = {
|
||||
|
@ -219,9 +221,11 @@ static struct property crashk_size_prop = {
|
|||
static struct property memory_limit_prop = {
|
||||
.name = "linux,memory-limit",
|
||||
.length = sizeof(unsigned long long),
|
||||
.value = &memory_limit,
|
||||
.value = &mem_limit,
|
||||
};
|
||||
|
||||
#define cpu_to_be_ulong __PASTE(cpu_to_be, BITS_PER_LONG)
|
||||
|
||||
static void __init export_crashk_values(struct device_node *node)
|
||||
{
|
||||
struct property *prop;
|
||||
|
@ -237,8 +241,9 @@ static void __init export_crashk_values(struct device_node *node)
|
|||
of_remove_property(node, prop);
|
||||
|
||||
if (crashk_res.start != 0) {
|
||||
crashk_base = cpu_to_be_ulong(crashk_res.start),
|
||||
of_add_property(node, &crashk_base_prop);
|
||||
crashk_size = resource_size(&crashk_res);
|
||||
crashk_size = cpu_to_be_ulong(resource_size(&crashk_res));
|
||||
of_add_property(node, &crashk_size_prop);
|
||||
}
|
||||
|
||||
|
@ -246,6 +251,7 @@ static void __init export_crashk_values(struct device_node *node)
|
|||
* memory_limit is required by the kexec-tools to limit the
|
||||
* crash regions to the actual memory used.
|
||||
*/
|
||||
mem_limit = cpu_to_be_ulong(memory_limit);
|
||||
of_update_property(node, &memory_limit_prop);
|
||||
}
|
||||
|
||||
|
@ -264,7 +270,7 @@ static int __init kexec_setup(void)
|
|||
of_remove_property(node, prop);
|
||||
|
||||
/* information needed by userspace when using default_machine_kexec */
|
||||
kernel_end = __pa(_end);
|
||||
kernel_end = cpu_to_be_ulong(__pa(_end));
|
||||
of_add_property(node, &kernel_end_prop);
|
||||
|
||||
export_crashk_values(node);
|
||||
|
|
|
@ -369,6 +369,7 @@ void default_machine_kexec(struct kimage *image)
|
|||
|
||||
/* Values we need to export to the second kernel via the device tree. */
|
||||
static unsigned long htab_base;
|
||||
static unsigned long htab_size;
|
||||
|
||||
static struct property htab_base_prop = {
|
||||
.name = "linux,htab-base",
|
||||
|
@ -379,7 +380,7 @@ static struct property htab_base_prop = {
|
|||
static struct property htab_size_prop = {
|
||||
.name = "linux,htab-size",
|
||||
.length = sizeof(unsigned long),
|
||||
.value = &htab_size_bytes,
|
||||
.value = &htab_size,
|
||||
};
|
||||
|
||||
static int __init export_htab_values(void)
|
||||
|
@ -403,8 +404,9 @@ static int __init export_htab_values(void)
|
|||
if (prop)
|
||||
of_remove_property(node, prop);
|
||||
|
||||
htab_base = __pa(htab_address);
|
||||
htab_base = cpu_to_be64(__pa(htab_address));
|
||||
of_add_property(node, &htab_base_prop);
|
||||
htab_size = cpu_to_be64(htab_size_bytes);
|
||||
of_add_property(node, &htab_size_prop);
|
||||
|
||||
of_node_put(node);
|
||||
|
|
|
@ -69,8 +69,8 @@ _GLOBAL(relocate)
|
|||
* R_PPC64_RELATIVE ones.
|
||||
*/
|
||||
mtctr r8
|
||||
5: lwz r0,12(9) /* ELF64_R_TYPE(reloc->r_info) */
|
||||
cmpwi r0,R_PPC64_RELATIVE
|
||||
5: ld r0,8(9) /* ELF64_R_TYPE(reloc->r_info) */
|
||||
cmpdi r0,R_PPC64_RELATIVE
|
||||
bne 6f
|
||||
ld r6,0(r9) /* reloc->r_offset */
|
||||
ld r0,16(r9) /* reloc->r_addend */
|
||||
|
|
|
@ -247,7 +247,12 @@ static void __init exc_lvl_early_init(void)
|
|||
/* interrupt stacks must be in lowmem, we get that for free on ppc32
|
||||
* as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */
|
||||
for_each_possible_cpu(i) {
|
||||
#ifdef CONFIG_SMP
|
||||
hw_cpu = get_hard_smp_processor_id(i);
|
||||
#else
|
||||
hw_cpu = 0;
|
||||
#endif
|
||||
|
||||
critirq_ctx[hw_cpu] = (struct thread_info *)
|
||||
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
|
||||
#ifdef CONFIG_BOOKE
|
||||
|
|
|
@ -207,6 +207,20 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
|
|||
if (overlaps_kernel_text(vaddr, vaddr + step))
|
||||
tprot &= ~HPTE_R_N;
|
||||
|
||||
/*
|
||||
* If relocatable, check if it overlaps interrupt vectors that
|
||||
* are copied down to real 0. For relocatable kernel
|
||||
* (e.g. kdump case) we copy interrupt vectors down to real
|
||||
* address 0. Mark that region as executable. This is
|
||||
* because on p8 system with relocation on exception feature
|
||||
* enabled, exceptions are raised with MMU (IR=DR=1) ON. Hence
|
||||
* in order to execute the interrupt handlers in virtual
|
||||
* mode the vector region need to be marked as executable.
|
||||
*/
|
||||
if ((PHYSICAL_START > MEMORY_START) &&
|
||||
overlaps_interrupt_vector_text(vaddr, vaddr + step))
|
||||
tprot &= ~HPTE_R_N;
|
||||
|
||||
hash = hpt_hash(vpn, shift, ssize);
|
||||
hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
|
||||
|
||||
|
|
|
@ -1147,6 +1147,9 @@ static void power_pmu_enable(struct pmu *pmu)
|
|||
mmcr0 = ebb_switch_in(ebb, cpuhw->mmcr[0]);
|
||||
|
||||
mb();
|
||||
if (cpuhw->bhrb_users)
|
||||
ppmu->config_bhrb(cpuhw->bhrb_filter);
|
||||
|
||||
write_mmcr0(cpuhw, mmcr0);
|
||||
|
||||
/*
|
||||
|
@ -1158,8 +1161,6 @@ static void power_pmu_enable(struct pmu *pmu)
|
|||
}
|
||||
|
||||
out:
|
||||
if (cpuhw->bhrb_users)
|
||||
ppmu->config_bhrb(cpuhw->bhrb_filter);
|
||||
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,37 @@
|
|||
#define PM_BRU_FIN 0x10068
|
||||
#define PM_BR_MPRED_CMPL 0x400f6
|
||||
|
||||
/* All L1 D cache load references counted at finish, gated by reject */
|
||||
#define PM_LD_REF_L1 0x100ee
|
||||
/* Load Missed L1 */
|
||||
#define PM_LD_MISS_L1 0x3e054
|
||||
/* Store Missed L1 */
|
||||
#define PM_ST_MISS_L1 0x300f0
|
||||
/* L1 cache data prefetches */
|
||||
#define PM_L1_PREF 0x0d8b8
|
||||
/* Instruction fetches from L1 */
|
||||
#define PM_INST_FROM_L1 0x04080
|
||||
/* Demand iCache Miss */
|
||||
#define PM_L1_ICACHE_MISS 0x200fd
|
||||
/* Instruction Demand sectors wriittent into IL1 */
|
||||
#define PM_L1_DEMAND_WRITE 0x0408c
|
||||
/* Instruction prefetch written into IL1 */
|
||||
#define PM_IC_PREF_WRITE 0x0408e
|
||||
/* The data cache was reloaded from local core's L3 due to a demand load */
|
||||
#define PM_DATA_FROM_L3 0x4c042
|
||||
/* Demand LD - L3 Miss (not L2 hit and not L3 hit) */
|
||||
#define PM_DATA_FROM_L3MISS 0x300fe
|
||||
/* All successful D-side store dispatches for this thread */
|
||||
#define PM_L2_ST 0x17080
|
||||
/* All successful D-side store dispatches for this thread that were L2 Miss */
|
||||
#define PM_L2_ST_MISS 0x17082
|
||||
/* Total HW L3 prefetches(Load+store) */
|
||||
#define PM_L3_PREF_ALL 0x4e052
|
||||
/* Data PTEG reload */
|
||||
#define PM_DTLB_MISS 0x300fc
|
||||
/* ITLB Reloaded */
|
||||
#define PM_ITLB_MISS 0x400fc
|
||||
|
||||
|
||||
/*
|
||||
* Raw event encoding for POWER8:
|
||||
|
@ -557,6 +588,8 @@ static int power8_generic_events[] = {
|
|||
[PERF_COUNT_HW_INSTRUCTIONS] = PM_INST_CMPL,
|
||||
[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = PM_BRU_FIN,
|
||||
[PERF_COUNT_HW_BRANCH_MISSES] = PM_BR_MPRED_CMPL,
|
||||
[PERF_COUNT_HW_CACHE_REFERENCES] = PM_LD_REF_L1,
|
||||
[PERF_COUNT_HW_CACHE_MISSES] = PM_LD_MISS_L1,
|
||||
};
|
||||
|
||||
static u64 power8_bhrb_filter_map(u64 branch_sample_type)
|
||||
|
@ -596,6 +629,116 @@ static void power8_config_bhrb(u64 pmu_bhrb_filter)
|
|||
mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter));
|
||||
}
|
||||
|
||||
#define C(x) PERF_COUNT_HW_CACHE_##x
|
||||
|
||||
/*
|
||||
* Table of generalized cache-related events.
|
||||
* 0 means not supported, -1 means nonsensical, other values
|
||||
* are event codes.
|
||||
*/
|
||||
static int power8_cache_events[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
|
||||
[ C(L1D) ] = {
|
||||
[ C(OP_READ) ] = {
|
||||
[ C(RESULT_ACCESS) ] = PM_LD_REF_L1,
|
||||
[ C(RESULT_MISS) ] = PM_LD_MISS_L1,
|
||||
},
|
||||
[ C(OP_WRITE) ] = {
|
||||
[ C(RESULT_ACCESS) ] = 0,
|
||||
[ C(RESULT_MISS) ] = PM_ST_MISS_L1,
|
||||
},
|
||||
[ C(OP_PREFETCH) ] = {
|
||||
[ C(RESULT_ACCESS) ] = PM_L1_PREF,
|
||||
[ C(RESULT_MISS) ] = 0,
|
||||
},
|
||||
},
|
||||
[ C(L1I) ] = {
|
||||
[ C(OP_READ) ] = {
|
||||
[ C(RESULT_ACCESS) ] = PM_INST_FROM_L1,
|
||||
[ C(RESULT_MISS) ] = PM_L1_ICACHE_MISS,
|
||||
},
|
||||
[ C(OP_WRITE) ] = {
|
||||
[ C(RESULT_ACCESS) ] = PM_L1_DEMAND_WRITE,
|
||||
[ C(RESULT_MISS) ] = -1,
|
||||
},
|
||||
[ C(OP_PREFETCH) ] = {
|
||||
[ C(RESULT_ACCESS) ] = PM_IC_PREF_WRITE,
|
||||
[ C(RESULT_MISS) ] = 0,
|
||||
},
|
||||
},
|
||||
[ C(LL) ] = {
|
||||
[ C(OP_READ) ] = {
|
||||
[ C(RESULT_ACCESS) ] = PM_DATA_FROM_L3,
|
||||
[ C(RESULT_MISS) ] = PM_DATA_FROM_L3MISS,
|
||||
},
|
||||
[ C(OP_WRITE) ] = {
|
||||
[ C(RESULT_ACCESS) ] = PM_L2_ST,
|
||||
[ C(RESULT_MISS) ] = PM_L2_ST_MISS,
|
||||
},
|
||||
[ C(OP_PREFETCH) ] = {
|
||||
[ C(RESULT_ACCESS) ] = PM_L3_PREF_ALL,
|
||||
[ C(RESULT_MISS) ] = 0,
|
||||
},
|
||||
},
|
||||
[ C(DTLB) ] = {
|
||||
[ C(OP_READ) ] = {
|
||||
[ C(RESULT_ACCESS) ] = 0,
|
||||
[ C(RESULT_MISS) ] = PM_DTLB_MISS,
|
||||
},
|
||||
[ C(OP_WRITE) ] = {
|
||||
[ C(RESULT_ACCESS) ] = -1,
|
||||
[ C(RESULT_MISS) ] = -1,
|
||||
},
|
||||
[ C(OP_PREFETCH) ] = {
|
||||
[ C(RESULT_ACCESS) ] = -1,
|
||||
[ C(RESULT_MISS) ] = -1,
|
||||
},
|
||||
},
|
||||
[ C(ITLB) ] = {
|
||||
[ C(OP_READ) ] = {
|
||||
[ C(RESULT_ACCESS) ] = 0,
|
||||
[ C(RESULT_MISS) ] = PM_ITLB_MISS,
|
||||
},
|
||||
[ C(OP_WRITE) ] = {
|
||||
[ C(RESULT_ACCESS) ] = -1,
|
||||
[ C(RESULT_MISS) ] = -1,
|
||||
},
|
||||
[ C(OP_PREFETCH) ] = {
|
||||
[ C(RESULT_ACCESS) ] = -1,
|
||||
[ C(RESULT_MISS) ] = -1,
|
||||
},
|
||||
},
|
||||
[ C(BPU) ] = {
|
||||
[ C(OP_READ) ] = {
|
||||
[ C(RESULT_ACCESS) ] = PM_BRU_FIN,
|
||||
[ C(RESULT_MISS) ] = PM_BR_MPRED_CMPL,
|
||||
},
|
||||
[ C(OP_WRITE) ] = {
|
||||
[ C(RESULT_ACCESS) ] = -1,
|
||||
[ C(RESULT_MISS) ] = -1,
|
||||
},
|
||||
[ C(OP_PREFETCH) ] = {
|
||||
[ C(RESULT_ACCESS) ] = -1,
|
||||
[ C(RESULT_MISS) ] = -1,
|
||||
},
|
||||
},
|
||||
[ C(NODE) ] = {
|
||||
[ C(OP_READ) ] = {
|
||||
[ C(RESULT_ACCESS) ] = -1,
|
||||
[ C(RESULT_MISS) ] = -1,
|
||||
},
|
||||
[ C(OP_WRITE) ] = {
|
||||
[ C(RESULT_ACCESS) ] = -1,
|
||||
[ C(RESULT_MISS) ] = -1,
|
||||
},
|
||||
[ C(OP_PREFETCH) ] = {
|
||||
[ C(RESULT_ACCESS) ] = -1,
|
||||
[ C(RESULT_MISS) ] = -1,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
#undef C
|
||||
|
||||
static struct power_pmu power8_pmu = {
|
||||
.name = "POWER8",
|
||||
.n_counter = 6,
|
||||
|
@ -611,6 +754,7 @@ static struct power_pmu power8_pmu = {
|
|||
.flags = PPMU_HAS_SSLOT | PPMU_HAS_SIER | PPMU_BHRB | PPMU_EBB,
|
||||
.n_generic = ARRAY_SIZE(power8_generic_events),
|
||||
.generic_events = power8_generic_events,
|
||||
.cache_events = &power8_cache_events,
|
||||
.attr_groups = power8_pmu_attr_groups,
|
||||
.bhrb_nr = 32,
|
||||
};
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue