aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/README13
-rw-r--r--Documentation/ABI/stable/sysfs-bus-usb8
-rw-r--r--Documentation/ABI/stable/sysfs-driver-ib_srp13
-rw-r--r--Documentation/ABI/stable/sysfs-transport-srp39
-rw-r--r--Documentation/ABI/testing/configfs-usb-gadget-mass-storage31
-rw-r--r--Documentation/ABI/testing/sysfs-bus-iio71
-rw-r--r--Documentation/ABI/testing/sysfs-class-mic.txt157
-rw-r--r--Documentation/ABI/testing/sysfs-class-mtd2
-rw-r--r--Documentation/ABI/testing/sysfs-class-net-batman-adv4
-rw-r--r--Documentation/ABI/testing/sysfs-class-net-mesh34
-rw-r--r--Documentation/ABI/testing/sysfs-class-powercap152
-rw-r--r--Documentation/ABI/testing/sysfs-devices-power32
-rw-r--r--Documentation/ABI/testing/sysfs-driver-hid-roccat-ryos178
-rw-r--r--Documentation/ABI/testing/sysfs-driver-hid-wiimote18
-rw-r--r--Documentation/ABI/testing/sysfs-driver-sunxi-sid22
-rw-r--r--Documentation/ABI/testing/sysfs-power22
-rw-r--r--Documentation/DMA-API-HOWTO.txt37
-rw-r--r--Documentation/DMA-API.txt8
-rw-r--r--Documentation/DMA-attributes.txt6
-rw-r--r--Documentation/DocBook/80211.tmpl4
-rw-r--r--Documentation/DocBook/device-drivers.tmpl5
-rw-r--r--Documentation/DocBook/filesystems.tmpl1
-rw-r--r--Documentation/DocBook/genericirq.tmpl64
-rw-r--r--Documentation/DocBook/kernel-locking.tmpl2
-rw-r--r--Documentation/DocBook/mtdnand.tmpl2
-rw-r--r--Documentation/PCI/pci.txt8
-rw-r--r--Documentation/RCU/checklist.txt4
-rw-r--r--Documentation/RCU/stallwarn.txt22
-rw-r--r--Documentation/acpi/dsdt-override.txt2
-rw-r--r--Documentation/acpi/enumeration.txt26
-rw-r--r--Documentation/arm/Marvell/README1
-rw-r--r--Documentation/arm/sunxi/README26
-rw-r--r--Documentation/arm64/booting.txt45
-rw-r--r--Documentation/arm64/memory.txt29
-rw-r--r--Documentation/assoc_array.txt574
-rw-r--r--Documentation/backlight/lp855x-driver.txt5
-rw-r--r--Documentation/block/00-INDEX2
-rw-r--r--Documentation/block/cmdline-partition.txt8
-rw-r--r--Documentation/blockdev/floppy.txt6
-rw-r--r--Documentation/cgroups/memory.txt10
-rw-r--r--Documentation/connector/ucon.c2
-rw-r--r--Documentation/cpu-freq/cpu-drivers.txt27
-rw-r--r--Documentation/cpu-freq/governors.txt4
-rw-r--r--Documentation/cpu-hotplug.txt2
-rw-r--r--Documentation/cpuidle/governor.txt1
-rw-r--r--Documentation/device-mapper/cache-policies.txt6
-rw-r--r--Documentation/device-mapper/cache.txt57
-rw-r--r--Documentation/device-mapper/dm-crypt.txt11
-rw-r--r--Documentation/devices.txt1
-rw-r--r--Documentation/devicetree/bindings/arc/pmu.txt24
-rw-r--r--Documentation/devicetree/bindings/arm/arm-boards50
-rw-r--r--Documentation/devicetree/bindings/arm/armada-370-xp-mpic.txt3
-rw-r--r--Documentation/devicetree/bindings/arm/atmel-adc.txt8
-rw-r--r--Documentation/devicetree/bindings/arm/calxeda/mem-ctrlr.txt4
-rw-r--r--Documentation/devicetree/bindings/arm/cci.txt60
-rw-r--r--Documentation/devicetree/bindings/arm/cpus.txt401
-rw-r--r--Documentation/devicetree/bindings/arm/omap/omap.txt3
-rw-r--r--Documentation/devicetree/bindings/arm/topology.txt474
-rw-r--r--Documentation/devicetree/bindings/arm/vic.txt12
-rw-r--r--Documentation/devicetree/bindings/clock/efm32-clock.txt11
-rw-r--r--Documentation/devicetree/bindings/clock/imx6q-clock.txt5
-rw-r--r--Documentation/devicetree/bindings/clock/keystone-gate.txt29
-rw-r--r--Documentation/devicetree/bindings/clock/keystone-pll.txt84
-rw-r--r--Documentation/devicetree/bindings/clock/mvebu-corediv-clock.txt19
-rw-r--r--Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt14
-rw-r--r--Documentation/devicetree/bindings/clock/sunxi.txt4
-rw-r--r--Documentation/devicetree/bindings/clock/sunxi/sun4i-a10-gates.txt93
-rw-r--r--Documentation/devicetree/bindings/clock/sunxi/sun5i-a10s-gates.txt75
-rw-r--r--Documentation/devicetree/bindings/clock/sunxi/sun5i-a13-gates.txt58
-rw-r--r--Documentation/devicetree/bindings/clock/sunxi/sun6i-a31-gates.txt83
-rw-r--r--Documentation/devicetree/bindings/clock/sunxi/sun7i-a20-gates.txt98
-rw-r--r--Documentation/devicetree/bindings/clock/xgene.txt111
-rw-r--r--Documentation/devicetree/bindings/crypto/omap-aes.txt31
-rw-r--r--Documentation/devicetree/bindings/crypto/omap-des.txt30
-rw-r--r--Documentation/devicetree/bindings/crypto/omap-sham.txt28
-rw-r--r--Documentation/devicetree/bindings/dma/atmel-dma.txt2
-rw-r--r--Documentation/devicetree/bindings/gpio/abilis,tb10x-gpio.txt36
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-bcm-kona.txt52
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt71
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio.txt40
-rw-r--r--Documentation/devicetree/bindings/hwmon/lm90.txt44
-rw-r--r--Documentation/devicetree/bindings/hwrng/omap_rng.txt22
-rw-r--r--Documentation/devicetree/bindings/i2c/i2c-bcm-kona.txt35
-rw-r--r--Documentation/devicetree/bindings/i2c/i2c-exynos5.txt44
-rw-r--r--Documentation/devicetree/bindings/i2c/i2c-rcar.txt23
-rw-r--r--Documentation/devicetree/bindings/i2c/i2c-st.txt41
-rw-r--r--Documentation/devicetree/bindings/i2c/trivial-devices.txt4
-rw-r--r--Documentation/devicetree/bindings/iio/light/cm36651.txt26
-rw-r--r--Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt21
-rw-r--r--Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt2
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/allwinner,sun4i-ic.txt3
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/interrupts.txt29
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/sunxi/sun4i-a10.txt89
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/sunxi/sun5i-a13.txt55
-rw-r--r--Documentation/devicetree/bindings/leds/leds-lp55xx.txt11
-rw-r--r--Documentation/devicetree/bindings/media/st-rc.txt29
-rw-r--r--Documentation/devicetree/bindings/memory.txt168
-rw-r--r--Documentation/devicetree/bindings/mfd/as3722.txt194
-rw-r--r--Documentation/devicetree/bindings/mfd/s2mps11.txt13
-rw-r--r--Documentation/devicetree/bindings/misc/allwinner,sunxi-sid.txt17
-rw-r--r--Documentation/devicetree/bindings/misc/ti,dac7512.txt20
-rw-r--r--Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt5
-rw-r--r--Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt9
-rw-r--r--Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt26
-rw-r--r--Documentation/devicetree/bindings/mmc/tmio_mmc.txt17
-rw-r--r--Documentation/devicetree/bindings/mtd/gpmc-nand.txt16
-rw-r--r--Documentation/devicetree/bindings/net/cpsw-phy-sel.txt28
-rw-r--r--Documentation/devicetree/bindings/net/fsl-tsec-phy.txt18
-rw-r--r--Documentation/devicetree/bindings/pci/designware-pcie.txt7
-rw-r--r--Documentation/devicetree/bindings/pci/mvebu-pci.txt10
-rw-r--r--Documentation/devicetree/bindings/phy/phy-bindings.txt66
-rw-r--r--Documentation/devicetree/bindings/phy/samsung-phy.txt22
-rw-r--r--Documentation/devicetree/bindings/pinctrl/abilis,tb10x-iomux.txt80
-rw-r--r--Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt2
-rw-r--r--Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt37
-rw-r--r--Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt99
-rw-r--r--Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt859
-rw-r--r--Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt2
-rw-r--r--Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt11
-rw-r--r--Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt46
-rw-r--r--Documentation/devicetree/bindings/power/twl-charger.txt20
-rw-r--r--Documentation/devicetree/bindings/power_supply/ti,bq24735.txt32
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/dma.txt138
-rw-r--r--Documentation/devicetree/bindings/pwm/pwm-samsung.txt2
-rw-r--r--Documentation/devicetree/bindings/regulator/as3722-regulator.txt91
-rw-r--r--Documentation/devicetree/bindings/regulator/da9210.txt21
-rw-r--r--Documentation/devicetree/bindings/regulator/palmas-pmic.txt12
-rw-r--r--Documentation/devicetree/bindings/regulator/regulator.txt5
-rw-r--r--Documentation/devicetree/bindings/sound/cs42l73.txt22
-rw-r--r--Documentation/devicetree/bindings/sound/davinci-evm-audio.txt42
-rw-r--r--Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt41
-rw-r--r--Documentation/devicetree/bindings/sound/tlv320aic3x.txt26
-rw-r--r--Documentation/devicetree/bindings/sound/tpa6130a2.txt27
-rw-r--r--Documentation/devicetree/bindings/spi/omap-spi.txt4
-rw-r--r--Documentation/devicetree/bindings/spi/sh-hspi.txt7
-rw-r--r--Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt36
-rw-r--r--Documentation/devicetree/bindings/timer/efm32,timer.txt23
-rw-r--r--Documentation/devicetree/bindings/usb/msm-hsusb.txt17
-rw-r--r--Documentation/devicetree/bindings/usb/omap-usb.txt39
-rw-r--r--Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt7
-rw-r--r--Documentation/devicetree/bindings/usb/usb-phy.txt6
-rw-r--r--Documentation/devicetree/bindings/usb/ux500-usb.txt2
-rw-r--r--Documentation/devicetree/bindings/vendor-prefixes.txt10
-rw-r--r--Documentation/devicetree/bindings/video/atmel,lcdc.txt75
-rw-r--r--Documentation/devicetree/bindings/video/backlight/lp855x.txt29
-rw-r--r--Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt7
-rw-r--r--Documentation/devicetree/bindings/video/exynos_dp.txt17
-rw-r--r--Documentation/devicetree/bindings/video/exynos_hdmi.txt14
-rw-r--r--Documentation/devicetree/bindings/video/exynos_mixer.txt4
-rw-r--r--Documentation/devicetree/bindings/watchdog/dw_wdt.txt21
-rw-r--r--Documentation/devicetree/bindings/watchdog/men-a021-wdt.txt (renamed from Documentation/devicetree/bindings/gpio/men-a021-wdt.txt)0
-rw-r--r--Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt15
-rw-r--r--Documentation/devicetree/bindings/watchdog/rt2880-wdt.txt19
-rw-r--r--Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt14
-rw-r--r--Documentation/dmatest.txt72
-rw-r--r--Documentation/driver-model/devres.txt4
-rw-r--r--Documentation/efi-stub.txt (renamed from Documentation/x86/efi-stub.txt)0
-rw-r--r--Documentation/extcon/porting-android-switch-class6
-rw-r--r--Documentation/filesystems/btrfs.txt34
-rw-r--r--Documentation/filesystems/caching/netfs-api.txt73
-rw-r--r--Documentation/filesystems/directory-locking31
-rw-r--r--Documentation/filesystems/f2fs.txt7
-rw-r--r--Documentation/filesystems/porting8
-rw-r--r--Documentation/filesystems/proc.txt1
-rw-r--r--Documentation/filesystems/vfat.txt2
-rw-r--r--Documentation/gcov.txt4
-rw-r--r--Documentation/hwmon/lm2506620
-rw-r--r--Documentation/hwmon/lm906
-rw-r--r--Documentation/hwmon/ltc297844
-rw-r--r--Documentation/i2c/busses/i2c-i8011
-rw-r--r--Documentation/input/gamepad.txt3
-rw-r--r--Documentation/ioctl/ioctl-number.txt1
-rw-r--r--Documentation/kbuild/kconfig.txt11
-rw-r--r--Documentation/kernel-parameters.txt132
-rw-r--r--Documentation/kernel-per-CPU-kthreads.txt17
-rw-r--r--Documentation/laptops/thinkpad-acpi.txt7
-rw-r--r--Documentation/lockstat.txt123
-rw-r--r--Documentation/mic/mic_overview.txt51
-rw-r--r--Documentation/mic/mpssd/.gitignore1
-rw-r--r--Documentation/mic/mpssd/Makefile19
-rwxr-xr-xDocumentation/mic/mpssd/micctrl173
-rwxr-xr-xDocumentation/mic/mpssd/mpss202
-rw-r--r--Documentation/mic/mpssd/mpssd.c1721
-rw-r--r--Documentation/mic/mpssd/mpssd.h102
-rw-r--r--Documentation/mic/mpssd/sysfs.c102
-rw-r--r--Documentation/mutex-design.txt10
-rw-r--r--Documentation/networking/batman-adv.txt54
-rw-r--r--Documentation/networking/bonding.txt75
-rw-r--r--Documentation/networking/can.txt217
-rw-r--r--Documentation/networking/dccp.txt4
-rw-r--r--Documentation/networking/e100.txt2
-rw-r--r--Documentation/networking/ieee802154.txt4
-rw-r--r--Documentation/networking/ip-sysctl.txt18
-rw-r--r--Documentation/networking/l2tp.txt2
-rw-r--r--Documentation/networking/netdev-FAQ.txt24
-rw-r--r--Documentation/networking/netdevices.txt10
-rw-r--r--Documentation/networking/netlink_mmap.txt6
-rw-r--r--Documentation/networking/operstates.txt4
-rw-r--r--Documentation/networking/rxrpc.txt2
-rw-r--r--Documentation/networking/stmmac.txt8
-rw-r--r--Documentation/networking/vortex.txt4
-rw-r--r--Documentation/networking/x25-iface.txt2
-rw-r--r--Documentation/phy.txt166
-rw-r--r--Documentation/pinctrl.txt7
-rw-r--r--Documentation/power/opp.txt108
-rw-r--r--Documentation/power/power_supply_class.txt8
-rw-r--r--Documentation/power/powercap/powercap.txt236
-rw-r--r--Documentation/power/runtime_pm.txt28
-rw-r--r--Documentation/pps/pps.txt15
-rw-r--r--Documentation/ptp/testptp.c65
-rw-r--r--Documentation/pwm.txt4
-rw-r--r--Documentation/s390/s390dbf.txt10
-rw-r--r--Documentation/scheduler/sched-arch.txt5
-rw-r--r--Documentation/security/00-INDEX2
-rw-r--r--Documentation/security/IMA-templates.txt87
-rw-r--r--Documentation/security/keys.txt20
-rw-r--r--Documentation/serial/driver4
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt2
-rw-r--r--Documentation/sound/alsa/Audiophile-Usb.txt2
-rw-r--r--Documentation/sound/alsa/CMIPCI.txt2
-rw-r--r--Documentation/sound/alsa/HD-Audio-Models.txt1
-rw-r--r--Documentation/sound/alsa/compress_offload.txt6
-rw-r--r--Documentation/sound/alsa/soc/DPCM.txt380
-rw-r--r--Documentation/sound/alsa/soc/codec.txt46
-rw-r--r--Documentation/sound/alsa/soc/dapm.txt73
-rw-r--r--Documentation/sound/alsa/soc/machine.txt6
-rw-r--r--Documentation/sound/alsa/soc/platform.txt19
-rw-r--r--Documentation/sysctl/kernel.txt101
-rw-r--r--Documentation/sysctl/vm.txt15
-rw-r--r--Documentation/sysrq.txt28
-rw-r--r--Documentation/timers/00-INDEX4
-rw-r--r--Documentation/trace/ftrace.txt6
-rw-r--r--Documentation/trace/tracepoints.txt5
-rw-r--r--Documentation/usb/gadget_configfs.txt6
-rw-r--r--Documentation/virtual/kvm/00-INDEX24
-rw-r--r--Documentation/virtual/kvm/api.txt152
-rw-r--r--Documentation/virtual/kvm/cpuid.txt7
-rw-r--r--Documentation/virtual/kvm/devices/vfio.txt22
-rw-r--r--Documentation/virtual/kvm/locking.txt19
-rw-r--r--Documentation/vm/00-INDEX20
-rw-r--r--Documentation/vm/split_page_table_lock94
-rw-r--r--Documentation/vm/zswap.txt8
242 files changed, 9626 insertions, 2523 deletions
diff --git a/Documentation/ABI/README b/Documentation/ABI/README
index 10069828568b..1fafc4b0753b 100644
--- a/Documentation/ABI/README
+++ b/Documentation/ABI/README
@@ -72,3 +72,16 @@ kernel tree without going through the obsolete state first.
72 72
73It's up to the developer to place their interfaces in the category they 73It's up to the developer to place their interfaces in the category they
74wish for it to start out in. 74wish for it to start out in.
75
76
77Notable bits of non-ABI, which should not under any circumstances be considered
78stable:
79
80- Kconfig. Userspace should not rely on the presence or absence of any
81 particular Kconfig symbol, in /proc/config.gz, in the copy of .config
82 commonly installed to /boot, or in any invocation of the kernel build
83 process.
84
85- Kernel-internal symbols. Do not rely on the presence, absence, location, or
86 type of any kernel symbol, either in System.map files or the kernel binary
87 itself. See Documentation/stable_api_nonsense.txt.
diff --git a/Documentation/ABI/stable/sysfs-bus-usb b/Documentation/ABI/stable/sysfs-bus-usb
index 2be603c52a24..a6b685724740 100644
--- a/Documentation/ABI/stable/sysfs-bus-usb
+++ b/Documentation/ABI/stable/sysfs-bus-usb
@@ -37,8 +37,8 @@ Description:
37 that the USB device has been connected to the machine. This 37 that the USB device has been connected to the machine. This
38 file is read-only. 38 file is read-only.
39Users: 39Users:
40 PowerTOP <power@bughost.org> 40 PowerTOP <powertop@lists.01.org>
41 http://www.lesswatts.org/projects/powertop/ 41 https://01.org/powertop/
42 42
43What: /sys/bus/usb/device/.../power/active_duration 43What: /sys/bus/usb/device/.../power/active_duration
44Date: January 2008 44Date: January 2008
@@ -57,8 +57,8 @@ Description:
57 will give an integer percentage. Note that this does not 57 will give an integer percentage. Note that this does not
58 account for counter wrap. 58 account for counter wrap.
59Users: 59Users:
60 PowerTOP <power@bughost.org> 60 PowerTOP <powertop@lists.01.org>
61 http://www.lesswatts.org/projects/powertop/ 61 https://01.org/powertop/
62 62
63What: /sys/bus/usb/devices/<busnum>-<port[.port]>...:<config num>-<interface num>/supports_autosuspend 63What: /sys/bus/usb/devices/<busnum>-<port[.port]>...:<config num>-<interface num>/supports_autosuspend
64Date: January 2008 64Date: January 2008
diff --git a/Documentation/ABI/stable/sysfs-driver-ib_srp b/Documentation/ABI/stable/sysfs-driver-ib_srp
index 5c53d28f775c..b9688de8455b 100644
--- a/Documentation/ABI/stable/sysfs-driver-ib_srp
+++ b/Documentation/ABI/stable/sysfs-driver-ib_srp
@@ -61,6 +61,12 @@ Description: Interface for making ib_srp connect to a new target.
61 interrupt is handled by a different CPU then the comp_vector 61 interrupt is handled by a different CPU then the comp_vector
62 parameter can be used to spread the SRP completion workload 62 parameter can be used to spread the SRP completion workload
63 over multiple CPU's. 63 over multiple CPU's.
64 * tl_retry_count, a number in the range 2..7 specifying the
65 IB RC retry count.
66 * queue_size, the maximum number of commands that the
67 initiator is allowed to queue per SCSI host. The default
68 value for this parameter is 62. The lowest supported value
69 is 2.
64 70
65What: /sys/class/infiniband_srp/srp-<hca>-<port_number>/ibdev 71What: /sys/class/infiniband_srp/srp-<hca>-<port_number>/ibdev
66Date: January 2, 2006 72Date: January 2, 2006
@@ -153,6 +159,13 @@ Contact: linux-rdma@vger.kernel.org
153Description: InfiniBand service ID used for establishing communication with 159Description: InfiniBand service ID used for establishing communication with
154 the SRP target. 160 the SRP target.
155 161
162What: /sys/class/scsi_host/host<n>/sgid
163Date: February 1, 2014
164KernelVersion: 3.13
165Contact: linux-rdma@vger.kernel.org
166Description: InfiniBand GID of the source port used for communication with
167 the SRP target.
168
156What: /sys/class/scsi_host/host<n>/zero_req_lim 169What: /sys/class/scsi_host/host<n>/zero_req_lim
157Date: September 20, 2006 170Date: September 20, 2006
158KernelVersion: 2.6.18 171KernelVersion: 2.6.18
diff --git a/Documentation/ABI/stable/sysfs-transport-srp b/Documentation/ABI/stable/sysfs-transport-srp
index b36fb0dc13c8..ec7af69fea0a 100644
--- a/Documentation/ABI/stable/sysfs-transport-srp
+++ b/Documentation/ABI/stable/sysfs-transport-srp
@@ -5,6 +5,24 @@ Contact: linux-scsi@vger.kernel.org, linux-rdma@vger.kernel.org
5Description: Instructs an SRP initiator to disconnect from a target and to 5Description: Instructs an SRP initiator to disconnect from a target and to
6 remove all LUNs imported from that target. 6 remove all LUNs imported from that target.
7 7
8What: /sys/class/srp_remote_ports/port-<h>:<n>/dev_loss_tmo
9Date: February 1, 2014
10KernelVersion: 3.13
11Contact: linux-scsi@vger.kernel.org, linux-rdma@vger.kernel.org
12Description: Number of seconds the SCSI layer will wait after a transport
13 layer error has been observed before removing a target port.
14 Zero means immediate removal. Setting this attribute to "off"
15 will disable the dev_loss timer.
16
17What: /sys/class/srp_remote_ports/port-<h>:<n>/fast_io_fail_tmo
18Date: February 1, 2014
19KernelVersion: 3.13
20Contact: linux-scsi@vger.kernel.org, linux-rdma@vger.kernel.org
21Description: Number of seconds the SCSI layer will wait after a transport
22 layer error has been observed before failing I/O. Zero means
23 failing I/O immediately. Setting this attribute to "off" will
24 disable the fast_io_fail timer.
25
8What: /sys/class/srp_remote_ports/port-<h>:<n>/port_id 26What: /sys/class/srp_remote_ports/port-<h>:<n>/port_id
9Date: June 27, 2007 27Date: June 27, 2007
10KernelVersion: 2.6.24 28KernelVersion: 2.6.24
@@ -12,8 +30,29 @@ Contact: linux-scsi@vger.kernel.org
12Description: 16-byte local SRP port identifier in hexadecimal format. An 30Description: 16-byte local SRP port identifier in hexadecimal format. An
13 example: 4c:49:4e:55:58:20:56:49:4f:00:00:00:00:00:00:00. 31 example: 4c:49:4e:55:58:20:56:49:4f:00:00:00:00:00:00:00.
14 32
33What: /sys/class/srp_remote_ports/port-<h>:<n>/reconnect_delay
34Date: February 1, 2014
35KernelVersion: 3.13
36Contact: linux-scsi@vger.kernel.org, linux-rdma@vger.kernel.org
37Description: Number of seconds the SCSI layer will wait after a reconnect
38 attempt failed before retrying. Setting this attribute to
39 "off" will disable time-based reconnecting.
40
15What: /sys/class/srp_remote_ports/port-<h>:<n>/roles 41What: /sys/class/srp_remote_ports/port-<h>:<n>/roles
16Date: June 27, 2007 42Date: June 27, 2007
17KernelVersion: 2.6.24 43KernelVersion: 2.6.24
18Contact: linux-scsi@vger.kernel.org 44Contact: linux-scsi@vger.kernel.org
19Description: Role of the remote port. Either "SRP Initiator" or "SRP Target". 45Description: Role of the remote port. Either "SRP Initiator" or "SRP Target".
46
47What: /sys/class/srp_remote_ports/port-<h>:<n>/state
48Date: February 1, 2014
49KernelVersion: 3.13
50Contact: linux-scsi@vger.kernel.org, linux-rdma@vger.kernel.org
51Description: State of the transport layer used for communication with the
52 remote port. "running" if the transport layer is operational;
53 "blocked" if a transport layer error has been encountered but
54 the fast_io_fail_tmo timer has not yet fired; "fail-fast"
55 after the fast_io_fail_tmo timer has fired and before the
56 "dev_loss_tmo" timer has fired; "lost" after the
57 "dev_loss_tmo" timer has fired and before the port is finally
58 removed.
diff --git a/Documentation/ABI/testing/configfs-usb-gadget-mass-storage b/Documentation/ABI/testing/configfs-usb-gadget-mass-storage
new file mode 100644
index 000000000000..ad72a37ee9ff
--- /dev/null
+++ b/Documentation/ABI/testing/configfs-usb-gadget-mass-storage
@@ -0,0 +1,31 @@
1What: /config/usb-gadget/gadget/functions/mass_storage.name
2Date: Oct 2013
3KenelVersion: 3.13
4Description:
5 The attributes:
6
7 stall - Set to permit function to halt bulk endpoints.
8 Disabled on some USB devices known not to work
9 correctly. You should set it to true.
10 num_buffers - Number of pipeline buffers. Valid numbers
11 are 2..4. Available only if
12 CONFIG_USB_GADGET_DEBUG_FILES is set.
13
14What: /config/usb-gadget/gadget/functions/mass_storage.name/lun.name
15Date: Oct 2013
16KenelVersion: 3.13
17Description:
18 The attributes:
19
20 file - The path to the backing file for the LUN.
21 Required if LUN is not marked as removable.
22 ro - Flag specifying access to the LUN shall be
23 read-only. This is implied if CD-ROM emulation
24 is enabled as well as when it was impossible
25 to open "filename" in R/W mode.
26 removable - Flag specifying that LUN shall be indicated as
27 being removable.
28 cdrom - Flag specifying that LUN shall be reported as
29 being a CD-ROM.
30 nofua - Flag specifying that FUA flag
31 in SCSI WRITE(10,12)
diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index 39c8de0e53d0..b20e829d350f 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -79,7 +79,7 @@ Description:
79 correspond to externally available input one of the named 79 correspond to externally available input one of the named
80 versions may be used. The number must always be specified and 80 versions may be used. The number must always be specified and
81 unique to allow association with event codes. Units after 81 unique to allow association with event codes. Units after
82 application of scale and offset are microvolts. 82 application of scale and offset are millivolts.
83 83
84What: /sys/bus/iio/devices/iio:deviceX/in_voltageY-voltageZ_raw 84What: /sys/bus/iio/devices/iio:deviceX/in_voltageY-voltageZ_raw
85KernelVersion: 2.6.35 85KernelVersion: 2.6.35
@@ -90,7 +90,7 @@ Description:
90 physically equivalent inputs when non differential readings are 90 physically equivalent inputs when non differential readings are
91 separately available. In differential only parts, then all that 91 separately available. In differential only parts, then all that
92 is required is a consistent labeling. Units after application 92 is required is a consistent labeling. Units after application
93 of scale and offset are microvolts. 93 of scale and offset are millivolts.
94 94
95What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_raw 95What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_raw
96KernelVersion: 3.2 96KernelVersion: 3.2
@@ -537,6 +537,62 @@ Description:
537 value is in raw device units or in processed units (as _raw 537 value is in raw device units or in processed units (as _raw
538 and _input do on sysfs direct channel read attributes). 538 and _input do on sysfs direct channel read attributes).
539 539
540What: /sys/.../events/in_accel_x_thresh_rising_hysteresis
541What: /sys/.../events/in_accel_x_thresh_falling_hysteresis
542What: /sys/.../events/in_accel_x_thresh_either_hysteresis
543What: /sys/.../events/in_accel_y_thresh_rising_hysteresis
544What: /sys/.../events/in_accel_y_thresh_falling_hysteresis
545What: /sys/.../events/in_accel_y_thresh_either_hysteresis
546What: /sys/.../events/in_accel_z_thresh_rising_hysteresis
547What: /sys/.../events/in_accel_z_thresh_falling_hysteresis
548What: /sys/.../events/in_accel_z_thresh_either_hysteresis
549What: /sys/.../events/in_anglvel_x_thresh_rising_hysteresis
550What: /sys/.../events/in_anglvel_x_thresh_falling_hysteresis
551What: /sys/.../events/in_anglvel_x_thresh_either_hysteresis
552What: /sys/.../events/in_anglvel_y_thresh_rising_hysteresis
553What: /sys/.../events/in_anglvel_y_thresh_falling_hysteresis
554What: /sys/.../events/in_anglvel_y_thresh_either_hysteresis
555What: /sys/.../events/in_anglvel_z_thresh_rising_hysteresis
556What: /sys/.../events/in_anglvel_z_thresh_falling_hysteresis
557What: /sys/.../events/in_anglvel_z_thresh_either_hysteresis
558What: /sys/.../events/in_magn_x_thresh_rising_hysteresis
559What: /sys/.../events/in_magn_x_thresh_falling_hysteresis
560What: /sys/.../events/in_magn_x_thresh_either_hysteresis
561What: /sys/.../events/in_magn_y_thresh_rising_hysteresis
562What: /sys/.../events/in_magn_y_thresh_falling_hysteresis
563What: /sys/.../events/in_magn_y_thresh_either_hysteresis
564What: /sys/.../events/in_magn_z_thresh_rising_hysteresis
565What: /sys/.../events/in_magn_z_thresh_falling_hysteresis
566What: /sys/.../events/in_magn_z_thresh_either_hysteresis
567What: /sys/.../events/in_voltageY_thresh_rising_hysteresis
568What: /sys/.../events/in_voltageY_thresh_falling_hysteresis
569What: /sys/.../events/in_voltageY_thresh_either_hysteresis
570What: /sys/.../events/in_tempY_thresh_rising_hysteresis
571What: /sys/.../events/in_tempY_thresh_falling_hysteresis
572What: /sys/.../events/in_tempY_thresh_either_hysteresis
573What: /sys/.../events/in_illuminance0_thresh_falling_hysteresis
574what: /sys/.../events/in_illuminance0_thresh_rising_hysteresis
575what: /sys/.../events/in_illuminance0_thresh_either_hysteresis
576what: /sys/.../events/in_proximity0_thresh_falling_hysteresis
577what: /sys/.../events/in_proximity0_thresh_rising_hysteresis
578what: /sys/.../events/in_proximity0_thresh_either_hysteresis
579KernelVersion: 3.13
580Contact: linux-iio@vger.kernel.org
581Description:
582 Specifies the hysteresis of threshold that the device is comparing
583 against for the events enabled by
584 <type>Y[_name]_thresh[_(rising|falling)]_hysteresis.
585 If separate attributes exist for the two directions, but
586 direction is not specified for this attribute, then a single
587 hysteresis value applies to both directions.
588 For falling events the hysteresis is added to the _value attribute for
589 this event to get the upper threshold for when the event goes back to
590 normal, for rising events the hysteresis is subtracted from the _value
591 attribute. E.g. if in_voltage0_raw_thresh_rising_value is set to 1200
592 and in_voltage0_raw_thresh_rising_hysteresis is set to 50. The event
593 will get activated once in_voltage0_raw goes above 1200 and will become
594 deactived again once the value falls below 1150.
595
540What: /sys/.../events/in_accel_x_raw_roc_rising_value 596What: /sys/.../events/in_accel_x_raw_roc_rising_value
541What: /sys/.../events/in_accel_x_raw_roc_falling_value 597What: /sys/.../events/in_accel_x_raw_roc_falling_value
542What: /sys/.../events/in_accel_y_raw_roc_rising_value 598What: /sys/.../events/in_accel_y_raw_roc_rising_value
@@ -811,3 +867,14 @@ Description:
811 Writing '1' stores the current device configuration into 867 Writing '1' stores the current device configuration into
812 on-chip EEPROM. After power-up or chip reset the device will 868 on-chip EEPROM. After power-up or chip reset the device will
813 automatically load the saved configuration. 869 automatically load the saved configuration.
870
871What: /sys/.../iio:deviceX/in_intensity_red_integration_time
872What: /sys/.../iio:deviceX/in_intensity_green_integration_time
873What: /sys/.../iio:deviceX/in_intensity_blue_integration_time
874What: /sys/.../iio:deviceX/in_intensity_clear_integration_time
875What: /sys/.../iio:deviceX/in_illuminance_integration_time
876KernelVersion: 3.12
877Contact: linux-iio@vger.kernel.org
878Description:
879 This attribute is used to get/set the integration time in
880 seconds.
diff --git a/Documentation/ABI/testing/sysfs-class-mic.txt b/Documentation/ABI/testing/sysfs-class-mic.txt
new file mode 100644
index 000000000000..13f48afc534f
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-mic.txt
@@ -0,0 +1,157 @@
1What: /sys/class/mic/
2Date: October 2013
3KernelVersion: 3.13
4Contact: Sudeep Dutt <sudeep.dutt@intel.com>
5Description:
6 The mic class directory belongs to Intel MIC devices and
7 provides information per MIC device. An Intel MIC device is a
8 PCIe form factor add-in Coprocessor card based on the Intel Many
9 Integrated Core (MIC) architecture that runs a Linux OS.
10
11What: /sys/class/mic/mic(x)
12Date: October 2013
13KernelVersion: 3.13
14Contact: Sudeep Dutt <sudeep.dutt@intel.com>
15Description:
16 The directories /sys/class/mic/mic0, /sys/class/mic/mic1 etc.,
17 represent MIC devices (0,1,..etc). Each directory has
18 information specific to that MIC device.
19
20What: /sys/class/mic/mic(x)/family
21Date: October 2013
22KernelVersion: 3.13
23Contact: Sudeep Dutt <sudeep.dutt@intel.com>
24Description:
25 Provides information about the Coprocessor family for an Intel
26 MIC device. For example - "x100"
27
28What: /sys/class/mic/mic(x)/stepping
29Date: October 2013
30KernelVersion: 3.13
31Contact: Sudeep Dutt <sudeep.dutt@intel.com>
32Description:
33 Provides information about the silicon stepping for an Intel
34 MIC device. For example - "A0" or "B0"
35
36What: /sys/class/mic/mic(x)/state
37Date: October 2013
38KernelVersion: 3.13
39Contact: Sudeep Dutt <sudeep.dutt@intel.com>
40Description:
41 When read, this entry provides the current state of an Intel
42 MIC device in the context of the card OS. Possible values that
43 will be read are:
44 "offline" - The MIC device is ready to boot the card OS. On
45 reading this entry after an OSPM resume, a "boot" has to be
46 written to this entry if the card was previously shutdown
47 during OSPM suspend.
48 "online" - The MIC device has initiated booting a card OS.
49 "shutting_down" - The card OS is shutting down.
50 "reset_failed" - The MIC device has failed to reset.
51 "suspending" - The MIC device is currently being prepared for
52 suspend. On reading this entry, a "suspend" has to be written
53 to the state sysfs entry to ensure the card is shutdown during
54 OSPM suspend.
55 "suspended" - The MIC device has been suspended.
56
57 When written, this sysfs entry triggers different state change
58 operations depending upon the current state of the card OS.
59 Acceptable values are:
60 "boot" - Boot the card OS image specified by the combination
61 of firmware, ramdisk, cmdline and bootmode
62 sysfs entries.
63 "reset" - Initiates device reset.
64 "shutdown" - Initiates card OS shutdown.
65 "suspend" - Initiates card OS shutdown and also marks the card
66 as suspended.
67
68What: /sys/class/mic/mic(x)/shutdown_status
69Date: October 2013
70KernelVersion: 3.13
71Contact: Sudeep Dutt <sudeep.dutt@intel.com>
72Description:
73 An Intel MIC device runs a Linux OS during its operation. This
74 OS can shutdown because of various reasons. When read, this
75 entry provides the status on why the card OS was shutdown.
76 Possible values are:
77 "nop" - shutdown status is not applicable, when the card OS is
78 "online"
79 "crashed" - Shutdown because of a HW or SW crash.
80 "halted" - Shutdown because of a halt command.
81 "poweroff" - Shutdown because of a poweroff command.
82 "restart" - Shutdown because of a restart command.
83
84What: /sys/class/mic/mic(x)/cmdline
85Date: October 2013
86KernelVersion: 3.13
87Contact: Sudeep Dutt <sudeep.dutt@intel.com>
88Description:
89 An Intel MIC device runs a Linux OS during its operation. Before
90 booting this card OS, it is possible to pass kernel command line
91 options to configure various features in it, similar to
92 self-bootable machines. When read, this entry provides
93 information about the current kernel command line options set to
94 boot the card OS. This entry can be written to change the
95 existing kernel command line options. Typically, the user would
96 want to read the current command line options, append new ones
97 or modify existing ones and then write the whole kernel command
98 line back to this entry.
99
100What: /sys/class/mic/mic(x)/firmware
101Date: October 2013
102KernelVersion: 3.13
103Contact: Sudeep Dutt <sudeep.dutt@intel.com>
104Description:
105 When read, this sysfs entry provides the path name under
106 /lib/firmware/ where the firmware image to be booted on the
107 card can be found. The entry can be written to change the
108 firmware image location under /lib/firmware/.
109
110What: /sys/class/mic/mic(x)/ramdisk
111Date: October 2013
112KernelVersion: 3.13
113Contact: Sudeep Dutt <sudeep.dutt@intel.com>
114Description:
115 When read, this sysfs entry provides the path name under
116 /lib/firmware/ where the ramdisk image to be used during card
117 OS boot can be found. The entry can be written to change
118 the ramdisk image location under /lib/firmware/.
119
120What: /sys/class/mic/mic(x)/bootmode
121Date: October 2013
122KernelVersion: 3.13
123Contact: Sudeep Dutt <sudeep.dutt@intel.com>
124Description:
125 When read, this sysfs entry provides the current bootmode for
126 the card. This sysfs entry can be written with the following
127 valid strings:
128 a) linux - Boot a Linux image.
129 b) elf - Boot an elf image for flash updates.
130
131What: /sys/class/mic/mic(x)/log_buf_addr
132Date: October 2013
133KernelVersion: 3.13
134Contact: Sudeep Dutt <sudeep.dutt@intel.com>
135Description:
136 An Intel MIC device runs a Linux OS during its operation. For
137 debugging purpose and early kernel boot messages, the user can
138 access the card OS log buffer via debugfs. When read, this entry
139 provides the kernel virtual address of the buffer where the card
140 OS log buffer can be read. This entry is written by the host
141 configuration daemon to set the log buffer address. The correct
142 log buffer address to be written can be found in the System.map
143 file of the card OS.
144
145What: /sys/class/mic/mic(x)/log_buf_len
146Date: October 2013
147KernelVersion: 3.13
148Contact: Sudeep Dutt <sudeep.dutt@intel.com>
149Description:
150 An Intel MIC device runs a Linux OS during its operation. For
151 debugging purpose and early kernel boot messages, the user can
152 access the card OS log buffer via debugfs. When read, this entry
153 provides the kernel virtual address where the card OS log buffer
154 length can be read. This entry is written by host configuration
155 daemon to set the log buffer length address. The correct log
156 buffer length address to be written can be found in the
157 System.map file of the card OS.
diff --git a/Documentation/ABI/testing/sysfs-class-mtd b/Documentation/ABI/testing/sysfs-class-mtd
index bfd119ace6ad..1399bb2da3eb 100644
--- a/Documentation/ABI/testing/sysfs-class-mtd
+++ b/Documentation/ABI/testing/sysfs-class-mtd
@@ -104,7 +104,7 @@ Description:
104 One of the following ASCII strings, representing the device 104 One of the following ASCII strings, representing the device
105 type: 105 type:
106 106
107 absent, ram, rom, nor, nand, dataflash, ubi, unknown 107 absent, ram, rom, nor, nand, mlc-nand, dataflash, ubi, unknown
108 108
109What: /sys/class/mtd/mtdX/writesize 109What: /sys/class/mtd/mtdX/writesize
110Date: April 2009 110Date: April 2009
diff --git a/Documentation/ABI/testing/sysfs-class-net-batman-adv b/Documentation/ABI/testing/sysfs-class-net-batman-adv
index bdc00707c751..7f34a95bb963 100644
--- a/Documentation/ABI/testing/sysfs-class-net-batman-adv
+++ b/Documentation/ABI/testing/sysfs-class-net-batman-adv
@@ -1,13 +1,13 @@
1 1
2What: /sys/class/net/<iface>/batman-adv/iface_status 2What: /sys/class/net/<iface>/batman-adv/iface_status
3Date: May 2010 3Date: May 2010
4Contact: Marek Lindner <lindner_marek@yahoo.de> 4Contact: Marek Lindner <mareklindner@neomailbox.ch>
5Description: 5Description:
6 Indicates the status of <iface> as it is seen by batman. 6 Indicates the status of <iface> as it is seen by batman.
7 7
8What: /sys/class/net/<iface>/batman-adv/mesh_iface 8What: /sys/class/net/<iface>/batman-adv/mesh_iface
9Date: May 2010 9Date: May 2010
10Contact: Marek Lindner <lindner_marek@yahoo.de> 10Contact: Marek Lindner <mareklindner@neomailbox.ch>
11Description: 11Description:
12 The /sys/class/net/<iface>/batman-adv/mesh_iface file 12 The /sys/class/net/<iface>/batman-adv/mesh_iface file
13 displays the batman mesh interface this <iface> 13 displays the batman mesh interface this <iface>
diff --git a/Documentation/ABI/testing/sysfs-class-net-mesh b/Documentation/ABI/testing/sysfs-class-net-mesh
index bdcd8b4e38f2..0baa657b18c4 100644
--- a/Documentation/ABI/testing/sysfs-class-net-mesh
+++ b/Documentation/ABI/testing/sysfs-class-net-mesh
@@ -1,22 +1,23 @@
1 1
2What: /sys/class/net/<mesh_iface>/mesh/aggregated_ogms 2What: /sys/class/net/<mesh_iface>/mesh/aggregated_ogms
3Date: May 2010 3Date: May 2010
4Contact: Marek Lindner <lindner_marek@yahoo.de> 4Contact: Marek Lindner <mareklindner@neomailbox.ch>
5Description: 5Description:
6 Indicates whether the batman protocol messages of the 6 Indicates whether the batman protocol messages of the
7 mesh <mesh_iface> shall be aggregated or not. 7 mesh <mesh_iface> shall be aggregated or not.
8 8
9What: /sys/class/net/<mesh_iface>/mesh/ap_isolation 9What: /sys/class/net/<mesh_iface>/mesh/<vlan_subdir>/ap_isolation
10Date: May 2011 10Date: May 2011
11Contact: Antonio Quartulli <ordex@autistici.org> 11Contact: Antonio Quartulli <antonio@meshcoding.com>
12Description: 12Description:
13 Indicates whether the data traffic going from a 13 Indicates whether the data traffic going from a
14 wireless client to another wireless client will be 14 wireless client to another wireless client will be
15 silently dropped. 15 silently dropped. <vlan_subdir> is empty when referring
16 to the untagged lan.
16 17
17What: /sys/class/net/<mesh_iface>/mesh/bonding 18What: /sys/class/net/<mesh_iface>/mesh/bonding
18Date: June 2010 19Date: June 2010
19Contact: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> 20Contact: Simon Wunderlich <sw@simonwunderlich.de>
20Description: 21Description:
21 Indicates whether the data traffic going through the 22 Indicates whether the data traffic going through the
22 mesh will be sent using multiple interfaces at the 23 mesh will be sent using multiple interfaces at the
@@ -24,7 +25,7 @@ Description:
24 25
25What: /sys/class/net/<mesh_iface>/mesh/bridge_loop_avoidance 26What: /sys/class/net/<mesh_iface>/mesh/bridge_loop_avoidance
26Date: November 2011 27Date: November 2011
27Contact: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> 28Contact: Simon Wunderlich <sw@simonwunderlich.de>
28Description: 29Description:
29 Indicates whether the bridge loop avoidance feature 30 Indicates whether the bridge loop avoidance feature
30 is enabled. This feature detects and avoids loops 31 is enabled. This feature detects and avoids loops
@@ -41,21 +42,21 @@ Description:
41 42
42What: /sys/class/net/<mesh_iface>/mesh/gw_bandwidth 43What: /sys/class/net/<mesh_iface>/mesh/gw_bandwidth
43Date: October 2010 44Date: October 2010
44Contact: Marek Lindner <lindner_marek@yahoo.de> 45Contact: Marek Lindner <mareklindner@neomailbox.ch>
45Description: 46Description:
46 Defines the bandwidth which is propagated by this 47 Defines the bandwidth which is propagated by this
47 node if gw_mode was set to 'server'. 48 node if gw_mode was set to 'server'.
48 49
49What: /sys/class/net/<mesh_iface>/mesh/gw_mode 50What: /sys/class/net/<mesh_iface>/mesh/gw_mode
50Date: October 2010 51Date: October 2010
51Contact: Marek Lindner <lindner_marek@yahoo.de> 52Contact: Marek Lindner <mareklindner@neomailbox.ch>
52Description: 53Description:
53 Defines the state of the gateway features. Can be 54 Defines the state of the gateway features. Can be
54 either 'off', 'client' or 'server'. 55 either 'off', 'client' or 'server'.
55 56
56What: /sys/class/net/<mesh_iface>/mesh/gw_sel_class 57What: /sys/class/net/<mesh_iface>/mesh/gw_sel_class
57Date: October 2010 58Date: October 2010
58Contact: Marek Lindner <lindner_marek@yahoo.de> 59Contact: Marek Lindner <mareklindner@neomailbox.ch>
59Description: 60Description:
60 Defines the selection criteria this node will use 61 Defines the selection criteria this node will use
61 to choose a gateway if gw_mode was set to 'client'. 62 to choose a gateway if gw_mode was set to 'client'.
@@ -77,25 +78,14 @@ Description:
77 78
78What: /sys/class/net/<mesh_iface>/mesh/orig_interval 79What: /sys/class/net/<mesh_iface>/mesh/orig_interval
79Date: May 2010 80Date: May 2010
80Contact: Marek Lindner <lindner_marek@yahoo.de> 81Contact: Marek Lindner <mareklindner@neomailbox.ch>
81Description: 82Description:
82 Defines the interval in milliseconds in which batman 83 Defines the interval in milliseconds in which batman
83 sends its protocol messages. 84 sends its protocol messages.
84 85
85What: /sys/class/net/<mesh_iface>/mesh/routing_algo 86What: /sys/class/net/<mesh_iface>/mesh/routing_algo
86Date: Dec 2011 87Date: Dec 2011
87Contact: Marek Lindner <lindner_marek@yahoo.de> 88Contact: Marek Lindner <mareklindner@neomailbox.ch>
88Description: 89Description:
89 Defines the routing procotol this mesh instance 90 Defines the routing procotol this mesh instance
90 uses to find the optimal paths through the mesh. 91 uses to find the optimal paths through the mesh.
91
92What: /sys/class/net/<mesh_iface>/mesh/vis_mode
93Date: May 2010
94Contact: Marek Lindner <lindner_marek@yahoo.de>
95Description:
96 Each batman node only maintains information about its
97 own local neighborhood, therefore generating graphs
98 showing the topology of the entire mesh is not easily
99 feasible without having a central instance to collect
100 the local topologies from all nodes. This file allows
101 to activate the collecting (server) mode.
diff --git a/Documentation/ABI/testing/sysfs-class-powercap b/Documentation/ABI/testing/sysfs-class-powercap
new file mode 100644
index 000000000000..db3b3ff70d84
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-powercap
@@ -0,0 +1,152 @@
1What: /sys/class/powercap/
2Date: September 2013
3KernelVersion: 3.13
4Contact: linux-pm@vger.kernel.org
5Description:
6 The powercap/ class sub directory belongs to the power cap
7 subsystem. Refer to
8 Documentation/power/powercap/powercap.txt for details.
9
10What: /sys/class/powercap/<control type>
11Date: September 2013
12KernelVersion: 3.13
13Contact: linux-pm@vger.kernel.org
14Description:
15 A <control type> is a unique name under /sys/class/powercap.
16 Here <control type> determines how the power is going to be
17 controlled. A <control type> can contain multiple power zones.
18
19What: /sys/class/powercap/<control type>/enabled
20Date: September 2013
21KernelVersion: 3.13
22Contact: linux-pm@vger.kernel.org
23Description:
24 This allows to enable/disable power capping for a "control type".
25 This status affects every power zone using this "control_type.
26
27What: /sys/class/powercap/<control type>/<power zone>
28Date: September 2013
29KernelVersion: 3.13
30Contact: linux-pm@vger.kernel.org
31Description:
32 A power zone is a single or a collection of devices, which can
33 be independently monitored and controlled. A power zone sysfs
34 entry is qualified with the name of the <control type>.
35 E.g. intel-rapl:0:1:1.
36
37What: /sys/class/powercap/<control type>/<power zone>/<child power zone>
38Date: September 2013
39KernelVersion: 3.13
40Contact: linux-pm@vger.kernel.org
41Description:
42 Power zones may be organized in a hierarchy in which child
43 power zones provide monitoring and control for a subset of
44 devices under the parent. For example, if there is a parent
45 power zone for a whole CPU package, each CPU core in it can
46 be a child power zone.
47
48What: /sys/class/powercap/.../<power zone>/name
49Date: September 2013
50KernelVersion: 3.13
51Contact: linux-pm@vger.kernel.org
52Description:
53 Specifies the name of this power zone.
54
55What: /sys/class/powercap/.../<power zone>/energy_uj
56Date: September 2013
57KernelVersion: 3.13
58Contact: linux-pm@vger.kernel.org
59Description:
60 Current energy counter in micro-joules. Write "0" to reset.
61 If the counter can not be reset, then this attribute is
62 read-only.
63
64What: /sys/class/powercap/.../<power zone>/max_energy_range_uj
65Date: September 2013
66KernelVersion: 3.13
67Contact: linux-pm@vger.kernel.org
68Description:
69 Range of the above energy counter in micro-joules.
70
71
72What: /sys/class/powercap/.../<power zone>/power_uw
73Date: September 2013
74KernelVersion: 3.13
75Contact: linux-pm@vger.kernel.org
76Description:
77 Current power in micro-watts.
78
79What: /sys/class/powercap/.../<power zone>/max_power_range_uw
80Date: September 2013
81KernelVersion: 3.13
82Contact: linux-pm@vger.kernel.org
83Description:
84 Range of the above power value in micro-watts.
85
86What: /sys/class/powercap/.../<power zone>/constraint_X_name
87Date: September 2013
88KernelVersion: 3.13
89Contact: linux-pm@vger.kernel.org
90Description:
91 Each power zone can define one or more constraints. Each
92 constraint can have an optional name. Here "X" can have values
93 from 0 to max integer.
94
95What: /sys/class/powercap/.../<power zone>/constraint_X_power_limit_uw
96Date: September 2013
97KernelVersion: 3.13
98Contact: linux-pm@vger.kernel.org
99Description:
100 Power limit in micro-watts should be applicable for
101 the time window specified by "constraint_X_time_window_us".
102 Here "X" can have values from 0 to max integer.
103
104What: /sys/class/powercap/.../<power zone>/constraint_X_time_window_us
105Date: September 2013
106KernelVersion: 3.13
107Contact: linux-pm@vger.kernel.org
108Description:
109 Time window in micro seconds. This is used along with
110 constraint_X_power_limit_uw to define a power constraint.
111 Here "X" can have values from 0 to max integer.
112
113
114What: /sys/class/powercap/<control type>/.../constraint_X_max_power_uw
115Date: September 2013
116KernelVersion: 3.13
117Contact: linux-pm@vger.kernel.org
118Description:
119 Maximum allowed power in micro watts for this constraint.
120 Here "X" can have values from 0 to max integer.
121
122What: /sys/class/powercap/<control type>/.../constraint_X_min_power_uw
123Date: September 2013
124KernelVersion: 3.13
125Contact: linux-pm@vger.kernel.org
126Description:
127 Minimum allowed power in micro watts for this constraint.
128 Here "X" can have values from 0 to max integer.
129
130What: /sys/class/powercap/.../<power zone>/constraint_X_max_time_window_us
131Date: September 2013
132KernelVersion: 3.13
133Contact: linux-pm@vger.kernel.org
134Description:
135 Maximum allowed time window in micro seconds for this
136 constraint. Here "X" can have values from 0 to max integer.
137
138What: /sys/class/powercap/.../<power zone>/constraint_X_min_time_window_us
139Date: September 2013
140KernelVersion: 3.13
141Contact: linux-pm@vger.kernel.org
142Description:
143 Minimum allowed time window in micro seconds for this
144 constraint. Here "X" can have values from 0 to max integer.
145
146What: /sys/class/powercap/.../<power zone>/enabled
147Date: September 2013
148KernelVersion: 3.13
149Contact: linux-pm@vger.kernel.org
150Description
151 This allows to enable/disable power capping at power zone level.
152 This applies to current power zone and its children.
diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power
index 9d43e7670841..efe449bdf811 100644
--- a/Documentation/ABI/testing/sysfs-devices-power
+++ b/Documentation/ABI/testing/sysfs-devices-power
@@ -1,6 +1,6 @@
1What: /sys/devices/.../power/ 1What: /sys/devices/.../power/
2Date: January 2009 2Date: January 2009
3Contact: Rafael J. Wysocki <rjw@sisk.pl> 3Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
4Description: 4Description:
5 The /sys/devices/.../power directory contains attributes 5 The /sys/devices/.../power directory contains attributes
6 allowing the user space to check and modify some power 6 allowing the user space to check and modify some power
@@ -8,7 +8,7 @@ Description:
8 8
9What: /sys/devices/.../power/wakeup 9What: /sys/devices/.../power/wakeup
10Date: January 2009 10Date: January 2009
11Contact: Rafael J. Wysocki <rjw@sisk.pl> 11Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
12Description: 12Description:
13 The /sys/devices/.../power/wakeup attribute allows the user 13 The /sys/devices/.../power/wakeup attribute allows the user
14 space to check if the device is enabled to wake up the system 14 space to check if the device is enabled to wake up the system
@@ -34,7 +34,7 @@ Description:
34 34
35What: /sys/devices/.../power/control 35What: /sys/devices/.../power/control
36Date: January 2009 36Date: January 2009
37Contact: Rafael J. Wysocki <rjw@sisk.pl> 37Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
38Description: 38Description:
39 The /sys/devices/.../power/control attribute allows the user 39 The /sys/devices/.../power/control attribute allows the user
40 space to control the run-time power management of the device. 40 space to control the run-time power management of the device.
@@ -53,7 +53,7 @@ Description:
53 53
54What: /sys/devices/.../power/async 54What: /sys/devices/.../power/async
55Date: January 2009 55Date: January 2009
56Contact: Rafael J. Wysocki <rjw@sisk.pl> 56Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
57Description: 57Description:
58 The /sys/devices/.../async attribute allows the user space to 58 The /sys/devices/.../async attribute allows the user space to
59 enable or diasble the device's suspend and resume callbacks to 59 enable or diasble the device's suspend and resume callbacks to
@@ -79,7 +79,7 @@ Description:
79 79
80What: /sys/devices/.../power/wakeup_count 80What: /sys/devices/.../power/wakeup_count
81Date: September 2010 81Date: September 2010
82Contact: Rafael J. Wysocki <rjw@sisk.pl> 82Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
83Description: 83Description:
84 The /sys/devices/.../wakeup_count attribute contains the number 84 The /sys/devices/.../wakeup_count attribute contains the number
85 of signaled wakeup events associated with the device. This 85 of signaled wakeup events associated with the device. This
@@ -88,7 +88,7 @@ Description:
88 88
89What: /sys/devices/.../power/wakeup_active_count 89What: /sys/devices/.../power/wakeup_active_count
90Date: September 2010 90Date: September 2010
91Contact: Rafael J. Wysocki <rjw@sisk.pl> 91Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
92Description: 92Description:
93 The /sys/devices/.../wakeup_active_count attribute contains the 93 The /sys/devices/.../wakeup_active_count attribute contains the
94 number of times the processing of wakeup events associated with 94 number of times the processing of wakeup events associated with
@@ -98,7 +98,7 @@ Description:
98 98
99What: /sys/devices/.../power/wakeup_abort_count 99What: /sys/devices/.../power/wakeup_abort_count
100Date: February 2012 100Date: February 2012
101Contact: Rafael J. Wysocki <rjw@sisk.pl> 101Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
102Description: 102Description:
103 The /sys/devices/.../wakeup_abort_count attribute contains the 103 The /sys/devices/.../wakeup_abort_count attribute contains the
104 number of times the processing of a wakeup event associated with 104 number of times the processing of a wakeup event associated with
@@ -109,7 +109,7 @@ Description:
109 109
110What: /sys/devices/.../power/wakeup_expire_count 110What: /sys/devices/.../power/wakeup_expire_count
111Date: February 2012 111Date: February 2012
112Contact: Rafael J. Wysocki <rjw@sisk.pl> 112Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
113Description: 113Description:
114 The /sys/devices/.../wakeup_expire_count attribute contains the 114 The /sys/devices/.../wakeup_expire_count attribute contains the
115 number of times a wakeup event associated with the device has 115 number of times a wakeup event associated with the device has
@@ -119,7 +119,7 @@ Description:
119 119
120What: /sys/devices/.../power/wakeup_active 120What: /sys/devices/.../power/wakeup_active
121Date: September 2010 121Date: September 2010
122Contact: Rafael J. Wysocki <rjw@sisk.pl> 122Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
123Description: 123Description:
124 The /sys/devices/.../wakeup_active attribute contains either 1, 124 The /sys/devices/.../wakeup_active attribute contains either 1,
125 or 0, depending on whether or not a wakeup event associated with 125 or 0, depending on whether or not a wakeup event associated with
@@ -129,7 +129,7 @@ Description:
129 129
130What: /sys/devices/.../power/wakeup_total_time_ms 130What: /sys/devices/.../power/wakeup_total_time_ms
131Date: September 2010 131Date: September 2010
132Contact: Rafael J. Wysocki <rjw@sisk.pl> 132Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
133Description: 133Description:
134 The /sys/devices/.../wakeup_total_time_ms attribute contains 134 The /sys/devices/.../wakeup_total_time_ms attribute contains
135 the total time of processing wakeup events associated with the 135 the total time of processing wakeup events associated with the
@@ -139,7 +139,7 @@ Description:
139 139
140What: /sys/devices/.../power/wakeup_max_time_ms 140What: /sys/devices/.../power/wakeup_max_time_ms
141Date: September 2010 141Date: September 2010
142Contact: Rafael J. Wysocki <rjw@sisk.pl> 142Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
143Description: 143Description:
144 The /sys/devices/.../wakeup_max_time_ms attribute contains 144 The /sys/devices/.../wakeup_max_time_ms attribute contains
145 the maximum time of processing a single wakeup event associated 145 the maximum time of processing a single wakeup event associated
@@ -149,7 +149,7 @@ Description:
149 149
150What: /sys/devices/.../power/wakeup_last_time_ms 150What: /sys/devices/.../power/wakeup_last_time_ms
151Date: September 2010 151Date: September 2010
152Contact: Rafael J. Wysocki <rjw@sisk.pl> 152Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
153Description: 153Description:
154 The /sys/devices/.../wakeup_last_time_ms attribute contains 154 The /sys/devices/.../wakeup_last_time_ms attribute contains
155 the value of the monotonic clock corresponding to the time of 155 the value of the monotonic clock corresponding to the time of
@@ -160,7 +160,7 @@ Description:
160 160
161What: /sys/devices/.../power/wakeup_prevent_sleep_time_ms 161What: /sys/devices/.../power/wakeup_prevent_sleep_time_ms
162Date: February 2012 162Date: February 2012
163Contact: Rafael J. Wysocki <rjw@sisk.pl> 163Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
164Description: 164Description:
165 The /sys/devices/.../wakeup_prevent_sleep_time_ms attribute 165 The /sys/devices/.../wakeup_prevent_sleep_time_ms attribute
166 contains the total time the device has been preventing 166 contains the total time the device has been preventing
@@ -189,7 +189,7 @@ Description:
189 189
190What: /sys/devices/.../power/pm_qos_latency_us 190What: /sys/devices/.../power/pm_qos_latency_us
191Date: March 2012 191Date: March 2012
192Contact: Rafael J. Wysocki <rjw@sisk.pl> 192Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
193Description: 193Description:
194 The /sys/devices/.../power/pm_qos_resume_latency_us attribute 194 The /sys/devices/.../power/pm_qos_resume_latency_us attribute
195 contains the PM QoS resume latency limit for the given device, 195 contains the PM QoS resume latency limit for the given device,
@@ -207,7 +207,7 @@ Description:
207 207
208What: /sys/devices/.../power/pm_qos_no_power_off 208What: /sys/devices/.../power/pm_qos_no_power_off
209Date: September 2012 209Date: September 2012
210Contact: Rafael J. Wysocki <rjw@sisk.pl> 210Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
211Description: 211Description:
212 The /sys/devices/.../power/pm_qos_no_power_off attribute 212 The /sys/devices/.../power/pm_qos_no_power_off attribute
213 is used for manipulating the PM QoS "no power off" flag. If 213 is used for manipulating the PM QoS "no power off" flag. If
@@ -222,7 +222,7 @@ Description:
222 222
223What: /sys/devices/.../power/pm_qos_remote_wakeup 223What: /sys/devices/.../power/pm_qos_remote_wakeup
224Date: September 2012 224Date: September 2012
225Contact: Rafael J. Wysocki <rjw@sisk.pl> 225Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
226Description: 226Description:
227 The /sys/devices/.../power/pm_qos_remote_wakeup attribute 227 The /sys/devices/.../power/pm_qos_remote_wakeup attribute
228 is used for manipulating the PM QoS "remote wakeup required" 228 is used for manipulating the PM QoS "remote wakeup required"
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-ryos b/Documentation/ABI/testing/sysfs-driver-hid-roccat-ryos
new file mode 100644
index 000000000000..1d6a8cf9dc0a
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-ryos
@@ -0,0 +1,178 @@
1What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/control
2Date: October 2013
3Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
4Description: When written, this file lets one select which data from which
5 profile will be read next. The data has to be 3 bytes long.
6 This file is writeonly.
7Users: http://roccat.sourceforge.net
8
9What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/profile
10Date: October 2013
11Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
12Description: The mouse can store 5 profiles which can be switched by the
13 press of a button. profile holds index of actual profile.
14 This value is persistent, so its value determines the profile
15 that's active when the device is powered on next time.
16 When written, the device activates the set profile immediately.
17 The data has to be 3 bytes long.
18 The device will reject invalid data.
19Users: http://roccat.sourceforge.net
20
21What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/keys_primary
22Date: October 2013
23Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
24Description: When written, this file lets one set the default of all keys for
25 a specific profile. Profile index is included in written data.
26 The data has to be 125 bytes long.
27 Before reading this file, control has to be written to select
28 which profile to read.
29Users: http://roccat.sourceforge.net
30
31What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/keys_function
32Date: October 2013
33Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
34Description: When written, this file lets one set the function of the
35 function keys for a specific profile. Profile index is included
36 in written data. The data has to be 95 bytes long.
37 Before reading this file, control has to be written to select
38 which profile to read.
39Users: http://roccat.sourceforge.net
40
41What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/keys_macro
42Date: October 2013
43Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
44Description: When written, this file lets one set the function of the macro
45 keys for a specific profile. Profile index is included in
46 written data. The data has to be 35 bytes long.
47 Before reading this file, control has to be written to select
48 which profile to read.
49Users: http://roccat.sourceforge.net
50
51What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/keys_thumbster
52Date: October 2013
53Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
54Description: When written, this file lets one set the function of the
55 thumbster keys for a specific profile. Profile index is included
56 in written data. The data has to be 23 bytes long.
57 Before reading this file, control has to be written to select
58 which profile to read.
59Users: http://roccat.sourceforge.net
60
61What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/keys_extra
62Date: October 2013
63Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
64Description: When written, this file lets one set the function of the
65 capslock and function keys for a specific profile. Profile index
66 is included in written data. The data has to be 8 bytes long.
67 Before reading this file, control has to be written to select
68 which profile to read.
69Users: http://roccat.sourceforge.net
70
71What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/keys_easyzone
72Date: October 2013
73Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
74Description: When written, this file lets one set the function of the
75 easyzone keys for a specific profile. Profile index is included
76 in written data. The data has to be 294 bytes long.
77 Before reading this file, control has to be written to select
78 which profile to read.
79Users: http://roccat.sourceforge.net
80
81What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/key_mask
82Date: October 2013
83Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
84Description: When written, this file lets one deactivate certain keys like
85 windows and application keys, to prevent accidental presses.
86 Profile index for which this settings occur is included in
87 written data. The data has to be 6 bytes long.
88 Before reading this file, control has to be written to select
89 which profile to read.
90Users: http://roccat.sourceforge.net
91
92What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/light
93Date: October 2013
94Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
95Description: When written, this file lets one set the backlight intensity for
96 a specific profile. Profile index is included in written data.
97 This attribute is only valid for the glow and pro variant.
98 The data has to be 16 bytes long.
99 Before reading this file, control has to be written to select
100 which profile to read.
101Users: http://roccat.sourceforge.net
102
103What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/macro
104Date: October 2013
105Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
106Description: When written, this file lets one store macros with max 480
107 keystrokes for a specific button for a specific profile.
108 Button and profile indexes are included in written data.
109 The data has to be 2002 bytes long.
110 Before reading this file, control has to be written to select
111 which profile and key to read.
112Users: http://roccat.sourceforge.net
113
114What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/info
115Date: October 2013
116Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
117Description: When read, this file returns general data like firmware version.
118 The data is 8 bytes long.
119 This file is readonly.
120Users: http://roccat.sourceforge.net
121
122What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/reset
123Date: October 2013
124Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
125Description: When written, this file lets one reset the device.
126 The data has to be 3 bytes long.
127 This file is writeonly.
128Users: http://roccat.sourceforge.net
129
130What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/talk
131Date: October 2013
132Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
133Description: When written, this file lets one trigger easyshift functionality
134 from the host.
135 The data has to be 16 bytes long.
136 This file is writeonly.
137Users: http://roccat.sourceforge.net
138
139What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/light_control
140Date: October 2013
141Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
142Description: When written, this file lets one switch between stored and custom
143 light settings.
144 This attribute is only valid for the pro variant.
145 The data has to be 8 bytes long.
146 This file is writeonly.
147Users: http://roccat.sourceforge.net
148
149What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/stored_lights
150Date: October 2013
151Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
152Description: When written, this file lets one set per-key lighting for different
153 layers.
154 This attribute is only valid for the pro variant.
155 The data has to be 1382 bytes long.
156 Before reading this file, control has to be written to select
157 which profile to read.
158Users: http://roccat.sourceforge.net
159
160What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/custom_lights
161Date: October 2013
162Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
163Description: When written, this file lets one set the actual per-key lighting.
164 This attribute is only valid for the pro variant.
165 The data has to be 20 bytes long.
166 This file is writeonly.
167Users: http://roccat.sourceforge.net
168
169What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/light_macro
170Date: October 2013
171Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
172Description: When written, this file lets one set a light macro that is looped
173 whenever the device gets in dimness mode.
174 This attribute is only valid for the pro variant.
175 The data has to be 2002 bytes long.
176 Before reading this file, control has to be written to select
177 which profile to read.
178Users: http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-wiimote b/Documentation/ABI/testing/sysfs-driver-hid-wiimote
index ed5dd567d397..39dfa5cb1cc5 100644
--- a/Documentation/ABI/testing/sysfs-driver-hid-wiimote
+++ b/Documentation/ABI/testing/sysfs-driver-hid-wiimote
@@ -57,3 +57,21 @@ Description: This attribute is only provided if the device was detected as a
57 Calibration data is already applied by the kernel to all input 57 Calibration data is already applied by the kernel to all input
58 values but may be used by user-space to perform other 58 values but may be used by user-space to perform other
59 transformations. 59 transformations.
60
61What: /sys/bus/hid/drivers/wiimote/<dev>/pro_calib
62Date: October 2013
63KernelVersion: 3.13
64Contact: David Herrmann <dh.herrmann@gmail.com>
65Description: This attribute is only provided if the device was detected as a
66 pro-controller. It provides a single line with 4 calibration
67 values for all 4 analog sticks. Format is: "x1:y1 x2:y2". Data
68 is prefixed with a +/-. Each value is a signed 16bit number.
69 Data is encoded as decimal numbers and specifies the offsets of
70 the analog sticks of the pro-controller.
71 Calibration data is already applied by the kernel to all input
72 values but may be used by user-space to perform other
73 transformations.
74 Calibration data is detected by the kernel during device setup.
75 You can write "scan\n" into this file to re-trigger calibration.
76 You can also write data directly in the form "x1:y1 x2:y2" to
77 set the calibration values manually.
diff --git a/Documentation/ABI/testing/sysfs-driver-sunxi-sid b/Documentation/ABI/testing/sysfs-driver-sunxi-sid
new file mode 100644
index 000000000000..ffb9536f6ecc
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-sunxi-sid
@@ -0,0 +1,22 @@
1What: /sys/devices/*/<our-device>/eeprom
2Date: August 2013
3Contact: Oliver Schinagl <oliver@schinagl.nl>
4Description: read-only access to the SID (Security-ID) on current
5 A-series SoC's from Allwinner. Currently supports A10, A10s, A13
6 and A20 CPU's. The earlier A1x series of SoCs exports 16 bytes,
7 whereas the newer A20 SoC exposes 512 bytes split into sections.
8 Besides the 16 bytes of SID, there's also an SJTAG area,
9 HDMI-HDCP key and some custom keys. Below a quick overview, for
10 details see the user manual:
11 0x000 128 bit root-key (sun[457]i)
12 0x010 128 bit boot-key (sun7i)
13 0x020 64 bit security-jtag-key (sun7i)
14 0x028 16 bit key configuration (sun7i)
15 0x02b 16 bit custom-vendor-key (sun7i)
16 0x02c 320 bit low general key (sun7i)
17 0x040 32 bit read-control access (sun7i)
18 0x064 224 bit low general key (sun7i)
19 0x080 2304 bit HDCP-key (sun7i)
20 0x1a0 768 bit high general key (sun7i)
21Users: any user space application which wants to read the SID on
22 Allwinner's A-series of CPU's.
diff --git a/Documentation/ABI/testing/sysfs-power b/Documentation/ABI/testing/sysfs-power
index 217772615d02..205a73878441 100644
--- a/Documentation/ABI/testing/sysfs-power
+++ b/Documentation/ABI/testing/sysfs-power
@@ -1,6 +1,6 @@
1What: /sys/power/ 1What: /sys/power/
2Date: August 2006 2Date: August 2006
3Contact: Rafael J. Wysocki <rjw@sisk.pl> 3Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
4Description: 4Description:
5 The /sys/power directory will contain files that will 5 The /sys/power directory will contain files that will
6 provide a unified interface to the power management 6 provide a unified interface to the power management
@@ -8,7 +8,7 @@ Description:
8 8
9What: /sys/power/state 9What: /sys/power/state
10Date: August 2006 10Date: August 2006
11Contact: Rafael J. Wysocki <rjw@sisk.pl> 11Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
12Description: 12Description:
13 The /sys/power/state file controls the system power state. 13 The /sys/power/state file controls the system power state.
14 Reading from this file returns what states are supported, 14 Reading from this file returns what states are supported,
@@ -22,7 +22,7 @@ Description:
22 22
23What: /sys/power/disk 23What: /sys/power/disk
24Date: September 2006 24Date: September 2006
25Contact: Rafael J. Wysocki <rjw@sisk.pl> 25Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
26Description: 26Description:
27 The /sys/power/disk file controls the operating mode of the 27 The /sys/power/disk file controls the operating mode of the
28 suspend-to-disk mechanism. Reading from this file returns 28 suspend-to-disk mechanism. Reading from this file returns
@@ -67,7 +67,7 @@ Description:
67 67
68What: /sys/power/image_size 68What: /sys/power/image_size
69Date: August 2006 69Date: August 2006
70Contact: Rafael J. Wysocki <rjw@sisk.pl> 70Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
71Description: 71Description:
72 The /sys/power/image_size file controls the size of the image 72 The /sys/power/image_size file controls the size of the image
73 created by the suspend-to-disk mechanism. It can be written a 73 created by the suspend-to-disk mechanism. It can be written a
@@ -84,7 +84,7 @@ Description:
84 84
85What: /sys/power/pm_trace 85What: /sys/power/pm_trace
86Date: August 2006 86Date: August 2006
87Contact: Rafael J. Wysocki <rjw@sisk.pl> 87Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
88Description: 88Description:
89 The /sys/power/pm_trace file controls the code which saves the 89 The /sys/power/pm_trace file controls the code which saves the
90 last PM event point in the RTC across reboots, so that you can 90 last PM event point in the RTC across reboots, so that you can
@@ -133,7 +133,7 @@ Description:
133 133
134What: /sys/power/pm_async 134What: /sys/power/pm_async
135Date: January 2009 135Date: January 2009
136Contact: Rafael J. Wysocki <rjw@sisk.pl> 136Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
137Description: 137Description:
138 The /sys/power/pm_async file controls the switch allowing the 138 The /sys/power/pm_async file controls the switch allowing the
139 user space to enable or disable asynchronous suspend and resume 139 user space to enable or disable asynchronous suspend and resume
@@ -146,7 +146,7 @@ Description:
146 146
147What: /sys/power/wakeup_count 147What: /sys/power/wakeup_count
148Date: July 2010 148Date: July 2010
149Contact: Rafael J. Wysocki <rjw@sisk.pl> 149Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
150Description: 150Description:
151 The /sys/power/wakeup_count file allows user space to put the 151 The /sys/power/wakeup_count file allows user space to put the
152 system into a sleep state while taking into account the 152 system into a sleep state while taking into account the
@@ -161,7 +161,7 @@ Description:
161 161
162What: /sys/power/reserved_size 162What: /sys/power/reserved_size
163Date: May 2011 163Date: May 2011
164Contact: Rafael J. Wysocki <rjw@sisk.pl> 164Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
165Description: 165Description:
166 The /sys/power/reserved_size file allows user space to control 166 The /sys/power/reserved_size file allows user space to control
167 the amount of memory reserved for allocations made by device 167 the amount of memory reserved for allocations made by device
@@ -175,7 +175,7 @@ Description:
175 175
176What: /sys/power/autosleep 176What: /sys/power/autosleep
177Date: April 2012 177Date: April 2012
178Contact: Rafael J. Wysocki <rjw@sisk.pl> 178Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
179Description: 179Description:
180 The /sys/power/autosleep file can be written one of the strings 180 The /sys/power/autosleep file can be written one of the strings
181 returned by reads from /sys/power/state. If that happens, a 181 returned by reads from /sys/power/state. If that happens, a
@@ -192,7 +192,7 @@ Description:
192 192
193What: /sys/power/wake_lock 193What: /sys/power/wake_lock
194Date: February 2012 194Date: February 2012
195Contact: Rafael J. Wysocki <rjw@sisk.pl> 195Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
196Description: 196Description:
197 The /sys/power/wake_lock file allows user space to create 197 The /sys/power/wake_lock file allows user space to create
198 wakeup source objects and activate them on demand (if one of 198 wakeup source objects and activate them on demand (if one of
@@ -219,7 +219,7 @@ Description:
219 219
220What: /sys/power/wake_unlock 220What: /sys/power/wake_unlock
221Date: February 2012 221Date: February 2012
222Contact: Rafael J. Wysocki <rjw@sisk.pl> 222Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
223Description: 223Description:
224 The /sys/power/wake_unlock file allows user space to deactivate 224 The /sys/power/wake_unlock file allows user space to deactivate
225 wakeup sources created with the help of /sys/power/wake_lock. 225 wakeup sources created with the help of /sys/power/wake_lock.
diff --git a/Documentation/DMA-API-HOWTO.txt b/Documentation/DMA-API-HOWTO.txt
index 14129f149a75..5e983031cc11 100644
--- a/Documentation/DMA-API-HOWTO.txt
+++ b/Documentation/DMA-API-HOWTO.txt
@@ -101,14 +101,23 @@ style to do this even if your device holds the default setting,
101because this shows that you did think about these issues wrt. your 101because this shows that you did think about these issues wrt. your
102device. 102device.
103 103
104The query is performed via a call to dma_set_mask(): 104The query is performed via a call to dma_set_mask_and_coherent():
105 105
106 int dma_set_mask(struct device *dev, u64 mask); 106 int dma_set_mask_and_coherent(struct device *dev, u64 mask);
107 107
108The query for consistent allocations is performed via a call to 108which will query the mask for both streaming and coherent APIs together.
109dma_set_coherent_mask(): 109If you have some special requirements, then the following two separate
110queries can be used instead:
110 111
111 int dma_set_coherent_mask(struct device *dev, u64 mask); 112 The query for streaming mappings is performed via a call to
113 dma_set_mask():
114
115 int dma_set_mask(struct device *dev, u64 mask);
116
117 The query for consistent allocations is performed via a call
118 to dma_set_coherent_mask():
119
120 int dma_set_coherent_mask(struct device *dev, u64 mask);
112 121
113Here, dev is a pointer to the device struct of your device, and mask 122Here, dev is a pointer to the device struct of your device, and mask
114is a bit mask describing which bits of an address your device 123is a bit mask describing which bits of an address your device
@@ -137,7 +146,7 @@ exactly why.
137 146
138The standard 32-bit addressing device would do something like this: 147The standard 32-bit addressing device would do something like this:
139 148
140 if (dma_set_mask(dev, DMA_BIT_MASK(32))) { 149 if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32))) {
141 printk(KERN_WARNING 150 printk(KERN_WARNING
142 "mydev: No suitable DMA available.\n"); 151 "mydev: No suitable DMA available.\n");
143 goto ignore_this_device; 152 goto ignore_this_device;
@@ -171,22 +180,20 @@ the case would look like this:
171 180
172 int using_dac, consistent_using_dac; 181 int using_dac, consistent_using_dac;
173 182
174 if (!dma_set_mask(dev, DMA_BIT_MASK(64))) { 183 if (!dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64))) {
175 using_dac = 1; 184 using_dac = 1;
176 consistent_using_dac = 1; 185 consistent_using_dac = 1;
177 dma_set_coherent_mask(dev, DMA_BIT_MASK(64)); 186 } else if (!dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32))) {
178 } else if (!dma_set_mask(dev, DMA_BIT_MASK(32))) {
179 using_dac = 0; 187 using_dac = 0;
180 consistent_using_dac = 0; 188 consistent_using_dac = 0;
181 dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
182 } else { 189 } else {
183 printk(KERN_WARNING 190 printk(KERN_WARNING
184 "mydev: No suitable DMA available.\n"); 191 "mydev: No suitable DMA available.\n");
185 goto ignore_this_device; 192 goto ignore_this_device;
186 } 193 }
187 194
188dma_set_coherent_mask() will always be able to set the same or a 195The coherent coherent mask will always be able to set the same or a
189smaller mask as dma_set_mask(). However for the rare case that a 196smaller mask as the streaming mask. However for the rare case that a
190device driver only uses consistent allocations, one would have to 197device driver only uses consistent allocations, one would have to
191check the return value from dma_set_coherent_mask(). 198check the return value from dma_set_coherent_mask().
192 199
@@ -199,9 +206,9 @@ address you might do something like:
199 goto ignore_this_device; 206 goto ignore_this_device;
200 } 207 }
201 208
202When dma_set_mask() is successful, and returns zero, the kernel saves 209When dma_set_mask() or dma_set_mask_and_coherent() is successful, and
203away this mask you have provided. The kernel will use this 210returns zero, the kernel saves away this mask you have provided. The
204information later when you make DMA mappings. 211kernel will use this information later when you make DMA mappings.
205 212
206There is a case which we are aware of at this time, which is worth 213There is a case which we are aware of at this time, which is worth
207mentioning in this documentation. If your device supports multiple 214mentioning in this documentation. If your device supports multiple
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 78a6c569d204..e865279cec58 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -142,6 +142,14 @@ internal API for use by the platform than an external API for use by
142driver writers. 142driver writers.
143 143
144int 144int
145dma_set_mask_and_coherent(struct device *dev, u64 mask)
146
147Checks to see if the mask is possible and updates the device
148streaming and coherent DMA mask parameters if it is.
149
150Returns: 0 if successful and a negative error if not.
151
152int
145dma_set_mask(struct device *dev, u64 mask) 153dma_set_mask(struct device *dev, u64 mask)
146 154
147Checks to see if the mask is possible and updates the device 155Checks to see if the mask is possible and updates the device
diff --git a/Documentation/DMA-attributes.txt b/Documentation/DMA-attributes.txt
index e59480db9ee0..cc2450d80310 100644
--- a/Documentation/DMA-attributes.txt
+++ b/Documentation/DMA-attributes.txt
@@ -13,7 +13,7 @@ all pending DMA writes to complete, and thus provides a mechanism to
13strictly order DMA from a device across all intervening busses and 13strictly order DMA from a device across all intervening busses and
14bridges. This barrier is not specific to a particular type of 14bridges. This barrier is not specific to a particular type of
15interconnect, it applies to the system as a whole, and so its 15interconnect, it applies to the system as a whole, and so its
16implementation must account for the idiosyncracies of the system all 16implementation must account for the idiosyncrasies of the system all
17the way from the DMA device to memory. 17the way from the DMA device to memory.
18 18
19As an example of a situation where DMA_ATTR_WRITE_BARRIER would be 19As an example of a situation where DMA_ATTR_WRITE_BARRIER would be
@@ -60,7 +60,7 @@ such mapping is non-trivial task and consumes very limited resources
60Buffers allocated with this attribute can be only passed to user space 60Buffers allocated with this attribute can be only passed to user space
61by calling dma_mmap_attrs(). By using this API, you are guaranteeing 61by calling dma_mmap_attrs(). By using this API, you are guaranteeing
62that you won't dereference the pointer returned by dma_alloc_attr(). You 62that you won't dereference the pointer returned by dma_alloc_attr(). You
63can threat it as a cookie that must be passed to dma_mmap_attrs() and 63can treat it as a cookie that must be passed to dma_mmap_attrs() and
64dma_free_attrs(). Make sure that both of these also get this attribute 64dma_free_attrs(). Make sure that both of these also get this attribute
65set on each call. 65set on each call.
66 66
@@ -82,7 +82,7 @@ to 'device' domain, what synchronizes CPU caches for the given region
82(usually it means that the cache has been flushed or invalidated 82(usually it means that the cache has been flushed or invalidated
83depending on the dma direction). However, next calls to 83depending on the dma direction). However, next calls to
84dma_map_{single,page,sg}() for other devices will perform exactly the 84dma_map_{single,page,sg}() for other devices will perform exactly the
85same sychronization operation on the CPU cache. CPU cache sychronization 85same synchronization operation on the CPU cache. CPU cache synchronization
86might be a time consuming operation, especially if the buffers are 86might be a time consuming operation, especially if the buffers are
87large, so it is highly recommended to avoid it if possible. 87large, so it is highly recommended to avoid it if possible.
88DMA_ATTR_SKIP_CPU_SYNC allows platform code to skip synchronization of 88DMA_ATTR_SKIP_CPU_SYNC allows platform code to skip synchronization of
diff --git a/Documentation/DocBook/80211.tmpl b/Documentation/DocBook/80211.tmpl
index f403ec3c5c9a..46ad6faee9ab 100644
--- a/Documentation/DocBook/80211.tmpl
+++ b/Documentation/DocBook/80211.tmpl
@@ -152,8 +152,8 @@
152!Finclude/net/cfg80211.h cfg80211_scan_request 152!Finclude/net/cfg80211.h cfg80211_scan_request
153!Finclude/net/cfg80211.h cfg80211_scan_done 153!Finclude/net/cfg80211.h cfg80211_scan_done
154!Finclude/net/cfg80211.h cfg80211_bss 154!Finclude/net/cfg80211.h cfg80211_bss
155!Finclude/net/cfg80211.h cfg80211_inform_bss_frame 155!Finclude/net/cfg80211.h cfg80211_inform_bss_width_frame
156!Finclude/net/cfg80211.h cfg80211_inform_bss 156!Finclude/net/cfg80211.h cfg80211_inform_bss_width
157!Finclude/net/cfg80211.h cfg80211_unlink_bss 157!Finclude/net/cfg80211.h cfg80211_unlink_bss
158!Finclude/net/cfg80211.h cfg80211_find_ie 158!Finclude/net/cfg80211.h cfg80211_find_ie
159!Finclude/net/cfg80211.h ieee80211_bss_get_ie 159!Finclude/net/cfg80211.h ieee80211_bss_get_ie
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl
index fe397f90a34f..6c9d9d37c83a 100644
--- a/Documentation/DocBook/device-drivers.tmpl
+++ b/Documentation/DocBook/device-drivers.tmpl
@@ -87,7 +87,10 @@ X!Iinclude/linux/kobject.h
87!Ekernel/printk/printk.c 87!Ekernel/printk/printk.c
88!Ekernel/panic.c 88!Ekernel/panic.c
89!Ekernel/sys.c 89!Ekernel/sys.c
90!Ekernel/rcupdate.c 90!Ekernel/rcu/srcu.c
91!Ekernel/rcu/tree.c
92!Ekernel/rcu/tree_plugin.h
93!Ekernel/rcu/update.c
91 </sect1> 94 </sect1>
92 95
93 <sect1><title>Device Resource Management</title> 96 <sect1><title>Device Resource Management</title>
diff --git a/Documentation/DocBook/filesystems.tmpl b/Documentation/DocBook/filesystems.tmpl
index 25b58efd955d..4f676838da06 100644
--- a/Documentation/DocBook/filesystems.tmpl
+++ b/Documentation/DocBook/filesystems.tmpl
@@ -91,7 +91,6 @@
91 <title>The Filesystem for Exporting Kernel Objects</title> 91 <title>The Filesystem for Exporting Kernel Objects</title>
92!Efs/sysfs/file.c 92!Efs/sysfs/file.c
93!Efs/sysfs/symlink.c 93!Efs/sysfs/symlink.c
94!Efs/sysfs/bin.c
95 </chapter> 94 </chapter>
96 95
97 <chapter id="debugfs"> 96 <chapter id="debugfs">
diff --git a/Documentation/DocBook/genericirq.tmpl b/Documentation/DocBook/genericirq.tmpl
index d16d21b7a3b7..46347f603353 100644
--- a/Documentation/DocBook/genericirq.tmpl
+++ b/Documentation/DocBook/genericirq.tmpl
@@ -87,7 +87,7 @@
87 <chapter id="rationale"> 87 <chapter id="rationale">
88 <title>Rationale</title> 88 <title>Rationale</title>
89 <para> 89 <para>
90 The original implementation of interrupt handling in Linux is using 90 The original implementation of interrupt handling in Linux uses
91 the __do_IRQ() super-handler, which is able to deal with every 91 the __do_IRQ() super-handler, which is able to deal with every
92 type of interrupt logic. 92 type of interrupt logic.
93 </para> 93 </para>
@@ -111,19 +111,19 @@
111 </itemizedlist> 111 </itemizedlist>
112 </para> 112 </para>
113 <para> 113 <para>
114 This split implementation of highlevel IRQ handlers allows us to 114 This split implementation of high-level IRQ handlers allows us to
115 optimize the flow of the interrupt handling for each specific 115 optimize the flow of the interrupt handling for each specific
116 interrupt type. This reduces complexity in that particular codepath 116 interrupt type. This reduces complexity in that particular code path
117 and allows the optimized handling of a given type. 117 and allows the optimized handling of a given type.
118 </para> 118 </para>
119 <para> 119 <para>
120 The original general IRQ implementation used hw_interrupt_type 120 The original general IRQ implementation used hw_interrupt_type
121 structures and their ->ack(), ->end() [etc.] callbacks to 121 structures and their ->ack(), ->end() [etc.] callbacks to
122 differentiate the flow control in the super-handler. This leads to 122 differentiate the flow control in the super-handler. This leads to
123 a mix of flow logic and lowlevel hardware logic, and it also leads 123 a mix of flow logic and low-level hardware logic, and it also leads
124 to unnecessary code duplication: for example in i386, there is a 124 to unnecessary code duplication: for example in i386, there is an
125 ioapic_level_irq and a ioapic_edge_irq irq-type which share many 125 ioapic_level_irq and an ioapic_edge_irq IRQ-type which share many
126 of the lowlevel details but have different flow handling. 126 of the low-level details but have different flow handling.
127 </para> 127 </para>
128 <para> 128 <para>
129 A more natural abstraction is the clean separation of the 129 A more natural abstraction is the clean separation of the
@@ -132,23 +132,23 @@
132 <para> 132 <para>
133 Analysing a couple of architecture's IRQ subsystem implementations 133 Analysing a couple of architecture's IRQ subsystem implementations
134 reveals that most of them can use a generic set of 'irq flow' 134 reveals that most of them can use a generic set of 'irq flow'
135 methods and only need to add the chip level specific code. 135 methods and only need to add the chip-level specific code.
136 The separation is also valuable for (sub)architectures 136 The separation is also valuable for (sub)architectures
137 which need specific quirks in the irq flow itself but not in the 137 which need specific quirks in the IRQ flow itself but not in the
138 chip-details - and thus provides a more transparent IRQ subsystem 138 chip details - and thus provides a more transparent IRQ subsystem
139 design. 139 design.
140 </para> 140 </para>
141 <para> 141 <para>
142 Each interrupt descriptor is assigned its own highlevel flow 142 Each interrupt descriptor is assigned its own high-level flow
143 handler, which is normally one of the generic 143 handler, which is normally one of the generic
144 implementations. (This highlevel flow handler implementation also 144 implementations. (This high-level flow handler implementation also
145 makes it simple to provide demultiplexing handlers which can be 145 makes it simple to provide demultiplexing handlers which can be
146 found in embedded platforms on various architectures.) 146 found in embedded platforms on various architectures.)
147 </para> 147 </para>
148 <para> 148 <para>
149 The separation makes the generic interrupt handling layer more 149 The separation makes the generic interrupt handling layer more
150 flexible and extensible. For example, an (sub)architecture can 150 flexible and extensible. For example, an (sub)architecture can
151 use a generic irq-flow implementation for 'level type' interrupts 151 use a generic IRQ-flow implementation for 'level type' interrupts
152 and add a (sub)architecture specific 'edge type' implementation. 152 and add a (sub)architecture specific 'edge type' implementation.
153 </para> 153 </para>
154 <para> 154 <para>
@@ -172,9 +172,9 @@
172 <para> 172 <para>
173 There are three main levels of abstraction in the interrupt code: 173 There are three main levels of abstraction in the interrupt code:
174 <orderedlist> 174 <orderedlist>
175 <listitem><para>Highlevel driver API</para></listitem> 175 <listitem><para>High-level driver API</para></listitem>
176 <listitem><para>Highlevel IRQ flow handlers</para></listitem> 176 <listitem><para>High-level IRQ flow handlers</para></listitem>
177 <listitem><para>Chiplevel hardware encapsulation</para></listitem> 177 <listitem><para>Chip-level hardware encapsulation</para></listitem>
178 </orderedlist> 178 </orderedlist>
179 </para> 179 </para>
180 <sect1 id="Interrupt_control_flow"> 180 <sect1 id="Interrupt_control_flow">
@@ -189,16 +189,16 @@
189 which are assigned to this interrupt. 189 which are assigned to this interrupt.
190 </para> 190 </para>
191 <para> 191 <para>
192 Whenever an interrupt triggers, the lowlevel arch code calls into 192 Whenever an interrupt triggers, the low-level architecture code calls
193 the generic interrupt code by calling desc->handle_irq(). 193 into the generic interrupt code by calling desc->handle_irq().
194 This highlevel IRQ handling function only uses desc->irq_data.chip 194 This high-level IRQ handling function only uses desc->irq_data.chip
195 primitives referenced by the assigned chip descriptor structure. 195 primitives referenced by the assigned chip descriptor structure.
196 </para> 196 </para>
197 </sect1> 197 </sect1>
198 <sect1 id="Highlevel_Driver_API"> 198 <sect1 id="Highlevel_Driver_API">
199 <title>Highlevel Driver API</title> 199 <title>High-level Driver API</title>
200 <para> 200 <para>
201 The highlevel Driver API consists of following functions: 201 The high-level Driver API consists of following functions:
202 <itemizedlist> 202 <itemizedlist>
203 <listitem><para>request_irq()</para></listitem> 203 <listitem><para>request_irq()</para></listitem>
204 <listitem><para>free_irq()</para></listitem> 204 <listitem><para>free_irq()</para></listitem>
@@ -216,7 +216,7 @@
216 </para> 216 </para>
217 </sect1> 217 </sect1>
218 <sect1 id="Highlevel_IRQ_flow_handlers"> 218 <sect1 id="Highlevel_IRQ_flow_handlers">
219 <title>Highlevel IRQ flow handlers</title> 219 <title>High-level IRQ flow handlers</title>
220 <para> 220 <para>
221 The generic layer provides a set of pre-defined irq-flow methods: 221 The generic layer provides a set of pre-defined irq-flow methods:
222 <itemizedlist> 222 <itemizedlist>
@@ -228,7 +228,7 @@
228 <listitem><para>handle_edge_eoi_irq</para></listitem> 228 <listitem><para>handle_edge_eoi_irq</para></listitem>
229 <listitem><para>handle_bad_irq</para></listitem> 229 <listitem><para>handle_bad_irq</para></listitem>
230 </itemizedlist> 230 </itemizedlist>
231 The interrupt flow handlers (either predefined or architecture 231 The interrupt flow handlers (either pre-defined or architecture
232 specific) are assigned to specific interrupts by the architecture 232 specific) are assigned to specific interrupts by the architecture
233 either during bootup or during device initialization. 233 either during bootup or during device initialization.
234 </para> 234 </para>
@@ -297,7 +297,7 @@ desc->irq_data.chip->irq_unmask();
297 <para> 297 <para>
298 handle_fasteoi_irq provides a generic implementation 298 handle_fasteoi_irq provides a generic implementation
299 for interrupts, which only need an EOI at the end of 299 for interrupts, which only need an EOI at the end of
300 the handler 300 the handler.
301 </para> 301 </para>
302 <para> 302 <para>
303 The following control flow is implemented (simplified excerpt): 303 The following control flow is implemented (simplified excerpt):
@@ -394,7 +394,7 @@ if (desc->irq_data.chip->irq_eoi)
394 The generic functions are intended for 'clean' architectures and chips, 394 The generic functions are intended for 'clean' architectures and chips,
395 which have no platform-specific IRQ handling quirks. If an architecture 395 which have no platform-specific IRQ handling quirks. If an architecture
396 needs to implement quirks on the 'flow' level then it can do so by 396 needs to implement quirks on the 'flow' level then it can do so by
397 overriding the highlevel irq-flow handler. 397 overriding the high-level irq-flow handler.
398 </para> 398 </para>
399 </sect2> 399 </sect2>
400 <sect2 id="Delayed_interrupt_disable"> 400 <sect2 id="Delayed_interrupt_disable">
@@ -419,9 +419,9 @@ if (desc->irq_data.chip->irq_eoi)
419 </sect2> 419 </sect2>
420 </sect1> 420 </sect1>
421 <sect1 id="Chiplevel_hardware_encapsulation"> 421 <sect1 id="Chiplevel_hardware_encapsulation">
422 <title>Chiplevel hardware encapsulation</title> 422 <title>Chip-level hardware encapsulation</title>
423 <para> 423 <para>
424 The chip level hardware descriptor structure irq_chip 424 The chip-level hardware descriptor structure irq_chip
425 contains all the direct chip relevant functions, which 425 contains all the direct chip relevant functions, which
426 can be utilized by the irq flow implementations. 426 can be utilized by the irq flow implementations.
427 <itemizedlist> 427 <itemizedlist>
@@ -429,14 +429,14 @@ if (desc->irq_data.chip->irq_eoi)
429 <listitem><para>irq_mask_ack() - Optional, recommended for performance</para></listitem> 429 <listitem><para>irq_mask_ack() - Optional, recommended for performance</para></listitem>
430 <listitem><para>irq_mask()</para></listitem> 430 <listitem><para>irq_mask()</para></listitem>
431 <listitem><para>irq_unmask()</para></listitem> 431 <listitem><para>irq_unmask()</para></listitem>
432 <listitem><para>irq_eoi() - Optional, required for eoi flow handlers</para></listitem> 432 <listitem><para>irq_eoi() - Optional, required for EOI flow handlers</para></listitem>
433 <listitem><para>irq_retrigger() - Optional</para></listitem> 433 <listitem><para>irq_retrigger() - Optional</para></listitem>
434 <listitem><para>irq_set_type() - Optional</para></listitem> 434 <listitem><para>irq_set_type() - Optional</para></listitem>
435 <listitem><para>irq_set_wake() - Optional</para></listitem> 435 <listitem><para>irq_set_wake() - Optional</para></listitem>
436 </itemizedlist> 436 </itemizedlist>
437 These primitives are strictly intended to mean what they say: ack means 437 These primitives are strictly intended to mean what they say: ack means
438 ACK, masking means masking of an IRQ line, etc. It is up to the flow 438 ACK, masking means masking of an IRQ line, etc. It is up to the flow
439 handler(s) to use these basic units of lowlevel functionality. 439 handler(s) to use these basic units of low-level functionality.
440 </para> 440 </para>
441 </sect1> 441 </sect1>
442 </chapter> 442 </chapter>
@@ -445,7 +445,7 @@ if (desc->irq_data.chip->irq_eoi)
445 <title>__do_IRQ entry point</title> 445 <title>__do_IRQ entry point</title>
446 <para> 446 <para>
447 The original implementation __do_IRQ() was an alternative entry 447 The original implementation __do_IRQ() was an alternative entry
448 point for all types of interrupts. It not longer exists. 448 point for all types of interrupts. It no longer exists.
449 </para> 449 </para>
450 <para> 450 <para>
451 This handler turned out to be not suitable for all 451 This handler turned out to be not suitable for all
@@ -468,11 +468,11 @@ if (desc->irq_data.chip->irq_eoi)
468 <chapter id="genericchip"> 468 <chapter id="genericchip">
469 <title>Generic interrupt chip</title> 469 <title>Generic interrupt chip</title>
470 <para> 470 <para>
471 To avoid copies of identical implementations of irq chips the 471 To avoid copies of identical implementations of IRQ chips the
472 core provides a configurable generic interrupt chip 472 core provides a configurable generic interrupt chip
473 implementation. Developers should check carefuly whether the 473 implementation. Developers should check carefuly whether the
474 generic chip fits their needs before implementing the same 474 generic chip fits their needs before implementing the same
475 functionality slightly different themself. 475 functionality slightly differently themselves.
476 </para> 476 </para>
477!Ekernel/irq/generic-chip.c 477!Ekernel/irq/generic-chip.c
478 </chapter> 478 </chapter>
diff --git a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl
index 09e884e5b9f5..19f2a5a5a5b4 100644
--- a/Documentation/DocBook/kernel-locking.tmpl
+++ b/Documentation/DocBook/kernel-locking.tmpl
@@ -1958,7 +1958,7 @@ machines due to caching.
1958 <chapter id="apiref-mutex"> 1958 <chapter id="apiref-mutex">
1959 <title>Mutex API reference</title> 1959 <title>Mutex API reference</title>
1960!Iinclude/linux/mutex.h 1960!Iinclude/linux/mutex.h
1961!Ekernel/mutex.c 1961!Ekernel/locking/mutex.c
1962 </chapter> 1962 </chapter>
1963 1963
1964 <chapter id="apiref-futex"> 1964 <chapter id="apiref-futex">
diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl
index a248f42a121e..cd11926e07c7 100644
--- a/Documentation/DocBook/mtdnand.tmpl
+++ b/Documentation/DocBook/mtdnand.tmpl
@@ -1222,8 +1222,6 @@ in this page</entry>
1222#define NAND_BBT_VERSION 0x00000100 1222#define NAND_BBT_VERSION 0x00000100
1223/* Create a bbt if none axists */ 1223/* Create a bbt if none axists */
1224#define NAND_BBT_CREATE 0x00000200 1224#define NAND_BBT_CREATE 0x00000200
1225/* Search good / bad pattern through all pages of a block */
1226#define NAND_BBT_SCANALLPAGES 0x00000400
1227/* Write bbt if neccecary */ 1225/* Write bbt if neccecary */
1228#define NAND_BBT_WRITE 0x00001000 1226#define NAND_BBT_WRITE 0x00001000
1229/* Read and write back block contents when writing bbt */ 1227/* Read and write back block contents when writing bbt */
diff --git a/Documentation/PCI/pci.txt b/Documentation/PCI/pci.txt
index bccf602a87f5..6f458564d625 100644
--- a/Documentation/PCI/pci.txt
+++ b/Documentation/PCI/pci.txt
@@ -525,8 +525,9 @@ corresponding register block for you.
5256. Other interesting functions 5256. Other interesting functions
526~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 526~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
527 527
528pci_find_slot() Find pci_dev corresponding to given bus and 528pci_get_domain_bus_and_slot() Find pci_dev corresponding to given domain,
529 slot numbers. 529 bus and slot and number. If the device is
530 found, its reference count is increased.
530pci_set_power_state() Set PCI Power Management state (0=D0 ... 3=D3) 531pci_set_power_state() Set PCI Power Management state (0=D0 ... 3=D3)
531pci_find_capability() Find specified capability in device's capability 532pci_find_capability() Find specified capability in device's capability
532 list. 533 list.
@@ -582,7 +583,8 @@ having sane locking.
582 583
583pci_find_device() Superseded by pci_get_device() 584pci_find_device() Superseded by pci_get_device()
584pci_find_subsys() Superseded by pci_get_subsys() 585pci_find_subsys() Superseded by pci_get_subsys()
585pci_find_slot() Superseded by pci_get_slot() 586pci_find_slot() Superseded by pci_get_domain_bus_and_slot()
587pci_get_slot() Superseded by pci_get_domain_bus_and_slot()
586 588
587 589
588The alternative is the traditional PCI device driver that walks PCI 590The alternative is the traditional PCI device driver that walks PCI
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt
index 7703ec73a9bb..91266193b8f4 100644
--- a/Documentation/RCU/checklist.txt
+++ b/Documentation/RCU/checklist.txt
@@ -202,8 +202,8 @@ over a rather long period of time, but improvements are always welcome!
202 updater uses call_rcu_sched() or synchronize_sched(), then 202 updater uses call_rcu_sched() or synchronize_sched(), then
203 the corresponding readers must disable preemption, possibly 203 the corresponding readers must disable preemption, possibly
204 by calling rcu_read_lock_sched() and rcu_read_unlock_sched(). 204 by calling rcu_read_lock_sched() and rcu_read_unlock_sched().
205 If the updater uses synchronize_srcu() or call_srcu(), 205 If the updater uses synchronize_srcu() or call_srcu(), then
206 the the corresponding readers must use srcu_read_lock() and 206 the corresponding readers must use srcu_read_lock() and
207 srcu_read_unlock(), and with the same srcu_struct. The rules for 207 srcu_read_unlock(), and with the same srcu_struct. The rules for
208 the expedited primitives are the same as for their non-expedited 208 the expedited primitives are the same as for their non-expedited
209 counterparts. Mixing things up will result in confusion and 209 counterparts. Mixing things up will result in confusion and
diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt
index 8e9359de1d28..6f3a0057548e 100644
--- a/Documentation/RCU/stallwarn.txt
+++ b/Documentation/RCU/stallwarn.txt
@@ -12,12 +12,12 @@ CONFIG_RCU_CPU_STALL_TIMEOUT
12 This kernel configuration parameter defines the period of time 12 This kernel configuration parameter defines the period of time
13 that RCU will wait from the beginning of a grace period until it 13 that RCU will wait from the beginning of a grace period until it
14 issues an RCU CPU stall warning. This time period is normally 14 issues an RCU CPU stall warning. This time period is normally
15 sixty seconds. 15 21 seconds.
16 16
17 This configuration parameter may be changed at runtime via the 17 This configuration parameter may be changed at runtime via the
18 /sys/module/rcutree/parameters/rcu_cpu_stall_timeout, however 18 /sys/module/rcutree/parameters/rcu_cpu_stall_timeout, however
19 this parameter is checked only at the beginning of a cycle. 19 this parameter is checked only at the beginning of a cycle.
20 So if you are 30 seconds into a 70-second stall, setting this 20 So if you are 10 seconds into a 40-second stall, setting this
21 sysfs parameter to (say) five will shorten the timeout for the 21 sysfs parameter to (say) five will shorten the timeout for the
22 -next- stall, or the following warning for the current stall 22 -next- stall, or the following warning for the current stall
23 (assuming the stall lasts long enough). It will not affect the 23 (assuming the stall lasts long enough). It will not affect the
@@ -32,7 +32,7 @@ CONFIG_RCU_CPU_STALL_VERBOSE
32 also dump the stacks of any tasks that are blocking the current 32 also dump the stacks of any tasks that are blocking the current
33 RCU-preempt grace period. 33 RCU-preempt grace period.
34 34
35RCU_CPU_STALL_INFO 35CONFIG_RCU_CPU_STALL_INFO
36 36
37 This kernel configuration parameter causes the stall warning to 37 This kernel configuration parameter causes the stall warning to
38 print out additional per-CPU diagnostic information, including 38 print out additional per-CPU diagnostic information, including
@@ -43,7 +43,8 @@ RCU_STALL_DELAY_DELTA
43 Although the lockdep facility is extremely useful, it does add 43 Although the lockdep facility is extremely useful, it does add
44 some overhead. Therefore, under CONFIG_PROVE_RCU, the 44 some overhead. Therefore, under CONFIG_PROVE_RCU, the
45 RCU_STALL_DELAY_DELTA macro allows five extra seconds before 45 RCU_STALL_DELAY_DELTA macro allows five extra seconds before
46 giving an RCU CPU stall warning message. 46 giving an RCU CPU stall warning message. (This is a cpp
47 macro, not a kernel configuration parameter.)
47 48
48RCU_STALL_RAT_DELAY 49RCU_STALL_RAT_DELAY
49 50
@@ -52,7 +53,8 @@ RCU_STALL_RAT_DELAY
52 However, if the offending CPU does not detect its own stall in 53 However, if the offending CPU does not detect its own stall in
53 the number of jiffies specified by RCU_STALL_RAT_DELAY, then 54 the number of jiffies specified by RCU_STALL_RAT_DELAY, then
54 some other CPU will complain. This delay is normally set to 55 some other CPU will complain. This delay is normally set to
55 two jiffies. 56 two jiffies. (This is a cpp macro, not a kernel configuration
57 parameter.)
56 58
57When a CPU detects that it is stalling, it will print a message similar 59When a CPU detects that it is stalling, it will print a message similar
58to the following: 60to the following:
@@ -86,7 +88,12 @@ printing, there will be a spurious stall-warning message:
86 88
87INFO: rcu_bh_state detected stalls on CPUs/tasks: { } (detected by 4, 2502 jiffies) 89INFO: rcu_bh_state detected stalls on CPUs/tasks: { } (detected by 4, 2502 jiffies)
88 90
89This is rare, but does happen from time to time in real life. 91This is rare, but does happen from time to time in real life. It is also
92possible for a zero-jiffy stall to be flagged in this case, depending
93on how the stall warning and the grace-period initialization happen to
94interact. Please note that it is not possible to entirely eliminate this
95sort of false positive without resorting to things like stop_machine(),
96which is overkill for this sort of problem.
90 97
91If the CONFIG_RCU_CPU_STALL_INFO kernel configuration parameter is set, 98If the CONFIG_RCU_CPU_STALL_INFO kernel configuration parameter is set,
92more information is printed with the stall-warning message, for example: 99more information is printed with the stall-warning message, for example:
@@ -216,4 +223,5 @@ that portion of the stack which remains the same from trace to trace.
216If you can reliably trigger the stall, ftrace can be quite helpful. 223If you can reliably trigger the stall, ftrace can be quite helpful.
217 224
218RCU bugs can often be debugged with the help of CONFIG_RCU_TRACE 225RCU bugs can often be debugged with the help of CONFIG_RCU_TRACE
219and with RCU's event tracing. 226and with RCU's event tracing. For information on RCU's event tracing,
227see include/trace/events/rcu.h.
diff --git a/Documentation/acpi/dsdt-override.txt b/Documentation/acpi/dsdt-override.txt
index febbb1ba4d23..784841caa6e6 100644
--- a/Documentation/acpi/dsdt-override.txt
+++ b/Documentation/acpi/dsdt-override.txt
@@ -4,4 +4,4 @@ CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel.
4 4
5When to use this method is described in detail on the 5When to use this method is described in detail on the
6Linux/ACPI home page: 6Linux/ACPI home page:
7http://www.lesswatts.org/projects/acpi/overridingDSDT.php 7https://01.org/linux-acpi/documentation/overriding-dsdt
diff --git a/Documentation/acpi/enumeration.txt b/Documentation/acpi/enumeration.txt
index aca4e69121b7..b994bcb32b92 100644
--- a/Documentation/acpi/enumeration.txt
+++ b/Documentation/acpi/enumeration.txt
@@ -295,10 +295,6 @@ These GPIO numbers are controller relative and path "\\_SB.PCI0.GPI0"
295specifies the path to the controller. In order to use these GPIOs in Linux 295specifies the path to the controller. In order to use these GPIOs in Linux
296we need to translate them to the Linux GPIO numbers. 296we need to translate them to the Linux GPIO numbers.
297 297
298The driver can do this by including <linux/acpi_gpio.h> and then calling
299acpi_get_gpio(path, gpio). This will return the Linux GPIO number or
300negative errno if there was no translation found.
301
302In a simple case of just getting the Linux GPIO number from device 298In a simple case of just getting the Linux GPIO number from device
303resources one can use acpi_get_gpio_by_index() helper function. It takes 299resources one can use acpi_get_gpio_by_index() helper function. It takes
304pointer to the device and index of the GpioIo/GpioInt descriptor in the 300pointer to the device and index of the GpioIo/GpioInt descriptor in the
@@ -322,3 +318,25 @@ suitable to the gpiolib before passing them.
322 318
323In case of GpioInt resource an additional call to gpio_to_irq() must be 319In case of GpioInt resource an additional call to gpio_to_irq() must be
324done before calling request_irq(). 320done before calling request_irq().
321
322Note that the above API is ACPI specific and not recommended for drivers
323that need to support non-ACPI systems. The recommended way is to use
324the descriptor based GPIO interfaces. The above example looks like this
325when converted to the GPIO desc:
326
327 #include <linux/gpio/consumer.h>
328 ...
329
330 struct gpio_desc *irq_desc, *power_desc;
331
332 irq_desc = gpiod_get_index(dev, NULL, 1);
333 if (IS_ERR(irq_desc))
334 /* handle error */
335
336 power_desc = gpiod_get_index(dev, NULL, 0);
337 if (IS_ERR(power_desc))
338 /* handle error */
339
340 /* Now we can use the GPIO descriptors */
341
342See also Documentation/gpio.txt.
diff --git a/Documentation/arm/Marvell/README b/Documentation/arm/Marvell/README
index 8f08a86e03b7..da0151db9964 100644
--- a/Documentation/arm/Marvell/README
+++ b/Documentation/arm/Marvell/README
@@ -88,6 +88,7 @@ EBU Armada family
88 MV78230 88 MV78230
89 MV78260 89 MV78260
90 MV78460 90 MV78460
91 NOTE: not to be confused with the non-SMP 78xx0 SoCs
91 92
92 Product Brief: http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf 93 Product Brief: http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf
93 No public datasheet available. 94 No public datasheet available.
diff --git a/Documentation/arm/sunxi/README b/Documentation/arm/sunxi/README
index e3f93fb9224e..7945238453ed 100644
--- a/Documentation/arm/sunxi/README
+++ b/Documentation/arm/sunxi/README
@@ -10,6 +10,10 @@ SunXi family
10 Linux kernel mach directory: arch/arm/mach-sunxi 10 Linux kernel mach directory: arch/arm/mach-sunxi
11 11
12 Flavors: 12 Flavors:
13 * ARM926 based SoCs
14 - Allwinner F20 (sun3i)
15 + Not Supported
16
13 * ARM Cortex-A8 based SoCs 17 * ARM Cortex-A8 based SoCs
14 - Allwinner A10 (sun4i) 18 - Allwinner A10 (sun4i)
15 + Datasheet 19 + Datasheet
@@ -25,4 +29,24 @@ SunXi family
25 + Datasheet 29 + Datasheet
26 http://dl.linux-sunxi.org/A13/A13%20Datasheet%20-%20v1.12%20%282012-03-29%29.pdf 30 http://dl.linux-sunxi.org/A13/A13%20Datasheet%20-%20v1.12%20%282012-03-29%29.pdf
27 + User Manual 31 + User Manual
28 http://dl.linux-sunxi.org/A13/A13%20User%20Manual%20-%20v1.2%20%282013-08-08%29.pdf 32 http://dl.linux-sunxi.org/A13/A13%20User%20Manual%20-%20v1.2%20%282013-01-08%29.pdf
33
34 * Dual ARM Cortex-A7 based SoCs
35 - Allwinner A20 (sun7i)
36 + User Manual
37 http://dl.linux-sunxi.org/A20/A20%20User%20Manual%202013-03-22.pdf
38
39 - Allwinner A23
40 + Not Supported
41
42 * Quad ARM Cortex-A7 based SoCs
43 - Allwinner A31 (sun6i)
44 + Datasheet
45 http://dl.linux-sunxi.org/A31/A31%20Datasheet%20-%20v1.00%20(2012-12-24).pdf
46
47 - Allwinner A31s (sun6i)
48 + Not Supported
49
50 * Quad ARM Cortex-A15, Quad ARM Cortex-A7 based SoCs
51 - Allwinner A80
52 + Not Supported \ No newline at end of file
diff --git a/Documentation/arm64/booting.txt b/Documentation/arm64/booting.txt
index 98df4a03807e..a9691cc48fe3 100644
--- a/Documentation/arm64/booting.txt
+++ b/Documentation/arm64/booting.txt
@@ -115,9 +115,10 @@ Before jumping into the kernel, the following conditions must be met:
115 External caches (if present) must be configured and disabled. 115 External caches (if present) must be configured and disabled.
116 116
117- Architected timers 117- Architected timers
118 CNTFRQ must be programmed with the timer frequency. 118 CNTFRQ must be programmed with the timer frequency and CNTVOFF must
119 If entering the kernel at EL1, CNTHCTL_EL2 must have EL1PCTEN (bit 0) 119 be programmed with a consistent value on all CPUs. If entering the
120 set where available. 120 kernel at EL1, CNTHCTL_EL2 must have EL1PCTEN (bit 0) set where
121 available.
121 122
122- Coherency 123- Coherency
123 All CPUs to be booted by the kernel must be part of the same coherency 124 All CPUs to be booted by the kernel must be part of the same coherency
@@ -130,30 +131,46 @@ Before jumping into the kernel, the following conditions must be met:
130 the kernel image will be entered must be initialised by software at a 131 the kernel image will be entered must be initialised by software at a
131 higher exception level to prevent execution in an UNKNOWN state. 132 higher exception level to prevent execution in an UNKNOWN state.
132 133
134The requirements described above for CPU mode, caches, MMUs, architected
135timers, coherency and system registers apply to all CPUs. All CPUs must
136enter the kernel in the same exception level.
137
133The boot loader is expected to enter the kernel on each CPU in the 138The boot loader is expected to enter the kernel on each CPU in the
134following manner: 139following manner:
135 140
136- The primary CPU must jump directly to the first instruction of the 141- The primary CPU must jump directly to the first instruction of the
137 kernel image. The device tree blob passed by this CPU must contain 142 kernel image. The device tree blob passed by this CPU must contain
138 for each CPU node: 143 an 'enable-method' property for each cpu node. The supported
139 144 enable-methods are described below.
140 1. An 'enable-method' property. Currently, the only supported value
141 for this field is the string "spin-table".
142
143 2. A 'cpu-release-addr' property identifying a 64-bit,
144 zero-initialised memory location.
145 145
146 It is expected that the bootloader will generate these device tree 146 It is expected that the bootloader will generate these device tree
147 properties and insert them into the blob prior to kernel entry. 147 properties and insert them into the blob prior to kernel entry.
148 148
149- Any secondary CPUs must spin outside of the kernel in a reserved area 149- CPUs with a "spin-table" enable-method must have a 'cpu-release-addr'
150 of memory (communicated to the kernel by a /memreserve/ region in the 150 property in their cpu node. This property identifies a
151 naturally-aligned 64-bit zero-initalised memory location.
152
153 These CPUs should spin outside of the kernel in a reserved area of
154 memory (communicated to the kernel by a /memreserve/ region in the
151 device tree) polling their cpu-release-addr location, which must be 155 device tree) polling their cpu-release-addr location, which must be
152 contained in the reserved region. A wfe instruction may be inserted 156 contained in the reserved region. A wfe instruction may be inserted
153 to reduce the overhead of the busy-loop and a sev will be issued by 157 to reduce the overhead of the busy-loop and a sev will be issued by
154 the primary CPU. When a read of the location pointed to by the 158 the primary CPU. When a read of the location pointed to by the
155 cpu-release-addr returns a non-zero value, the CPU must jump directly 159 cpu-release-addr returns a non-zero value, the CPU must jump to this
156 to this value. 160 value. The value will be written as a single 64-bit little-endian
161 value, so CPUs must convert the read value to their native endianness
162 before jumping to it.
163
164- CPUs with a "psci" enable method should remain outside of
165 the kernel (i.e. outside of the regions of memory described to the
166 kernel in the memory node, or in a reserved area of memory described
167 to the kernel by a /memreserve/ region in the device tree). The
168 kernel will issue CPU_ON calls as described in ARM document number ARM
169 DEN 0022A ("Power State Coordination Interface System Software on ARM
170 processors") to bring CPUs into the kernel.
171
172 The device tree should contain a 'psci' node, as described in
173 Documentation/devicetree/bindings/arm/psci.txt.
157 174
158- Secondary CPU general-purpose register settings 175- Secondary CPU general-purpose register settings
159 x0 = 0 (reserved for future use) 176 x0 = 0 (reserved for future use)
diff --git a/Documentation/arm64/memory.txt b/Documentation/arm64/memory.txt
index 78a377124ef0..5e054bfe4dde 100644
--- a/Documentation/arm64/memory.txt
+++ b/Documentation/arm64/memory.txt
@@ -21,7 +21,7 @@ The swapper_pgd_dir address is written to TTBR1 and never written to
21TTBR0. 21TTBR0.
22 22
23 23
24AArch64 Linux memory layout: 24AArch64 Linux memory layout with 4KB pages:
25 25
26Start End Size Use 26Start End Size Use
27----------------------------------------------------------------------- 27-----------------------------------------------------------------------
@@ -39,13 +39,38 @@ ffffffbffbc00000 ffffffbffbdfffff 2MB earlyprintk device
39 39
40ffffffbffbe00000 ffffffbffbe0ffff 64KB PCI I/O space 40ffffffbffbe00000 ffffffbffbe0ffff 64KB PCI I/O space
41 41
42ffffffbbffff0000 ffffffbcffffffff ~2MB [guard] 42ffffffbffbe10000 ffffffbcffffffff ~2MB [guard]
43 43
44ffffffbffc000000 ffffffbfffffffff 64MB modules 44ffffffbffc000000 ffffffbfffffffff 64MB modules
45 45
46ffffffc000000000 ffffffffffffffff 256GB kernel logical memory map 46ffffffc000000000 ffffffffffffffff 256GB kernel logical memory map
47 47
48 48
49AArch64 Linux memory layout with 64KB pages:
50
51Start End Size Use
52-----------------------------------------------------------------------
530000000000000000 000003ffffffffff 4TB user
54
55fffffc0000000000 fffffdfbfffeffff ~2TB vmalloc
56
57fffffdfbffff0000 fffffdfbffffffff 64KB [guard page]
58
59fffffdfc00000000 fffffdfdffffffff 8GB vmemmap
60
61fffffdfe00000000 fffffdfffbbfffff ~8GB [guard, future vmmemap]
62
63fffffdfffbc00000 fffffdfffbdfffff 2MB earlyprintk device
64
65fffffdfffbe00000 fffffdfffbe0ffff 64KB PCI I/O space
66
67fffffdfffbe10000 fffffdfffbffffff ~2MB [guard]
68
69fffffdfffc000000 fffffdffffffffff 64MB modules
70
71fffffe0000000000 ffffffffffffffff 2TB kernel logical memory map
72
73
49Translation table lookup with 4KB pages: 74Translation table lookup with 4KB pages:
50 75
51+--------+--------+--------+--------+--------+--------+--------+--------+ 76+--------+--------+--------+--------+--------+--------+--------+--------+
diff --git a/Documentation/assoc_array.txt b/Documentation/assoc_array.txt
new file mode 100644
index 000000000000..f4faec0f66e4
--- /dev/null
+++ b/Documentation/assoc_array.txt
@@ -0,0 +1,574 @@
1 ========================================
2 GENERIC ASSOCIATIVE ARRAY IMPLEMENTATION
3 ========================================
4
5Contents:
6
7 - Overview.
8
9 - The public API.
10 - Edit script.
11 - Operations table.
12 - Manipulation functions.
13 - Access functions.
14 - Index key form.
15
16 - Internal workings.
17 - Basic internal tree layout.
18 - Shortcuts.
19 - Splitting and collapsing nodes.
20 - Non-recursive iteration.
21 - Simultaneous alteration and iteration.
22
23
24========
25OVERVIEW
26========
27
28This associative array implementation is an object container with the following
29properties:
30
31 (1) Objects are opaque pointers. The implementation does not care where they
32 point (if anywhere) or what they point to (if anything).
33
34 [!] NOTE: Pointers to objects _must_ be zero in the least significant bit.
35
36 (2) Objects do not need to contain linkage blocks for use by the array. This
37 permits an object to be located in multiple arrays simultaneously.
38 Rather, the array is made up of metadata blocks that point to objects.
39
40 (3) Objects require index keys to locate them within the array.
41
42 (4) Index keys must be unique. Inserting an object with the same key as one
43 already in the array will replace the old object.
44
45 (5) Index keys can be of any length and can be of different lengths.
46
47 (6) Index keys should encode the length early on, before any variation due to
48 length is seen.
49
50 (7) Index keys can include a hash to scatter objects throughout the array.
51
52 (8) The array can iterated over. The objects will not necessarily come out in
53 key order.
54
55 (9) The array can be iterated over whilst it is being modified, provided the
56 RCU readlock is being held by the iterator. Note, however, under these
57 circumstances, some objects may be seen more than once. If this is a
58 problem, the iterator should lock against modification. Objects will not
59 be missed, however, unless deleted.
60
61(10) Objects in the array can be looked up by means of their index key.
62
63(11) Objects can be looked up whilst the array is being modified, provided the
64 RCU readlock is being held by the thread doing the look up.
65
66The implementation uses a tree of 16-pointer nodes internally that are indexed
67on each level by nibbles from the index key in the same manner as in a radix
68tree. To improve memory efficiency, shortcuts can be emplaced to skip over
69what would otherwise be a series of single-occupancy nodes. Further, nodes
70pack leaf object pointers into spare space in the node rather than making an
71extra branch until as such time an object needs to be added to a full node.
72
73
74==============
75THE PUBLIC API
76==============
77
78The public API can be found in <linux/assoc_array.h>. The associative array is
79rooted on the following structure:
80
81 struct assoc_array {
82 ...
83 };
84
85The code is selected by enabling CONFIG_ASSOCIATIVE_ARRAY.
86
87
88EDIT SCRIPT
89-----------
90
91The insertion and deletion functions produce an 'edit script' that can later be
92applied to effect the changes without risking ENOMEM. This retains the
93preallocated metadata blocks that will be installed in the internal tree and
94keeps track of the metadata blocks that will be removed from the tree when the
95script is applied.
96
97This is also used to keep track of dead blocks and dead objects after the
98script has been applied so that they can be freed later. The freeing is done
99after an RCU grace period has passed - thus allowing access functions to
100proceed under the RCU read lock.
101
102The script appears as outside of the API as a pointer of the type:
103
104 struct assoc_array_edit;
105
106There are two functions for dealing with the script:
107
108 (1) Apply an edit script.
109
110 void assoc_array_apply_edit(struct assoc_array_edit *edit);
111
112 This will perform the edit functions, interpolating various write barriers
113 to permit accesses under the RCU read lock to continue. The edit script
114 will then be passed to call_rcu() to free it and any dead stuff it points
115 to.
116
117 (2) Cancel an edit script.
118
119 void assoc_array_cancel_edit(struct assoc_array_edit *edit);
120
121 This frees the edit script and all preallocated memory immediately. If
122 this was for insertion, the new object is _not_ released by this function,
123 but must rather be released by the caller.
124
125These functions are guaranteed not to fail.
126
127
128OPERATIONS TABLE
129----------------
130
131Various functions take a table of operations:
132
133 struct assoc_array_ops {
134 ...
135 };
136
137This points to a number of methods, all of which need to be provided:
138
139 (1) Get a chunk of index key from caller data:
140
141 unsigned long (*get_key_chunk)(const void *index_key, int level);
142
143 This should return a chunk of caller-supplied index key starting at the
144 *bit* position given by the level argument. The level argument will be a
145 multiple of ASSOC_ARRAY_KEY_CHUNK_SIZE and the function should return
146 ASSOC_ARRAY_KEY_CHUNK_SIZE bits. No error is possible.
147
148
149 (2) Get a chunk of an object's index key.
150
151 unsigned long (*get_object_key_chunk)(const void *object, int level);
152
153 As the previous function, but gets its data from an object in the array
154 rather than from a caller-supplied index key.
155
156
157 (3) See if this is the object we're looking for.
158
159 bool (*compare_object)(const void *object, const void *index_key);
160
161 Compare the object against an index key and return true if it matches and
162 false if it doesn't.
163
164
165 (4) Diff the index keys of two objects.
166
167 int (*diff_objects)(const void *a, const void *b);
168
169 Return the bit position at which the index keys of two objects differ or
170 -1 if they are the same.
171
172
173 (5) Free an object.
174
175 void (*free_object)(void *object);
176
177 Free the specified object. Note that this may be called an RCU grace
178 period after assoc_array_apply_edit() was called, so synchronize_rcu() may
179 be necessary on module unloading.
180
181
182MANIPULATION FUNCTIONS
183----------------------
184
185There are a number of functions for manipulating an associative array:
186
187 (1) Initialise an associative array.
188
189 void assoc_array_init(struct assoc_array *array);
190
191 This initialises the base structure for an associative array. It can't
192 fail.
193
194
195 (2) Insert/replace an object in an associative array.
196
197 struct assoc_array_edit *
198 assoc_array_insert(struct assoc_array *array,
199 const struct assoc_array_ops *ops,
200 const void *index_key,
201 void *object);
202
203 This inserts the given object into the array. Note that the least
204 significant bit of the pointer must be zero as it's used to type-mark
205 pointers internally.
206
207 If an object already exists for that key then it will be replaced with the
208 new object and the old one will be freed automatically.
209
210 The index_key argument should hold index key information and is
211 passed to the methods in the ops table when they are called.
212
213 This function makes no alteration to the array itself, but rather returns
214 an edit script that must be applied. -ENOMEM is returned in the case of
215 an out-of-memory error.
216
217 The caller should lock exclusively against other modifiers of the array.
218
219
220 (3) Delete an object from an associative array.
221
222 struct assoc_array_edit *
223 assoc_array_delete(struct assoc_array *array,
224 const struct assoc_array_ops *ops,
225 const void *index_key);
226
227 This deletes an object that matches the specified data from the array.
228
229 The index_key argument should hold index key information and is
230 passed to the methods in the ops table when they are called.
231
232 This function makes no alteration to the array itself, but rather returns
233 an edit script that must be applied. -ENOMEM is returned in the case of
234 an out-of-memory error. NULL will be returned if the specified object is
235 not found within the array.
236
237 The caller should lock exclusively against other modifiers of the array.
238
239
240 (4) Delete all objects from an associative array.
241
242 struct assoc_array_edit *
243 assoc_array_clear(struct assoc_array *array,
244 const struct assoc_array_ops *ops);
245
246 This deletes all the objects from an associative array and leaves it
247 completely empty.
248
249 This function makes no alteration to the array itself, but rather returns
250 an edit script that must be applied. -ENOMEM is returned in the case of
251 an out-of-memory error.
252
253 The caller should lock exclusively against other modifiers of the array.
254
255
256 (5) Destroy an associative array, deleting all objects.
257
258 void assoc_array_destroy(struct assoc_array *array,
259 const struct assoc_array_ops *ops);
260
261 This destroys the contents of the associative array and leaves it
262 completely empty. It is not permitted for another thread to be traversing
263 the array under the RCU read lock at the same time as this function is
264 destroying it as no RCU deferral is performed on memory release -
265 something that would require memory to be allocated.
266
267 The caller should lock exclusively against other modifiers and accessors
268 of the array.
269
270
271 (6) Garbage collect an associative array.
272
273 int assoc_array_gc(struct assoc_array *array,
274 const struct assoc_array_ops *ops,
275 bool (*iterator)(void *object, void *iterator_data),
276 void *iterator_data);
277
278 This iterates over the objects in an associative array and passes each one
279 to iterator(). If iterator() returns true, the object is kept. If it
280 returns false, the object will be freed. If the iterator() function
281 returns true, it must perform any appropriate refcount incrementing on the
282 object before returning.
283
284 The internal tree will be packed down if possible as part of the iteration
285 to reduce the number of nodes in it.
286
287 The iterator_data is passed directly to iterator() and is otherwise
288 ignored by the function.
289
290 The function will return 0 if successful and -ENOMEM if there wasn't
291 enough memory.
292
293 It is possible for other threads to iterate over or search the array under
294 the RCU read lock whilst this function is in progress. The caller should
295 lock exclusively against other modifiers of the array.
296
297
298ACCESS FUNCTIONS
299----------------
300
301There are two functions for accessing an associative array:
302
303 (1) Iterate over all the objects in an associative array.
304
305 int assoc_array_iterate(const struct assoc_array *array,
306 int (*iterator)(const void *object,
307 void *iterator_data),
308 void *iterator_data);
309
310 This passes each object in the array to the iterator callback function.
311 iterator_data is private data for that function.
312
313 This may be used on an array at the same time as the array is being
314 modified, provided the RCU read lock is held. Under such circumstances,
315 it is possible for the iteration function to see some objects twice. If
316 this is a problem, then modification should be locked against. The
317 iteration algorithm should not, however, miss any objects.
318
319 The function will return 0 if no objects were in the array or else it will
320 return the result of the last iterator function called. Iteration stops
321 immediately if any call to the iteration function results in a non-zero
322 return.
323
324
325 (2) Find an object in an associative array.
326
327 void *assoc_array_find(const struct assoc_array *array,
328 const struct assoc_array_ops *ops,
329 const void *index_key);
330
331 This walks through the array's internal tree directly to the object
332 specified by the index key..
333
334 This may be used on an array at the same time as the array is being
335 modified, provided the RCU read lock is held.
336
337 The function will return the object if found (and set *_type to the object
338 type) or will return NULL if the object was not found.
339
340
341INDEX KEY FORM
342--------------
343
344The index key can be of any form, but since the algorithms aren't told how long
345the key is, it is strongly recommended that the index key includes its length
346very early on before any variation due to the length would have an effect on
347comparisons.
348
349This will cause leaves with different length keys to scatter away from each
350other - and those with the same length keys to cluster together.
351
352It is also recommended that the index key begin with a hash of the rest of the
353key to maximise scattering throughout keyspace.
354
355The better the scattering, the wider and lower the internal tree will be.
356
357Poor scattering isn't too much of a problem as there are shortcuts and nodes
358can contain mixtures of leaves and metadata pointers.
359
360The index key is read in chunks of machine word. Each chunk is subdivided into
361one nibble (4 bits) per level, so on a 32-bit CPU this is good for 8 levels and
362on a 64-bit CPU, 16 levels. Unless the scattering is really poor, it is
363unlikely that more than one word of any particular index key will have to be
364used.
365
366
367=================
368INTERNAL WORKINGS
369=================
370
371The associative array data structure has an internal tree. This tree is
372constructed of two types of metadata blocks: nodes and shortcuts.
373
374A node is an array of slots. Each slot can contain one of four things:
375
376 (*) A NULL pointer, indicating that the slot is empty.
377
378 (*) A pointer to an object (a leaf).
379
380 (*) A pointer to a node at the next level.
381
382 (*) A pointer to a shortcut.
383
384
385BASIC INTERNAL TREE LAYOUT
386--------------------------
387
388Ignoring shortcuts for the moment, the nodes form a multilevel tree. The index
389key space is strictly subdivided by the nodes in the tree and nodes occur on
390fixed levels. For example:
391
392 Level: 0 1 2 3
393 =============== =============== =============== ===============
394 NODE D
395 NODE B NODE C +------>+---+
396 +------>+---+ +------>+---+ | | 0 |
397 NODE A | | 0 | | | 0 | | +---+
398 +---+ | +---+ | +---+ | : :
399 | 0 | | : : | : : | +---+
400 +---+ | +---+ | +---+ | | f |
401 | 1 |---+ | 3 |---+ | 7 |---+ +---+
402 +---+ +---+ +---+
403 : : : : | 8 |---+
404 +---+ +---+ +---+ | NODE E
405 | e |---+ | f | : : +------>+---+
406 +---+ | +---+ +---+ | 0 |
407 | f | | | f | +---+
408 +---+ | +---+ : :
409 | NODE F +---+
410 +------>+---+ | f |
411 | 0 | NODE G +---+
412 +---+ +------>+---+
413 : : | | 0 |
414 +---+ | +---+
415 | 6 |---+ : :
416 +---+ +---+
417 : : | f |
418 +---+ +---+
419 | f |
420 +---+
421
422In the above example, there are 7 nodes (A-G), each with 16 slots (0-f).
423Assuming no other meta data nodes in the tree, the key space is divided thusly:
424
425 KEY PREFIX NODE
426 ========== ====
427 137* D
428 138* E
429 13[0-69-f]* C
430 1[0-24-f]* B
431 e6* G
432 e[0-57-f]* F
433 [02-df]* A
434
435So, for instance, keys with the following example index keys will be found in
436the appropriate nodes:
437
438 INDEX KEY PREFIX NODE
439 =============== ======= ====
440 13694892892489 13 C
441 13795289025897 137 D
442 13889dde88793 138 E
443 138bbb89003093 138 E
444 1394879524789 12 C
445 1458952489 1 B
446 9431809de993ba - A
447 b4542910809cd - A
448 e5284310def98 e F
449 e68428974237 e6 G
450 e7fffcbd443 e F
451 f3842239082 - A
452
453To save memory, if a node can hold all the leaves in its portion of keyspace,
454then the node will have all those leaves in it and will not have any metadata
455pointers - even if some of those leaves would like to be in the same slot.
456
457A node can contain a heterogeneous mix of leaves and metadata pointers.
458Metadata pointers must be in the slots that match their subdivisions of key
459space. The leaves can be in any slot not occupied by a metadata pointer. It
460is guaranteed that none of the leaves in a node will match a slot occupied by a
461metadata pointer. If the metadata pointer is there, any leaf whose key matches
462the metadata key prefix must be in the subtree that the metadata pointer points
463to.
464
465In the above example list of index keys, node A will contain:
466
467 SLOT CONTENT INDEX KEY (PREFIX)
468 ==== =============== ==================
469 1 PTR TO NODE B 1*
470 any LEAF 9431809de993ba
471 any LEAF b4542910809cd
472 e PTR TO NODE F e*
473 any LEAF f3842239082
474
475and node B:
476
477 3 PTR TO NODE C 13*
478 any LEAF 1458952489
479
480
481SHORTCUTS
482---------
483
484Shortcuts are metadata records that jump over a piece of keyspace. A shortcut
485is a replacement for a series of single-occupancy nodes ascending through the
486levels. Shortcuts exist to save memory and to speed up traversal.
487
488It is possible for the root of the tree to be a shortcut - say, for example,
489the tree contains at least 17 nodes all with key prefix '1111'. The insertion
490algorithm will insert a shortcut to skip over the '1111' keyspace in a single
491bound and get to the fourth level where these actually become different.
492
493
494SPLITTING AND COLLAPSING NODES
495------------------------------
496
497Each node has a maximum capacity of 16 leaves and metadata pointers. If the
498insertion algorithm finds that it is trying to insert a 17th object into a
499node, that node will be split such that at least two leaves that have a common
500key segment at that level end up in a separate node rooted on that slot for
501that common key segment.
502
503If the leaves in a full node and the leaf that is being inserted are
504sufficiently similar, then a shortcut will be inserted into the tree.
505
506When the number of objects in the subtree rooted at a node falls to 16 or
507fewer, then the subtree will be collapsed down to a single node - and this will
508ripple towards the root if possible.
509
510
511NON-RECURSIVE ITERATION
512-----------------------
513
514Each node and shortcut contains a back pointer to its parent and the number of
515slot in that parent that points to it. None-recursive iteration uses these to
516proceed rootwards through the tree, going to the parent node, slot N + 1 to
517make sure progress is made without the need for a stack.
518
519The backpointers, however, make simultaneous alteration and iteration tricky.
520
521
522SIMULTANEOUS ALTERATION AND ITERATION
523-------------------------------------
524
525There are a number of cases to consider:
526
527 (1) Simple insert/replace. This involves simply replacing a NULL or old
528 matching leaf pointer with the pointer to the new leaf after a barrier.
529 The metadata blocks don't change otherwise. An old leaf won't be freed
530 until after the RCU grace period.
531
532 (2) Simple delete. This involves just clearing an old matching leaf. The
533 metadata blocks don't change otherwise. The old leaf won't be freed until
534 after the RCU grace period.
535
536 (3) Insertion replacing part of a subtree that we haven't yet entered. This
537 may involve replacement of part of that subtree - but that won't affect
538 the iteration as we won't have reached the pointer to it yet and the
539 ancestry blocks are not replaced (the layout of those does not change).
540
541 (4) Insertion replacing nodes that we're actively processing. This isn't a
542 problem as we've passed the anchoring pointer and won't switch onto the
543 new layout until we follow the back pointers - at which point we've
544 already examined the leaves in the replaced node (we iterate over all the
545 leaves in a node before following any of its metadata pointers).
546
547 We might, however, re-see some leaves that have been split out into a new
548 branch that's in a slot further along than we were at.
549
550 (5) Insertion replacing nodes that we're processing a dependent branch of.
551 This won't affect us until we follow the back pointers. Similar to (4).
552
553 (6) Deletion collapsing a branch under us. This doesn't affect us because the
554 back pointers will get us back to the parent of the new node before we
555 could see the new node. The entire collapsed subtree is thrown away
556 unchanged - and will still be rooted on the same slot, so we shouldn't
557 process it a second time as we'll go back to slot + 1.
558
559Note:
560
561 (*) Under some circumstances, we need to simultaneously change the parent
562 pointer and the parent slot pointer on a node (say, for example, we
563 inserted another node before it and moved it up a level). We cannot do
564 this without locking against a read - so we have to replace that node too.
565
566 However, when we're changing a shortcut into a node this isn't a problem
567 as shortcuts only have one slot and so the parent slot number isn't used
568 when traversing backwards over one. This means that it's okay to change
569 the slot number first - provided suitable barriers are used to make sure
570 the parent slot number is read after the back pointer.
571
572Obsolete blocks and leaves are freed up after an RCU grace period has passed,
573so as long as anyone doing walking or iteration holds the RCU read lock, the
574old superstructure should not go away on them.
diff --git a/Documentation/backlight/lp855x-driver.txt b/Documentation/backlight/lp855x-driver.txt
index 1c732f0c6758..01bce243d3d7 100644
--- a/Documentation/backlight/lp855x-driver.txt
+++ b/Documentation/backlight/lp855x-driver.txt
@@ -4,7 +4,8 @@ Kernel driver lp855x
4Backlight driver for LP855x ICs 4Backlight driver for LP855x ICs
5 5
6Supported chips: 6Supported chips:
7 Texas Instruments LP8550, LP8551, LP8552, LP8553, LP8556 and LP8557 7 Texas Instruments LP8550, LP8551, LP8552, LP8553, LP8555, LP8556 and
8 LP8557
8 9
9Author: Milo(Woogyom) Kim <milo.kim@ti.com> 10Author: Milo(Woogyom) Kim <milo.kim@ti.com>
10 11
@@ -24,7 +25,7 @@ Value : pwm based or register based
24 25
252) chip_id 262) chip_id
26The lp855x chip id. 27The lp855x chip id.
27Value : lp8550/lp8551/lp8552/lp8553/lp8556/lp8557 28Value : lp8550/lp8551/lp8552/lp8553/lp8555/lp8556/lp8557
28 29
29Platform data for lp855x 30Platform data for lp855x
30------------------------ 31------------------------
diff --git a/Documentation/block/00-INDEX b/Documentation/block/00-INDEX
index d18ecd827c40..929d9904f74b 100644
--- a/Documentation/block/00-INDEX
+++ b/Documentation/block/00-INDEX
@@ -6,6 +6,8 @@ capability.txt
6 - Generic Block Device Capability (/sys/block/<device>/capability) 6 - Generic Block Device Capability (/sys/block/<device>/capability)
7cfq-iosched.txt 7cfq-iosched.txt
8 - CFQ IO scheduler tunables 8 - CFQ IO scheduler tunables
9cmdline-partition.txt
10 - how to specify block device partitions on kernel command line
9data-integrity.txt 11data-integrity.txt
10 - Block data integrity 12 - Block data integrity
11deadline-iosched.txt 13deadline-iosched.txt
diff --git a/Documentation/block/cmdline-partition.txt b/Documentation/block/cmdline-partition.txt
index 2bbf4cc40c3f..525b9f6d7fb4 100644
--- a/Documentation/block/cmdline-partition.txt
+++ b/Documentation/block/cmdline-partition.txt
@@ -1,9 +1,9 @@
1Embedded device command line partition 1Embedded device command line partition parsing
2===================================================================== 2=====================================================================
3 3
4Read block device partition table from command line. 4Support for reading the block device partition table from the command line.
5The partition used for fixed block device (eMMC) embedded device. 5It is typically used for fixed block (eMMC) embedded devices.
6It is no MBR, save storage space. Bootloader can be easily accessed 6It has no MBR, so saves storage space. Bootloader can be easily accessed
7by absolute address of data on the block device. 7by absolute address of data on the block device.
8Users can easily change the partition. 8Users can easily change the partition.
9 9
diff --git a/Documentation/blockdev/floppy.txt b/Documentation/blockdev/floppy.txt
index 470fe4b5e379..e2240f5ab64d 100644
--- a/Documentation/blockdev/floppy.txt
+++ b/Documentation/blockdev/floppy.txt
@@ -39,15 +39,15 @@ Module configuration options
39============================ 39============================
40 40
41 If you use the floppy driver as a module, use the following syntax: 41 If you use the floppy driver as a module, use the following syntax:
42modprobe floppy <options> 42modprobe floppy floppy="<options>"
43 43
44Example: 44Example:
45 modprobe floppy omnibook messages 45 modprobe floppy floppy="omnibook messages"
46 46
47 If you need certain options enabled every time you load the floppy driver, 47 If you need certain options enabled every time you load the floppy driver,
48you can put: 48you can put:
49 49
50 options floppy omnibook messages 50 options floppy floppy="omnibook messages"
51 51
52in a configuration file in /etc/modprobe.d/. 52in a configuration file in /etc/modprobe.d/.
53 53
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index 8af4ad121828..e2bc132608fd 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -573,15 +573,19 @@ an memcg since the pages are allowed to be allocated from any physical
573node. One of the use cases is evaluating application performance by 573node. One of the use cases is evaluating application performance by
574combining this information with the application's CPU allocation. 574combining this information with the application's CPU allocation.
575 575
576We export "total", "file", "anon" and "unevictable" pages per-node for 576Each memcg's numa_stat file includes "total", "file", "anon" and "unevictable"
577each memcg. The ouput format of memory.numa_stat is: 577per-node page counts including "hierarchical_<counter>" which sums up all
578hierarchical children's values in addition to the memcg's own value.
579
580The ouput format of memory.numa_stat is:
578 581
579total=<total pages> N0=<node 0 pages> N1=<node 1 pages> ... 582total=<total pages> N0=<node 0 pages> N1=<node 1 pages> ...
580file=<total file pages> N0=<node 0 pages> N1=<node 1 pages> ... 583file=<total file pages> N0=<node 0 pages> N1=<node 1 pages> ...
581anon=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ... 584anon=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ...
582unevictable=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ... 585unevictable=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ...
586hierarchical_<counter>=<counter pages> N0=<node 0 pages> N1=<node 1 pages> ...
583 587
584And we have total = file + anon + unevictable. 588The "total" count is sum of file + anon + unevictable.
585 589
5866. Hierarchy support 5906. Hierarchy support
587 591
diff --git a/Documentation/connector/ucon.c b/Documentation/connector/ucon.c
index 4848db8c71ff..8a4da64e02a8 100644
--- a/Documentation/connector/ucon.c
+++ b/Documentation/connector/ucon.c
@@ -71,7 +71,7 @@ static int netlink_send(int s, struct cn_msg *msg)
71 nlh->nlmsg_seq = seq++; 71 nlh->nlmsg_seq = seq++;
72 nlh->nlmsg_pid = getpid(); 72 nlh->nlmsg_pid = getpid();
73 nlh->nlmsg_type = NLMSG_DONE; 73 nlh->nlmsg_type = NLMSG_DONE;
74 nlh->nlmsg_len = NLMSG_LENGTH(size - sizeof(*nlh)); 74 nlh->nlmsg_len = size;
75 nlh->nlmsg_flags = 0; 75 nlh->nlmsg_flags = 0;
76 76
77 m = NLMSG_DATA(nlh); 77 m = NLMSG_DATA(nlh);
diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt
index 40282e617913..8b1a4451422e 100644
--- a/Documentation/cpu-freq/cpu-drivers.txt
+++ b/Documentation/cpu-freq/cpu-drivers.txt
@@ -23,8 +23,8 @@ Contents:
231.1 Initialization 231.1 Initialization
241.2 Per-CPU Initialization 241.2 Per-CPU Initialization
251.3 verify 251.3 verify
261.4 target or setpolicy? 261.4 target/target_index or setpolicy?
271.5 target 271.5 target/target_index
281.6 setpolicy 281.6 setpolicy
292. Frequency Table Helpers 292. Frequency Table Helpers
30 30
@@ -56,7 +56,8 @@ cpufreq_driver.init - A pointer to the per-CPU initialization
56cpufreq_driver.verify - A pointer to a "verification" function. 56cpufreq_driver.verify - A pointer to a "verification" function.
57 57
58cpufreq_driver.setpolicy _or_ 58cpufreq_driver.setpolicy _or_
59cpufreq_driver.target - See below on the differences. 59cpufreq_driver.target/
60target_index - See below on the differences.
60 61
61And optionally 62And optionally
62 63
@@ -66,7 +67,7 @@ cpufreq_driver.resume - A pointer to a per-CPU resume function
66 which is called with interrupts disabled 67 which is called with interrupts disabled
67 and _before_ the pre-suspend frequency 68 and _before_ the pre-suspend frequency
68 and/or policy is restored by a call to 69 and/or policy is restored by a call to
69 ->target or ->setpolicy. 70 ->target/target_index or ->setpolicy.
70 71
71cpufreq_driver.attr - A pointer to a NULL-terminated list of 72cpufreq_driver.attr - A pointer to a NULL-terminated list of
72 "struct freq_attr" which allow to 73 "struct freq_attr" which allow to
@@ -103,8 +104,8 @@ policy->governor must contain the "default policy" for
103 this CPU. A few moments later, 104 this CPU. A few moments later,
104 cpufreq_driver.verify and either 105 cpufreq_driver.verify and either
105 cpufreq_driver.setpolicy or 106 cpufreq_driver.setpolicy or
106 cpufreq_driver.target is called with 107 cpufreq_driver.target/target_index is called
107 these values. 108 with these values.
108 109
109For setting some of these values (cpuinfo.min[max]_freq, policy->min[max]), the 110For setting some of these values (cpuinfo.min[max]_freq, policy->min[max]), the
110frequency table helpers might be helpful. See the section 2 for more information 111frequency table helpers might be helpful. See the section 2 for more information
@@ -133,20 +134,28 @@ range) is within policy->min and policy->max. If necessary, increase
133policy->max first, and only if this is no solution, decrease policy->min. 134policy->max first, and only if this is no solution, decrease policy->min.
134 135
135 136
1361.4 target or setpolicy? 1371.4 target/target_index or setpolicy?
137---------------------------- 138----------------------------
138 139
139Most cpufreq drivers or even most cpu frequency scaling algorithms 140Most cpufreq drivers or even most cpu frequency scaling algorithms
140only allow the CPU to be set to one frequency. For these, you use the 141only allow the CPU to be set to one frequency. For these, you use the
141->target call. 142->target/target_index call.
142 143
143Some cpufreq-capable processors switch the frequency between certain 144Some cpufreq-capable processors switch the frequency between certain
144limits on their own. These shall use the ->setpolicy call 145limits on their own. These shall use the ->setpolicy call
145 146
146 147
1471.4. target 1481.4. target/target_index
148------------- 149-------------
149 150
151The target_index call has two arguments: struct cpufreq_policy *policy,
152and unsigned int index (into the exposed frequency table).
153
154The CPUfreq driver must set the new frequency when called here. The
155actual frequency must be determined by freq_table[index].frequency.
156
157Deprecated:
158----------
150The target call has three arguments: struct cpufreq_policy *policy, 159The target call has three arguments: struct cpufreq_policy *policy,
151unsigned int target_frequency, unsigned int relation. 160unsigned int target_frequency, unsigned int relation.
152 161
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt
index 219970ba54b7..77ec21574fb1 100644
--- a/Documentation/cpu-freq/governors.txt
+++ b/Documentation/cpu-freq/governors.txt
@@ -40,7 +40,7 @@ Most cpufreq drivers (in fact, all except one, longrun) or even most
40cpu frequency scaling algorithms only offer the CPU to be set to one 40cpu frequency scaling algorithms only offer the CPU to be set to one
41frequency. In order to offer dynamic frequency scaling, the cpufreq 41frequency. In order to offer dynamic frequency scaling, the cpufreq
42core must be able to tell these drivers of a "target frequency". So 42core must be able to tell these drivers of a "target frequency". So
43these specific drivers will be transformed to offer a "->target" 43these specific drivers will be transformed to offer a "->target/target_index"
44call instead of the existing "->setpolicy" call. For "longrun", all 44call instead of the existing "->setpolicy" call. For "longrun", all
45stays the same, though. 45stays the same, though.
46 46
@@ -71,7 +71,7 @@ CPU can be set to switch independently | CPU can only be set
71 / the limits of policy->{min,max} 71 / the limits of policy->{min,max}
72 / \ 72 / \
73 / \ 73 / \
74 Using the ->setpolicy call, Using the ->target call, 74 Using the ->setpolicy call, Using the ->target/target_index call,
75 the limits and the the frequency closest 75 the limits and the the frequency closest
76 "policy" is set. to target_freq is set. 76 "policy" is set. to target_freq is set.
77 It is assured that it 77 It is assured that it
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt
index 786dc82f98ce..8cb9938cc47e 100644
--- a/Documentation/cpu-hotplug.txt
+++ b/Documentation/cpu-hotplug.txt
@@ -5,7 +5,7 @@
5 Rusty Russell <rusty@rustcorp.com.au> 5 Rusty Russell <rusty@rustcorp.com.au>
6 Srivatsa Vaddagiri <vatsa@in.ibm.com> 6 Srivatsa Vaddagiri <vatsa@in.ibm.com>
7 i386: 7 i386:
8 Zwane Mwaikambo <zwane@arm.linux.org.uk> 8 Zwane Mwaikambo <zwanem@gmail.com>
9 ppc64: 9 ppc64:
10 Nathan Lynch <nathanl@austin.ibm.com> 10 Nathan Lynch <nathanl@austin.ibm.com>
11 Joel Schopp <jschopp@austin.ibm.com> 11 Joel Schopp <jschopp@austin.ibm.com>
diff --git a/Documentation/cpuidle/governor.txt b/Documentation/cpuidle/governor.txt
index 12c6bd50c9f6..d9020f5e847b 100644
--- a/Documentation/cpuidle/governor.txt
+++ b/Documentation/cpuidle/governor.txt
@@ -25,5 +25,4 @@ kernel configuration and platform will be selected by cpuidle.
25 25
26Interfaces: 26Interfaces:
27extern int cpuidle_register_governor(struct cpuidle_governor *gov); 27extern int cpuidle_register_governor(struct cpuidle_governor *gov);
28extern void cpuidle_unregister_governor(struct cpuidle_governor *gov);
29struct cpuidle_governor 28struct cpuidle_governor
diff --git a/Documentation/device-mapper/cache-policies.txt b/Documentation/device-mapper/cache-policies.txt
index d7c440b444cc..df52a849957f 100644
--- a/Documentation/device-mapper/cache-policies.txt
+++ b/Documentation/device-mapper/cache-policies.txt
@@ -30,8 +30,10 @@ multiqueue
30 30
31This policy is the default. 31This policy is the default.
32 32
33The multiqueue policy has two sets of 16 queues: one set for entries 33The multiqueue policy has three sets of 16 queues: one set for entries
34waiting for the cache and another one for those in the cache. 34waiting for the cache and another two for those in the cache (a set for
35clean entries and a set for dirty entries).
36
35Cache entries in the queues are aged based on logical time. Entry into 37Cache entries in the queues are aged based on logical time. Entry into
36the cache is based on variable thresholds and queue selection is based 38the cache is based on variable thresholds and queue selection is based
37on hit count on entry. The policy aims to take different cache miss 39on hit count on entry. The policy aims to take different cache miss
diff --git a/Documentation/device-mapper/cache.txt b/Documentation/device-mapper/cache.txt
index 33d45ee0b737..274752f8bdf9 100644
--- a/Documentation/device-mapper/cache.txt
+++ b/Documentation/device-mapper/cache.txt
@@ -68,10 +68,11 @@ So large block sizes are bad because they waste cache space. And small
68block sizes are bad because they increase the amount of metadata (both 68block sizes are bad because they increase the amount of metadata (both
69in core and on disk). 69in core and on disk).
70 70
71Writeback/writethrough 71Cache operating modes
72---------------------- 72---------------------
73 73
74The cache has two modes, writeback and writethrough. 74The cache has three operating modes: writeback, writethrough and
75passthrough.
75 76
76If writeback, the default, is selected then a write to a block that is 77If writeback, the default, is selected then a write to a block that is
77cached will go only to the cache and the block will be marked dirty in 78cached will go only to the cache and the block will be marked dirty in
@@ -81,8 +82,31 @@ If writethrough is selected then a write to a cached block will not
81complete until it has hit both the origin and cache devices. Clean 82complete until it has hit both the origin and cache devices. Clean
82blocks should remain clean. 83blocks should remain clean.
83 84
85If passthrough is selected, useful when the cache contents are not known
86to be coherent with the origin device, then all reads are served from
87the origin device (all reads miss the cache) and all writes are
88forwarded to the origin device; additionally, write hits cause cache
89block invalidates. To enable passthrough mode the cache must be clean.
90Passthrough mode allows a cache device to be activated without having to
91worry about coherency. Coherency that exists is maintained, although
92the cache will gradually cool as writes take place. If the coherency of
93the cache can later be verified, or established through use of the
94"invalidate_cblocks" message, the cache device can be transitioned to
95writethrough or writeback mode while still warm. Otherwise, the cache
96contents can be discarded prior to transitioning to the desired
97operating mode.
98
84A simple cleaner policy is provided, which will clean (write back) all 99A simple cleaner policy is provided, which will clean (write back) all
85dirty blocks in a cache. Useful for decommissioning a cache. 100dirty blocks in a cache. Useful for decommissioning a cache or when
101shrinking a cache. Shrinking the cache's fast device requires all cache
102blocks, in the area of the cache being removed, to be clean. If the
103area being removed from the cache still contains dirty blocks the resize
104will fail. Care must be taken to never reduce the volume used for the
105cache's fast device until the cache is clean. This is of particular
106importance if writeback mode is used. Writethrough and passthrough
107modes already maintain a clean cache. Future support to partially clean
108the cache, above a specified threshold, will allow for keeping the cache
109warm and in writeback mode during resize.
86 110
87Migration throttling 111Migration throttling
88-------------------- 112--------------------
@@ -161,7 +185,7 @@ Constructor
161 block size : cache unit size in sectors 185 block size : cache unit size in sectors
162 186
163 #feature args : number of feature arguments passed 187 #feature args : number of feature arguments passed
164 feature args : writethrough. (The default is writeback.) 188 feature args : writethrough or passthrough (The default is writeback.)
165 189
166 policy : the replacement policy to use 190 policy : the replacement policy to use
167 #policy args : an even number of arguments corresponding to 191 #policy args : an even number of arguments corresponding to
@@ -177,6 +201,13 @@ Optional feature arguments are:
177 back cache block contents later for performance reasons, 201 back cache block contents later for performance reasons,
178 so they may differ from the corresponding origin blocks. 202 so they may differ from the corresponding origin blocks.
179 203
204 passthrough : a degraded mode useful for various cache coherency
205 situations (e.g., rolling back snapshots of
206 underlying storage). Reads and writes always go to
207 the origin. If a write goes to a cached origin
208 block, then the cache block is invalidated.
209 To enable passthrough mode the cache must be clean.
210
180A policy called 'default' is always registered. This is an alias for 211A policy called 'default' is always registered. This is an alias for
181the policy we currently think is giving best all round performance. 212the policy we currently think is giving best all round performance.
182 213
@@ -231,12 +262,26 @@ The message format is:
231E.g. 262E.g.
232 dmsetup message my_cache 0 sequential_threshold 1024 263 dmsetup message my_cache 0 sequential_threshold 1024
233 264
265
266Invalidation is removing an entry from the cache without writing it
267back. Cache blocks can be invalidated via the invalidate_cblocks
268message, which takes an arbitrary number of cblock ranges. Each cblock
269must be expressed as a decimal value, in the future a variant message
270that takes cblock ranges expressed in hexidecimal may be needed to
271better support efficient invalidation of larger caches. The cache must
272be in passthrough mode when invalidate_cblocks is used.
273
274 invalidate_cblocks [<cblock>|<cblock begin>-<cblock end>]*
275
276E.g.
277 dmsetup message my_cache 0 invalidate_cblocks 2345 3456-4567 5678-6789
278
234Examples 279Examples
235======== 280========
236 281
237The test suite can be found here: 282The test suite can be found here:
238 283
239https://github.com/jthornber/thinp-test-suite 284https://github.com/jthornber/device-mapper-test-suite
240 285
241dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \ 286dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \
242 /dev/mapper/ssd /dev/mapper/origin 512 1 writeback default 0' 287 /dev/mapper/ssd /dev/mapper/origin 512 1 writeback default 0'
diff --git a/Documentation/device-mapper/dm-crypt.txt b/Documentation/device-mapper/dm-crypt.txt
index 2c656ae43ba7..c81839b52c4d 100644
--- a/Documentation/device-mapper/dm-crypt.txt
+++ b/Documentation/device-mapper/dm-crypt.txt
@@ -4,12 +4,15 @@ dm-crypt
4Device-Mapper's "crypt" target provides transparent encryption of block devices 4Device-Mapper's "crypt" target provides transparent encryption of block devices
5using the kernel crypto API. 5using the kernel crypto API.
6 6
7For a more detailed description of supported parameters see:
8http://code.google.com/p/cryptsetup/wiki/DMCrypt
9
7Parameters: <cipher> <key> <iv_offset> <device path> \ 10Parameters: <cipher> <key> <iv_offset> <device path> \
8 <offset> [<#opt_params> <opt_params>] 11 <offset> [<#opt_params> <opt_params>]
9 12
10<cipher> 13<cipher>
11 Encryption cipher and an optional IV generation mode. 14 Encryption cipher and an optional IV generation mode.
12 (In format cipher[:keycount]-chainmode-ivopts:ivmode). 15 (In format cipher[:keycount]-chainmode-ivmode[:ivopts]).
13 Examples: 16 Examples:
14 des 17 des
15 aes-cbc-essiv:sha256 18 aes-cbc-essiv:sha256
@@ -19,7 +22,11 @@ Parameters: <cipher> <key> <iv_offset> <device path> \
19 22
20<key> 23<key>
21 Key used for encryption. It is encoded as a hexadecimal number. 24 Key used for encryption. It is encoded as a hexadecimal number.
22 You can only use key sizes that are valid for the selected cipher. 25 You can only use key sizes that are valid for the selected cipher
26 in combination with the selected iv mode.
27 Note that for some iv modes the key string can contain additional
28 keys (for example IV seed) so the key contains more parts concatenated
29 into a single string.
23 30
24<keycount> 31<keycount>
25 Multi-key compatibility mode. You can define <keycount> keys and 32 Multi-key compatibility mode. You can define <keycount> keys and
diff --git a/Documentation/devices.txt b/Documentation/devices.txt
index 23721d3be3e6..80b72419ffd8 100644
--- a/Documentation/devices.txt
+++ b/Documentation/devices.txt
@@ -414,6 +414,7 @@ Your cooperation is appreciated.
414 200 = /dev/net/tun TAP/TUN network device 414 200 = /dev/net/tun TAP/TUN network device
415 201 = /dev/button/gulpb Transmeta GULP-B buttons 415 201 = /dev/button/gulpb Transmeta GULP-B buttons
416 202 = /dev/emd/ctl Enhanced Metadisk RAID (EMD) control 416 202 = /dev/emd/ctl Enhanced Metadisk RAID (EMD) control
417 203 = /dev/cuse Cuse (character device in user-space)
417 204 = /dev/video/em8300 EM8300 DVD decoder control 418 204 = /dev/video/em8300 EM8300 DVD decoder control
418 205 = /dev/video/em8300_mv EM8300 DVD decoder video 419 205 = /dev/video/em8300_mv EM8300 DVD decoder video
419 206 = /dev/video/em8300_ma EM8300 DVD decoder audio 420 206 = /dev/video/em8300_ma EM8300 DVD decoder audio
diff --git a/Documentation/devicetree/bindings/arc/pmu.txt b/Documentation/devicetree/bindings/arc/pmu.txt
new file mode 100644
index 000000000000..49d517340de3
--- /dev/null
+++ b/Documentation/devicetree/bindings/arc/pmu.txt
@@ -0,0 +1,24 @@
1* ARC Performance Monitor Unit
2
3The ARC 700 can be configured with a pipeline performance monitor for counting
4CPU and cache events like cache misses and hits.
5
6Note that:
7 * ARC 700 refers to a family of ARC processor cores;
8 - There is only one type of PMU available for the whole family;
9 - The PMU may support different sets of events; supported events are probed
10 at boot time, as required by the reference manual.
11
12 * The ARC 700 PMU does not support interrupts; although HW events may be
13 counted, the HW events themselves cannot serve as a trigger for a sample.
14
15Required properties:
16
17- compatible : should contain
18 "snps,arc700-pmu"
19
20Example:
21
22pmu {
23 compatible = "snps,arc700-pmu";
24};
diff --git a/Documentation/devicetree/bindings/arm/arm-boards b/Documentation/devicetree/bindings/arm/arm-boards
index db5858e32d3f..5fac246a9530 100644
--- a/Documentation/devicetree/bindings/arm/arm-boards
+++ b/Documentation/devicetree/bindings/arm/arm-boards
@@ -9,9 +9,53 @@ Required properties (in root node):
9 9
10FPGA type interrupt controllers, see the versatile-fpga-irq binding doc. 10FPGA type interrupt controllers, see the versatile-fpga-irq binding doc.
11 11
12In the root node the Integrator/CP must have a /cpcon node pointing 12Required nodes:
13to the CP control registers, and the Integrator/AP must have a 13
14/syscon node pointing to the Integrator/AP system controller. 14- core-module: the root node to the Integrator platforms must have
15 a core-module with regs and the compatible string
16 "arm,core-module-integrator"
17
18 Required properties for the core module:
19 - regs: the location and size of the core module registers, one
20 range of 0x200 bytes.
21
22- syscon: the root node of the Integrator platforms must have a
23 system controller node pointong to the control registers,
24 with the compatible string
25 "arm,integrator-ap-syscon"
26 "arm,integrator-cp-syscon"
27 respectively.
28
29 Required properties for the system controller:
30 - regs: the location and size of the system controller registers,
31 one range of 0x100 bytes.
32
33 Required properties for the AP system controller:
34 - interrupts: the AP syscon node must include the logical module
35 interrupts, stated in order of module instance <module 0>,
36 <module 1>, <module 2> ... for the CP system controller this
37 is not required not of any use.
38
39/dts-v1/;
40/include/ "integrator.dtsi"
41
42/ {
43 model = "ARM Integrator/AP";
44 compatible = "arm,integrator-ap";
45
46 core-module@10000000 {
47 compatible = "arm,core-module-integrator";
48 reg = <0x10000000 0x200>;
49 };
50
51 syscon {
52 compatible = "arm,integrator-ap-syscon";
53 reg = <0x11000000 0x100>;
54 interrupt-parent = <&pic>;
55 /* These are the logic module IRQs */
56 interrupts = <9>, <10>, <11>, <12>;
57 };
58};
15 59
16 60
17ARM Versatile Application and Platform Baseboards 61ARM Versatile Application and Platform Baseboards
diff --git a/Documentation/devicetree/bindings/arm/armada-370-xp-mpic.txt b/Documentation/devicetree/bindings/arm/armada-370-xp-mpic.txt
index 61df564c0d23..d74091a8a3bf 100644
--- a/Documentation/devicetree/bindings/arm/armada-370-xp-mpic.txt
+++ b/Documentation/devicetree/bindings/arm/armada-370-xp-mpic.txt
@@ -4,6 +4,8 @@ Marvell Armada 370 and Armada XP Interrupt Controller
4Required properties: 4Required properties:
5- compatible: Should be "marvell,mpic" 5- compatible: Should be "marvell,mpic"
6- interrupt-controller: Identifies the node as an interrupt controller. 6- interrupt-controller: Identifies the node as an interrupt controller.
7- msi-controller: Identifies the node as an PCI Message Signaled
8 Interrupt controller.
7- #interrupt-cells: The number of cells to define the interrupts. Should be 1. 9- #interrupt-cells: The number of cells to define the interrupts. Should be 1.
8 The cell is the IRQ number 10 The cell is the IRQ number
9 11
@@ -24,6 +26,7 @@ Example:
24 #address-cells = <1>; 26 #address-cells = <1>;
25 #size-cells = <1>; 27 #size-cells = <1>;
26 interrupt-controller; 28 interrupt-controller;
29 msi-controller;
27 reg = <0xd0020a00 0x1d0>, 30 reg = <0xd0020a00 0x1d0>,
28 <0xd0021070 0x58>; 31 <0xd0021070 0x58>;
29 }; 32 };
diff --git a/Documentation/devicetree/bindings/arm/atmel-adc.txt b/Documentation/devicetree/bindings/arm/atmel-adc.txt
index 723c205cb10d..d1061469f63d 100644
--- a/Documentation/devicetree/bindings/arm/atmel-adc.txt
+++ b/Documentation/devicetree/bindings/arm/atmel-adc.txt
@@ -7,7 +7,6 @@ Required properties:
7 - interrupts: Should contain the IRQ line for the ADC 7 - interrupts: Should contain the IRQ line for the ADC
8 - atmel,adc-channels-used: Bitmask of the channels muxed and enable for this 8 - atmel,adc-channels-used: Bitmask of the channels muxed and enable for this
9 device 9 device
10 - atmel,adc-num-channels: Number of channels available in the ADC
11 - atmel,adc-startup-time: Startup Time of the ADC in microseconds as 10 - atmel,adc-startup-time: Startup Time of the ADC in microseconds as
12 defined in the datasheet 11 defined in the datasheet
13 - atmel,adc-vref: Reference voltage in millivolts for the conversions 12 - atmel,adc-vref: Reference voltage in millivolts for the conversions
@@ -24,6 +23,13 @@ Optional properties:
24 resolution will be used. 23 resolution will be used.
25 - atmel,adc-sleep-mode: Boolean to enable sleep mode when no conversion 24 - atmel,adc-sleep-mode: Boolean to enable sleep mode when no conversion
26 - atmel,adc-sample-hold-time: Sample and Hold Time in microseconds 25 - atmel,adc-sample-hold-time: Sample and Hold Time in microseconds
26 - atmel,adc-ts-wires: Number of touch screen wires. Should be 4 or 5. If this
27 value is set, then adc driver will enable touch screen
28 support.
29 NOTE: when adc touch screen enabled, the adc hardware trigger will be
30 disabled. Since touch screen will occupied the trigger register.
31 - atmel,adc-ts-pressure-threshold: a pressure threshold for touchscreen. It
32 make touch detect more precision.
27 33
28Optional trigger Nodes: 34Optional trigger Nodes:
29 - Required properties: 35 - Required properties:
diff --git a/Documentation/devicetree/bindings/arm/calxeda/mem-ctrlr.txt b/Documentation/devicetree/bindings/arm/calxeda/mem-ctrlr.txt
index f770ac0893d4..049675944b78 100644
--- a/Documentation/devicetree/bindings/arm/calxeda/mem-ctrlr.txt
+++ b/Documentation/devicetree/bindings/arm/calxeda/mem-ctrlr.txt
@@ -1,7 +1,9 @@
1Calxeda DDR memory controller 1Calxeda DDR memory controller
2 2
3Properties: 3Properties:
4- compatible : Should be "calxeda,hb-ddr-ctrl" 4- compatible : Should be:
5 - "calxeda,hb-ddr-ctrl" for ECX-1000
6 - "calxeda,ecx-2000-ddr-ctrl" for ECX-2000
5- reg : Address and size for DDR controller registers. 7- reg : Address and size for DDR controller registers.
6- interrupts : Interrupt for DDR controller. 8- interrupts : Interrupt for DDR controller.
7 9
diff --git a/Documentation/devicetree/bindings/arm/cci.txt b/Documentation/devicetree/bindings/arm/cci.txt
index 92d36e2aa877..f28d82bbbc56 100644
--- a/Documentation/devicetree/bindings/arm/cci.txt
+++ b/Documentation/devicetree/bindings/arm/cci.txt
@@ -36,14 +36,18 @@ specific to ARM.
36 36
37 - reg 37 - reg
38 Usage: required 38 Usage: required
39 Value type: <prop-encoded-array> 39 Value type: Integer cells. A register entry, expressed as a pair
40 of cells, containing base and size.
40 Definition: A standard property. Specifies base physical 41 Definition: A standard property. Specifies base physical
41 address of CCI control registers common to all 42 address of CCI control registers common to all
42 interfaces. 43 interfaces.
43 44
44 - ranges: 45 - ranges:
45 Usage: required 46 Usage: required
46 Value type: <prop-encoded-array> 47 Value type: Integer cells. An array of range entries, expressed
48 as a tuple of cells, containing child address,
49 parent address and the size of the region in the
50 child address space.
47 Definition: A standard property. Follow rules in the ePAPR for 51 Definition: A standard property. Follow rules in the ePAPR for
48 hierarchical bus addressing. CCI interfaces 52 hierarchical bus addressing. CCI interfaces
49 addresses refer to the parent node addressing 53 addresses refer to the parent node addressing
@@ -74,11 +78,49 @@ specific to ARM.
74 78
75 - reg: 79 - reg:
76 Usage: required 80 Usage: required
77 Value type: <prop-encoded-array> 81 Value type: Integer cells. A register entry, expressed
82 as a pair of cells, containing base and
83 size.
78 Definition: the base address and size of the 84 Definition: the base address and size of the
79 corresponding interface programming 85 corresponding interface programming
80 registers. 86 registers.
81 87
88 - CCI PMU node
89
90 Parent node must be CCI interconnect node.
91
92 A CCI pmu node must contain the following properties:
93
94 - compatible
95 Usage: required
96 Value type: <string>
97 Definition: must be "arm,cci-400-pmu"
98
99 - reg:
100 Usage: required
101 Value type: Integer cells. A register entry, expressed
102 as a pair of cells, containing base and
103 size.
104 Definition: the base address and size of the
105 corresponding interface programming
106 registers.
107
108 - interrupts:
109 Usage: required
110 Value type: Integer cells. Array of interrupt specifier
111 entries, as defined in
112 ../interrupt-controller/interrupts.txt.
113 Definition: list of counter overflow interrupts, one per
114 counter. The interrupts must be specified
115 starting with the cycle counter overflow
116 interrupt, followed by counter0 overflow
117 interrupt, counter1 overflow interrupt,...
118 ,counterN overflow interrupt.
119
120 The CCI PMU has an interrupt signal for each
121 counter. The number of interrupts must be
122 equal to the number of counters.
123
82* CCI interconnect bus masters 124* CCI interconnect bus masters
83 125
84 Description: masters in the device tree connected to a CCI port 126 Description: masters in the device tree connected to a CCI port
@@ -144,7 +186,7 @@ Example:
144 #address-cells = <1>; 186 #address-cells = <1>;
145 #size-cells = <1>; 187 #size-cells = <1>;
146 reg = <0x0 0x2c090000 0 0x1000>; 188 reg = <0x0 0x2c090000 0 0x1000>;
147 ranges = <0x0 0x0 0x2c090000 0x6000>; 189 ranges = <0x0 0x0 0x2c090000 0x10000>;
148 190
149 cci_control0: slave-if@1000 { 191 cci_control0: slave-if@1000 {
150 compatible = "arm,cci-400-ctrl-if"; 192 compatible = "arm,cci-400-ctrl-if";
@@ -163,6 +205,16 @@ Example:
163 interface-type = "ace"; 205 interface-type = "ace";
164 reg = <0x5000 0x1000>; 206 reg = <0x5000 0x1000>;
165 }; 207 };
208
209 pmu@9000 {
210 compatible = "arm,cci-400-pmu";
211 reg = <0x9000 0x5000>;
212 interrupts = <0 101 4>,
213 <0 102 4>,
214 <0 103 4>,
215 <0 104 4>,
216 <0 105 4>;
217 };
166 }; 218 };
167 219
168This CCI node corresponds to a CCI component whose control registers sits 220This CCI node corresponds to a CCI component whose control registers sits
diff --git a/Documentation/devicetree/bindings/arm/cpus.txt b/Documentation/devicetree/bindings/arm/cpus.txt
index f32494dbfe19..91304353eea4 100644
--- a/Documentation/devicetree/bindings/arm/cpus.txt
+++ b/Documentation/devicetree/bindings/arm/cpus.txt
@@ -1,77 +1,384 @@
1* ARM CPUs binding description 1=================
2ARM CPUs bindings
3=================
2 4
3The device tree allows to describe the layout of CPUs in a system through 5The device tree allows to describe the layout of CPUs in a system through
4the "cpus" node, which in turn contains a number of subnodes (ie "cpu") 6the "cpus" node, which in turn contains a number of subnodes (ie "cpu")
5defining properties for every cpu. 7defining properties for every cpu.
6 8
7Bindings for CPU nodes follow the ePAPR standard, available from: 9Bindings for CPU nodes follow the ePAPR v1.1 standard, available from:
8 10
9http://devicetree.org 11https://www.power.org/documentation/epapr-version-1-1/
10 12
11For the ARM architecture every CPU node must contain the following properties: 13with updates for 32-bit and 64-bit ARM systems provided in this document.
12 14
13- device_type: must be "cpu" 15================================
14- reg: property matching the CPU MPIDR[23:0] register bits 16Convention used in this document
15 reg[31:24] bits must be set to 0 17================================
16- compatible: should be one of: 18
17 "arm,arm1020" 19This document follows the conventions described in the ePAPR v1.1, with
18 "arm,arm1020e" 20the addition:
19 "arm,arm1022" 21
20 "arm,arm1026" 22- square brackets define bitfields, eg reg[7:0] value of the bitfield in
21 "arm,arm720" 23 the reg property contained in bits 7 down to 0
22 "arm,arm740" 24
23 "arm,arm7tdmi" 25=====================================
24 "arm,arm920" 26cpus and cpu node bindings definition
25 "arm,arm922" 27=====================================
26 "arm,arm925" 28
27 "arm,arm926" 29The ARM architecture, in accordance with the ePAPR, requires the cpus and cpu
28 "arm,arm940" 30nodes to be present and contain the properties described below.
29 "arm,arm946" 31
30 "arm,arm9tdmi" 32- cpus node
31 "arm,cortex-a5" 33
32 "arm,cortex-a7" 34 Description: Container of cpu nodes
33 "arm,cortex-a8" 35
34 "arm,cortex-a9" 36 The node name must be "cpus".
35 "arm,cortex-a15" 37
36 "arm,arm1136" 38 A cpus node must define the following properties:
37 "arm,arm1156" 39
38 "arm,arm1176" 40 - #address-cells
39 "arm,arm11mpcore" 41 Usage: required
40 "faraday,fa526" 42 Value type: <u32>
41 "intel,sa110" 43
42 "intel,sa1100" 44 Definition depends on ARM architecture version and
43 "marvell,feroceon" 45 configuration:
44 "marvell,mohawk" 46
45 "marvell,xsc3" 47 # On uniprocessor ARM architectures previous to v7
46 "marvell,xscale" 48 value must be 1, to enable a simple enumeration
47 49 scheme for processors that do not have a HW CPU
48Example: 50 identification register.
51 # On 32-bit ARM 11 MPcore, ARM v7 or later systems
52 value must be 1, that corresponds to CPUID/MPIDR
53 registers sizes.
54 # On ARM v8 64-bit systems value should be set to 2,
55 that corresponds to the MPIDR_EL1 register size.
56 If MPIDR_EL1[63:32] value is equal to 0 on all CPUs
57 in the system, #address-cells can be set to 1, since
58 MPIDR_EL1[63:32] bits are not used for CPUs
59 identification.
60 - #size-cells
61 Usage: required
62 Value type: <u32>
63 Definition: must be set to 0
64
65- cpu node
66
67 Description: Describes a CPU in an ARM based system
68
69 PROPERTIES
70
71 - device_type
72 Usage: required
73 Value type: <string>
74 Definition: must be "cpu"
75 - reg
76 Usage and definition depend on ARM architecture version and
77 configuration:
78
79 # On uniprocessor ARM architectures previous to v7
80 this property is required and must be set to 0.
81
82 # On ARM 11 MPcore based systems this property is
83 required and matches the CPUID[11:0] register bits.
84
85 Bits [11:0] in the reg cell must be set to
86 bits [11:0] in CPU ID register.
87
88 All other bits in the reg cell must be set to 0.
89
90 # On 32-bit ARM v7 or later systems this property is
91 required and matches the CPU MPIDR[23:0] register
92 bits.
93
94 Bits [23:0] in the reg cell must be set to
95 bits [23:0] in MPIDR.
96
97 All other bits in the reg cell must be set to 0.
98
99 # On ARM v8 64-bit systems this property is required
100 and matches the MPIDR_EL1 register affinity bits.
101
102 * If cpus node's #address-cells property is set to 2
103
104 The first reg cell bits [7:0] must be set to
105 bits [39:32] of MPIDR_EL1.
106
107 The second reg cell bits [23:0] must be set to
108 bits [23:0] of MPIDR_EL1.
109
110 * If cpus node's #address-cells property is set to 1
111
112 The reg cell bits [23:0] must be set to bits [23:0]
113 of MPIDR_EL1.
114
115 All other bits in the reg cells must be set to 0.
116
117 - compatible:
118 Usage: required
119 Value type: <string>
120 Definition: should be one of:
121 "arm,arm710t"
122 "arm,arm720t"
123 "arm,arm740t"
124 "arm,arm7ej-s"
125 "arm,arm7tdmi"
126 "arm,arm7tdmi-s"
127 "arm,arm9es"
128 "arm,arm9ej-s"
129 "arm,arm920t"
130 "arm,arm922t"
131 "arm,arm925"
132 "arm,arm926e-s"
133 "arm,arm926ej-s"
134 "arm,arm940t"
135 "arm,arm946e-s"
136 "arm,arm966e-s"
137 "arm,arm968e-s"
138 "arm,arm9tdmi"
139 "arm,arm1020e"
140 "arm,arm1020t"
141 "arm,arm1022e"
142 "arm,arm1026ej-s"
143 "arm,arm1136j-s"
144 "arm,arm1136jf-s"
145 "arm,arm1156t2-s"
146 "arm,arm1156t2f-s"
147 "arm,arm1176jzf"
148 "arm,arm1176jz-s"
149 "arm,arm1176jzf-s"
150 "arm,arm11mpcore"
151 "arm,cortex-a5"
152 "arm,cortex-a7"
153 "arm,cortex-a8"
154 "arm,cortex-a9"
155 "arm,cortex-a15"
156 "arm,cortex-a53"
157 "arm,cortex-a57"
158 "arm,cortex-m0"
159 "arm,cortex-m0+"
160 "arm,cortex-m1"
161 "arm,cortex-m3"
162 "arm,cortex-m4"
163 "arm,cortex-r4"
164 "arm,cortex-r5"
165 "arm,cortex-r7"
166 "faraday,fa526"
167 "intel,sa110"
168 "intel,sa1100"
169 "marvell,feroceon"
170 "marvell,mohawk"
171 "marvell,pj4a"
172 "marvell,pj4b"
173 "marvell,sheeva-v5"
174 "qcom,krait"
175 "qcom,scorpion"
176 - enable-method
177 Value type: <stringlist>
178 Usage and definition depend on ARM architecture version.
179 # On ARM v8 64-bit this property is required and must
180 be one of:
181 "spin-table"
182 "psci"
183 # On ARM 32-bit systems this property is optional.
184
185 - cpu-release-addr
186 Usage: required for systems that have an "enable-method"
187 property value of "spin-table".
188 Value type: <prop-encoded-array>
189 Definition:
190 # On ARM v8 64-bit systems must be a two cell
191 property identifying a 64-bit zero-initialised
192 memory location.
193
194Example 1 (dual-cluster big.LITTLE system 32-bit):
49 195
50 cpus { 196 cpus {
51 #size-cells = <0>; 197 #size-cells = <0>;
52 #address-cells = <1>; 198 #address-cells = <1>;
53 199
54 CPU0: cpu@0 { 200 cpu@0 {
55 device_type = "cpu"; 201 device_type = "cpu";
56 compatible = "arm,cortex-a15"; 202 compatible = "arm,cortex-a15";
57 reg = <0x0>; 203 reg = <0x0>;
58 }; 204 };
59 205
60 CPU1: cpu@1 { 206 cpu@1 {
61 device_type = "cpu"; 207 device_type = "cpu";
62 compatible = "arm,cortex-a15"; 208 compatible = "arm,cortex-a15";
63 reg = <0x1>; 209 reg = <0x1>;
64 }; 210 };
65 211
66 CPU2: cpu@100 { 212 cpu@100 {
67 device_type = "cpu"; 213 device_type = "cpu";
68 compatible = "arm,cortex-a7"; 214 compatible = "arm,cortex-a7";
69 reg = <0x100>; 215 reg = <0x100>;
70 }; 216 };
71 217
72 CPU3: cpu@101 { 218 cpu@101 {
73 device_type = "cpu"; 219 device_type = "cpu";
74 compatible = "arm,cortex-a7"; 220 compatible = "arm,cortex-a7";
75 reg = <0x101>; 221 reg = <0x101>;
76 }; 222 };
77 }; 223 };
224
225Example 2 (Cortex-A8 uniprocessor 32-bit system):
226
227 cpus {
228 #size-cells = <0>;
229 #address-cells = <1>;
230
231 cpu@0 {
232 device_type = "cpu";
233 compatible = "arm,cortex-a8";
234 reg = <0x0>;
235 };
236 };
237
238Example 3 (ARM 926EJ-S uniprocessor 32-bit system):
239
240 cpus {
241 #size-cells = <0>;
242 #address-cells = <1>;
243
244 cpu@0 {
245 device_type = "cpu";
246 compatible = "arm,arm926ej-s";
247 reg = <0x0>;
248 };
249 };
250
251Example 4 (ARM Cortex-A57 64-bit system):
252
253cpus {
254 #size-cells = <0>;
255 #address-cells = <2>;
256
257 cpu@0 {
258 device_type = "cpu";
259 compatible = "arm,cortex-a57";
260 reg = <0x0 0x0>;
261 enable-method = "spin-table";
262 cpu-release-addr = <0 0x20000000>;
263 };
264
265 cpu@1 {
266 device_type = "cpu";
267 compatible = "arm,cortex-a57";
268 reg = <0x0 0x1>;
269 enable-method = "spin-table";
270 cpu-release-addr = <0 0x20000000>;
271 };
272
273 cpu@100 {
274 device_type = "cpu";
275 compatible = "arm,cortex-a57";
276 reg = <0x0 0x100>;
277 enable-method = "spin-table";
278 cpu-release-addr = <0 0x20000000>;
279 };
280
281 cpu@101 {
282 device_type = "cpu";
283 compatible = "arm,cortex-a57";
284 reg = <0x0 0x101>;
285 enable-method = "spin-table";
286 cpu-release-addr = <0 0x20000000>;
287 };
288
289 cpu@10000 {
290 device_type = "cpu";
291 compatible = "arm,cortex-a57";
292 reg = <0x0 0x10000>;
293 enable-method = "spin-table";
294 cpu-release-addr = <0 0x20000000>;
295 };
296
297 cpu@10001 {
298 device_type = "cpu";
299 compatible = "arm,cortex-a57";
300 reg = <0x0 0x10001>;
301 enable-method = "spin-table";
302 cpu-release-addr = <0 0x20000000>;
303 };
304
305 cpu@10100 {
306 device_type = "cpu";
307 compatible = "arm,cortex-a57";
308 reg = <0x0 0x10100>;
309 enable-method = "spin-table";
310 cpu-release-addr = <0 0x20000000>;
311 };
312
313 cpu@10101 {
314 device_type = "cpu";
315 compatible = "arm,cortex-a57";
316 reg = <0x0 0x10101>;
317 enable-method = "spin-table";
318 cpu-release-addr = <0 0x20000000>;
319 };
320
321 cpu@100000000 {
322 device_type = "cpu";
323 compatible = "arm,cortex-a57";
324 reg = <0x1 0x0>;
325 enable-method = "spin-table";
326 cpu-release-addr = <0 0x20000000>;
327 };
328
329 cpu@100000001 {
330 device_type = "cpu";
331 compatible = "arm,cortex-a57";
332 reg = <0x1 0x1>;
333 enable-method = "spin-table";
334 cpu-release-addr = <0 0x20000000>;
335 };
336
337 cpu@100000100 {
338 device_type = "cpu";
339 compatible = "arm,cortex-a57";
340 reg = <0x1 0x100>;
341 enable-method = "spin-table";
342 cpu-release-addr = <0 0x20000000>;
343 };
344
345 cpu@100000101 {
346 device_type = "cpu";
347 compatible = "arm,cortex-a57";
348 reg = <0x1 0x101>;
349 enable-method = "spin-table";
350 cpu-release-addr = <0 0x20000000>;
351 };
352
353 cpu@100010000 {
354 device_type = "cpu";
355 compatible = "arm,cortex-a57";
356 reg = <0x1 0x10000>;
357 enable-method = "spin-table";
358 cpu-release-addr = <0 0x20000000>;
359 };
360
361 cpu@100010001 {
362 device_type = "cpu";
363 compatible = "arm,cortex-a57";
364 reg = <0x1 0x10001>;
365 enable-method = "spin-table";
366 cpu-release-addr = <0 0x20000000>;
367 };
368
369 cpu@100010100 {
370 device_type = "cpu";
371 compatible = "arm,cortex-a57";
372 reg = <0x1 0x10100>;
373 enable-method = "spin-table";
374 cpu-release-addr = <0 0x20000000>;
375 };
376
377 cpu@100010101 {
378 device_type = "cpu";
379 compatible = "arm,cortex-a57";
380 reg = <0x1 0x10101>;
381 enable-method = "spin-table";
382 cpu-release-addr = <0 0x20000000>;
383 };
384};
diff --git a/Documentation/devicetree/bindings/arm/omap/omap.txt b/Documentation/devicetree/bindings/arm/omap/omap.txt
index 91b7049affa1..808c1543b0f8 100644
--- a/Documentation/devicetree/bindings/arm/omap/omap.txt
+++ b/Documentation/devicetree/bindings/arm/omap/omap.txt
@@ -21,7 +21,8 @@ Required properties:
21Optional properties: 21Optional properties:
22- ti,no_idle_on_suspend: When present, it prevents the PM to idle the module 22- ti,no_idle_on_suspend: When present, it prevents the PM to idle the module
23 during suspend. 23 during suspend.
24 24- ti,no-reset-on-init: When present, the module should not be reset at init
25- ti,no-idle-on-init: When present, the module should not be idled at init
25 26
26Example: 27Example:
27 28
diff --git a/Documentation/devicetree/bindings/arm/topology.txt b/Documentation/devicetree/bindings/arm/topology.txt
new file mode 100644
index 000000000000..4aa20e7a424e
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/topology.txt
@@ -0,0 +1,474 @@
1===========================================
2ARM topology binding description
3===========================================
4
5===========================================
61 - Introduction
7===========================================
8
9In an ARM system, the hierarchy of CPUs is defined through three entities that
10are used to describe the layout of physical CPUs in the system:
11
12- cluster
13- core
14- thread
15
16The cpu nodes (bindings defined in [1]) represent the devices that
17correspond to physical CPUs and are to be mapped to the hierarchy levels.
18
19The bottom hierarchy level sits at core or thread level depending on whether
20symmetric multi-threading (SMT) is supported or not.
21
22For instance in a system where CPUs support SMT, "cpu" nodes represent all
23threads existing in the system and map to the hierarchy level "thread" above.
24In systems where SMT is not supported "cpu" nodes represent all cores present
25in the system and map to the hierarchy level "core" above.
26
27ARM topology bindings allow one to associate cpu nodes with hierarchical groups
28corresponding to the system hierarchy; syntactically they are defined as device
29tree nodes.
30
31The remainder of this document provides the topology bindings for ARM, based
32on the ePAPR standard, available from:
33
34http://www.power.org/documentation/epapr-version-1-1/
35
36If not stated otherwise, whenever a reference to a cpu node phandle is made its
37value must point to a cpu node compliant with the cpu node bindings as
38documented in [1].
39A topology description containing phandles to cpu nodes that are not compliant
40with bindings standardized in [1] is therefore considered invalid.
41
42===========================================
432 - cpu-map node
44===========================================
45
46The ARM CPU topology is defined within the cpu-map node, which is a direct
47child of the cpus node and provides a container where the actual topology
48nodes are listed.
49
50- cpu-map node
51
52 Usage: Optional - On ARM SMP systems provide CPUs topology to the OS.
53 ARM uniprocessor systems do not require a topology
54 description and therefore should not define a
55 cpu-map node.
56
57 Description: The cpu-map node is just a container node where its
58 subnodes describe the CPU topology.
59
60 Node name must be "cpu-map".
61
62 The cpu-map node's parent node must be the cpus node.
63
64 The cpu-map node's child nodes can be:
65
66 - one or more cluster nodes
67
68 Any other configuration is considered invalid.
69
70The cpu-map node can only contain three types of child nodes:
71
72- cluster node
73- core node
74- thread node
75
76whose bindings are described in paragraph 3.
77
78The nodes describing the CPU topology (cluster/core/thread) can only be
79defined within the cpu-map node.
80Any other configuration is consider invalid and therefore must be ignored.
81
82===========================================
832.1 - cpu-map child nodes naming convention
84===========================================
85
86cpu-map child nodes must follow a naming convention where the node name
87must be "clusterN", "coreN", "threadN" depending on the node type (ie
88cluster/core/thread) (where N = {0, 1, ...} is the node number; nodes which
89are siblings within a single common parent node must be given a unique and
90sequential N value, starting from 0).
91cpu-map child nodes which do not share a common parent node can have the same
92name (ie same number N as other cpu-map child nodes at different device tree
93levels) since name uniqueness will be guaranteed by the device tree hierarchy.
94
95===========================================
963 - cluster/core/thread node bindings
97===========================================
98
99Bindings for cluster/cpu/thread nodes are defined as follows:
100
101- cluster node
102
103 Description: must be declared within a cpu-map node, one node
104 per cluster. A system can contain several layers of
105 clustering and cluster nodes can be contained in parent
106 cluster nodes.
107
108 The cluster node name must be "clusterN" as described in 2.1 above.
109 A cluster node can not be a leaf node.
110
111 A cluster node's child nodes must be:
112
113 - one or more cluster nodes; or
114 - one or more core nodes
115
116 Any other configuration is considered invalid.
117
118- core node
119
120 Description: must be declared in a cluster node, one node per core in
121 the cluster. If the system does not support SMT, core
122 nodes are leaf nodes, otherwise they become containers of
123 thread nodes.
124
125 The core node name must be "coreN" as described in 2.1 above.
126
127 A core node must be a leaf node if SMT is not supported.
128
129 Properties for core nodes that are leaf nodes:
130
131 - cpu
132 Usage: required
133 Value type: <phandle>
134 Definition: a phandle to the cpu node that corresponds to the
135 core node.
136
137 If a core node is not a leaf node (CPUs supporting SMT) a core node's
138 child nodes can be:
139
140 - one or more thread nodes
141
142 Any other configuration is considered invalid.
143
144- thread node
145
146 Description: must be declared in a core node, one node per thread
147 in the core if the system supports SMT. Thread nodes are
148 always leaf nodes in the device tree.
149
150 The thread node name must be "threadN" as described in 2.1 above.
151
152 A thread node must be a leaf node.
153
154 A thread node must contain the following property:
155
156 - cpu
157 Usage: required
158 Value type: <phandle>
159 Definition: a phandle to the cpu node that corresponds to
160 the thread node.
161
162===========================================
1634 - Example dts
164===========================================
165
166Example 1 (ARM 64-bit, 16-cpu system, two clusters of clusters):
167
168cpus {
169 #size-cells = <0>;
170 #address-cells = <2>;
171
172 cpu-map {
173 cluster0 {
174 cluster0 {
175 core0 {
176 thread0 {
177 cpu = <&CPU0>;
178 };
179 thread1 {
180 cpu = <&CPU1>;
181 };
182 };
183
184 core1 {
185 thread0 {
186 cpu = <&CPU2>;
187 };
188 thread1 {
189 cpu = <&CPU3>;
190 };
191 };
192 };
193
194 cluster1 {
195 core0 {
196 thread0 {
197 cpu = <&CPU4>;
198 };
199 thread1 {
200 cpu = <&CPU5>;
201 };
202 };
203
204 core1 {
205 thread0 {
206 cpu = <&CPU6>;
207 };
208 thread1 {
209 cpu = <&CPU7>;
210 };
211 };
212 };
213 };
214
215 cluster1 {
216 cluster0 {
217 core0 {
218 thread0 {
219 cpu = <&CPU8>;
220 };
221 thread1 {
222 cpu = <&CPU9>;
223 };
224 };
225 core1 {
226 thread0 {
227 cpu = <&CPU10>;
228 };
229 thread1 {
230 cpu = <&CPU11>;
231 };
232 };
233 };
234
235 cluster1 {
236 core0 {
237 thread0 {
238 cpu = <&CPU12>;
239 };
240 thread1 {
241 cpu = <&CPU13>;
242 };
243 };
244 core1 {
245 thread0 {
246 cpu = <&CPU14>;
247 };
248 thread1 {
249 cpu = <&CPU15>;
250 };
251 };
252 };
253 };
254 };
255
256 CPU0: cpu@0 {
257 device_type = "cpu";
258 compatible = "arm,cortex-a57";
259 reg = <0x0 0x0>;
260 enable-method = "spin-table";
261 cpu-release-addr = <0 0x20000000>;
262 };
263
264 CPU1: cpu@1 {
265 device_type = "cpu";
266 compatible = "arm,cortex-a57";
267 reg = <0x0 0x1>;
268 enable-method = "spin-table";
269 cpu-release-addr = <0 0x20000000>;
270 };
271
272 CPU2: cpu@100 {
273 device_type = "cpu";
274 compatible = "arm,cortex-a57";
275 reg = <0x0 0x100>;
276 enable-method = "spin-table";
277 cpu-release-addr = <0 0x20000000>;
278 };
279
280 CPU3: cpu@101 {
281 device_type = "cpu";
282 compatible = "arm,cortex-a57";
283 reg = <0x0 0x101>;
284 enable-method = "spin-table";
285 cpu-release-addr = <0 0x20000000>;
286 };
287
288 CPU4: cpu@10000 {
289 device_type = "cpu";
290 compatible = "arm,cortex-a57";
291 reg = <0x0 0x10000>;
292 enable-method = "spin-table";
293 cpu-release-addr = <0 0x20000000>;
294 };
295
296 CPU5: cpu@10001 {
297 device_type = "cpu";
298 compatible = "arm,cortex-a57";
299 reg = <0x0 0x10001>;
300 enable-method = "spin-table";
301 cpu-release-addr = <0 0x20000000>;
302 };
303
304 CPU6: cpu@10100 {
305 device_type = "cpu";
306 compatible = "arm,cortex-a57";
307 reg = <0x0 0x10100>;
308 enable-method = "spin-table";
309 cpu-release-addr = <0 0x20000000>;
310 };
311
312 CPU7: cpu@10101 {
313 device_type = "cpu";
314 compatible = "arm,cortex-a57";
315 reg = <0x0 0x10101>;
316 enable-method = "spin-table";
317 cpu-release-addr = <0 0x20000000>;
318 };
319
320 CPU8: cpu@100000000 {
321 device_type = "cpu";
322 compatible = "arm,cortex-a57";
323 reg = <0x1 0x0>;
324 enable-method = "spin-table";
325 cpu-release-addr = <0 0x20000000>;
326 };
327
328 CPU9: cpu@100000001 {
329 device_type = "cpu";
330 compatible = "arm,cortex-a57";
331 reg = <0x1 0x1>;
332 enable-method = "spin-table";
333 cpu-release-addr = <0 0x20000000>;
334 };
335
336 CPU10: cpu@100000100 {
337 device_type = "cpu";
338 compatible = "arm,cortex-a57";
339 reg = <0x1 0x100>;
340 enable-method = "spin-table";
341 cpu-release-addr = <0 0x20000000>;
342 };
343
344 CPU11: cpu@100000101 {
345 device_type = "cpu";
346 compatible = "arm,cortex-a57";
347 reg = <0x1 0x101>;
348 enable-method = "spin-table";
349 cpu-release-addr = <0 0x20000000>;
350 };
351
352 CPU12: cpu@100010000 {
353 device_type = "cpu";
354 compatible = "arm,cortex-a57";
355 reg = <0x1 0x10000>;
356 enable-method = "spin-table";
357 cpu-release-addr = <0 0x20000000>;
358 };
359
360 CPU13: cpu@100010001 {
361 device_type = "cpu";
362 compatible = "arm,cortex-a57";
363 reg = <0x1 0x10001>;
364 enable-method = "spin-table";
365 cpu-release-addr = <0 0x20000000>;
366 };
367
368 CPU14: cpu@100010100 {
369 device_type = "cpu";
370 compatible = "arm,cortex-a57";
371 reg = <0x1 0x10100>;
372 enable-method = "spin-table";
373 cpu-release-addr = <0 0x20000000>;
374 };
375
376 CPU15: cpu@100010101 {
377 device_type = "cpu";
378 compatible = "arm,cortex-a57";
379 reg = <0x1 0x10101>;
380 enable-method = "spin-table";
381 cpu-release-addr = <0 0x20000000>;
382 };
383};
384
385Example 2 (ARM 32-bit, dual-cluster, 8-cpu system, no SMT):
386
387cpus {
388 #size-cells = <0>;
389 #address-cells = <1>;
390
391 cpu-map {
392 cluster0 {
393 core0 {
394 cpu = <&CPU0>;
395 };
396 core1 {
397 cpu = <&CPU1>;
398 };
399 core2 {
400 cpu = <&CPU2>;
401 };
402 core3 {
403 cpu = <&CPU3>;
404 };
405 };
406
407 cluster1 {
408 core0 {
409 cpu = <&CPU4>;
410 };
411 core1 {
412 cpu = <&CPU5>;
413 };
414 core2 {
415 cpu = <&CPU6>;
416 };
417 core3 {
418 cpu = <&CPU7>;
419 };
420 };
421 };
422
423 CPU0: cpu@0 {
424 device_type = "cpu";
425 compatible = "arm,cortex-a15";
426 reg = <0x0>;
427 };
428
429 CPU1: cpu@1 {
430 device_type = "cpu";
431 compatible = "arm,cortex-a15";
432 reg = <0x1>;
433 };
434
435 CPU2: cpu@2 {
436 device_type = "cpu";
437 compatible = "arm,cortex-a15";
438 reg = <0x2>;
439 };
440
441 CPU3: cpu@3 {
442 device_type = "cpu";
443 compatible = "arm,cortex-a15";
444 reg = <0x3>;
445 };
446
447 CPU4: cpu@100 {
448 device_type = "cpu";
449 compatible = "arm,cortex-a7";
450 reg = <0x100>;
451 };
452
453 CPU5: cpu@101 {
454 device_type = "cpu";
455 compatible = "arm,cortex-a7";
456 reg = <0x101>;
457 };
458
459 CPU6: cpu@102 {
460 device_type = "cpu";
461 compatible = "arm,cortex-a7";
462 reg = <0x102>;
463 };
464
465 CPU7: cpu@103 {
466 device_type = "cpu";
467 compatible = "arm,cortex-a7";
468 reg = <0x103>;
469 };
470};
471
472===============================================================================
473[1] ARM Linux kernel documentation
474 Documentation/devicetree/bindings/arm/cpus.txt
diff --git a/Documentation/devicetree/bindings/arm/vic.txt b/Documentation/devicetree/bindings/arm/vic.txt
index 266716b23437..dd527216c5fb 100644
--- a/Documentation/devicetree/bindings/arm/vic.txt
+++ b/Documentation/devicetree/bindings/arm/vic.txt
@@ -18,6 +18,15 @@ Required properties:
18Optional properties: 18Optional properties:
19 19
20- interrupts : Interrupt source for parent controllers if the VIC is nested. 20- interrupts : Interrupt source for parent controllers if the VIC is nested.
21- valid-mask : A one cell big bit mask of valid interrupt sources. Each bit
22 represents single interrupt source, starting from source 0 at LSb and ending
23 at source 31 at MSb. A bit that is set means that the source is wired and
24 clear means otherwise. If unspecified, defaults to all valid.
25- valid-wakeup-mask : A one cell big bit mask of interrupt sources that can be
26 configured as wake up source for the system. Order of bits is the same as for
27 valid-mask property. A set bit means that this interrupt source can be
28 configured as a wake up source for the system. If unspecied, defaults to all
29 interrupt sources configurable as wake up sources.
21 30
22Example: 31Example:
23 32
@@ -26,4 +35,7 @@ Example:
26 interrupt-controller; 35 interrupt-controller;
27 #interrupt-cells = <1>; 36 #interrupt-cells = <1>;
28 reg = <0x60000 0x1000>; 37 reg = <0x60000 0x1000>;
38
39 valid-mask = <0xffffff7f>;
40 valid-wakeup-mask = <0x0000ff7f>;
29 }; 41 };
diff --git a/Documentation/devicetree/bindings/clock/efm32-clock.txt b/Documentation/devicetree/bindings/clock/efm32-clock.txt
new file mode 100644
index 000000000000..263d293f6a10
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/efm32-clock.txt
@@ -0,0 +1,11 @@
1* Clock bindings for Energy Micro efm32 Giant Gecko's Clock Management Unit
2
3Required properties:
4- compatible: Should be "efm32gg,cmu"
5- reg: Base address and length of the register set
6- interrupts: Interrupt used by the CMU
7- #clock-cells: Should be <1>
8
9The clock consumer should specify the desired clock by having the clock ID in
10its "clocks" phandle cell. The header efm32-clk.h contains a list of available
11IDs.
diff --git a/Documentation/devicetree/bindings/clock/imx6q-clock.txt b/Documentation/devicetree/bindings/clock/imx6q-clock.txt
index 5a90a724b520..6aab72bf67ea 100644
--- a/Documentation/devicetree/bindings/clock/imx6q-clock.txt
+++ b/Documentation/devicetree/bindings/clock/imx6q-clock.txt
@@ -215,6 +215,11 @@ clocks and IDs.
215 cko2 200 215 cko2 200
216 cko 201 216 cko 201
217 vdoa 202 217 vdoa 202
218 pll4_audio_div 203
219 lvds1_sel 204
220 lvds2_sel 205
221 lvds1_gate 206
222 lvds2_gate 207
218 223
219Examples: 224Examples:
220 225
diff --git a/Documentation/devicetree/bindings/clock/keystone-gate.txt b/Documentation/devicetree/bindings/clock/keystone-gate.txt
new file mode 100644
index 000000000000..c5aa187026e3
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/keystone-gate.txt
@@ -0,0 +1,29 @@
1Status: Unstable - ABI compatibility may be broken in the future
2
3Binding for Keystone gate control driver which uses PSC controller IP.
4
5This binding uses the common clock binding[1].
6
7[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
8
9Required properties:
10- compatible : shall be "ti,keystone,psc-clock".
11- #clock-cells : from common clock binding; shall be set to 0.
12- clocks : parent clock phandle
13- reg : psc control and domain address address space
14- reg-names : psc control and domain registers
15- domain-id : psc domain id needed to check the transition state register
16
17Optional properties:
18- clock-output-names : From common clock binding to override the
19 default output clock name
20Example:
21 clkusb: clkusb {
22 #clock-cells = <0>;
23 compatible = "ti,keystone,psc-clock";
24 clocks = <&chipclk16>;
25 clock-output-names = "usb";
26 reg = <0x02350008 0xb00>, <0x02350000 0x400>;
27 reg-names = "control", "domain";
28 domain-id = <0>;
29 };
diff --git a/Documentation/devicetree/bindings/clock/keystone-pll.txt b/Documentation/devicetree/bindings/clock/keystone-pll.txt
new file mode 100644
index 000000000000..12bd72605a31
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/keystone-pll.txt
@@ -0,0 +1,84 @@
1Status: Unstable - ABI compatibility may be broken in the future
2
3Binding for keystone PLLs. The main PLL IP typically has a multiplier,
4a divider and a post divider. The additional PLL IPs like ARMPLL, DDRPLL
5and PAPLL are controlled by the memory mapped register where as the Main
6PLL is controlled by a PLL controller registers along with memory mapped
7registers.
8
9This binding uses the common clock binding[1].
10
11[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
12
13Required properties:
14- #clock-cells : from common clock binding; shall be set to 0.
15- compatible : shall be "ti,keystone,main-pll-clock" or "ti,keystone,pll-clock"
16- clocks : parent clock phandle
17- reg - pll control0 and pll multipler registers
18- reg-names : control and multiplier. The multiplier is applicable only for
19 main pll clock
20- fixed-postdiv : fixed post divider value
21
22Example:
23 mainpllclk: mainpllclk@2310110 {
24 #clock-cells = <0>;
25 compatible = "ti,keystone,main-pll-clock";
26 clocks = <&refclkmain>;
27 reg = <0x02620350 4>, <0x02310110 4>;
28 reg-names = "control", "multiplier";
29 fixed-postdiv = <2>;
30 };
31
32 papllclk: papllclk@2620358 {
33 #clock-cells = <0>;
34 compatible = "ti,keystone,pll-clock";
35 clocks = <&refclkmain>;
36 clock-output-names = "pa-pll-clk";
37 reg = <0x02620358 4>;
38 reg-names = "control";
39 fixed-postdiv = <6>;
40 };
41
42Required properties:
43- #clock-cells : from common clock binding; shall be set to 0.
44- compatible : shall be "ti,keystone,pll-mux-clock"
45- clocks : link phandles of parent clocks
46- reg - pll mux register
47- bit-shift : number of bits to shift the bit-mask
48- bit-mask : arbitrary bitmask for programming the mux
49
50Optional properties:
51- clock-output-names : From common clock binding.
52
53Example:
54 mainmuxclk: mainmuxclk@2310108 {
55 #clock-cells = <0>;
56 compatible = "ti,keystone,pll-mux-clock";
57 clocks = <&mainpllclk>, <&refclkmain>;
58 reg = <0x02310108 4>;
59 bit-shift = <23>;
60 bit-mask = <1>;
61 clock-output-names = "mainmuxclk";
62 };
63
64Required properties:
65- #clock-cells : from common clock binding; shall be set to 0.
66- compatible : shall be "ti,keystone,pll-divider-clock"
67- clocks : parent clock phandle
68- reg - pll mux register
69- bit-shift : number of bits to shift the bit-mask
70- bit-mask : arbitrary bitmask for programming the divider
71
72Optional properties:
73- clock-output-names : From common clock binding.
74
75Example:
76 gemtraceclk: gemtraceclk@2310120 {
77 #clock-cells = <0>;
78 compatible = "ti,keystone,pll-divider-clock";
79 clocks = <&mainmuxclk>;
80 reg = <0x02310120 4>;
81 bit-shift = <0>;
82 bit-mask = <8>;
83 clock-output-names = "gemtraceclk";
84 };
diff --git a/Documentation/devicetree/bindings/clock/mvebu-corediv-clock.txt b/Documentation/devicetree/bindings/clock/mvebu-corediv-clock.txt
new file mode 100644
index 000000000000..c62391fc0e39
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/mvebu-corediv-clock.txt
@@ -0,0 +1,19 @@
1* Core Divider Clock bindings for Marvell MVEBU SoCs
2
3The following is a list of provided IDs and clock names on Armada 370/XP:
4 0 = nand (NAND clock)
5
6Required properties:
7- compatible : must be "marvell,armada-370-corediv-clock"
8- reg : must be the register address of Core Divider control register
9- #clock-cells : from common clock binding; shall be set to 1
10- clocks : must be set to the parent's phandle
11
12Example:
13
14corediv_clk: corediv-clocks@18740 {
15 compatible = "marvell,armada-370-corediv-clock";
16 reg = <0x18740 0xc>;
17 #clock-cells = <1>;
18 clocks = <&pll>;
19};
diff --git a/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt b/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
index cffc93d97f54..fc2910fa7e45 100644
--- a/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
+++ b/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
@@ -1,10 +1,10 @@
1* Gated Clock bindings for Marvell Orion SoCs 1* Gated Clock bindings for Marvell EBU SoCs
2 2
3Marvell Dove and Kirkwood allow some peripheral clocks to be gated to save 3Marvell Armada 370/XP, Dove and Kirkwood allow some peripheral clocks to be
4some power. The clock consumer should specify the desired clock by having 4gated to save some power. The clock consumer should specify the desired clock
5the clock ID in its "clocks" phandle cell. The clock ID is directly mapped to 5by having the clock ID in its "clocks" phandle cell. The clock ID is directly
6the corresponding clock gating control bit in HW to ease manual clock lookup 6mapped to the corresponding clock gating control bit in HW to ease manual clock
7in datasheet. 7lookup in datasheet.
8 8
9The following is a list of provided IDs for Armada 370: 9The following is a list of provided IDs for Armada 370:
10ID Clock Peripheral 10ID Clock Peripheral
@@ -94,6 +94,8 @@ ID Clock Peripheral
94 94
95Required properties: 95Required properties:
96- compatible : shall be one of the following: 96- compatible : shall be one of the following:
97 "marvell,armada-370-gating-clock" - for Armada 370 SoC clock gating
98 "marvell,armada-xp-gating-clock" - for Armada XP SoC clock gating
97 "marvell,dove-gating-clock" - for Dove SoC clock gating 99 "marvell,dove-gating-clock" - for Dove SoC clock gating
98 "marvell,kirkwood-gating-clock" - for Kirkwood SoC clock gating 100 "marvell,kirkwood-gating-clock" - for Kirkwood SoC clock gating
99- reg : shall be the register address of the Clock Gating Control register 101- reg : shall be the register address of the Clock Gating Control register
diff --git a/Documentation/devicetree/bindings/clock/sunxi.txt b/Documentation/devicetree/bindings/clock/sunxi.txt
index 00a5c26454eb..91a748fed13d 100644
--- a/Documentation/devicetree/bindings/clock/sunxi.txt
+++ b/Documentation/devicetree/bindings/clock/sunxi.txt
@@ -45,8 +45,8 @@ Additionally, "allwinner,*-gates-clk" clocks require:
45 45
46Clock consumers should specify the desired clocks they use with a 46Clock consumers should specify the desired clocks they use with a
47"clocks" phandle cell. Consumers that are using a gated clock should 47"clocks" phandle cell. Consumers that are using a gated clock should
48provide an additional ID in their clock property. The values of this 48provide an additional ID in their clock property. This ID is the
49ID are documented in sunxi/<soc>-gates.txt. 49offset of the bit controlling this particular gate in the register.
50 50
51For example: 51For example:
52 52
diff --git a/Documentation/devicetree/bindings/clock/sunxi/sun4i-a10-gates.txt b/Documentation/devicetree/bindings/clock/sunxi/sun4i-a10-gates.txt
deleted file mode 100644
index 6a03475bbfe2..000000000000
--- a/Documentation/devicetree/bindings/clock/sunxi/sun4i-a10-gates.txt
+++ /dev/null
@@ -1,93 +0,0 @@
1Gate clock outputs
2------------------
3
4 * AXI gates ("allwinner,sun4i-axi-gates-clk")
5
6 DRAM 0
7
8 * AHB gates ("allwinner,sun4i-ahb-gates-clk")
9
10 USB0 0
11 EHCI0 1
12 OHCI0 2*
13 EHCI1 3
14 OHCI1 4*
15 SS 5
16 DMA 6
17 BIST 7
18 MMC0 8
19 MMC1 9
20 MMC2 10
21 MMC3 11
22 MS 12**
23 NAND 13
24 SDRAM 14
25
26 ACE 16
27 EMAC 17
28 TS 18
29
30 SPI0 20
31 SPI1 21
32 SPI2 22
33 SPI3 23
34 PATA 24
35 SATA 25**
36 GPS 26*
37
38 VE 32
39 TVD 33
40 TVE0 34
41 TVE1 35
42 LCD0 36
43 LCD1 37
44
45 CSI0 40
46 CSI1 41
47
48 HDMI 43
49 DE_BE0 44
50 DE_BE1 45
51 DE_FE1 46
52 DE_FE1 47
53
54 MP 50
55
56 MALI400 52
57
58 * APB0 gates ("allwinner,sun4i-apb0-gates-clk")
59
60 CODEC 0
61 SPDIF 1*
62 AC97 2
63 IIS 3
64
65 PIO 5
66 IR0 6
67 IR1 7
68
69 KEYPAD 10
70
71 * APB1 gates ("allwinner,sun4i-apb1-gates-clk")
72
73 I2C0 0
74 I2C1 1
75 I2C2 2
76
77 CAN 4
78 SCR 5
79 PS20 6
80 PS21 7
81
82 UART0 16
83 UART1 17
84 UART2 18
85 UART3 19
86 UART4 20
87 UART5 21
88 UART6 22
89 UART7 23
90
91Notation:
92 [*]: The datasheet didn't mention these, but they are present on AW code
93 [**]: The datasheet had this marked as "NC" but they are used on AW code
diff --git a/Documentation/devicetree/bindings/clock/sunxi/sun5i-a10s-gates.txt b/Documentation/devicetree/bindings/clock/sunxi/sun5i-a10s-gates.txt
deleted file mode 100644
index d24279fe1429..000000000000
--- a/Documentation/devicetree/bindings/clock/sunxi/sun5i-a10s-gates.txt
+++ /dev/null
@@ -1,75 +0,0 @@
1Gate clock outputs
2------------------
3
4 * AXI gates ("allwinner,sun4i-axi-gates-clk")
5
6 DRAM 0
7
8 * AHB gates ("allwinner,sun5i-a10s-ahb-gates-clk")
9
10 USB0 0
11 EHCI0 1
12 OHCI0 2
13
14 SS 5
15 DMA 6
16 BIST 7
17 MMC0 8
18 MMC1 9
19 MMC2 10
20
21 NAND 13
22 SDRAM 14
23
24 EMAC 17
25 TS 18
26
27 SPI0 20
28 SPI1 21
29 SPI2 22
30
31 GPS 26
32
33 HSTIMER 28
34
35 VE 32
36
37 TVE 34
38
39 LCD 36
40
41 CSI 40
42
43 HDMI 43
44 DE_BE 44
45
46 DE_FE 46
47
48 IEP 51
49 MALI400 52
50
51 * APB0 gates ("allwinner,sun5i-a10s-apb0-gates-clk")
52
53 CODEC 0
54
55 IIS 3
56
57 PIO 5
58 IR 6
59
60 KEYPAD 10
61
62 * APB1 gates ("allwinner,sun5i-a10s-apb1-gates-clk")
63
64 I2C0 0
65 I2C1 1
66 I2C2 2
67
68 UART0 16
69 UART1 17
70 UART2 18
71 UART3 19
72
73Notation:
74 [*]: The datasheet didn't mention these, but they are present on AW code
75 [**]: The datasheet had this marked as "NC" but they are used on AW code
diff --git a/Documentation/devicetree/bindings/clock/sunxi/sun5i-a13-gates.txt b/Documentation/devicetree/bindings/clock/sunxi/sun5i-a13-gates.txt
deleted file mode 100644
index 006b6dfc4703..000000000000
--- a/Documentation/devicetree/bindings/clock/sunxi/sun5i-a13-gates.txt
+++ /dev/null
@@ -1,58 +0,0 @@
1Gate clock outputs
2------------------
3
4 * AXI gates ("allwinner,sun4i-axi-gates-clk")
5
6 DRAM 0
7
8 * AHB gates ("allwinner,sun5i-a13-ahb-gates-clk")
9
10 USBOTG 0
11 EHCI 1
12 OHCI 2
13
14 SS 5
15 DMA 6
16 BIST 7
17 MMC0 8
18 MMC1 9
19 MMC2 10
20
21 NAND 13
22 SDRAM 14
23
24 SPI0 20
25 SPI1 21
26 SPI2 22
27
28 STIMER 28
29
30 VE 32
31
32 LCD 36
33
34 CSI 40
35
36 DE_BE 44
37
38 DE_FE 46
39
40 IEP 51
41 MALI400 52
42
43 * APB0 gates ("allwinner,sun5i-a13-apb0-gates-clk")
44
45 CODEC 0
46
47 PIO 5
48 IR 6
49
50 * APB1 gates ("allwinner,sun5i-a13-apb1-gates-clk")
51
52 I2C0 0
53 I2C1 1
54 I2C2 2
55
56 UART1 17
57
58 UART3 19
diff --git a/Documentation/devicetree/bindings/clock/sunxi/sun6i-a31-gates.txt b/Documentation/devicetree/bindings/clock/sunxi/sun6i-a31-gates.txt
deleted file mode 100644
index fe44932b5c6b..000000000000
--- a/Documentation/devicetree/bindings/clock/sunxi/sun6i-a31-gates.txt
+++ /dev/null
@@ -1,83 +0,0 @@
1Gate clock outputs
2------------------
3
4 * AHB1 gates ("allwinner,sun6i-a31-ahb1-gates-clk")
5
6 MIPI DSI 1
7
8 SS 5
9 DMA 6
10
11 MMC0 8
12 MMC1 9
13 MMC2 10
14 MMC3 11
15
16 NAND1 12
17 NAND0 13
18 SDRAM 14
19
20 GMAC 17
21 TS 18
22 HSTIMER 19
23 SPI0 20
24 SPI1 21
25 SPI2 22
26 SPI3 23
27 USB_OTG 24
28
29 EHCI0 26
30 EHCI1 27
31
32 OHCI0 29
33 OHCI1 30
34 OHCI2 31
35 VE 32
36
37 LCD0 36
38 LCD1 37
39
40 CSI 40
41
42 HDMI 43
43 DE_BE0 44
44 DE_BE1 45
45 DE_FE1 46
46 DE_FE1 47
47
48 MP 50
49
50 GPU 52
51
52 DEU0 55
53 DEU1 56
54 DRC0 57
55 DRC1 58
56
57 * APB1 gates ("allwinner,sun6i-a31-apb1-gates-clk")
58
59 CODEC 0
60
61 DIGITAL MIC 4
62 PIO 5
63
64 DAUDIO0 12
65 DAUDIO1 13
66
67 * APB2 gates ("allwinner,sun6i-a31-apb2-gates-clk")
68
69 I2C0 0
70 I2C1 1
71 I2C2 2
72 I2C3 3
73
74 UART0 16
75 UART1 17
76 UART2 18
77 UART3 19
78 UART4 20
79 UART5 21
80
81Notation:
82 [*]: The datasheet didn't mention these, but they are present on AW code
83 [**]: The datasheet had this marked as "NC" but they are used on AW code
diff --git a/Documentation/devicetree/bindings/clock/sunxi/sun7i-a20-gates.txt b/Documentation/devicetree/bindings/clock/sunxi/sun7i-a20-gates.txt
deleted file mode 100644
index 357f4fdc02ef..000000000000
--- a/Documentation/devicetree/bindings/clock/sunxi/sun7i-a20-gates.txt
+++ /dev/null
@@ -1,98 +0,0 @@
1Gate clock outputs
2------------------
3
4 * AXI gates ("allwinner,sun4i-axi-gates-clk")
5
6 DRAM 0
7
8 * AHB gates ("allwinner,sun7i-a20-ahb-gates-clk")
9
10 USB0 0
11 EHCI0 1
12 OHCI0 2
13 EHCI1 3
14 OHCI1 4
15 SS 5
16 DMA 6
17 BIST 7
18 MMC0 8
19 MMC1 9
20 MMC2 10
21 MMC3 11
22 MS 12
23 NAND 13
24 SDRAM 14
25
26 ACE 16
27 EMAC 17
28 TS 18
29
30 SPI0 20
31 SPI1 21
32 SPI2 22
33 SPI3 23
34
35 SATA 25
36
37 HSTIMER 28
38
39 VE 32
40 TVD 33
41 TVE0 34
42 TVE1 35
43 LCD0 36
44 LCD1 37
45
46 CSI0 40
47 CSI1 41
48
49 HDMI1 42
50 HDMI0 43
51 DE_BE0 44
52 DE_BE1 45
53 DE_FE1 46
54 DE_FE1 47
55
56 GMAC 49
57 MP 50
58
59 MALI400 52
60
61 * APB0 gates ("allwinner,sun7i-a20-apb0-gates-clk")
62
63 CODEC 0
64 SPDIF 1
65 AC97 2
66 IIS0 3
67 IIS1 4
68 PIO 5
69 IR0 6
70 IR1 7
71 IIS2 8
72
73 KEYPAD 10
74
75 * APB1 gates ("allwinner,sun7i-a20-apb1-gates-clk")
76
77 I2C0 0
78 I2C1 1
79 I2C2 2
80 I2C3 3
81 CAN 4
82 SCR 5
83 PS20 6
84 PS21 7
85
86 I2C4 15
87 UART0 16
88 UART1 17
89 UART2 18
90 UART3 19
91 UART4 20
92 UART5 21
93 UART6 22
94 UART7 23
95
96Notation:
97 [*]: The datasheet didn't mention these, but they are present on AW code
98 [**]: The datasheet had this marked as "NC" but they are used on AW code
diff --git a/Documentation/devicetree/bindings/clock/xgene.txt b/Documentation/devicetree/bindings/clock/xgene.txt
new file mode 100644
index 000000000000..1c4ef773feea
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/xgene.txt
@@ -0,0 +1,111 @@
1Device Tree Clock bindings for APM X-Gene
2
3This binding uses the common clock binding[1].
4
5[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
6
7Required properties:
8- compatible : shall be one of the following:
9 "apm,xgene-socpll-clock" - for a X-Gene SoC PLL clock
10 "apm,xgene-pcppll-clock" - for a X-Gene PCP PLL clock
11 "apm,xgene-device-clock" - for a X-Gene device clock
12
13Required properties for SoC or PCP PLL clocks:
14- reg : shall be the physical PLL register address for the pll clock.
15- clocks : shall be the input parent clock phandle for the clock. This should
16 be the reference clock.
17- #clock-cells : shall be set to 1.
18- clock-output-names : shall be the name of the PLL referenced by derive
19 clock.
20Optional properties for PLL clocks:
21- clock-names : shall be the name of the PLL. If missing, use the device name.
22
23Required properties for device clocks:
24- reg : shall be a list of address and length pairs describing the CSR
25 reset and/or the divider. Either may be omitted, but at least
26 one must be present.
27 - reg-names : shall be a string list describing the reg resource. This
28 may include "csr-reg" and/or "div-reg". If this property
29 is not present, the reg property is assumed to describe
30 only "csr-reg".
31- clocks : shall be the input parent clock phandle for the clock.
32- #clock-cells : shall be set to 1.
33- clock-output-names : shall be the name of the device referenced.
34Optional properties for device clocks:
35- clock-names : shall be the name of the device clock. If missing, use the
36 device name.
37- csr-offset : Offset to the CSR reset register from the reset address base.
38 Default is 0.
39- csr-mask : CSR reset mask bit. Default is 0xF.
40- enable-offset : Offset to the enable register from the reset address base.
41 Default is 0x8.
42- enable-mask : CSR enable mask bit. Default is 0xF.
43- divider-offset : Offset to the divider CSR register from the divider base.
44 Default is 0x0.
45- divider-width : Width of the divider register. Default is 0.
46- divider-shift : Bit shift of the divider register. Default is 0.
47
48For example:
49
50 pcppll: pcppll@17000100 {
51 compatible = "apm,xgene-pcppll-clock";
52 #clock-cells = <1>;
53 clocks = <&refclk 0>;
54 clock-names = "pcppll";
55 reg = <0x0 0x17000100 0x0 0x1000>;
56 clock-output-names = "pcppll";
57 type = <0>;
58 };
59
60 socpll: socpll@17000120 {
61 compatible = "apm,xgene-socpll-clock";
62 #clock-cells = <1>;
63 clocks = <&refclk 0>;
64 clock-names = "socpll";
65 reg = <0x0 0x17000120 0x0 0x1000>;
66 clock-output-names = "socpll";
67 type = <1>;
68 };
69
70 qmlclk: qmlclk {
71 compatible = "apm,xgene-device-clock";
72 #clock-cells = <1>;
73 clocks = <&socplldiv2 0>;
74 clock-names = "qmlclk";
75 reg = <0x0 0x1703C000 0x0 0x1000>;
76 reg-name = "csr-reg";
77 clock-output-names = "qmlclk";
78 };
79
80 ethclk: ethclk {
81 compatible = "apm,xgene-device-clock";
82 #clock-cells = <1>;
83 clocks = <&socplldiv2 0>;
84 clock-names = "ethclk";
85 reg = <0x0 0x17000000 0x0 0x1000>;
86 reg-names = "div-reg";
87 divider-offset = <0x238>;
88 divider-width = <0x9>;
89 divider-shift = <0x0>;
90 clock-output-names = "ethclk";
91 };
92
93 apbclk: apbclk {
94 compatible = "apm,xgene-device-clock";
95 #clock-cells = <1>;
96 clocks = <&ahbclk 0>;
97 clock-names = "apbclk";
98 reg = <0x0 0x1F2AC000 0x0 0x1000
99 0x0 0x1F2AC000 0x0 0x1000>;
100 reg-names = "csr-reg", "div-reg";
101 csr-offset = <0x0>;
102 csr-mask = <0x200>;
103 enable-offset = <0x8>;
104 enable-mask = <0x200>;
105 divider-offset = <0x10>;
106 divider-width = <0x2>;
107 divider-shift = <0x0>;
108 flags = <0x8>;
109 clock-output-names = "apbclk";
110 };
111
diff --git a/Documentation/devicetree/bindings/crypto/omap-aes.txt b/Documentation/devicetree/bindings/crypto/omap-aes.txt
new file mode 100644
index 000000000000..fd9717653cbb
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/omap-aes.txt
@@ -0,0 +1,31 @@
1OMAP SoC AES crypto Module
2
3Required properties:
4
5- compatible : Should contain entries for this and backward compatible
6 AES versions:
7 - "ti,omap2-aes" for OMAP2.
8 - "ti,omap3-aes" for OMAP3.
9 - "ti,omap4-aes" for OMAP4 and AM33XX.
10 Note that the OMAP2 and 3 versions are compatible (OMAP3 supports
11 more algorithms) but they are incompatible with OMAP4.
12- ti,hwmods: Name of the hwmod associated with the AES module
13- reg : Offset and length of the register set for the module
14- interrupts : the interrupt-specifier for the AES module.
15
16Optional properties:
17- dmas: DMA specifiers for tx and rx dma. See the DMA client binding,
18 Documentation/devicetree/bindings/dma/dma.txt
19- dma-names: DMA request names should include "tx" and "rx" if present.
20
21Example:
22 /* AM335x */
23 aes: aes@53500000 {
24 compatible = "ti,omap4-aes";
25 ti,hwmods = "aes";
26 reg = <0x53500000 0xa0>;
27 interrupts = <102>;
28 dmas = <&edma 6>,
29 <&edma 5>;
30 dma-names = "tx", "rx";
31 };
diff --git a/Documentation/devicetree/bindings/crypto/omap-des.txt b/Documentation/devicetree/bindings/crypto/omap-des.txt
new file mode 100644
index 000000000000..e8c63bf2e16d
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/omap-des.txt
@@ -0,0 +1,30 @@
1OMAP SoC DES crypto Module
2
3Required properties:
4
5- compatible : Should contain "ti,omap4-des"
6- ti,hwmods: Name of the hwmod associated with the DES module
7- reg : Offset and length of the register set for the module
8- interrupts : the interrupt-specifier for the DES module
9- clocks : A phandle to the functional clock node of the DES module
10 corresponding to each entry in clock-names
11- clock-names : Name of the functional clock, should be "fck"
12
13Optional properties:
14- dmas: DMA specifiers for tx and rx dma. See the DMA client binding,
15 Documentation/devicetree/bindings/dma/dma.txt
16 Each entry corresponds to an entry in dma-names
17- dma-names: DMA request names should include "tx" and "rx" if present
18
19Example:
20 /* DRA7xx SoC */
21 des: des@480a5000 {
22 compatible = "ti,omap4-des";
23 ti,hwmods = "des";
24 reg = <0x480a5000 0xa0>;
25 interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
26 dmas = <&sdma 117>, <&sdma 116>;
27 dma-names = "tx", "rx";
28 clocks = <&l3_iclk_div>;
29 clock-names = "fck";
30 };
diff --git a/Documentation/devicetree/bindings/crypto/omap-sham.txt b/Documentation/devicetree/bindings/crypto/omap-sham.txt
new file mode 100644
index 000000000000..ad9115569611
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/omap-sham.txt
@@ -0,0 +1,28 @@
1OMAP SoC SHA crypto Module
2
3Required properties:
4
5- compatible : Should contain entries for this and backward compatible
6 SHAM versions:
7 - "ti,omap2-sham" for OMAP2 & OMAP3.
8 - "ti,omap4-sham" for OMAP4 and AM33XX.
9 - "ti,omap5-sham" for OMAP5, DRA7 and AM43XX.
10- ti,hwmods: Name of the hwmod associated with the SHAM module
11- reg : Offset and length of the register set for the module
12- interrupts : the interrupt-specifier for the SHAM module.
13
14Optional properties:
15- dmas: DMA specifiers for the rx dma. See the DMA client binding,
16 Documentation/devicetree/bindings/dma/dma.txt
17- dma-names: DMA request name. Should be "rx" if a dma is present.
18
19Example:
20 /* AM335x */
21 sham: sham@53100000 {
22 compatible = "ti,omap4-sham";
23 ti,hwmods = "sham";
24 reg = <0x53100000 0x200>;
25 interrupts = <109>;
26 dmas = <&edma 36>;
27 dma-names = "rx";
28 };
diff --git a/Documentation/devicetree/bindings/dma/atmel-dma.txt b/Documentation/devicetree/bindings/dma/atmel-dma.txt
index e1f343c7a34b..f69bcf5a6343 100644
--- a/Documentation/devicetree/bindings/dma/atmel-dma.txt
+++ b/Documentation/devicetree/bindings/dma/atmel-dma.txt
@@ -28,7 +28,7 @@ The three cells in order are:
28dependent: 28dependent:
29 - bit 7-0: peripheral identifier for the hardware handshaking interface. The 29 - bit 7-0: peripheral identifier for the hardware handshaking interface. The
30 identifier can be different for tx and rx. 30 identifier can be different for tx and rx.
31 - bit 11-8: FIFO configuration. 0 for half FIFO, 1 for ALAP, 1 for ASAP. 31 - bit 11-8: FIFO configuration. 0 for half FIFO, 1 for ALAP, 2 for ASAP.
32 32
33Example: 33Example:
34 34
diff --git a/Documentation/devicetree/bindings/gpio/abilis,tb10x-gpio.txt b/Documentation/devicetree/bindings/gpio/abilis,tb10x-gpio.txt
new file mode 100644
index 000000000000..00611aceed3e
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/abilis,tb10x-gpio.txt
@@ -0,0 +1,36 @@
1* Abilis TB10x GPIO controller
2
3Required Properties:
4- compatible: Should be "abilis,tb10x-gpio"
5- reg: Address and length of the register set for the device
6- gpio-controller: Marks the device node as a gpio controller.
7- #gpio-cells: Should be <2>. The first cell is the pin number and the
8 second cell is used to specify optional parameters:
9 - bit 0 specifies polarity (0 for normal, 1 for inverted).
10- abilis,ngpio: the number of GPIO pins this driver controls.
11
12Optional Properties:
13- interrupt-controller: Marks the device node as an interrupt controller.
14- #interrupt-cells: Should be <1>. Interrupts are triggered on both edges.
15- interrupts: Defines the interrupt line connecting this GPIO controller to
16 its parent interrupt controller.
17- interrupt-parent: Defines the parent interrupt controller.
18
19GPIO ranges are specified as described in
20Documentation/devicetree/bindings/gpio/gpio.txt
21
22Example:
23
24 gpioa: gpio@FF140000 {
25 compatible = "abilis,tb10x-gpio";
26 interrupt-controller;
27 #interrupt-cells = <1>;
28 interrupt-parent = <&tb10x_ictl>;
29 interrupts = <27 2>;
30 reg = <0xFF140000 0x1000>;
31 gpio-controller;
32 #gpio-cells = <2>;
33 abilis,ngpio = <3>;
34 gpio-ranges = <&iomux 0 0 0>;
35 gpio-ranges-group-names = "gpioa_pins";
36 };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-bcm-kona.txt b/Documentation/devicetree/bindings/gpio/gpio-bcm-kona.txt
new file mode 100644
index 000000000000..4a63bc96b687
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-bcm-kona.txt
@@ -0,0 +1,52 @@
1Broadcom Kona Family GPIO
2=========================
3
4This GPIO driver is used in the following Broadcom SoCs:
5 BCM11130, BCM11140, BCM11351, BCM28145, BCM28155
6
7The Broadcom GPIO Controller IP can be configured prior to synthesis to
8support up to 8 banks of 32 GPIOs where each bank has its own IRQ. The
9GPIO controller only supports edge, not level, triggering of interrupts.
10
11Required properties
12-------------------
13
14- compatible: "brcm,bcm11351-gpio", "brcm,kona-gpio"
15- reg: Physical base address and length of the controller's registers.
16- interrupts: The interrupt outputs from the controller. There is one GPIO
17 interrupt per GPIO bank. The number of interrupts listed depends on the
18 number of GPIO banks on the SoC. The interrupts must be ordered by bank,
19 starting with bank 0. There is always a 1:1 mapping between banks and
20 IRQs.
21- #gpio-cells: Should be <2>. The first cell is the pin number, the second
22 cell is used to specify optional parameters:
23 - bit 0 specifies polarity (0 for normal, 1 for inverted)
24 See also "gpio-specifier" in .../devicetree/bindings/gpio/gpio.txt.
25- #interrupt-cells: Should be <2>. The first cell is the GPIO number. The
26 second cell is used to specify flags. The following subset of flags is
27 supported:
28 - trigger type (bits[1:0]):
29 1 = low-to-high edge triggered.
30 2 = high-to-low edge triggered.
31 3 = low-to-high or high-to-low edge triggered
32 Valid values are 1, 2, 3
33 See also .../devicetree/bindings/interrupt-controller/interrupts.txt.
34- gpio-controller: Marks the device node as a GPIO controller.
35- interrupt-controller: Marks the device node as an interrupt controller.
36
37Example:
38 gpio: gpio@35003000 {
39 compatible = "brcm,bcm11351-gpio", "brcm,kona-gpio";
40 reg = <0x35003000 0x800>;
41 interrupts =
42 <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH
43 GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH
44 GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH
45 GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
46 GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH
47 GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
48 #gpio-cells = <2>;
49 #interrupt-cells = <2>;
50 gpio-controller;
51 interrupt-controller;
52 };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt b/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt
new file mode 100644
index 000000000000..d63194a2c848
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt
@@ -0,0 +1,71 @@
1* PCF857x-compatible I/O expanders
2
3The PCF857x-compatible chips have "quasi-bidirectional" I/O lines that can be
4driven high by a pull-up current source or driven low to ground. This combines
5the direction and output level into a single bit per line, which can't be read
6back. We can't actually know at initialization time whether a line is configured
7(a) as output and driving the signal low/high, or (b) as input and reporting a
8low/high value, without knowing the last value written since the chip came out
9of reset (if any). The only reliable solution for setting up line direction is
10thus to do it explicitly.
11
12Required Properties:
13
14 - compatible: should be one of the following.
15 - "maxim,max7328": For the Maxim MAX7378
16 - "maxim,max7329": For the Maxim MAX7329
17 - "nxp,pca8574": For the NXP PCA8574
18 - "nxp,pca8575": For the NXP PCA8575
19 - "nxp,pca9670": For the NXP PCA9670
20 - "nxp,pca9671": For the NXP PCA9671
21 - "nxp,pca9672": For the NXP PCA9672
22 - "nxp,pca9673": For the NXP PCA9673
23 - "nxp,pca9674": For the NXP PCA9674
24 - "nxp,pca9675": For the NXP PCA9675
25 - "nxp,pcf8574": For the NXP PCF8574
26 - "nxp,pcf8574a": For the NXP PCF8574A
27 - "nxp,pcf8575": For the NXP PCF8575
28 - "ti,tca9554": For the TI TCA9554
29
30 - reg: I2C slave address.
31
32 - gpio-controller: Marks the device node as a gpio controller.
33 - #gpio-cells: Should be 2. The first cell is the GPIO number and the second
34 cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. Only the
35 GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
36
37Optional Properties:
38
39 - lines-initial-states: Bitmask that specifies the initial state of each
40 line. When a bit is set to zero, the corresponding line will be initialized to
41 the input (pulled-up) state. When the bit is set to one, the line will be
42 initialized the the low-level output state. If the property is not specified
43 all lines will be initialized to the input state.
44
45 The I/O expander can detect input state changes, and thus optionally act as
46 an interrupt controller. When the expander interrupt line is connected all the
47 following properties must be set. For more information please see the
48 interrupt controller device tree bindings documentation available at
49 Documentation/devicetree/bindings/interrupt-controller/interrupts.txt.
50
51 - interrupt-controller: Identifies the node as an interrupt controller.
52 - #interrupt-cells: Number of cells to encode an interrupt source, shall be 2.
53 - interrupt-parent: phandle of the parent interrupt controller.
54 - interrupts: Interrupt specifier for the controllers interrupt.
55
56
57Please refer to gpio.txt in this directory for details of the common GPIO
58bindings used by client devices.
59
60Example: PCF8575 I/O expander node
61
62 pcf8575: gpio@20 {
63 compatible = "nxp,pcf8575";
64 reg = <0x20>;
65 interrupt-parent = <&irqpin2>;
66 interrupts = <3 0>;
67 gpio-controller;
68 #gpio-cells = <2>;
69 interrupt-controller;
70 #interrupt-cells = <2>;
71 };
diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt
index 6cec6ff20d2e..0c85bb6e3a80 100644
--- a/Documentation/devicetree/bindings/gpio/gpio.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio.txt
@@ -87,8 +87,10 @@ controllers. The gpio-ranges property described below represents this, and
87contains information structures as follows: 87contains information structures as follows:
88 88
89 gpio-range-list ::= <single-gpio-range> [gpio-range-list] 89 gpio-range-list ::= <single-gpio-range> [gpio-range-list]
90 single-gpio-range ::= 90 single-gpio-range ::= <numeric-gpio-range> | <named-gpio-range>
91 numeric-gpio-range ::=
91 <pinctrl-phandle> <gpio-base> <pinctrl-base> <count> 92 <pinctrl-phandle> <gpio-base> <pinctrl-base> <count>
93 named-gpio-range ::= <pinctrl-phandle> <gpio-base> '<0 0>'
92 gpio-phandle : phandle to pin controller node. 94 gpio-phandle : phandle to pin controller node.
93 gpio-base : Base GPIO ID in the GPIO controller 95 gpio-base : Base GPIO ID in the GPIO controller
94 pinctrl-base : Base pinctrl pin ID in the pin controller 96 pinctrl-base : Base pinctrl pin ID in the pin controller
@@ -97,6 +99,19 @@ contains information structures as follows:
97The "pin controller node" mentioned above must conform to the bindings 99The "pin controller node" mentioned above must conform to the bindings
98described in ../pinctrl/pinctrl-bindings.txt. 100described in ../pinctrl/pinctrl-bindings.txt.
99 101
102In case named gpio ranges are used (ranges with both <pinctrl-base> and
103<count> set to 0), the property gpio-ranges-group-names contains one string
104for every single-gpio-range in gpio-ranges:
105 gpiorange-names-list ::= <gpiorange-name> [gpiorange-names-list]
106 gpiorange-name : Name of the pingroup associated to the GPIO range in
107 the respective pin controller.
108
109Elements of gpiorange-names-list corresponding to numeric ranges contain
110the empty string. Elements of gpiorange-names-list corresponding to named
111ranges contain the name of a pin group defined in the respective pin
112controller. The number of pins/GPIOs in the range is the number of pins in
113that pin group.
114
100Previous versions of this binding required all pin controller nodes that 115Previous versions of this binding required all pin controller nodes that
101were referenced by any gpio-ranges property to contain a property named 116were referenced by any gpio-ranges property to contain a property named
102#gpio-range-cells with value <3>. This requirement is now deprecated. 117#gpio-range-cells with value <3>. This requirement is now deprecated.
@@ -104,7 +119,7 @@ However, that property may still exist in older device trees for
104compatibility reasons, and would still be required even in new device 119compatibility reasons, and would still be required even in new device
105trees that need to be compatible with older software. 120trees that need to be compatible with older software.
106 121
107Example: 122Example 1:
108 123
109 qe_pio_e: gpio-controller@1460 { 124 qe_pio_e: gpio-controller@1460 {
110 #gpio-cells = <2>; 125 #gpio-cells = <2>;
@@ -117,3 +132,24 @@ Example:
117Here, a single GPIO controller has GPIOs 0..9 routed to pin controller 132Here, a single GPIO controller has GPIOs 0..9 routed to pin controller
118pinctrl1's pins 20..29, and GPIOs 10..19 routed to pin controller pinctrl2's 133pinctrl1's pins 20..29, and GPIOs 10..19 routed to pin controller pinctrl2's
119pins 50..59. 134pins 50..59.
135
136Example 2:
137
138 gpio_pio_i: gpio-controller@14B0 {
139 #gpio-cells = <2>;
140 compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank";
141 reg = <0x1480 0x18>;
142 gpio-controller;
143 gpio-ranges = <&pinctrl1 0 20 10>,
144 <&pinctrl2 10 0 0>,
145 <&pinctrl1 15 0 10>,
146 <&pinctrl2 25 0 0>;
147 gpio-ranges-group-names = "",
148 "foo",
149 "",
150 "bar";
151 };
152
153Here, three GPIO ranges are defined wrt. two pin controllers. pinctrl1 GPIO
154ranges are defined using pin numbers whereas the GPIO ranges wrt. pinctrl2
155are named "foo" and "bar".
diff --git a/Documentation/devicetree/bindings/hwmon/lm90.txt b/Documentation/devicetree/bindings/hwmon/lm90.txt
new file mode 100644
index 000000000000..e8632486b9ef
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/lm90.txt
@@ -0,0 +1,44 @@
1* LM90 series thermometer.
2
3Required node properties:
4- compatible: manufacturer and chip name, one of
5 "adi,adm1032"
6 "adi,adt7461"
7 "adi,adt7461a"
8 "gmt,g781"
9 "national,lm90"
10 "national,lm86"
11 "national,lm89"
12 "national,lm99"
13 "dallas,max6646"
14 "dallas,max6647"
15 "dallas,max6649"
16 "dallas,max6657"
17 "dallas,max6658"
18 "dallas,max6659"
19 "dallas,max6680"
20 "dallas,max6681"
21 "dallas,max6695"
22 "dallas,max6696"
23 "onnn,nct1008"
24 "winbond,w83l771"
25 "nxp,sa56004"
26
27- reg: I2C bus address of the device
28
29- vcc-supply: vcc regulator for the supply voltage.
30
31Optional properties:
32- interrupts: Contains a single interrupt specifier which describes the
33 LM90 "-ALERT" pin output.
34 See interrupt-controller/interrupts.txt for the format.
35
36Example LM90 node:
37
38temp-sensor {
39 compatible = "onnn,nct1008";
40 reg = <0x4c>;
41 vcc-supply = <&palmas_ldo6_reg>;
42 interrupt-parent = <&gpio>;
43 interrupts = <TEGRA_GPIO(O, 4) IRQ_TYPE_LEVEL_LOW>;
44}
diff --git a/Documentation/devicetree/bindings/hwrng/omap_rng.txt b/Documentation/devicetree/bindings/hwrng/omap_rng.txt
new file mode 100644
index 000000000000..6a62acd86953
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwrng/omap_rng.txt
@@ -0,0 +1,22 @@
1OMAP SoC HWRNG Module
2
3Required properties:
4
5- compatible : Should contain entries for this and backward compatible
6 RNG versions:
7 - "ti,omap2-rng" for OMAP2.
8 - "ti,omap4-rng" for OMAP4, OMAP5 and AM33XX.
9 Note that these two versions are incompatible.
10- ti,hwmods: Name of the hwmod associated with the RNG module
11- reg : Offset and length of the register set for the module
12- interrupts : the interrupt number for the RNG module.
13 Only used for "ti,omap4-rng".
14
15Example:
16/* AM335x */
17rng: rng@48310000 {
18 compatible = "ti,omap4-rng";
19 ti,hwmods = "rng";
20 reg = <0x48310000 0x2000>;
21 interrupts = <111>;
22};
diff --git a/Documentation/devicetree/bindings/i2c/i2c-bcm-kona.txt b/Documentation/devicetree/bindings/i2c/i2c-bcm-kona.txt
new file mode 100644
index 000000000000..1b87b741fa8e
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-bcm-kona.txt
@@ -0,0 +1,35 @@
1Broadcom Kona Family I2C
2=========================
3
4This I2C controller is used in the following Broadcom SoCs:
5
6 BCM11130
7 BCM11140
8 BCM11351
9 BCM28145
10 BCM28155
11
12Required Properties
13-------------------
14- compatible: "brcm,bcm11351-i2c", "brcm,kona-i2c"
15- reg: Physical base address and length of controller registers
16- interrupts: The interrupt number used by the controller
17- clocks: clock specifier for the kona i2c external clock
18- clock-frequency: The I2C bus frequency in Hz
19- #address-cells: Should be <1>
20- #size-cells: Should be <0>
21
22Refer to clocks/clock-bindings.txt for generic clock consumer
23properties.
24
25Example:
26
27i2c@3e016000 {
28 compatible = "brcm,bcm11351-i2c","brcm,kona-i2c";
29 reg = <0x3e016000 0x80>;
30 interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
31 clocks = <&bsc1_clk>;
32 clock-frequency = <400000>;
33 #address-cells = <1>;
34 #size-cells = <0>;
35};
diff --git a/Documentation/devicetree/bindings/i2c/i2c-exynos5.txt b/Documentation/devicetree/bindings/i2c/i2c-exynos5.txt
new file mode 100644
index 000000000000..056732cfdcee
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-exynos5.txt
@@ -0,0 +1,44 @@
1* Samsung's High Speed I2C controller
2
3The Samsung's High Speed I2C controller is used to interface with I2C devices
4at various speeds ranging from 100khz to 3.4Mhz.
5
6Required properties:
7 - compatible: value should be.
8 -> "samsung,exynos5-hsi2c", for i2c compatible with exynos5 hsi2c.
9 - reg: physical base address of the controller and length of memory mapped
10 region.
11 - interrupts: interrupt number to the cpu.
12 - #address-cells: always 1 (for i2c addresses)
13 - #size-cells: always 0
14
15 - Pinctrl:
16 - pinctrl-0: Pin control group to be used for this controller.
17 - pinctrl-names: Should contain only one value - "default".
18
19Optional properties:
20 - clock-frequency: Desired operating frequency in Hz of the bus.
21 -> If not specified, the bus operates in fast-speed mode at
22 at 100khz.
23 -> If specified, the bus operates in high-speed mode only if the
24 clock-frequency is >= 1Mhz.
25
26Example:
27
28hsi2c@12ca0000 {
29 compatible = "samsung,exynos5-hsi2c";
30 reg = <0x12ca0000 0x100>;
31 interrupts = <56>;
32 clock-frequency = <100000>;
33
34 pinctrl-0 = <&i2c4_bus>;
35 pinctrl-names = "default";
36
37 #address-cells = <1>;
38 #size-cells = <0>;
39
40 s2mps11_pmic@66 {
41 compatible = "samsung,s2mps11-pmic";
42 reg = <0x66>;
43 };
44};
diff --git a/Documentation/devicetree/bindings/i2c/i2c-rcar.txt b/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
new file mode 100644
index 000000000000..897cfcd5ce92
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
@@ -0,0 +1,23 @@
1I2C for R-Car platforms
2
3Required properties:
4- compatible: Must be one of
5 "renesas,i2c-rcar"
6 "renesas,i2c-r8a7778"
7 "renesas,i2c-r8a7779"
8 "renesas,i2c-r8a7790"
9- reg: physical base address of the controller and length of memory mapped
10 region.
11- interrupts: interrupt specifier.
12
13Optional properties:
14- clock-frequency: desired I2C bus clock frequency in Hz. The absence of this
15 propoerty indicates the default frequency 100 kHz.
16
17Examples :
18
19i2c0: i2c@e6500000 {
20 compatible = "renesas,i2c-rcar-h2";
21 reg = <0 0xe6500000 0 0x428>;
22 interrupts = <0 174 0x4>;
23};
diff --git a/Documentation/devicetree/bindings/i2c/i2c-st.txt b/Documentation/devicetree/bindings/i2c/i2c-st.txt
new file mode 100644
index 000000000000..437e0db3823c
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-st.txt
@@ -0,0 +1,41 @@
1ST SSC binding, for I2C mode operation
2
3Required properties :
4- compatible : Must be "st,comms-ssc-i2c" or "st,comms-ssc4-i2c"
5- reg : Offset and length of the register set for the device
6- interrupts : the interrupt specifier
7- clock-names: Must contain "ssc".
8- clocks: Must contain an entry for each name in clock-names. See the common
9 clock bindings.
10- A pinctrl state named "default" must be defined to set pins in mode of
11 operation for I2C transfer.
12
13Optional properties :
14- clock-frequency : Desired I2C bus clock frequency in Hz. If not specified,
15 the default 100 kHz frequency will be used. As only Normal and Fast modes
16 are supported, possible values are 100000 and 400000.
17- st,i2c-min-scl-pulse-width-us : The minimum valid SCL pulse width that is
18 allowed through the deglitch circuit. In units of us.
19- st,i2c-min-sda-pulse-width-us : The minimum valid SDA pulse width that is
20 allowed through the deglitch circuit. In units of us.
21- A pinctrl state named "idle" could be defined to set pins in idle state
22 when I2C instance is not performing a transfer.
23- A pinctrl state named "sleep" could be defined to set pins in sleep state
24 when driver enters in suspend.
25
26
27
28Example :
29
30i2c0: i2c@fed40000 {
31 compatible = "st,comms-ssc4-i2c";
32 reg = <0xfed40000 0x110>;
33 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
34 clocks = <&CLK_S_ICN_REG_0>;
35 clock-names = "ssc";
36 clock-frequency = <400000>;
37 pinctrl-names = "default";
38 pinctrl-0 = <&pinctrl_i2c0_default>;
39 st,i2c-min-scl-pulse-width-us = <0>;
40 st,i2c-min-sda-pulse-width-us = <5>;
41};
diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index ad6a73852f08..b1cb3415e6f1 100644
--- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -15,6 +15,7 @@ adi,adt7461 +/-1C TDM Extended Temp Range I.C
15adt7461 +/-1C TDM Extended Temp Range I.C 15adt7461 +/-1C TDM Extended Temp Range I.C
16at,24c08 i2c serial eeprom (24cxx) 16at,24c08 i2c serial eeprom (24cxx)
17atmel,24c02 i2c serial eeprom (24cxx) 17atmel,24c02 i2c serial eeprom (24cxx)
18atmel,at97sc3204t i2c trusted platform module (TPM)
18catalyst,24c32 i2c serial eeprom 19catalyst,24c32 i2c serial eeprom
19dallas,ds1307 64 x 8, Serial, I2C Real-Time Clock 20dallas,ds1307 64 x 8, Serial, I2C Real-Time Clock
20dallas,ds1338 I2C RTC with 56-Byte NV RAM 21dallas,ds1338 I2C RTC with 56-Byte NV RAM
@@ -35,6 +36,7 @@ fsl,mc13892 MC13892: Power Management Integrated Circuit (PMIC) for i.MX35/51
35fsl,mma8450 MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer 36fsl,mma8450 MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer
36fsl,mpr121 MPR121: Proximity Capacitive Touch Sensor Controller 37fsl,mpr121 MPR121: Proximity Capacitive Touch Sensor Controller
37fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec 38fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec
39gmt,g751 G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface
38infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz) 40infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
39infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz) 41infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz)
40maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator 42maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator
@@ -44,6 +46,7 @@ mc,rv3029c2 Real Time Clock Module with I2C-Bus
44national,lm75 I2C TEMP SENSOR 46national,lm75 I2C TEMP SENSOR
45national,lm80 Serial Interface ACPI-Compatible Microprocessor System Hardware Monitor 47national,lm80 Serial Interface ACPI-Compatible Microprocessor System Hardware Monitor
46national,lm92 ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator with Two-Wire Interface 48national,lm92 ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator with Two-Wire Interface
49nuvoton,npct501 i2c trusted platform module (TPM)
47nxp,pca9556 Octal SMBus and I2C registered interface 50nxp,pca9556 Octal SMBus and I2C registered interface
48nxp,pca9557 8-bit I2C-bus and SMBus I/O port with reset 51nxp,pca9557 8-bit I2C-bus and SMBus I/O port with reset
49nxp,pcf8563 Real-time clock/calendar 52nxp,pcf8563 Real-time clock/calendar
@@ -61,3 +64,4 @@ taos,tsl2550 Ambient Light Sensor with SMBUS/Two Wire Serial Interface
61ti,tsc2003 I2C Touch-Screen Controller 64ti,tsc2003 I2C Touch-Screen Controller
62ti,tmp102 Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface 65ti,tmp102 Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface
63ti,tmp275 Digital Temperature Sensor 66ti,tmp275 Digital Temperature Sensor
67winbond,wpct301 i2c trusted platform module (TPM)
diff --git a/Documentation/devicetree/bindings/iio/light/cm36651.txt b/Documentation/devicetree/bindings/iio/light/cm36651.txt
new file mode 100644
index 000000000000..c03e19db4550
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/cm36651.txt
@@ -0,0 +1,26 @@
1* Capella CM36651 I2C Proximity and Color Light sensor
2
3Required properties:
4- compatible: must be "capella,cm36651"
5- reg: the I2C address of the device
6- interrupts: interrupt-specifier for the sole interrupt
7 generated by the device
8- vled-supply: regulator for the IR LED. IR_LED is a part
9 of the cm36651 for proximity detection.
10 As covered in ../../regulator/regulator.txt
11
12Example:
13
14 i2c_cm36651: i2c-gpio {
15 /* ... */
16
17 cm36651@18 {
18 compatible = "capella,cm36651";
19 reg = <0x18>;
20 interrupt-parent = <&gpx0>;
21 interrupts = <2 0>;
22 vled-supply = <&ps_als_reg>;
23 };
24
25 /* ... */
26 };
diff --git a/Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt b/Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt
new file mode 100644
index 000000000000..9231c82317ad
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt
@@ -0,0 +1,21 @@
1* Sharp GP2AP020A00F I2C Proximity/ALS sensor
2
3The proximity detector sensor requires power supply
4for its built-in led. It is also defined by this binding.
5
6Required properties:
7
8 - compatible : should be "sharp,gp2ap020a00f"
9 - reg : the I2C slave address of the light sensor
10 - interrupts : interrupt specifier for the sole interrupt generated
11 by the device
12 - vled-supply : VLED power supply, as covered in ../regulator/regulator.txt
13
14Example:
15
16gp2ap020a00f@39 {
17 compatible = "sharp,gp2ap020a00f";
18 reg = <0x39>;
19 interrupts = <2 0>;
20 vled-supply = <...>;
21};
diff --git a/Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt b/Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
index 491c97b78384..878549ba814d 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
@@ -6,7 +6,7 @@ Required properties:
6 ti,wires: Wires refer to application modes i.e. 4/5/8 wire touchscreen 6 ti,wires: Wires refer to application modes i.e. 4/5/8 wire touchscreen
7 support on the platform. 7 support on the platform.
8 ti,x-plate-resistance: X plate resistance 8 ti,x-plate-resistance: X plate resistance
9 ti,coordiante-readouts: The sequencer supports a total of 16 9 ti,coordinate-readouts: The sequencer supports a total of 16
10 programmable steps each step is used to 10 programmable steps each step is used to
11 read a single coordinate. A single 11 read a single coordinate. A single
12 readout is enough but multiple reads can 12 readout is enough but multiple reads can
diff --git a/Documentation/devicetree/bindings/interrupt-controller/allwinner,sun4i-ic.txt b/Documentation/devicetree/bindings/interrupt-controller/allwinner,sun4i-ic.txt
index 57edb30dbbca..3d3b2b91e333 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/allwinner,sun4i-ic.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/allwinner,sun4i-ic.txt
@@ -8,9 +8,6 @@ Required properties:
8- #interrupt-cells : Specifies the number of cells needed to encode an 8- #interrupt-cells : Specifies the number of cells needed to encode an
9 interrupt source. The value shall be 1. 9 interrupt source. The value shall be 1.
10 10
11For the valid interrupt sources for your SoC, see the documentation in
12sunxi/<soc>.txt
13
14Example: 11Example:
15 12
16intc: interrupt-controller { 13intc: interrupt-controller {
diff --git a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
index 72a06c0ab1db..1486497a24c1 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
@@ -4,16 +4,33 @@ Specifying interrupt information for devices
41) Interrupt client nodes 41) Interrupt client nodes
5------------------------- 5-------------------------
6 6
7Nodes that describe devices which generate interrupts must contain an 7Nodes that describe devices which generate interrupts must contain an either an
8"interrupts" property. This property must contain a list of interrupt 8"interrupts" property or an "interrupts-extended" property. These properties
9specifiers, one per output interrupt. The format of the interrupt specifier is 9contain a list of interrupt specifiers, one per output interrupt. The format of
10determined by the interrupt controller to which the interrupts are routed; see 10the interrupt specifier is determined by the interrupt controller to which the
11section 2 below for details. 11interrupts are routed; see section 2 below for details.
12
13 Example:
14 interrupt-parent = <&intc1>;
15 interrupts = <5 0>, <6 0>;
12 16
13The "interrupt-parent" property is used to specify the controller to which 17The "interrupt-parent" property is used to specify the controller to which
14interrupts are routed and contains a single phandle referring to the interrupt 18interrupts are routed and contains a single phandle referring to the interrupt
15controller node. This property is inherited, so it may be specified in an 19controller node. This property is inherited, so it may be specified in an
16interrupt client node or in any of its parent nodes. 20interrupt client node or in any of its parent nodes. Interrupts listed in the
21"interrupts" property are always in reference to the node's interrupt parent.
22
23The "interrupts-extended" property is a special form for use when a node needs
24to reference multiple interrupt parents. Each entry in this property contains
25both the parent phandle and the interrupt specifier. "interrupts-extended"
26should only be used when a device has multiple interrupt parents.
27
28 Example:
29 interrupts-extended = <&intc1 5 1>, <&intc2 1 0>;
30
31A device node may contain either "interrupts" or "interrupts-extended", but not
32both. If both properties are present, then the operating system should log an
33error and use only the data in "interrupts".
17 34
182) Interrupt controller nodes 352) Interrupt controller nodes
19----------------------------- 36-----------------------------
diff --git a/Documentation/devicetree/bindings/interrupt-controller/sunxi/sun4i-a10.txt b/Documentation/devicetree/bindings/interrupt-controller/sunxi/sun4i-a10.txt
deleted file mode 100644
index 76b98c834499..000000000000
--- a/Documentation/devicetree/bindings/interrupt-controller/sunxi/sun4i-a10.txt
+++ /dev/null
@@ -1,89 +0,0 @@
1Allwinner A10 (sun4i) interrupt sources
2---------------------------------------
3
4The interrupt sources available for the Allwinner A10 SoC are the
5following one:
6
70: ENMI
81: UART0
92: UART1
103: UART2
114: UART3
125: IR0
136: IR1
147: I2C0
158: I2C1
169: I2C2
1710: SPI0
1811: SPI1
1912: SPI2
2013: SPDIF
2114: AC97
2215: TS
2316: I2S
2417: UART4
2518: UART5
2619: UART6
2720: UART7
2821: KEYPAD
2922: TIMER0
3023: TIMER1
3124: TIMER2
3225: TIMER3
3326: CAN
3427: DMA
3528: PIO
3629: TOUCH_PANEL
3730: AUDIO_CODEC
3831: LRADC
3932: MMC0
4033: MMC1
4134: MMC2
4235: MMC3
4336: MEMSTICK
4437: NAND
4538: USB0
4639: USB1
4740: USB2
4841: SCR
4942: CSI0
5043: CSI1
5144: LCDCTRL0
5245: LCDCTRL1
5346: MP
5447: DEFEBE0
5548: DEFEBE1
5649: PMU
5750: SPI3
5851: TZASC
5952: PATA
6053: VE
6154: SS
6255: EMAC
6356: SATA
6457: GPS
6558: HDMI
6659: TVE
6760: ACE
6861: TVD
6962: PS2_0
7063: PS2_1
7164: USB3
7265: USB4
7366: PLE_PFM
7467: TIMER4
7568: TIMER5
7669: GPU_GP
7770: GPU_GPMMU
7871: GPU_PP0
7972: GPU_PPMMU0
8073: GPU_PMU
8174: GPU_RSV0
8275: GPU_RSV1
8376: GPU_RSV2
8477: GPU_RSV3
8578: GPU_RSV4
8679: GPU_RSV5
8780: GPU_RSV6
8882: SYNC_TIMER0
8983: SYNC_TIMER1
diff --git a/Documentation/devicetree/bindings/interrupt-controller/sunxi/sun5i-a13.txt b/Documentation/devicetree/bindings/interrupt-controller/sunxi/sun5i-a13.txt
deleted file mode 100644
index 2ec3b5ce1a0b..000000000000
--- a/Documentation/devicetree/bindings/interrupt-controller/sunxi/sun5i-a13.txt
+++ /dev/null
@@ -1,55 +0,0 @@
1Allwinner A13 (sun5i) interrupt sources
2---------------------------------------
3
4The interrupt sources available for the Allwinner A13 SoC are the
5following one:
6
70: ENMI
82: UART1
94: UART3
105: IR
117: I2C0
128: I2C1
139: I2C2
1410: SPI0
1511: SPI1
1612: SPI2
1722: TIMER0
1823: TIMER1
1924: TIMER2
2025: TIMER3
2127: DMA
2228: PIO
2329: TOUCH_PANEL
2430: AUDIO_CODEC
2531: LRADC
2632: MMC0
2733: MMC1
2834: MMC2
2937: NAND
3038: USB OTG
3139: USB EHCI
3240: USB OHCI
3342: CSI
3444: LCDCTRL
3547: DEFEBE
3649: PMU
3753: VE
3854: SS
3966: PLE_PFM
4067: TIMER4
4168: TIMER5
4269: GPU_GP
4370: GPU_GPMMU
4471: GPU_PP0
4572: GPU_PPMMU0
4673: GPU_PMU
4774: GPU_RSV0
4875: GPU_RSV1
4976: GPU_RSV2
5077: GPU_RSV3
5178: GPU_RSV4
5279: GPU_RSV5
5380: GPU_RSV6
5482: SYNC_TIMER0
5583: SYNC_TIMER1
diff --git a/Documentation/devicetree/bindings/leds/leds-lp55xx.txt b/Documentation/devicetree/bindings/leds/leds-lp55xx.txt
index a61727f9a6d1..c55b8c016a9e 100644
--- a/Documentation/devicetree/bindings/leds/leds-lp55xx.txt
+++ b/Documentation/devicetree/bindings/leds/leds-lp55xx.txt
@@ -10,6 +10,7 @@ Each child has own specific current settings
10- max-cur: Maximun current at each led channel. 10- max-cur: Maximun current at each led channel.
11 11
12Optional properties: 12Optional properties:
13- enable-gpio: GPIO attached to the chip's enable pin
13- label: Used for naming LEDs 14- label: Used for naming LEDs
14- pwr-sel: LP8501 specific property. Power selection for output channels. 15- pwr-sel: LP8501 specific property. Power selection for output channels.
15 0: D1~9 are connected to VDD 16 0: D1~9 are connected to VDD
@@ -17,12 +18,15 @@ Optional properties:
17 2: D1~6 with VOUT, D7~9 with VDD 18 2: D1~6 with VOUT, D7~9 with VDD
18 3: D1~9 are connected to VOUT 19 3: D1~9 are connected to VOUT
19 20
20Alternatively, each child can have specific channel name 21Alternatively, each child can have a specific channel name and trigger:
21- chan-name: Name of each channel name 22- chan-name (optional): name of channel
23- linux,default-trigger (optional): see
24 Documentation/devicetree/bindings/leds/common.txt
22 25
23example 1) LP5521 26example 1) LP5521
243 LED channels, external clock used. Channel names are 'lp5521_pri:channel0', 273 LED channels, external clock used. Channel names are 'lp5521_pri:channel0',
25'lp5521_pri:channel1' and 'lp5521_pri:channel2' 28'lp5521_pri:channel1' and 'lp5521_pri:channel2', with a heartbeat trigger
29on channel 0.
26 30
27lp5521@32 { 31lp5521@32 {
28 compatible = "national,lp5521"; 32 compatible = "national,lp5521";
@@ -33,6 +37,7 @@ lp5521@32 {
33 chan0 { 37 chan0 {
34 led-cur = /bits/ 8 <0x2f>; 38 led-cur = /bits/ 8 <0x2f>;
35 max-cur = /bits/ 8 <0x5f>; 39 max-cur = /bits/ 8 <0x5f>;
40 linux,default-trigger = "heartbeat";
36 }; 41 };
37 42
38 chan1 { 43 chan1 {
diff --git a/Documentation/devicetree/bindings/media/st-rc.txt b/Documentation/devicetree/bindings/media/st-rc.txt
new file mode 100644
index 000000000000..05c432d08bca
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/st-rc.txt
@@ -0,0 +1,29 @@
1Device-Tree bindings for ST IRB IP
2
3Required properties:
4 - compatible: Should contain "st,comms-irb".
5 - reg: Base physical address of the controller and length of memory
6 mapped region.
7 - interrupts: interrupt-specifier for the sole interrupt generated by
8 the device. The interrupt specifier format depends on the interrupt
9 controller parent.
10 - rx-mode: can be "infrared" or "uhf". This property specifies the L1
11 protocol used for receiving remote control signals. rx-mode should
12 be present iff the rx pins are wired up.
13 - tx-mode: should be "infrared". This property specifies the L1
14 protocol used for transmitting remote control signals. tx-mode should
15 be present iff the tx pins are wired up.
16
17Optional properties:
18 - pinctrl-names, pinctrl-0: the pincontrol settings to configure muxing
19 properly for IRB pins.
20 - clocks : phandle with clock-specifier pair for IRB.
21
22Example node:
23
24 rc: rc@fe518000 {
25 compatible = "st,comms-irb";
26 reg = <0xfe518000 0x234>;
27 interrupts = <0 203 0>;
28 rx-mode = "infrared";
29 };
diff --git a/Documentation/devicetree/bindings/memory.txt b/Documentation/devicetree/bindings/memory.txt
deleted file mode 100644
index eb2469365593..000000000000
--- a/Documentation/devicetree/bindings/memory.txt
+++ /dev/null
@@ -1,168 +0,0 @@
1*** Memory binding ***
2
3The /memory node provides basic information about the address and size
4of the physical memory. This node is usually filled or updated by the
5bootloader, depending on the actual memory configuration of the given
6hardware.
7
8The memory layout is described by the following node:
9
10/ {
11 #address-cells = <(n)>;
12 #size-cells = <(m)>;
13 memory {
14 device_type = "memory";
15 reg = <(baseaddr1) (size1)
16 (baseaddr2) (size2)
17 ...
18 (baseaddrN) (sizeN)>;
19 };
20 ...
21};
22
23A memory node follows the typical device tree rules for "reg" property:
24n: number of cells used to store base address value
25m: number of cells used to store size value
26baseaddrX: defines a base address of the defined memory bank
27sizeX: the size of the defined memory bank
28
29
30More than one memory bank can be defined.
31
32
33*** Reserved memory regions ***
34
35In /memory/reserved-memory node one can create child nodes describing
36particular reserved (excluded from normal use) memory regions. Such
37memory regions are usually designed for the special usage by various
38device drivers. A good example are contiguous memory allocations or
39memory sharing with other operating system on the same hardware board.
40Those special memory regions might depend on the board configuration and
41devices used on the target system.
42
43Parameters for each memory region can be encoded into the device tree
44with the following convention:
45
46[(label):] (name) {
47 compatible = "linux,contiguous-memory-region", "reserved-memory-region";
48 reg = <(address) (size)>;
49 (linux,default-contiguous-region);
50};
51
52compatible: one or more of:
53 - "linux,contiguous-memory-region" - enables binding of this
54 region to Contiguous Memory Allocator (special region for
55 contiguous memory allocations, shared with movable system
56 memory, Linux kernel-specific).
57 - "reserved-memory-region" - compatibility is defined, given
58 region is assigned for exclusive usage for by the respective
59 devices.
60
61reg: standard property defining the base address and size of
62 the memory region
63
64linux,default-contiguous-region: property indicating that the region
65 is the default region for all contiguous memory
66 allocations, Linux specific (optional)
67
68It is optional to specify the base address, so if one wants to use
69autoconfiguration of the base address, '0' can be specified as a base
70address in the 'reg' property.
71
72The /memory/reserved-memory node must contain the same #address-cells
73and #size-cells value as the root node.
74
75
76*** Device node's properties ***
77
78Once regions in the /memory/reserved-memory node have been defined, they
79may be referenced by other device nodes. Bindings that wish to reference
80memory regions should explicitly document their use of the following
81property:
82
83memory-region = <&phandle_to_defined_region>;
84
85This property indicates that the device driver should use the memory
86region pointed by the given phandle.
87
88
89*** Example ***
90
91This example defines a memory consisting of 4 memory banks. 3 contiguous
92regions are defined for Linux kernel, one default of all device drivers
93(named contig_mem, placed at 0x72000000, 64MiB), one dedicated to the
94framebuffer device (labelled display_mem, placed at 0x78000000, 8MiB)
95and one for multimedia processing (labelled multimedia_mem, placed at
960x77000000, 64MiB). 'display_mem' region is then assigned to fb@12300000
97device for DMA memory allocations (Linux kernel drivers will use CMA is
98available or dma-exclusive usage otherwise). 'multimedia_mem' is
99assigned to scaler@12500000 and codec@12600000 devices for contiguous
100memory allocations when CMA driver is enabled.
101
102The reason for creating a separate region for framebuffer device is to
103match the framebuffer base address to the one configured by bootloader,
104so once Linux kernel drivers starts no glitches on the displayed boot
105logo appears. Scaller and codec drivers should share the memory
106allocations.
107
108/ {
109 #address-cells = <1>;
110 #size-cells = <1>;
111
112 /* ... */
113
114 memory {
115 reg = <0x40000000 0x10000000
116 0x50000000 0x10000000
117 0x60000000 0x10000000
118 0x70000000 0x10000000>;
119
120 reserved-memory {
121 #address-cells = <1>;
122 #size-cells = <1>;
123
124 /*
125 * global autoconfigured region for contiguous allocations
126 * (used only with Contiguous Memory Allocator)
127 */
128 contig_region@0 {
129 compatible = "linux,contiguous-memory-region";
130 reg = <0x0 0x4000000>;
131 linux,default-contiguous-region;
132 };
133
134 /*
135 * special region for framebuffer
136 */
137 display_region: region@78000000 {
138 compatible = "linux,contiguous-memory-region", "reserved-memory-region";
139 reg = <0x78000000 0x800000>;
140 };
141
142 /*
143 * special region for multimedia processing devices
144 */
145 multimedia_region: region@77000000 {
146 compatible = "linux,contiguous-memory-region";
147 reg = <0x77000000 0x4000000>;
148 };
149 };
150 };
151
152 /* ... */
153
154 fb0: fb@12300000 {
155 status = "okay";
156 memory-region = <&display_region>;
157 };
158
159 scaler: scaler@12500000 {
160 status = "okay";
161 memory-region = <&multimedia_region>;
162 };
163
164 codec: codec@12600000 {
165 status = "okay";
166 memory-region = <&multimedia_region>;
167 };
168};
diff --git a/Documentation/devicetree/bindings/mfd/as3722.txt b/Documentation/devicetree/bindings/mfd/as3722.txt
new file mode 100644
index 000000000000..fc2191ecfd6b
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/as3722.txt
@@ -0,0 +1,194 @@
1* ams AS3722 Power management IC.
2
3Required properties:
4-------------------
5- compatible: Must be "ams,as3722".
6- reg: I2C device address.
7- interrupt-controller: AS3722 has internal interrupt controller which takes the
8 interrupt request from internal sub-blocks like RTC, regulators, GPIOs as well
9 as external input.
10- #interrupt-cells: Should be set to 2 for IRQ number and flags.
11 The first cell is the IRQ number. IRQ numbers for different interrupt source
12 of AS3722 are defined at dt-bindings/mfd/as3722.h
13 The second cell is the flags, encoded as the trigger masks from binding document
14 interrupts.txt, using dt-bindings/irq.
15
16Optional submodule and their properties:
17=======================================
18
19Pinmux and GPIO:
20===============
21Device has 8 GPIO pins which can be configured as GPIO as well as the special IO
22functions.
23
24Please refer to pinctrl-bindings.txt in this directory for details of the
25common pinctrl bindings used by client devices, including the meaning of the
26phrase "pin configuration node".
27
28Following are properties which is needed if GPIO and pinmux functionality
29is required:
30 Required properties:
31 -------------------
32 - gpio-controller: Marks the device node as a GPIO controller.
33 - #gpio-cells: Number of GPIO cells. Refer to binding document
34 gpio/gpio.txt
35
36 Optional properties:
37 --------------------
38 Following properties are require if pin control setting is required
39 at boot.
40 - pinctrl-names: A pinctrl state named "default" be defined, using the
41 bindings in pinctrl/pinctrl-binding.txt.
42 - pinctrl[0...n]: Properties to contain the phandle that refer to
43 different nodes of pin control settings. These nodes represents
44 the pin control setting of state 0 to state n. Each of these
45 nodes contains different subnodes to represents some desired
46 configuration for a list of pins. This configuration can
47 include the mux function to select on those pin(s), and
48 various pin configuration parameters, such as pull-up,
49 open drain.
50
51 Each subnode have following properties:
52 Required properties:
53 - pins: List of pins. Valid values of pins properties are:
54 gpio0, gpio1, gpio2, gpio3, gpio4, gpio5,
55 gpio6, gpio7
56
57 Optional properties:
58 function, bias-disable, bias-pull-up, bias-pull-down,
59 bias-high-impedance, drive-open-drain.
60
61 Valid values for function properties are:
62 gpio, interrupt-out, gpio-in-interrupt,
63 vsup-vbat-low-undebounce-out,
64 vsup-vbat-low-debounce-out,
65 voltage-in-standby, oc-pg-sd0, oc-pg-sd6,
66 powergood-out, pwm-in, pwm-out, clk32k-out,
67 watchdog-in, soft-reset-in
68
69Regulators:
70===========
71Device has multiple DCDC and LDOs. The node "regulators" is require if regulator
72functionality is needed.
73
74Following are properties of regulator subnode.
75
76 Optional properties:
77 -------------------
78 The input supply of regulators are the optional properties on the
79 regulator node. The input supply of these regulators are provided
80 through following properties:
81 vsup-sd2-supply: Input supply for SD2.
82 vsup-sd3-supply: Input supply for SD3.
83 vsup-sd4-supply: Input supply for SD4.
84 vsup-sd5-supply: Input supply for SD5.
85 vin-ldo0-supply: Input supply for LDO0.
86 vin-ldo1-6-supply: Input supply for LDO1 and LDO6.
87 vin-ldo2-5-7-supply: Input supply for LDO2, LDO5 and LDO7.
88 vin-ldo3-4-supply: Input supply for LDO3 and LDO4.
89 vin-ldo9-10-supply: Input supply for LDO9 and LDO10.
90 vin-ldo11-supply: Input supply for LDO11.
91
92 Optional sub nodes for regulators:
93 ---------------------------------
94 The subnodes name is the name of regulator and it must be one of:
95 sd[0-6], ldo[0-7], ldo[9-11]
96
97 Each sub-node should contain the constraints and initialization
98 information for that regulator. See regulator.txt for a description
99 of standard properties for these sub-nodes.
100 Additional optional custom properties are listed below.
101 ams,ext-control: External control of the rail. The option of
102 this properties will tell which external input is
103 controlling this rail. Valid values are 0, 1, 2 ad 3.
104 0: There is no external control of this rail.
105 1: Rail is controlled by ENABLE1 input pin.
106 2: Rail is controlled by ENABLE2 input pin.
107 3: Rail is controlled by ENABLE3 input pin.
108 Missing this property on DT will be assume as no
109 external control. The external control pin macros
110 are defined @dt-bindings/mfd/as3722.h
111
112 ams,enable-tracking: Enable tracking with SD1, only supported
113 by LDO3.
114
115Example:
116--------
117#include <dt-bindings/mfd/as3722.h>
118...
119ams3722 {
120 compatible = "ams,as3722";
121 reg = <0x48>;
122
123 interrupt-parent = <&intc>;
124 interrupt-controller;
125 #interrupt-cells = <2>;
126
127 gpio-controller;
128 #gpio-cells = <2>;
129
130 pinctrl-names = "default";
131 pinctrl-0 = <&as3722_default>;
132
133 as3722_default: pinmux {
134 gpio0 {
135 pins = "gpio0";
136 function = "gpio";
137 bias-pull-down;
138 };
139
140 gpio1_2_4_7 {
141 pins = "gpio1", "gpio2", "gpio4", "gpio7";
142 function = "gpio";
143 bias-pull-up;
144 };
145
146 gpio5 {
147 pins = "gpio5";
148 function = "clk32k_out";
149 };
150 }
151
152 regulators {
153 vsup-sd2-supply = <...>;
154 ...
155
156 sd0 {
157 regulator-name = "vdd_cpu";
158 regulator-min-microvolt = <700000>;
159 regulator-max-microvolt = <1400000>;
160 regulator-always-on;
161 ams,ext-control = <2>;
162 };
163
164 sd1 {
165 regulator-name = "vdd_core";
166 regulator-min-microvolt = <700000>;
167 regulator-max-microvolt = <1400000>;
168 regulator-always-on;
169 ams,ext-control = <1>;
170 };
171
172 sd2 {
173 regulator-name = "vddio_ddr";
174 regulator-min-microvolt = <1350000>;
175 regulator-max-microvolt = <1350000>;
176 regulator-always-on;
177 };
178
179 sd4 {
180 regulator-name = "avdd-hdmi-pex";
181 regulator-min-microvolt = <1050000>;
182 regulator-max-microvolt = <1050000>;
183 regulator-always-on;
184 };
185
186 sd5 {
187 regulator-name = "vdd-1v8";
188 regulator-min-microvolt = <1800000>;
189 regulator-max-microvolt = <1800000>;
190 regulator-always-on;
191 };
192 ....
193 };
194};
diff --git a/Documentation/devicetree/bindings/mfd/s2mps11.txt b/Documentation/devicetree/bindings/mfd/s2mps11.txt
index c9332c626021..78a840d7510d 100644
--- a/Documentation/devicetree/bindings/mfd/s2mps11.txt
+++ b/Documentation/devicetree/bindings/mfd/s2mps11.txt
@@ -1,10 +1,10 @@
1 1
2* Samsung S2MPS11 Voltage and Current Regulator 2* Samsung S2MPS11 Voltage and Current Regulator
3 3
4The Samsung S2MP211 is a multi-function device which includes voltage and 4The Samsung S2MPS11 is a multi-function device which includes voltage and
5current regulators, RTC, charger controller and other sub-blocks. It is 5current regulators, RTC, charger controller and other sub-blocks. It is
6interfaced to the host controller using a I2C interface. Each sub-block is 6interfaced to the host controller using an I2C interface. Each sub-block is
7addressed by the host system using different I2C slave address. 7addressed by the host system using different I2C slave addresses.
8 8
9Required properties: 9Required properties:
10- compatible: Should be "samsung,s2mps11-pmic". 10- compatible: Should be "samsung,s2mps11-pmic".
@@ -43,7 +43,8 @@ sub-node should be of the format as listed below.
43 43
44 BUCK[2/3/4/6] supports disabling ramp delay on hardware, so explictly 44 BUCK[2/3/4/6] supports disabling ramp delay on hardware, so explictly
45 regulator-ramp-delay = <0> can be used for them to disable ramp delay. 45 regulator-ramp-delay = <0> can be used for them to disable ramp delay.
46 In absence of regulator-ramp-delay property, default ramp delay will be used. 46 In the absence of the regulator-ramp-delay property, the default ramp
47 delay will be used.
47 48
48NOTE: Some BUCKs share the ramp rate setting i.e. same ramp value will be set 49NOTE: Some BUCKs share the ramp rate setting i.e. same ramp value will be set
49for a particular group of BUCKs. So provide same regulator-ramp-delay<value>. 50for a particular group of BUCKs. So provide same regulator-ramp-delay<value>.
@@ -58,10 +59,10 @@ supports. Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
58as per the datasheet of s2mps11. 59as per the datasheet of s2mps11.
59 60
60 - LDOn 61 - LDOn
61 - valid values for n are 1 to 28 62 - valid values for n are 1 to 38
62 - Example: LDO0, LD01, LDO28 63 - Example: LDO0, LD01, LDO28
63 - BUCKn 64 - BUCKn
64 - valid values for n are 1 to 9. 65 - valid values for n are 1 to 10.
65 - Example: BUCK1, BUCK2, BUCK9 66 - Example: BUCK1, BUCK2, BUCK9
66 67
67Example: 68Example:
diff --git a/Documentation/devicetree/bindings/misc/allwinner,sunxi-sid.txt b/Documentation/devicetree/bindings/misc/allwinner,sunxi-sid.txt
new file mode 100644
index 000000000000..68ba37295565
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/allwinner,sunxi-sid.txt
@@ -0,0 +1,17 @@
1Allwinner sunxi-sid
2
3Required properties:
4- compatible: "allwinner,sun4i-sid" or "allwinner,sun7i-a20-sid".
5- reg: Should contain registers location and length
6
7Example for sun4i:
8 sid@01c23800 {
9 compatible = "allwinner,sun4i-sid";
10 reg = <0x01c23800 0x10>
11 };
12
13Example for sun7i:
14 sid@01c23800 {
15 compatible = "allwinner,sun7i-a20-sid";
16 reg = <0x01c23800 0x200>
17 };
diff --git a/Documentation/devicetree/bindings/misc/ti,dac7512.txt b/Documentation/devicetree/bindings/misc/ti,dac7512.txt
new file mode 100644
index 000000000000..1db45939dac9
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/ti,dac7512.txt
@@ -0,0 +1,20 @@
1TI DAC7512 DEVICETREE BINDINGS
2
3Required properties:
4
5 - "compatible" Must be set to "ti,dac7512"
6
7Property rules described in Documentation/devicetree/bindings/spi/spi-bus.txt
8apply. In particular, "reg" and "spi-max-frequency" properties must be given.
9
10
11Example:
12
13 spi_master {
14 dac7512: dac7512@0 {
15 compatible = "ti,dac7512";
16 reg = <0>; /* CS0 */
17 spi-max-frequency = <1000000>;
18 };
19 };
20
diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
index 1dd622546d06..9046ba06c47a 100644
--- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
+++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
@@ -12,6 +12,11 @@ Required properties:
12Optional properties: 12Optional properties:
13- fsl,cd-controller : Indicate to use controller internal card detection 13- fsl,cd-controller : Indicate to use controller internal card detection
14- fsl,wp-controller : Indicate to use controller internal write protection 14- fsl,wp-controller : Indicate to use controller internal write protection
15- fsl,delay-line : Specify the number of delay cells for override mode.
16 This is used to set the clock delay for DLL(Delay Line) on override mode
17 to select a proper data sampling window in case the clock quality is not good
18 due to signal path is too long on the board. Please refer to eSDHC/uSDHC
19 chapter, DLL (Delay Line) section in RM for details.
15 20
16Examples: 21Examples:
17 22
diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
index 066a78b034ca..8f3f13315358 100644
--- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
+++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
@@ -52,6 +52,9 @@ Optional properties:
52 is specified and the ciu clock is specified then we'll try to set the ciu 52 is specified and the ciu clock is specified then we'll try to set the ciu
53 clock to this at probe time. 53 clock to this at probe time.
54 54
55* clock-freq-min-max: Minimum and Maximum clock frequency for card output
56 clock(cclk_out). If it's not specified, max is 200MHZ and min is 400KHz by default.
57
55* num-slots: specifies the number of slots supported by the controller. 58* num-slots: specifies the number of slots supported by the controller.
56 The number of physical slots actually used could be equal or less than the 59 The number of physical slots actually used could be equal or less than the
57 value specified by num-slots. If this property is not specified, the value 60 value specified by num-slots. If this property is not specified, the value
@@ -66,6 +69,10 @@ Optional properties:
66 69
67* supports-highspeed: Enables support for high speed cards (up to 50MHz) 70* supports-highspeed: Enables support for high speed cards (up to 50MHz)
68 71
72* caps2-mmc-hs200-1_8v: Supports mmc HS200 SDR 1.8V mode
73
74* caps2-mmc-hs200-1_2v: Supports mmc HS200 SDR 1.2V mode
75
69* broken-cd: as documented in mmc core bindings. 76* broken-cd: as documented in mmc core bindings.
70 77
71* vmmc-supply: The phandle to the regulator to use for vmmc. If this is 78* vmmc-supply: The phandle to the regulator to use for vmmc. If this is
@@ -93,8 +100,10 @@ board specific portions as listed below.
93 100
94 dwmmc0@12200000 { 101 dwmmc0@12200000 {
95 clock-frequency = <400000000>; 102 clock-frequency = <400000000>;
103 clock-freq-min-max = <400000 200000000>;
96 num-slots = <1>; 104 num-slots = <1>;
97 supports-highspeed; 105 supports-highspeed;
106 caps2-mmc-hs200-1_8v;
98 broken-cd; 107 broken-cd;
99 fifo-depth = <0x80>; 108 fifo-depth = <0x80>;
100 card-detect-delay = <200>; 109 card-detect-delay = <200>;
diff --git a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
index ed271fc255b2..8c8908ab84ba 100644
--- a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
+++ b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
@@ -20,8 +20,29 @@ ti,dual-volt: boolean, supports dual voltage cards
20ti,non-removable: non-removable slot (like eMMC) 20ti,non-removable: non-removable slot (like eMMC)
21ti,needs-special-reset: Requires a special softreset sequence 21ti,needs-special-reset: Requires a special softreset sequence
22ti,needs-special-hs-handling: HSMMC IP needs special setting for handling High Speed 22ti,needs-special-hs-handling: HSMMC IP needs special setting for handling High Speed
23dmas: List of DMA specifiers with the controller specific format
24as described in the generic DMA client binding. A tx and rx
25specifier is required.
26dma-names: List of DMA request names. These strings correspond
271:1 with the DMA specifiers listed in dmas. The string naming is
28to be "rx" and "tx" for RX and TX DMA requests, respectively.
29
30Examples:
31
32[hwmod populated DMA resources]
33
34 mmc1: mmc@0x4809c000 {
35 compatible = "ti,omap4-hsmmc";
36 reg = <0x4809c000 0x400>;
37 ti,hwmods = "mmc1";
38 ti,dual-volt;
39 bus-width = <4>;
40 vmmc-supply = <&vmmc>; /* phandle to regulator node */
41 ti,non-removable;
42 };
43
44[generic DMA request binding]
23 45
24Example:
25 mmc1: mmc@0x4809c000 { 46 mmc1: mmc@0x4809c000 {
26 compatible = "ti,omap4-hsmmc"; 47 compatible = "ti,omap4-hsmmc";
27 reg = <0x4809c000 0x400>; 48 reg = <0x4809c000 0x400>;
@@ -30,4 +51,7 @@ Example:
30 bus-width = <4>; 51 bus-width = <4>;
31 vmmc-supply = <&vmmc>; /* phandle to regulator node */ 52 vmmc-supply = <&vmmc>; /* phandle to regulator node */
32 ti,non-removable; 53 ti,non-removable;
54 dmas = <&edma 24
55 &edma 25>;
56 dma-names = "tx", "rx";
33 }; 57 };
diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
index df204e18e030..6a2a1160a70d 100644
--- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
@@ -9,12 +9,15 @@ compulsory and any optional properties, common to all SD/MMC drivers, as
9described in mmc.txt, can be used. Additionally the following tmio_mmc-specific 9described in mmc.txt, can be used. Additionally the following tmio_mmc-specific
10optional bindings can be used. 10optional bindings can be used.
11 11
12Required properties:
13- compatible: "renesas,sdhi-shmobile" - a generic sh-mobile SDHI unit
14 "renesas,sdhi-sh7372" - SDHI IP on SH7372 SoC
15 "renesas,sdhi-sh73a0" - SDHI IP on SH73A0 SoC
16 "renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoC
17 "renesas,sdhi-r8a7740" - SDHI IP on R8A7740 SoC
18 "renesas,sdhi-r8a7778" - SDHI IP on R8A7778 SoC
19 "renesas,sdhi-r8a7779" - SDHI IP on R8A7779 SoC
20 "renesas,sdhi-r8a7790" - SDHI IP on R8A7790 SoC
21
12Optional properties: 22Optional properties:
13- toshiba,mmc-wrprotect-disable: write-protect detection is unavailable 23- toshiba,mmc-wrprotect-disable: write-protect detection is unavailable
14
15When used with Renesas SDHI hardware, the following compatibility strings
16configure various model-specific properties:
17
18"renesas,sh7372-sdhi": (default) compatible with SH7372
19"renesas,r8a7740-sdhi": compatible with R8A7740: certain MMC/SD commands have to
20 wait for the interface to become idle.
diff --git a/Documentation/devicetree/bindings/mtd/gpmc-nand.txt b/Documentation/devicetree/bindings/mtd/gpmc-nand.txt
index df338cb5059c..5e1f31b5ff70 100644
--- a/Documentation/devicetree/bindings/mtd/gpmc-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmc-nand.txt
@@ -22,10 +22,10 @@ Optional properties:
22 width of 8 is assumed. 22 width of 8 is assumed.
23 23
24 - ti,nand-ecc-opt: A string setting the ECC layout to use. One of: 24 - ti,nand-ecc-opt: A string setting the ECC layout to use. One of:
25 25 "sw" <deprecated> use "ham1" instead
26 "sw" Software method (default) 26 "hw" <deprecated> use "ham1" instead
27 "hw" Hardware method 27 "hw-romcode" <deprecated> use "ham1" instead
28 "hw-romcode" gpmc hamming mode method & romcode layout 28 "ham1" 1-bit Hamming ecc code
29 "bch4" 4-bit BCH ecc code 29 "bch4" 4-bit BCH ecc code
30 "bch8" 8-bit BCH ecc code 30 "bch8" 8-bit BCH ecc code
31 31
@@ -36,8 +36,12 @@ Optional properties:
36 "prefetch-dma" Prefetch enabled sDMA mode 36 "prefetch-dma" Prefetch enabled sDMA mode
37 "prefetch-irq" Prefetch enabled irq mode 37 "prefetch-irq" Prefetch enabled irq mode
38 38
39 - elm_id: Specifies elm device node. This is required to support BCH 39 - elm_id: <deprecated> use "ti,elm-id" instead
40 error correction using ELM module. 40 - ti,elm-id: Specifies phandle of the ELM devicetree node.
41 ELM is an on-chip hardware engine on TI SoC which is used for
42 locating ECC errors for BCHx algorithms. SoC devices which have
43 ELM hardware engines should specify this device node in .dtsi
44 Using ELM for ECC error correction frees some CPU cycles.
41 45
42For inline partiton table parsing (optional): 46For inline partiton table parsing (optional):
43 47
diff --git a/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt b/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt
new file mode 100644
index 000000000000..7ff57a119f81
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt
@@ -0,0 +1,28 @@
1TI CPSW Phy mode Selection Device Tree Bindings
2-----------------------------------------------
3
4Required properties:
5- compatible : Should be "ti,am3352-cpsw-phy-sel"
6- reg : physical base address and size of the cpsw
7 registers map
8- reg-names : names of the register map given in "reg" node
9
10Optional properties:
11-rmii-clock-ext : If present, the driver will configure the RMII
12 interface to external clock usage
13
14Examples:
15
16 phy_sel: cpsw-phy-sel@44e10650 {
17 compatible = "ti,am3352-cpsw-phy-sel";
18 reg= <0x44e10650 0x4>;
19 reg-names = "gmii-sel";
20 };
21
22(or)
23 phy_sel: cpsw-phy-sel@44e10650 {
24 compatible = "ti,am3352-cpsw-phy-sel";
25 reg= <0x44e10650 0x4>;
26 reg-names = "gmii-sel";
27 rmii-clock-ext;
28 };
diff --git a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
index 2c6be0377f55..d2ea4605d078 100644
--- a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
+++ b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
@@ -86,6 +86,7 @@ General Properties:
86 86
87Clock Properties: 87Clock Properties:
88 88
89 - fsl,cksel Timer reference clock source.
89 - fsl,tclk-period Timer reference clock period in nanoseconds. 90 - fsl,tclk-period Timer reference clock period in nanoseconds.
90 - fsl,tmr-prsc Prescaler, divides the output clock. 91 - fsl,tmr-prsc Prescaler, divides the output clock.
91 - fsl,tmr-add Frequency compensation value. 92 - fsl,tmr-add Frequency compensation value.
@@ -97,7 +98,7 @@ Clock Properties:
97 clock. You must choose these carefully for the clock to work right. 98 clock. You must choose these carefully for the clock to work right.
98 Here is how to figure good values: 99 Here is how to figure good values:
99 100
100 TimerOsc = system clock MHz 101 TimerOsc = selected reference clock MHz
101 tclk_period = desired clock period nanoseconds 102 tclk_period = desired clock period nanoseconds
102 NominalFreq = 1000 / tclk_period MHz 103 NominalFreq = 1000 / tclk_period MHz
103 FreqDivRatio = TimerOsc / NominalFreq (must be greater that 1.0) 104 FreqDivRatio = TimerOsc / NominalFreq (must be greater that 1.0)
@@ -114,6 +115,20 @@ Clock Properties:
114 Pulse Per Second (PPS) signal, since this will be offered to the PPS 115 Pulse Per Second (PPS) signal, since this will be offered to the PPS
115 subsystem to synchronize the Linux clock. 116 subsystem to synchronize the Linux clock.
116 117
118 Reference clock source is determined by the value, which is holded
119 in CKSEL bits in TMR_CTRL register. "fsl,cksel" property keeps the
120 value, which will be directly written in those bits, that is why,
121 according to reference manual, the next clock sources can be used:
122
123 <0> - external high precision timer reference clock (TSEC_TMR_CLK
124 input is used for this purpose);
125 <1> - eTSEC system clock;
126 <2> - eTSEC1 transmit clock;
127 <3> - RTC clock input.
128
129 When this attribute is not used, eTSEC system clock will serve as
130 IEEE 1588 timer reference clock.
131
117Example: 132Example:
118 133
119 ptp_clock@24E00 { 134 ptp_clock@24E00 {
@@ -121,6 +136,7 @@ Example:
121 reg = <0x24E00 0xB0>; 136 reg = <0x24E00 0xB0>;
122 interrupts = <12 0x8 13 0x8>; 137 interrupts = <12 0x8 13 0x8>;
123 interrupt-parent = < &ipic >; 138 interrupt-parent = < &ipic >;
139 fsl,cksel = <1>;
124 fsl,tclk-period = <10>; 140 fsl,tclk-period = <10>;
125 fsl,tmr-prsc = <100>; 141 fsl,tmr-prsc = <100>;
126 fsl,tmr-add = <0x999999A4>; 142 fsl,tmr-add = <0x999999A4>;
diff --git a/Documentation/devicetree/bindings/pci/designware-pcie.txt b/Documentation/devicetree/bindings/pci/designware-pcie.txt
index e216af356847..d5d26d443693 100644
--- a/Documentation/devicetree/bindings/pci/designware-pcie.txt
+++ b/Documentation/devicetree/bindings/pci/designware-pcie.txt
@@ -3,7 +3,7 @@
3Required properties: 3Required properties:
4- compatible: should contain "snps,dw-pcie" to identify the 4- compatible: should contain "snps,dw-pcie" to identify the
5 core, plus an identifier for the specific instance, such 5 core, plus an identifier for the specific instance, such
6 as "samsung,exynos5440-pcie". 6 as "samsung,exynos5440-pcie" or "fsl,imx6q-pcie".
7- reg: base addresses and lengths of the pcie controller, 7- reg: base addresses and lengths of the pcie controller,
8 the phy controller, additional register for the phy controller. 8 the phy controller, additional register for the phy controller.
9- interrupts: interrupt values for level interrupt, 9- interrupts: interrupt values for level interrupt,
@@ -21,6 +21,11 @@ Required properties:
21- num-lanes: number of lanes to use 21- num-lanes: number of lanes to use
22- reset-gpio: gpio pin number of power good signal 22- reset-gpio: gpio pin number of power good signal
23 23
24Optional properties for fsl,imx6q-pcie
25- power-on-gpio: gpio pin number of power-enable signal
26- wake-up-gpio: gpio pin number of incoming wakeup signal
27- disable-gpio: gpio pin number of outgoing rfkill/endpoint disable signal
28
24Example: 29Example:
25 30
26SoC specific DT Entry: 31SoC specific DT Entry:
diff --git a/Documentation/devicetree/bindings/pci/mvebu-pci.txt b/Documentation/devicetree/bindings/pci/mvebu-pci.txt
index 9556e2fedf6d..08c716b2c6b6 100644
--- a/Documentation/devicetree/bindings/pci/mvebu-pci.txt
+++ b/Documentation/devicetree/bindings/pci/mvebu-pci.txt
@@ -5,6 +5,7 @@ Mandatory properties:
5- compatible: one of the following values: 5- compatible: one of the following values:
6 marvell,armada-370-pcie 6 marvell,armada-370-pcie
7 marvell,armada-xp-pcie 7 marvell,armada-xp-pcie
8 marvell,dove-pcie
8 marvell,kirkwood-pcie 9 marvell,kirkwood-pcie
9- #address-cells, set to <3> 10- #address-cells, set to <3>
10- #size-cells, set to <2> 11- #size-cells, set to <2>
@@ -14,6 +15,8 @@ Mandatory properties:
14- ranges: ranges describing the MMIO registers to control the PCIe 15- ranges: ranges describing the MMIO registers to control the PCIe
15 interfaces, and ranges describing the MBus windows needed to access 16 interfaces, and ranges describing the MBus windows needed to access
16 the memory and I/O regions of each PCIe interface. 17 the memory and I/O regions of each PCIe interface.
18- msi-parent: Link to the hardware entity that serves as the Message
19 Signaled Interrupt controller for this PCI controller.
17 20
18The ranges describing the MMIO registers have the following layout: 21The ranges describing the MMIO registers have the following layout:
19 22
@@ -74,6 +77,8 @@ and the following optional properties:
74- marvell,pcie-lane: the physical PCIe lane number, for ports having 77- marvell,pcie-lane: the physical PCIe lane number, for ports having
75 multiple lanes. If this property is not found, we assume that the 78 multiple lanes. If this property is not found, we assume that the
76 value is 0. 79 value is 0.
80- reset-gpios: optional gpio to PERST#
81- reset-delay-us: delay in us to wait after reset de-assertion
77 82
78Example: 83Example:
79 84
@@ -86,6 +91,7 @@ pcie-controller {
86 #size-cells = <2>; 91 #size-cells = <2>;
87 92
88 bus-range = <0x00 0xff>; 93 bus-range = <0x00 0xff>;
94 msi-parent = <&mpic>;
89 95
90 ranges = 96 ranges =
91 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */ 97 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */
@@ -135,6 +141,10 @@ pcie-controller {
135 interrupt-map = <0 0 0 0 &mpic 58>; 141 interrupt-map = <0 0 0 0 &mpic 58>;
136 marvell,pcie-port = <0>; 142 marvell,pcie-port = <0>;
137 marvell,pcie-lane = <0>; 143 marvell,pcie-lane = <0>;
144 /* low-active PERST# reset on GPIO 25 */
145 reset-gpios = <&gpio0 25 1>;
146 /* wait 20ms for device settle after reset deassertion */
147 reset-delay-us = <20000>;
138 clocks = <&gateclk 5>; 148 clocks = <&gateclk 5>;
139 status = "disabled"; 149 status = "disabled";
140 }; 150 };
diff --git a/Documentation/devicetree/bindings/phy/phy-bindings.txt b/Documentation/devicetree/bindings/phy/phy-bindings.txt
new file mode 100644
index 000000000000..8ae844fc0c60
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/phy-bindings.txt
@@ -0,0 +1,66 @@
1This document explains only the device tree data binding. For general
2information about PHY subsystem refer to Documentation/phy.txt
3
4PHY device node
5===============
6
7Required Properties:
8#phy-cells: Number of cells in a PHY specifier; The meaning of all those
9 cells is defined by the binding for the phy node. The PHY
10 provider can use the values in cells to find the appropriate
11 PHY.
12
13For example:
14
15phys: phy {
16 compatible = "xxx";
17 reg = <...>;
18 .
19 .
20 #phy-cells = <1>;
21 .
22 .
23};
24
25That node describes an IP block (PHY provider) that implements 2 different PHYs.
26In order to differentiate between these 2 PHYs, an additonal specifier should be
27given while trying to get a reference to it.
28
29PHY user node
30=============
31
32Required Properties:
33phys : the phandle for the PHY device (used by the PHY subsystem)
34phy-names : the names of the PHY corresponding to the PHYs present in the
35 *phys* phandle
36
37Example 1:
38usb1: usb_otg_ss@xxx {
39 compatible = "xxx";
40 reg = <xxx>;
41 .
42 .
43 phys = <&usb2_phy>, <&usb3_phy>;
44 phy-names = "usb2phy", "usb3phy";
45 .
46 .
47};
48
49This node represents a controller that uses two PHYs, one for usb2 and one for
50usb3.
51
52Example 2:
53usb2: usb_otg_ss@xxx {
54 compatible = "xxx";
55 reg = <xxx>;
56 .
57 .
58 phys = <&phys 1>;
59 phy-names = "usbphy";
60 .
61 .
62};
63
64This node represents a controller that uses one of the PHYs of the PHY provider
65device defined previously. Note that the phy handle has an additional specifier
66"1" to differentiate between the two PHYs.
diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt b/Documentation/devicetree/bindings/phy/samsung-phy.txt
new file mode 100644
index 000000000000..c0fccaa1671e
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt
@@ -0,0 +1,22 @@
1Samsung S5P/EXYNOS SoC series MIPI CSIS/DSIM DPHY
2-------------------------------------------------
3
4Required properties:
5- compatible : should be "samsung,s5pv210-mipi-video-phy";
6- reg : offset and length of the MIPI DPHY register set;
7- #phy-cells : from the generic phy bindings, must be 1;
8
9For "samsung,s5pv210-mipi-video-phy" compatible PHYs the second cell in
10the PHY specifier identifies the PHY and its meaning is as follows:
11 0 - MIPI CSIS 0,
12 1 - MIPI DSIM 0,
13 2 - MIPI CSIS 1,
14 3 - MIPI DSIM 1.
15
16Samsung EXYNOS SoC series Display Port PHY
17-------------------------------------------------
18
19Required properties:
20- compatible : should be "samsung,exynos5250-dp-video-phy";
21- reg : offset and length of the Display Port PHY register set;
22- #phy-cells : from the generic PHY bindings, must be 0;
diff --git a/Documentation/devicetree/bindings/pinctrl/abilis,tb10x-iomux.txt b/Documentation/devicetree/bindings/pinctrl/abilis,tb10x-iomux.txt
new file mode 100644
index 000000000000..2c11866221c2
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/abilis,tb10x-iomux.txt
@@ -0,0 +1,80 @@
1Abilis Systems TB10x pin controller
2===================================
3
4Required properties
5-------------------
6
7- compatible: should be "abilis,tb10x-iomux";
8- reg: should contain the physical address and size of the pin controller's
9 register range.
10
11
12Function definitions
13--------------------
14
15Functions are defined (and referenced) by sub-nodes of the pin controller.
16Every sub-node defines exactly one function (implying a set of pins).
17Every function is associated to one named pin group inside the pin controller
18driver and these names are used to associate pin group predefinitions to pin
19controller sub-nodes.
20
21Required function definition subnode properties:
22 - abilis,function: should be set to the name of the function's pin group.
23
24The following pin groups are available:
25 - GPIO ports: gpioa, gpiob, gpioc, gpiod, gpioe, gpiof, gpiog,
26 gpioh, gpioi, gpioj, gpiok, gpiol, gpiom, gpion
27 - Serial TS input ports: mis0, mis1, mis2, mis3, mis4, mis5, mis6, mis7
28 - Parallel TS input ports: mip1, mip3, mip5, mip7
29 - Serial TS output ports: mos0, mos1, mos2, mos3
30 - Parallel TS output port: mop
31 - CI+ port: ciplus
32 - CableCard (Mcard) port: mcard
33 - Smart card ports: stc0, stc1
34 - UART ports: uart0, uart1
35 - SPI ports: spi1, spi3
36 - JTAG: jtag
37
38All other ports of the chip are not multiplexed and thus not managed by this
39driver.
40
41
42GPIO ranges definition
43----------------------
44
45The named pin groups of GPIO ports can be used to define GPIO ranges as
46explained in Documentation/devicetree/bindings/gpio/gpio.txt.
47
48
49Example
50-------
51
52iomux: iomux@FF10601c {
53 compatible = "abilis,tb10x-iomux";
54 reg = <0xFF10601c 0x4>;
55 pctl_gpio_a: pctl-gpio-a {
56 abilis,function = "gpioa";
57 };
58 pctl_uart0: pctl-uart0 {
59 abilis,function = "uart0";
60 };
61};
62uart@FF100000 {
63 compatible = "snps,dw-apb-uart";
64 reg = <0xFF100000 0x100>;
65 clock-frequency = <166666666>;
66 interrupts = <25 1>;
67 reg-shift = <2>;
68 reg-io-width = <4>;
69 pinctrl-names = "default";
70 pinctrl-0 = <&pctl_uart0>;
71};
72gpioa: gpio@FF140000 {
73 compatible = "abilis,tb10x-gpio";
74 reg = <0xFF140000 0x1000>;
75 gpio-controller;
76 #gpio-cells = <2>;
77 ngpio = <3>;
78 gpio-ranges = <&iomux 0 0>;
79 gpio-ranges-group-names = "gpioa";
80};
diff --git a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt
index 7ccae490ff6d..02ab5ab198a4 100644
--- a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt
@@ -18,7 +18,7 @@ mode) this pin can work on and the 'config' configures various pad settings
18such as pull-up, multi drive, etc. 18such as pull-up, multi drive, etc.
19 19
20Required properties for iomux controller: 20Required properties for iomux controller:
21- compatible: "atmel,at91rm9200-pinctrl" 21- compatible: "atmel,at91rm9200-pinctrl" or "atmel,at91sam9x5-pinctrl"
22- atmel,mux-mask: array of mask (periph per bank) to describe if a pin can be 22- atmel,mux-mask: array of mask (periph per bank) to describe if a pin can be
23 configured in this periph mode. All the periph and bank need to be describe. 23 configured in this periph mode. All the periph and bank need to be describe.
24 24
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt
index 3a7caf7a744a..9fde25f1401a 100644
--- a/Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt
@@ -22,11 +22,12 @@ Required properties for iomux controller:
22 Please refer to each fsl,<soc>-pinctrl.txt binding doc for supported SoCs. 22 Please refer to each fsl,<soc>-pinctrl.txt binding doc for supported SoCs.
23 23
24Required properties for pin configuration node: 24Required properties for pin configuration node:
25- fsl,pins: two integers array, represents a group of pins mux and config 25- fsl,pins: each entry consists of 6 integers and represents the mux and config
26 setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a 26 setting for one pin. The first 5 integers <mux_reg conf_reg input_reg mux_val
27 pin working on a specific function, which consists of a tuple of 27 input_val> are specified using a PIN_FUNC_ID macro, which can be found in
28 <mux_reg conf_reg input_reg mux_val input_val>. CONFIG is the pad setting 28 imx*-pinfunc.h under device tree source folder. The last integer CONFIG is
29 value like pull-up on this pin. 29 the pad setting value like pull-up on this pin. And that's why fsl,pins entry
30 looks like <PIN_FUNC_ID CONFIG> in the example below.
30 31
31Bits used for CONFIG: 32Bits used for CONFIG:
32NO_PAD_CTL(1 << 31): indicate this pin does not need config. 33NO_PAD_CTL(1 << 31): indicate this pin does not need config.
@@ -72,17 +73,18 @@ iomuxc@020e0000 {
72 /* shared pinctrl settings */ 73 /* shared pinctrl settings */
73 usdhc4 { 74 usdhc4 {
74 pinctrl_usdhc4_1: usdhc4grp-1 { 75 pinctrl_usdhc4_1: usdhc4grp-1 {
75 fsl,pins = <1386 0x17059 /* MX6Q_PAD_SD4_CMD__USDHC4_CMD */ 76 fsl,pins = <
76 1392 0x10059 /* MX6Q_PAD_SD4_CLK__USDHC4_CLK */ 77 MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059
77 1462 0x17059 /* MX6Q_PAD_SD4_DAT0__USDHC4_DAT0 */ 78 MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
78 1470 0x17059 /* MX6Q_PAD_SD4_DAT1__USDHC4_DAT1 */ 79 MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
79 1478 0x17059 /* MX6Q_PAD_SD4_DAT2__USDHC4_DAT2 */ 80 MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
80 1486 0x17059 /* MX6Q_PAD_SD4_DAT3__USDHC4_DAT3 */ 81 MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
81 1493 0x17059 /* MX6Q_PAD_SD4_DAT4__USDHC4_DAT4 */ 82 MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
82 1501 0x17059 /* MX6Q_PAD_SD4_DAT5__USDHC4_DAT5 */ 83 MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059
83 1509 0x17059 /* MX6Q_PAD_SD4_DAT6__USDHC4_DAT6 */ 84 MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059
84 1517 0x17059>; /* MX6Q_PAD_SD4_DAT7__USDHC4_DAT7 */ 85 MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059
85 }; 86 MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059
87 >;
86 }; 88 };
87 .... 89 ....
88}; 90};
@@ -90,6 +92,3 @@ Refer to the IOMUXC controller chapter in imx6q datasheet,
900x17059 means enable hysteresis, 47KOhm Pull Up, 50Mhz speed, 920x17059 means enable hysteresis, 47KOhm Pull Up, 50Mhz speed,
9180Ohm driver strength and Fast Slew Rate. 9380Ohm driver strength and Fast Slew Rate.
92User should refer to each SoC spec to set the correct value. 94User should refer to each SoC spec to set the correct value.
93
94TODO: when dtc macro support is available, we can change above raw data
95to dt macro which can get better readability in dts file.
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt
new file mode 100644
index 000000000000..353eca0efbf8
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt
@@ -0,0 +1,99 @@
1* Freescale IMX27 IOMUX Controller
2
3Required properties:
4- compatible: "fsl,imx27-iomuxc"
5
6The iomuxc driver node should define subnodes containing of pinctrl configuration subnodes.
7
8Required properties for pin configuration node:
9- fsl,pins: three integers array, represents a group of pins mux and config
10 setting. The format is fsl,pins = <PIN MUX_ID CONFIG>.
11
12 PIN is an integer between 0 and 0xbf. imx27 has 6 ports with 32 configurable
13 configurable pins each. PIN is PORT * 32 + PORT_PIN, PORT_PIN is the pin
14 number on the specific port (between 0 and 31).
15
16 MUX_ID is
17 function + (direction << 2) + (gpio_oconf << 4) + (gpio_iconfa << 8) + (gpio_iconfb << 10)
18
19 function value is used to select the pin function.
20 Possible values:
21 0 - Primary function
22 1 - Alternate function
23 2 - GPIO
24 Registers: GIUS (GPIO In Use), GPR (General Purpose Register)
25
26 direction defines the data direction of the pin.
27 Possible values:
28 0 - Input
29 1 - Output
30 Register: DDIR
31
32 gpio_oconf configures the gpio submodule output signal. This does not
33 have any effect unless GPIO function is selected. A/B/C_IN are output
34 signals of function blocks A,B and C. Specific function blocks are
35 described in the reference manual.
36 Possible values:
37 0 - A_IN
38 1 - B_IN
39 2 - C_IN
40 3 - Data Register
41 Registers: OCR1, OCR2
42
43 gpio_iconfa/b configures the gpio submodule input to functionblocks A and
44 B. GPIO function should be selected if this is configured.
45 Possible values:
46 0 - GPIO_IN
47 1 - Interrupt Status Register
48 2 - Pulldown
49 3 - Pullup
50 Registers ICONFA1, ICONFA2, ICONFB1 and ICONFB2
51
52 CONFIG can be 0 or 1, meaning Pullup disable/enable.
53
54
55
56Example:
57
58iomuxc: iomuxc@10015000 {
59 compatible = "fsl,imx27-iomuxc";
60 reg = <0x10015000 0x600>;
61
62 uart {
63 pinctrl_uart1: uart-1 {
64 fsl,pins = <
65 0x8c 0x004 0x0 /* UART1_TXD__UART1_TXD */
66 0x8d 0x000 0x0 /* UART1_RXD__UART1_RXD */
67 0x8e 0x004 0x0 /* UART1_CTS__UART1_CTS */
68 0x8f 0x000 0x0 /* UART1_RTS__UART1_RTS */
69 >;
70 };
71
72 ...
73 };
74};
75
76
77For convenience there are macros defined in imx27-pinfunc.h which provide PIN
78and MUX_ID. They are structured as MX27_PAD_<Pad name>__<Signal name>. The names
79are defined in the i.MX27 reference manual.
80
81The above example using macros:
82
83iomuxc: iomuxc@10015000 {
84 compatible = "fsl,imx27-iomuxc";
85 reg = <0x10015000 0x600>;
86
87 uart {
88 pinctrl_uart1: uart-1 {
89 fsl,pins = <
90 MX27_PAD_UART1_TXD__UART1_TXD 0x0
91 MX27_PAD_UART1_RXD__UART1_RXD 0x0
92 MX27_PAD_UART1_CTS__UART1_CTS 0x0
93 MX27_PAD_UART1_RTS__UART1_RTS 0x0
94 >;
95 };
96
97 ...
98 };
99};
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt
index 3077370c89af..1e70a8aff260 100644
--- a/Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt
@@ -59,16 +59,16 @@ Required subnode-properties:
59 59
60Optional subnode-properties: 60Optional subnode-properties:
61- fsl,drive-strength: Integer. 61- fsl,drive-strength: Integer.
62 0: 4 mA 62 0: MXS_DRIVE_4mA
63 1: 8 mA 63 1: MXS_DRIVE_8mA
64 2: 12 mA 64 2: MXS_DRIVE_12mA
65 3: 16 mA 65 3: MXS_DRIVE_16mA
66- fsl,voltage: Integer. 66- fsl,voltage: Integer.
67 0: 1.8 V 67 0: MXS_VOLTAGE_LOW - 1.8 V
68 1: 3.3 V 68 1: MXS_VOLTAGE_HIGH - 3.3 V
69- fsl,pull-up: Integer. 69- fsl,pull-up: Integer.
70 0: Disable the internal pull-up 70 0: MXS_PULL_DISABLE - Disable the internal pull-up
71 1: Enable the internal pull-up 71 1: MXS_PULL_ENABLE - Enable the internal pull-up
72 72
73Note that when enabling the pull-up, the internal pad keeper gets disabled. 73Note that when enabling the pull-up, the internal pad keeper gets disabled.
74Also, some pins doesn't have a pull up, in that case, setting the fsl,pull-up 74Also, some pins doesn't have a pull up, in that case, setting the fsl,pull-up
@@ -85,23 +85,32 @@ pinctrl@80018000 {
85 mmc0_8bit_pins_a: mmc0-8bit@0 { 85 mmc0_8bit_pins_a: mmc0-8bit@0 {
86 reg = <0>; 86 reg = <0>;
87 fsl,pinmux-ids = < 87 fsl,pinmux-ids = <
88 0x2000 0x2010 0x2020 0x2030 88 MX28_PAD_SSP0_DATA0__SSP0_D0
89 0x2040 0x2050 0x2060 0x2070 89 MX28_PAD_SSP0_DATA1__SSP0_D1
90 0x2080 0x2090 0x20a0>; 90 MX28_PAD_SSP0_DATA2__SSP0_D2
91 fsl,drive-strength = <1>; 91 MX28_PAD_SSP0_DATA3__SSP0_D3
92 fsl,voltage = <1>; 92 MX28_PAD_SSP0_DATA4__SSP0_D4
93 fsl,pull-up = <1>; 93 MX28_PAD_SSP0_DATA5__SSP0_D5
94 MX28_PAD_SSP0_DATA6__SSP0_D6
95 MX28_PAD_SSP0_DATA7__SSP0_D7
96 MX28_PAD_SSP0_CMD__SSP0_CMD
97 MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT
98 MX28_PAD_SSP0_SCK__SSP0_SCK
99 >;
100 fsl,drive-strength = <MXS_DRIVE_4mA>;
101 fsl,voltage = <MXS_VOLTAGE_HIGH>;
102 fsl,pull-up = <MXS_PULL_ENABLE>;
94 }; 103 };
95 104
96 mmc_cd_cfg: mmc-cd-cfg { 105 mmc_cd_cfg: mmc-cd-cfg {
97 fsl,pinmux-ids = <0x2090>; 106 fsl,pinmux-ids = <MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT>;
98 fsl,pull-up = <0>; 107 fsl,pull-up = <MXS_PULL_DISABLE>;
99 }; 108 };
100 109
101 mmc_sck_cfg: mmc-sck-cfg { 110 mmc_sck_cfg: mmc-sck-cfg {
102 fsl,pinmux-ids = <0x20a0>; 111 fsl,pinmux-ids = <MX28_PAD_SSP0_SCK__SSP0_SCK>;
103 fsl,drive-strength = <2>; 112 fsl,drive-strength = <MXS_DRIVE_12mA>;
104 fsl,pull-up = <0>; 113 fsl,pull-up = <MXS_PULL_DISABLE>;
105 }; 114 };
106}; 115};
107 116
@@ -112,811 +121,7 @@ adjusting the configuration for pins card-detection and clock from what group
112node mmc0-8bit defines. Only the configuration properties to be adjusted need 121node mmc0-8bit defines. Only the configuration properties to be adjusted need
113to be listed in the config nodes. 122to be listed in the config nodes.
114 123
115Valid values for i.MX28 pinmux-id: 124Valid values for i.MX28/i.MX23 pinmux-id are defined in
116 125arch/arm/boot/dts/imx28-pinfunc.h and arch/arm/boot/dts/imx23-pinfunc.h.
117pinmux id 126The definitions for the padconfig properties can be found in
118------ -- 127arch/arm/boot/dts/mxs-pinfunc.h.
119MX28_PAD_GPMI_D00__GPMI_D0 0x0000
120MX28_PAD_GPMI_D01__GPMI_D1 0x0010
121MX28_PAD_GPMI_D02__GPMI_D2 0x0020
122MX28_PAD_GPMI_D03__GPMI_D3 0x0030
123MX28_PAD_GPMI_D04__GPMI_D4 0x0040
124MX28_PAD_GPMI_D05__GPMI_D5 0x0050
125MX28_PAD_GPMI_D06__GPMI_D6 0x0060
126MX28_PAD_GPMI_D07__GPMI_D7 0x0070
127MX28_PAD_GPMI_CE0N__GPMI_CE0N 0x0100
128MX28_PAD_GPMI_CE1N__GPMI_CE1N 0x0110
129MX28_PAD_GPMI_CE2N__GPMI_CE2N 0x0120
130MX28_PAD_GPMI_CE3N__GPMI_CE3N 0x0130
131MX28_PAD_GPMI_RDY0__GPMI_READY0 0x0140
132MX28_PAD_GPMI_RDY1__GPMI_READY1 0x0150
133MX28_PAD_GPMI_RDY2__GPMI_READY2 0x0160
134MX28_PAD_GPMI_RDY3__GPMI_READY3 0x0170
135MX28_PAD_GPMI_RDN__GPMI_RDN 0x0180
136MX28_PAD_GPMI_WRN__GPMI_WRN 0x0190
137MX28_PAD_GPMI_ALE__GPMI_ALE 0x01a0
138MX28_PAD_GPMI_CLE__GPMI_CLE 0x01b0
139MX28_PAD_GPMI_RESETN__GPMI_RESETN 0x01c0
140MX28_PAD_LCD_D00__LCD_D0 0x1000
141MX28_PAD_LCD_D01__LCD_D1 0x1010
142MX28_PAD_LCD_D02__LCD_D2 0x1020
143MX28_PAD_LCD_D03__LCD_D3 0x1030
144MX28_PAD_LCD_D04__LCD_D4 0x1040
145MX28_PAD_LCD_D05__LCD_D5 0x1050
146MX28_PAD_LCD_D06__LCD_D6 0x1060
147MX28_PAD_LCD_D07__LCD_D7 0x1070
148MX28_PAD_LCD_D08__LCD_D8 0x1080
149MX28_PAD_LCD_D09__LCD_D9 0x1090
150MX28_PAD_LCD_D10__LCD_D10 0x10a0
151MX28_PAD_LCD_D11__LCD_D11 0x10b0
152MX28_PAD_LCD_D12__LCD_D12 0x10c0
153MX28_PAD_LCD_D13__LCD_D13 0x10d0
154MX28_PAD_LCD_D14__LCD_D14 0x10e0
155MX28_PAD_LCD_D15__LCD_D15 0x10f0
156MX28_PAD_LCD_D16__LCD_D16 0x1100
157MX28_PAD_LCD_D17__LCD_D17 0x1110
158MX28_PAD_LCD_D18__LCD_D18 0x1120
159MX28_PAD_LCD_D19__LCD_D19 0x1130
160MX28_PAD_LCD_D20__LCD_D20 0x1140
161MX28_PAD_LCD_D21__LCD_D21 0x1150
162MX28_PAD_LCD_D22__LCD_D22 0x1160
163MX28_PAD_LCD_D23__LCD_D23 0x1170
164MX28_PAD_LCD_RD_E__LCD_RD_E 0x1180
165MX28_PAD_LCD_WR_RWN__LCD_WR_RWN 0x1190
166MX28_PAD_LCD_RS__LCD_RS 0x11a0
167MX28_PAD_LCD_CS__LCD_CS 0x11b0
168MX28_PAD_LCD_VSYNC__LCD_VSYNC 0x11c0
169MX28_PAD_LCD_HSYNC__LCD_HSYNC 0x11d0
170MX28_PAD_LCD_DOTCLK__LCD_DOTCLK 0x11e0
171MX28_PAD_LCD_ENABLE__LCD_ENABLE 0x11f0
172MX28_PAD_SSP0_DATA0__SSP0_D0 0x2000
173MX28_PAD_SSP0_DATA1__SSP0_D1 0x2010
174MX28_PAD_SSP0_DATA2__SSP0_D2 0x2020
175MX28_PAD_SSP0_DATA3__SSP0_D3 0x2030
176MX28_PAD_SSP0_DATA4__SSP0_D4 0x2040
177MX28_PAD_SSP0_DATA5__SSP0_D5 0x2050
178MX28_PAD_SSP0_DATA6__SSP0_D6 0x2060
179MX28_PAD_SSP0_DATA7__SSP0_D7 0x2070
180MX28_PAD_SSP0_CMD__SSP0_CMD 0x2080
181MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT 0x2090
182MX28_PAD_SSP0_SCK__SSP0_SCK 0x20a0
183MX28_PAD_SSP1_SCK__SSP1_SCK 0x20c0
184MX28_PAD_SSP1_CMD__SSP1_CMD 0x20d0
185MX28_PAD_SSP1_DATA0__SSP1_D0 0x20e0
186MX28_PAD_SSP1_DATA3__SSP1_D3 0x20f0
187MX28_PAD_SSP2_SCK__SSP2_SCK 0x2100
188MX28_PAD_SSP2_MOSI__SSP2_CMD 0x2110
189MX28_PAD_SSP2_MISO__SSP2_D0 0x2120
190MX28_PAD_SSP2_SS0__SSP2_D3 0x2130
191MX28_PAD_SSP2_SS1__SSP2_D4 0x2140
192MX28_PAD_SSP2_SS2__SSP2_D5 0x2150
193MX28_PAD_SSP3_SCK__SSP3_SCK 0x2180
194MX28_PAD_SSP3_MOSI__SSP3_CMD 0x2190
195MX28_PAD_SSP3_MISO__SSP3_D0 0x21a0
196MX28_PAD_SSP3_SS0__SSP3_D3 0x21b0
197MX28_PAD_AUART0_RX__AUART0_RX 0x3000
198MX28_PAD_AUART0_TX__AUART0_TX 0x3010
199MX28_PAD_AUART0_CTS__AUART0_CTS 0x3020
200MX28_PAD_AUART0_RTS__AUART0_RTS 0x3030
201MX28_PAD_AUART1_RX__AUART1_RX 0x3040
202MX28_PAD_AUART1_TX__AUART1_TX 0x3050
203MX28_PAD_AUART1_CTS__AUART1_CTS 0x3060
204MX28_PAD_AUART1_RTS__AUART1_RTS 0x3070
205MX28_PAD_AUART2_RX__AUART2_RX 0x3080
206MX28_PAD_AUART2_TX__AUART2_TX 0x3090
207MX28_PAD_AUART2_CTS__AUART2_CTS 0x30a0
208MX28_PAD_AUART2_RTS__AUART2_RTS 0x30b0
209MX28_PAD_AUART3_RX__AUART3_RX 0x30c0
210MX28_PAD_AUART3_TX__AUART3_TX 0x30d0
211MX28_PAD_AUART3_CTS__AUART3_CTS 0x30e0
212MX28_PAD_AUART3_RTS__AUART3_RTS 0x30f0
213MX28_PAD_PWM0__PWM_0 0x3100
214MX28_PAD_PWM1__PWM_1 0x3110
215MX28_PAD_PWM2__PWM_2 0x3120
216MX28_PAD_SAIF0_MCLK__SAIF0_MCLK 0x3140
217MX28_PAD_SAIF0_LRCLK__SAIF0_LRCLK 0x3150
218MX28_PAD_SAIF0_BITCLK__SAIF0_BITCLK 0x3160
219MX28_PAD_SAIF0_SDATA0__SAIF0_SDATA0 0x3170
220MX28_PAD_I2C0_SCL__I2C0_SCL 0x3180
221MX28_PAD_I2C0_SDA__I2C0_SDA 0x3190
222MX28_PAD_SAIF1_SDATA0__SAIF1_SDATA0 0x31a0
223MX28_PAD_SPDIF__SPDIF_TX 0x31b0
224MX28_PAD_PWM3__PWM_3 0x31c0
225MX28_PAD_PWM4__PWM_4 0x31d0
226MX28_PAD_LCD_RESET__LCD_RESET 0x31e0
227MX28_PAD_ENET0_MDC__ENET0_MDC 0x4000
228MX28_PAD_ENET0_MDIO__ENET0_MDIO 0x4010
229MX28_PAD_ENET0_RX_EN__ENET0_RX_EN 0x4020
230MX28_PAD_ENET0_RXD0__ENET0_RXD0 0x4030
231MX28_PAD_ENET0_RXD1__ENET0_RXD1 0x4040
232MX28_PAD_ENET0_TX_CLK__ENET0_TX_CLK 0x4050
233MX28_PAD_ENET0_TX_EN__ENET0_TX_EN 0x4060
234MX28_PAD_ENET0_TXD0__ENET0_TXD0 0x4070
235MX28_PAD_ENET0_TXD1__ENET0_TXD1 0x4080
236MX28_PAD_ENET0_RXD2__ENET0_RXD2 0x4090
237MX28_PAD_ENET0_RXD3__ENET0_RXD3 0x40a0
238MX28_PAD_ENET0_TXD2__ENET0_TXD2 0x40b0
239MX28_PAD_ENET0_TXD3__ENET0_TXD3 0x40c0
240MX28_PAD_ENET0_RX_CLK__ENET0_RX_CLK 0x40d0
241MX28_PAD_ENET0_COL__ENET0_COL 0x40e0
242MX28_PAD_ENET0_CRS__ENET0_CRS 0x40f0
243MX28_PAD_ENET_CLK__CLKCTRL_ENET 0x4100
244MX28_PAD_JTAG_RTCK__JTAG_RTCK 0x4140
245MX28_PAD_EMI_D00__EMI_DATA0 0x5000
246MX28_PAD_EMI_D01__EMI_DATA1 0x5010
247MX28_PAD_EMI_D02__EMI_DATA2 0x5020
248MX28_PAD_EMI_D03__EMI_DATA3 0x5030
249MX28_PAD_EMI_D04__EMI_DATA4 0x5040
250MX28_PAD_EMI_D05__EMI_DATA5 0x5050
251MX28_PAD_EMI_D06__EMI_DATA6 0x5060
252MX28_PAD_EMI_D07__EMI_DATA7 0x5070
253MX28_PAD_EMI_D08__EMI_DATA8 0x5080
254MX28_PAD_EMI_D09__EMI_DATA9 0x5090
255MX28_PAD_EMI_D10__EMI_DATA10 0x50a0
256MX28_PAD_EMI_D11__EMI_DATA11 0x50b0
257MX28_PAD_EMI_D12__EMI_DATA12 0x50c0
258MX28_PAD_EMI_D13__EMI_DATA13 0x50d0
259MX28_PAD_EMI_D14__EMI_DATA14 0x50e0
260MX28_PAD_EMI_D15__EMI_DATA15 0x50f0
261MX28_PAD_EMI_ODT0__EMI_ODT0 0x5100
262MX28_PAD_EMI_DQM0__EMI_DQM0 0x5110
263MX28_PAD_EMI_ODT1__EMI_ODT1 0x5120
264MX28_PAD_EMI_DQM1__EMI_DQM1 0x5130
265MX28_PAD_EMI_DDR_OPEN_FB__EMI_DDR_OPEN_FEEDBACK 0x5140
266MX28_PAD_EMI_CLK__EMI_CLK 0x5150
267MX28_PAD_EMI_DQS0__EMI_DQS0 0x5160
268MX28_PAD_EMI_DQS1__EMI_DQS1 0x5170
269MX28_PAD_EMI_DDR_OPEN__EMI_DDR_OPEN 0x51a0
270MX28_PAD_EMI_A00__EMI_ADDR0 0x6000
271MX28_PAD_EMI_A01__EMI_ADDR1 0x6010
272MX28_PAD_EMI_A02__EMI_ADDR2 0x6020
273MX28_PAD_EMI_A03__EMI_ADDR3 0x6030
274MX28_PAD_EMI_A04__EMI_ADDR4 0x6040
275MX28_PAD_EMI_A05__EMI_ADDR5 0x6050
276MX28_PAD_EMI_A06__EMI_ADDR6 0x6060
277MX28_PAD_EMI_A07__EMI_ADDR7 0x6070
278MX28_PAD_EMI_A08__EMI_ADDR8 0x6080
279MX28_PAD_EMI_A09__EMI_ADDR9 0x6090
280MX28_PAD_EMI_A10__EMI_ADDR10 0x60a0
281MX28_PAD_EMI_A11__EMI_ADDR11 0x60b0
282MX28_PAD_EMI_A12__EMI_ADDR12 0x60c0
283MX28_PAD_EMI_A13__EMI_ADDR13 0x60d0
284MX28_PAD_EMI_A14__EMI_ADDR14 0x60e0
285MX28_PAD_EMI_BA0__EMI_BA0 0x6100
286MX28_PAD_EMI_BA1__EMI_BA1 0x6110
287MX28_PAD_EMI_BA2__EMI_BA2 0x6120
288MX28_PAD_EMI_CASN__EMI_CASN 0x6130
289MX28_PAD_EMI_RASN__EMI_RASN 0x6140
290MX28_PAD_EMI_WEN__EMI_WEN 0x6150
291MX28_PAD_EMI_CE0N__EMI_CE0N 0x6160
292MX28_PAD_EMI_CE1N__EMI_CE1N 0x6170
293MX28_PAD_EMI_CKE__EMI_CKE 0x6180
294MX28_PAD_GPMI_D00__SSP1_D0 0x0001
295MX28_PAD_GPMI_D01__SSP1_D1 0x0011
296MX28_PAD_GPMI_D02__SSP1_D2 0x0021
297MX28_PAD_GPMI_D03__SSP1_D3 0x0031
298MX28_PAD_GPMI_D04__SSP1_D4 0x0041
299MX28_PAD_GPMI_D05__SSP1_D5 0x0051
300MX28_PAD_GPMI_D06__SSP1_D6 0x0061
301MX28_PAD_GPMI_D07__SSP1_D7 0x0071
302MX28_PAD_GPMI_CE0N__SSP3_D0 0x0101
303MX28_PAD_GPMI_CE1N__SSP3_D3 0x0111
304MX28_PAD_GPMI_CE2N__CAN1_TX 0x0121
305MX28_PAD_GPMI_CE3N__CAN1_RX 0x0131
306MX28_PAD_GPMI_RDY0__SSP1_CARD_DETECT 0x0141
307MX28_PAD_GPMI_RDY1__SSP1_CMD 0x0151
308MX28_PAD_GPMI_RDY2__CAN0_TX 0x0161
309MX28_PAD_GPMI_RDY3__CAN0_RX 0x0171
310MX28_PAD_GPMI_RDN__SSP3_SCK 0x0181
311MX28_PAD_GPMI_WRN__SSP1_SCK 0x0191
312MX28_PAD_GPMI_ALE__SSP3_D1 0x01a1
313MX28_PAD_GPMI_CLE__SSP3_D2 0x01b1
314MX28_PAD_GPMI_RESETN__SSP3_CMD 0x01c1
315MX28_PAD_LCD_D03__ETM_DA8 0x1031
316MX28_PAD_LCD_D04__ETM_DA9 0x1041
317MX28_PAD_LCD_D08__ETM_DA3 0x1081
318MX28_PAD_LCD_D09__ETM_DA4 0x1091
319MX28_PAD_LCD_D20__ENET1_1588_EVENT2_OUT 0x1141
320MX28_PAD_LCD_D21__ENET1_1588_EVENT2_IN 0x1151
321MX28_PAD_LCD_D22__ENET1_1588_EVENT3_OUT 0x1161
322MX28_PAD_LCD_D23__ENET1_1588_EVENT3_IN 0x1171
323MX28_PAD_LCD_RD_E__LCD_VSYNC 0x1181
324MX28_PAD_LCD_WR_RWN__LCD_HSYNC 0x1191
325MX28_PAD_LCD_RS__LCD_DOTCLK 0x11a1
326MX28_PAD_LCD_CS__LCD_ENABLE 0x11b1
327MX28_PAD_LCD_VSYNC__SAIF1_SDATA0 0x11c1
328MX28_PAD_LCD_HSYNC__SAIF1_SDATA1 0x11d1
329MX28_PAD_LCD_DOTCLK__SAIF1_MCLK 0x11e1
330MX28_PAD_SSP0_DATA4__SSP2_D0 0x2041
331MX28_PAD_SSP0_DATA5__SSP2_D3 0x2051
332MX28_PAD_SSP0_DATA6__SSP2_CMD 0x2061
333MX28_PAD_SSP0_DATA7__SSP2_SCK 0x2071
334MX28_PAD_SSP1_SCK__SSP2_D1 0x20c1
335MX28_PAD_SSP1_CMD__SSP2_D2 0x20d1
336MX28_PAD_SSP1_DATA0__SSP2_D6 0x20e1
337MX28_PAD_SSP1_DATA3__SSP2_D7 0x20f1
338MX28_PAD_SSP2_SCK__AUART2_RX 0x2101
339MX28_PAD_SSP2_MOSI__AUART2_TX 0x2111
340MX28_PAD_SSP2_MISO__AUART3_RX 0x2121
341MX28_PAD_SSP2_SS0__AUART3_TX 0x2131
342MX28_PAD_SSP2_SS1__SSP2_D1 0x2141
343MX28_PAD_SSP2_SS2__SSP2_D2 0x2151
344MX28_PAD_SSP3_SCK__AUART4_TX 0x2181
345MX28_PAD_SSP3_MOSI__AUART4_RX 0x2191
346MX28_PAD_SSP3_MISO__AUART4_RTS 0x21a1
347MX28_PAD_SSP3_SS0__AUART4_CTS 0x21b1
348MX28_PAD_AUART0_RX__I2C0_SCL 0x3001
349MX28_PAD_AUART0_TX__I2C0_SDA 0x3011
350MX28_PAD_AUART0_CTS__AUART4_RX 0x3021
351MX28_PAD_AUART0_RTS__AUART4_TX 0x3031
352MX28_PAD_AUART1_RX__SSP2_CARD_DETECT 0x3041
353MX28_PAD_AUART1_TX__SSP3_CARD_DETECT 0x3051
354MX28_PAD_AUART1_CTS__USB0_OVERCURRENT 0x3061
355MX28_PAD_AUART1_RTS__USB0_ID 0x3071
356MX28_PAD_AUART2_RX__SSP3_D1 0x3081
357MX28_PAD_AUART2_TX__SSP3_D2 0x3091
358MX28_PAD_AUART2_CTS__I2C1_SCL 0x30a1
359MX28_PAD_AUART2_RTS__I2C1_SDA 0x30b1
360MX28_PAD_AUART3_RX__CAN0_TX 0x30c1
361MX28_PAD_AUART3_TX__CAN0_RX 0x30d1
362MX28_PAD_AUART3_CTS__CAN1_TX 0x30e1
363MX28_PAD_AUART3_RTS__CAN1_RX 0x30f1
364MX28_PAD_PWM0__I2C1_SCL 0x3101
365MX28_PAD_PWM1__I2C1_SDA 0x3111
366MX28_PAD_PWM2__USB0_ID 0x3121
367MX28_PAD_SAIF0_MCLK__PWM_3 0x3141
368MX28_PAD_SAIF0_LRCLK__PWM_4 0x3151
369MX28_PAD_SAIF0_BITCLK__PWM_5 0x3161
370MX28_PAD_SAIF0_SDATA0__PWM_6 0x3171
371MX28_PAD_I2C0_SCL__TIMROT_ROTARYA 0x3181
372MX28_PAD_I2C0_SDA__TIMROT_ROTARYB 0x3191
373MX28_PAD_SAIF1_SDATA0__PWM_7 0x31a1
374MX28_PAD_LCD_RESET__LCD_VSYNC 0x31e1
375MX28_PAD_ENET0_MDC__GPMI_CE4N 0x4001
376MX28_PAD_ENET0_MDIO__GPMI_CE5N 0x4011
377MX28_PAD_ENET0_RX_EN__GPMI_CE6N 0x4021
378MX28_PAD_ENET0_RXD0__GPMI_CE7N 0x4031
379MX28_PAD_ENET0_RXD1__GPMI_READY4 0x4041
380MX28_PAD_ENET0_TX_CLK__HSADC_TRIGGER 0x4051
381MX28_PAD_ENET0_TX_EN__GPMI_READY5 0x4061
382MX28_PAD_ENET0_TXD0__GPMI_READY6 0x4071
383MX28_PAD_ENET0_TXD1__GPMI_READY7 0x4081
384MX28_PAD_ENET0_RXD2__ENET1_RXD0 0x4091
385MX28_PAD_ENET0_RXD3__ENET1_RXD1 0x40a1
386MX28_PAD_ENET0_TXD2__ENET1_TXD0 0x40b1
387MX28_PAD_ENET0_TXD3__ENET1_TXD1 0x40c1
388MX28_PAD_ENET0_RX_CLK__ENET0_RX_ER 0x40d1
389MX28_PAD_ENET0_COL__ENET1_TX_EN 0x40e1
390MX28_PAD_ENET0_CRS__ENET1_RX_EN 0x40f1
391MX28_PAD_GPMI_CE2N__ENET0_RX_ER 0x0122
392MX28_PAD_GPMI_CE3N__SAIF1_MCLK 0x0132
393MX28_PAD_GPMI_RDY0__USB0_ID 0x0142
394MX28_PAD_GPMI_RDY2__ENET0_TX_ER 0x0162
395MX28_PAD_GPMI_RDY3__HSADC_TRIGGER 0x0172
396MX28_PAD_GPMI_ALE__SSP3_D4 0x01a2
397MX28_PAD_GPMI_CLE__SSP3_D5 0x01b2
398MX28_PAD_LCD_D00__ETM_DA0 0x1002
399MX28_PAD_LCD_D01__ETM_DA1 0x1012
400MX28_PAD_LCD_D02__ETM_DA2 0x1022
401MX28_PAD_LCD_D03__ETM_DA3 0x1032
402MX28_PAD_LCD_D04__ETM_DA4 0x1042
403MX28_PAD_LCD_D05__ETM_DA5 0x1052
404MX28_PAD_LCD_D06__ETM_DA6 0x1062
405MX28_PAD_LCD_D07__ETM_DA7 0x1072
406MX28_PAD_LCD_D08__ETM_DA8 0x1082
407MX28_PAD_LCD_D09__ETM_DA9 0x1092
408MX28_PAD_LCD_D10__ETM_DA10 0x10a2
409MX28_PAD_LCD_D11__ETM_DA11 0x10b2
410MX28_PAD_LCD_D12__ETM_DA12 0x10c2
411MX28_PAD_LCD_D13__ETM_DA13 0x10d2
412MX28_PAD_LCD_D14__ETM_DA14 0x10e2
413MX28_PAD_LCD_D15__ETM_DA15 0x10f2
414MX28_PAD_LCD_D16__ETM_DA7 0x1102
415MX28_PAD_LCD_D17__ETM_DA6 0x1112
416MX28_PAD_LCD_D18__ETM_DA5 0x1122
417MX28_PAD_LCD_D19__ETM_DA4 0x1132
418MX28_PAD_LCD_D20__ETM_DA3 0x1142
419MX28_PAD_LCD_D21__ETM_DA2 0x1152
420MX28_PAD_LCD_D22__ETM_DA1 0x1162
421MX28_PAD_LCD_D23__ETM_DA0 0x1172
422MX28_PAD_LCD_RD_E__ETM_TCTL 0x1182
423MX28_PAD_LCD_WR_RWN__ETM_TCLK 0x1192
424MX28_PAD_LCD_HSYNC__ETM_TCTL 0x11d2
425MX28_PAD_LCD_DOTCLK__ETM_TCLK 0x11e2
426MX28_PAD_SSP1_SCK__ENET0_1588_EVENT2_OUT 0x20c2
427MX28_PAD_SSP1_CMD__ENET0_1588_EVENT2_IN 0x20d2
428MX28_PAD_SSP1_DATA0__ENET0_1588_EVENT3_OUT 0x20e2
429MX28_PAD_SSP1_DATA3__ENET0_1588_EVENT3_IN 0x20f2
430MX28_PAD_SSP2_SCK__SAIF0_SDATA1 0x2102
431MX28_PAD_SSP2_MOSI__SAIF0_SDATA2 0x2112
432MX28_PAD_SSP2_MISO__SAIF1_SDATA1 0x2122
433MX28_PAD_SSP2_SS0__SAIF1_SDATA2 0x2132
434MX28_PAD_SSP2_SS1__USB1_OVERCURRENT 0x2142
435MX28_PAD_SSP2_SS2__USB0_OVERCURRENT 0x2152
436MX28_PAD_SSP3_SCK__ENET1_1588_EVENT0_OUT 0x2182
437MX28_PAD_SSP3_MOSI__ENET1_1588_EVENT0_IN 0x2192
438MX28_PAD_SSP3_MISO__ENET1_1588_EVENT1_OUT 0x21a2
439MX28_PAD_SSP3_SS0__ENET1_1588_EVENT1_IN 0x21b2
440MX28_PAD_AUART0_RX__DUART_CTS 0x3002
441MX28_PAD_AUART0_TX__DUART_RTS 0x3012
442MX28_PAD_AUART0_CTS__DUART_RX 0x3022
443MX28_PAD_AUART0_RTS__DUART_TX 0x3032
444MX28_PAD_AUART1_RX__PWM_0 0x3042
445MX28_PAD_AUART1_TX__PWM_1 0x3052
446MX28_PAD_AUART1_CTS__TIMROT_ROTARYA 0x3062
447MX28_PAD_AUART1_RTS__TIMROT_ROTARYB 0x3072
448MX28_PAD_AUART2_RX__SSP3_D4 0x3082
449MX28_PAD_AUART2_TX__SSP3_D5 0x3092
450MX28_PAD_AUART2_CTS__SAIF1_BITCLK 0x30a2
451MX28_PAD_AUART2_RTS__SAIF1_LRCLK 0x30b2
452MX28_PAD_AUART3_RX__ENET0_1588_EVENT0_OUT 0x30c2
453MX28_PAD_AUART3_TX__ENET0_1588_EVENT0_IN 0x30d2
454MX28_PAD_AUART3_CTS__ENET0_1588_EVENT1_OUT 0x30e2
455MX28_PAD_AUART3_RTS__ENET0_1588_EVENT1_IN 0x30f2
456MX28_PAD_PWM0__DUART_RX 0x3102
457MX28_PAD_PWM1__DUART_TX 0x3112
458MX28_PAD_PWM2__USB1_OVERCURRENT 0x3122
459MX28_PAD_SAIF0_MCLK__AUART4_CTS 0x3142
460MX28_PAD_SAIF0_LRCLK__AUART4_RTS 0x3152
461MX28_PAD_SAIF0_BITCLK__AUART4_RX 0x3162
462MX28_PAD_SAIF0_SDATA0__AUART4_TX 0x3172
463MX28_PAD_I2C0_SCL__DUART_RX 0x3182
464MX28_PAD_I2C0_SDA__DUART_TX 0x3192
465MX28_PAD_SAIF1_SDATA0__SAIF0_SDATA1 0x31a2
466MX28_PAD_SPDIF__ENET1_RX_ER 0x31b2
467MX28_PAD_ENET0_MDC__SAIF0_SDATA1 0x4002
468MX28_PAD_ENET0_MDIO__SAIF0_SDATA2 0x4012
469MX28_PAD_ENET0_RX_EN__SAIF1_SDATA1 0x4022
470MX28_PAD_ENET0_RXD0__SAIF1_SDATA2 0x4032
471MX28_PAD_ENET0_TX_CLK__ENET0_1588_EVENT2_OUT 0x4052
472MX28_PAD_ENET0_RXD2__ENET0_1588_EVENT0_OUT 0x4092
473MX28_PAD_ENET0_RXD3__ENET0_1588_EVENT0_IN 0x40a2
474MX28_PAD_ENET0_TXD2__ENET0_1588_EVENT1_OUT 0x40b2
475MX28_PAD_ENET0_TXD3__ENET0_1588_EVENT1_IN 0x40c2
476MX28_PAD_ENET0_RX_CLK__ENET0_1588_EVENT2_IN 0x40d2
477MX28_PAD_ENET0_COL__ENET0_1588_EVENT3_OUT 0x40e2
478MX28_PAD_ENET0_CRS__ENET0_1588_EVENT3_IN 0x40f2
479MX28_PAD_GPMI_D00__GPIO_0_0 0x0003
480MX28_PAD_GPMI_D01__GPIO_0_1 0x0013
481MX28_PAD_GPMI_D02__GPIO_0_2 0x0023
482MX28_PAD_GPMI_D03__GPIO_0_3 0x0033
483MX28_PAD_GPMI_D04__GPIO_0_4 0x0043
484MX28_PAD_GPMI_D05__GPIO_0_5 0x0053
485MX28_PAD_GPMI_D06__GPIO_0_6 0x0063
486MX28_PAD_GPMI_D07__GPIO_0_7 0x0073
487MX28_PAD_GPMI_CE0N__GPIO_0_16 0x0103
488MX28_PAD_GPMI_CE1N__GPIO_0_17 0x0113
489MX28_PAD_GPMI_CE2N__GPIO_0_18 0x0123
490MX28_PAD_GPMI_CE3N__GPIO_0_19 0x0133
491MX28_PAD_GPMI_RDY0__GPIO_0_20 0x0143
492MX28_PAD_GPMI_RDY1__GPIO_0_21 0x0153
493MX28_PAD_GPMI_RDY2__GPIO_0_22 0x0163
494MX28_PAD_GPMI_RDY3__GPIO_0_23 0x0173
495MX28_PAD_GPMI_RDN__GPIO_0_24 0x0183
496MX28_PAD_GPMI_WRN__GPIO_0_25 0x0193
497MX28_PAD_GPMI_ALE__GPIO_0_26 0x01a3
498MX28_PAD_GPMI_CLE__GPIO_0_27 0x01b3
499MX28_PAD_GPMI_RESETN__GPIO_0_28 0x01c3
500MX28_PAD_LCD_D00__GPIO_1_0 0x1003
501MX28_PAD_LCD_D01__GPIO_1_1 0x1013
502MX28_PAD_LCD_D02__GPIO_1_2 0x1023
503MX28_PAD_LCD_D03__GPIO_1_3 0x1033
504MX28_PAD_LCD_D04__GPIO_1_4 0x1043
505MX28_PAD_LCD_D05__GPIO_1_5 0x1053
506MX28_PAD_LCD_D06__GPIO_1_6 0x1063
507MX28_PAD_LCD_D07__GPIO_1_7 0x1073
508MX28_PAD_LCD_D08__GPIO_1_8 0x1083
509MX28_PAD_LCD_D09__GPIO_1_9 0x1093
510MX28_PAD_LCD_D10__GPIO_1_10 0x10a3
511MX28_PAD_LCD_D11__GPIO_1_11 0x10b3
512MX28_PAD_LCD_D12__GPIO_1_12 0x10c3
513MX28_PAD_LCD_D13__GPIO_1_13 0x10d3
514MX28_PAD_LCD_D14__GPIO_1_14 0x10e3
515MX28_PAD_LCD_D15__GPIO_1_15 0x10f3
516MX28_PAD_LCD_D16__GPIO_1_16 0x1103
517MX28_PAD_LCD_D17__GPIO_1_17 0x1113
518MX28_PAD_LCD_D18__GPIO_1_18 0x1123
519MX28_PAD_LCD_D19__GPIO_1_19 0x1133
520MX28_PAD_LCD_D20__GPIO_1_20 0x1143
521MX28_PAD_LCD_D21__GPIO_1_21 0x1153
522MX28_PAD_LCD_D22__GPIO_1_22 0x1163
523MX28_PAD_LCD_D23__GPIO_1_23 0x1173
524MX28_PAD_LCD_RD_E__GPIO_1_24 0x1183
525MX28_PAD_LCD_WR_RWN__GPIO_1_25 0x1193
526MX28_PAD_LCD_RS__GPIO_1_26 0x11a3
527MX28_PAD_LCD_CS__GPIO_1_27 0x11b3
528MX28_PAD_LCD_VSYNC__GPIO_1_28 0x11c3
529MX28_PAD_LCD_HSYNC__GPIO_1_29 0x11d3
530MX28_PAD_LCD_DOTCLK__GPIO_1_30 0x11e3
531MX28_PAD_LCD_ENABLE__GPIO_1_31 0x11f3
532MX28_PAD_SSP0_DATA0__GPIO_2_0 0x2003
533MX28_PAD_SSP0_DATA1__GPIO_2_1 0x2013
534MX28_PAD_SSP0_DATA2__GPIO_2_2 0x2023
535MX28_PAD_SSP0_DATA3__GPIO_2_3 0x2033
536MX28_PAD_SSP0_DATA4__GPIO_2_4 0x2043
537MX28_PAD_SSP0_DATA5__GPIO_2_5 0x2053
538MX28_PAD_SSP0_DATA6__GPIO_2_6 0x2063
539MX28_PAD_SSP0_DATA7__GPIO_2_7 0x2073
540MX28_PAD_SSP0_CMD__GPIO_2_8 0x2083
541MX28_PAD_SSP0_DETECT__GPIO_2_9 0x2093
542MX28_PAD_SSP0_SCK__GPIO_2_10 0x20a3
543MX28_PAD_SSP1_SCK__GPIO_2_12 0x20c3
544MX28_PAD_SSP1_CMD__GPIO_2_13 0x20d3
545MX28_PAD_SSP1_DATA0__GPIO_2_14 0x20e3
546MX28_PAD_SSP1_DATA3__GPIO_2_15 0x20f3
547MX28_PAD_SSP2_SCK__GPIO_2_16 0x2103
548MX28_PAD_SSP2_MOSI__GPIO_2_17 0x2113
549MX28_PAD_SSP2_MISO__GPIO_2_18 0x2123
550MX28_PAD_SSP2_SS0__GPIO_2_19 0x2133
551MX28_PAD_SSP2_SS1__GPIO_2_20 0x2143
552MX28_PAD_SSP2_SS2__GPIO_2_21 0x2153
553MX28_PAD_SSP3_SCK__GPIO_2_24 0x2183
554MX28_PAD_SSP3_MOSI__GPIO_2_25 0x2193
555MX28_PAD_SSP3_MISO__GPIO_2_26 0x21a3
556MX28_PAD_SSP3_SS0__GPIO_2_27 0x21b3
557MX28_PAD_AUART0_RX__GPIO_3_0 0x3003
558MX28_PAD_AUART0_TX__GPIO_3_1 0x3013
559MX28_PAD_AUART0_CTS__GPIO_3_2 0x3023
560MX28_PAD_AUART0_RTS__GPIO_3_3 0x3033
561MX28_PAD_AUART1_RX__GPIO_3_4 0x3043
562MX28_PAD_AUART1_TX__GPIO_3_5 0x3053
563MX28_PAD_AUART1_CTS__GPIO_3_6 0x3063
564MX28_PAD_AUART1_RTS__GPIO_3_7 0x3073
565MX28_PAD_AUART2_RX__GPIO_3_8 0x3083
566MX28_PAD_AUART2_TX__GPIO_3_9 0x3093
567MX28_PAD_AUART2_CTS__GPIO_3_10 0x30a3
568MX28_PAD_AUART2_RTS__GPIO_3_11 0x30b3
569MX28_PAD_AUART3_RX__GPIO_3_12 0x30c3
570MX28_PAD_AUART3_TX__GPIO_3_13 0x30d3
571MX28_PAD_AUART3_CTS__GPIO_3_14 0x30e3
572MX28_PAD_AUART3_RTS__GPIO_3_15 0x30f3
573MX28_PAD_PWM0__GPIO_3_16 0x3103
574MX28_PAD_PWM1__GPIO_3_17 0x3113
575MX28_PAD_PWM2__GPIO_3_18 0x3123
576MX28_PAD_SAIF0_MCLK__GPIO_3_20 0x3143
577MX28_PAD_SAIF0_LRCLK__GPIO_3_21 0x3153
578MX28_PAD_SAIF0_BITCLK__GPIO_3_22 0x3163
579MX28_PAD_SAIF0_SDATA0__GPIO_3_23 0x3173
580MX28_PAD_I2C0_SCL__GPIO_3_24 0x3183
581MX28_PAD_I2C0_SDA__GPIO_3_25 0x3193
582MX28_PAD_SAIF1_SDATA0__GPIO_3_26 0x31a3
583MX28_PAD_SPDIF__GPIO_3_27 0x31b3
584MX28_PAD_PWM3__GPIO_3_28 0x31c3
585MX28_PAD_PWM4__GPIO_3_29 0x31d3
586MX28_PAD_LCD_RESET__GPIO_3_30 0x31e3
587MX28_PAD_ENET0_MDC__GPIO_4_0 0x4003
588MX28_PAD_ENET0_MDIO__GPIO_4_1 0x4013
589MX28_PAD_ENET0_RX_EN__GPIO_4_2 0x4023
590MX28_PAD_ENET0_RXD0__GPIO_4_3 0x4033
591MX28_PAD_ENET0_RXD1__GPIO_4_4 0x4043
592MX28_PAD_ENET0_TX_CLK__GPIO_4_5 0x4053
593MX28_PAD_ENET0_TX_EN__GPIO_4_6 0x4063
594MX28_PAD_ENET0_TXD0__GPIO_4_7 0x4073
595MX28_PAD_ENET0_TXD1__GPIO_4_8 0x4083
596MX28_PAD_ENET0_RXD2__GPIO_4_9 0x4093
597MX28_PAD_ENET0_RXD3__GPIO_4_10 0x40a3
598MX28_PAD_ENET0_TXD2__GPIO_4_11 0x40b3
599MX28_PAD_ENET0_TXD3__GPIO_4_12 0x40c3
600MX28_PAD_ENET0_RX_CLK__GPIO_4_13 0x40d3
601MX28_PAD_ENET0_COL__GPIO_4_14 0x40e3
602MX28_PAD_ENET0_CRS__GPIO_4_15 0x40f3
603MX28_PAD_ENET_CLK__GPIO_4_16 0x4103
604MX28_PAD_JTAG_RTCK__GPIO_4_20 0x4143
605
606Valid values for i.MX23 pinmux-id:
607
608pinmux id
609------ --
610MX23_PAD_GPMI_D00__GPMI_D00 0x0000
611MX23_PAD_GPMI_D01__GPMI_D01 0x0010
612MX23_PAD_GPMI_D02__GPMI_D02 0x0020
613MX23_PAD_GPMI_D03__GPMI_D03 0x0030
614MX23_PAD_GPMI_D04__GPMI_D04 0x0040
615MX23_PAD_GPMI_D05__GPMI_D05 0x0050
616MX23_PAD_GPMI_D06__GPMI_D06 0x0060
617MX23_PAD_GPMI_D07__GPMI_D07 0x0070
618MX23_PAD_GPMI_D08__GPMI_D08 0x0080
619MX23_PAD_GPMI_D09__GPMI_D09 0x0090
620MX23_PAD_GPMI_D10__GPMI_D10 0x00a0
621MX23_PAD_GPMI_D11__GPMI_D11 0x00b0
622MX23_PAD_GPMI_D12__GPMI_D12 0x00c0
623MX23_PAD_GPMI_D13__GPMI_D13 0x00d0
624MX23_PAD_GPMI_D14__GPMI_D14 0x00e0
625MX23_PAD_GPMI_D15__GPMI_D15 0x00f0
626MX23_PAD_GPMI_CLE__GPMI_CLE 0x0100
627MX23_PAD_GPMI_ALE__GPMI_ALE 0x0110
628MX23_PAD_GPMI_CE2N__GPMI_CE2N 0x0120
629MX23_PAD_GPMI_RDY0__GPMI_RDY0 0x0130
630MX23_PAD_GPMI_RDY1__GPMI_RDY1 0x0140
631MX23_PAD_GPMI_RDY2__GPMI_RDY2 0x0150
632MX23_PAD_GPMI_RDY3__GPMI_RDY3 0x0160
633MX23_PAD_GPMI_WPN__GPMI_WPN 0x0170
634MX23_PAD_GPMI_WRN__GPMI_WRN 0x0180
635MX23_PAD_GPMI_RDN__GPMI_RDN 0x0190
636MX23_PAD_AUART1_CTS__AUART1_CTS 0x01a0
637MX23_PAD_AUART1_RTS__AUART1_RTS 0x01b0
638MX23_PAD_AUART1_RX__AUART1_RX 0x01c0
639MX23_PAD_AUART1_TX__AUART1_TX 0x01d0
640MX23_PAD_I2C_SCL__I2C_SCL 0x01e0
641MX23_PAD_I2C_SDA__I2C_SDA 0x01f0
642MX23_PAD_LCD_D00__LCD_D00 0x1000
643MX23_PAD_LCD_D01__LCD_D01 0x1010
644MX23_PAD_LCD_D02__LCD_D02 0x1020
645MX23_PAD_LCD_D03__LCD_D03 0x1030
646MX23_PAD_LCD_D04__LCD_D04 0x1040
647MX23_PAD_LCD_D05__LCD_D05 0x1050
648MX23_PAD_LCD_D06__LCD_D06 0x1060
649MX23_PAD_LCD_D07__LCD_D07 0x1070
650MX23_PAD_LCD_D08__LCD_D08 0x1080
651MX23_PAD_LCD_D09__LCD_D09 0x1090
652MX23_PAD_LCD_D10__LCD_D10 0x10a0
653MX23_PAD_LCD_D11__LCD_D11 0x10b0
654MX23_PAD_LCD_D12__LCD_D12 0x10c0
655MX23_PAD_LCD_D13__LCD_D13 0x10d0
656MX23_PAD_LCD_D14__LCD_D14 0x10e0
657MX23_PAD_LCD_D15__LCD_D15 0x10f0
658MX23_PAD_LCD_D16__LCD_D16 0x1100
659MX23_PAD_LCD_D17__LCD_D17 0x1110
660MX23_PAD_LCD_RESET__LCD_RESET 0x1120
661MX23_PAD_LCD_RS__LCD_RS 0x1130
662MX23_PAD_LCD_WR__LCD_WR 0x1140
663MX23_PAD_LCD_CS__LCD_CS 0x1150
664MX23_PAD_LCD_DOTCK__LCD_DOTCK 0x1160
665MX23_PAD_LCD_ENABLE__LCD_ENABLE 0x1170
666MX23_PAD_LCD_HSYNC__LCD_HSYNC 0x1180
667MX23_PAD_LCD_VSYNC__LCD_VSYNC 0x1190
668MX23_PAD_PWM0__PWM0 0x11a0
669MX23_PAD_PWM1__PWM1 0x11b0
670MX23_PAD_PWM2__PWM2 0x11c0
671MX23_PAD_PWM3__PWM3 0x11d0
672MX23_PAD_PWM4__PWM4 0x11e0
673MX23_PAD_SSP1_CMD__SSP1_CMD 0x2000
674MX23_PAD_SSP1_DETECT__SSP1_DETECT 0x2010
675MX23_PAD_SSP1_DATA0__SSP1_DATA0 0x2020
676MX23_PAD_SSP1_DATA1__SSP1_DATA1 0x2030
677MX23_PAD_SSP1_DATA2__SSP1_DATA2 0x2040
678MX23_PAD_SSP1_DATA3__SSP1_DATA3 0x2050
679MX23_PAD_SSP1_SCK__SSP1_SCK 0x2060
680MX23_PAD_ROTARYA__ROTARYA 0x2070
681MX23_PAD_ROTARYB__ROTARYB 0x2080
682MX23_PAD_EMI_A00__EMI_A00 0x2090
683MX23_PAD_EMI_A01__EMI_A01 0x20a0
684MX23_PAD_EMI_A02__EMI_A02 0x20b0
685MX23_PAD_EMI_A03__EMI_A03 0x20c0
686MX23_PAD_EMI_A04__EMI_A04 0x20d0
687MX23_PAD_EMI_A05__EMI_A05 0x20e0
688MX23_PAD_EMI_A06__EMI_A06 0x20f0
689MX23_PAD_EMI_A07__EMI_A07 0x2100
690MX23_PAD_EMI_A08__EMI_A08 0x2110
691MX23_PAD_EMI_A09__EMI_A09 0x2120
692MX23_PAD_EMI_A10__EMI_A10 0x2130
693MX23_PAD_EMI_A11__EMI_A11 0x2140
694MX23_PAD_EMI_A12__EMI_A12 0x2150
695MX23_PAD_EMI_BA0__EMI_BA0 0x2160
696MX23_PAD_EMI_BA1__EMI_BA1 0x2170
697MX23_PAD_EMI_CASN__EMI_CASN 0x2180
698MX23_PAD_EMI_CE0N__EMI_CE0N 0x2190
699MX23_PAD_EMI_CE1N__EMI_CE1N 0x21a0
700MX23_PAD_GPMI_CE1N__GPMI_CE1N 0x21b0
701MX23_PAD_GPMI_CE0N__GPMI_CE0N 0x21c0
702MX23_PAD_EMI_CKE__EMI_CKE 0x21d0
703MX23_PAD_EMI_RASN__EMI_RASN 0x21e0
704MX23_PAD_EMI_WEN__EMI_WEN 0x21f0
705MX23_PAD_EMI_D00__EMI_D00 0x3000
706MX23_PAD_EMI_D01__EMI_D01 0x3010
707MX23_PAD_EMI_D02__EMI_D02 0x3020
708MX23_PAD_EMI_D03__EMI_D03 0x3030
709MX23_PAD_EMI_D04__EMI_D04 0x3040
710MX23_PAD_EMI_D05__EMI_D05 0x3050
711MX23_PAD_EMI_D06__EMI_D06 0x3060
712MX23_PAD_EMI_D07__EMI_D07 0x3070
713MX23_PAD_EMI_D08__EMI_D08 0x3080
714MX23_PAD_EMI_D09__EMI_D09 0x3090
715MX23_PAD_EMI_D10__EMI_D10 0x30a0
716MX23_PAD_EMI_D11__EMI_D11 0x30b0
717MX23_PAD_EMI_D12__EMI_D12 0x30c0
718MX23_PAD_EMI_D13__EMI_D13 0x30d0
719MX23_PAD_EMI_D14__EMI_D14 0x30e0
720MX23_PAD_EMI_D15__EMI_D15 0x30f0
721MX23_PAD_EMI_DQM0__EMI_DQM0 0x3100
722MX23_PAD_EMI_DQM1__EMI_DQM1 0x3110
723MX23_PAD_EMI_DQS0__EMI_DQS0 0x3120
724MX23_PAD_EMI_DQS1__EMI_DQS1 0x3130
725MX23_PAD_EMI_CLK__EMI_CLK 0x3140
726MX23_PAD_EMI_CLKN__EMI_CLKN 0x3150
727MX23_PAD_GPMI_D00__LCD_D8 0x0001
728MX23_PAD_GPMI_D01__LCD_D9 0x0011
729MX23_PAD_GPMI_D02__LCD_D10 0x0021
730MX23_PAD_GPMI_D03__LCD_D11 0x0031
731MX23_PAD_GPMI_D04__LCD_D12 0x0041
732MX23_PAD_GPMI_D05__LCD_D13 0x0051
733MX23_PAD_GPMI_D06__LCD_D14 0x0061
734MX23_PAD_GPMI_D07__LCD_D15 0x0071
735MX23_PAD_GPMI_D08__LCD_D18 0x0081
736MX23_PAD_GPMI_D09__LCD_D19 0x0091
737MX23_PAD_GPMI_D10__LCD_D20 0x00a1
738MX23_PAD_GPMI_D11__LCD_D21 0x00b1
739MX23_PAD_GPMI_D12__LCD_D22 0x00c1
740MX23_PAD_GPMI_D13__LCD_D23 0x00d1
741MX23_PAD_GPMI_D14__AUART2_RX 0x00e1
742MX23_PAD_GPMI_D15__AUART2_TX 0x00f1
743MX23_PAD_GPMI_CLE__LCD_D16 0x0101
744MX23_PAD_GPMI_ALE__LCD_D17 0x0111
745MX23_PAD_GPMI_CE2N__ATA_A2 0x0121
746MX23_PAD_AUART1_RTS__IR_CLK 0x01b1
747MX23_PAD_AUART1_RX__IR_RX 0x01c1
748MX23_PAD_AUART1_TX__IR_TX 0x01d1
749MX23_PAD_I2C_SCL__GPMI_RDY2 0x01e1
750MX23_PAD_I2C_SDA__GPMI_CE2N 0x01f1
751MX23_PAD_LCD_D00__ETM_DA8 0x1001
752MX23_PAD_LCD_D01__ETM_DA9 0x1011
753MX23_PAD_LCD_D02__ETM_DA10 0x1021
754MX23_PAD_LCD_D03__ETM_DA11 0x1031
755MX23_PAD_LCD_D04__ETM_DA12 0x1041
756MX23_PAD_LCD_D05__ETM_DA13 0x1051
757MX23_PAD_LCD_D06__ETM_DA14 0x1061
758MX23_PAD_LCD_D07__ETM_DA15 0x1071
759MX23_PAD_LCD_D08__ETM_DA0 0x1081
760MX23_PAD_LCD_D09__ETM_DA1 0x1091
761MX23_PAD_LCD_D10__ETM_DA2 0x10a1
762MX23_PAD_LCD_D11__ETM_DA3 0x10b1
763MX23_PAD_LCD_D12__ETM_DA4 0x10c1
764MX23_PAD_LCD_D13__ETM_DA5 0x10d1
765MX23_PAD_LCD_D14__ETM_DA6 0x10e1
766MX23_PAD_LCD_D15__ETM_DA7 0x10f1
767MX23_PAD_LCD_RESET__ETM_TCTL 0x1121
768MX23_PAD_LCD_RS__ETM_TCLK 0x1131
769MX23_PAD_LCD_DOTCK__GPMI_RDY3 0x1161
770MX23_PAD_LCD_ENABLE__I2C_SCL 0x1171
771MX23_PAD_LCD_HSYNC__I2C_SDA 0x1181
772MX23_PAD_LCD_VSYNC__LCD_BUSY 0x1191
773MX23_PAD_PWM0__ROTARYA 0x11a1
774MX23_PAD_PWM1__ROTARYB 0x11b1
775MX23_PAD_PWM2__GPMI_RDY3 0x11c1
776MX23_PAD_PWM3__ETM_TCTL 0x11d1
777MX23_PAD_PWM4__ETM_TCLK 0x11e1
778MX23_PAD_SSP1_DETECT__GPMI_CE3N 0x2011
779MX23_PAD_SSP1_DATA1__I2C_SCL 0x2031
780MX23_PAD_SSP1_DATA2__I2C_SDA 0x2041
781MX23_PAD_ROTARYA__AUART2_RTS 0x2071
782MX23_PAD_ROTARYB__AUART2_CTS 0x2081
783MX23_PAD_GPMI_D00__SSP2_DATA0 0x0002
784MX23_PAD_GPMI_D01__SSP2_DATA1 0x0012
785MX23_PAD_GPMI_D02__SSP2_DATA2 0x0022
786MX23_PAD_GPMI_D03__SSP2_DATA3 0x0032
787MX23_PAD_GPMI_D04__SSP2_DATA4 0x0042
788MX23_PAD_GPMI_D05__SSP2_DATA5 0x0052
789MX23_PAD_GPMI_D06__SSP2_DATA6 0x0062
790MX23_PAD_GPMI_D07__SSP2_DATA7 0x0072
791MX23_PAD_GPMI_D08__SSP1_DATA4 0x0082
792MX23_PAD_GPMI_D09__SSP1_DATA5 0x0092
793MX23_PAD_GPMI_D10__SSP1_DATA6 0x00a2
794MX23_PAD_GPMI_D11__SSP1_DATA7 0x00b2
795MX23_PAD_GPMI_D15__GPMI_CE3N 0x00f2
796MX23_PAD_GPMI_RDY0__SSP2_DETECT 0x0132
797MX23_PAD_GPMI_RDY1__SSP2_CMD 0x0142
798MX23_PAD_GPMI_WRN__SSP2_SCK 0x0182
799MX23_PAD_AUART1_CTS__SSP1_DATA4 0x01a2
800MX23_PAD_AUART1_RTS__SSP1_DATA5 0x01b2
801MX23_PAD_AUART1_RX__SSP1_DATA6 0x01c2
802MX23_PAD_AUART1_TX__SSP1_DATA7 0x01d2
803MX23_PAD_I2C_SCL__AUART1_TX 0x01e2
804MX23_PAD_I2C_SDA__AUART1_RX 0x01f2
805MX23_PAD_LCD_D08__SAIF2_SDATA0 0x1082
806MX23_PAD_LCD_D09__SAIF1_SDATA0 0x1092
807MX23_PAD_LCD_D10__SAIF_MCLK_BITCLK 0x10a2
808MX23_PAD_LCD_D11__SAIF_LRCLK 0x10b2
809MX23_PAD_LCD_D12__SAIF2_SDATA1 0x10c2
810MX23_PAD_LCD_D13__SAIF2_SDATA2 0x10d2
811MX23_PAD_LCD_D14__SAIF1_SDATA2 0x10e2
812MX23_PAD_LCD_D15__SAIF1_SDATA1 0x10f2
813MX23_PAD_LCD_D16__SAIF_ALT_BITCLK 0x1102
814MX23_PAD_LCD_RESET__GPMI_CE3N 0x1122
815MX23_PAD_PWM0__DUART_RX 0x11a2
816MX23_PAD_PWM1__DUART_TX 0x11b2
817MX23_PAD_PWM3__AUART1_CTS 0x11d2
818MX23_PAD_PWM4__AUART1_RTS 0x11e2
819MX23_PAD_SSP1_CMD__JTAG_TDO 0x2002
820MX23_PAD_SSP1_DETECT__USB_OTG_ID 0x2012
821MX23_PAD_SSP1_DATA0__JTAG_TDI 0x2022
822MX23_PAD_SSP1_DATA1__JTAG_TCLK 0x2032
823MX23_PAD_SSP1_DATA2__JTAG_RTCK 0x2042
824MX23_PAD_SSP1_DATA3__JTAG_TMS 0x2052
825MX23_PAD_SSP1_SCK__JTAG_TRST 0x2062
826MX23_PAD_ROTARYA__SPDIF 0x2072
827MX23_PAD_ROTARYB__GPMI_CE3N 0x2082
828MX23_PAD_GPMI_D00__GPIO_0_0 0x0003
829MX23_PAD_GPMI_D01__GPIO_0_1 0x0013
830MX23_PAD_GPMI_D02__GPIO_0_2 0x0023
831MX23_PAD_GPMI_D03__GPIO_0_3 0x0033
832MX23_PAD_GPMI_D04__GPIO_0_4 0x0043
833MX23_PAD_GPMI_D05__GPIO_0_5 0x0053
834MX23_PAD_GPMI_D06__GPIO_0_6 0x0063
835MX23_PAD_GPMI_D07__GPIO_0_7 0x0073
836MX23_PAD_GPMI_D08__GPIO_0_8 0x0083
837MX23_PAD_GPMI_D09__GPIO_0_9 0x0093
838MX23_PAD_GPMI_D10__GPIO_0_10 0x00a3
839MX23_PAD_GPMI_D11__GPIO_0_11 0x00b3
840MX23_PAD_GPMI_D12__GPIO_0_12 0x00c3
841MX23_PAD_GPMI_D13__GPIO_0_13 0x00d3
842MX23_PAD_GPMI_D14__GPIO_0_14 0x00e3
843MX23_PAD_GPMI_D15__GPIO_0_15 0x00f3
844MX23_PAD_GPMI_CLE__GPIO_0_16 0x0103
845MX23_PAD_GPMI_ALE__GPIO_0_17 0x0113
846MX23_PAD_GPMI_CE2N__GPIO_0_18 0x0123
847MX23_PAD_GPMI_RDY0__GPIO_0_19 0x0133
848MX23_PAD_GPMI_RDY1__GPIO_0_20 0x0143
849MX23_PAD_GPMI_RDY2__GPIO_0_21 0x0153
850MX23_PAD_GPMI_RDY3__GPIO_0_22 0x0163
851MX23_PAD_GPMI_WPN__GPIO_0_23 0x0173
852MX23_PAD_GPMI_WRN__GPIO_0_24 0x0183
853MX23_PAD_GPMI_RDN__GPIO_0_25 0x0193
854MX23_PAD_AUART1_CTS__GPIO_0_26 0x01a3
855MX23_PAD_AUART1_RTS__GPIO_0_27 0x01b3
856MX23_PAD_AUART1_RX__GPIO_0_28 0x01c3
857MX23_PAD_AUART1_TX__GPIO_0_29 0x01d3
858MX23_PAD_I2C_SCL__GPIO_0_30 0x01e3
859MX23_PAD_I2C_SDA__GPIO_0_31 0x01f3
860MX23_PAD_LCD_D00__GPIO_1_0 0x1003
861MX23_PAD_LCD_D01__GPIO_1_1 0x1013
862MX23_PAD_LCD_D02__GPIO_1_2 0x1023
863MX23_PAD_LCD_D03__GPIO_1_3 0x1033
864MX23_PAD_LCD_D04__GPIO_1_4 0x1043
865MX23_PAD_LCD_D05__GPIO_1_5 0x1053
866MX23_PAD_LCD_D06__GPIO_1_6 0x1063
867MX23_PAD_LCD_D07__GPIO_1_7 0x1073
868MX23_PAD_LCD_D08__GPIO_1_8 0x1083
869MX23_PAD_LCD_D09__GPIO_1_9 0x1093
870MX23_PAD_LCD_D10__GPIO_1_10 0x10a3
871MX23_PAD_LCD_D11__GPIO_1_11 0x10b3
872MX23_PAD_LCD_D12__GPIO_1_12 0x10c3
873MX23_PAD_LCD_D13__GPIO_1_13 0x10d3
874MX23_PAD_LCD_D14__GPIO_1_14 0x10e3
875MX23_PAD_LCD_D15__GPIO_1_15 0x10f3
876MX23_PAD_LCD_D16__GPIO_1_16 0x1103
877MX23_PAD_LCD_D17__GPIO_1_17 0x1113
878MX23_PAD_LCD_RESET__GPIO_1_18 0x1123
879MX23_PAD_LCD_RS__GPIO_1_19 0x1133
880MX23_PAD_LCD_WR__GPIO_1_20 0x1143
881MX23_PAD_LCD_CS__GPIO_1_21 0x1153
882MX23_PAD_LCD_DOTCK__GPIO_1_22 0x1163
883MX23_PAD_LCD_ENABLE__GPIO_1_23 0x1173
884MX23_PAD_LCD_HSYNC__GPIO_1_24 0x1183
885MX23_PAD_LCD_VSYNC__GPIO_1_25 0x1193
886MX23_PAD_PWM0__GPIO_1_26 0x11a3
887MX23_PAD_PWM1__GPIO_1_27 0x11b3
888MX23_PAD_PWM2__GPIO_1_28 0x11c3
889MX23_PAD_PWM3__GPIO_1_29 0x11d3
890MX23_PAD_PWM4__GPIO_1_30 0x11e3
891MX23_PAD_SSP1_CMD__GPIO_2_0 0x2003
892MX23_PAD_SSP1_DETECT__GPIO_2_1 0x2013
893MX23_PAD_SSP1_DATA0__GPIO_2_2 0x2023
894MX23_PAD_SSP1_DATA1__GPIO_2_3 0x2033
895MX23_PAD_SSP1_DATA2__GPIO_2_4 0x2043
896MX23_PAD_SSP1_DATA3__GPIO_2_5 0x2053
897MX23_PAD_SSP1_SCK__GPIO_2_6 0x2063
898MX23_PAD_ROTARYA__GPIO_2_7 0x2073
899MX23_PAD_ROTARYB__GPIO_2_8 0x2083
900MX23_PAD_EMI_A00__GPIO_2_9 0x2093
901MX23_PAD_EMI_A01__GPIO_2_10 0x20a3
902MX23_PAD_EMI_A02__GPIO_2_11 0x20b3
903MX23_PAD_EMI_A03__GPIO_2_12 0x20c3
904MX23_PAD_EMI_A04__GPIO_2_13 0x20d3
905MX23_PAD_EMI_A05__GPIO_2_14 0x20e3
906MX23_PAD_EMI_A06__GPIO_2_15 0x20f3
907MX23_PAD_EMI_A07__GPIO_2_16 0x2103
908MX23_PAD_EMI_A08__GPIO_2_17 0x2113
909MX23_PAD_EMI_A09__GPIO_2_18 0x2123
910MX23_PAD_EMI_A10__GPIO_2_19 0x2133
911MX23_PAD_EMI_A11__GPIO_2_20 0x2143
912MX23_PAD_EMI_A12__GPIO_2_21 0x2153
913MX23_PAD_EMI_BA0__GPIO_2_22 0x2163
914MX23_PAD_EMI_BA1__GPIO_2_23 0x2173
915MX23_PAD_EMI_CASN__GPIO_2_24 0x2183
916MX23_PAD_EMI_CE0N__GPIO_2_25 0x2193
917MX23_PAD_EMI_CE1N__GPIO_2_26 0x21a3
918MX23_PAD_GPMI_CE1N__GPIO_2_27 0x21b3
919MX23_PAD_GPMI_CE0N__GPIO_2_28 0x21c3
920MX23_PAD_EMI_CKE__GPIO_2_29 0x21d3
921MX23_PAD_EMI_RASN__GPIO_2_30 0x21e3
922MX23_PAD_EMI_WEN__GPIO_2_31 0x21f3
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt
index 734d9b04d533..caf297bee1fb 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt
@@ -41,7 +41,7 @@ pinctrl-bindings.txt:
41 41
42Required: pins 42Required: pins
43Options: function, bias-disable, bias-pull-up, bias-pull-down, 43Options: function, bias-disable, bias-pull-up, bias-pull-down,
44 bias-pin-default, drive-open-drain. 44 drive-open-drain.
45 45
46Note that many of these properties are only valid for certain specific pins. 46Note that many of these properties are only valid for certain specific pins.
47See the Palmas device datasheet for complete details regarding which pins 47See the Palmas device datasheet for complete details regarding which pins
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt
index 5a02e30dd262..7069a0b84e3a 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt
@@ -72,6 +72,13 @@ Optional properties:
72 /* pin base, nr pins & gpio function */ 72 /* pin base, nr pins & gpio function */
73 pinctrl-single,gpio-range = <&range 0 3 0 &range 3 9 1>; 73 pinctrl-single,gpio-range = <&range 0 3 0 &range 3 9 1>;
74 74
75- interrupt-controller : standard interrupt controller binding if using
76 interrupts for wake-up events for example. In this case pinctrl-single
77 is set up as a chained interrupt controller and the wake-up interrupts
78 can be requested by the drivers using request_irq().
79
80- #interrupt-cells : standard interrupt binding if using interrupts
81
75This driver assumes that there is only one register for each pin (unless the 82This driver assumes that there is only one register for each pin (unless the
76pinctrl-single,bit-per-mux is set), and uses the common pinctrl bindings as 83pinctrl-single,bit-per-mux is set), and uses the common pinctrl bindings as
77specified in the pinctrl-bindings.txt document in this directory. 84specified in the pinctrl-bindings.txt document in this directory.
@@ -121,6 +128,8 @@ pmx_core: pinmux@4a100040 {
121 reg = <0x4a100040 0x0196>; 128 reg = <0x4a100040 0x0196>;
122 #address-cells = <1>; 129 #address-cells = <1>;
123 #size-cells = <0>; 130 #size-cells = <0>;
131 #interrupt-cells = <1>;
132 interrupt-controller;
124 pinctrl-single,register-width = <16>; 133 pinctrl-single,register-width = <16>;
125 pinctrl-single,function-mask = <0xffff>; 134 pinctrl-single,function-mask = <0xffff>;
126}; 135};
@@ -131,6 +140,8 @@ pmx_wkup: pinmux@4a31e040 {
131 reg = <0x4a31e040 0x0038>; 140 reg = <0x4a31e040 0x0038>;
132 #address-cells = <1>; 141 #address-cells = <1>;
133 #size-cells = <0>; 142 #size-cells = <0>;
143 #interrupt-cells = <1>;
144 interrupt-controller;
134 pinctrl-single,register-width = <16>; 145 pinctrl-single,register-width = <16>;
135 pinctrl-single,function-mask = <0xffff>; 146 pinctrl-single,function-mask = <0xffff>;
136}; 147};
diff --git a/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt
index b0fb1018d7ad..f378d342aae4 100644
--- a/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt
@@ -21,10 +21,13 @@ defined as gpio sub-nodes of the pinmux controller.
21Required properties for iomux controller: 21Required properties for iomux controller:
22 - compatible: one of "rockchip,rk2928-pinctrl", "rockchip,rk3066a-pinctrl" 22 - compatible: one of "rockchip,rk2928-pinctrl", "rockchip,rk3066a-pinctrl"
23 "rockchip,rk3066b-pinctrl", "rockchip,rk3188-pinctrl" 23 "rockchip,rk3066b-pinctrl", "rockchip,rk3188-pinctrl"
24 - reg: first element is the general register space of the iomux controller
25 second element is the separate pull register space of the rk3188
24 26
25Required properties for gpio sub nodes: 27Required properties for gpio sub nodes:
26 - compatible: "rockchip,gpio-bank" 28 - compatible: "rockchip,gpio-bank", "rockchip,rk3188-gpio-bank0"
27 - reg: register of the gpio bank (different than the iomux registerset) 29 - reg: register of the gpio bank (different than the iomux registerset)
30 second element: separate pull register for rk3188 bank0
28 - interrupts: base interrupt of the gpio bank in the interrupt controller 31 - interrupts: base interrupt of the gpio bank in the interrupt controller
29 - clocks: clock that drives this bank 32 - clocks: clock that drives this bank
30 - gpio-controller: identifies the node as a gpio controller and pin bank. 33 - gpio-controller: identifies the node as a gpio controller and pin bank.
@@ -95,3 +98,44 @@ uart2: serial@20064000 {
95 pinctrl-names = "default"; 98 pinctrl-names = "default";
96 pinctrl-0 = <&uart2_xfer>; 99 pinctrl-0 = <&uart2_xfer>;
97}; 100};
101
102Example for rk3188:
103
104 pinctrl@20008000 {
105 compatible = "rockchip,rk3188-pinctrl";
106 reg = <0x20008000 0xa0>,
107 <0x20008164 0x1a0>;
108 #address-cells = <1>;
109 #size-cells = <1>;
110 ranges;
111
112 gpio0: gpio0@0x2000a000 {
113 compatible = "rockchip,rk3188-gpio-bank0";
114 reg = <0x2000a000 0x100>,
115 <0x20004064 0x8>;
116 interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
117 clocks = <&clk_gates8 9>;
118
119 gpio-controller;
120 #gpio-cells = <2>;
121
122 interrupt-controller;
123 #interrupt-cells = <2>;
124 };
125
126 gpio1: gpio1@0x2003c000 {
127 compatible = "rockchip,gpio-bank";
128 reg = <0x2003c000 0x100>;
129 interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
130 clocks = <&clk_gates8 10>;
131
132 gpio-controller;
133 #gpio-cells = <2>;
134
135 interrupt-controller;
136 #interrupt-cells = <2>;
137 };
138
139 ...
140
141 };
diff --git a/Documentation/devicetree/bindings/power/twl-charger.txt b/Documentation/devicetree/bindings/power/twl-charger.txt
new file mode 100644
index 000000000000..d5c706216df5
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/twl-charger.txt
@@ -0,0 +1,20 @@
1TWL BCI (Battery Charger Interface)
2
3Required properties:
4- compatible:
5 - "ti,twl4030-bci"
6- interrupts: two interrupt lines from the TWL SIH (secondary
7 interrupt handler) - interrupts 9 and 2.
8
9Optional properties:
10- ti,bb-uvolt: microvolts for charging the backup battery.
11- ti,bb-uamp: microamps for charging the backup battery.
12
13Examples:
14
15bci {
16 compatible = "ti,twl4030-bci";
17 interrupts = <9>, <2>;
18 ti,bb-uvolt = <3200000>;
19 ti,bb-uamp = <150>;
20};
diff --git a/Documentation/devicetree/bindings/power_supply/ti,bq24735.txt b/Documentation/devicetree/bindings/power_supply/ti,bq24735.txt
new file mode 100644
index 000000000000..4f6a550184d0
--- /dev/null
+++ b/Documentation/devicetree/bindings/power_supply/ti,bq24735.txt
@@ -0,0 +1,32 @@
1TI BQ24735 Charge Controller
2~~~~~~~~~~
3
4Required properties :
5 - compatible : "ti,bq24735"
6
7Optional properties :
8 - interrupts : Specify the interrupt to be used to trigger when the AC
9 adapter is either plugged in or removed.
10 - ti,ac-detect-gpios : This GPIO is optionally used to read the AC adapter
11 presence. This is a Host GPIO that is configured as an input and
12 connected to the bq24735.
13 - ti,charge-current : Used to control and set the charging current. This value
14 must be between 128mA and 8.128A with a 64mA step resolution. The POR value
15 is 0x0000h. This number is in mA (e.g. 8192), see spec for more information
16 about the ChargeCurrent (0x14h) register.
17 - ti,charge-voltage : Used to control and set the charging voltage. This value
18 must be between 1.024V and 19.2V with a 16mV step resolution. The POR value
19 is 0x0000h. This number is in mV (e.g. 19200), see spec for more information
20 about the ChargeVoltage (0x15h) register.
21 - ti,input-current : Used to control and set the charger input current. This
22 value must be between 128mA and 8.064A with a 128mA step resolution. The
23 POR value is 0x1000h. This number is in mA (e.g. 8064), see the spec for
24 more information about the InputCurrent (0x3fh) register.
25
26Example:
27
28 bq24735@9 {
29 compatible = "ti,bq24735";
30 reg = <0x9>;
31 ti,ac-detect-gpios = <&gpio 72 0x1>;
32 }
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/dma.txt b/Documentation/devicetree/bindings/powerpc/fsl/dma.txt
index 2a4b4bce6110..7fc1b010fa75 100644
--- a/Documentation/devicetree/bindings/powerpc/fsl/dma.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/dma.txt
@@ -1,33 +1,30 @@
1* Freescale 83xx DMA Controller 1* Freescale DMA Controllers
2 2
3Freescale PowerPC 83xx have on chip general purpose DMA controllers. 3** Freescale Elo DMA Controller
4 This is a little-endian 4-channel DMA controller, used in Freescale mpc83xx
5 series chips such as mpc8315, mpc8349, mpc8379 etc.
4 6
5Required properties: 7Required properties:
6 8
7- compatible : compatible list, contains 2 entries, first is 9- compatible : must include "fsl,elo-dma"
8 "fsl,CHIP-dma", where CHIP is the processor 10- reg : DMA General Status Register, i.e. DGSR which contains
9 (mpc8349, mpc8360, etc.) and the second is 11 status for all the 4 DMA channels
10 "fsl,elo-dma" 12- ranges : describes the mapping between the address space of the
11- reg : <registers mapping for DMA general status reg> 13 DMA channels and the address space of the DMA controller
12- ranges : Should be defined as specified in 1) to describe the
13 DMA controller channels.
14- cell-index : controller index. 0 for controller @ 0x8100 14- cell-index : controller index. 0 for controller @ 0x8100
15- interrupts : <interrupt mapping for DMA IRQ> 15- interrupts : interrupt specifier for DMA IRQ
16- interrupt-parent : optional, if needed for interrupt mapping 16- interrupt-parent : optional, if needed for interrupt mapping
17 17
18
19- DMA channel nodes: 18- DMA channel nodes:
20 - compatible : compatible list, contains 2 entries, first is 19 - compatible : must include "fsl,elo-dma-channel"
21 "fsl,CHIP-dma-channel", where CHIP is the processor 20 However, see note below.
22 (mpc8349, mpc8350, etc.) and the second is 21 - reg : DMA channel specific registers
23 "fsl,elo-dma-channel". However, see note below. 22 - cell-index : DMA channel index starts at 0.
24 - reg : <registers mapping for channel>
25 - cell-index : dma channel index starts at 0.
26 23
27Optional properties: 24Optional properties:
28 - interrupts : <interrupt mapping for DMA channel IRQ> 25 - interrupts : interrupt specifier for DMA channel IRQ
29 (on 83xx this is expected to be identical to 26 (on 83xx this is expected to be identical to
30 the interrupts property of the parent node) 27 the interrupts property of the parent node)
31 - interrupt-parent : optional, if needed for interrupt mapping 28 - interrupt-parent : optional, if needed for interrupt mapping
32 29
33Example: 30Example:
@@ -70,30 +67,27 @@ Example:
70 }; 67 };
71 }; 68 };
72 69
73* Freescale 85xx/86xx DMA Controller 70** Freescale EloPlus DMA Controller
74 71 This is a 4-channel DMA controller with extended addresses and chaining,
75Freescale PowerPC 85xx/86xx have on chip general purpose DMA controllers. 72 mainly used in Freescale mpc85xx/86xx, Pxxx and BSC series chips, such as
73 mpc8540, mpc8641 p4080, bsc9131 etc.
76 74
77Required properties: 75Required properties:
78 76
79- compatible : compatible list, contains 2 entries, first is 77- compatible : must include "fsl,eloplus-dma"
80 "fsl,CHIP-dma", where CHIP is the processor 78- reg : DMA General Status Register, i.e. DGSR which contains
81 (mpc8540, mpc8540, etc.) and the second is 79 status for all the 4 DMA channels
82 "fsl,eloplus-dma"
83- reg : <registers mapping for DMA general status reg>
84- cell-index : controller index. 0 for controller @ 0x21000, 80- cell-index : controller index. 0 for controller @ 0x21000,
85 1 for controller @ 0xc000 81 1 for controller @ 0xc000
86- ranges : Should be defined as specified in 1) to describe the 82- ranges : describes the mapping between the address space of the
87 DMA controller channels. 83 DMA channels and the address space of the DMA controller
88 84
89- DMA channel nodes: 85- DMA channel nodes:
90 - compatible : compatible list, contains 2 entries, first is 86 - compatible : must include "fsl,eloplus-dma-channel"
91 "fsl,CHIP-dma-channel", where CHIP is the processor 87 However, see note below.
92 (mpc8540, mpc8560, etc.) and the second is 88 - cell-index : DMA channel index starts at 0.
93 "fsl,eloplus-dma-channel". However, see note below. 89 - reg : DMA channel specific registers
94 - cell-index : dma channel index starts at 0. 90 - interrupts : interrupt specifier for DMA channel IRQ
95 - reg : <registers mapping for channel>
96 - interrupts : <interrupt mapping for DMA channel IRQ>
97 - interrupt-parent : optional, if needed for interrupt mapping 91 - interrupt-parent : optional, if needed for interrupt mapping
98 92
99Example: 93Example:
@@ -134,6 +128,76 @@ Example:
134 }; 128 };
135 }; 129 };
136 130
131** Freescale Elo3 DMA Controller
132 DMA controller which has same function as EloPlus except that Elo3 has 8
133 channels while EloPlus has only 4, it is used in Freescale Txxx and Bxxx
134 series chips, such as t1040, t4240, b4860.
135
136Required properties:
137
138- compatible : must include "fsl,elo3-dma"
139- reg : contains two entries for DMA General Status Registers,
140 i.e. DGSR0 which includes status for channel 1~4, and
141 DGSR1 for channel 5~8
142- ranges : describes the mapping between the address space of the
143 DMA channels and the address space of the DMA controller
144
145- DMA channel nodes:
146 - compatible : must include "fsl,eloplus-dma-channel"
147 - reg : DMA channel specific registers
148 - interrupts : interrupt specifier for DMA channel IRQ
149 - interrupt-parent : optional, if needed for interrupt mapping
150
151Example:
152dma@100300 {
153 #address-cells = <1>;
154 #size-cells = <1>;
155 compatible = "fsl,elo3-dma";
156 reg = <0x100300 0x4>,
157 <0x100600 0x4>;
158 ranges = <0x0 0x100100 0x500>;
159 dma-channel@0 {
160 compatible = "fsl,eloplus-dma-channel";
161 reg = <0x0 0x80>;
162 interrupts = <28 2 0 0>;
163 };
164 dma-channel@80 {
165 compatible = "fsl,eloplus-dma-channel";
166 reg = <0x80 0x80>;
167 interrupts = <29 2 0 0>;
168 };
169 dma-channel@100 {
170 compatible = "fsl,eloplus-dma-channel";
171 reg = <0x100 0x80>;
172 interrupts = <30 2 0 0>;
173 };
174 dma-channel@180 {
175 compatible = "fsl,eloplus-dma-channel";
176 reg = <0x180 0x80>;
177 interrupts = <31 2 0 0>;
178 };
179 dma-channel@300 {
180 compatible = "fsl,eloplus-dma-channel";
181 reg = <0x300 0x80>;
182 interrupts = <76 2 0 0>;
183 };
184 dma-channel@380 {
185 compatible = "fsl,eloplus-dma-channel";
186 reg = <0x380 0x80>;
187 interrupts = <77 2 0 0>;
188 };
189 dma-channel@400 {
190 compatible = "fsl,eloplus-dma-channel";
191 reg = <0x400 0x80>;
192 interrupts = <78 2 0 0>;
193 };
194 dma-channel@480 {
195 compatible = "fsl,eloplus-dma-channel";
196 reg = <0x480 0x80>;
197 interrupts = <79 2 0 0>;
198 };
199};
200
137Note on DMA channel compatible properties: The compatible property must say 201Note on DMA channel compatible properties: The compatible property must say
138"fsl,elo-dma-channel" or "fsl,eloplus-dma-channel" to be used by the Elo DMA 202"fsl,elo-dma-channel" or "fsl,eloplus-dma-channel" to be used by the Elo DMA
139driver (fsldma). Any DMA channel used by fsldma cannot be used by another 203driver (fsldma). Any DMA channel used by fsldma cannot be used by another
diff --git a/Documentation/devicetree/bindings/pwm/pwm-samsung.txt b/Documentation/devicetree/bindings/pwm/pwm-samsung.txt
index d61fccd40bad..5538de9c2007 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-samsung.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-samsung.txt
@@ -15,7 +15,7 @@ Required properties:
15 samsung,s5pc100-pwm - for 32-bit timers present on S5PC100, S5PV210, 15 samsung,s5pc100-pwm - for 32-bit timers present on S5PC100, S5PV210,
16 Exynos4210 rev0 SoCs 16 Exynos4210 rev0 SoCs
17 samsung,exynos4210-pwm - for 32-bit timers present on Exynos4210, 17 samsung,exynos4210-pwm - for 32-bit timers present on Exynos4210,
18 Exynos4x12 and Exynos5250 SoCs 18 Exynos4x12, Exynos5250 and Exynos5420 SoCs
19- reg: base address and size of register area 19- reg: base address and size of register area
20- interrupts: list of timer interrupts (one interrupt per timer, starting at 20- interrupts: list of timer interrupts (one interrupt per timer, starting at
21 timer 0) 21 timer 0)
diff --git a/Documentation/devicetree/bindings/regulator/as3722-regulator.txt b/Documentation/devicetree/bindings/regulator/as3722-regulator.txt
new file mode 100644
index 000000000000..caad0c8a258d
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/as3722-regulator.txt
@@ -0,0 +1,91 @@
1Regulator of AMS AS3722 PMIC.
2Name of the regulator subnode must be "regulators".
3
4Optional properties:
5--------------------
6The input supply of regulators are the optional properties on the
7regulator node. The AS3722 is having 7 DCDC step-down regulators as
8sd[0-6], 10 LDOs as ldo[0-7], ldo[9-11]. The input supply of these
9regulators are provided through following properties:
10vsup-sd2-supply: Input supply for SD2.
11vsup-sd3-supply: Input supply for SD3.
12vsup-sd4-supply: Input supply for SD4.
13vsup-sd5-supply: Input supply for SD5.
14vin-ldo0-supply: Input supply for LDO0.
15vin-ldo1-6-supply: Input supply for LDO1 and LDO6.
16vin-ldo2-5-7-supply: Input supply for LDO2, LDO5 and LDO7.
17vin-ldo3-4-supply: Input supply for LDO3 and LDO4.
18vin-ldo9-10-supply: Input supply for LDO9 and LDO10.
19vin-ldo11-supply: Input supply for LDO11.
20
21Optional nodes:
22--------------
23- regulators : Must contain a sub-node per regulator from the list below.
24 Each sub-node should contain the constraints and initialization
25 information for that regulator. See regulator.txt for a
26 description of standard properties for these sub-nodes.
27 Additional custom properties are listed below.
28 sd[0-6], ldo[0-7], ldo[9-11].
29
30 Optional sub-node properties:
31 ----------------------------
32 ams,ext-control: External control of the rail. The option of
33 this properties will tell which external input is
34 controlling this rail. Valid values are 0, 1, 2 ad 3.
35 0: There is no external control of this rail.
36 1: Rail is controlled by ENABLE1 input pin.
37 2: Rail is controlled by ENABLE2 input pin.
38 3: Rail is controlled by ENABLE3 input pin.
39 ams,enable-tracking: Enable tracking with SD1, only supported
40 by LDO3.
41
42Example:
43-------
44 ams3722: ams3722 {
45 compatible = "ams,as3722";
46 reg = <0x40>;
47 ...
48
49 regulators {
50 vsup-sd2-supply = <...>;
51 ...
52
53 sd0 {
54 regulator-name = "vdd_cpu";
55 regulator-min-microvolt = <700000>;
56 regulator-max-microvolt = <1400000>;
57 regulator-always-on;
58 ams,ext-control = <2>;
59 };
60
61 sd1 {
62 regulator-name = "vdd_core";
63 regulator-min-microvolt = <700000>;
64 regulator-max-microvolt = <1400000>;
65 regulator-always-on;
66 ams,ext-control = <1>;
67 };
68
69 sd2 {
70 regulator-name = "vddio_ddr";
71 regulator-min-microvolt = <1350000>;
72 regulator-max-microvolt = <1350000>;
73 regulator-always-on;
74 };
75
76 sd4 {
77 regulator-name = "avdd-hdmi-pex";
78 regulator-min-microvolt = <1050000>;
79 regulator-max-microvolt = <1050000>;
80 regulator-always-on;
81 };
82
83 sd5 {
84 regulator-name = "vdd-1v8";
85 regulator-min-microvolt = <1800000>;
86 regulator-max-microvolt = <1800000>;
87 regulator-always-on;
88 };
89 ....
90 };
91 };
diff --git a/Documentation/devicetree/bindings/regulator/da9210.txt b/Documentation/devicetree/bindings/regulator/da9210.txt
new file mode 100644
index 000000000000..f120f229d67d
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/da9210.txt
@@ -0,0 +1,21 @@
1* Dialog Semiconductor DA9210 Voltage Regulator
2
3Required properties:
4
5- compatible: must be "diasemi,da9210"
6- reg: the i2c slave address of the regulator. It should be 0x68.
7
8Any standard regulator properties can be used to configure the single da9210
9DCDC.
10
11Example:
12
13 da9210@68 {
14 compatible = "diasemi,da9210";
15 reg = <0x68>;
16
17 regulator-min-microvolt = <900000>;
18 regulator-max-microvolt = <1000000>;
19 regulator-boot-on;
20 regulator-always-on;
21 };
diff --git a/Documentation/devicetree/bindings/regulator/palmas-pmic.txt b/Documentation/devicetree/bindings/regulator/palmas-pmic.txt
index 875639ae0606..42e6b6bc48ff 100644
--- a/Documentation/devicetree/bindings/regulator/palmas-pmic.txt
+++ b/Documentation/devicetree/bindings/regulator/palmas-pmic.txt
@@ -26,11 +26,17 @@ Optional nodes:
26 26
27 For ti,palmas-pmic - smps12, smps123, smps3 depending on OTP, 27 For ti,palmas-pmic - smps12, smps123, smps3 depending on OTP,
28 smps45, smps457, smps7 depending on variant, smps6, smps[8-9], 28 smps45, smps457, smps7 depending on variant, smps6, smps[8-9],
29 smps10_out2, smps10_out1, do[1-9], ldoln, ldousb. 29 smps10_out2, smps10_out1, ldo[1-9], ldoln, ldousb.
30 30
31 Optional sub-node properties: 31 Optional sub-node properties:
32 ti,warm-reset - maintain voltage during warm reset(boolean) 32 ti,warm-reset - maintain voltage during warm reset(boolean)
33 ti,roof-floor - control voltage selection by pin(boolean) 33 ti,roof-floor - This takes as optional argument on platform supporting
34 the rail from desired external control. If there is no argument then
35 it will be assume that it is controlled by NSLEEP pin.
36 The valid value for external pins are:
37 ENABLE1 then 1,
38 ENABLE2 then 2 or
39 NSLEEP then 3.
34 ti,mode-sleep - mode to adopt in pmic sleep 0 - off, 1 - auto, 40 ti,mode-sleep - mode to adopt in pmic sleep 0 - off, 1 - auto,
35 2 - eco, 3 - forced pwm 41 2 - eco, 3 - forced pwm
36 ti,smps-range - OTP has the wrong range set for the hardware so override 42 ti,smps-range - OTP has the wrong range set for the hardware so override
@@ -61,7 +67,7 @@ pmic {
61 regulator-always-on; 67 regulator-always-on;
62 regulator-boot-on; 68 regulator-boot-on;
63 ti,warm-reset; 69 ti,warm-reset;
64 ti,roof-floor; 70 ti,roof-floor = <1>; /* ENABLE1 control */
65 ti,mode-sleep = <0>; 71 ti,mode-sleep = <0>;
66 ti,smps-range = <1>; 72 ti,smps-range = <1>;
67 }; 73 };
diff --git a/Documentation/devicetree/bindings/regulator/regulator.txt b/Documentation/devicetree/bindings/regulator/regulator.txt
index 2bd8f0978765..e2c7f1e7251a 100644
--- a/Documentation/devicetree/bindings/regulator/regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/regulator.txt
@@ -14,6 +14,11 @@ Optional properties:
14- regulator-ramp-delay: ramp delay for regulator(in uV/uS) 14- regulator-ramp-delay: ramp delay for regulator(in uV/uS)
15 For hardwares which support disabling ramp rate, it should be explicitly 15 For hardwares which support disabling ramp rate, it should be explicitly
16 intialised to zero (regulator-ramp-delay = <0>) for disabling ramp delay. 16 intialised to zero (regulator-ramp-delay = <0>) for disabling ramp delay.
17- regulator-enable-ramp-delay: The time taken, in microseconds, for the supply
18 rail to reach the target voltage, plus/minus whatever tolerance the board
19 design requires. This property describes the total system ramp time
20 required due to the combination of internal ramping of the regulator itself,
21 and board design issues such as trace capacitance and load on the supply.
17 22
18Deprecated properties: 23Deprecated properties:
19- regulator-compatible: If a regulator chip contains multiple 24- regulator-compatible: If a regulator chip contains multiple
diff --git a/Documentation/devicetree/bindings/sound/cs42l73.txt b/Documentation/devicetree/bindings/sound/cs42l73.txt
new file mode 100644
index 000000000000..80ae910dbf6c
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/cs42l73.txt
@@ -0,0 +1,22 @@
1CS42L73 audio CODEC
2
3Required properties:
4
5 - compatible : "cirrus,cs42l73"
6
7 - reg : the I2C address of the device for I2C
8
9Optional properties:
10
11 - reset_gpio : a GPIO spec for the reset pin.
12 - chgfreq : Charge Pump Frequency values 0x00-0x0F
13
14
15Example:
16
17codec: cs42l73@4a {
18 compatible = "cirrus,cs42l73";
19 reg = <0x4a>;
20 reset_gpio = <&gpio 10 0>;
21 chgfreq = <0x05>;
22}; \ No newline at end of file
diff --git a/Documentation/devicetree/bindings/sound/davinci-evm-audio.txt b/Documentation/devicetree/bindings/sound/davinci-evm-audio.txt
new file mode 100644
index 000000000000..865178d5cdf3
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/davinci-evm-audio.txt
@@ -0,0 +1,42 @@
1* Texas Instruments SoC audio setups with TLV320AIC3X Codec
2
3Required properties:
4- compatible : "ti,da830-evm-audio" : forDM365/DA8xx/OMAPL1x/AM33xx
5- ti,model : The user-visible name of this sound complex.
6- ti,audio-codec : The phandle of the TLV320AIC3x audio codec
7- ti,mcasp-controller : The phandle of the McASP controller
8- ti,codec-clock-rate : The Codec Clock rate (in Hz) applied to the Codec
9- ti,audio-routing : A list of the connections between audio components.
10 Each entry is a pair of strings, the first being the connection's sink,
11 the second being the connection's source. Valid names for sources and
12 sinks are the codec's pins, and the jacks on the board:
13
14 Board connectors:
15
16 * Headphone Jack
17 * Line Out
18 * Mic Jack
19 * Line In
20
21
22Example:
23
24sound {
25 compatible = "ti,da830-evm-audio";
26 ti,model = "DA830 EVM";
27 ti,audio-codec = <&tlv320aic3x>;
28 ti,mcasp-controller = <&mcasp1>;
29 ti,codec-clock-rate = <12000000>;
30 ti,audio-routing =
31 "Headphone Jack", "HPLOUT",
32 "Headphone Jack", "HPROUT",
33 "Line Out", "LLOUT",
34 "Line Out", "RLOUT",
35 "MIC3L", "Mic Bias 2V",
36 "MIC3R", "Mic Bias 2V",
37 "Mic Bias 2V", "Mic Jack",
38 "LINE1L", "Line In",
39 "LINE2L", "Line In",
40 "LINE1R", "Line In",
41 "LINE2R", "Line In";
42};
diff --git a/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt b/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
index 374e145c2ef1..ed785b3f67be 100644
--- a/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
+++ b/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
@@ -4,17 +4,25 @@ Required properties:
4- compatible : 4- compatible :
5 "ti,dm646x-mcasp-audio" : for DM646x platforms 5 "ti,dm646x-mcasp-audio" : for DM646x platforms
6 "ti,da830-mcasp-audio" : for both DA830 & DA850 platforms 6 "ti,da830-mcasp-audio" : for both DA830 & DA850 platforms
7 "ti,omap2-mcasp-audio" : for OMAP2 platforms (TI81xx, AM33xx) 7 "ti,am33xx-mcasp-audio" : for AM33xx platforms (AM33xx, TI81xx)
8
9- reg : Should contain McASP registers offset and length
10- interrupts : Interrupt number for McASP
11- op-mode : I2S/DIT ops mode.
12- tdm-slots : Slots for TDM operation.
13- num-serializer : Serializers used by McASP.
14- serial-dir : A list of serializer pin mode. The list number should be equal
15 to "num-serializer" parameter. Each entry is a number indication
16 serializer pin direction. (0 - INACTIVE, 1 - TX, 2 - RX)
17 8
9- reg : Should contain reg specifiers for the entries in the reg-names property.
10- reg-names : Should contain:
11 * "mpu" for the main registers (required). For compatibility with
12 existing software, it is recommended this is the first entry.
13 * "dat" for separate data port register access (optional).
14- op-mode : I2S/DIT ops mode. 0 for I2S mode. 1 for DIT mode used for S/PDIF,
15 IEC60958-1, and AES-3 formats.
16- tdm-slots : Slots for TDM operation. Indicates number of channels transmitted
17 or received over one serializer.
18- serial-dir : A list of serializer configuration. Each entry is a number
19 indication for serializer pin direction.
20 (0 - INACTIVE, 1 - TX, 2 - RX)
21- dmas: two element list of DMA controller phandles and DMA request line
22 ordered pairs.
23- dma-names: identifier string for each DMA request line in the dmas property.
24 These strings correspond 1:1 with the ordered pairs in dmas. The dma
25 identifiers must be "rx" and "tx".
18 26
19Optional properties: 27Optional properties:
20 28
@@ -23,18 +31,23 @@ Optional properties:
23- rx-num-evt : FIFO levels. 31- rx-num-evt : FIFO levels.
24- sram-size-playback : size of sram to be allocated during playback 32- sram-size-playback : size of sram to be allocated during playback
25- sram-size-capture : size of sram to be allocated during capture 33- sram-size-capture : size of sram to be allocated during capture
34- interrupts : Interrupt numbers for McASP, currently not used by the driver
35- interrupt-names : Known interrupt names are "tx" and "rx"
36- pinctrl-0: Should specify pin control group used for this controller.
37- pinctrl-names: Should contain only one value - "default", for more details
38 please refer to pinctrl-bindings.txt
39
26 40
27Example: 41Example:
28 42
29mcasp0: mcasp0@1d00000 { 43mcasp0: mcasp0@1d00000 {
30 compatible = "ti,da830-mcasp-audio"; 44 compatible = "ti,da830-mcasp-audio";
31 #address-cells = <1>;
32 #size-cells = <0>;
33 reg = <0x100000 0x3000>; 45 reg = <0x100000 0x3000>;
34 interrupts = <82 83>; 46 reg-names "mpu";
47 interrupts = <82>, <83>;
48 interrupts-names = "tx", "rx";
35 op-mode = <0>; /* MCASP_IIS_MODE */ 49 op-mode = <0>; /* MCASP_IIS_MODE */
36 tdm-slots = <2>; 50 tdm-slots = <2>;
37 num-serializer = <16>;
38 serial-dir = < 51 serial-dir = <
39 0 0 0 0 /* 0: INACTIVE, 1: TX, 2: RX */ 52 0 0 0 0 /* 0: INACTIVE, 1: TX, 2: RX */
40 0 0 0 0 53 0 0 0 0
diff --git a/Documentation/devicetree/bindings/sound/tlv320aic3x.txt b/Documentation/devicetree/bindings/sound/tlv320aic3x.txt
index 705a6b156c6c..5e6040c2c2e9 100644
--- a/Documentation/devicetree/bindings/sound/tlv320aic3x.txt
+++ b/Documentation/devicetree/bindings/sound/tlv320aic3x.txt
@@ -24,10 +24,36 @@ Optional properties:
24 3 - MICBIAS output is connected to AVDD, 24 3 - MICBIAS output is connected to AVDD,
25 If this node is not mentioned or if the value is incorrect, then MicBias 25 If this node is not mentioned or if the value is incorrect, then MicBias
26 is powered down. 26 is powered down.
27- AVDD-supply, IOVDD-supply, DRVDD-supply, DVDD-supply : power supplies for the
28 device as covered in Documentation/devicetree/bindings/regulator/regulator.txt
29
30CODEC output pins:
31 * LLOUT
32 * RLOUT
33 * MONO_LOUT
34 * HPLOUT
35 * HPROUT
36 * HPLCOM
37 * HPRCOM
38
39CODEC input pins:
40 * MIC3L
41 * MIC3R
42 * LINE1L
43 * LINE2L
44 * LINE1R
45 * LINE2R
46
47The pins can be used in referring sound node's audio-routing property.
27 48
28Example: 49Example:
29 50
30tlv320aic3x: tlv320aic3x@1b { 51tlv320aic3x: tlv320aic3x@1b {
31 compatible = "ti,tlv320aic3x"; 52 compatible = "ti,tlv320aic3x";
32 reg = <0x1b>; 53 reg = <0x1b>;
54
55 AVDD-supply = <&regulator>;
56 IOVDD-supply = <&regulator>;
57 DRVDD-supply = <&regulator>;
58 DVDD-supply = <&regulator>;
33}; 59};
diff --git a/Documentation/devicetree/bindings/sound/tpa6130a2.txt b/Documentation/devicetree/bindings/sound/tpa6130a2.txt
new file mode 100644
index 000000000000..6dfa740e4b2d
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/tpa6130a2.txt
@@ -0,0 +1,27 @@
1Texas Instruments - tpa6130a2 Codec module
2
3The tpa6130a2 serial control bus communicates through I2C protocols
4
5Required properties:
6
7- compatible - "string" - One of:
8 "ti,tpa6130a2" - TPA6130A2
9 "ti,tpa6140a2" - TPA6140A2
10
11
12- reg - <int> - I2C slave address
13
14- Vdd-supply - <phandle> - power supply regulator
15
16Optional properties:
17
18- power-gpio - gpio pin to power the device
19
20Example:
21
22tpa6130a2: tpa6130a2@60 {
23 compatible = "ti,tpa6130a2";
24 reg = <0x60>;
25 Vdd-supply = <&vmmc2>;
26 power-gpio = <&gpio4 2 GPIO_ACTIVE_HIGH>;
27};
diff --git a/Documentation/devicetree/bindings/spi/omap-spi.txt b/Documentation/devicetree/bindings/spi/omap-spi.txt
index 4c85c4c69584..2ba5f9c023ac 100644
--- a/Documentation/devicetree/bindings/spi/omap-spi.txt
+++ b/Documentation/devicetree/bindings/spi/omap-spi.txt
@@ -2,8 +2,8 @@ OMAP2+ McSPI device
2 2
3Required properties: 3Required properties:
4- compatible : 4- compatible :
5 - "ti,omap2-spi" for OMAP2 & OMAP3. 5 - "ti,omap2-mcspi" for OMAP2 & OMAP3.
6 - "ti,omap4-spi" for OMAP4+. 6 - "ti,omap4-mcspi" for OMAP4+.
7- ti,spi-num-cs : Number of chipselect supported by the instance. 7- ti,spi-num-cs : Number of chipselect supported by the instance.
8- ti,hwmods: Name of the hwmod associated to the McSPI 8- ti,hwmods: Name of the hwmod associated to the McSPI
9- ti,pindir-d0-out-d1-in: Select the D0 pin as output and D1 as 9- ti,pindir-d0-out-d1-in: Select the D0 pin as output and D1 as
diff --git a/Documentation/devicetree/bindings/spi/sh-hspi.txt b/Documentation/devicetree/bindings/spi/sh-hspi.txt
new file mode 100644
index 000000000000..30b57b1c8a13
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/sh-hspi.txt
@@ -0,0 +1,7 @@
1Renesas HSPI.
2
3Required properties:
4- compatible : "renesas,hspi"
5- reg : Offset and length of the register set for the device
6- interrupts : interrupt line used by HSPI
7
diff --git a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
index 46882058b59b..ee05dc390694 100644
--- a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
+++ b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
@@ -1,7 +1,8 @@
1* Freescale i.MX28 LRADC device driver 1* Freescale i.MX28 LRADC device driver
2 2
3Required properties: 3Required properties:
4- compatible: Should be "fsl,imx28-lradc" 4- compatible: Should be "fsl,imx23-lradc" for i.MX23 SoC and "fsl,imx28-lradc"
5 for i.MX28 SoC
5- reg: Address and length of the register set for the device 6- reg: Address and length of the register set for the device
6- interrupts: Should contain the LRADC interrupts 7- interrupts: Should contain the LRADC interrupts
7 8
@@ -9,13 +10,38 @@ Optional properties:
9- fsl,lradc-touchscreen-wires: Number of wires used to connect the touchscreen 10- fsl,lradc-touchscreen-wires: Number of wires used to connect the touchscreen
10 to LRADC. Valid value is either 4 or 5. If this 11 to LRADC. Valid value is either 4 or 5. If this
11 property is not present, then the touchscreen is 12 property is not present, then the touchscreen is
12 disabled. 13 disabled. 5 wires is valid for i.MX28 SoC only.
14- fsl,ave-ctrl: number of samples per direction to calculate an average value.
15 Allowed value is 1 ... 31, default is 4
16- fsl,ave-delay: delay between consecutive samples. Allowed value is
17 1 ... 2047. It is used if 'fsl,ave-ctrl' > 1, counts at
18 2 kHz and its default is 2 (= 1 ms)
19- fsl,settling: delay between plate switch to next sample. Allowed value is
20 1 ... 2047. It counts at 2 kHz and its default is
21 10 (= 5 ms)
13 22
14Examples: 23Example for i.MX23 SoC:
24
25 lradc@80050000 {
26 compatible = "fsl,imx23-lradc";
27 reg = <0x80050000 0x2000>;
28 interrupts = <36 37 38 39 40 41 42 43 44>;
29 status = "okay";
30 fsl,lradc-touchscreen-wires = <4>;
31 fsl,ave-ctrl = <4>;
32 fsl,ave-delay = <2>;
33 fsl,settling = <10>;
34 };
35
36Example for i.MX28 SoC:
15 37
16 lradc@80050000 { 38 lradc@80050000 {
17 compatible = "fsl,imx28-lradc"; 39 compatible = "fsl,imx28-lradc";
18 reg = <0x80050000 0x2000>; 40 reg = <0x80050000 0x2000>;
19 interrupts = <10 14 15 16 17 18 19 41 interrupts = <10 14 15 16 17 18 19 20 21 22 23 24 25>;
20 20 21 22 23 24 25>; 42 status = "okay";
43 fsl,lradc-touchscreen-wires = <5>;
44 fsl,ave-ctrl = <4>;
45 fsl,ave-delay = <2>;
46 fsl,settling = <10>;
21 }; 47 };
diff --git a/Documentation/devicetree/bindings/timer/efm32,timer.txt b/Documentation/devicetree/bindings/timer/efm32,timer.txt
new file mode 100644
index 000000000000..97a568f696c9
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/efm32,timer.txt
@@ -0,0 +1,23 @@
1* EFM32 timer hardware
2
3The efm32 Giant Gecko SoCs come with four 16 bit timers. Two counters can be
4connected to form a 32 bit counter. Each timer has three Compare/Capture
5channels and can be used as PWM or Quadrature Decoder. Available clock sources
6are the cpu's HFPERCLK (with a 10-bit prescaler) or an external pin.
7
8Required properties:
9- compatible : Should be efm32,timer
10- reg : Address and length of the register set
11- clocks : Should contain a reference to the HFPERCLK
12
13Optional properties:
14- interrupts : Reference to the timer interrupt
15
16Example:
17
18timer@40010c00 {
19 compatible = "efm32,timer";
20 reg = <0x40010c00 0x400>;
21 interrupts = <14>;
22 clocks = <&cmu clk_HFPERCLKTIMER3>;
23};
diff --git a/Documentation/devicetree/bindings/usb/msm-hsusb.txt b/Documentation/devicetree/bindings/usb/msm-hsusb.txt
new file mode 100644
index 000000000000..5ea26c631e3a
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/msm-hsusb.txt
@@ -0,0 +1,17 @@
1MSM SoC HSUSB controllers
2
3EHCI
4
5Required properties:
6- compatible: Should contain "qcom,ehci-host"
7- regs: offset and length of the register set in the memory map
8- usb-phy: phandle for the PHY device
9
10Example EHCI controller device node:
11
12 ehci: ehci@f9a55000 {
13 compatible = "qcom,ehci-host";
14 reg = <0xf9a55000 0x400>;
15 usb-phy = <&usb_otg>;
16 };
17
diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt b/Documentation/devicetree/bindings/usb/omap-usb.txt
index 9088ab09e200..090e5e22bd2b 100644
--- a/Documentation/devicetree/bindings/usb/omap-usb.txt
+++ b/Documentation/devicetree/bindings/usb/omap-usb.txt
@@ -3,9 +3,6 @@ OMAP GLUE AND OTHER OMAP SPECIFIC COMPONENTS
3OMAP MUSB GLUE 3OMAP MUSB GLUE
4 - compatible : Should be "ti,omap4-musb" or "ti,omap3-musb" 4 - compatible : Should be "ti,omap4-musb" or "ti,omap3-musb"
5 - ti,hwmods : must be "usb_otg_hs" 5 - ti,hwmods : must be "usb_otg_hs"
6 - ti,has-mailbox : to specify that omap uses an external mailbox
7 (in control module) to communicate with the musb core during device connect
8 and disconnect.
9 - multipoint : Should be "1" indicating the musb controller supports 6 - multipoint : Should be "1" indicating the musb controller supports
10 multipoint. This is a MUSB configuration-specific setting. 7 multipoint. This is a MUSB configuration-specific setting.
11 - num-eps : Specifies the number of endpoints. This is also a 8 - num-eps : Specifies the number of endpoints. This is also a
@@ -19,6 +16,9 @@ OMAP MUSB GLUE
19 - power : Should be "50". This signifies the controller can supply up to 16 - power : Should be "50". This signifies the controller can supply up to
20 100mA when operating in host mode. 17 100mA when operating in host mode.
21 - usb-phy : the phandle for the PHY device 18 - usb-phy : the phandle for the PHY device
19 - phys : the phandle for the PHY device (used by generic PHY framework)
20 - phy-names : the names of the PHY corresponding to the PHYs present in the
21 *phy* phandle.
22 22
23Optional properties: 23Optional properties:
24 - ctrl-module : phandle of the control module this glue uses to write to 24 - ctrl-module : phandle of the control module this glue uses to write to
@@ -28,11 +28,12 @@ SOC specific device node entry
28usb_otg_hs: usb_otg_hs@4a0ab000 { 28usb_otg_hs: usb_otg_hs@4a0ab000 {
29 compatible = "ti,omap4-musb"; 29 compatible = "ti,omap4-musb";
30 ti,hwmods = "usb_otg_hs"; 30 ti,hwmods = "usb_otg_hs";
31 ti,has-mailbox;
32 multipoint = <1>; 31 multipoint = <1>;
33 num-eps = <16>; 32 num-eps = <16>;
34 ram-bits = <12>; 33 ram-bits = <12>;
35 ctrl-module = <&omap_control_usb>; 34 ctrl-module = <&omap_control_usb>;
35 phys = <&usb2_phy>;
36 phy-names = "usb2-phy";
36}; 37};
37 38
38Board specific device node entry 39Board specific device node entry
@@ -78,22 +79,22 @@ omap_dwc3 {
78OMAP CONTROL USB 79OMAP CONTROL USB
79 80
80Required properties: 81Required properties:
81 - compatible: Should be "ti,omap-control-usb" 82 - compatible: Should be one of
83 "ti,control-phy-otghs" - if it has otghs_control mailbox register as on OMAP4.
84 "ti,control-phy-usb2" - if it has Power down bit in control_dev_conf register
85 e.g. USB2_PHY on OMAP5.
86 "ti,control-phy-pipe3" - if it has DPLL and individual Rx & Tx power control
87 e.g. USB3 PHY and SATA PHY on OMAP5.
88 "ti,control-phy-dra7usb2" - if it has power down register like USB2 PHY on
89 DRA7 platform.
82 - reg : Address and length of the register set for the device. It contains 90 - reg : Address and length of the register set for the device. It contains
83 the address of "control_dev_conf" and "otghs_control" or "phy_power_usb" 91 the address of "otghs_control" for control-phy-otghs or "power" register
84 depending upon omap4 or omap5. 92 for other types.
85 - reg-names: The names of the register addresses corresponding to the registers 93 - reg-names: should be "otghs_control" control-phy-otghs and "power" for
86 filled in "reg". 94 other types.
87 - ti,type: This is used to differentiate whether the control module has
88 usb mailbox or usb3 phy power. omap4 has usb mailbox in control module to
89 notify events to the musb core and omap5 has usb3 phy power register to
90 power on usb3 phy. Should be "1" if it has mailbox and "2" if it has usb3
91 phy power.
92 95
93omap_control_usb: omap-control-usb@4a002300 { 96omap_control_usb: omap-control-usb@4a002300 {
94 compatible = "ti,omap-control-usb"; 97 compatible = "ti,control-phy-otghs";
95 reg = <0x4a002300 0x4>, 98 reg = <0x4a00233c 0x4>;
96 <0x4a00233c 0x4>; 99 reg-names = "otghs_control";
97 reg-names = "control_dev_conf", "otghs_control";
98 ti,type = <1>;
99}; 100};
diff --git a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt
index d7e272671c7e..1bd37faba05b 100644
--- a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt
+++ b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt
@@ -15,7 +15,7 @@ Optional properties:
15 15
16- vcc-supply: phandle to the regulator that provides RESET to the PHY. 16- vcc-supply: phandle to the regulator that provides RESET to the PHY.
17 17
18- reset-supply: phandle to the regulator that provides power to the PHY. 18- reset-gpios: Should specify the GPIO for reset.
19 19
20Example: 20Example:
21 21
@@ -25,10 +25,9 @@ Example:
25 clocks = <&osc 0>; 25 clocks = <&osc 0>;
26 clock-names = "main_clk"; 26 clock-names = "main_clk";
27 vcc-supply = <&hsusb1_vcc_regulator>; 27 vcc-supply = <&hsusb1_vcc_regulator>;
28 reset-supply = <&hsusb1_reset_regulator>; 28 reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
29 }; 29 };
30 30
31hsusb1_phy is a NOP USB PHY device that gets its clock from an oscillator 31hsusb1_phy is a NOP USB PHY device that gets its clock from an oscillator
32and expects that clock to be configured to 19.2MHz by the NOP PHY driver. 32and expects that clock to be configured to 19.2MHz by the NOP PHY driver.
33hsusb1_vcc_regulator provides power to the PHY and hsusb1_reset_regulator 33hsusb1_vcc_regulator provides power to the PHY and GPIO 7 controls RESET.
34controls RESET.
diff --git a/Documentation/devicetree/bindings/usb/usb-phy.txt b/Documentation/devicetree/bindings/usb/usb-phy.txt
index 61496f5cb095..c0245c888982 100644
--- a/Documentation/devicetree/bindings/usb/usb-phy.txt
+++ b/Documentation/devicetree/bindings/usb/usb-phy.txt
@@ -5,6 +5,8 @@ OMAP USB2 PHY
5Required properties: 5Required properties:
6 - compatible: Should be "ti,omap-usb2" 6 - compatible: Should be "ti,omap-usb2"
7 - reg : Address and length of the register set for the device. 7 - reg : Address and length of the register set for the device.
8 - #phy-cells: determine the number of cells that should be given in the
9 phandle while referencing this phy.
8 10
9Optional properties: 11Optional properties:
10 - ctrl-module : phandle of the control module used by PHY driver to power on 12 - ctrl-module : phandle of the control module used by PHY driver to power on
@@ -16,6 +18,7 @@ usb2phy@4a0ad080 {
16 compatible = "ti,omap-usb2"; 18 compatible = "ti,omap-usb2";
17 reg = <0x4a0ad080 0x58>; 19 reg = <0x4a0ad080 0x58>;
18 ctrl-module = <&omap_control_usb>; 20 ctrl-module = <&omap_control_usb>;
21 #phy-cells = <0>;
19}; 22};
20 23
21OMAP USB3 PHY 24OMAP USB3 PHY
@@ -25,6 +28,8 @@ Required properties:
25 - reg : Address and length of the register set for the device. 28 - reg : Address and length of the register set for the device.
26 - reg-names: The names of the register addresses corresponding to the registers 29 - reg-names: The names of the register addresses corresponding to the registers
27 filled in "reg". 30 filled in "reg".
31 - #phy-cells: determine the number of cells that should be given in the
32 phandle while referencing this phy.
28 33
29Optional properties: 34Optional properties:
30 - ctrl-module : phandle of the control module used by PHY driver to power on 35 - ctrl-module : phandle of the control module used by PHY driver to power on
@@ -39,4 +44,5 @@ usb3phy@4a084400 {
39 <0x4a084c00 0x40>; 44 <0x4a084c00 0x40>;
40 reg-names = "phy_rx", "phy_tx", "pll_ctrl"; 45 reg-names = "phy_rx", "phy_tx", "pll_ctrl";
41 ctrl-module = <&omap_control_usb>; 46 ctrl-module = <&omap_control_usb>;
47 #phy-cells = <0>;
42}; 48};
diff --git a/Documentation/devicetree/bindings/usb/ux500-usb.txt b/Documentation/devicetree/bindings/usb/ux500-usb.txt
index 330d6ec15401..439a41c79afa 100644
--- a/Documentation/devicetree/bindings/usb/ux500-usb.txt
+++ b/Documentation/devicetree/bindings/usb/ux500-usb.txt
@@ -15,7 +15,7 @@ Optional properties:
15Example: 15Example:
16 16
17usb_per5@a03e0000 { 17usb_per5@a03e0000 {
18 compatible = "stericsson,db8500-musb", "mentor,musb"; 18 compatible = "stericsson,db8500-musb";
19 reg = <0xa03e0000 0x10000>; 19 reg = <0xa03e0000 0x10000>;
20 interrupts = <0 23 0x4>; 20 interrupts = <0 23 0x4>;
21 interrupt-names = "mc"; 21 interrupt-names = "mc";
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 2956800f0240..ce95ed1c6d3e 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -12,11 +12,15 @@ amcc Applied Micro Circuits Corporation (APM, formally AMCC)
12apm Applied Micro Circuits Corporation (APM) 12apm Applied Micro Circuits Corporation (APM)
13arm ARM Ltd. 13arm ARM Ltd.
14atmel Atmel Corporation 14atmel Atmel Corporation
15auo AU Optronics Corporation
15avago Avago Technologies 16avago Avago Technologies
16bosch Bosch Sensortec GmbH 17bosch Bosch Sensortec GmbH
17brcm Broadcom Corporation 18brcm Broadcom Corporation
19capella Capella Microsystems, Inc
18cavium Cavium, Inc. 20cavium Cavium, Inc.
21cdns Cadence Design Systems Inc.
19chrp Common Hardware Reference Platform 22chrp Common Hardware Reference Platform
23chunghwa Chunghwa Picture Tubes Ltd.
20cirrus Cirrus Logic, Inc. 24cirrus Cirrus Logic, Inc.
21cortina Cortina Systems, Inc. 25cortina Cortina Systems, Inc.
22dallas Maxim Integrated Products (formerly Dallas Semiconductor) 26dallas Maxim Integrated Products (formerly Dallas Semiconductor)
@@ -45,6 +49,8 @@ nintendo Nintendo
45nvidia NVIDIA 49nvidia NVIDIA
46nxp NXP Semiconductors 50nxp NXP Semiconductors
47onnn ON Semiconductor Corp. 51onnn ON Semiconductor Corp.
52panasonic Panasonic Corporation
53phytec PHYTEC Messtechnik GmbH
48picochip Picochip Ltd 54picochip Picochip Ltd
49powervr PowerVR (deprecated, use img) 55powervr PowerVR (deprecated, use img)
50qca Qualcomm Atheros, Inc. 56qca Qualcomm Atheros, Inc.
@@ -64,12 +70,12 @@ snps Synopsys, Inc.
64st STMicroelectronics 70st STMicroelectronics
65ste ST-Ericsson 71ste ST-Ericsson
66stericsson ST-Ericsson 72stericsson ST-Ericsson
67toumaz Toumaz
68ti Texas Instruments 73ti Texas Instruments
69toshiba Toshiba Corporation 74toshiba Toshiba Corporation
75toumaz Toumaz
70v3 V3 Semiconductor 76v3 V3 Semiconductor
71via VIA Technologies, Inc. 77via VIA Technologies, Inc.
78winbond Winbond Electronics corp.
72wlf Wolfson Microelectronics 79wlf Wolfson Microelectronics
73wm Wondermedia Technologies, Inc. 80wm Wondermedia Technologies, Inc.
74winbond Winbond Electronics corp.
75xlnx Xilinx 81xlnx Xilinx
diff --git a/Documentation/devicetree/bindings/video/atmel,lcdc.txt b/Documentation/devicetree/bindings/video/atmel,lcdc.txt
new file mode 100644
index 000000000000..1ec175eddca8
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/atmel,lcdc.txt
@@ -0,0 +1,75 @@
1Atmel LCDC Framebuffer
2-----------------------------------------------------
3
4Required properties:
5- compatible :
6 "atmel,at91sam9261-lcdc" ,
7 "atmel,at91sam9263-lcdc" ,
8 "atmel,at91sam9g10-lcdc" ,
9 "atmel,at91sam9g45-lcdc" ,
10 "atmel,at91sam9g45es-lcdc" ,
11 "atmel,at91sam9rl-lcdc" ,
12 "atmel,at32ap-lcdc"
13- reg : Should contain 1 register ranges(address and length)
14- interrupts : framebuffer controller interrupt
15- display: a phandle pointing to the display node
16
17Required nodes:
18- display: a display node is required to initialize the lcd panel
19 This should be in the board dts.
20- default-mode: a videomode within the display with timing parameters
21 as specified below.
22
23Example:
24
25 fb0: fb@0x00500000 {
26 compatible = "atmel,at91sam9g45-lcdc";
27 reg = <0x00500000 0x1000>;
28 interrupts = <23 3 0>;
29 pinctrl-names = "default";
30 pinctrl-0 = <&pinctrl_fb>;
31 display = <&display0>;
32 status = "okay";
33 #address-cells = <1>;
34 #size-cells = <1>;
35
36 };
37
38Atmel LCDC Display
39-----------------------------------------------------
40Required properties (as per of_videomode_helper):
41
42 - atmel,dmacon: dma controler configuration
43 - atmel,lcdcon2: lcd controler configuration
44 - atmel,guard-time: lcd guard time (Delay in frame periods)
45 - bits-per-pixel: lcd panel bit-depth.
46
47Optional properties (as per of_videomode_helper):
48 - atmel,lcdcon-backlight: enable backlight
49 - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"
50 - atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed)
51
52Example:
53 display0: display {
54 bits-per-pixel = <32>;
55 atmel,lcdcon-backlight;
56 atmel,dmacon = <0x1>;
57 atmel,lcdcon2 = <0x80008002>;
58 atmel,guard-time = <9>;
59 atmel,lcd-wiring-mode = <1>;
60
61 display-timings {
62 native-mode = <&timing0>;
63 timing0: timing0 {
64 clock-frequency = <9000000>;
65 hactive = <480>;
66 vactive = <272>;
67 hback-porch = <1>;
68 hfront-porch = <1>;
69 vback-porch = <40>;
70 vfront-porch = <1>;
71 hsync-len = <45>;
72 vsync-len = <1>;
73 };
74 };
75 };
diff --git a/Documentation/devicetree/bindings/video/backlight/lp855x.txt b/Documentation/devicetree/bindings/video/backlight/lp855x.txt
index 1482103d288f..96e83a56048e 100644
--- a/Documentation/devicetree/bindings/video/backlight/lp855x.txt
+++ b/Documentation/devicetree/bindings/video/backlight/lp855x.txt
@@ -2,7 +2,7 @@ lp855x bindings
2 2
3Required properties: 3Required properties:
4 - compatible: "ti,lp8550", "ti,lp8551", "ti,lp8552", "ti,lp8553", 4 - compatible: "ti,lp8550", "ti,lp8551", "ti,lp8552", "ti,lp8553",
5 "ti,lp8556", "ti,lp8557" 5 "ti,lp8555", "ti,lp8556", "ti,lp8557"
6 - reg: I2C slave address (u8) 6 - reg: I2C slave address (u8)
7 - dev-ctrl: Value of DEVICE CONTROL register (u8). It depends on the device. 7 - dev-ctrl: Value of DEVICE CONTROL register (u8). It depends on the device.
8 8
@@ -15,6 +15,33 @@ Optional properties:
15 15
16Example: 16Example:
17 17
18 /* LP8555 */
19 backlight@2c {
20 compatible = "ti,lp8555";
21 reg = <0x2c>;
22
23 dev-ctrl = /bits/ 8 <0x00>;
24 pwm-period = <10000>;
25
26 /* 4V OV, 4 output LED0 string enabled */
27 rom_14h {
28 rom-addr = /bits/ 8 <0x14>;
29 rom-val = /bits/ 8 <0xcf>;
30 };
31
32 /* Heavy smoothing, 24ms ramp time step */
33 rom_15h {
34 rom-addr = /bits/ 8 <0x15>;
35 rom-val = /bits/ 8 <0xc7>;
36 };
37
38 /* 4 output LED1 string enabled */
39 rom_19h {
40 rom-addr = /bits/ 8 <0x19>;
41 rom-val = /bits/ 8 <0x0f>;
42 };
43 };
44
18 /* LP8556 */ 45 /* LP8556 */
19 backlight@2c { 46 backlight@2c {
20 compatible = "ti,lp8556"; 47 compatible = "ti,lp8556";
diff --git a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
index 1e4fc727f3b1..764db86d441a 100644
--- a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
+++ b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
@@ -10,12 +10,16 @@ Required properties:
10 last value in the array represents a 100% duty cycle (brightest). 10 last value in the array represents a 100% duty cycle (brightest).
11 - default-brightness-level: the default brightness level (index into the 11 - default-brightness-level: the default brightness level (index into the
12 array defined by the "brightness-levels" property) 12 array defined by the "brightness-levels" property)
13 - power-supply: regulator for supply voltage
13 14
14Optional properties: 15Optional properties:
15 - pwm-names: a list of names for the PWM devices specified in the 16 - pwm-names: a list of names for the PWM devices specified in the
16 "pwms" property (see PWM binding[0]) 17 "pwms" property (see PWM binding[0])
18 - enable-gpios: contains a single GPIO specifier for the GPIO which enables
19 and disables the backlight (see GPIO binding[1])
17 20
18[0]: Documentation/devicetree/bindings/pwm/pwm.txt 21[0]: Documentation/devicetree/bindings/pwm/pwm.txt
22[1]: Documentation/devicetree/bindings/gpio/gpio.txt
19 23
20Example: 24Example:
21 25
@@ -25,4 +29,7 @@ Example:
25 29
26 brightness-levels = <0 4 8 16 32 64 128 255>; 30 brightness-levels = <0 4 8 16 32 64 128 255>;
27 default-brightness-level = <6>; 31 default-brightness-level = <6>;
32
33 power-supply = <&vdd_bl_reg>;
34 enable-gpios = <&gpio 58 0>;
28 }; 35 };
diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt b/Documentation/devicetree/bindings/video/exynos_dp.txt
index 84f10c16cb38..3289d76a21d0 100644
--- a/Documentation/devicetree/bindings/video/exynos_dp.txt
+++ b/Documentation/devicetree/bindings/video/exynos_dp.txt
@@ -6,10 +6,10 @@ We use two nodes:
6 -dptx-phy node(defined inside dp-controller node) 6 -dptx-phy node(defined inside dp-controller node)
7 7
8For the DP-PHY initialization, we use the dptx-phy node. 8For the DP-PHY initialization, we use the dptx-phy node.
9Required properties for dptx-phy: 9Required properties for dptx-phy: deprecated, use phys and phy-names
10 -reg: 10 -reg: deprecated
11 Base address of DP PHY register. 11 Base address of DP PHY register.
12 -samsung,enable-mask: 12 -samsung,enable-mask: deprecated
13 The bit-mask used to enable/disable DP PHY. 13 The bit-mask used to enable/disable DP PHY.
14 14
15For the Panel initialization, we read data from dp-controller node. 15For the Panel initialization, we read data from dp-controller node.
@@ -27,6 +27,10 @@ Required properties for dp-controller:
27 from common clock binding: Shall be "dp". 27 from common clock binding: Shall be "dp".
28 -interrupt-parent: 28 -interrupt-parent:
29 phandle to Interrupt combiner node. 29 phandle to Interrupt combiner node.
30 -phys:
31 from general PHY binding: the phandle for the PHY device.
32 -phy-names:
33 from general PHY binding: Should be "dp".
30 -samsung,color-space: 34 -samsung,color-space:
31 input video data format. 35 input video data format.
32 COLOR_RGB = 0, COLOR_YCBCR422 = 1, COLOR_YCBCR444 = 2 36 COLOR_RGB = 0, COLOR_YCBCR422 = 1, COLOR_YCBCR444 = 2
@@ -68,11 +72,8 @@ SOC specific portion:
68 clocks = <&clock 342>; 72 clocks = <&clock 342>;
69 clock-names = "dp"; 73 clock-names = "dp";
70 74
71 dptx-phy { 75 phys = <&dp_phy>;
72 reg = <0x10040720>; 76 phy-names = "dp";
73 samsung,enable-mask = <1>;
74 };
75
76 }; 77 };
77 78
78Board Specific portion: 79Board Specific portion:
diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
index 323983be3c30..50decf8e1b90 100644
--- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt
+++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
@@ -12,7 +12,19 @@ Required properties:
12 a) phandle of the gpio controller node. 12 a) phandle of the gpio controller node.
13 b) pin number within the gpio controller. 13 b) pin number within the gpio controller.
14 c) optional flags and pull up/down. 14 c) optional flags and pull up/down.
15 15- clocks: list of clock IDs from SoC clock driver.
16 a) hdmi: Gate of HDMI IP bus clock.
17 b) sclk_hdmi: Gate of HDMI special clock.
18 c) sclk_pixel: Pixel special clock, one of the two possible inputs of
19 HDMI clock mux.
20 d) sclk_hdmiphy: HDMI PHY clock output, one of two possible inputs of
21 HDMI clock mux.
22 e) mout_hdmi: It is required by the driver to switch between the 2
23 parents i.e. sclk_pixel and sclk_hdmiphy. If hdmiphy is stable
24 after configuration, parent is set to sclk_hdmiphy else
25 sclk_pixel.
26- clock-names: aliases as per driver requirements for above clock IDs:
27 "hdmi", "sclk_hdmi", "sclk_pixel", "sclk_hdmiphy" and "mout_hdmi".
16Example: 28Example:
17 29
18 hdmi { 30 hdmi {
diff --git a/Documentation/devicetree/bindings/video/exynos_mixer.txt b/Documentation/devicetree/bindings/video/exynos_mixer.txt
index 3334b0a8e343..7bfde9c9d658 100644
--- a/Documentation/devicetree/bindings/video/exynos_mixer.txt
+++ b/Documentation/devicetree/bindings/video/exynos_mixer.txt
@@ -10,6 +10,10 @@ Required properties:
10- reg: physical base address of the mixer and length of memory mapped 10- reg: physical base address of the mixer and length of memory mapped
11 region. 11 region.
12- interrupts: interrupt number to the cpu. 12- interrupts: interrupt number to the cpu.
13- clocks: list of clock IDs from SoC clock driver.
14 a) mixer: Gate of Mixer IP bus clock.
15 b) sclk_hdmi: HDMI Special clock, one of the two possible inputs of
16 mixer mux.
13 17
14Example: 18Example:
15 19
diff --git a/Documentation/devicetree/bindings/watchdog/dw_wdt.txt b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt
new file mode 100644
index 000000000000..08e16f684f2d
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt
@@ -0,0 +1,21 @@
1Synopsys Designware Watchdog Timer
2
3Required Properties:
4
5- compatible : Should contain "snps,dw-wdt"
6- reg : Base address and size of the watchdog timer registers.
7- clocks : phandle + clock-specifier for the clock that drives the
8 watchdog timer.
9
10Optional Properties:
11
12- interrupts : The interrupt used for the watchdog timeout warning.
13
14Example:
15
16 watchdog0: wd@ffd02000 {
17 compatible = "snps,dw-wdt";
18 reg = <0xffd02000 0x1000>;
19 interrupts = <0 171 4>;
20 clocks = <&per_base_clk>;
21 };
diff --git a/Documentation/devicetree/bindings/gpio/men-a021-wdt.txt b/Documentation/devicetree/bindings/watchdog/men-a021-wdt.txt
index 370dee3226d9..370dee3226d9 100644
--- a/Documentation/devicetree/bindings/gpio/men-a021-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/men-a021-wdt.txt
diff --git a/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt b/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt
new file mode 100644
index 000000000000..1169857d1d12
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt
@@ -0,0 +1,15 @@
1MOXA ART Watchdog timer
2
3Required properties:
4
5- compatible : Must be "moxa,moxart-watchdog"
6- reg : Should contain registers location and length
7- clocks : Should contain phandle for the clock that drives the counter
8
9Example:
10
11 watchdog: watchdog@98500000 {
12 compatible = "moxa,moxart-watchdog";
13 reg = <0x98500000 0x10>;
14 clocks = <&coreclk>;
15 };
diff --git a/Documentation/devicetree/bindings/watchdog/rt2880-wdt.txt b/Documentation/devicetree/bindings/watchdog/rt2880-wdt.txt
new file mode 100644
index 000000000000..d7bab3db9d1f
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/rt2880-wdt.txt
@@ -0,0 +1,19 @@
1Ralink Watchdog Timers
2
3Required properties:
4- compatible: must be "ralink,rt2880-wdt"
5- reg: physical base address of the controller and length of the register range
6
7Optional properties:
8- interrupt-parent: phandle to the INTC device node
9- interrupts: Specify the INTC interrupt number
10
11Example:
12
13 watchdog@120 {
14 compatible = "ralink,rt2880-wdt";
15 reg = <0x120 0x10>;
16
17 interrupt-parent = <&intc>;
18 interrupts = <1>;
19 };
diff --git a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
new file mode 100644
index 000000000000..9cbc76c89b2b
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
@@ -0,0 +1,14 @@
1SiRFSoC Timer and Watchdog Timer(WDT) Controller
2
3Required properties:
4- compatible: "sirf,prima2-tick"
5- reg: Address range of tick timer/WDT register set
6- interrupts: interrupt number to the cpu
7
8Example:
9
10timer@b0020000 {
11 compatible = "sirf,prima2-tick";
12 reg = <0xb0020000 0x1000>;
13 interrupts = <0>;
14};
diff --git a/Documentation/dmatest.txt b/Documentation/dmatest.txt
index a2b5663eae26..dd77a81bdb80 100644
--- a/Documentation/dmatest.txt
+++ b/Documentation/dmatest.txt
@@ -15,39 +15,48 @@ be built as module or inside kernel. Let's consider those cases.
15 15
16 Part 2 - When dmatest is built as a module... 16 Part 2 - When dmatest is built as a module...
17 17
18After mounting debugfs and loading the module, the /sys/kernel/debug/dmatest
19folder with nodes will be created. There are two important files located. First
20is the 'run' node that controls run and stop phases of the test, and the second
21one, 'results', is used to get the test case results.
22
23Note that in this case test will not run on load automatically.
24
25Example of usage: 18Example of usage:
19 % modprobe dmatest channel=dma0chan0 timeout=2000 iterations=1 run=1
20
21...or:
22 % modprobe dmatest
26 % echo dma0chan0 > /sys/module/dmatest/parameters/channel 23 % echo dma0chan0 > /sys/module/dmatest/parameters/channel
27 % echo 2000 > /sys/module/dmatest/parameters/timeout 24 % echo 2000 > /sys/module/dmatest/parameters/timeout
28 % echo 1 > /sys/module/dmatest/parameters/iterations 25 % echo 1 > /sys/module/dmatest/parameters/iterations
29 % echo 1 > /sys/kernel/debug/dmatest/run 26 % echo 1 > /sys/module/dmatest/parameters/run
27
28...or on the kernel command line:
29
30 dmatest.channel=dma0chan0 dmatest.timeout=2000 dmatest.iterations=1 dmatest.run=1
30 31
31Hint: available channel list could be extracted by running the following 32Hint: available channel list could be extracted by running the following
32command: 33command:
33 % ls -1 /sys/class/dma/ 34 % ls -1 /sys/class/dma/
34 35
35After a while you will start to get messages about current status or error like 36Once started a message like "dmatest: Started 1 threads using dma0chan0" is
36in the original code. 37emitted. After that only test failure messages are reported until the test
38stops.
37 39
38Note that running a new test will not stop any in progress test. 40Note that running a new test will not stop any in progress test.
39 41
40The following command should return actual state of the test. 42The following command returns the state of the test.
41 % cat /sys/kernel/debug/dmatest/run 43 % cat /sys/module/dmatest/parameters/run
42 44
43To wait for test done the user may perform a busy loop that checks the state. 45To wait for test completion userpace can poll 'run' until it is false, or use
44 46the wait parameter. Specifying 'wait=1' when loading the module causes module
45 % while [ $(cat /sys/kernel/debug/dmatest/run) = "Y" ] 47initialization to pause until a test run has completed, while reading
46 > do 48/sys/module/dmatest/parameters/wait waits for any running test to complete
47 > echo -n "." 49before returning. For example, the following scripts wait for 42 tests
48 > sleep 1 50to complete before exiting. Note that if 'iterations' is set to 'infinite' then
49 > done 51waiting is disabled.
50 > echo 52
53Example:
54 % modprobe dmatest run=1 iterations=42 wait=1
55 % modprobe -r dmatest
56...or:
57 % modprobe dmatest run=1 iterations=42
58 % cat /sys/module/dmatest/parameters/wait
59 % modprobe -r dmatest
51 60
52 Part 3 - When built-in in the kernel... 61 Part 3 - When built-in in the kernel...
53 62
@@ -62,21 +71,22 @@ case. You always could check them at run-time by running
62 71
63 Part 4 - Gathering the test results 72 Part 4 - Gathering the test results
64 73
65The module provides a storage for the test results in the memory. The gathered 74Test results are printed to the kernel log buffer with the format:
66data could be used after test is done.
67 75
68The special file 'results' in the debugfs represents gathered data of the in 76"dmatest: result <channel>: <test id>: '<error msg>' with src_off=<val> dst_off=<val> len=<val> (<err code>)"
69progress test. The messages collected are printed to the kernel log as well.
70 77
71Example of output: 78Example of output:
72 % cat /sys/kernel/debug/dmatest/results 79 % dmesg | tail -n 1
73 dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0) 80 dmatest: result dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)
74 81
75The message format is unified across the different types of errors. A number in 82The message format is unified across the different types of errors. A number in
76the parens represents additional information, e.g. error code, error counter, 83the parens represents additional information, e.g. error code, error counter,
77or status. 84or status. A test thread also emits a summary line at completion listing the
85number of tests executed, number that failed, and a result code.
78 86
79Comparison between buffers is stored to the dedicated structure. 87Example:
88 % dmesg | tail -n 1
89 dmatest: dma0chan0-copy0: summary 1 test, 0 failures 1000 iops 100000 KB/s (0)
80 90
81Note that the verify result is now accessible only via file 'results' in the 91The details of a data miscompare error are also emitted, but do not follow the
82debugfs. 92above format.
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index fcb34a5697ea..5bdc8cb5fc28 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -283,6 +283,7 @@ REGULATOR
283 devm_regulator_get() 283 devm_regulator_get()
284 devm_regulator_put() 284 devm_regulator_put()
285 devm_regulator_bulk_get() 285 devm_regulator_bulk_get()
286 devm_regulator_register()
286 287
287CLOCK 288CLOCK
288 devm_clk_get() 289 devm_clk_get()
@@ -302,3 +303,6 @@ PHY
302 303
303SLAVE DMA ENGINE 304SLAVE DMA ENGINE
304 devm_acpi_dma_controller_register() 305 devm_acpi_dma_controller_register()
306
307SPI
308 devm_spi_register_master()
diff --git a/Documentation/x86/efi-stub.txt b/Documentation/efi-stub.txt
index 44e6bb6ead10..44e6bb6ead10 100644
--- a/Documentation/x86/efi-stub.txt
+++ b/Documentation/efi-stub.txt
diff --git a/Documentation/extcon/porting-android-switch-class b/Documentation/extcon/porting-android-switch-class
index eb0fa5f4fe88..5377f6317961 100644
--- a/Documentation/extcon/porting-android-switch-class
+++ b/Documentation/extcon/porting-android-switch-class
@@ -25,8 +25,10 @@ MyungJoo Ham <myungjoo.ham@samsung.com>
25 @print_state: no change but type change (switch_dev->extcon_dev) 25 @print_state: no change but type change (switch_dev->extcon_dev)
26 26
27- switch_dev_register(sdev, dev) 27- switch_dev_register(sdev, dev)
28 => extcon_dev_register(edev, dev) 28 => extcon_dev_register(edev)
29 : no change but type change (sdev->edev) 29 : type change (sdev->edev)
30 : remove second param('dev'). if edev has parent device, should store
31 'dev' to 'edev.dev.parent' before registering extcon device
30- switch_dev_unregister(sdev) 32- switch_dev_unregister(sdev)
31 => extcon_dev_unregister(edev) 33 => extcon_dev_unregister(edev)
32 : no change but type change (sdev->edev) 34 : no change but type change (sdev->edev)
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
index 9dae59407437..5dd282dda55c 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -70,6 +70,12 @@ Unless otherwise specified, all options default to off.
70 70
71 See comments at the top of fs/btrfs/check-integrity.c for more info. 71 See comments at the top of fs/btrfs/check-integrity.c for more info.
72 72
73 commit=<seconds>
74 Set the interval of periodic commit, 30 seconds by default. Higher
75 values defer data being synced to permanent storage with obvious
76 consequences when the system crashes. The upper bound is not forced,
77 but a warning is printed if it's more than 300 seconds (5 minutes).
78
73 compress 79 compress
74 compress=<type> 80 compress=<type>
75 compress-force 81 compress-force
@@ -154,7 +160,11 @@ Unless otherwise specified, all options default to off.
154 Currently this scans a list of several previous tree roots and tries to 160 Currently this scans a list of several previous tree roots and tries to
155 use the first readable. 161 use the first readable.
156 162
157 skip_balance 163 rescan_uuid_tree
164 Force check and rebuild procedure of the UUID tree. This should not
165 normally be needed.
166
167 skip_balance
158 Skip automatic resume of interrupted balance operation after mount. 168 Skip automatic resume of interrupted balance operation after mount.
159 May be resumed with "btrfs balance resume." 169 May be resumed with "btrfs balance resume."
160 170
@@ -234,24 +244,14 @@ available from the git repository at the following location:
234 244
235These include the following tools: 245These include the following tools:
236 246
237mkfs.btrfs: create a filesystem 247* mkfs.btrfs: create a filesystem
238
239btrfsctl: control program to create snapshots and subvolumes:
240 248
241 mount /dev/sda2 /mnt 249* btrfs: a single tool to manage the filesystems, refer to the manpage for more details
242 btrfsctl -s new_subvol_name /mnt
243 btrfsctl -s snapshot_of_default /mnt/default
244 btrfsctl -s snapshot_of_new_subvol /mnt/new_subvol_name
245 btrfsctl -s snapshot_of_a_snapshot /mnt/snapshot_of_new_subvol
246 ls /mnt
247 default snapshot_of_a_snapshot snapshot_of_new_subvol
248 new_subvol_name snapshot_of_default
249 250
250 Snapshots and subvolumes cannot be deleted right now, but you can 251* 'btrfsck' or 'btrfs check': do a consistency check of the filesystem
251 rm -rf all the files and directories inside them.
252 252
253btrfsck: do a limited check of the FS extent trees. 253Other tools for specific tasks:
254 254
255btrfs-debug-tree: print all of the FS metadata in text form. Example: 255* btrfs-convert: in-place conversion from ext2/3/4 filesystems
256 256
257 btrfs-debug-tree /dev/sda2 >& big_output_file 257* btrfs-image: dump filesystem metadata for debugging
diff --git a/Documentation/filesystems/caching/netfs-api.txt b/Documentation/filesystems/caching/netfs-api.txt
index 11a0a40ce445..aed6b94160b1 100644
--- a/Documentation/filesystems/caching/netfs-api.txt
+++ b/Documentation/filesystems/caching/netfs-api.txt
@@ -29,15 +29,16 @@ This document contains the following sections:
29 (6) Index registration 29 (6) Index registration
30 (7) Data file registration 30 (7) Data file registration
31 (8) Miscellaneous object registration 31 (8) Miscellaneous object registration
32 (9) Setting the data file size 32 (9) Setting the data file size
33 (10) Page alloc/read/write 33 (10) Page alloc/read/write
34 (11) Page uncaching 34 (11) Page uncaching
35 (12) Index and data file consistency 35 (12) Index and data file consistency
36 (13) Miscellaneous cookie operations 36 (13) Cookie enablement
37 (14) Cookie unregistration 37 (14) Miscellaneous cookie operations
38 (15) Index invalidation 38 (15) Cookie unregistration
39 (16) Data file invalidation 39 (16) Index invalidation
40 (17) FS-Cache specific page flags. 40 (17) Data file invalidation
41 (18) FS-Cache specific page flags.
41 42
42 43
43============================= 44=============================
@@ -334,7 +335,8 @@ the path to the file:
334 struct fscache_cookie * 335 struct fscache_cookie *
335 fscache_acquire_cookie(struct fscache_cookie *parent, 336 fscache_acquire_cookie(struct fscache_cookie *parent,
336 const struct fscache_object_def *def, 337 const struct fscache_object_def *def,
337 void *netfs_data); 338 void *netfs_data,
339 bool enable);
338 340
339This function creates an index entry in the index represented by parent, 341This function creates an index entry in the index represented by parent,
340filling in the index entry by calling the operations pointed to by def. 342filling in the index entry by calling the operations pointed to by def.
@@ -350,6 +352,10 @@ object needs to be created somewhere down the hierarchy. Furthermore, an index
350may be created in several different caches independently at different times. 352may be created in several different caches independently at different times.
351This is all handled transparently, and the netfs doesn't see any of it. 353This is all handled transparently, and the netfs doesn't see any of it.
352 354
355A cookie will be created in the disabled state if enabled is false. A cookie
356must be enabled to do anything with it. A disabled cookie can be enabled by
357calling fscache_enable_cookie() (see below).
358
353For example, with AFS, a cell would be added to the primary index. This index 359For example, with AFS, a cell would be added to the primary index. This index
354entry would have a dependent inode containing a volume location index for the 360entry would have a dependent inode containing a volume location index for the
355volume mappings within this cell: 361volume mappings within this cell:
@@ -357,7 +363,7 @@ volume mappings within this cell:
357 cell->cache = 363 cell->cache =
358 fscache_acquire_cookie(afs_cache_netfs.primary_index, 364 fscache_acquire_cookie(afs_cache_netfs.primary_index,
359 &afs_cell_cache_index_def, 365 &afs_cell_cache_index_def,
360 cell); 366 cell, true);
361 367
362Then when a volume location was accessed, it would be entered into the cell's 368Then when a volume location was accessed, it would be entered into the cell's
363index and an inode would be allocated that acts as a volume type and hash chain 369index and an inode would be allocated that acts as a volume type and hash chain
@@ -366,7 +372,7 @@ combination:
366 vlocation->cache = 372 vlocation->cache =
367 fscache_acquire_cookie(cell->cache, 373 fscache_acquire_cookie(cell->cache,
368 &afs_vlocation_cache_index_def, 374 &afs_vlocation_cache_index_def,
369 vlocation); 375 vlocation, true);
370 376
371And then a particular flavour of volume (R/O for example) could be added to 377And then a particular flavour of volume (R/O for example) could be added to
372that index, creating another index for vnodes (AFS inode equivalents): 378that index, creating another index for vnodes (AFS inode equivalents):
@@ -374,7 +380,7 @@ that index, creating another index for vnodes (AFS inode equivalents):
374 volume->cache = 380 volume->cache =
375 fscache_acquire_cookie(vlocation->cache, 381 fscache_acquire_cookie(vlocation->cache,
376 &afs_volume_cache_index_def, 382 &afs_volume_cache_index_def,
377 volume); 383 volume, true);
378 384
379 385
380====================== 386======================
@@ -388,7 +394,7 @@ the object definition should be something other than index type.
388 vnode->cache = 394 vnode->cache =
389 fscache_acquire_cookie(volume->cache, 395 fscache_acquire_cookie(volume->cache,
390 &afs_vnode_cache_object_def, 396 &afs_vnode_cache_object_def,
391 vnode); 397 vnode, true);
392 398
393 399
394================================= 400=================================
@@ -404,7 +410,7 @@ it would be some other type of object such as a data file.
404 xattr->cache = 410 xattr->cache =
405 fscache_acquire_cookie(vnode->cache, 411 fscache_acquire_cookie(vnode->cache,
406 &afs_xattr_cache_object_def, 412 &afs_xattr_cache_object_def,
407 xattr); 413 xattr, true);
408 414
409Miscellaneous objects might be used to store extended attributes or directory 415Miscellaneous objects might be used to store extended attributes or directory
410entries for example. 416entries for example.
@@ -733,6 +739,47 @@ Note that partial updates may happen automatically at other times, such as when
733data blocks are added to a data file object. 739data blocks are added to a data file object.
734 740
735 741
742=================
743COOKIE ENABLEMENT
744=================
745
746Cookies exist in one of two states: enabled and disabled. If a cookie is
747disabled, it ignores all attempts to acquire child cookies; check, update or
748invalidate its state; allocate, read or write backing pages - though it is
749still possible to uncache pages and relinquish the cookie.
750
751The initial enablement state is set by fscache_acquire_cookie(), but the cookie
752can be enabled or disabled later. To disable a cookie, call:
753
754 void fscache_disable_cookie(struct fscache_cookie *cookie,
755 bool invalidate);
756
757If the cookie is not already disabled, this locks the cookie against other
758enable and disable ops, marks the cookie as being disabled, discards or
759invalidates any backing objects and waits for cessation of activity on any
760associated object before unlocking the cookie.
761
762All possible failures are handled internally. The caller should consider
763calling fscache_uncache_all_inode_pages() afterwards to make sure all page
764markings are cleared up.
765
766Cookies can be enabled or reenabled with:
767
768 void fscache_enable_cookie(struct fscache_cookie *cookie,
769 bool (*can_enable)(void *data),
770 void *data)
771
772If the cookie is not already enabled, this locks the cookie against other
773enable and disable ops, invokes can_enable() and, if the cookie is not an index
774cookie, will begin the procedure of acquiring backing objects.
775
776The optional can_enable() function is passed the data argument and returns a
777ruling as to whether or not enablement should actually be permitted to begin.
778
779All possible failures are handled internally. The cookie will only be marked
780as enabled if provisional backing objects are allocated.
781
782
736=============================== 783===============================
737MISCELLANEOUS COOKIE OPERATIONS 784MISCELLANEOUS COOKIE OPERATIONS
738=============================== 785===============================
@@ -778,7 +825,7 @@ COOKIE UNREGISTRATION
778To get rid of a cookie, this function should be called. 825To get rid of a cookie, this function should be called.
779 826
780 void fscache_relinquish_cookie(struct fscache_cookie *cookie, 827 void fscache_relinquish_cookie(struct fscache_cookie *cookie,
781 int retire); 828 bool retire);
782 829
783If retire is non-zero, then the object will be marked for recycling, and all 830If retire is non-zero, then the object will be marked for recycling, and all
784copies of it will be removed from all active caches in which it is present. 831copies of it will be removed from all active caches in which it is present.
diff --git a/Documentation/filesystems/directory-locking b/Documentation/filesystems/directory-locking
index ff7b611abf33..09bbf9a54f80 100644
--- a/Documentation/filesystems/directory-locking
+++ b/Documentation/filesystems/directory-locking
@@ -2,6 +2,10 @@
2kinds of locks - per-inode (->i_mutex) and per-filesystem 2kinds of locks - per-inode (->i_mutex) and per-filesystem
3(->s_vfs_rename_mutex). 3(->s_vfs_rename_mutex).
4 4
5 When taking the i_mutex on multiple non-directory objects, we
6always acquire the locks in order by increasing address. We'll call
7that "inode pointer" order in the following.
8
5 For our purposes all operations fall in 5 classes: 9 For our purposes all operations fall in 5 classes:
6 10
71) read access. Locking rules: caller locks directory we are accessing. 111) read access. Locking rules: caller locks directory we are accessing.
@@ -12,8 +16,9 @@ kinds of locks - per-inode (->i_mutex) and per-filesystem
12locks victim and calls the method. 16locks victim and calls the method.
13 17
144) rename() that is _not_ cross-directory. Locking rules: caller locks 184) rename() that is _not_ cross-directory. Locking rules: caller locks
15the parent, finds source and target, if target already exists - locks it 19the parent and finds source and target. If target already exists, lock
16and then calls the method. 20it. If source is a non-directory, lock it. If that means we need to
21lock both, lock them in inode pointer order.
17 22
185) link creation. Locking rules: 235) link creation. Locking rules:
19 * lock parent 24 * lock parent
@@ -30,7 +35,9 @@ rules:
30 fail with -ENOTEMPTY 35 fail with -ENOTEMPTY
31 * if new parent is equal to or is a descendent of source 36 * if new parent is equal to or is a descendent of source
32 fail with -ELOOP 37 fail with -ELOOP
33 * if target exists - lock it. 38 * If target exists, lock it. If source is a non-directory, lock
39 it. In case that means we need to lock both source and target,
40 do so in inode pointer order.
34 * call the method. 41 * call the method.
35 42
36 43
@@ -56,9 +63,11 @@ objects - A < B iff A is an ancestor of B.
56 renames will be blocked on filesystem lock and we don't start changing 63 renames will be blocked on filesystem lock and we don't start changing
57 the order until we had acquired all locks). 64 the order until we had acquired all locks).
58 65
59(3) any operation holds at most one lock on non-directory object and 66(3) locks on non-directory objects are acquired only after locks on
60 that lock is acquired after all other locks. (Proof: see descriptions 67 directory objects, and are acquired in inode pointer order.
61 of operations). 68 (Proof: all operations but renames take lock on at most one
69 non-directory object, except renames, which take locks on source and
70 target in inode pointer order in the case they are not directories.)
62 71
63 Now consider the minimal deadlock. Each process is blocked on 72 Now consider the minimal deadlock. Each process is blocked on
64attempt to acquire some lock and already holds at least one lock. Let's 73attempt to acquire some lock and already holds at least one lock. Let's
@@ -66,9 +75,13 @@ consider the set of contended locks. First of all, filesystem lock is
66not contended, since any process blocked on it is not holding any locks. 75not contended, since any process blocked on it is not holding any locks.
67Thus all processes are blocked on ->i_mutex. 76Thus all processes are blocked on ->i_mutex.
68 77
69 Non-directory objects are not contended due to (3). Thus link 78 By (3), any process holding a non-directory lock can only be
70creation can't be a part of deadlock - it can't be blocked on source 79waiting on another non-directory lock with a larger address. Therefore
71and it means that it doesn't hold any locks. 80the process holding the "largest" such lock can always make progress, and
81non-directory objects are not included in the set of contended locks.
82
83 Thus link creation can't be a part of deadlock - it can't be
84blocked on source and it means that it doesn't hold any locks.
72 85
73 Any contended object is either held by cross-directory rename or 86 Any contended object is either held by cross-directory rename or
74has a child that is also contended. Indeed, suppose that it is held by 87has a child that is also contended. Indeed, suppose that it is held by
diff --git a/Documentation/filesystems/f2fs.txt b/Documentation/filesystems/f2fs.txt
index 3cd27bed6349..a3fe811bbdbc 100644
--- a/Documentation/filesystems/f2fs.txt
+++ b/Documentation/filesystems/f2fs.txt
@@ -119,6 +119,7 @@ active_logs=%u Support configuring the number of active logs. In the
119 Default number is 6. 119 Default number is 6.
120disable_ext_identify Disable the extension list configured by mkfs, so f2fs 120disable_ext_identify Disable the extension list configured by mkfs, so f2fs
121 does not aware of cold files such as media files. 121 does not aware of cold files such as media files.
122inline_xattr Enable the inline xattrs feature.
122 123
123================================================================================ 124================================================================================
124DEBUGFS ENTRIES 125DEBUGFS ENTRIES
@@ -164,6 +165,12 @@ Files in /sys/fs/f2fs/<devname>
164 gc_idle = 1 will select the Cost Benefit approach 165 gc_idle = 1 will select the Cost Benefit approach
165 & setting gc_idle = 2 will select the greedy aproach. 166 & setting gc_idle = 2 will select the greedy aproach.
166 167
168 reclaim_segments This parameter controls the number of prefree
169 segments to be reclaimed. If the number of prefree
170 segments is larger than this number, f2fs tries to
171 conduct checkpoint to reclaim the prefree segments
172 to free segments. By default, 100 segments, 200MB.
173
167================================================================================ 174================================================================================
168USAGE 175USAGE
169================================================================================ 176================================================================================
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index f0890581f7f6..fe2b7ae6f962 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -455,3 +455,11 @@ in your dentry operations instead.
455 vfs_follow_link has been removed. Filesystems must use nd_set_link 455 vfs_follow_link has been removed. Filesystems must use nd_set_link
456 from ->follow_link for normal symlinks, or nd_jump_link for magic 456 from ->follow_link for normal symlinks, or nd_jump_link for magic
457 /proc/<pid> style links. 457 /proc/<pid> style links.
458--
459[mandatory]
460 iget5_locked()/ilookup5()/ilookup5_nowait() test() callback used to be
461 called with both ->i_lock and inode_hash_lock held; the former is *not*
462 taken anymore, so verify that your callbacks do not rely on it (none
463 of the in-tree instances did). inode_hash_lock is still held,
464 of course, so they are still serialized wrt removal from inode hash,
465 as well as wrt set() callback of iget5_locked().
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index 823c95faebd2..22d89aa37218 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -460,6 +460,7 @@ manner. The codes are the following:
460 nl - non-linear mapping 460 nl - non-linear mapping
461 ar - architecture specific flag 461 ar - architecture specific flag
462 dd - do not include area into core dump 462 dd - do not include area into core dump
463 sd - soft-dirty flag
463 mm - mixed map area 464 mm - mixed map area
464 hg - huge page advise flag 465 hg - huge page advise flag
465 nh - no-huge page advise flag 466 nh - no-huge page advise flag
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt
index aa1f459fa6cf..4a93e98b290a 100644
--- a/Documentation/filesystems/vfat.txt
+++ b/Documentation/filesystems/vfat.txt
@@ -307,7 +307,7 @@ the following:
307 307
308 <proceeding files...> 308 <proceeding files...>
309 <slot #3, id = 0x43, characters = "h is long"> 309 <slot #3, id = 0x43, characters = "h is long">
310 <slot #2, id = 0x02, characters = "xtension which"> 310 <slot #2, id = 0x02, characters = "xtension whic">
311 <slot #1, id = 0x01, characters = "My Big File.E"> 311 <slot #1, id = 0x01, characters = "My Big File.E">
312 <directory entry, name = "MYBIGFIL.EXT"> 312 <directory entry, name = "MYBIGFIL.EXT">
313 313
diff --git a/Documentation/gcov.txt b/Documentation/gcov.txt
index e7ca6478cd93..7b727783db7e 100644
--- a/Documentation/gcov.txt
+++ b/Documentation/gcov.txt
@@ -50,6 +50,10 @@ Configure the kernel with:
50 CONFIG_DEBUG_FS=y 50 CONFIG_DEBUG_FS=y
51 CONFIG_GCOV_KERNEL=y 51 CONFIG_GCOV_KERNEL=y
52 52
53select the gcc's gcov format, default is autodetect based on gcc version:
54
55 CONFIG_GCOV_FORMAT_AUTODETECT=y
56
53and to get coverage data for the entire kernel: 57and to get coverage data for the entire kernel:
54 58
55 CONFIG_GCOV_PROFILE_ALL=y 59 CONFIG_GCOV_PROFILE_ALL=y
diff --git a/Documentation/hwmon/lm25066 b/Documentation/hwmon/lm25066
index c1b57d72efc3..b34c3de5c1bc 100644
--- a/Documentation/hwmon/lm25066
+++ b/Documentation/hwmon/lm25066
@@ -8,6 +8,11 @@ Supported chips:
8 Datasheets: 8 Datasheets:
9 http://www.ti.com/lit/gpn/lm25056 9 http://www.ti.com/lit/gpn/lm25056
10 http://www.ti.com/lit/gpn/lm25056a 10 http://www.ti.com/lit/gpn/lm25056a
11 * TI LM25063
12 Prefix: 'lm25063'
13 Addresses scanned: -
14 Datasheet:
15 To be announced
11 * National Semiconductor LM25066 16 * National Semiconductor LM25066
12 Prefix: 'lm25066' 17 Prefix: 'lm25066'
13 Addresses scanned: - 18 Addresses scanned: -
@@ -32,7 +37,7 @@ Description
32----------- 37-----------
33 38
34This driver supports hardware montoring for National Semiconductor / TI LM25056, 39This driver supports hardware montoring for National Semiconductor / TI LM25056,
35LM25066, LM5064, and LM5064 Power Management, Monitoring, Control, and 40LM25063, LM25066, LM5064, and LM5066 Power Management, Monitoring, Control, and
36Protection ICs. 41Protection ICs.
37 42
38The driver is a client driver to the core PMBus driver. Please see 43The driver is a client driver to the core PMBus driver. Please see
@@ -64,8 +69,12 @@ in1_input Measured input voltage.
64in1_average Average measured input voltage. 69in1_average Average measured input voltage.
65in1_min Minimum input voltage. 70in1_min Minimum input voltage.
66in1_max Maximum input voltage. 71in1_max Maximum input voltage.
72in1_crit Critical high input voltage (LM25063 only).
73in1_lcrit Critical low input voltage (LM25063 only).
67in1_min_alarm Input voltage low alarm. 74in1_min_alarm Input voltage low alarm.
68in1_max_alarm Input voltage high alarm. 75in1_max_alarm Input voltage high alarm.
76in1_lcrit_alarm Input voltage critical low alarm (LM25063 only).
77in1_crit_alarm Input voltage critical high alarm. (LM25063 only).
69 78
70in2_label "vmon" 79in2_label "vmon"
71in2_input Measured voltage on VAUX pin 80in2_input Measured voltage on VAUX pin
@@ -80,12 +89,16 @@ in3_input Measured output voltage.
80in3_average Average measured output voltage. 89in3_average Average measured output voltage.
81in3_min Minimum output voltage. 90in3_min Minimum output voltage.
82in3_min_alarm Output voltage low alarm. 91in3_min_alarm Output voltage low alarm.
92in3_highest Historical minimum output voltage (LM25063 only).
93in3_lowest Historical maximum output voltage (LM25063 only).
83 94
84curr1_label "iin" 95curr1_label "iin"
85curr1_input Measured input current. 96curr1_input Measured input current.
86curr1_average Average measured input current. 97curr1_average Average measured input current.
87curr1_max Maximum input current. 98curr1_max Maximum input current.
99curr1_crit Critical input current (LM25063 only).
88curr1_max_alarm Input current high alarm. 100curr1_max_alarm Input current high alarm.
101curr1_crit_alarm Input current critical high alarm (LM25063 only).
89 102
90power1_label "pin" 103power1_label "pin"
91power1_input Measured input power. 104power1_input Measured input power.
@@ -95,6 +108,11 @@ power1_alarm Input power alarm
95power1_input_highest Historical maximum power. 108power1_input_highest Historical maximum power.
96power1_reset_history Write any value to reset maximum power history. 109power1_reset_history Write any value to reset maximum power history.
97 110
111power2_label "pout". LM25063 only.
112power2_input Measured output power.
113power2_max Maximum output power limit.
114power2_crit Critical output power limit.
115
98temp1_input Measured temperature. 116temp1_input Measured temperature.
99temp1_max Maximum temperature. 117temp1_max Maximum temperature.
100temp1_crit Critical high temperature. 118temp1_crit Critical high temperature.
diff --git a/Documentation/hwmon/lm90 b/Documentation/hwmon/lm90
index b466974e142f..ab81013cc390 100644
--- a/Documentation/hwmon/lm90
+++ b/Documentation/hwmon/lm90
@@ -122,6 +122,12 @@ Supported chips:
122 Prefix: 'g781' 122 Prefix: 'g781'
123 Addresses scanned: I2C 0x4c, 0x4d 123 Addresses scanned: I2C 0x4c, 0x4d
124 Datasheet: Not publicly available from GMT 124 Datasheet: Not publicly available from GMT
125 * Texas Instruments TMP451
126 Prefix: 'tmp451'
127 Addresses scanned: I2C 0x4c
128 Datasheet: Publicly available at TI website
129 http://www.ti.com/litv/pdf/sbos686
130
125 131
126Author: Jean Delvare <khali@linux-fr.org> 132Author: Jean Delvare <khali@linux-fr.org>
127 133
diff --git a/Documentation/hwmon/ltc2978 b/Documentation/hwmon/ltc2978
index dc0d08c61305..a0546fc42273 100644
--- a/Documentation/hwmon/ltc2978
+++ b/Documentation/hwmon/ltc2978
@@ -6,10 +6,15 @@ Supported chips:
6 Prefix: 'ltc2974' 6 Prefix: 'ltc2974'
7 Addresses scanned: - 7 Addresses scanned: -
8 Datasheet: http://www.linear.com/product/ltc2974 8 Datasheet: http://www.linear.com/product/ltc2974
9 * Linear Technology LTC2978 9 * Linear Technology LTC2977
10 Prefix: 'ltc2977'
11 Addresses scanned: -
12 Datasheet: http://www.linear.com/product/ltc2977
13 * Linear Technology LTC2978, LTC2978A
10 Prefix: 'ltc2978' 14 Prefix: 'ltc2978'
11 Addresses scanned: - 15 Addresses scanned: -
12 Datasheet: http://www.linear.com/product/ltc2978 16 Datasheet: http://www.linear.com/product/ltc2978
17 http://www.linear.com/product/ltc2978a
13 * Linear Technology LTC3880 18 * Linear Technology LTC3880
14 Prefix: 'ltc3880' 19 Prefix: 'ltc3880'
15 Addresses scanned: - 20 Addresses scanned: -
@@ -26,8 +31,9 @@ Description
26----------- 31-----------
27 32
28LTC2974 is a quad digital power supply manager. LTC2978 is an octal power supply 33LTC2974 is a quad digital power supply manager. LTC2978 is an octal power supply
29monitor. LTC3880 is a dual output poly-phase step-down DC/DC controller. LTC3883 34monitor. LTC2977 is a pin compatible replacement for LTC2978. LTC3880 is a dual
30is a single phase step-down DC/DC controller. 35output poly-phase step-down DC/DC controller. LTC3883 is a single phase
36step-down DC/DC controller.
31 37
32 38
33Usage Notes 39Usage Notes
@@ -49,21 +55,25 @@ Sysfs attributes
49in1_label "vin" 55in1_label "vin"
50in1_input Measured input voltage. 56in1_input Measured input voltage.
51in1_min Minimum input voltage. 57in1_min Minimum input voltage.
52in1_max Maximum input voltage. LTC2974 and LTC2978 only. 58in1_max Maximum input voltage.
53in1_lcrit Critical minimum input voltage. LTC2974 and LTC2978 59 LTC2974, LTC2977, and LTC2978 only.
54 only. 60in1_lcrit Critical minimum input voltage.
61 LTC2974, LTC2977, and LTC2978 only.
55in1_crit Critical maximum input voltage. 62in1_crit Critical maximum input voltage.
56in1_min_alarm Input voltage low alarm. 63in1_min_alarm Input voltage low alarm.
57in1_max_alarm Input voltage high alarm. LTC2974 and LTC2978 only. 64in1_max_alarm Input voltage high alarm.
58in1_lcrit_alarm Input voltage critical low alarm. LTC2974 and LTC2978 65 LTC2974, LTC2977, and LTC2978 only.
59 only. 66in1_lcrit_alarm Input voltage critical low alarm.
67 LTC2974, LTC2977, and LTC2978 only.
60in1_crit_alarm Input voltage critical high alarm. 68in1_crit_alarm Input voltage critical high alarm.
61in1_lowest Lowest input voltage. LTC2974 and LTC2978 only. 69in1_lowest Lowest input voltage.
70 LTC2974, LTC2977, and LTC2978 only.
62in1_highest Highest input voltage. 71in1_highest Highest input voltage.
63in1_reset_history Reset input voltage history. 72in1_reset_history Reset input voltage history.
64 73
65in[N]_label "vout[1-8]". 74in[N]_label "vout[1-8]".
66 LTC2974: N=2-5 75 LTC2974: N=2-5
76 LTC2977: N=2-9
67 LTC2978: N=2-9 77 LTC2978: N=2-9
68 LTC3880: N=2-3 78 LTC3880: N=2-3
69 LTC3883: N=2 79 LTC3883: N=2
@@ -83,21 +93,23 @@ in[N]_reset_history Reset output voltage history.
83temp[N]_input Measured temperature. 93temp[N]_input Measured temperature.
84 On LTC2974, temp[1-4] report external temperatures, 94 On LTC2974, temp[1-4] report external temperatures,
85 and temp5 reports the chip temperature. 95 and temp5 reports the chip temperature.
86 On LTC2978, only one temperature measurement is 96 On LTC2977 and LTC2978, only one temperature measurement
87 supported and reports the chip temperature. 97 is supported and reports the chip temperature.
88 On LTC3880, temp1 and temp2 report external 98 On LTC3880, temp1 and temp2 report external
89 temperatures, and temp3 reports the chip temperature. 99 temperatures, and temp3 reports the chip temperature.
90 On LTC3883, temp1 reports an external temperature, 100 On LTC3883, temp1 reports an external temperature,
91 and temp2 reports the chip temperature. 101 and temp2 reports the chip temperature.
92temp[N]_min Mimimum temperature. LTC2974 and LTC2978 only. 102temp[N]_min Mimimum temperature. LTC2974, LCT2977, and LTC2978 only.
93temp[N]_max Maximum temperature. 103temp[N]_max Maximum temperature.
94temp[N]_lcrit Critical low temperature. 104temp[N]_lcrit Critical low temperature.
95temp[N]_crit Critical high temperature. 105temp[N]_crit Critical high temperature.
96temp[N]_min_alarm Temperature low alarm. LTC2974 and LTC2978 only. 106temp[N]_min_alarm Temperature low alarm.
107 LTC2974, LTC2977, and LTC2978 only.
97temp[N]_max_alarm Temperature high alarm. 108temp[N]_max_alarm Temperature high alarm.
98temp[N]_lcrit_alarm Temperature critical low alarm. 109temp[N]_lcrit_alarm Temperature critical low alarm.
99temp[N]_crit_alarm Temperature critical high alarm. 110temp[N]_crit_alarm Temperature critical high alarm.
100temp[N]_lowest Lowest measured temperature. LTC2974 and LTC2978 only. 111temp[N]_lowest Lowest measured temperature.
112 LTC2974, LTC2977, and LTC2978 only.
101 Not supported for chip temperature sensor on LTC2974. 113 Not supported for chip temperature sensor on LTC2974.
102temp[N]_highest Highest measured temperature. Not supported for chip 114temp[N]_highest Highest measured temperature. Not supported for chip
103 temperature sensor on LTC2974. 115 temperature sensor on LTC2974.
@@ -109,6 +121,7 @@ power1_input Measured input power.
109 121
110power[N]_label "pout[1-4]". 122power[N]_label "pout[1-4]".
111 LTC2974: N=1-4 123 LTC2974: N=1-4
124 LTC2977: Not supported
112 LTC2978: Not supported 125 LTC2978: Not supported
113 LTC3880: N=1-2 126 LTC3880: N=1-2
114 LTC3883: N=2 127 LTC3883: N=2
@@ -123,6 +136,7 @@ curr1_reset_history Reset input current history. LTC3883 only.
123 136
124curr[N]_label "iout[1-4]". 137curr[N]_label "iout[1-4]".
125 LTC2974: N=1-4 138 LTC2974: N=1-4
139 LTC2977: not supported
126 LTC2978: not supported 140 LTC2978: not supported
127 LTC3880: N=2-3 141 LTC3880: N=2-3
128 LTC3883: N=2 142 LTC3883: N=2
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801
index d29dea0f3232..7b0dcdb57173 100644
--- a/Documentation/i2c/busses/i2c-i801
+++ b/Documentation/i2c/busses/i2c-i801
@@ -25,6 +25,7 @@ Supported adapters:
25 * Intel Avoton (SOC) 25 * Intel Avoton (SOC)
26 * Intel Wellsburg (PCH) 26 * Intel Wellsburg (PCH)
27 * Intel Coleto Creek (PCH) 27 * Intel Coleto Creek (PCH)
28 * Intel Wildcat Point-LP (PCH)
28 Datasheets: Publicly available at the Intel website 29 Datasheets: Publicly available at the Intel website
29 30
30On Intel Patsburg and later chipsets, both the normal host SMBus controller 31On Intel Patsburg and later chipsets, both the normal host SMBus controller
diff --git a/Documentation/input/gamepad.txt b/Documentation/input/gamepad.txt
index 8002c894c6b0..31bb6a4029ef 100644
--- a/Documentation/input/gamepad.txt
+++ b/Documentation/input/gamepad.txt
@@ -122,12 +122,14 @@ D-Pad:
122 BTN_DPAD_* 122 BTN_DPAD_*
123 Analog buttons are reported as: 123 Analog buttons are reported as:
124 ABS_HAT0X and ABS_HAT0Y 124 ABS_HAT0X and ABS_HAT0Y
125 (for ABS values negative is left/up, positive is right/down)
125 126
126Analog-Sticks: 127Analog-Sticks:
127 The left analog-stick is reported as ABS_X, ABS_Y. The right analog stick is 128 The left analog-stick is reported as ABS_X, ABS_Y. The right analog stick is
128 reported as ABS_RX, ABS_RY. Zero, one or two sticks may be present. 129 reported as ABS_RX, ABS_RY. Zero, one or two sticks may be present.
129 If analog-sticks provide digital buttons, they are mapped accordingly as 130 If analog-sticks provide digital buttons, they are mapped accordingly as
130 BTN_THUMBL (first/left) and BTN_THUMBR (second/right). 131 BTN_THUMBL (first/left) and BTN_THUMBR (second/right).
132 (for ABS values negative is left/up, positive is right/down)
131 133
132Triggers: 134Triggers:
133 Trigger buttons can be available as digital or analog buttons or both. User- 135 Trigger buttons can be available as digital or analog buttons or both. User-
@@ -138,6 +140,7 @@ Triggers:
138 ABS_HAT2X (right/ZR) and BTN_TL2 or ABS_HAT2Y (left/ZL). 140 ABS_HAT2X (right/ZR) and BTN_TL2 or ABS_HAT2Y (left/ZL).
139 If only one trigger-button combination is present (upper+lower), they are 141 If only one trigger-button combination is present (upper+lower), they are
140 reported as "right" triggers (BTN_TR/ABS_HAT1X). 142 reported as "right" triggers (BTN_TR/ABS_HAT1X).
143 (ABS trigger values start at 0, pressure is reported as positive values)
141 144
142Menu-Pad: 145Menu-Pad:
143 Menu buttons are always digital and are mapped according to their location 146 Menu buttons are always digital and are mapped according to their location
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
index 2a5f0e14efa3..7cbfa3c4fc3d 100644
--- a/Documentation/ioctl/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.txt
@@ -138,6 +138,7 @@ Code Seq#(hex) Include File Comments
138'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict! 138'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict!
139'H' C0-DF net/bluetooth/bnep/bnep.h conflict! 139'H' C0-DF net/bluetooth/bnep/bnep.h conflict!
140'H' F1 linux/hid-roccat.h <mailto:erazor_de@users.sourceforge.net> 140'H' F1 linux/hid-roccat.h <mailto:erazor_de@users.sourceforge.net>
141'H' F8-FA sound/firewire.h
141'I' all linux/isdn.h conflict! 142'I' all linux/isdn.h conflict!
142'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict! 143'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict!
143'I' 40-4F linux/mISDNif.h conflict! 144'I' 40-4F linux/mISDNif.h conflict!
diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt
index 8ef6dbb6a462..bbc99c0c1094 100644
--- a/Documentation/kbuild/kconfig.txt
+++ b/Documentation/kbuild/kconfig.txt
@@ -20,16 +20,9 @@ symbols have been introduced.
20To see a list of new config symbols when using "make oldconfig", use 20To see a list of new config symbols when using "make oldconfig", use
21 21
22 cp user/some/old.config .config 22 cp user/some/old.config .config
23 yes "" | make oldconfig >conf.new 23 make listnewconfig
24 24
25and the config program will list as (NEW) any new symbols that have 25and the config program will list any new symbols, one per line.
26unknown values. Of course, the .config file is also updated with
27new (default) values, so you can use:
28
29 grep "(NEW)" conf.new
30
31to see the new config symbols or you can use diffconfig to see the
32differences between the previous and new .config files:
33 26
34 scripts/diffconfig .config.old .config | less 27 scripts/diffconfig .config.old .config | less
35 28
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 539a23631990..50680a59a2ff 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -480,6 +480,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
480 Format: <io>,<irq>,<mode> 480 Format: <io>,<irq>,<mode>
481 See header of drivers/net/hamradio/baycom_ser_hdx.c. 481 See header of drivers/net/hamradio/baycom_ser_hdx.c.
482 482
483 blkdevparts= Manual partition parsing of block device(s) for
484 embedded devices based on command line input.
485 See Documentation/block/cmdline-partition.txt
486
483 boot_delay= Milliseconds to delay each printk during boot. 487 boot_delay= Milliseconds to delay each printk during boot.
484 Values larger than 10 seconds (10000) are changed to 488 Values larger than 10 seconds (10000) are changed to
485 no delay (0). 489 no delay (0).
@@ -843,6 +847,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
843 847
844 earlyprintk= [X86,SH,BLACKFIN,ARM] 848 earlyprintk= [X86,SH,BLACKFIN,ARM]
845 earlyprintk=vga 849 earlyprintk=vga
850 earlyprintk=efi
846 earlyprintk=xen 851 earlyprintk=xen
847 earlyprintk=serial[,ttySn[,baudrate]] 852 earlyprintk=serial[,ttySn[,baudrate]]
848 earlyprintk=serial[,0x...[,baudrate]] 853 earlyprintk=serial[,0x...[,baudrate]]
@@ -856,7 +861,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
856 Append ",keep" to not disable it when the real console 861 Append ",keep" to not disable it when the real console
857 takes over. 862 takes over.
858 863
859 Only vga or serial or usb debug port at a time. 864 Only one of vga, efi, serial, or usb debug port can
865 be used at a time.
860 866
861 Currently only ttyS0 and ttyS1 may be specified by 867 Currently only ttyS0 and ttyS1 may be specified by
862 name. Other I/O ports may be explicitly specified 868 name. Other I/O ports may be explicitly specified
@@ -870,8 +876,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
870 Interaction with the standard serial driver is not 876 Interaction with the standard serial driver is not
871 very good. 877 very good.
872 878
873 The VGA output is eventually overwritten by the real 879 The VGA and EFI output is eventually overwritten by
874 console. 880 the real console.
875 881
876 The xen output can only be used by Xen PV guests. 882 The xen output can only be used by Xen PV guests.
877 883
@@ -1064,6 +1070,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1064 VIA, nVidia) 1070 VIA, nVidia)
1065 verbose: show contents of HPET registers during setup 1071 verbose: show contents of HPET registers during setup
1066 1072
1073 hpet_mmap= [X86, HPET_MMAP] Allow userspace to mmap HPET
1074 registers. Default set by CONFIG_HPET_MMAP_DEFAULT.
1075
1067 hugepages= [HW,X86-32,IA-64] HugeTLB pages to allocate at boot. 1076 hugepages= [HW,X86-32,IA-64] HugeTLB pages to allocate at boot.
1068 hugepagesz= [HW,IA-64,PPC,X86-64] The size of the HugeTLB pages. 1077 hugepagesz= [HW,IA-64,PPC,X86-64] The size of the HugeTLB pages.
1069 On x86-64 and powerpc, this option can be specified 1078 On x86-64 and powerpc, this option can be specified
@@ -1181,15 +1190,24 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1181 owned by uid=0. 1190 owned by uid=0.
1182 1191
1183 ima_hash= [IMA] 1192 ima_hash= [IMA]
1184 Format: { "sha1" | "md5" } 1193 Format: { md5 | sha1 | rmd160 | sha256 | sha384
1194 | sha512 | ... }
1185 default: "sha1" 1195 default: "sha1"
1186 1196
1197 The list of supported hash algorithms is defined
1198 in crypto/hash_info.h.
1199
1187 ima_tcb [IMA] 1200 ima_tcb [IMA]
1188 Load a policy which meets the needs of the Trusted 1201 Load a policy which meets the needs of the Trusted
1189 Computing Base. This means IMA will measure all 1202 Computing Base. This means IMA will measure all
1190 programs exec'd, files mmap'd for exec, and all files 1203 programs exec'd, files mmap'd for exec, and all files
1191 opened for read by uid=0. 1204 opened for read by uid=0.
1192 1205
1206 ima_template= [IMA]
1207 Select one of defined IMA measurements template formats.
1208 Formats: { "ima" | "ima-ng" }
1209 Default: "ima-ng"
1210
1193 init= [KNL] 1211 init= [KNL]
1194 Format: <full_path> 1212 Format: <full_path>
1195 Run specified binary instead of /sbin/init as init 1213 Run specified binary instead of /sbin/init as init
@@ -1357,7 +1375,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1357 pages. In the event, a node is too small to have both 1375 pages. In the event, a node is too small to have both
1358 kernelcore and Movable pages, kernelcore pages will 1376 kernelcore and Movable pages, kernelcore pages will
1359 take priority and other nodes will have a larger number 1377 take priority and other nodes will have a larger number
1360 of kernelcore pages. The Movable zone is used for the 1378 of Movable pages. The Movable zone is used for the
1361 allocation of pages that may be reclaimed or moved 1379 allocation of pages that may be reclaimed or moved
1362 by the page migration subsystem. This means that 1380 by the page migration subsystem. This means that
1363 HugeTLB pages may not be allocated from this zone. 1381 HugeTLB pages may not be allocated from this zone.
@@ -1769,6 +1787,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1769 that the amount of memory usable for all allocations 1787 that the amount of memory usable for all allocations
1770 is not too small. 1788 is not too small.
1771 1789
1790 movable_node [KNL,X86] Boot-time switch to enable the effects
1791 of CONFIG_MOVABLE_NODE=y. See mm/Kconfig for details.
1792
1772 MTD_Partition= [MTD] 1793 MTD_Partition= [MTD]
1773 Format: <name>,<region-number>,<size>,<offset> 1794 Format: <name>,<region-number>,<size>,<offset>
1774 1795
@@ -2595,7 +2616,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2595 ramdisk_size= [RAM] Sizes of RAM disks in kilobytes 2616 ramdisk_size= [RAM] Sizes of RAM disks in kilobytes
2596 See Documentation/blockdev/ramdisk.txt. 2617 See Documentation/blockdev/ramdisk.txt.
2597 2618
2598 rcu_nocbs= [KNL,BOOT] 2619 rcu_nocbs= [KNL]
2599 In kernels built with CONFIG_RCU_NOCB_CPU=y, set 2620 In kernels built with CONFIG_RCU_NOCB_CPU=y, set
2600 the specified list of CPUs to be no-callback CPUs. 2621 the specified list of CPUs to be no-callback CPUs.
2601 Invocation of these CPUs' RCU callbacks will 2622 Invocation of these CPUs' RCU callbacks will
@@ -2608,7 +2629,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2608 real-time workloads. It can also improve energy 2629 real-time workloads. It can also improve energy
2609 efficiency for asymmetric multiprocessors. 2630 efficiency for asymmetric multiprocessors.
2610 2631
2611 rcu_nocb_poll [KNL,BOOT] 2632 rcu_nocb_poll [KNL]
2612 Rather than requiring that offloaded CPUs 2633 Rather than requiring that offloaded CPUs
2613 (specified by rcu_nocbs= above) explicitly 2634 (specified by rcu_nocbs= above) explicitly
2614 awaken the corresponding "rcuoN" kthreads, 2635 awaken the corresponding "rcuoN" kthreads,
@@ -2619,126 +2640,145 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2619 energy efficiency by requiring that the kthreads 2640 energy efficiency by requiring that the kthreads
2620 periodically wake up to do the polling. 2641 periodically wake up to do the polling.
2621 2642
2622 rcutree.blimit= [KNL,BOOT] 2643 rcutree.blimit= [KNL]
2623 Set maximum number of finished RCU callbacks to process 2644 Set maximum number of finished RCU callbacks to process
2624 in one batch. 2645 in one batch.
2625 2646
2626 rcutree.fanout_leaf= [KNL,BOOT] 2647 rcutree.rcu_fanout_leaf= [KNL]
2627 Increase the number of CPUs assigned to each 2648 Increase the number of CPUs assigned to each
2628 leaf rcu_node structure. Useful for very large 2649 leaf rcu_node structure. Useful for very large
2629 systems. 2650 systems.
2630 2651
2631 rcutree.jiffies_till_first_fqs= [KNL,BOOT] 2652 rcutree.jiffies_till_first_fqs= [KNL]
2632 Set delay from grace-period initialization to 2653 Set delay from grace-period initialization to
2633 first attempt to force quiescent states. 2654 first attempt to force quiescent states.
2634 Units are jiffies, minimum value is zero, 2655 Units are jiffies, minimum value is zero,
2635 and maximum value is HZ. 2656 and maximum value is HZ.
2636 2657
2637 rcutree.jiffies_till_next_fqs= [KNL,BOOT] 2658 rcutree.jiffies_till_next_fqs= [KNL]
2638 Set delay between subsequent attempts to force 2659 Set delay between subsequent attempts to force
2639 quiescent states. Units are jiffies, minimum 2660 quiescent states. Units are jiffies, minimum
2640 value is one, and maximum value is HZ. 2661 value is one, and maximum value is HZ.
2641 2662
2642 rcutree.qhimark= [KNL,BOOT] 2663 rcutree.qhimark= [KNL]
2643 Set threshold of queued 2664 Set threshold of queued
2644 RCU callbacks over which batch limiting is disabled. 2665 RCU callbacks over which batch limiting is disabled.
2645 2666
2646 rcutree.qlowmark= [KNL,BOOT] 2667 rcutree.qlowmark= [KNL]
2647 Set threshold of queued RCU callbacks below which 2668 Set threshold of queued RCU callbacks below which
2648 batch limiting is re-enabled. 2669 batch limiting is re-enabled.
2649 2670
2650 rcutree.rcu_cpu_stall_suppress= [KNL,BOOT] 2671 rcutree.rcu_idle_gp_delay= [KNL]
2651 Suppress RCU CPU stall warning messages.
2652
2653 rcutree.rcu_cpu_stall_timeout= [KNL,BOOT]
2654 Set timeout for RCU CPU stall warning messages.
2655
2656 rcutree.rcu_idle_gp_delay= [KNL,BOOT]
2657 Set wakeup interval for idle CPUs that have 2672 Set wakeup interval for idle CPUs that have
2658 RCU callbacks (RCU_FAST_NO_HZ=y). 2673 RCU callbacks (RCU_FAST_NO_HZ=y).
2659 2674
2660 rcutree.rcu_idle_lazy_gp_delay= [KNL,BOOT] 2675 rcutree.rcu_idle_lazy_gp_delay= [KNL]
2661 Set wakeup interval for idle CPUs that have 2676 Set wakeup interval for idle CPUs that have
2662 only "lazy" RCU callbacks (RCU_FAST_NO_HZ=y). 2677 only "lazy" RCU callbacks (RCU_FAST_NO_HZ=y).
2663 Lazy RCU callbacks are those which RCU can 2678 Lazy RCU callbacks are those which RCU can
2664 prove do nothing more than free memory. 2679 prove do nothing more than free memory.
2665 2680
2666 rcutorture.fqs_duration= [KNL,BOOT] 2681 rcutorture.fqs_duration= [KNL]
2667 Set duration of force_quiescent_state bursts. 2682 Set duration of force_quiescent_state bursts.
2668 2683
2669 rcutorture.fqs_holdoff= [KNL,BOOT] 2684 rcutorture.fqs_holdoff= [KNL]
2670 Set holdoff time within force_quiescent_state bursts. 2685 Set holdoff time within force_quiescent_state bursts.
2671 2686
2672 rcutorture.fqs_stutter= [KNL,BOOT] 2687 rcutorture.fqs_stutter= [KNL]
2673 Set wait time between force_quiescent_state bursts. 2688 Set wait time between force_quiescent_state bursts.
2674 2689
2675 rcutorture.irqreader= [KNL,BOOT] 2690 rcutorture.gp_exp= [KNL]
2676 Test RCU readers from irq handlers. 2691 Use expedited update-side primitives.
2692
2693 rcutorture.gp_normal= [KNL]
2694 Use normal (non-expedited) update-side primitives.
2695 If both gp_exp and gp_normal are set, do both.
2696 If neither gp_exp nor gp_normal are set, still
2697 do both.
2677 2698
2678 rcutorture.n_barrier_cbs= [KNL,BOOT] 2699 rcutorture.n_barrier_cbs= [KNL]
2679 Set callbacks/threads for rcu_barrier() testing. 2700 Set callbacks/threads for rcu_barrier() testing.
2680 2701
2681 rcutorture.nfakewriters= [KNL,BOOT] 2702 rcutorture.nfakewriters= [KNL]
2682 Set number of concurrent RCU writers. These just 2703 Set number of concurrent RCU writers. These just
2683 stress RCU, they don't participate in the actual 2704 stress RCU, they don't participate in the actual
2684 test, hence the "fake". 2705 test, hence the "fake".
2685 2706
2686 rcutorture.nreaders= [KNL,BOOT] 2707 rcutorture.nreaders= [KNL]
2687 Set number of RCU readers. 2708 Set number of RCU readers.
2688 2709
2689 rcutorture.onoff_holdoff= [KNL,BOOT] 2710 rcutorture.object_debug= [KNL]
2711 Enable debug-object double-call_rcu() testing.
2712
2713 rcutorture.onoff_holdoff= [KNL]
2690 Set time (s) after boot for CPU-hotplug testing. 2714 Set time (s) after boot for CPU-hotplug testing.
2691 2715
2692 rcutorture.onoff_interval= [KNL,BOOT] 2716 rcutorture.onoff_interval= [KNL]
2693 Set time (s) between CPU-hotplug operations, or 2717 Set time (s) between CPU-hotplug operations, or
2694 zero to disable CPU-hotplug testing. 2718 zero to disable CPU-hotplug testing.
2695 2719
2696 rcutorture.shuffle_interval= [KNL,BOOT] 2720 rcutorture.rcutorture_runnable= [BOOT]
2721 Start rcutorture running at boot time.
2722
2723 rcutorture.shuffle_interval= [KNL]
2697 Set task-shuffle interval (s). Shuffling tasks 2724 Set task-shuffle interval (s). Shuffling tasks
2698 allows some CPUs to go into dyntick-idle mode 2725 allows some CPUs to go into dyntick-idle mode
2699 during the rcutorture test. 2726 during the rcutorture test.
2700 2727
2701 rcutorture.shutdown_secs= [KNL,BOOT] 2728 rcutorture.shutdown_secs= [KNL]
2702 Set time (s) after boot system shutdown. This 2729 Set time (s) after boot system shutdown. This
2703 is useful for hands-off automated testing. 2730 is useful for hands-off automated testing.
2704 2731
2705 rcutorture.stall_cpu= [KNL,BOOT] 2732 rcutorture.stall_cpu= [KNL]
2706 Duration of CPU stall (s) to test RCU CPU stall 2733 Duration of CPU stall (s) to test RCU CPU stall
2707 warnings, zero to disable. 2734 warnings, zero to disable.
2708 2735
2709 rcutorture.stall_cpu_holdoff= [KNL,BOOT] 2736 rcutorture.stall_cpu_holdoff= [KNL]
2710 Time to wait (s) after boot before inducing stall. 2737 Time to wait (s) after boot before inducing stall.
2711 2738
2712 rcutorture.stat_interval= [KNL,BOOT] 2739 rcutorture.stat_interval= [KNL]
2713 Time (s) between statistics printk()s. 2740 Time (s) between statistics printk()s.
2714 2741
2715 rcutorture.stutter= [KNL,BOOT] 2742 rcutorture.stutter= [KNL]
2716 Time (s) to stutter testing, for example, specifying 2743 Time (s) to stutter testing, for example, specifying
2717 five seconds causes the test to run for five seconds, 2744 five seconds causes the test to run for five seconds,
2718 wait for five seconds, and so on. This tests RCU's 2745 wait for five seconds, and so on. This tests RCU's
2719 ability to transition abruptly to and from idle. 2746 ability to transition abruptly to and from idle.
2720 2747
2721 rcutorture.test_boost= [KNL,BOOT] 2748 rcutorture.test_boost= [KNL]
2722 Test RCU priority boosting? 0=no, 1=maybe, 2=yes. 2749 Test RCU priority boosting? 0=no, 1=maybe, 2=yes.
2723 "Maybe" means test if the RCU implementation 2750 "Maybe" means test if the RCU implementation
2724 under test support RCU priority boosting. 2751 under test support RCU priority boosting.
2725 2752
2726 rcutorture.test_boost_duration= [KNL,BOOT] 2753 rcutorture.test_boost_duration= [KNL]
2727 Duration (s) of each individual boost test. 2754 Duration (s) of each individual boost test.
2728 2755
2729 rcutorture.test_boost_interval= [KNL,BOOT] 2756 rcutorture.test_boost_interval= [KNL]
2730 Interval (s) between each boost test. 2757 Interval (s) between each boost test.
2731 2758
2732 rcutorture.test_no_idle_hz= [KNL,BOOT] 2759 rcutorture.test_no_idle_hz= [KNL]
2733 Test RCU's dyntick-idle handling. See also the 2760 Test RCU's dyntick-idle handling. See also the
2734 rcutorture.shuffle_interval parameter. 2761 rcutorture.shuffle_interval parameter.
2735 2762
2736 rcutorture.torture_type= [KNL,BOOT] 2763 rcutorture.torture_type= [KNL]
2737 Specify the RCU implementation to test. 2764 Specify the RCU implementation to test.
2738 2765
2739 rcutorture.verbose= [KNL,BOOT] 2766 rcutorture.verbose= [KNL]
2740 Enable additional printk() statements. 2767 Enable additional printk() statements.
2741 2768
2769 rcupdate.rcu_expedited= [KNL]
2770 Use expedited grace-period primitives, for
2771 example, synchronize_rcu_expedited() instead
2772 of synchronize_rcu(). This reduces latency,
2773 but can increase CPU utilization, degrade
2774 real-time latency, and degrade energy efficiency.
2775
2776 rcupdate.rcu_cpu_stall_suppress= [KNL]
2777 Suppress RCU CPU stall warning messages.
2778
2779 rcupdate.rcu_cpu_stall_timeout= [KNL]
2780 Set timeout for RCU CPU stall warning messages.
2781
2742 rdinit= [KNL] 2782 rdinit= [KNL]
2743 Format: <full_path> 2783 Format: <full_path>
2744 Run specified binary instead of /init from the ramdisk, 2784 Run specified binary instead of /init from the ramdisk,
@@ -3467,11 +3507,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
3467 default x2apic cluster mode on platforms 3507 default x2apic cluster mode on platforms
3468 supporting x2apic. 3508 supporting x2apic.
3469 3509
3470 x86_mrst_timer= [X86-32,APBT] 3510 x86_intel_mid_timer= [X86-32,APBT]
3471 Choose timer option for x86 Moorestown MID platform. 3511 Choose timer option for x86 Intel MID platform.
3472 Two valid options are apbt timer only and lapic timer 3512 Two valid options are apbt timer only and lapic timer
3473 plus one apbt timer for broadcast timer. 3513 plus one apbt timer for broadcast timer.
3474 x86_mrst_timer=apbt_only | lapic_and_apbt 3514 x86_intel_mid_timer=apbt_only | lapic_and_apbt
3475 3515
3476 xen_emul_unplug= [HW,X86,XEN] 3516 xen_emul_unplug= [HW,X86,XEN]
3477 Unplug Xen emulated devices 3517 Unplug Xen emulated devices
diff --git a/Documentation/kernel-per-CPU-kthreads.txt b/Documentation/kernel-per-CPU-kthreads.txt
index 32351bfabf20..827104fb9364 100644
--- a/Documentation/kernel-per-CPU-kthreads.txt
+++ b/Documentation/kernel-per-CPU-kthreads.txt
@@ -181,12 +181,17 @@ To reduce its OS jitter, do any of the following:
181 make sure that this is safe on your particular system. 181 make sure that this is safe on your particular system.
182 d. It is not possible to entirely get rid of OS jitter 182 d. It is not possible to entirely get rid of OS jitter
183 from vmstat_update() on CONFIG_SMP=y systems, but you 183 from vmstat_update() on CONFIG_SMP=y systems, but you
184 can decrease its frequency by writing a large value to 184 can decrease its frequency by writing a large value
185 /proc/sys/vm/stat_interval. The default value is HZ, 185 to /proc/sys/vm/stat_interval. The default value is
186 for an interval of one second. Of course, larger values 186 HZ, for an interval of one second. Of course, larger
187 will make your virtual-memory statistics update more 187 values will make your virtual-memory statistics update
188 slowly. Of course, you can also run your workload at 188 more slowly. Of course, you can also run your workload
189 a real-time priority, thus preempting vmstat_update(). 189 at a real-time priority, thus preempting vmstat_update(),
190 but if your workload is CPU-bound, this is a bad idea.
191 However, there is an RFC patch from Christoph Lameter
192 (based on an earlier one from Gilad Ben-Yossef) that
193 reduces or even eliminates vmstat overhead for some
194 workloads at https://lkml.org/lkml/2013/9/4/379.
190 e. If running on high-end powerpc servers, build with 195 e. If running on high-end powerpc servers, build with
191 CONFIG_PPC_RTAS_DAEMON=n. This prevents the RTAS 196 CONFIG_PPC_RTAS_DAEMON=n. This prevents the RTAS
192 daemon from running on each CPU every second or so. 197 daemon from running on each CPU every second or so.
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 86c52360ffe7..fc04c14de4bb 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -1,7 +1,7 @@
1 ThinkPad ACPI Extras Driver 1 ThinkPad ACPI Extras Driver
2 2
3 Version 0.24 3 Version 0.25
4 December 11th, 2009 4 October 16th, 2013
5 5
6 Borislav Deianov <borislav@users.sf.net> 6 Borislav Deianov <borislav@users.sf.net>
7 Henrique de Moraes Holschuh <hmh@hmh.eng.br> 7 Henrique de Moraes Holschuh <hmh@hmh.eng.br>
@@ -741,6 +741,9 @@ compiled with the CONFIG_THINKPAD_ACPI_UNSAFE_LEDS option enabled.
741Distributions must never enable this option. Individual users that 741Distributions must never enable this option. Individual users that
742are aware of the consequences are welcome to enabling it. 742are aware of the consequences are welcome to enabling it.
743 743
744Audio mute and microphone mute LEDs are supported, but currently not
745visible to userspace. They are used by the snd-hda-intel audio driver.
746
744procfs notes: 747procfs notes:
745 748
746The available commands are: 749The available commands are:
diff --git a/Documentation/lockstat.txt b/Documentation/lockstat.txt
index dd2f7b26ca30..72d010689751 100644
--- a/Documentation/lockstat.txt
+++ b/Documentation/lockstat.txt
@@ -46,16 +46,14 @@ With these hooks we provide the following statistics:
46 contentions - number of lock acquisitions that had to wait 46 contentions - number of lock acquisitions that had to wait
47 wait time min - shortest (non-0) time we ever had to wait for a lock 47 wait time min - shortest (non-0) time we ever had to wait for a lock
48 max - longest time we ever had to wait for a lock 48 max - longest time we ever had to wait for a lock
49 total - total time we spend waiting on this lock 49 total - total time we spend waiting on this lock
50 avg - average time spent waiting on this lock
50 acq-bounces - number of lock acquisitions that involved x-cpu data 51 acq-bounces - number of lock acquisitions that involved x-cpu data
51 acquisitions - number of times we took the lock 52 acquisitions - number of times we took the lock
52 hold time min - shortest (non-0) time we ever held the lock 53 hold time min - shortest (non-0) time we ever held the lock
53 max - longest time we ever held the lock 54 max - longest time we ever held the lock
54 total - total time this lock was held 55 total - total time this lock was held
55 56 avg - average time this lock was held
56From these number various other statistics can be derived, such as:
57
58 hold time average = hold time total / acquisitions
59 57
60These numbers are gathered per lock class, per read/write state (when 58These numbers are gathered per lock class, per read/write state (when
61applicable). 59applicable).
@@ -84,37 +82,38 @@ Look at the current lock statistics:
84 82
85# less /proc/lock_stat 83# less /proc/lock_stat
86 84
8701 lock_stat version 0.3 8501 lock_stat version 0.4
8802 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 8602-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
8903 class name con-bounces contentions waittime-min waittime-max waittime-total acq-bounces acquisitions holdtime-min holdtime-max holdtime-total 8703 class name con-bounces contentions waittime-min waittime-max waittime-total waittime-avg acq-bounces acquisitions holdtime-min holdtime-max holdtime-total holdtime-avg
9004 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 8804-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9105 8905
9206 &mm->mmap_sem-W: 233 538 18446744073708 22924.27 607243.51 1342 45806 1.71 8595.89 1180582.34 9006 &mm->mmap_sem-W: 46 84 0.26 939.10 16371.53 194.90 47291 2922365 0.16 2220301.69 17464026916.32 5975.99
9307 &mm->mmap_sem-R: 205 587 18446744073708 28403.36 731975.00 1940 412426 0.58 187825.45 6307502.88 9107 &mm->mmap_sem-R: 37 100 1.31 299502.61 325629.52 3256.30 212344 34316685 0.10 7744.91 95016910.20 2.77
9408 --------------- 9208 ---------------
9509 &mm->mmap_sem 487 [<ffffffff8053491f>] do_page_fault+0x466/0x928 9309 &mm->mmap_sem 1 [<ffffffff811502a7>] khugepaged_scan_mm_slot+0x57/0x280
9610 &mm->mmap_sem 179 [<ffffffff802a6200>] sys_mprotect+0xcd/0x21d 9419 &mm->mmap_sem 96 [<ffffffff815351c4>] __do_page_fault+0x1d4/0x510
9711 &mm->mmap_sem 279 [<ffffffff80210a57>] sys_mmap+0x75/0xce 9511 &mm->mmap_sem 34 [<ffffffff81113d77>] vm_mmap_pgoff+0x87/0xd0
9812 &mm->mmap_sem 76 [<ffffffff802a490b>] sys_munmap+0x32/0x59 9612 &mm->mmap_sem 17 [<ffffffff81127e71>] vm_munmap+0x41/0x80
9913 --------------- 9713 ---------------
10014 &mm->mmap_sem 270 [<ffffffff80210a57>] sys_mmap+0x75/0xce 9814 &mm->mmap_sem 1 [<ffffffff81046fda>] dup_mmap+0x2a/0x3f0
10115 &mm->mmap_sem 431 [<ffffffff8053491f>] do_page_fault+0x466/0x928 9915 &mm->mmap_sem 60 [<ffffffff81129e29>] SyS_mprotect+0xe9/0x250
10216 &mm->mmap_sem 138 [<ffffffff802a490b>] sys_munmap+0x32/0x59 10016 &mm->mmap_sem 41 [<ffffffff815351c4>] __do_page_fault+0x1d4/0x510
10317 &mm->mmap_sem 145 [<ffffffff802a6200>] sys_mprotect+0xcd/0x21d 10117 &mm->mmap_sem 68 [<ffffffff81113d77>] vm_mmap_pgoff+0x87/0xd0
10418 10218
10519 ............................................................................................................................................................................................... 10319.............................................................................................................................................................................................................................
10620 10420
10721 dcache_lock: 621 623 0.52 118.26 1053.02 6745 91930 0.29 316.29 118423.41 10521 unix_table_lock: 110 112 0.21 49.24 163.91 1.46 21094 66312 0.12 624.42 31589.81 0.48
10822 ----------- 10622 ---------------
10923 dcache_lock 179 [<ffffffff80378274>] _atomic_dec_and_lock+0x34/0x54 10723 unix_table_lock 45 [<ffffffff8150ad8e>] unix_create1+0x16e/0x1b0
11024 dcache_lock 113 [<ffffffff802cc17b>] d_alloc+0x19a/0x1eb 10824 unix_table_lock 47 [<ffffffff8150b111>] unix_release_sock+0x31/0x250
11125 dcache_lock 99 [<ffffffff802ca0dc>] d_rehash+0x1b/0x44 10925 unix_table_lock 15 [<ffffffff8150ca37>] unix_find_other+0x117/0x230
11226 dcache_lock 104 [<ffffffff802cbca0>] d_instantiate+0x36/0x8a 11026 unix_table_lock 5 [<ffffffff8150a09f>] unix_autobind+0x11f/0x1b0
11327 ----------- 11127 ---------------
11428 dcache_lock 192 [<ffffffff80378274>] _atomic_dec_and_lock+0x34/0x54 11228 unix_table_lock 39 [<ffffffff8150b111>] unix_release_sock+0x31/0x250
11529 dcache_lock 98 [<ffffffff802ca0dc>] d_rehash+0x1b/0x44 11329 unix_table_lock 49 [<ffffffff8150ad8e>] unix_create1+0x16e/0x1b0
11630 dcache_lock 72 [<ffffffff802cc17b>] d_alloc+0x19a/0x1eb 11430 unix_table_lock 20 [<ffffffff8150ca37>] unix_find_other+0x117/0x230
11731 dcache_lock 112 [<ffffffff802cbca0>] d_instantiate+0x36/0x8a 11531 unix_table_lock 4 [<ffffffff8150a09f>] unix_autobind+0x11f/0x1b0
116
118 117
119This excerpt shows the first two lock class statistics. Line 01 shows the 118This excerpt shows the first two lock class statistics. Line 01 shows the
120output version - each time the format changes this will be updated. Line 02-04 119output version - each time the format changes this will be updated. Line 02-04
@@ -131,30 +130,30 @@ The integer part of the time values is in us.
131 130
132Dealing with nested locks, subclasses may appear: 131Dealing with nested locks, subclasses may appear:
133 132
13432............................................................................................................................................................................................... 13332...........................................................................................................................................................................................................................
13533 13433
13634 &rq->lock: 13128 13128 0.43 190.53 103881.26 97454 3453404 0.00 401.11 13224683.11 13534 &rq->lock: 13128 13128 0.43 190.53 103881.26 7.91 97454 3453404 0.00 401.11 13224683.11 3.82
13735 --------- 13635 ---------
13836 &rq->lock 645 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75 13736 &rq->lock 645 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
13937 &rq->lock 297 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a 13837 &rq->lock 297 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
14038 &rq->lock 360 [<ffffffff8103c4c5>] select_task_rq_fair+0x1f0/0x74a 13938 &rq->lock 360 [<ffffffff8103c4c5>] select_task_rq_fair+0x1f0/0x74a
14139 &rq->lock 428 [<ffffffff81045f98>] scheduler_tick+0x46/0x1fb 14039 &rq->lock 428 [<ffffffff81045f98>] scheduler_tick+0x46/0x1fb
14240 --------- 14140 ---------
14341 &rq->lock 77 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75 14241 &rq->lock 77 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
14442 &rq->lock 174 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a 14342 &rq->lock 174 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
14543 &rq->lock 4715 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54 14443 &rq->lock 4715 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
14644 &rq->lock 893 [<ffffffff81340524>] schedule+0x157/0x7b8 14544 &rq->lock 893 [<ffffffff81340524>] schedule+0x157/0x7b8
14745 14645
14846............................................................................................................................................................................................... 14746...........................................................................................................................................................................................................................
14947 14847
15048 &rq->lock/1: 11526 11488 0.33 388.73 136294.31 21461 38404 0.00 37.93 109388.53 14948 &rq->lock/1: 1526 11488 0.33 388.73 136294.31 11.86 21461 38404 0.00 37.93 109388.53 2.84
15149 ----------- 15049 -----------
15250 &rq->lock/1 11526 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54 15150 &rq->lock/1 11526 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
15351 ----------- 15251 -----------
15452 &rq->lock/1 5645 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54 15352 &rq->lock/1 5645 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
15553 &rq->lock/1 1224 [<ffffffff81340524>] schedule+0x157/0x7b8 15453 &rq->lock/1 1224 [<ffffffff81340524>] schedule+0x157/0x7b8
15654 &rq->lock/1 4336 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54 15554 &rq->lock/1 4336 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
15755 &rq->lock/1 181 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a 15655 &rq->lock/1 181 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
158 157
159Line 48 shows statistics for the second subclass (/1) of &rq->lock class 158Line 48 shows statistics for the second subclass (/1) of &rq->lock class
160(subclass starts from 0), since in this case, as line 50 suggests, 159(subclass starts from 0), since in this case, as line 50 suggests,
@@ -163,16 +162,16 @@ double_rq_lock actually acquires a nested lock of two spinlocks.
163View the top contending locks: 162View the top contending locks:
164 163
165# grep : /proc/lock_stat | head 164# grep : /proc/lock_stat | head
166 &inode->i_data.tree_lock-W: 15 21657 0.18 1093295.30 11547131054.85 58 10415 0.16 87.51 6387.60 165 clockevents_lock: 2926159 2947636 0.15 46882.81 1784540466.34 605.41 3381345 3879161 0.00 2260.97 53178395.68 13.71
167 &inode->i_data.tree_lock-R: 0 0 0.00 0.00 0.00 23302 231198 0.25 8.45 98023.38 166 tick_broadcast_lock: 346460 346717 0.18 2257.43 39364622.71 113.54 3642919 4242696 0.00 2263.79 49173646.60 11.59
168 dcache_lock: 1037 1161 0.38 45.32 774.51 6611 243371 0.15 306.48 77387.24 167 &mapping->i_mmap_mutex: 203896 203899 3.36 645530.05 31767507988.39 155800.21 3361776 8893984 0.17 2254.15 14110121.02 1.59
169 &inode->i_mutex: 161 286 18446744073709 62882.54 1244614.55 3653 20598 18446744073709 62318.60 1693822.74 168 &rq->lock: 135014 136909 0.18 606.09 842160.68 6.15 1540728 10436146 0.00 728.72 17606683.41 1.69
170 &zone->lru_lock: 94 94 0.53 7.33 92.10 4366 32690 0.29 59.81 16350.06 169 &(&zone->lru_lock)->rlock: 93000 94934 0.16 59.18 188253.78 1.98 1199912 3809894 0.15 391.40 3559518.81 0.93
171 &inode->i_data.i_mmap_mutex: 79 79 0.40 3.77 53.03 11779 87755 0.28 116.93 29898.44 170 tasklist_lock-W: 40667 41130 0.23 1189.42 428980.51 10.43 270278 510106 0.16 653.51 3939674.91 7.72
172 &q->__queue_lock: 48 50 0.52 31.62 86.31 774 13131 0.17 113.08 12277.52 171 tasklist_lock-R: 21298 21305 0.20 1310.05 215511.12 10.12 186204 241258 0.14 1162.33 1179779.23 4.89
173 &rq->rq_lock_key: 43 47 0.74 68.50 170.63 3706 33929 0.22 107.99 17460.62 172 rcu_node_1: 47656 49022 0.16 635.41 193616.41 3.95 844888 1865423 0.00 764.26 1656226.96 0.89
174 &rq->rq_lock_key#2: 39 46 0.75 6.68 49.03 2979 32292 0.17 125.17 17137.63 173 &(&dentry->d_lockref.lock)->rlock: 39791 40179 0.15 1302.08 88851.96 2.21 2790851 12527025 0.10 1910.75 3379714.27 0.27
175 tasklist_lock-W: 15 15 1.45 10.87 32.70 1201 7390 0.58 62.55 13648.47 174 rcu_node_0: 29203 30064 0.16 786.55 1555573.00 51.74 88963 244254 0.00 398.87 428872.51 1.76
176 175
177Clear the statistics: 176Clear the statistics:
178 177
diff --git a/Documentation/mic/mic_overview.txt b/Documentation/mic/mic_overview.txt
new file mode 100644
index 000000000000..b41929224804
--- /dev/null
+++ b/Documentation/mic/mic_overview.txt
@@ -0,0 +1,51 @@
1An Intel MIC X100 device is a PCIe form factor add-in coprocessor
2card based on the Intel Many Integrated Core (MIC) architecture
3that runs a Linux OS. It is a PCIe endpoint in a platform and therefore
4implements the three required standard address spaces i.e. configuration,
5memory and I/O. The host OS loads a device driver as is typical for
6PCIe devices. The card itself runs a bootstrap after reset that
7transfers control to the card OS downloaded from the host driver. The
8host driver supports OSPM suspend and resume operations. It shuts down
9the card during suspend and reboots the card OS during resume.
10The card OS as shipped by Intel is a Linux kernel with modifications
11for the X100 devices.
12
13Since it is a PCIe card, it does not have the ability to host hardware
14devices for networking, storage and console. We provide these devices
15on X100 coprocessors thus enabling a self-bootable equivalent environment
16for applications. A key benefit of our solution is that it leverages
17the standard virtio framework for network, disk and console devices,
18though in our case the virtio framework is used across a PCIe bus.
19
20Here is a block diagram of the various components described above. The
21virtio backends are situated on the host rather than the card given better
22single threaded performance for the host compared to MIC, the ability of
23the host to initiate DMA's to/from the card using the MIC DMA engine and
24the fact that the virtio block storage backend can only be on the host.
25
26 |
27 +----------+ | +----------+
28 | Card OS | | | Host OS |
29 +----------+ | +----------+
30 |
31+-------+ +--------+ +------+ | +---------+ +--------+ +--------+
32| Virtio| |Virtio | |Virtio| | |Virtio | |Virtio | |Virtio |
33| Net | |Console | |Block | | |Net | |Console | |Block |
34| Driver| |Driver | |Driver| | |backend | |backend | |backend |
35+-------+ +--------+ +------+ | +---------+ +--------+ +--------+
36 | | | | | | |
37 | | | |User | | |
38 | | | |------|------------|---------|-------
39 +-------------------+ |Kernel +--------------------------+
40 | | | Virtio over PCIe IOCTLs |
41 | | +--------------------------+
42 +--------------+ | |
43 |Intel MIC | | +---------------+
44 |Card Driver | | |Intel MIC |
45 +--------------+ | |Host Driver |
46 | | +---------------+
47 | | |
48 +-------------------------------------------------------------+
49 | |
50 | PCIe Bus |
51 +-------------------------------------------------------------+
diff --git a/Documentation/mic/mpssd/.gitignore b/Documentation/mic/mpssd/.gitignore
new file mode 100644
index 000000000000..8b7c72f07c92
--- /dev/null
+++ b/Documentation/mic/mpssd/.gitignore
@@ -0,0 +1 @@
mpssd
diff --git a/Documentation/mic/mpssd/Makefile b/Documentation/mic/mpssd/Makefile
new file mode 100644
index 000000000000..eb860a7d152e
--- /dev/null
+++ b/Documentation/mic/mpssd/Makefile
@@ -0,0 +1,19 @@
1#
2# Makefile - Intel MIC User Space Tools.
3# Copyright(c) 2013, Intel Corporation.
4#
5ifdef DEBUG
6CFLAGS += $(USERWARNFLAGS) -I. -g -Wall -DDEBUG=$(DEBUG)
7else
8CFLAGS += $(USERWARNFLAGS) -I. -g -Wall
9endif
10
11mpssd: mpssd.o sysfs.o
12 $(CC) $(CFLAGS) -o $@ $^ -lpthread
13
14install:
15 install mpssd /usr/sbin/mpssd
16 install micctrl /usr/sbin/micctrl
17
18clean:
19 rm -f mpssd *.o
diff --git a/Documentation/mic/mpssd/micctrl b/Documentation/mic/mpssd/micctrl
new file mode 100755
index 000000000000..8f2629b41c5f
--- /dev/null
+++ b/Documentation/mic/mpssd/micctrl
@@ -0,0 +1,173 @@
1#!/bin/bash
2# Intel MIC Platform Software Stack (MPSS)
3#
4# Copyright(c) 2013 Intel Corporation.
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License, version 2, as
8# published by the Free Software Foundation.
9#
10# This program is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# The full GNU General Public License is included in this distribution in
16# the file called "COPYING".
17#
18# Intel MIC User Space Tools.
19#
20# micctrl - Controls MIC boot/start/stop.
21#
22# chkconfig: 2345 95 05
23# description: start MPSS stack processing.
24#
25### BEGIN INIT INFO
26# Provides: micctrl
27### END INIT INFO
28
29# Source function library.
30. /etc/init.d/functions
31
32sysfs="/sys/class/mic"
33
34_status()
35{
36 f=$sysfs/$1
37 echo -e $1 state: "`cat $f/state`" shutdown_status: "`cat $f/shutdown_status`"
38}
39
40status()
41{
42 if [ "`echo $1 | head -c3`" == "mic" ]; then
43 _status $1
44 return $?
45 fi
46 for f in $sysfs/*
47 do
48 _status `basename $f`
49 RETVAL=$?
50 [ $RETVAL -ne 0 ] && return $RETVAL
51 done
52 return 0
53}
54
55_reset()
56{
57 f=$sysfs/$1
58 echo reset > $f/state
59}
60
61reset()
62{
63 if [ "`echo $1 | head -c3`" == "mic" ]; then
64 _reset $1
65 return $?
66 fi
67 for f in $sysfs/*
68 do
69 _reset `basename $f`
70 RETVAL=$?
71 [ $RETVAL -ne 0 ] && return $RETVAL
72 done
73 return 0
74}
75
76_boot()
77{
78 f=$sysfs/$1
79 echo "linux" > $f/bootmode
80 echo "mic/uos.img" > $f/firmware
81 echo "mic/$1.image" > $f/ramdisk
82 echo "boot" > $f/state
83}
84
85boot()
86{
87 if [ "`echo $1 | head -c3`" == "mic" ]; then
88 _boot $1
89 return $?
90 fi
91 for f in $sysfs/*
92 do
93 _boot `basename $f`
94 RETVAL=$?
95 [ $RETVAL -ne 0 ] && return $RETVAL
96 done
97 return 0
98}
99
100_shutdown()
101{
102 f=$sysfs/$1
103 echo shutdown > $f/state
104}
105
106shutdown()
107{
108 if [ "`echo $1 | head -c3`" == "mic" ]; then
109 _shutdown $1
110 return $?
111 fi
112 for f in $sysfs/*
113 do
114 _shutdown `basename $f`
115 RETVAL=$?
116 [ $RETVAL -ne 0 ] && return $RETVAL
117 done
118 return 0
119}
120
121_wait()
122{
123 f=$sysfs/$1
124 while [ "`cat $f/state`" != "offline" -a "`cat $f/state`" != "online" ]
125 do
126 sleep 1
127 echo -e "Waiting for $1 to go offline"
128 done
129}
130
131wait()
132{
133 if [ "`echo $1 | head -c3`" == "mic" ]; then
134 _wait $1
135 return $?
136 fi
137 # Wait for the cards to go offline
138 for f in $sysfs/*
139 do
140 _wait `basename $f`
141 RETVAL=$?
142 [ $RETVAL -ne 0 ] && return $RETVAL
143 done
144 return 0
145}
146
147if [ ! -d "$sysfs" ]; then
148 echo -e $"Module unloaded "
149 exit 3
150fi
151
152case $1 in
153 -s)
154 status $2
155 ;;
156 -r)
157 reset $2
158 ;;
159 -b)
160 boot $2
161 ;;
162 -S)
163 shutdown $2
164 ;;
165 -w)
166 wait $2
167 ;;
168 *)
169 echo $"Usage: $0 {-s (status) |-r (reset) |-b (boot) |-S (shutdown) |-w (wait)}"
170 exit 2
171esac
172
173exit $?
diff --git a/Documentation/mic/mpssd/mpss b/Documentation/mic/mpssd/mpss
new file mode 100755
index 000000000000..3136c68dad0b
--- /dev/null
+++ b/Documentation/mic/mpssd/mpss
@@ -0,0 +1,202 @@
1#!/bin/bash
2# Intel MIC Platform Software Stack (MPSS)
3#
4# Copyright(c) 2013 Intel Corporation.
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License, version 2, as
8# published by the Free Software Foundation.
9#
10# This program is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# The full GNU General Public License is included in this distribution in
16# the file called "COPYING".
17#
18# Intel MIC User Space Tools.
19#
20# mpss Start mpssd.
21#
22# chkconfig: 2345 95 05
23# description: start MPSS stack processing.
24#
25### BEGIN INIT INFO
26# Provides: mpss
27# Required-Start:
28# Required-Stop:
29# Short-Description: MPSS stack control
30# Description: MPSS stack control
31### END INIT INFO
32
33# Source function library.
34. /etc/init.d/functions
35
36exec=/usr/sbin/mpssd
37sysfs="/sys/class/mic"
38
39start()
40{
41 [ -x $exec ] || exit 5
42
43 if [ "`ps -e | awk '{print $4}' | grep mpssd | head -1`" = "mpssd" ]; then
44 echo -e $"MPSSD already running! "
45 success
46 echo
47 return 0
48 fi
49
50 echo -e $"Starting MPSS Stack"
51 echo -e $"Loading MIC_HOST Module"
52
53 # Ensure the driver is loaded
54 if [ ! -d "$sysfs" ]; then
55 modprobe mic_host
56 RETVAL=$?
57 if [ $RETVAL -ne 0 ]; then
58 failure
59 echo
60 return $RETVAL
61 fi
62 fi
63
64 # Start the daemon
65 echo -n $"Starting MPSSD "
66 $exec
67 RETVAL=$?
68 if [ $RETVAL -ne 0 ]; then
69 failure
70 echo
71 return $RETVAL
72 fi
73 success
74 echo
75
76 sleep 5
77
78 # Boot the cards
79 micctrl -b
80
81 # Wait till ping works
82 for f in $sysfs/*
83 do
84 count=100
85 ipaddr=`cat $f/cmdline`
86 ipaddr=${ipaddr#*address,}
87 ipaddr=`echo $ipaddr | cut -d, -f1 | cut -d\; -f1`
88 while [ $count -ge 0 ]
89 do
90 echo -e "Pinging "`basename $f`" "
91 ping -c 1 $ipaddr &> /dev/null
92 RETVAL=$?
93 if [ $RETVAL -eq 0 ]; then
94 success
95 break
96 fi
97 sleep 1
98 count=`expr $count - 1`
99 done
100 [ $RETVAL -ne 0 ] && failure || success
101 echo
102 done
103 return $RETVAL
104}
105
106stop()
107{
108 echo -e $"Shutting down MPSS Stack: "
109
110 # Bail out if module is unloaded
111 if [ ! -d "$sysfs" ]; then
112 echo -n $"Module unloaded "
113 success
114 echo
115 return 0
116 fi
117
118 # Shut down the cards.
119 micctrl -S
120
121 # Wait for the cards to go offline
122 for f in $sysfs/*
123 do
124 while [ "`cat $f/state`" != "offline" ]
125 do
126 sleep 1
127 echo -e "Waiting for "`basename $f`" to go offline"
128 done
129 done
130
131 # Display the status of the cards
132 micctrl -s
133
134 # Kill MPSSD now
135 echo -n $"Killing MPSSD"
136 killall -9 mpssd 2>/dev/null
137 RETVAL=$?
138 [ $RETVAL -ne 0 ] && failure || success
139 echo
140 return $RETVAL
141}
142
143restart()
144{
145 stop
146 sleep 5
147 start
148}
149
150status()
151{
152 micctrl -s
153 if [ "`ps -e | awk '{print $4}' | grep mpssd | head -n 1`" = "mpssd" ]; then
154 echo "mpssd is running"
155 else
156 echo "mpssd is stopped"
157 fi
158 return 0
159}
160
161unload()
162{
163 if [ ! -d "$sysfs" ]; then
164 echo -n $"No MIC_HOST Module: "
165 success
166 echo
167 return
168 fi
169
170 stop
171
172 sleep 5
173 echo -n $"Removing MIC_HOST Module: "
174 modprobe -r mic_host
175 RETVAL=$?
176 [ $RETVAL -ne 0 ] && failure || success
177 echo
178 return $RETVAL
179}
180
181case $1 in
182 start)
183 start
184 ;;
185 stop)
186 stop
187 ;;
188 restart)
189 restart
190 ;;
191 status)
192 status
193 ;;
194 unload)
195 unload
196 ;;
197 *)
198 echo $"Usage: $0 {start|stop|restart|status|unload}"
199 exit 2
200esac
201
202exit $?
diff --git a/Documentation/mic/mpssd/mpssd.c b/Documentation/mic/mpssd/mpssd.c
new file mode 100644
index 000000000000..0c980ad40b17
--- /dev/null
+++ b/Documentation/mic/mpssd/mpssd.c
@@ -0,0 +1,1721 @@
1/*
2 * Intel MIC Platform Software Stack (MPSS)
3 *
4 * Copyright(c) 2013 Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2, as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * The full GNU General Public License is included in this distribution in
16 * the file called "COPYING".
17 *
18 * Intel MIC User Space Tools.
19 */
20
21#define _GNU_SOURCE
22
23#include <stdlib.h>
24#include <fcntl.h>
25#include <getopt.h>
26#include <assert.h>
27#include <unistd.h>
28#include <stdbool.h>
29#include <signal.h>
30#include <poll.h>
31#include <features.h>
32#include <sys/types.h>
33#include <sys/stat.h>
34#include <sys/mman.h>
35#include <sys/socket.h>
36#include <linux/virtio_ring.h>
37#include <linux/virtio_net.h>
38#include <linux/virtio_console.h>
39#include <linux/virtio_blk.h>
40#include <linux/version.h>
41#include "mpssd.h"
42#include <linux/mic_ioctl.h>
43#include <linux/mic_common.h>
44
45static void init_mic(struct mic_info *mic);
46
47static FILE *logfp;
48static struct mic_info mic_list;
49
50#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
51
52#define min_t(type, x, y) ({ \
53 type __min1 = (x); \
54 type __min2 = (y); \
55 __min1 < __min2 ? __min1 : __min2; })
56
57/* align addr on a size boundary - adjust address up/down if needed */
58#define _ALIGN_DOWN(addr, size) ((addr)&(~((size)-1)))
59#define _ALIGN_UP(addr, size) _ALIGN_DOWN(addr + size - 1, size)
60
61/* align addr on a size boundary - adjust address up if needed */
62#define _ALIGN(addr, size) _ALIGN_UP(addr, size)
63
64/* to align the pointer to the (next) page boundary */
65#define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE)
66
67#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
68
69#define GSO_ENABLED 1
70#define MAX_GSO_SIZE (64 * 1024)
71#define ETH_H_LEN 14
72#define MAX_NET_PKT_SIZE (_ALIGN_UP(MAX_GSO_SIZE + ETH_H_LEN, 64))
73#define MIC_DEVICE_PAGE_END 0x1000
74
75#ifndef VIRTIO_NET_HDR_F_DATA_VALID
76#define VIRTIO_NET_HDR_F_DATA_VALID 2 /* Csum is valid */
77#endif
78
79static struct {
80 struct mic_device_desc dd;
81 struct mic_vqconfig vqconfig[2];
82 __u32 host_features, guest_acknowledgements;
83 struct virtio_console_config cons_config;
84} virtcons_dev_page = {
85 .dd = {
86 .type = VIRTIO_ID_CONSOLE,
87 .num_vq = ARRAY_SIZE(virtcons_dev_page.vqconfig),
88 .feature_len = sizeof(virtcons_dev_page.host_features),
89 .config_len = sizeof(virtcons_dev_page.cons_config),
90 },
91 .vqconfig[0] = {
92 .num = htole16(MIC_VRING_ENTRIES),
93 },
94 .vqconfig[1] = {
95 .num = htole16(MIC_VRING_ENTRIES),
96 },
97};
98
99static struct {
100 struct mic_device_desc dd;
101 struct mic_vqconfig vqconfig[2];
102 __u32 host_features, guest_acknowledgements;
103 struct virtio_net_config net_config;
104} virtnet_dev_page = {
105 .dd = {
106 .type = VIRTIO_ID_NET,
107 .num_vq = ARRAY_SIZE(virtnet_dev_page.vqconfig),
108 .feature_len = sizeof(virtnet_dev_page.host_features),
109 .config_len = sizeof(virtnet_dev_page.net_config),
110 },
111 .vqconfig[0] = {
112 .num = htole16(MIC_VRING_ENTRIES),
113 },
114 .vqconfig[1] = {
115 .num = htole16(MIC_VRING_ENTRIES),
116 },
117#if GSO_ENABLED
118 .host_features = htole32(
119 1 << VIRTIO_NET_F_CSUM |
120 1 << VIRTIO_NET_F_GSO |
121 1 << VIRTIO_NET_F_GUEST_TSO4 |
122 1 << VIRTIO_NET_F_GUEST_TSO6 |
123 1 << VIRTIO_NET_F_GUEST_ECN |
124 1 << VIRTIO_NET_F_GUEST_UFO),
125#else
126 .host_features = 0,
127#endif
128};
129
130static const char *mic_config_dir = "/etc/sysconfig/mic";
131static const char *virtblk_backend = "VIRTBLK_BACKEND";
132static struct {
133 struct mic_device_desc dd;
134 struct mic_vqconfig vqconfig[1];
135 __u32 host_features, guest_acknowledgements;
136 struct virtio_blk_config blk_config;
137} virtblk_dev_page = {
138 .dd = {
139 .type = VIRTIO_ID_BLOCK,
140 .num_vq = ARRAY_SIZE(virtblk_dev_page.vqconfig),
141 .feature_len = sizeof(virtblk_dev_page.host_features),
142 .config_len = sizeof(virtblk_dev_page.blk_config),
143 },
144 .vqconfig[0] = {
145 .num = htole16(MIC_VRING_ENTRIES),
146 },
147 .host_features =
148 htole32(1<<VIRTIO_BLK_F_SEG_MAX),
149 .blk_config = {
150 .seg_max = htole32(MIC_VRING_ENTRIES - 2),
151 .capacity = htole64(0),
152 }
153};
154
155static char *myname;
156
157static int
158tap_configure(struct mic_info *mic, char *dev)
159{
160 pid_t pid;
161 char *ifargv[7];
162 char ipaddr[IFNAMSIZ];
163 int ret = 0;
164
165 pid = fork();
166 if (pid == 0) {
167 ifargv[0] = "ip";
168 ifargv[1] = "link";
169 ifargv[2] = "set";
170 ifargv[3] = dev;
171 ifargv[4] = "up";
172 ifargv[5] = NULL;
173 mpsslog("Configuring %s\n", dev);
174 ret = execvp("ip", ifargv);
175 if (ret < 0) {
176 mpsslog("%s execvp failed errno %s\n",
177 mic->name, strerror(errno));
178 return ret;
179 }
180 }
181 if (pid < 0) {
182 mpsslog("%s fork failed errno %s\n",
183 mic->name, strerror(errno));
184 return ret;
185 }
186
187 ret = waitpid(pid, NULL, 0);
188 if (ret < 0) {
189 mpsslog("%s waitpid failed errno %s\n",
190 mic->name, strerror(errno));
191 return ret;
192 }
193
194 snprintf(ipaddr, IFNAMSIZ, "172.31.%d.254/24", mic->id);
195
196 pid = fork();
197 if (pid == 0) {
198 ifargv[0] = "ip";
199 ifargv[1] = "addr";
200 ifargv[2] = "add";
201 ifargv[3] = ipaddr;
202 ifargv[4] = "dev";
203 ifargv[5] = dev;
204 ifargv[6] = NULL;
205 mpsslog("Configuring %s ipaddr %s\n", dev, ipaddr);
206 ret = execvp("ip", ifargv);
207 if (ret < 0) {
208 mpsslog("%s execvp failed errno %s\n",
209 mic->name, strerror(errno));
210 return ret;
211 }
212 }
213 if (pid < 0) {
214 mpsslog("%s fork failed errno %s\n",
215 mic->name, strerror(errno));
216 return ret;
217 }
218
219 ret = waitpid(pid, NULL, 0);
220 if (ret < 0) {
221 mpsslog("%s waitpid failed errno %s\n",
222 mic->name, strerror(errno));
223 return ret;
224 }
225 mpsslog("MIC name %s %s %d DONE!\n",
226 mic->name, __func__, __LINE__);
227 return 0;
228}
229
230static int tun_alloc(struct mic_info *mic, char *dev)
231{
232 struct ifreq ifr;
233 int fd, err;
234#if GSO_ENABLED
235 unsigned offload;
236#endif
237 fd = open("/dev/net/tun", O_RDWR);
238 if (fd < 0) {
239 mpsslog("Could not open /dev/net/tun %s\n", strerror(errno));
240 goto done;
241 }
242
243 memset(&ifr, 0, sizeof(ifr));
244
245 ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_VNET_HDR;
246 if (*dev)
247 strncpy(ifr.ifr_name, dev, IFNAMSIZ);
248
249 err = ioctl(fd, TUNSETIFF, (void *)&ifr);
250 if (err < 0) {
251 mpsslog("%s %s %d TUNSETIFF failed %s\n",
252 mic->name, __func__, __LINE__, strerror(errno));
253 close(fd);
254 return err;
255 }
256#if GSO_ENABLED
257 offload = TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 |
258 TUN_F_TSO_ECN | TUN_F_UFO;
259
260 err = ioctl(fd, TUNSETOFFLOAD, offload);
261 if (err < 0) {
262 mpsslog("%s %s %d TUNSETOFFLOAD failed %s\n",
263 mic->name, __func__, __LINE__, strerror(errno));
264 close(fd);
265 return err;
266 }
267#endif
268 strcpy(dev, ifr.ifr_name);
269 mpsslog("Created TAP %s\n", dev);
270done:
271 return fd;
272}
273
274#define NET_FD_VIRTIO_NET 0
275#define NET_FD_TUN 1
276#define MAX_NET_FD 2
277
278static void set_dp(struct mic_info *mic, int type, void *dp)
279{
280 switch (type) {
281 case VIRTIO_ID_CONSOLE:
282 mic->mic_console.console_dp = dp;
283 return;
284 case VIRTIO_ID_NET:
285 mic->mic_net.net_dp = dp;
286 return;
287 case VIRTIO_ID_BLOCK:
288 mic->mic_virtblk.block_dp = dp;
289 return;
290 }
291 mpsslog("%s %s %d not found\n", mic->name, __func__, type);
292 assert(0);
293}
294
295static void *get_dp(struct mic_info *mic, int type)
296{
297 switch (type) {
298 case VIRTIO_ID_CONSOLE:
299 return mic->mic_console.console_dp;
300 case VIRTIO_ID_NET:
301 return mic->mic_net.net_dp;
302 case VIRTIO_ID_BLOCK:
303 return mic->mic_virtblk.block_dp;
304 }
305 mpsslog("%s %s %d not found\n", mic->name, __func__, type);
306 assert(0);
307 return NULL;
308}
309
310static struct mic_device_desc *get_device_desc(struct mic_info *mic, int type)
311{
312 struct mic_device_desc *d;
313 int i;
314 void *dp = get_dp(mic, type);
315
316 for (i = mic_aligned_size(struct mic_bootparam); i < PAGE_SIZE;
317 i += mic_total_desc_size(d)) {
318 d = dp + i;
319
320 /* End of list */
321 if (d->type == 0)
322 break;
323
324 if (d->type == -1)
325 continue;
326
327 mpsslog("%s %s d-> type %d d %p\n",
328 mic->name, __func__, d->type, d);
329
330 if (d->type == (__u8)type)
331 return d;
332 }
333 mpsslog("%s %s %d not found\n", mic->name, __func__, type);
334 assert(0);
335 return NULL;
336}
337
338/* See comments in vhost.c for explanation of next_desc() */
339static unsigned next_desc(struct vring_desc *desc)
340{
341 unsigned int next;
342
343 if (!(le16toh(desc->flags) & VRING_DESC_F_NEXT))
344 return -1U;
345 next = le16toh(desc->next);
346 return next;
347}
348
349/* Sum up all the IOVEC length */
350static ssize_t
351sum_iovec_len(struct mic_copy_desc *copy)
352{
353 ssize_t sum = 0;
354 int i;
355
356 for (i = 0; i < copy->iovcnt; i++)
357 sum += copy->iov[i].iov_len;
358 return sum;
359}
360
361static inline void verify_out_len(struct mic_info *mic,
362 struct mic_copy_desc *copy)
363{
364 if (copy->out_len != sum_iovec_len(copy)) {
365 mpsslog("%s %s %d BUG copy->out_len 0x%x len 0x%zx\n",
366 mic->name, __func__, __LINE__,
367 copy->out_len, sum_iovec_len(copy));
368 assert(copy->out_len == sum_iovec_len(copy));
369 }
370}
371
372/* Display an iovec */
373static void
374disp_iovec(struct mic_info *mic, struct mic_copy_desc *copy,
375 const char *s, int line)
376{
377 int i;
378
379 for (i = 0; i < copy->iovcnt; i++)
380 mpsslog("%s %s %d copy->iov[%d] addr %p len 0x%zx\n",
381 mic->name, s, line, i,
382 copy->iov[i].iov_base, copy->iov[i].iov_len);
383}
384
385static inline __u16 read_avail_idx(struct mic_vring *vr)
386{
387 return ACCESS_ONCE(vr->info->avail_idx);
388}
389
390static inline void txrx_prepare(int type, bool tx, struct mic_vring *vr,
391 struct mic_copy_desc *copy, ssize_t len)
392{
393 copy->vr_idx = tx ? 0 : 1;
394 copy->update_used = true;
395 if (type == VIRTIO_ID_NET)
396 copy->iov[1].iov_len = len - sizeof(struct virtio_net_hdr);
397 else
398 copy->iov[0].iov_len = len;
399}
400
401/* Central API which triggers the copies */
402static int
403mic_virtio_copy(struct mic_info *mic, int fd,
404 struct mic_vring *vr, struct mic_copy_desc *copy)
405{
406 int ret;
407
408 ret = ioctl(fd, MIC_VIRTIO_COPY_DESC, copy);
409 if (ret) {
410 mpsslog("%s %s %d errno %s ret %d\n",
411 mic->name, __func__, __LINE__,
412 strerror(errno), ret);
413 }
414 return ret;
415}
416
417/*
418 * This initialization routine requires at least one
419 * vring i.e. vr0. vr1 is optional.
420 */
421static void *
422init_vr(struct mic_info *mic, int fd, int type,
423 struct mic_vring *vr0, struct mic_vring *vr1, int num_vq)
424{
425 int vr_size;
426 char *va;
427
428 vr_size = PAGE_ALIGN(vring_size(MIC_VRING_ENTRIES,
429 MIC_VIRTIO_RING_ALIGN) + sizeof(struct _mic_vring_info));
430 va = mmap(NULL, MIC_DEVICE_PAGE_END + vr_size * num_vq,
431 PROT_READ, MAP_SHARED, fd, 0);
432 if (MAP_FAILED == va) {
433 mpsslog("%s %s %d mmap failed errno %s\n",
434 mic->name, __func__, __LINE__,
435 strerror(errno));
436 goto done;
437 }
438 set_dp(mic, type, va);
439 vr0->va = (struct mic_vring *)&va[MIC_DEVICE_PAGE_END];
440 vr0->info = vr0->va +
441 vring_size(MIC_VRING_ENTRIES, MIC_VIRTIO_RING_ALIGN);
442 vring_init(&vr0->vr,
443 MIC_VRING_ENTRIES, vr0->va, MIC_VIRTIO_RING_ALIGN);
444 mpsslog("%s %s vr0 %p vr0->info %p vr_size 0x%x vring 0x%x ",
445 __func__, mic->name, vr0->va, vr0->info, vr_size,
446 vring_size(MIC_VRING_ENTRIES, MIC_VIRTIO_RING_ALIGN));
447 mpsslog("magic 0x%x expected 0x%x\n",
448 vr0->info->magic, MIC_MAGIC + type);
449 assert(vr0->info->magic == MIC_MAGIC + type);
450 if (vr1) {
451 vr1->va = (struct mic_vring *)
452 &va[MIC_DEVICE_PAGE_END + vr_size];
453 vr1->info = vr1->va + vring_size(MIC_VRING_ENTRIES,
454 MIC_VIRTIO_RING_ALIGN);
455 vring_init(&vr1->vr,
456 MIC_VRING_ENTRIES, vr1->va, MIC_VIRTIO_RING_ALIGN);
457 mpsslog("%s %s vr1 %p vr1->info %p vr_size 0x%x vring 0x%x ",
458 __func__, mic->name, vr1->va, vr1->info, vr_size,
459 vring_size(MIC_VRING_ENTRIES, MIC_VIRTIO_RING_ALIGN));
460 mpsslog("magic 0x%x expected 0x%x\n",
461 vr1->info->magic, MIC_MAGIC + type + 1);
462 assert(vr1->info->magic == MIC_MAGIC + type + 1);
463 }
464done:
465 return va;
466}
467
468static void
469wait_for_card_driver(struct mic_info *mic, int fd, int type)
470{
471 struct pollfd pollfd;
472 int err;
473 struct mic_device_desc *desc = get_device_desc(mic, type);
474
475 pollfd.fd = fd;
476 mpsslog("%s %s Waiting .... desc-> type %d status 0x%x\n",
477 mic->name, __func__, type, desc->status);
478 while (1) {
479 pollfd.events = POLLIN;
480 pollfd.revents = 0;
481 err = poll(&pollfd, 1, -1);
482 if (err < 0) {
483 mpsslog("%s %s poll failed %s\n",
484 mic->name, __func__, strerror(errno));
485 continue;
486 }
487
488 if (pollfd.revents) {
489 mpsslog("%s %s Waiting... desc-> type %d status 0x%x\n",
490 mic->name, __func__, type, desc->status);
491 if (desc->status & VIRTIO_CONFIG_S_DRIVER_OK) {
492 mpsslog("%s %s poll.revents %d\n",
493 mic->name, __func__, pollfd.revents);
494 mpsslog("%s %s desc-> type %d status 0x%x\n",
495 mic->name, __func__, type,
496 desc->status);
497 break;
498 }
499 }
500 }
501}
502
503/* Spin till we have some descriptors */
504static void
505spin_for_descriptors(struct mic_info *mic, struct mic_vring *vr)
506{
507 __u16 avail_idx = read_avail_idx(vr);
508
509 while (avail_idx == le16toh(ACCESS_ONCE(vr->vr.avail->idx))) {
510#ifdef DEBUG
511 mpsslog("%s %s waiting for desc avail %d info_avail %d\n",
512 mic->name, __func__,
513 le16toh(vr->vr.avail->idx), vr->info->avail_idx);
514#endif
515 sched_yield();
516 }
517}
518
519static void *
520virtio_net(void *arg)
521{
522 static __u8 vnet_hdr[2][sizeof(struct virtio_net_hdr)];
523 static __u8 vnet_buf[2][MAX_NET_PKT_SIZE] __aligned(64);
524 struct iovec vnet_iov[2][2] = {
525 { { .iov_base = vnet_hdr[0], .iov_len = sizeof(vnet_hdr[0]) },
526 { .iov_base = vnet_buf[0], .iov_len = sizeof(vnet_buf[0]) } },
527 { { .iov_base = vnet_hdr[1], .iov_len = sizeof(vnet_hdr[1]) },
528 { .iov_base = vnet_buf[1], .iov_len = sizeof(vnet_buf[1]) } },
529 };
530 struct iovec *iov0 = vnet_iov[0], *iov1 = vnet_iov[1];
531 struct mic_info *mic = (struct mic_info *)arg;
532 char if_name[IFNAMSIZ];
533 struct pollfd net_poll[MAX_NET_FD];
534 struct mic_vring tx_vr, rx_vr;
535 struct mic_copy_desc copy;
536 struct mic_device_desc *desc;
537 int err;
538
539 snprintf(if_name, IFNAMSIZ, "mic%d", mic->id);
540 mic->mic_net.tap_fd = tun_alloc(mic, if_name);
541 if (mic->mic_net.tap_fd < 0)
542 goto done;
543
544 if (tap_configure(mic, if_name))
545 goto done;
546 mpsslog("MIC name %s id %d\n", mic->name, mic->id);
547
548 net_poll[NET_FD_VIRTIO_NET].fd = mic->mic_net.virtio_net_fd;
549 net_poll[NET_FD_VIRTIO_NET].events = POLLIN;
550 net_poll[NET_FD_TUN].fd = mic->mic_net.tap_fd;
551 net_poll[NET_FD_TUN].events = POLLIN;
552
553 if (MAP_FAILED == init_vr(mic, mic->mic_net.virtio_net_fd,
554 VIRTIO_ID_NET, &tx_vr, &rx_vr,
555 virtnet_dev_page.dd.num_vq)) {
556 mpsslog("%s init_vr failed %s\n",
557 mic->name, strerror(errno));
558 goto done;
559 }
560
561 copy.iovcnt = 2;
562 desc = get_device_desc(mic, VIRTIO_ID_NET);
563
564 while (1) {
565 ssize_t len;
566
567 net_poll[NET_FD_VIRTIO_NET].revents = 0;
568 net_poll[NET_FD_TUN].revents = 0;
569
570 /* Start polling for data from tap and virtio net */
571 err = poll(net_poll, 2, -1);
572 if (err < 0) {
573 mpsslog("%s poll failed %s\n",
574 __func__, strerror(errno));
575 continue;
576 }
577 if (!(desc->status & VIRTIO_CONFIG_S_DRIVER_OK))
578 wait_for_card_driver(mic, mic->mic_net.virtio_net_fd,
579 VIRTIO_ID_NET);
580 /*
581 * Check if there is data to be read from TUN and write to
582 * virtio net fd if there is.
583 */
584 if (net_poll[NET_FD_TUN].revents & POLLIN) {
585 copy.iov = iov0;
586 len = readv(net_poll[NET_FD_TUN].fd,
587 copy.iov, copy.iovcnt);
588 if (len > 0) {
589 struct virtio_net_hdr *hdr
590 = (struct virtio_net_hdr *)vnet_hdr[0];
591
592 /* Disable checksums on the card since we are on
593 a reliable PCIe link */
594 hdr->flags |= VIRTIO_NET_HDR_F_DATA_VALID;
595#ifdef DEBUG
596 mpsslog("%s %s %d hdr->flags 0x%x ", mic->name,
597 __func__, __LINE__, hdr->flags);
598 mpsslog("copy.out_len %d hdr->gso_type 0x%x\n",
599 copy.out_len, hdr->gso_type);
600#endif
601#ifdef DEBUG
602 disp_iovec(mic, copy, __func__, __LINE__);
603 mpsslog("%s %s %d read from tap 0x%lx\n",
604 mic->name, __func__, __LINE__,
605 len);
606#endif
607 spin_for_descriptors(mic, &tx_vr);
608 txrx_prepare(VIRTIO_ID_NET, 1, &tx_vr, &copy,
609 len);
610
611 err = mic_virtio_copy(mic,
612 mic->mic_net.virtio_net_fd, &tx_vr,
613 &copy);
614 if (err < 0) {
615 mpsslog("%s %s %d mic_virtio_copy %s\n",
616 mic->name, __func__, __LINE__,
617 strerror(errno));
618 }
619 if (!err)
620 verify_out_len(mic, &copy);
621#ifdef DEBUG
622 disp_iovec(mic, copy, __func__, __LINE__);
623 mpsslog("%s %s %d wrote to net 0x%lx\n",
624 mic->name, __func__, __LINE__,
625 sum_iovec_len(&copy));
626#endif
627 /* Reinitialize IOV for next run */
628 iov0[1].iov_len = MAX_NET_PKT_SIZE;
629 } else if (len < 0) {
630 disp_iovec(mic, &copy, __func__, __LINE__);
631 mpsslog("%s %s %d read failed %s ", mic->name,
632 __func__, __LINE__, strerror(errno));
633 mpsslog("cnt %d sum %zd\n",
634 copy.iovcnt, sum_iovec_len(&copy));
635 }
636 }
637
638 /*
639 * Check if there is data to be read from virtio net and
640 * write to TUN if there is.
641 */
642 if (net_poll[NET_FD_VIRTIO_NET].revents & POLLIN) {
643 while (rx_vr.info->avail_idx !=
644 le16toh(rx_vr.vr.avail->idx)) {
645 copy.iov = iov1;
646 txrx_prepare(VIRTIO_ID_NET, 0, &rx_vr, &copy,
647 MAX_NET_PKT_SIZE
648 + sizeof(struct virtio_net_hdr));
649
650 err = mic_virtio_copy(mic,
651 mic->mic_net.virtio_net_fd, &rx_vr,
652 &copy);
653 if (!err) {
654#ifdef DEBUG
655 struct virtio_net_hdr *hdr
656 = (struct virtio_net_hdr *)
657 vnet_hdr[1];
658
659 mpsslog("%s %s %d hdr->flags 0x%x, ",
660 mic->name, __func__, __LINE__,
661 hdr->flags);
662 mpsslog("out_len %d gso_type 0x%x\n",
663 copy.out_len,
664 hdr->gso_type);
665#endif
666 /* Set the correct output iov_len */
667 iov1[1].iov_len = copy.out_len -
668 sizeof(struct virtio_net_hdr);
669 verify_out_len(mic, &copy);
670#ifdef DEBUG
671 disp_iovec(mic, copy, __func__,
672 __LINE__);
673 mpsslog("%s %s %d ",
674 mic->name, __func__, __LINE__);
675 mpsslog("read from net 0x%lx\n",
676 sum_iovec_len(copy));
677#endif
678 len = writev(net_poll[NET_FD_TUN].fd,
679 copy.iov, copy.iovcnt);
680 if (len != sum_iovec_len(&copy)) {
681 mpsslog("Tun write failed %s ",
682 strerror(errno));
683 mpsslog("len 0x%zx ", len);
684 mpsslog("read_len 0x%zx\n",
685 sum_iovec_len(&copy));
686 } else {
687#ifdef DEBUG
688 disp_iovec(mic, &copy, __func__,
689 __LINE__);
690 mpsslog("%s %s %d ",
691 mic->name, __func__,
692 __LINE__);
693 mpsslog("wrote to tap 0x%lx\n",
694 len);
695#endif
696 }
697 } else {
698 mpsslog("%s %s %d mic_virtio_copy %s\n",
699 mic->name, __func__, __LINE__,
700 strerror(errno));
701 break;
702 }
703 }
704 }
705 if (net_poll[NET_FD_VIRTIO_NET].revents & POLLERR)
706 mpsslog("%s: %s: POLLERR\n", __func__, mic->name);
707 }
708done:
709 pthread_exit(NULL);
710}
711
712/* virtio_console */
713#define VIRTIO_CONSOLE_FD 0
714#define MONITOR_FD (VIRTIO_CONSOLE_FD + 1)
715#define MAX_CONSOLE_FD (MONITOR_FD + 1) /* must be the last one + 1 */
716#define MAX_BUFFER_SIZE PAGE_SIZE
717
718static void *
719virtio_console(void *arg)
720{
721 static __u8 vcons_buf[2][PAGE_SIZE];
722 struct iovec vcons_iov[2] = {
723 { .iov_base = vcons_buf[0], .iov_len = sizeof(vcons_buf[0]) },
724 { .iov_base = vcons_buf[1], .iov_len = sizeof(vcons_buf[1]) },
725 };
726 struct iovec *iov0 = &vcons_iov[0], *iov1 = &vcons_iov[1];
727 struct mic_info *mic = (struct mic_info *)arg;
728 int err;
729 struct pollfd console_poll[MAX_CONSOLE_FD];
730 int pty_fd;
731 char *pts_name;
732 ssize_t len;
733 struct mic_vring tx_vr, rx_vr;
734 struct mic_copy_desc copy;
735 struct mic_device_desc *desc;
736
737 pty_fd = posix_openpt(O_RDWR);
738 if (pty_fd < 0) {
739 mpsslog("can't open a pseudoterminal master device: %s\n",
740 strerror(errno));
741 goto _return;
742 }
743 pts_name = ptsname(pty_fd);
744 if (pts_name == NULL) {
745 mpsslog("can't get pts name\n");
746 goto _close_pty;
747 }
748 printf("%s console message goes to %s\n", mic->name, pts_name);
749 mpsslog("%s console message goes to %s\n", mic->name, pts_name);
750 err = grantpt(pty_fd);
751 if (err < 0) {
752 mpsslog("can't grant access: %s %s\n",
753 pts_name, strerror(errno));
754 goto _close_pty;
755 }
756 err = unlockpt(pty_fd);
757 if (err < 0) {
758 mpsslog("can't unlock a pseudoterminal: %s %s\n",
759 pts_name, strerror(errno));
760 goto _close_pty;
761 }
762 console_poll[MONITOR_FD].fd = pty_fd;
763 console_poll[MONITOR_FD].events = POLLIN;
764
765 console_poll[VIRTIO_CONSOLE_FD].fd = mic->mic_console.virtio_console_fd;
766 console_poll[VIRTIO_CONSOLE_FD].events = POLLIN;
767
768 if (MAP_FAILED == init_vr(mic, mic->mic_console.virtio_console_fd,
769 VIRTIO_ID_CONSOLE, &tx_vr, &rx_vr,
770 virtcons_dev_page.dd.num_vq)) {
771 mpsslog("%s init_vr failed %s\n",
772 mic->name, strerror(errno));
773 goto _close_pty;
774 }
775
776 copy.iovcnt = 1;
777 desc = get_device_desc(mic, VIRTIO_ID_CONSOLE);
778
779 for (;;) {
780 console_poll[MONITOR_FD].revents = 0;
781 console_poll[VIRTIO_CONSOLE_FD].revents = 0;
782 err = poll(console_poll, MAX_CONSOLE_FD, -1);
783 if (err < 0) {
784 mpsslog("%s %d: poll failed: %s\n", __func__, __LINE__,
785 strerror(errno));
786 continue;
787 }
788 if (!(desc->status & VIRTIO_CONFIG_S_DRIVER_OK))
789 wait_for_card_driver(mic,
790 mic->mic_console.virtio_console_fd,
791 VIRTIO_ID_CONSOLE);
792
793 if (console_poll[MONITOR_FD].revents & POLLIN) {
794 copy.iov = iov0;
795 len = readv(pty_fd, copy.iov, copy.iovcnt);
796 if (len > 0) {
797#ifdef DEBUG
798 disp_iovec(mic, copy, __func__, __LINE__);
799 mpsslog("%s %s %d read from tap 0x%lx\n",
800 mic->name, __func__, __LINE__,
801 len);
802#endif
803 spin_for_descriptors(mic, &tx_vr);
804 txrx_prepare(VIRTIO_ID_CONSOLE, 1, &tx_vr,
805 &copy, len);
806
807 err = mic_virtio_copy(mic,
808 mic->mic_console.virtio_console_fd,
809 &tx_vr, &copy);
810 if (err < 0) {
811 mpsslog("%s %s %d mic_virtio_copy %s\n",
812 mic->name, __func__, __LINE__,
813 strerror(errno));
814 }
815 if (!err)
816 verify_out_len(mic, &copy);
817#ifdef DEBUG
818 disp_iovec(mic, copy, __func__, __LINE__);
819 mpsslog("%s %s %d wrote to net 0x%lx\n",
820 mic->name, __func__, __LINE__,
821 sum_iovec_len(copy));
822#endif
823 /* Reinitialize IOV for next run */
824 iov0->iov_len = PAGE_SIZE;
825 } else if (len < 0) {
826 disp_iovec(mic, &copy, __func__, __LINE__);
827 mpsslog("%s %s %d read failed %s ",
828 mic->name, __func__, __LINE__,
829 strerror(errno));
830 mpsslog("cnt %d sum %zd\n",
831 copy.iovcnt, sum_iovec_len(&copy));
832 }
833 }
834
835 if (console_poll[VIRTIO_CONSOLE_FD].revents & POLLIN) {
836 while (rx_vr.info->avail_idx !=
837 le16toh(rx_vr.vr.avail->idx)) {
838 copy.iov = iov1;
839 txrx_prepare(VIRTIO_ID_CONSOLE, 0, &rx_vr,
840 &copy, PAGE_SIZE);
841
842 err = mic_virtio_copy(mic,
843 mic->mic_console.virtio_console_fd,
844 &rx_vr, &copy);
845 if (!err) {
846 /* Set the correct output iov_len */
847 iov1->iov_len = copy.out_len;
848 verify_out_len(mic, &copy);
849#ifdef DEBUG
850 disp_iovec(mic, copy, __func__,
851 __LINE__);
852 mpsslog("%s %s %d ",
853 mic->name, __func__, __LINE__);
854 mpsslog("read from net 0x%lx\n",
855 sum_iovec_len(copy));
856#endif
857 len = writev(pty_fd,
858 copy.iov, copy.iovcnt);
859 if (len != sum_iovec_len(&copy)) {
860 mpsslog("Tun write failed %s ",
861 strerror(errno));
862 mpsslog("len 0x%zx ", len);
863 mpsslog("read_len 0x%zx\n",
864 sum_iovec_len(&copy));
865 } else {
866#ifdef DEBUG
867 disp_iovec(mic, copy, __func__,
868 __LINE__);
869 mpsslog("%s %s %d ",
870 mic->name, __func__,
871 __LINE__);
872 mpsslog("wrote to tap 0x%lx\n",
873 len);
874#endif
875 }
876 } else {
877 mpsslog("%s %s %d mic_virtio_copy %s\n",
878 mic->name, __func__, __LINE__,
879 strerror(errno));
880 break;
881 }
882 }
883 }
884 if (console_poll[NET_FD_VIRTIO_NET].revents & POLLERR)
885 mpsslog("%s: %s: POLLERR\n", __func__, mic->name);
886 }
887_close_pty:
888 close(pty_fd);
889_return:
890 pthread_exit(NULL);
891}
892
893static void
894add_virtio_device(struct mic_info *mic, struct mic_device_desc *dd)
895{
896 char path[PATH_MAX];
897 int fd, err;
898
899 snprintf(path, PATH_MAX, "/dev/mic%d", mic->id);
900 fd = open(path, O_RDWR);
901 if (fd < 0) {
902 mpsslog("Could not open %s %s\n", path, strerror(errno));
903 return;
904 }
905
906 err = ioctl(fd, MIC_VIRTIO_ADD_DEVICE, dd);
907 if (err < 0) {
908 mpsslog("Could not add %d %s\n", dd->type, strerror(errno));
909 close(fd);
910 return;
911 }
912 switch (dd->type) {
913 case VIRTIO_ID_NET:
914 mic->mic_net.virtio_net_fd = fd;
915 mpsslog("Added VIRTIO_ID_NET for %s\n", mic->name);
916 break;
917 case VIRTIO_ID_CONSOLE:
918 mic->mic_console.virtio_console_fd = fd;
919 mpsslog("Added VIRTIO_ID_CONSOLE for %s\n", mic->name);
920 break;
921 case VIRTIO_ID_BLOCK:
922 mic->mic_virtblk.virtio_block_fd = fd;
923 mpsslog("Added VIRTIO_ID_BLOCK for %s\n", mic->name);
924 break;
925 }
926}
927
928static bool
929set_backend_file(struct mic_info *mic)
930{
931 FILE *config;
932 char buff[PATH_MAX], *line, *evv, *p;
933
934 snprintf(buff, PATH_MAX, "%s/mpssd%03d.conf", mic_config_dir, mic->id);
935 config = fopen(buff, "r");
936 if (config == NULL)
937 return false;
938 do { /* look for "virtblk_backend=XXXX" */
939 line = fgets(buff, PATH_MAX, config);
940 if (line == NULL)
941 break;
942 if (*line == '#')
943 continue;
944 p = strchr(line, '\n');
945 if (p)
946 *p = '\0';
947 } while (strncmp(line, virtblk_backend, strlen(virtblk_backend)) != 0);
948 fclose(config);
949 if (line == NULL)
950 return false;
951 evv = strchr(line, '=');
952 if (evv == NULL)
953 return false;
954 mic->mic_virtblk.backend_file = malloc(strlen(evv) + 1);
955 if (mic->mic_virtblk.backend_file == NULL) {
956 mpsslog("%s %d can't allocate memory\n", mic->name, mic->id);
957 return false;
958 }
959 strcpy(mic->mic_virtblk.backend_file, evv + 1);
960 return true;
961}
962
963#define SECTOR_SIZE 512
964static bool
965set_backend_size(struct mic_info *mic)
966{
967 mic->mic_virtblk.backend_size = lseek(mic->mic_virtblk.backend, 0,
968 SEEK_END);
969 if (mic->mic_virtblk.backend_size < 0) {
970 mpsslog("%s: can't seek: %s\n",
971 mic->name, mic->mic_virtblk.backend_file);
972 return false;
973 }
974 virtblk_dev_page.blk_config.capacity =
975 mic->mic_virtblk.backend_size / SECTOR_SIZE;
976 if ((mic->mic_virtblk.backend_size % SECTOR_SIZE) != 0)
977 virtblk_dev_page.blk_config.capacity++;
978
979 virtblk_dev_page.blk_config.capacity =
980 htole64(virtblk_dev_page.blk_config.capacity);
981
982 return true;
983}
984
985static bool
986open_backend(struct mic_info *mic)
987{
988 if (!set_backend_file(mic))
989 goto _error_exit;
990 mic->mic_virtblk.backend = open(mic->mic_virtblk.backend_file, O_RDWR);
991 if (mic->mic_virtblk.backend < 0) {
992 mpsslog("%s: can't open: %s\n", mic->name,
993 mic->mic_virtblk.backend_file);
994 goto _error_free;
995 }
996 if (!set_backend_size(mic))
997 goto _error_close;
998 mic->mic_virtblk.backend_addr = mmap(NULL,
999 mic->mic_virtblk.backend_size,
1000 PROT_READ|PROT_WRITE, MAP_SHARED,
1001 mic->mic_virtblk.backend, 0L);
1002 if (mic->mic_virtblk.backend_addr == MAP_FAILED) {
1003 mpsslog("%s: can't map: %s %s\n",
1004 mic->name, mic->mic_virtblk.backend_file,
1005 strerror(errno));
1006 goto _error_close;
1007 }
1008 return true;
1009
1010 _error_close:
1011 close(mic->mic_virtblk.backend);
1012 _error_free:
1013 free(mic->mic_virtblk.backend_file);
1014 _error_exit:
1015 return false;
1016}
1017
1018static void
1019close_backend(struct mic_info *mic)
1020{
1021 munmap(mic->mic_virtblk.backend_addr, mic->mic_virtblk.backend_size);
1022 close(mic->mic_virtblk.backend);
1023 free(mic->mic_virtblk.backend_file);
1024}
1025
1026static bool
1027start_virtblk(struct mic_info *mic, struct mic_vring *vring)
1028{
1029 if (((unsigned long)&virtblk_dev_page.blk_config % 8) != 0) {
1030 mpsslog("%s: blk_config is not 8 byte aligned.\n",
1031 mic->name);
1032 return false;
1033 }
1034 add_virtio_device(mic, &virtblk_dev_page.dd);
1035 if (MAP_FAILED == init_vr(mic, mic->mic_virtblk.virtio_block_fd,
1036 VIRTIO_ID_BLOCK, vring, NULL,
1037 virtblk_dev_page.dd.num_vq)) {
1038 mpsslog("%s init_vr failed %s\n",
1039 mic->name, strerror(errno));
1040 return false;
1041 }
1042 return true;
1043}
1044
1045static void
1046stop_virtblk(struct mic_info *mic)
1047{
1048 int vr_size, ret;
1049
1050 vr_size = PAGE_ALIGN(vring_size(MIC_VRING_ENTRIES,
1051 MIC_VIRTIO_RING_ALIGN) + sizeof(struct _mic_vring_info));
1052 ret = munmap(mic->mic_virtblk.block_dp,
1053 MIC_DEVICE_PAGE_END + vr_size * virtblk_dev_page.dd.num_vq);
1054 if (ret < 0)
1055 mpsslog("%s munmap errno %d\n", mic->name, errno);
1056 close(mic->mic_virtblk.virtio_block_fd);
1057}
1058
1059static __u8
1060header_error_check(struct vring_desc *desc)
1061{
1062 if (le32toh(desc->len) != sizeof(struct virtio_blk_outhdr)) {
1063 mpsslog("%s() %d: length is not sizeof(virtio_blk_outhd)\n",
1064 __func__, __LINE__);
1065 return -EIO;
1066 }
1067 if (!(le16toh(desc->flags) & VRING_DESC_F_NEXT)) {
1068 mpsslog("%s() %d: alone\n",
1069 __func__, __LINE__);
1070 return -EIO;
1071 }
1072 if (le16toh(desc->flags) & VRING_DESC_F_WRITE) {
1073 mpsslog("%s() %d: not read\n",
1074 __func__, __LINE__);
1075 return -EIO;
1076 }
1077 return 0;
1078}
1079
1080static int
1081read_header(int fd, struct virtio_blk_outhdr *hdr, __u32 desc_idx)
1082{
1083 struct iovec iovec;
1084 struct mic_copy_desc copy;
1085
1086 iovec.iov_len = sizeof(*hdr);
1087 iovec.iov_base = hdr;
1088 copy.iov = &iovec;
1089 copy.iovcnt = 1;
1090 copy.vr_idx = 0; /* only one vring on virtio_block */
1091 copy.update_used = false; /* do not update used index */
1092 return ioctl(fd, MIC_VIRTIO_COPY_DESC, &copy);
1093}
1094
1095static int
1096transfer_blocks(int fd, struct iovec *iovec, __u32 iovcnt)
1097{
1098 struct mic_copy_desc copy;
1099
1100 copy.iov = iovec;
1101 copy.iovcnt = iovcnt;
1102 copy.vr_idx = 0; /* only one vring on virtio_block */
1103 copy.update_used = false; /* do not update used index */
1104 return ioctl(fd, MIC_VIRTIO_COPY_DESC, &copy);
1105}
1106
1107static __u8
1108status_error_check(struct vring_desc *desc)
1109{
1110 if (le32toh(desc->len) != sizeof(__u8)) {
1111 mpsslog("%s() %d: length is not sizeof(status)\n",
1112 __func__, __LINE__);
1113 return -EIO;
1114 }
1115 return 0;
1116}
1117
1118static int
1119write_status(int fd, __u8 *status)
1120{
1121 struct iovec iovec;
1122 struct mic_copy_desc copy;
1123
1124 iovec.iov_base = status;
1125 iovec.iov_len = sizeof(*status);
1126 copy.iov = &iovec;
1127 copy.iovcnt = 1;
1128 copy.vr_idx = 0; /* only one vring on virtio_block */
1129 copy.update_used = true; /* Update used index */
1130 return ioctl(fd, MIC_VIRTIO_COPY_DESC, &copy);
1131}
1132
1133static void *
1134virtio_block(void *arg)
1135{
1136 struct mic_info *mic = (struct mic_info *)arg;
1137 int ret;
1138 struct pollfd block_poll;
1139 struct mic_vring vring;
1140 __u16 avail_idx;
1141 __u32 desc_idx;
1142 struct vring_desc *desc;
1143 struct iovec *iovec, *piov;
1144 __u8 status;
1145 __u32 buffer_desc_idx;
1146 struct virtio_blk_outhdr hdr;
1147 void *fos;
1148
1149 for (;;) { /* forever */
1150 if (!open_backend(mic)) { /* No virtblk */
1151 for (mic->mic_virtblk.signaled = 0;
1152 !mic->mic_virtblk.signaled;)
1153 sleep(1);
1154 continue;
1155 }
1156
1157 /* backend file is specified. */
1158 if (!start_virtblk(mic, &vring))
1159 goto _close_backend;
1160 iovec = malloc(sizeof(*iovec) *
1161 le32toh(virtblk_dev_page.blk_config.seg_max));
1162 if (!iovec) {
1163 mpsslog("%s: can't alloc iovec: %s\n",
1164 mic->name, strerror(ENOMEM));
1165 goto _stop_virtblk;
1166 }
1167
1168 block_poll.fd = mic->mic_virtblk.virtio_block_fd;
1169 block_poll.events = POLLIN;
1170 for (mic->mic_virtblk.signaled = 0;
1171 !mic->mic_virtblk.signaled;) {
1172 block_poll.revents = 0;
1173 /* timeout in 1 sec to see signaled */
1174 ret = poll(&block_poll, 1, 1000);
1175 if (ret < 0) {
1176 mpsslog("%s %d: poll failed: %s\n",
1177 __func__, __LINE__,
1178 strerror(errno));
1179 continue;
1180 }
1181
1182 if (!(block_poll.revents & POLLIN)) {
1183#ifdef DEBUG
1184 mpsslog("%s %d: block_poll.revents=0x%x\n",
1185 __func__, __LINE__, block_poll.revents);
1186#endif
1187 continue;
1188 }
1189
1190 /* POLLIN */
1191 while (vring.info->avail_idx !=
1192 le16toh(vring.vr.avail->idx)) {
1193 /* read header element */
1194 avail_idx =
1195 vring.info->avail_idx &
1196 (vring.vr.num - 1);
1197 desc_idx = le16toh(
1198 vring.vr.avail->ring[avail_idx]);
1199 desc = &vring.vr.desc[desc_idx];
1200#ifdef DEBUG
1201 mpsslog("%s() %d: avail_idx=%d ",
1202 __func__, __LINE__,
1203 vring.info->avail_idx);
1204 mpsslog("vring.vr.num=%d desc=%p\n",
1205 vring.vr.num, desc);
1206#endif
1207 status = header_error_check(desc);
1208 ret = read_header(
1209 mic->mic_virtblk.virtio_block_fd,
1210 &hdr, desc_idx);
1211 if (ret < 0) {
1212 mpsslog("%s() %d %s: ret=%d %s\n",
1213 __func__, __LINE__,
1214 mic->name, ret,
1215 strerror(errno));
1216 break;
1217 }
1218 /* buffer element */
1219 piov = iovec;
1220 status = 0;
1221 fos = mic->mic_virtblk.backend_addr +
1222 (hdr.sector * SECTOR_SIZE);
1223 buffer_desc_idx = next_desc(desc);
1224 desc_idx = buffer_desc_idx;
1225 for (desc = &vring.vr.desc[buffer_desc_idx];
1226 desc->flags & VRING_DESC_F_NEXT;
1227 desc_idx = next_desc(desc),
1228 desc = &vring.vr.desc[desc_idx]) {
1229 piov->iov_len = desc->len;
1230 piov->iov_base = fos;
1231 piov++;
1232 fos += desc->len;
1233 }
1234 /* Returning NULLs for VIRTIO_BLK_T_GET_ID. */
1235 if (hdr.type & ~(VIRTIO_BLK_T_OUT |
1236 VIRTIO_BLK_T_GET_ID)) {
1237 /*
1238 VIRTIO_BLK_T_IN - does not do
1239 anything. Probably for documenting.
1240 VIRTIO_BLK_T_SCSI_CMD - for
1241 virtio_scsi.
1242 VIRTIO_BLK_T_FLUSH - turned off in
1243 config space.
1244 VIRTIO_BLK_T_BARRIER - defined but not
1245 used in anywhere.
1246 */
1247 mpsslog("%s() %d: type %x ",
1248 __func__, __LINE__,
1249 hdr.type);
1250 mpsslog("is not supported\n");
1251 status = -ENOTSUP;
1252
1253 } else {
1254 ret = transfer_blocks(
1255 mic->mic_virtblk.virtio_block_fd,
1256 iovec,
1257 piov - iovec);
1258 if (ret < 0 &&
1259 status != 0)
1260 status = ret;
1261 }
1262 /* write status and update used pointer */
1263 if (status != 0)
1264 status = status_error_check(desc);
1265 ret = write_status(
1266 mic->mic_virtblk.virtio_block_fd,
1267 &status);
1268#ifdef DEBUG
1269 mpsslog("%s() %d: write status=%d on desc=%p\n",
1270 __func__, __LINE__,
1271 status, desc);
1272#endif
1273 }
1274 }
1275 free(iovec);
1276_stop_virtblk:
1277 stop_virtblk(mic);
1278_close_backend:
1279 close_backend(mic);
1280 } /* forever */
1281
1282 pthread_exit(NULL);
1283}
1284
1285static void
1286reset(struct mic_info *mic)
1287{
1288#define RESET_TIMEOUT 120
1289 int i = RESET_TIMEOUT;
1290 setsysfs(mic->name, "state", "reset");
1291 while (i) {
1292 char *state;
1293 state = readsysfs(mic->name, "state");
1294 if (!state)
1295 goto retry;
1296 mpsslog("%s: %s %d state %s\n",
1297 mic->name, __func__, __LINE__, state);
1298
1299 /*
1300 * If the shutdown was initiated by OSPM, the state stays
1301 * in "suspended" which is also a valid condition for reset.
1302 */
1303 if ((!strcmp(state, "offline")) ||
1304 (!strcmp(state, "suspended"))) {
1305 free(state);
1306 break;
1307 }
1308 free(state);
1309retry:
1310 sleep(1);
1311 i--;
1312 }
1313}
1314
1315static int
1316get_mic_shutdown_status(struct mic_info *mic, char *shutdown_status)
1317{
1318 if (!strcmp(shutdown_status, "nop"))
1319 return MIC_NOP;
1320 if (!strcmp(shutdown_status, "crashed"))
1321 return MIC_CRASHED;
1322 if (!strcmp(shutdown_status, "halted"))
1323 return MIC_HALTED;
1324 if (!strcmp(shutdown_status, "poweroff"))
1325 return MIC_POWER_OFF;
1326 if (!strcmp(shutdown_status, "restart"))
1327 return MIC_RESTART;
1328 mpsslog("%s: BUG invalid status %s\n", mic->name, shutdown_status);
1329 /* Invalid state */
1330 assert(0);
1331};
1332
1333static int get_mic_state(struct mic_info *mic, char *state)
1334{
1335 if (!strcmp(state, "offline"))
1336 return MIC_OFFLINE;
1337 if (!strcmp(state, "online"))
1338 return MIC_ONLINE;
1339 if (!strcmp(state, "shutting_down"))
1340 return MIC_SHUTTING_DOWN;
1341 if (!strcmp(state, "reset_failed"))
1342 return MIC_RESET_FAILED;
1343 if (!strcmp(state, "suspending"))
1344 return MIC_SUSPENDING;
1345 if (!strcmp(state, "suspended"))
1346 return MIC_SUSPENDED;
1347 mpsslog("%s: BUG invalid state %s\n", mic->name, state);
1348 /* Invalid state */
1349 assert(0);
1350};
1351
1352static void mic_handle_shutdown(struct mic_info *mic)
1353{
1354#define SHUTDOWN_TIMEOUT 60
1355 int i = SHUTDOWN_TIMEOUT, ret, stat = 0;
1356 char *shutdown_status;
1357 while (i) {
1358 shutdown_status = readsysfs(mic->name, "shutdown_status");
1359 if (!shutdown_status)
1360 continue;
1361 mpsslog("%s: %s %d shutdown_status %s\n",
1362 mic->name, __func__, __LINE__, shutdown_status);
1363 switch (get_mic_shutdown_status(mic, shutdown_status)) {
1364 case MIC_RESTART:
1365 mic->restart = 1;
1366 case MIC_HALTED:
1367 case MIC_POWER_OFF:
1368 case MIC_CRASHED:
1369 free(shutdown_status);
1370 goto reset;
1371 default:
1372 break;
1373 }
1374 free(shutdown_status);
1375 sleep(1);
1376 i--;
1377 }
1378reset:
1379 ret = kill(mic->pid, SIGTERM);
1380 mpsslog("%s: %s %d kill pid %d ret %d\n",
1381 mic->name, __func__, __LINE__,
1382 mic->pid, ret);
1383 if (!ret) {
1384 ret = waitpid(mic->pid, &stat,
1385 WIFSIGNALED(stat));
1386 mpsslog("%s: %s %d waitpid ret %d pid %d\n",
1387 mic->name, __func__, __LINE__,
1388 ret, mic->pid);
1389 }
1390 if (ret == mic->pid)
1391 reset(mic);
1392}
1393
1394static void *
1395mic_config(void *arg)
1396{
1397 struct mic_info *mic = (struct mic_info *)arg;
1398 char *state = NULL;
1399 char pathname[PATH_MAX];
1400 int fd, ret;
1401 struct pollfd ufds[1];
1402 char value[4096];
1403
1404 snprintf(pathname, PATH_MAX - 1, "%s/%s/%s",
1405 MICSYSFSDIR, mic->name, "state");
1406
1407 fd = open(pathname, O_RDONLY);
1408 if (fd < 0) {
1409 mpsslog("%s: opening file %s failed %s\n",
1410 mic->name, pathname, strerror(errno));
1411 goto error;
1412 }
1413
1414 do {
1415 ret = read(fd, value, sizeof(value));
1416 if (ret < 0) {
1417 mpsslog("%s: Failed to read sysfs entry '%s': %s\n",
1418 mic->name, pathname, strerror(errno));
1419 goto close_error1;
1420 }
1421retry:
1422 state = readsysfs(mic->name, "state");
1423 if (!state)
1424 goto retry;
1425 mpsslog("%s: %s %d state %s\n",
1426 mic->name, __func__, __LINE__, state);
1427 switch (get_mic_state(mic, state)) {
1428 case MIC_SHUTTING_DOWN:
1429 mic_handle_shutdown(mic);
1430 goto close_error;
1431 case MIC_SUSPENDING:
1432 mic->boot_on_resume = 1;
1433 setsysfs(mic->name, "state", "suspend");
1434 mic_handle_shutdown(mic);
1435 goto close_error;
1436 case MIC_OFFLINE:
1437 if (mic->boot_on_resume) {
1438 setsysfs(mic->name, "state", "boot");
1439 mic->boot_on_resume = 0;
1440 }
1441 break;
1442 default:
1443 break;
1444 }
1445 free(state);
1446
1447 ufds[0].fd = fd;
1448 ufds[0].events = POLLERR | POLLPRI;
1449 ret = poll(ufds, 1, -1);
1450 if (ret < 0) {
1451 mpsslog("%s: poll failed %s\n",
1452 mic->name, strerror(errno));
1453 goto close_error1;
1454 }
1455 } while (1);
1456close_error:
1457 free(state);
1458close_error1:
1459 close(fd);
1460error:
1461 init_mic(mic);
1462 pthread_exit(NULL);
1463}
1464
1465static void
1466set_cmdline(struct mic_info *mic)
1467{
1468 char buffer[PATH_MAX];
1469 int len;
1470
1471 len = snprintf(buffer, PATH_MAX,
1472 "clocksource=tsc highres=off nohz=off ");
1473 len += snprintf(buffer + len, PATH_MAX,
1474 "cpufreq_on;corec6_off;pc3_off;pc6_off ");
1475 len += snprintf(buffer + len, PATH_MAX,
1476 "ifcfg=static;address,172.31.%d.1;netmask,255.255.255.0",
1477 mic->id);
1478
1479 setsysfs(mic->name, "cmdline", buffer);
1480 mpsslog("%s: Command line: \"%s\"\n", mic->name, buffer);
1481 snprintf(buffer, PATH_MAX, "172.31.%d.1", mic->id);
1482 mpsslog("%s: IPADDR: \"%s\"\n", mic->name, buffer);
1483}
1484
1485static void
1486set_log_buf_info(struct mic_info *mic)
1487{
1488 int fd;
1489 off_t len;
1490 char system_map[] = "/lib/firmware/mic/System.map";
1491 char *map, *temp, log_buf[17] = {'\0'};
1492
1493 fd = open(system_map, O_RDONLY);
1494 if (fd < 0) {
1495 mpsslog("%s: Opening System.map failed: %d\n",
1496 mic->name, errno);
1497 return;
1498 }
1499 len = lseek(fd, 0, SEEK_END);
1500 if (len < 0) {
1501 mpsslog("%s: Reading System.map size failed: %d\n",
1502 mic->name, errno);
1503 close(fd);
1504 return;
1505 }
1506 map = mmap(NULL, len, PROT_READ, MAP_PRIVATE, fd, 0);
1507 if (map == MAP_FAILED) {
1508 mpsslog("%s: mmap of System.map failed: %d\n",
1509 mic->name, errno);
1510 close(fd);
1511 return;
1512 }
1513 temp = strstr(map, "__log_buf");
1514 if (!temp) {
1515 mpsslog("%s: __log_buf not found: %d\n", mic->name, errno);
1516 munmap(map, len);
1517 close(fd);
1518 return;
1519 }
1520 strncpy(log_buf, temp - 19, 16);
1521 setsysfs(mic->name, "log_buf_addr", log_buf);
1522 mpsslog("%s: log_buf_addr: %s\n", mic->name, log_buf);
1523 temp = strstr(map, "log_buf_len");
1524 if (!temp) {
1525 mpsslog("%s: log_buf_len not found: %d\n", mic->name, errno);
1526 munmap(map, len);
1527 close(fd);
1528 return;
1529 }
1530 strncpy(log_buf, temp - 19, 16);
1531 setsysfs(mic->name, "log_buf_len", log_buf);
1532 mpsslog("%s: log_buf_len: %s\n", mic->name, log_buf);
1533 munmap(map, len);
1534 close(fd);
1535}
1536
1537static void init_mic(struct mic_info *mic);
1538
1539static void
1540change_virtblk_backend(int x, siginfo_t *siginfo, void *p)
1541{
1542 struct mic_info *mic;
1543
1544 for (mic = mic_list.next; mic != NULL; mic = mic->next)
1545 mic->mic_virtblk.signaled = 1/* true */;
1546}
1547
1548static void
1549init_mic(struct mic_info *mic)
1550{
1551 struct sigaction ignore = {
1552 .sa_flags = 0,
1553 .sa_handler = SIG_IGN
1554 };
1555 struct sigaction act = {
1556 .sa_flags = SA_SIGINFO,
1557 .sa_sigaction = change_virtblk_backend,
1558 };
1559 char buffer[PATH_MAX];
1560 int err;
1561
1562 /*
1563 * Currently, one virtio block device is supported for each MIC card
1564 * at a time. Any user (or test) can send a SIGUSR1 to the MIC daemon.
1565 * The signal informs the virtio block backend about a change in the
1566 * configuration file which specifies the virtio backend file name on
1567 * the host. Virtio block backend then re-reads the configuration file
1568 * and switches to the new block device. This signalling mechanism may
1569 * not be required once multiple virtio block devices are supported by
1570 * the MIC daemon.
1571 */
1572 sigaction(SIGUSR1, &ignore, NULL);
1573
1574 mic->pid = fork();
1575 switch (mic->pid) {
1576 case 0:
1577 set_log_buf_info(mic);
1578 set_cmdline(mic);
1579 add_virtio_device(mic, &virtcons_dev_page.dd);
1580 add_virtio_device(mic, &virtnet_dev_page.dd);
1581 err = pthread_create(&mic->mic_console.console_thread, NULL,
1582 virtio_console, mic);
1583 if (err)
1584 mpsslog("%s virtcons pthread_create failed %s\n",
1585 mic->name, strerror(err));
1586 err = pthread_create(&mic->mic_net.net_thread, NULL,
1587 virtio_net, mic);
1588 if (err)
1589 mpsslog("%s virtnet pthread_create failed %s\n",
1590 mic->name, strerror(err));
1591 err = pthread_create(&mic->mic_virtblk.block_thread, NULL,
1592 virtio_block, mic);
1593 if (err)
1594 mpsslog("%s virtblk pthread_create failed %s\n",
1595 mic->name, strerror(err));
1596 sigemptyset(&act.sa_mask);
1597 err = sigaction(SIGUSR1, &act, NULL);
1598 if (err)
1599 mpsslog("%s sigaction SIGUSR1 failed %s\n",
1600 mic->name, strerror(errno));
1601 while (1)
1602 sleep(60);
1603 case -1:
1604 mpsslog("fork failed MIC name %s id %d errno %d\n",
1605 mic->name, mic->id, errno);
1606 break;
1607 default:
1608 if (mic->restart) {
1609 snprintf(buffer, PATH_MAX, "boot");
1610 setsysfs(mic->name, "state", buffer);
1611 mpsslog("%s restarting mic %d\n",
1612 mic->name, mic->restart);
1613 mic->restart = 0;
1614 }
1615 pthread_create(&mic->config_thread, NULL, mic_config, mic);
1616 }
1617}
1618
1619static void
1620start_daemon(void)
1621{
1622 struct mic_info *mic;
1623
1624 for (mic = mic_list.next; mic != NULL; mic = mic->next)
1625 init_mic(mic);
1626
1627 while (1)
1628 sleep(60);
1629}
1630
1631static int
1632init_mic_list(void)
1633{
1634 struct mic_info *mic = &mic_list;
1635 struct dirent *file;
1636 DIR *dp;
1637 int cnt = 0;
1638
1639 dp = opendir(MICSYSFSDIR);
1640 if (!dp)
1641 return 0;
1642
1643 while ((file = readdir(dp)) != NULL) {
1644 if (!strncmp(file->d_name, "mic", 3)) {
1645 mic->next = calloc(1, sizeof(struct mic_info));
1646 if (mic->next) {
1647 mic = mic->next;
1648 mic->id = atoi(&file->d_name[3]);
1649 mic->name = malloc(strlen(file->d_name) + 16);
1650 if (mic->name)
1651 strcpy(mic->name, file->d_name);
1652 mpsslog("MIC name %s id %d\n", mic->name,
1653 mic->id);
1654 cnt++;
1655 }
1656 }
1657 }
1658
1659 closedir(dp);
1660 return cnt;
1661}
1662
1663void
1664mpsslog(char *format, ...)
1665{
1666 va_list args;
1667 char buffer[4096];
1668 char ts[52], *ts1;
1669 time_t t;
1670
1671 if (logfp == NULL)
1672 return;
1673
1674 va_start(args, format);
1675 vsprintf(buffer, format, args);
1676 va_end(args);
1677
1678 time(&t);
1679 ts1 = ctime_r(&t, ts);
1680 ts1[strlen(ts1) - 1] = '\0';
1681 fprintf(logfp, "%s: %s", ts1, buffer);
1682
1683 fflush(logfp);
1684}
1685
1686int
1687main(int argc, char *argv[])
1688{
1689 int cnt;
1690 pid_t pid;
1691
1692 myname = argv[0];
1693
1694 logfp = fopen(LOGFILE_NAME, "a+");
1695 if (!logfp) {
1696 fprintf(stderr, "cannot open logfile '%s'\n", LOGFILE_NAME);
1697 exit(1);
1698 }
1699 pid = fork();
1700 switch (pid) {
1701 case 0:
1702 break;
1703 case -1:
1704 exit(2);
1705 default:
1706 exit(0);
1707 }
1708
1709 mpsslog("MIC Daemon start\n");
1710
1711 cnt = init_mic_list();
1712 if (cnt == 0) {
1713 mpsslog("MIC module not loaded\n");
1714 exit(3);
1715 }
1716 mpsslog("MIC found %d devices\n", cnt);
1717
1718 start_daemon();
1719
1720 exit(0);
1721}
diff --git a/Documentation/mic/mpssd/mpssd.h b/Documentation/mic/mpssd/mpssd.h
new file mode 100644
index 000000000000..f5f18b15d9a0
--- /dev/null
+++ b/Documentation/mic/mpssd/mpssd.h
@@ -0,0 +1,102 @@
1/*
2 * Intel MIC Platform Software Stack (MPSS)
3 *
4 * Copyright(c) 2013 Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2, as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * The full GNU General Public License is included in this distribution in
16 * the file called "COPYING".
17 *
18 * Intel MIC User Space Tools.
19 */
20#ifndef _MPSSD_H_
21#define _MPSSD_H_
22
23#include <stdio.h>
24#include <stdlib.h>
25#include <string.h>
26#include <fcntl.h>
27#include <unistd.h>
28#include <dirent.h>
29#include <libgen.h>
30#include <pthread.h>
31#include <stdarg.h>
32#include <time.h>
33#include <errno.h>
34#include <sys/dir.h>
35#include <sys/ioctl.h>
36#include <sys/poll.h>
37#include <sys/types.h>
38#include <sys/socket.h>
39#include <sys/stat.h>
40#include <sys/types.h>
41#include <sys/mman.h>
42#include <sys/utsname.h>
43#include <sys/wait.h>
44#include <netinet/in.h>
45#include <arpa/inet.h>
46#include <netdb.h>
47#include <pthread.h>
48#include <signal.h>
49#include <limits.h>
50#include <syslog.h>
51#include <getopt.h>
52#include <net/if.h>
53#include <linux/if_tun.h>
54#include <linux/if_tun.h>
55#include <linux/virtio_ids.h>
56
57#define MICSYSFSDIR "/sys/class/mic"
58#define LOGFILE_NAME "/var/log/mpssd"
59#define PAGE_SIZE 4096
60
61struct mic_console_info {
62 pthread_t console_thread;
63 int virtio_console_fd;
64 void *console_dp;
65};
66
67struct mic_net_info {
68 pthread_t net_thread;
69 int virtio_net_fd;
70 int tap_fd;
71 void *net_dp;
72};
73
74struct mic_virtblk_info {
75 pthread_t block_thread;
76 int virtio_block_fd;
77 void *block_dp;
78 volatile sig_atomic_t signaled;
79 char *backend_file;
80 int backend;
81 void *backend_addr;
82 long backend_size;
83};
84
85struct mic_info {
86 int id;
87 char *name;
88 pthread_t config_thread;
89 pid_t pid;
90 struct mic_console_info mic_console;
91 struct mic_net_info mic_net;
92 struct mic_virtblk_info mic_virtblk;
93 int restart;
94 int boot_on_resume;
95 struct mic_info *next;
96};
97
98__attribute__((format(printf, 1, 2)))
99void mpsslog(char *format, ...);
100char *readsysfs(char *dir, char *entry);
101int setsysfs(char *dir, char *entry, char *value);
102#endif
diff --git a/Documentation/mic/mpssd/sysfs.c b/Documentation/mic/mpssd/sysfs.c
new file mode 100644
index 000000000000..8dd326936083
--- /dev/null
+++ b/Documentation/mic/mpssd/sysfs.c
@@ -0,0 +1,102 @@
1/*
2 * Intel MIC Platform Software Stack (MPSS)
3 *
4 * Copyright(c) 2013 Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2, as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * The full GNU General Public License is included in this distribution in
16 * the file called "COPYING".
17 *
18 * Intel MIC User Space Tools.
19 */
20
21#include "mpssd.h"
22
23#define PAGE_SIZE 4096
24
25char *
26readsysfs(char *dir, char *entry)
27{
28 char filename[PATH_MAX];
29 char value[PAGE_SIZE];
30 char *string = NULL;
31 int fd;
32 int len;
33
34 if (dir == NULL)
35 snprintf(filename, PATH_MAX, "%s/%s", MICSYSFSDIR, entry);
36 else
37 snprintf(filename, PATH_MAX,
38 "%s/%s/%s", MICSYSFSDIR, dir, entry);
39
40 fd = open(filename, O_RDONLY);
41 if (fd < 0) {
42 mpsslog("Failed to open sysfs entry '%s': %s\n",
43 filename, strerror(errno));
44 return NULL;
45 }
46
47 len = read(fd, value, sizeof(value));
48 if (len < 0) {
49 mpsslog("Failed to read sysfs entry '%s': %s\n",
50 filename, strerror(errno));
51 goto readsys_ret;
52 }
53 if (len == 0)
54 goto readsys_ret;
55
56 value[len - 1] = '\0';
57
58 string = malloc(strlen(value) + 1);
59 if (string)
60 strcpy(string, value);
61
62readsys_ret:
63 close(fd);
64 return string;
65}
66
67int
68setsysfs(char *dir, char *entry, char *value)
69{
70 char filename[PATH_MAX];
71 char *oldvalue;
72 int fd, ret = 0;
73
74 if (dir == NULL)
75 snprintf(filename, PATH_MAX, "%s/%s", MICSYSFSDIR, entry);
76 else
77 snprintf(filename, PATH_MAX, "%s/%s/%s",
78 MICSYSFSDIR, dir, entry);
79
80 oldvalue = readsysfs(dir, entry);
81
82 fd = open(filename, O_RDWR);
83 if (fd < 0) {
84 ret = errno;
85 mpsslog("Failed to open sysfs entry '%s': %s\n",
86 filename, strerror(errno));
87 goto done;
88 }
89
90 if (!oldvalue || strcmp(value, oldvalue)) {
91 if (write(fd, value, strlen(value)) < 0) {
92 ret = errno;
93 mpsslog("Failed to write new sysfs entry '%s': %s\n",
94 filename, strerror(errno));
95 }
96 }
97 close(fd);
98done:
99 if (oldvalue)
100 free(oldvalue);
101 return ret;
102}
diff --git a/Documentation/mutex-design.txt b/Documentation/mutex-design.txt
index 38c10fd7f411..1dfe62c3641d 100644
--- a/Documentation/mutex-design.txt
+++ b/Documentation/mutex-design.txt
@@ -116,11 +116,11 @@ using mutexes at the moment, please let me know if you find any. ]
116Implementation of mutexes 116Implementation of mutexes
117------------------------- 117-------------------------
118 118
119'struct mutex' is the new mutex type, defined in include/linux/mutex.h 119'struct mutex' is the new mutex type, defined in include/linux/mutex.h and
120and implemented in kernel/mutex.c. It is a counter-based mutex with a 120implemented in kernel/locking/mutex.c. It is a counter-based mutex with a
121spinlock and a wait-list. The counter has 3 states: 1 for "unlocked", 121spinlock and a wait-list. The counter has 3 states: 1 for "unlocked", 0 for
1220 for "locked" and negative numbers (usually -1) for "locked, potential 122"locked" and negative numbers (usually -1) for "locked, potential waiters
123waiters queued". 123queued".
124 124
125the APIs of 'struct mutex' have been streamlined: 125the APIs of 'struct mutex' have been streamlined:
126 126
diff --git a/Documentation/networking/batman-adv.txt b/Documentation/networking/batman-adv.txt
index c1d82047a4b1..89490beb3c0b 100644
--- a/Documentation/networking/batman-adv.txt
+++ b/Documentation/networking/batman-adv.txt
@@ -69,8 +69,7 @@ folder:
69# aggregated_ogms gw_bandwidth log_level 69# aggregated_ogms gw_bandwidth log_level
70# ap_isolation gw_mode orig_interval 70# ap_isolation gw_mode orig_interval
71# bonding gw_sel_class routing_algo 71# bonding gw_sel_class routing_algo
72# bridge_loop_avoidance hop_penalty vis_mode 72# bridge_loop_avoidance hop_penalty fragmentation
73# fragmentation
74 73
75 74
76There is a special folder for debugging information: 75There is a special folder for debugging information:
@@ -78,7 +77,7 @@ There is a special folder for debugging information:
78# ls /sys/kernel/debug/batman_adv/bat0/ 77# ls /sys/kernel/debug/batman_adv/bat0/
79# bla_backbone_table log transtable_global 78# bla_backbone_table log transtable_global
80# bla_claim_table originators transtable_local 79# bla_claim_table originators transtable_local
81# gateways socket vis_data 80# gateways socket
82 81
83Some of the files contain all sort of status information regard- 82Some of the files contain all sort of status information regard-
84ing the mesh network. For example, you can view the table of 83ing the mesh network. For example, you can view the table of
@@ -127,51 +126,6 @@ ously assigned to interfaces now used by batman advanced, e.g.
127# ifconfig eth0 0.0.0.0 126# ifconfig eth0 0.0.0.0
128 127
129 128
130VISUALIZATION
131-------------
132
133If you want topology visualization, at least one mesh node must
134be configured as VIS-server:
135
136# echo "server" > /sys/class/net/bat0/mesh/vis_mode
137
138Each node is either configured as "server" or as "client" (de-
139fault: "client"). Clients send their topology data to the server
140next to them, and server synchronize with other servers. If there
141is no server configured (default) within the mesh, no topology
142information will be transmitted. With these "synchronizing
143servers", there can be 1 or more vis servers sharing the same (or
144at least very similar) data.
145
146When configured as server, you can get a topology snapshot of
147your mesh:
148
149# cat /sys/kernel/debug/batman_adv/bat0/vis_data
150
151This raw output is intended to be easily parsable and convertable
152with other tools. Have a look at the batctl README if you want a
153vis output in dot or json format for instance and how those out-
154puts could then be visualised in an image.
155
156The raw format consists of comma separated values per entry where
157each entry is giving information about a certain source inter-
158face. Each entry can/has to have the following values:
159-> "mac" - mac address of an originator's source interface
160 (each line begins with it)
161-> "TQ mac value" - src mac's link quality towards mac address
162 of a neighbor originator's interface which
163 is being used for routing
164-> "TT mac" - TT announced by source mac
165-> "PRIMARY" - this is a primary interface
166-> "SEC mac" - secondary mac address of source
167 (requires preceding PRIMARY)
168
169The TQ value has a range from 4 to 255 with 255 being the best.
170The TT entries are showing which hosts are connected to the mesh
171via bat0 or being bridged into the mesh network. The PRIMARY/SEC
172values are only applied on primary interfaces
173
174
175LOGGING/DEBUGGING 129LOGGING/DEBUGGING
176----------------- 130-----------------
177 131
@@ -245,5 +199,5 @@ Mailing-list: b.a.t.m.a.n@open-mesh.org (optional subscription
245 199
246You can also contact the Authors: 200You can also contact the Authors:
247 201
248Marek Lindner <lindner_marek@yahoo.de> 202Marek Lindner <mareklindner@neomailbox.ch>
249Simon Wunderlich <siwu@hrz.tu-chemnitz.de> 203Simon Wunderlich <sw@simonwunderlich.de>
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index 9b28e714831a..2cdb8b66caa9 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -639,6 +639,15 @@ num_unsol_na
639 are generated by the ipv4 and ipv6 code and the numbers of 639 are generated by the ipv4 and ipv6 code and the numbers of
640 repetitions cannot be set independently. 640 repetitions cannot be set independently.
641 641
642packets_per_slave
643
644 Specify the number of packets to transmit through a slave before
645 moving to the next one. When set to 0 then a slave is chosen at
646 random.
647
648 The valid range is 0 - 65535; the default value is 1. This option
649 has effect only in balance-rr mode.
650
642primary 651primary
643 652
644 A string (eth0, eth2, etc) specifying which slave is the 653 A string (eth0, eth2, etc) specifying which slave is the
@@ -743,21 +752,16 @@ xmit_hash_policy
743 protocol information to generate the hash. 752 protocol information to generate the hash.
744 753
745 Uses XOR of hardware MAC addresses and IP addresses to 754 Uses XOR of hardware MAC addresses and IP addresses to
746 generate the hash. The IPv4 formula is 755 generate the hash. The formula is
747
748 (((source IP XOR dest IP) AND 0xffff) XOR
749 ( source MAC XOR destination MAC ))
750 modulo slave count
751
752 The IPv6 formula is
753 756
754 hash = (source ip quad 2 XOR dest IP quad 2) XOR 757 hash = source MAC XOR destination MAC
755 (source ip quad 3 XOR dest IP quad 3) XOR 758 hash = hash XOR source IP XOR destination IP
756 (source ip quad 4 XOR dest IP quad 4) 759 hash = hash XOR (hash RSHIFT 16)
760 hash = hash XOR (hash RSHIFT 8)
761 And then hash is reduced modulo slave count.
757 762
758 (((hash >> 24) XOR (hash >> 16) XOR (hash >> 8) XOR hash) 763 If the protocol is IPv6 then the source and destination
759 XOR (source MAC XOR destination MAC)) 764 addresses are first hashed using ipv6_addr_hash.
760 modulo slave count
761 765
762 This algorithm will place all traffic to a particular 766 This algorithm will place all traffic to a particular
763 network peer on the same slave. For non-IP traffic, 767 network peer on the same slave. For non-IP traffic,
@@ -779,21 +783,16 @@ xmit_hash_policy
779 slaves, although a single connection will not span 783 slaves, although a single connection will not span
780 multiple slaves. 784 multiple slaves.
781 785
782 The formula for unfragmented IPv4 TCP and UDP packets is 786 The formula for unfragmented TCP and UDP packets is
783 787
784 ((source port XOR dest port) XOR 788 hash = source port, destination port (as in the header)
785 ((source IP XOR dest IP) AND 0xffff) 789 hash = hash XOR source IP XOR destination IP
786 modulo slave count 790 hash = hash XOR (hash RSHIFT 16)
791 hash = hash XOR (hash RSHIFT 8)
792 And then hash is reduced modulo slave count.
787 793
788 The formula for unfragmented IPv6 TCP and UDP packets is 794 If the protocol is IPv6 then the source and destination
789 795 addresses are first hashed using ipv6_addr_hash.
790 hash = (source port XOR dest port) XOR
791 ((source ip quad 2 XOR dest IP quad 2) XOR
792 (source ip quad 3 XOR dest IP quad 3) XOR
793 (source ip quad 4 XOR dest IP quad 4))
794
795 ((hash >> 24) XOR (hash >> 16) XOR (hash >> 8) XOR hash)
796 modulo slave count
797 796
798 For fragmented TCP or UDP packets and all other IPv4 and 797 For fragmented TCP or UDP packets and all other IPv4 and
799 IPv6 protocol traffic, the source and destination port 798 IPv6 protocol traffic, the source and destination port
@@ -801,10 +800,6 @@ xmit_hash_policy
801 formula is the same as for the layer2 transmit hash 800 formula is the same as for the layer2 transmit hash
802 policy. 801 policy.
803 802
804 The IPv4 policy is intended to mimic the behavior of
805 certain switches, notably Cisco switches with PFC2 as
806 well as some Foundry and IBM products.
807
808 This algorithm is not fully 802.3ad compliant. A 803 This algorithm is not fully 802.3ad compliant. A
809 single TCP or UDP conversation containing both 804 single TCP or UDP conversation containing both
810 fragmented and unfragmented packets will see packets 805 fragmented and unfragmented packets will see packets
@@ -815,6 +810,26 @@ xmit_hash_policy
815 conversations. Other implementations of 802.3ad may 810 conversations. Other implementations of 802.3ad may
816 or may not tolerate this noncompliance. 811 or may not tolerate this noncompliance.
817 812
813 encap2+3
814
815 This policy uses the same formula as layer2+3 but it
816 relies on skb_flow_dissect to obtain the header fields
817 which might result in the use of inner headers if an
818 encapsulation protocol is used. For example this will
819 improve the performance for tunnel users because the
820 packets will be distributed according to the encapsulated
821 flows.
822
823 encap3+4
824
825 This policy uses the same formula as layer3+4 but it
826 relies on skb_flow_dissect to obtain the header fields
827 which might result in the use of inner headers if an
828 encapsulation protocol is used. For example this will
829 improve the performance for tunnel users because the
830 packets will be distributed according to the encapsulated
831 flows.
832
818 The default value is layer2. This option was added in bonding 833 The default value is layer2. This option was added in bonding
819 version 2.6.3. In earlier versions of bonding, this parameter 834 version 2.6.3. In earlier versions of bonding, this parameter
820 does not exist, and the layer2 policy is the only policy. The 835 does not exist, and the layer2 policy is the only policy. The
diff --git a/Documentation/networking/can.txt b/Documentation/networking/can.txt
index 820f55344edc..4c072414eadb 100644
--- a/Documentation/networking/can.txt
+++ b/Documentation/networking/can.txt
@@ -25,6 +25,12 @@ This file contains
25 4.1.5 RAW socket option CAN_RAW_FD_FRAMES 25 4.1.5 RAW socket option CAN_RAW_FD_FRAMES
26 4.1.6 RAW socket returned message flags 26 4.1.6 RAW socket returned message flags
27 4.2 Broadcast Manager protocol sockets (SOCK_DGRAM) 27 4.2 Broadcast Manager protocol sockets (SOCK_DGRAM)
28 4.2.1 Broadcast Manager operations
29 4.2.2 Broadcast Manager message flags
30 4.2.3 Broadcast Manager transmission timers
31 4.2.4 Broadcast Manager message sequence transmission
32 4.2.5 Broadcast Manager receive filter timers
33 4.2.6 Broadcast Manager multiplex message receive filter
28 4.3 connected transport protocols (SOCK_SEQPACKET) 34 4.3 connected transport protocols (SOCK_SEQPACKET)
29 4.4 unconnected transport protocols (SOCK_DGRAM) 35 4.4 unconnected transport protocols (SOCK_DGRAM)
30 36
@@ -593,6 +599,217 @@ solution for a couple of reasons:
593 In order to receive such messages, CAN_RAW_RECV_OWN_MSGS must be set. 599 In order to receive such messages, CAN_RAW_RECV_OWN_MSGS must be set.
594 600
595 4.2 Broadcast Manager protocol sockets (SOCK_DGRAM) 601 4.2 Broadcast Manager protocol sockets (SOCK_DGRAM)
602
603 The Broadcast Manager protocol provides a command based configuration
604 interface to filter and send (e.g. cyclic) CAN messages in kernel space.
605
606 Receive filters can be used to down sample frequent messages; detect events
607 such as message contents changes, packet length changes, and do time-out
608 monitoring of received messages.
609
610 Periodic transmission tasks of CAN frames or a sequence of CAN frames can be
611 created and modified at runtime; both the message content and the two
612 possible transmit intervals can be altered.
613
614 A BCM socket is not intended for sending individual CAN frames using the
615 struct can_frame as known from the CAN_RAW socket. Instead a special BCM
616 configuration message is defined. The basic BCM configuration message used
617 to communicate with the broadcast manager and the available operations are
618 defined in the linux/can/bcm.h include. The BCM message consists of a
619 message header with a command ('opcode') followed by zero or more CAN frames.
620 The broadcast manager sends responses to user space in the same form:
621
622 struct bcm_msg_head {
623 __u32 opcode; /* command */
624 __u32 flags; /* special flags */
625 __u32 count; /* run 'count' times with ival1 */
626 struct timeval ival1, ival2; /* count and subsequent interval */
627 canid_t can_id; /* unique can_id for task */
628 __u32 nframes; /* number of can_frames following */
629 struct can_frame frames[0];
630 };
631
632 The aligned payload 'frames' uses the same basic CAN frame structure defined
633 at the beginning of section 4 and in the include/linux/can.h include. All
634 messages to the broadcast manager from user space have this structure.
635
636 Note a CAN_BCM socket must be connected instead of bound after socket
637 creation (example without error checking):
638
639 int s;
640 struct sockaddr_can addr;
641 struct ifreq ifr;
642
643 s = socket(PF_CAN, SOCK_DGRAM, CAN_BCM);
644
645 strcpy(ifr.ifr_name, "can0");
646 ioctl(s, SIOCGIFINDEX, &ifr);
647
648 addr.can_family = AF_CAN;
649 addr.can_ifindex = ifr.ifr_ifindex;
650
651 connect(s, (struct sockaddr *)&addr, sizeof(addr))
652
653 (..)
654
655 The broadcast manager socket is able to handle any number of in flight
656 transmissions or receive filters concurrently. The different RX/TX jobs are
657 distinguished by the unique can_id in each BCM message. However additional
658 CAN_BCM sockets are recommended to communicate on multiple CAN interfaces.
659 When the broadcast manager socket is bound to 'any' CAN interface (=> the
660 interface index is set to zero) the configured receive filters apply to any
661 CAN interface unless the sendto() syscall is used to overrule the 'any' CAN
662 interface index. When using recvfrom() instead of read() to retrieve BCM
663 socket messages the originating CAN interface is provided in can_ifindex.
664
665 4.2.1 Broadcast Manager operations
666
667 The opcode defines the operation for the broadcast manager to carry out,
668 or details the broadcast managers response to several events, including
669 user requests.
670
671 Transmit Operations (user space to broadcast manager):
672
673 TX_SETUP: Create (cyclic) transmission task.
674
675 TX_DELETE: Remove (cyclic) transmission task, requires only can_id.
676
677 TX_READ: Read properties of (cyclic) transmission task for can_id.
678
679 TX_SEND: Send one CAN frame.
680
681 Transmit Responses (broadcast manager to user space):
682
683 TX_STATUS: Reply to TX_READ request (transmission task configuration).
684
685 TX_EXPIRED: Notification when counter finishes sending at initial interval
686 'ival1'. Requires the TX_COUNTEVT flag to be set at TX_SETUP.
687
688 Receive Operations (user space to broadcast manager):
689
690 RX_SETUP: Create RX content filter subscription.
691
692 RX_DELETE: Remove RX content filter subscription, requires only can_id.
693
694 RX_READ: Read properties of RX content filter subscription for can_id.
695
696 Receive Responses (broadcast manager to user space):
697
698 RX_STATUS: Reply to RX_READ request (filter task configuration).
699
700 RX_TIMEOUT: Cyclic message is detected to be absent (timer ival1 expired).
701
702 RX_CHANGED: BCM message with updated CAN frame (detected content change).
703 Sent on first message received or on receipt of revised CAN messages.
704
705 4.2.2 Broadcast Manager message flags
706
707 When sending a message to the broadcast manager the 'flags' element may
708 contain the following flag definitions which influence the behaviour:
709
710 SETTIMER: Set the values of ival1, ival2 and count
711
712 STARTTIMER: Start the timer with the actual values of ival1, ival2
713 and count. Starting the timer leads simultaneously to emit a CAN frame.
714
715 TX_COUNTEVT: Create the message TX_EXPIRED when count expires
716
717 TX_ANNOUNCE: A change of data by the process is emitted immediately.
718
719 TX_CP_CAN_ID: Copies the can_id from the message header to each
720 subsequent frame in frames. This is intended as usage simplification. For
721 TX tasks the unique can_id from the message header may differ from the
722 can_id(s) stored for transmission in the subsequent struct can_frame(s).
723
724 RX_FILTER_ID: Filter by can_id alone, no frames required (nframes=0).
725
726 RX_CHECK_DLC: A change of the DLC leads to an RX_CHANGED.
727
728 RX_NO_AUTOTIMER: Prevent automatically starting the timeout monitor.
729
730 RX_ANNOUNCE_RESUME: If passed at RX_SETUP and a receive timeout occured, a
731 RX_CHANGED message will be generated when the (cyclic) receive restarts.
732
733 TX_RESET_MULTI_IDX: Reset the index for the multiple frame transmission.
734
735 RX_RTR_FRAME: Send reply for RTR-request (placed in op->frames[0]).
736
737 4.2.3 Broadcast Manager transmission timers
738
739 Periodic transmission configurations may use up to two interval timers.
740 In this case the BCM sends a number of messages ('count') at an interval
741 'ival1', then continuing to send at another given interval 'ival2'. When
742 only one timer is needed 'count' is set to zero and only 'ival2' is used.
743 When SET_TIMER and START_TIMER flag were set the timers are activated.
744 The timer values can be altered at runtime when only SET_TIMER is set.
745
746 4.2.4 Broadcast Manager message sequence transmission
747
748 Up to 256 CAN frames can be transmitted in a sequence in the case of a cyclic
749 TX task configuration. The number of CAN frames is provided in the 'nframes'
750 element of the BCM message head. The defined number of CAN frames are added
751 as array to the TX_SETUP BCM configuration message.
752
753 /* create a struct to set up a sequence of four CAN frames */
754 struct {
755 struct bcm_msg_head msg_head;
756 struct can_frame frame[4];
757 } mytxmsg;
758
759 (..)
760 mytxmsg.nframes = 4;
761 (..)
762
763 write(s, &mytxmsg, sizeof(mytxmsg));
764
765 With every transmission the index in the array of CAN frames is increased
766 and set to zero at index overflow.
767
768 4.2.5 Broadcast Manager receive filter timers
769
770 The timer values ival1 or ival2 may be set to non-zero values at RX_SETUP.
771 When the SET_TIMER flag is set the timers are enabled:
772
773 ival1: Send RX_TIMEOUT when a received message is not received again within
774 the given time. When START_TIMER is set at RX_SETUP the timeout detection
775 is activated directly - even without a former CAN frame reception.
776
777 ival2: Throttle the received message rate down to the value of ival2. This
778 is useful to reduce messages for the application when the signal inside the
779 CAN frame is stateless as state changes within the ival2 periode may get
780 lost.
781
782 4.2.6 Broadcast Manager multiplex message receive filter
783
784 To filter for content changes in multiplex message sequences an array of more
785 than one CAN frames can be passed in a RX_SETUP configuration message. The
786 data bytes of the first CAN frame contain the mask of relevant bits that
787 have to match in the subsequent CAN frames with the received CAN frame.
788 If one of the subsequent CAN frames is matching the bits in that frame data
789 mark the relevant content to be compared with the previous received content.
790 Up to 257 CAN frames (multiplex filter bit mask CAN frame plus 256 CAN
791 filters) can be added as array to the TX_SETUP BCM configuration message.
792
793 /* usually used to clear CAN frame data[] - beware of endian problems! */
794 #define U64_DATA(p) (*(unsigned long long*)(p)->data)
795
796 struct {
797 struct bcm_msg_head msg_head;
798 struct can_frame frame[5];
799 } msg;
800
801 msg.msg_head.opcode = RX_SETUP;
802 msg.msg_head.can_id = 0x42;
803 msg.msg_head.flags = 0;
804 msg.msg_head.nframes = 5;
805 U64_DATA(&msg.frame[0]) = 0xFF00000000000000ULL; /* MUX mask */
806 U64_DATA(&msg.frame[1]) = 0x01000000000000FFULL; /* data mask (MUX 0x01) */
807 U64_DATA(&msg.frame[2]) = 0x0200FFFF000000FFULL; /* data mask (MUX 0x02) */
808 U64_DATA(&msg.frame[3]) = 0x330000FFFFFF0003ULL; /* data mask (MUX 0x33) */
809 U64_DATA(&msg.frame[4]) = 0x4F07FC0FF0000000ULL; /* data mask (MUX 0x4F) */
810
811 write(s, &msg, sizeof(msg));
812
596 4.3 connected transport protocols (SOCK_SEQPACKET) 813 4.3 connected transport protocols (SOCK_SEQPACKET)
597 4.4 unconnected transport protocols (SOCK_DGRAM) 814 4.4 unconnected transport protocols (SOCK_DGRAM)
598 815
diff --git a/Documentation/networking/dccp.txt b/Documentation/networking/dccp.txt
index d718bc2ff1cf..bf5dbe3ab8c5 100644
--- a/Documentation/networking/dccp.txt
+++ b/Documentation/networking/dccp.txt
@@ -18,8 +18,8 @@ Introduction
18Datagram Congestion Control Protocol (DCCP) is an unreliable, connection 18Datagram Congestion Control Protocol (DCCP) is an unreliable, connection
19oriented protocol designed to solve issues present in UDP and TCP, particularly 19oriented protocol designed to solve issues present in UDP and TCP, particularly
20for real-time and multimedia (streaming) traffic. 20for real-time and multimedia (streaming) traffic.
21It divides into a base protocol (RFC 4340) and plugable congestion control 21It divides into a base protocol (RFC 4340) and pluggable congestion control
22modules called CCIDs. Like plugable TCP congestion control, at least one CCID 22modules called CCIDs. Like pluggable TCP congestion control, at least one CCID
23needs to be enabled in order for the protocol to function properly. In the Linux 23needs to be enabled in order for the protocol to function properly. In the Linux
24implementation, this is the TCP-like CCID2 (RFC 4341). Additional CCIDs, such as 24implementation, this is the TCP-like CCID2 (RFC 4341). Additional CCIDs, such as
25the TCP-friendly CCID3 (RFC 4342), are optional. 25the TCP-friendly CCID3 (RFC 4342), are optional.
diff --git a/Documentation/networking/e100.txt b/Documentation/networking/e100.txt
index 13a32124bca0..f862cf3aff34 100644
--- a/Documentation/networking/e100.txt
+++ b/Documentation/networking/e100.txt
@@ -103,7 +103,7 @@ Additional Configurations
103 PRO/100 Family of Adapters is e100. 103 PRO/100 Family of Adapters is e100.
104 104
105 As an example, if you install the e100 driver for two PRO/100 adapters 105 As an example, if you install the e100 driver for two PRO/100 adapters
106 (eth0 and eth1), add the following to a configuraton file in /etc/modprobe.d/ 106 (eth0 and eth1), add the following to a configuration file in /etc/modprobe.d/
107 107
108 alias eth0 e100 108 alias eth0 e100
109 alias eth1 e100 109 alias eth1 e100
diff --git a/Documentation/networking/ieee802154.txt b/Documentation/networking/ieee802154.txt
index 09eb57329f11..22bbc7225f8e 100644
--- a/Documentation/networking/ieee802154.txt
+++ b/Documentation/networking/ieee802154.txt
@@ -4,7 +4,7 @@
4 4
5Introduction 5Introduction
6============ 6============
7The IEEE 802.15.4 working group focuses on standartization of bottom 7The IEEE 802.15.4 working group focuses on standardization of bottom
8two layers: Medium Access Control (MAC) and Physical (PHY). And there 8two layers: Medium Access Control (MAC) and Physical (PHY). And there
9are mainly two options available for upper layers: 9are mainly two options available for upper layers:
10 - ZigBee - proprietary protocol from ZigBee Alliance 10 - ZigBee - proprietary protocol from ZigBee Alliance
@@ -66,7 +66,7 @@ net_device, with .type = ARPHRD_IEEE802154. Data is exchanged with socket family
66code via plain sk_buffs. On skb reception skb->cb must contain additional 66code via plain sk_buffs. On skb reception skb->cb must contain additional
67info as described in the struct ieee802154_mac_cb. During packet transmission 67info as described in the struct ieee802154_mac_cb. During packet transmission
68the skb->cb is used to provide additional data to device's header_ops->create 68the skb->cb is used to provide additional data to device's header_ops->create
69function. Be aware, that this data can be overriden later (when socket code 69function. Be aware that this data can be overridden later (when socket code
70submits skb to qdisc), so if you need something from that cb later, you should 70submits skb to qdisc), so if you need something from that cb later, you should
71store info in the skb->data on your own. 71store info in the skb->data on your own.
72 72
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index a46d78583ae1..3c12d9a7ed00 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -267,17 +267,6 @@ tcp_max_orphans - INTEGER
267 more aggressively. Let me to remind again: each orphan eats 267 more aggressively. Let me to remind again: each orphan eats
268 up to ~64K of unswappable memory. 268 up to ~64K of unswappable memory.
269 269
270tcp_max_ssthresh - INTEGER
271 Limited Slow-Start for TCP with large congestion windows (cwnd) defined in
272 RFC3742. Limited slow-start is a mechanism to limit growth of the cwnd
273 on the region where cwnd is larger than tcp_max_ssthresh. TCP increases cwnd
274 by at most tcp_max_ssthresh segments, and by at least tcp_max_ssthresh/2
275 segments per RTT when the cwnd is above tcp_max_ssthresh.
276 If TCP connection increased cwnd to thousands (or tens of thousands) segments,
277 and thousands of packets were being dropped during slow-start, you can set
278 tcp_max_ssthresh to improve performance for new TCP connection.
279 Default: 0 (off)
280
281tcp_max_syn_backlog - INTEGER 270tcp_max_syn_backlog - INTEGER
282 Maximal number of remembered connection requests, which have not 271 Maximal number of remembered connection requests, which have not
283 received an acknowledgment from connecting client. 272 received an acknowledgment from connecting client.
@@ -451,7 +440,7 @@ tcp_fastopen - INTEGER
451 connect() to perform a TCP handshake automatically. 440 connect() to perform a TCP handshake automatically.
452 441
453 The values (bitmap) are 442 The values (bitmap) are
454 1: Enables sending data in the opening SYN on the client. 443 1: Enables sending data in the opening SYN on the client w/ MSG_FASTOPEN.
455 2: Enables TCP Fast Open on the server side, i.e., allowing data in 444 2: Enables TCP Fast Open on the server side, i.e., allowing data in
456 a SYN packet to be accepted and passed to the application before 445 a SYN packet to be accepted and passed to the application before
457 3-way hand shake finishes. 446 3-way hand shake finishes.
@@ -464,7 +453,7 @@ tcp_fastopen - INTEGER
464 different ways of setting max_qlen without the TCP_FASTOPEN socket 453 different ways of setting max_qlen without the TCP_FASTOPEN socket
465 option. 454 option.
466 455
467 Default: 0 456 Default: 1
468 457
469 Note that the client & server side Fast Open flags (1 and 2 458 Note that the client & server side Fast Open flags (1 and 2
470 respectively) must be also enabled before the rest of flags can take 459 respectively) must be also enabled before the rest of flags can take
@@ -588,9 +577,6 @@ tcp_limit_output_bytes - INTEGER
588 typical pfifo_fast qdiscs. 577 typical pfifo_fast qdiscs.
589 tcp_limit_output_bytes limits the number of bytes on qdisc 578 tcp_limit_output_bytes limits the number of bytes on qdisc
590 or device to reduce artificial RTT/cwnd and reduce bufferbloat. 579 or device to reduce artificial RTT/cwnd and reduce bufferbloat.
591 Note: For GSO/TSO enabled flows, we try to have at least two
592 packets in flight. Reducing tcp_limit_output_bytes might also
593 reduce the size of individual GSO packet (64KB being the max)
594 Default: 131072 580 Default: 131072
595 581
596tcp_challenge_ack_limit - INTEGER 582tcp_challenge_ack_limit - INTEGER
diff --git a/Documentation/networking/l2tp.txt b/Documentation/networking/l2tp.txt
index e63fc1f7bf87..c74434de2fa5 100644
--- a/Documentation/networking/l2tp.txt
+++ b/Documentation/networking/l2tp.txt
@@ -197,7 +197,7 @@ state information because the file format is subject to change. It is
197implemented to provide extra debug information to help diagnose 197implemented to provide extra debug information to help diagnose
198problems.) Users should use the netlink API. 198problems.) Users should use the netlink API.
199 199
200/proc/net/pppol2tp is also provided for backwards compaibility with 200/proc/net/pppol2tp is also provided for backwards compatibility with
201the original pppol2tp driver. It lists information about L2TPv2 201the original pppol2tp driver. It lists information about L2TPv2
202tunnels and sessions only. Its use is discouraged. 202tunnels and sessions only. Its use is discouraged.
203 203
diff --git a/Documentation/networking/netdev-FAQ.txt b/Documentation/networking/netdev-FAQ.txt
index d9112f01c44a..0fe1c6e0dbcd 100644
--- a/Documentation/networking/netdev-FAQ.txt
+++ b/Documentation/networking/netdev-FAQ.txt
@@ -4,23 +4,23 @@ Information you need to know about netdev
4 4
5Q: What is netdev? 5Q: What is netdev?
6 6
7A: It is a mailing list for all network related linux stuff. This includes 7A: It is a mailing list for all network-related Linux stuff. This includes
8 anything found under net/ (i.e. core code like IPv6) and drivers/net 8 anything found under net/ (i.e. core code like IPv6) and drivers/net
9 (i.e. hardware specific drivers) in the linux source tree. 9 (i.e. hardware specific drivers) in the Linux source tree.
10 10
11 Note that some subsystems (e.g. wireless drivers) which have a high volume 11 Note that some subsystems (e.g. wireless drivers) which have a high volume
12 of traffic have their own specific mailing lists. 12 of traffic have their own specific mailing lists.
13 13
14 The netdev list is managed (like many other linux mailing lists) through 14 The netdev list is managed (like many other Linux mailing lists) through
15 VGER ( http://vger.kernel.org/ ) and archives can be found below: 15 VGER ( http://vger.kernel.org/ ) and archives can be found below:
16 16
17 http://marc.info/?l=linux-netdev 17 http://marc.info/?l=linux-netdev
18 http://www.spinics.net/lists/netdev/ 18 http://www.spinics.net/lists/netdev/
19 19
20 Aside from subsystems like that mentioned above, all network related linux 20 Aside from subsystems like that mentioned above, all network-related Linux
21 development (i.e. RFC, review, comments, etc) takes place on netdev. 21 development (i.e. RFC, review, comments, etc.) takes place on netdev.
22 22
23Q: How do the changes posted to netdev make their way into linux? 23Q: How do the changes posted to netdev make their way into Linux?
24 24
25A: There are always two trees (git repositories) in play. Both are driven 25A: There are always two trees (git repositories) in play. Both are driven
26 by David Miller, the main network maintainer. There is the "net" tree, 26 by David Miller, the main network maintainer. There is the "net" tree,
@@ -35,7 +35,7 @@ A: There are always two trees (git repositories) in play. Both are driven
35Q: How often do changes from these trees make it to the mainline Linus tree? 35Q: How often do changes from these trees make it to the mainline Linus tree?
36 36
37A: To understand this, you need to know a bit of background information 37A: To understand this, you need to know a bit of background information
38 on the cadence of linux development. Each new release starts off with 38 on the cadence of Linux development. Each new release starts off with
39 a two week "merge window" where the main maintainers feed their new 39 a two week "merge window" where the main maintainers feed their new
40 stuff to Linus for merging into the mainline tree. After the two weeks, 40 stuff to Linus for merging into the mainline tree. After the two weeks,
41 the merge window is closed, and it is called/tagged "-rc1". No new 41 the merge window is closed, and it is called/tagged "-rc1". No new
@@ -46,7 +46,7 @@ A: To understand this, you need to know a bit of background information
46 things are in a state of churn), and a week after the last vX.Y-rcN 46 things are in a state of churn), and a week after the last vX.Y-rcN
47 was done, the official "vX.Y" is released. 47 was done, the official "vX.Y" is released.
48 48
49 Relating that to netdev: At the beginning of the 2 week merge window, 49 Relating that to netdev: At the beginning of the 2-week merge window,
50 the net-next tree will be closed - no new changes/features. The 50 the net-next tree will be closed - no new changes/features. The
51 accumulated new content of the past ~10 weeks will be passed onto 51 accumulated new content of the past ~10 weeks will be passed onto
52 mainline/Linus via a pull request for vX.Y -- at the same time, 52 mainline/Linus via a pull request for vX.Y -- at the same time,
@@ -59,16 +59,16 @@ A: To understand this, you need to know a bit of background information
59 IMPORTANT: Do not send new net-next content to netdev during the 59 IMPORTANT: Do not send new net-next content to netdev during the
60 period during which net-next tree is closed. 60 period during which net-next tree is closed.
61 61
62 Shortly after the two weeks have passed, (and vX.Y-rc1 is released) the 62 Shortly after the two weeks have passed (and vX.Y-rc1 is released), the
63 tree for net-next reopens to collect content for the next (vX.Y+1) release. 63 tree for net-next reopens to collect content for the next (vX.Y+1) release.
64 64
65 If you aren't subscribed to netdev and/or are simply unsure if net-next 65 If you aren't subscribed to netdev and/or are simply unsure if net-next
66 has re-opened yet, simply check the net-next git repository link above for 66 has re-opened yet, simply check the net-next git repository link above for
67 any new networking related commits. 67 any new networking-related commits.
68 68
69 The "net" tree continues to collect fixes for the vX.Y content, and 69 The "net" tree continues to collect fixes for the vX.Y content, and
70 is fed back to Linus at regular (~weekly) intervals. Meaning that the 70 is fed back to Linus at regular (~weekly) intervals. Meaning that the
71 focus for "net" is on stablilization and bugfixes. 71 focus for "net" is on stabilization and bugfixes.
72 72
73 Finally, the vX.Y gets released, and the whole cycle starts over. 73 Finally, the vX.Y gets released, and the whole cycle starts over.
74 74
@@ -217,7 +217,7 @@ A: Attention to detail. Re-read your own work as if you were the
217 to why it happens, and then if necessary, explain why the fix proposed 217 to why it happens, and then if necessary, explain why the fix proposed
218 is the best way to get things done. Don't mangle whitespace, and as 218 is the best way to get things done. Don't mangle whitespace, and as
219 is common, don't mis-indent function arguments that span multiple lines. 219 is common, don't mis-indent function arguments that span multiple lines.
220 If it is your 1st patch, mail it to yourself so you can test apply 220 If it is your first patch, mail it to yourself so you can test apply
221 it to an unpatched tree to confirm infrastructure didn't mangle it. 221 it to an unpatched tree to confirm infrastructure didn't mangle it.
222 222
223 Finally, go back and read Documentation/SubmittingPatches to be 223 Finally, go back and read Documentation/SubmittingPatches to be
diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt
index c7ecc7080494..0b1cf6b2a592 100644
--- a/Documentation/networking/netdevices.txt
+++ b/Documentation/networking/netdevices.txt
@@ -10,12 +10,12 @@ network devices.
10struct net_device allocation rules 10struct net_device allocation rules
11================================== 11==================================
12Network device structures need to persist even after module is unloaded and 12Network device structures need to persist even after module is unloaded and
13must be allocated with kmalloc. If device has registered successfully, 13must be allocated with alloc_netdev_mqs() and friends.
14it will be freed on last use by free_netdev. This is required to handle the 14If device has registered successfully, it will be freed on last use
15pathologic case cleanly (example: rmmod mydriver </sys/class/net/myeth/mtu ) 15by free_netdev(). This is required to handle the pathologic case cleanly
16(example: rmmod mydriver </sys/class/net/myeth/mtu )
16 17
17There are routines in net_init.c to handle the common cases of 18alloc_netdev_mqs()/alloc_netdev() reserve extra space for driver
18alloc_etherdev, alloc_netdev. These reserve extra space for driver
19private data which gets freed when the network device is freed. If 19private data which gets freed when the network device is freed. If
20separately allocated data is attached to the network device 20separately allocated data is attached to the network device
21(netdev_priv(dev)) then it is up to the module exit handler to free that. 21(netdev_priv(dev)) then it is up to the module exit handler to free that.
diff --git a/Documentation/networking/netlink_mmap.txt b/Documentation/networking/netlink_mmap.txt
index 533378839546..b26122973525 100644
--- a/Documentation/networking/netlink_mmap.txt
+++ b/Documentation/networking/netlink_mmap.txt
@@ -45,7 +45,7 @@ processing.
45 45
46Conversion of the reception path involves calling poll() on the file 46Conversion of the reception path involves calling poll() on the file
47descriptor, once the socket is readable the frames from the ring are 47descriptor, once the socket is readable the frames from the ring are
48processsed in order until no more messages are available, as indicated by 48processed in order until no more messages are available, as indicated by
49a status word in the frame header. 49a status word in the frame header.
50 50
51On kernel side, in order to make use of memory mapped I/O on receive, the 51On kernel side, in order to make use of memory mapped I/O on receive, the
@@ -56,7 +56,7 @@ Dumps of kernel databases automatically support memory mapped I/O.
56 56
57Conversion of the transmit path involves changing message construction to 57Conversion of the transmit path involves changing message construction to
58use memory from the TX ring instead of (usually) a buffer declared on the 58use memory from the TX ring instead of (usually) a buffer declared on the
59stack and setting up the frame header approriately. Optionally poll() can 59stack and setting up the frame header appropriately. Optionally poll() can
60be used to wait for free frames in the TX ring. 60be used to wait for free frames in the TX ring.
61 61
62Structured and definitions for using memory mapped I/O are contained in 62Structured and definitions for using memory mapped I/O are contained in
@@ -231,7 +231,7 @@ Ring setup:
231 if (setsockopt(fd, NETLINK_TX_RING, &req, sizeof(req)) < 0) 231 if (setsockopt(fd, NETLINK_TX_RING, &req, sizeof(req)) < 0)
232 exit(1) 232 exit(1)
233 233
234 /* Calculate size of each invididual ring */ 234 /* Calculate size of each individual ring */
235 ring_size = req.nm_block_nr * req.nm_block_size; 235 ring_size = req.nm_block_nr * req.nm_block_size;
236 236
237 /* Map RX/TX rings. The TX ring is located after the RX ring */ 237 /* Map RX/TX rings. The TX ring is located after the RX ring */
diff --git a/Documentation/networking/operstates.txt b/Documentation/networking/operstates.txt
index 97694572338b..355c6d8ef8ad 100644
--- a/Documentation/networking/operstates.txt
+++ b/Documentation/networking/operstates.txt
@@ -89,8 +89,8 @@ packets. The name 'carrier' and the inversion are historical, think of
89it as lower layer. 89it as lower layer.
90 90
91Note that for certain kind of soft-devices, which are not managing any 91Note that for certain kind of soft-devices, which are not managing any
92real hardware, there is possible to set this bit from userpsace. 92real hardware, it is possible to set this bit from userspace. One
93One should use TVL IFLA_CARRIER to do so. 93should use TVL IFLA_CARRIER to do so.
94 94
95netif_carrier_ok() can be used to query that bit. 95netif_carrier_ok() can be used to query that bit.
96 96
diff --git a/Documentation/networking/rxrpc.txt b/Documentation/networking/rxrpc.txt
index 60d05eb77c64..b89bc82eed46 100644
--- a/Documentation/networking/rxrpc.txt
+++ b/Documentation/networking/rxrpc.txt
@@ -144,7 +144,7 @@ An overview of the RxRPC protocol:
144 (*) Calls use ACK packets to handle reliability. Data packets are also 144 (*) Calls use ACK packets to handle reliability. Data packets are also
145 explicitly sequenced per call. 145 explicitly sequenced per call.
146 146
147 (*) There are two types of positive acknowledgement: hard-ACKs and soft-ACKs. 147 (*) There are two types of positive acknowledgment: hard-ACKs and soft-ACKs.
148 A hard-ACK indicates to the far side that all the data received to a point 148 A hard-ACK indicates to the far side that all the data received to a point
149 has been received and processed; a soft-ACK indicates that the data has 149 has been received and processed; a soft-ACK indicates that the data has
150 been received but may yet be discarded and re-requested. The sender may 150 been received but may yet be discarded and re-requested. The sender may
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt
index 457b8bbafb08..cdd916da838d 100644
--- a/Documentation/networking/stmmac.txt
+++ b/Documentation/networking/stmmac.txt
@@ -160,7 +160,7 @@ Where:
160 o pmt: core has the embedded power module (optional). 160 o pmt: core has the embedded power module (optional).
161 o force_sf_dma_mode: force DMA to use the Store and Forward mode 161 o force_sf_dma_mode: force DMA to use the Store and Forward mode
162 instead of the Threshold. 162 instead of the Threshold.
163 o force_thresh_dma_mode: force DMA to use the Shreshold mode other than 163 o force_thresh_dma_mode: force DMA to use the Threshold mode other than
164 the Store and Forward mode. 164 the Store and Forward mode.
165 o riwt_off: force to disable the RX watchdog feature and switch to NAPI mode. 165 o riwt_off: force to disable the RX watchdog feature and switch to NAPI mode.
166 o fix_mac_speed: this callback is used for modifying some syscfg registers 166 o fix_mac_speed: this callback is used for modifying some syscfg registers
@@ -175,7 +175,7 @@ Where:
175 registers. 175 registers.
176 o custom_cfg/custom_data: this is a custom configuration that can be passed 176 o custom_cfg/custom_data: this is a custom configuration that can be passed
177 while initializing the resources. 177 while initializing the resources.
178 o bsp_priv: another private poiter. 178 o bsp_priv: another private pointer.
179 179
180For MDIO bus The we have: 180For MDIO bus The we have:
181 181
@@ -271,7 +271,7 @@ reset procedure etc).
271 o dwmac1000_dma.c: dma functions for the GMAC chip; 271 o dwmac1000_dma.c: dma functions for the GMAC chip;
272 o dwmac1000.h: specific header file for the GMAC; 272 o dwmac1000.h: specific header file for the GMAC;
273 o dwmac100_core: MAC 100 core and dma code; 273 o dwmac100_core: MAC 100 core and dma code;
274 o dwmac100_dma.c: dma funtions for the MAC chip; 274 o dwmac100_dma.c: dma functions for the MAC chip;
275 o dwmac1000.h: specific header file for the MAC; 275 o dwmac1000.h: specific header file for the MAC;
276 o dwmac_lib.c: generic DMA functions shared among chips; 276 o dwmac_lib.c: generic DMA functions shared among chips;
277 o enh_desc.c: functions for handling enhanced descriptors; 277 o enh_desc.c: functions for handling enhanced descriptors;
@@ -364,4 +364,4 @@ Auto-negotiated Link Parter Ability.
36410) TODO: 36410) TODO:
365 o XGMAC is not supported. 365 o XGMAC is not supported.
366 o Complete the TBI & RTBI support. 366 o Complete the TBI & RTBI support.
367 o extened VLAN support for 3.70a SYNP GMAC. 367 o extend VLAN support for 3.70a SYNP GMAC.
diff --git a/Documentation/networking/vortex.txt b/Documentation/networking/vortex.txt
index 9a8041dcbb53..97282da82b75 100644
--- a/Documentation/networking/vortex.txt
+++ b/Documentation/networking/vortex.txt
@@ -68,7 +68,7 @@ Module parameters
68 68
69There are several parameters which may be provided to the driver when 69There are several parameters which may be provided to the driver when
70its module is loaded. These are usually placed in /etc/modprobe.d/*.conf 70its module is loaded. These are usually placed in /etc/modprobe.d/*.conf
71configuretion files. Example: 71configuration files. Example:
72 72
73options 3c59x debug=3 rx_copybreak=300 73options 3c59x debug=3 rx_copybreak=300
74 74
@@ -178,7 +178,7 @@ max_interrupt_work=N
178 178
179 The driver's interrupt service routine can handle many receive and 179 The driver's interrupt service routine can handle many receive and
180 transmit packets in a single invocation. It does this in a loop. 180 transmit packets in a single invocation. It does this in a loop.
181 The value of max_interrupt_work governs how mnay times the interrupt 181 The value of max_interrupt_work governs how many times the interrupt
182 service routine will loop. The default value is 32 loops. If this 182 service routine will loop. The default value is 32 loops. If this
183 is exceeded the interrupt service routine gives up and generates a 183 is exceeded the interrupt service routine gives up and generates a
184 warning message "eth0: Too much work in interrupt". 184 warning message "eth0: Too much work in interrupt".
diff --git a/Documentation/networking/x25-iface.txt b/Documentation/networking/x25-iface.txt
index 78f662ee0622..7f213b556e85 100644
--- a/Documentation/networking/x25-iface.txt
+++ b/Documentation/networking/x25-iface.txt
@@ -105,7 +105,7 @@ reduced by the following measures or a combination thereof:
105 later. 105 later.
106 The lapb module interface was modified to support this. Its 106 The lapb module interface was modified to support this. Its
107 data_indication() method should now transparently pass the 107 data_indication() method should now transparently pass the
108 netif_rx() return value to the (lapb mopdule) caller. 108 netif_rx() return value to the (lapb module) caller.
109(2) Drivers for kernel versions 2.2.x should always check the global 109(2) Drivers for kernel versions 2.2.x should always check the global
110 variable netdev_dropping when a new frame is received. The driver 110 variable netdev_dropping when a new frame is received. The driver
111 should only call netif_rx() if netdev_dropping is zero. Otherwise 111 should only call netif_rx() if netdev_dropping is zero. Otherwise
diff --git a/Documentation/phy.txt b/Documentation/phy.txt
new file mode 100644
index 000000000000..0103e4b15b0e
--- /dev/null
+++ b/Documentation/phy.txt
@@ -0,0 +1,166 @@
1 PHY SUBSYSTEM
2 Kishon Vijay Abraham I <kishon@ti.com>
3
4This document explains the Generic PHY Framework along with the APIs provided,
5and how-to-use.
6
71. Introduction
8
9*PHY* is the abbreviation for physical layer. It is used to connect a device
10to the physical medium e.g., the USB controller has a PHY to provide functions
11such as serialization, de-serialization, encoding, decoding and is responsible
12for obtaining the required data transmission rate. Note that some USB
13controllers have PHY functionality embedded into it and others use an external
14PHY. Other peripherals that use PHY include Wireless LAN, Ethernet,
15SATA etc.
16
17The intention of creating this framework is to bring the PHY drivers spread
18all over the Linux kernel to drivers/phy to increase code re-use and for
19better code maintainability.
20
21This framework will be of use only to devices that use external PHY (PHY
22functionality is not embedded within the controller).
23
242. Registering/Unregistering the PHY provider
25
26PHY provider refers to an entity that implements one or more PHY instances.
27For the simple case where the PHY provider implements only a single instance of
28the PHY, the framework provides its own implementation of of_xlate in
29of_phy_simple_xlate. If the PHY provider implements multiple instances, it
30should provide its own implementation of of_xlate. of_xlate is used only for
31dt boot case.
32
33#define of_phy_provider_register(dev, xlate) \
34 __of_phy_provider_register((dev), THIS_MODULE, (xlate))
35
36#define devm_of_phy_provider_register(dev, xlate) \
37 __devm_of_phy_provider_register((dev), THIS_MODULE, (xlate))
38
39of_phy_provider_register and devm_of_phy_provider_register macros can be used to
40register the phy_provider and it takes device and of_xlate as
41arguments. For the dt boot case, all PHY providers should use one of the above
422 macros to register the PHY provider.
43
44void devm_of_phy_provider_unregister(struct device *dev,
45 struct phy_provider *phy_provider);
46void of_phy_provider_unregister(struct phy_provider *phy_provider);
47
48devm_of_phy_provider_unregister and of_phy_provider_unregister can be used to
49unregister the PHY.
50
513. Creating the PHY
52
53The PHY driver should create the PHY in order for other peripheral controllers
54to make use of it. The PHY framework provides 2 APIs to create the PHY.
55
56struct phy *phy_create(struct device *dev, const struct phy_ops *ops,
57 struct phy_init_data *init_data);
58struct phy *devm_phy_create(struct device *dev, const struct phy_ops *ops,
59 struct phy_init_data *init_data);
60
61The PHY drivers can use one of the above 2 APIs to create the PHY by passing
62the device pointer, phy ops and init_data.
63phy_ops is a set of function pointers for performing PHY operations such as
64init, exit, power_on and power_off. *init_data* is mandatory to get a reference
65to the PHY in the case of non-dt boot. See section *Board File Initialization*
66on how init_data should be used.
67
68Inorder to dereference the private data (in phy_ops), the phy provider driver
69can use phy_set_drvdata() after creating the PHY and use phy_get_drvdata() in
70phy_ops to get back the private data.
71
724. Getting a reference to the PHY
73
74Before the controller can make use of the PHY, it has to get a reference to
75it. This framework provides the following APIs to get a reference to the PHY.
76
77struct phy *phy_get(struct device *dev, const char *string);
78struct phy *devm_phy_get(struct device *dev, const char *string);
79
80phy_get and devm_phy_get can be used to get the PHY. In the case of dt boot,
81the string arguments should contain the phy name as given in the dt data and
82in the case of non-dt boot, it should contain the label of the PHY.
83The only difference between the two APIs is that devm_phy_get associates the
84device with the PHY using devres on successful PHY get. On driver detach,
85release function is invoked on the the devres data and devres data is freed.
86
875. Releasing a reference to the PHY
88
89When the controller no longer needs the PHY, it has to release the reference
90to the PHY it has obtained using the APIs mentioned in the above section. The
91PHY framework provides 2 APIs to release a reference to the PHY.
92
93void phy_put(struct phy *phy);
94void devm_phy_put(struct device *dev, struct phy *phy);
95
96Both these APIs are used to release a reference to the PHY and devm_phy_put
97destroys the devres associated with this PHY.
98
996. Destroying the PHY
100
101When the driver that created the PHY is unloaded, it should destroy the PHY it
102created using one of the following 2 APIs.
103
104void phy_destroy(struct phy *phy);
105void devm_phy_destroy(struct device *dev, struct phy *phy);
106
107Both these APIs destroy the PHY and devm_phy_destroy destroys the devres
108associated with this PHY.
109
1107. PM Runtime
111
112This subsystem is pm runtime enabled. So while creating the PHY,
113pm_runtime_enable of the phy device created by this subsystem is called and
114while destroying the PHY, pm_runtime_disable is called. Note that the phy
115device created by this subsystem will be a child of the device that calls
116phy_create (PHY provider device).
117
118So pm_runtime_get_sync of the phy_device created by this subsystem will invoke
119pm_runtime_get_sync of PHY provider device because of parent-child relationship.
120It should also be noted that phy_power_on and phy_power_off performs
121phy_pm_runtime_get_sync and phy_pm_runtime_put respectively.
122There are exported APIs like phy_pm_runtime_get, phy_pm_runtime_get_sync,
123phy_pm_runtime_put, phy_pm_runtime_put_sync, phy_pm_runtime_allow and
124phy_pm_runtime_forbid for performing PM operations.
125
1268. Board File Initialization
127
128Certain board file initialization is necessary in order to get a reference
129to the PHY in the case of non-dt boot.
130Say we have a single device that implements 3 PHYs that of USB, SATA and PCIe,
131then in the board file the following initialization should be done.
132
133struct phy_consumer consumers[] = {
134 PHY_CONSUMER("dwc3.0", "usb"),
135 PHY_CONSUMER("pcie.0", "pcie"),
136 PHY_CONSUMER("sata.0", "sata"),
137};
138PHY_CONSUMER takes 2 parameters, first is the device name of the controller
139(PHY consumer) and second is the port name.
140
141struct phy_init_data init_data = {
142 .consumers = consumers,
143 .num_consumers = ARRAY_SIZE(consumers),
144};
145
146static const struct platform_device pipe3_phy_dev = {
147 .name = "pipe3-phy",
148 .id = -1,
149 .dev = {
150 .platform_data = {
151 .init_data = &init_data,
152 },
153 },
154};
155
156then, while doing phy_create, the PHY driver should pass this init_data
157 phy_create(dev, ops, pdata->init_data);
158
159and the controller driver (phy consumer) should pass the port name along with
160the device to get a reference to the PHY
161 phy_get(dev, "pcie");
162
1639. DeviceTree Binding
164
165The documentation for PHY dt binding can be found @
166Documentation/devicetree/bindings/phy/phy-bindings.txt
diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt
index c0ffd30eb55e..a7929cb47e7c 100644
--- a/Documentation/pinctrl.txt
+++ b/Documentation/pinctrl.txt
@@ -358,7 +358,12 @@ static struct pinctrl_gpio_range gpio_range = {
358 .gc = &chip; 358 .gc = &chip;
359}; 359};
360 360
361In this case the pin_base property will be ignored. 361In this case the pin_base property will be ignored. If the name of a pin
362group is known, the pins and npins elements of the above structure can be
363initialised using the function pinctrl_get_group_pins(), e.g. for pin
364group "foo":
365
366pinctrl_get_group_pins(pctl, "foo", &gpio_range.pins, &gpio_range.npins);
362 367
363When GPIO-specific functions in the pin control subsystem are called, these 368When GPIO-specific functions in the pin control subsystem are called, these
364ranges will be used to look up the appropriate pin controller by inspecting 369ranges will be used to look up the appropriate pin controller by inspecting
diff --git a/Documentation/power/opp.txt b/Documentation/power/opp.txt
index 425c51d56aef..b8a907dc0169 100644
--- a/Documentation/power/opp.txt
+++ b/Documentation/power/opp.txt
@@ -42,7 +42,7 @@ We can represent these as three OPPs as the following {Hz, uV} tuples:
42 42
43OPP library provides a set of helper functions to organize and query the OPP 43OPP library provides a set of helper functions to organize and query the OPP
44information. The library is located in drivers/base/power/opp.c and the header 44information. The library is located in drivers/base/power/opp.c and the header
45is located in include/linux/opp.h. OPP library can be enabled by enabling 45is located in include/linux/pm_opp.h. OPP library can be enabled by enabling
46CONFIG_PM_OPP from power management menuconfig menu. OPP library depends on 46CONFIG_PM_OPP from power management menuconfig menu. OPP library depends on
47CONFIG_PM as certain SoCs such as Texas Instrument's OMAP framework allows to 47CONFIG_PM as certain SoCs such as Texas Instrument's OMAP framework allows to
48optionally boot at a certain OPP without needing cpufreq. 48optionally boot at a certain OPP without needing cpufreq.
@@ -71,14 +71,14 @@ operations until that OPP could be re-enabled if possible.
71 71
72OPP library facilitates this concept in it's implementation. The following 72OPP library facilitates this concept in it's implementation. The following
73operational functions operate only on available opps: 73operational functions operate only on available opps:
74opp_find_freq_{ceil, floor}, opp_get_voltage, opp_get_freq, opp_get_opp_count 74opp_find_freq_{ceil, floor}, dev_pm_opp_get_voltage, dev_pm_opp_get_freq, dev_pm_opp_get_opp_count
75and opp_init_cpufreq_table 75and dev_pm_opp_init_cpufreq_table
76 76
77opp_find_freq_exact is meant to be used to find the opp pointer which can then 77dev_pm_opp_find_freq_exact is meant to be used to find the opp pointer which can then
78be used for opp_enable/disable functions to make an opp available as required. 78be used for dev_pm_opp_enable/disable functions to make an opp available as required.
79 79
80WARNING: Users of OPP library should refresh their availability count using 80WARNING: Users of OPP library should refresh their availability count using
81get_opp_count if opp_enable/disable functions are invoked for a device, the 81get_opp_count if dev_pm_opp_enable/disable functions are invoked for a device, the
82exact mechanism to trigger these or the notification mechanism to other 82exact mechanism to trigger these or the notification mechanism to other
83dependent subsystems such as cpufreq are left to the discretion of the SoC 83dependent subsystems such as cpufreq are left to the discretion of the SoC
84specific framework which uses the OPP library. Similar care needs to be taken 84specific framework which uses the OPP library. Similar care needs to be taken
@@ -96,24 +96,24 @@ using RCU read locks. The opp_find_freq_{exact,ceil,floor},
96opp_get_{voltage, freq, opp_count} fall into this category. 96opp_get_{voltage, freq, opp_count} fall into this category.
97 97
98opp_{add,enable,disable} are updaters which use mutex and implement it's own 98opp_{add,enable,disable} are updaters which use mutex and implement it's own
99RCU locking mechanisms. opp_init_cpufreq_table acts as an updater and uses 99RCU locking mechanisms. dev_pm_opp_init_cpufreq_table acts as an updater and uses
100mutex to implment RCU updater strategy. These functions should *NOT* be called 100mutex to implment RCU updater strategy. These functions should *NOT* be called
101under RCU locks and other contexts that prevent blocking functions in RCU or 101under RCU locks and other contexts that prevent blocking functions in RCU or
102mutex operations from working. 102mutex operations from working.
103 103
1042. Initial OPP List Registration 1042. Initial OPP List Registration
105================================ 105================================
106The SoC implementation calls opp_add function iteratively to add OPPs per 106The SoC implementation calls dev_pm_opp_add function iteratively to add OPPs per
107device. It is expected that the SoC framework will register the OPP entries 107device. It is expected that the SoC framework will register the OPP entries
108optimally- typical numbers range to be less than 5. The list generated by 108optimally- typical numbers range to be less than 5. The list generated by
109registering the OPPs is maintained by OPP library throughout the device 109registering the OPPs is maintained by OPP library throughout the device
110operation. The SoC framework can subsequently control the availability of the 110operation. The SoC framework can subsequently control the availability of the
111OPPs dynamically using the opp_enable / disable functions. 111OPPs dynamically using the dev_pm_opp_enable / disable functions.
112 112
113opp_add - Add a new OPP for a specific domain represented by the device pointer. 113dev_pm_opp_add - Add a new OPP for a specific domain represented by the device pointer.
114 The OPP is defined using the frequency and voltage. Once added, the OPP 114 The OPP is defined using the frequency and voltage. Once added, the OPP
115 is assumed to be available and control of it's availability can be done 115 is assumed to be available and control of it's availability can be done
116 with the opp_enable/disable functions. OPP library internally stores 116 with the dev_pm_opp_enable/disable functions. OPP library internally stores
117 and manages this information in the opp struct. This function may be 117 and manages this information in the opp struct. This function may be
118 used by SoC framework to define a optimal list as per the demands of 118 used by SoC framework to define a optimal list as per the demands of
119 SoC usage environment. 119 SoC usage environment.
@@ -124,7 +124,7 @@ opp_add - Add a new OPP for a specific domain represented by the device pointer.
124 soc_pm_init() 124 soc_pm_init()
125 { 125 {
126 /* Do things */ 126 /* Do things */
127 r = opp_add(mpu_dev, 1000000, 900000); 127 r = dev_pm_opp_add(mpu_dev, 1000000, 900000);
128 if (!r) { 128 if (!r) {
129 pr_err("%s: unable to register mpu opp(%d)\n", r); 129 pr_err("%s: unable to register mpu opp(%d)\n", r);
130 goto no_cpufreq; 130 goto no_cpufreq;
@@ -143,44 +143,44 @@ functions return the matching pointer representing the opp if a match is
143found, else returns error. These errors are expected to be handled by standard 143found, else returns error. These errors are expected to be handled by standard
144error checks such as IS_ERR() and appropriate actions taken by the caller. 144error checks such as IS_ERR() and appropriate actions taken by the caller.
145 145
146opp_find_freq_exact - Search for an OPP based on an *exact* frequency and 146dev_pm_opp_find_freq_exact - Search for an OPP based on an *exact* frequency and
147 availability. This function is especially useful to enable an OPP which 147 availability. This function is especially useful to enable an OPP which
148 is not available by default. 148 is not available by default.
149 Example: In a case when SoC framework detects a situation where a 149 Example: In a case when SoC framework detects a situation where a
150 higher frequency could be made available, it can use this function to 150 higher frequency could be made available, it can use this function to
151 find the OPP prior to call the opp_enable to actually make it available. 151 find the OPP prior to call the dev_pm_opp_enable to actually make it available.
152 rcu_read_lock(); 152 rcu_read_lock();
153 opp = opp_find_freq_exact(dev, 1000000000, false); 153 opp = dev_pm_opp_find_freq_exact(dev, 1000000000, false);
154 rcu_read_unlock(); 154 rcu_read_unlock();
155 /* dont operate on the pointer.. just do a sanity check.. */ 155 /* dont operate on the pointer.. just do a sanity check.. */
156 if (IS_ERR(opp)) { 156 if (IS_ERR(opp)) {
157 pr_err("frequency not disabled!\n"); 157 pr_err("frequency not disabled!\n");
158 /* trigger appropriate actions.. */ 158 /* trigger appropriate actions.. */
159 } else { 159 } else {
160 opp_enable(dev,1000000000); 160 dev_pm_opp_enable(dev,1000000000);
161 } 161 }
162 162
163 NOTE: This is the only search function that operates on OPPs which are 163 NOTE: This is the only search function that operates on OPPs which are
164 not available. 164 not available.
165 165
166opp_find_freq_floor - Search for an available OPP which is *at most* the 166dev_pm_opp_find_freq_floor - Search for an available OPP which is *at most* the
167 provided frequency. This function is useful while searching for a lesser 167 provided frequency. This function is useful while searching for a lesser
168 match OR operating on OPP information in the order of decreasing 168 match OR operating on OPP information in the order of decreasing
169 frequency. 169 frequency.
170 Example: To find the highest opp for a device: 170 Example: To find the highest opp for a device:
171 freq = ULONG_MAX; 171 freq = ULONG_MAX;
172 rcu_read_lock(); 172 rcu_read_lock();
173 opp_find_freq_floor(dev, &freq); 173 dev_pm_opp_find_freq_floor(dev, &freq);
174 rcu_read_unlock(); 174 rcu_read_unlock();
175 175
176opp_find_freq_ceil - Search for an available OPP which is *at least* the 176dev_pm_opp_find_freq_ceil - Search for an available OPP which is *at least* the
177 provided frequency. This function is useful while searching for a 177 provided frequency. This function is useful while searching for a
178 higher match OR operating on OPP information in the order of increasing 178 higher match OR operating on OPP information in the order of increasing
179 frequency. 179 frequency.
180 Example 1: To find the lowest opp for a device: 180 Example 1: To find the lowest opp for a device:
181 freq = 0; 181 freq = 0;
182 rcu_read_lock(); 182 rcu_read_lock();
183 opp_find_freq_ceil(dev, &freq); 183 dev_pm_opp_find_freq_ceil(dev, &freq);
184 rcu_read_unlock(); 184 rcu_read_unlock();
185 Example 2: A simplified implementation of a SoC cpufreq_driver->target: 185 Example 2: A simplified implementation of a SoC cpufreq_driver->target:
186 soc_cpufreq_target(..) 186 soc_cpufreq_target(..)
@@ -188,7 +188,7 @@ opp_find_freq_ceil - Search for an available OPP which is *at least* the
188 /* Do stuff like policy checks etc. */ 188 /* Do stuff like policy checks etc. */
189 /* Find the best frequency match for the req */ 189 /* Find the best frequency match for the req */
190 rcu_read_lock(); 190 rcu_read_lock();
191 opp = opp_find_freq_ceil(dev, &freq); 191 opp = dev_pm_opp_find_freq_ceil(dev, &freq);
192 rcu_read_unlock(); 192 rcu_read_unlock();
193 if (!IS_ERR(opp)) 193 if (!IS_ERR(opp))
194 soc_switch_to_freq_voltage(freq); 194 soc_switch_to_freq_voltage(freq);
@@ -208,34 +208,34 @@ as thermal considerations (e.g. don't use OPPx until the temperature drops).
208 208
209WARNING: Do not use these functions in interrupt context. 209WARNING: Do not use these functions in interrupt context.
210 210
211opp_enable - Make a OPP available for operation. 211dev_pm_opp_enable - Make a OPP available for operation.
212 Example: Lets say that 1GHz OPP is to be made available only if the 212 Example: Lets say that 1GHz OPP is to be made available only if the
213 SoC temperature is lower than a certain threshold. The SoC framework 213 SoC temperature is lower than a certain threshold. The SoC framework
214 implementation might choose to do something as follows: 214 implementation might choose to do something as follows:
215 if (cur_temp < temp_low_thresh) { 215 if (cur_temp < temp_low_thresh) {
216 /* Enable 1GHz if it was disabled */ 216 /* Enable 1GHz if it was disabled */
217 rcu_read_lock(); 217 rcu_read_lock();
218 opp = opp_find_freq_exact(dev, 1000000000, false); 218 opp = dev_pm_opp_find_freq_exact(dev, 1000000000, false);
219 rcu_read_unlock(); 219 rcu_read_unlock();
220 /* just error check */ 220 /* just error check */
221 if (!IS_ERR(opp)) 221 if (!IS_ERR(opp))
222 ret = opp_enable(dev, 1000000000); 222 ret = dev_pm_opp_enable(dev, 1000000000);
223 else 223 else
224 goto try_something_else; 224 goto try_something_else;
225 } 225 }
226 226
227opp_disable - Make an OPP to be not available for operation 227dev_pm_opp_disable - Make an OPP to be not available for operation
228 Example: Lets say that 1GHz OPP is to be disabled if the temperature 228 Example: Lets say that 1GHz OPP is to be disabled if the temperature
229 exceeds a threshold value. The SoC framework implementation might 229 exceeds a threshold value. The SoC framework implementation might
230 choose to do something as follows: 230 choose to do something as follows:
231 if (cur_temp > temp_high_thresh) { 231 if (cur_temp > temp_high_thresh) {
232 /* Disable 1GHz if it was enabled */ 232 /* Disable 1GHz if it was enabled */
233 rcu_read_lock(); 233 rcu_read_lock();
234 opp = opp_find_freq_exact(dev, 1000000000, true); 234 opp = dev_pm_opp_find_freq_exact(dev, 1000000000, true);
235 rcu_read_unlock(); 235 rcu_read_unlock();
236 /* just error check */ 236 /* just error check */
237 if (!IS_ERR(opp)) 237 if (!IS_ERR(opp))
238 ret = opp_disable(dev, 1000000000); 238 ret = dev_pm_opp_disable(dev, 1000000000);
239 else 239 else
240 goto try_something_else; 240 goto try_something_else;
241 } 241 }
@@ -247,7 +247,7 @@ information from the OPP structure is necessary. Once an OPP pointer is
247retrieved using the search functions, the following functions can be used by SoC 247retrieved using the search functions, the following functions can be used by SoC
248framework to retrieve the information represented inside the OPP layer. 248framework to retrieve the information represented inside the OPP layer.
249 249
250opp_get_voltage - Retrieve the voltage represented by the opp pointer. 250dev_pm_opp_get_voltage - Retrieve the voltage represented by the opp pointer.
251 Example: At a cpufreq transition to a different frequency, SoC 251 Example: At a cpufreq transition to a different frequency, SoC
252 framework requires to set the voltage represented by the OPP using 252 framework requires to set the voltage represented by the OPP using
253 the regulator framework to the Power Management chip providing the 253 the regulator framework to the Power Management chip providing the
@@ -256,15 +256,15 @@ opp_get_voltage - Retrieve the voltage represented by the opp pointer.
256 { 256 {
257 /* do things */ 257 /* do things */
258 rcu_read_lock(); 258 rcu_read_lock();
259 opp = opp_find_freq_ceil(dev, &freq); 259 opp = dev_pm_opp_find_freq_ceil(dev, &freq);
260 v = opp_get_voltage(opp); 260 v = dev_pm_opp_get_voltage(opp);
261 rcu_read_unlock(); 261 rcu_read_unlock();
262 if (v) 262 if (v)
263 regulator_set_voltage(.., v); 263 regulator_set_voltage(.., v);
264 /* do other things */ 264 /* do other things */
265 } 265 }
266 266
267opp_get_freq - Retrieve the freq represented by the opp pointer. 267dev_pm_opp_get_freq - Retrieve the freq represented by the opp pointer.
268 Example: Lets say the SoC framework uses a couple of helper functions 268 Example: Lets say the SoC framework uses a couple of helper functions
269 we could pass opp pointers instead of doing additional parameters to 269 we could pass opp pointers instead of doing additional parameters to
270 handle quiet a bit of data parameters. 270 handle quiet a bit of data parameters.
@@ -273,8 +273,8 @@ opp_get_freq - Retrieve the freq represented by the opp pointer.
273 /* do things.. */ 273 /* do things.. */
274 max_freq = ULONG_MAX; 274 max_freq = ULONG_MAX;
275 rcu_read_lock(); 275 rcu_read_lock();
276 max_opp = opp_find_freq_floor(dev,&max_freq); 276 max_opp = dev_pm_opp_find_freq_floor(dev,&max_freq);
277 requested_opp = opp_find_freq_ceil(dev,&freq); 277 requested_opp = dev_pm_opp_find_freq_ceil(dev,&freq);
278 if (!IS_ERR(max_opp) && !IS_ERR(requested_opp)) 278 if (!IS_ERR(max_opp) && !IS_ERR(requested_opp))
279 r = soc_test_validity(max_opp, requested_opp); 279 r = soc_test_validity(max_opp, requested_opp);
280 rcu_read_unlock(); 280 rcu_read_unlock();
@@ -282,25 +282,25 @@ opp_get_freq - Retrieve the freq represented by the opp pointer.
282 } 282 }
283 soc_test_validity(..) 283 soc_test_validity(..)
284 { 284 {
285 if(opp_get_voltage(max_opp) < opp_get_voltage(requested_opp)) 285 if(dev_pm_opp_get_voltage(max_opp) < dev_pm_opp_get_voltage(requested_opp))
286 return -EINVAL; 286 return -EINVAL;
287 if(opp_get_freq(max_opp) < opp_get_freq(requested_opp)) 287 if(dev_pm_opp_get_freq(max_opp) < dev_pm_opp_get_freq(requested_opp))
288 return -EINVAL; 288 return -EINVAL;
289 /* do things.. */ 289 /* do things.. */
290 } 290 }
291 291
292opp_get_opp_count - Retrieve the number of available opps for a device 292dev_pm_opp_get_opp_count - Retrieve the number of available opps for a device
293 Example: Lets say a co-processor in the SoC needs to know the available 293 Example: Lets say a co-processor in the SoC needs to know the available
294 frequencies in a table, the main processor can notify as following: 294 frequencies in a table, the main processor can notify as following:
295 soc_notify_coproc_available_frequencies() 295 soc_notify_coproc_available_frequencies()
296 { 296 {
297 /* Do things */ 297 /* Do things */
298 rcu_read_lock(); 298 rcu_read_lock();
299 num_available = opp_get_opp_count(dev); 299 num_available = dev_pm_opp_get_opp_count(dev);
300 speeds = kzalloc(sizeof(u32) * num_available, GFP_KERNEL); 300 speeds = kzalloc(sizeof(u32) * num_available, GFP_KERNEL);
301 /* populate the table in increasing order */ 301 /* populate the table in increasing order */
302 freq = 0; 302 freq = 0;
303 while (!IS_ERR(opp = opp_find_freq_ceil(dev, &freq))) { 303 while (!IS_ERR(opp = dev_pm_opp_find_freq_ceil(dev, &freq))) {
304 speeds[i] = freq; 304 speeds[i] = freq;
305 freq++; 305 freq++;
306 i++; 306 i++;
@@ -313,7 +313,7 @@ opp_get_opp_count - Retrieve the number of available opps for a device
313 313
3146. Cpufreq Table Generation 3146. Cpufreq Table Generation
315=========================== 315===========================
316opp_init_cpufreq_table - cpufreq framework typically is initialized with 316dev_pm_opp_init_cpufreq_table - cpufreq framework typically is initialized with
317 cpufreq_frequency_table_cpuinfo which is provided with the list of 317 cpufreq_frequency_table_cpuinfo which is provided with the list of
318 frequencies that are available for operation. This function provides 318 frequencies that are available for operation. This function provides
319 a ready to use conversion routine to translate the OPP layer's internal 319 a ready to use conversion routine to translate the OPP layer's internal
@@ -326,7 +326,7 @@ opp_init_cpufreq_table - cpufreq framework typically is initialized with
326 soc_pm_init() 326 soc_pm_init()
327 { 327 {
328 /* Do things */ 328 /* Do things */
329 r = opp_init_cpufreq_table(dev, &freq_table); 329 r = dev_pm_opp_init_cpufreq_table(dev, &freq_table);
330 if (!r) 330 if (!r)
331 cpufreq_frequency_table_cpuinfo(policy, freq_table); 331 cpufreq_frequency_table_cpuinfo(policy, freq_table);
332 /* Do other things */ 332 /* Do other things */
@@ -336,7 +336,7 @@ opp_init_cpufreq_table - cpufreq framework typically is initialized with
336 addition to CONFIG_PM as power management feature is required to 336 addition to CONFIG_PM as power management feature is required to
337 dynamically scale voltage and frequency in a system. 337 dynamically scale voltage and frequency in a system.
338 338
339opp_free_cpufreq_table - Free up the table allocated by opp_init_cpufreq_table 339dev_pm_opp_free_cpufreq_table - Free up the table allocated by dev_pm_opp_init_cpufreq_table
340 340
3417. Data Structures 3417. Data Structures
342================== 342==================
@@ -358,16 +358,16 @@ accessed by various functions as described above. However, the structures
358representing the actual OPPs and domains are internal to the OPP library itself 358representing the actual OPPs and domains are internal to the OPP library itself
359to allow for suitable abstraction reusable across systems. 359to allow for suitable abstraction reusable across systems.
360 360
361struct opp - The internal data structure of OPP library which is used to 361struct dev_pm_opp - The internal data structure of OPP library which is used to
362 represent an OPP. In addition to the freq, voltage, availability 362 represent an OPP. In addition to the freq, voltage, availability
363 information, it also contains internal book keeping information required 363 information, it also contains internal book keeping information required
364 for the OPP library to operate on. Pointer to this structure is 364 for the OPP library to operate on. Pointer to this structure is
365 provided back to the users such as SoC framework to be used as a 365 provided back to the users such as SoC framework to be used as a
366 identifier for OPP in the interactions with OPP layer. 366 identifier for OPP in the interactions with OPP layer.
367 367
368 WARNING: The struct opp pointer should not be parsed or modified by the 368 WARNING: The struct dev_pm_opp pointer should not be parsed or modified by the
369 users. The defaults of for an instance is populated by opp_add, but the 369 users. The defaults of for an instance is populated by dev_pm_opp_add, but the
370 availability of the OPP can be modified by opp_enable/disable functions. 370 availability of the OPP can be modified by dev_pm_opp_enable/disable functions.
371 371
372struct device - This is used to identify a domain to the OPP layer. The 372struct device - This is used to identify a domain to the OPP layer. The
373 nature of the device and it's implementation is left to the user of 373 nature of the device and it's implementation is left to the user of
@@ -377,19 +377,19 @@ Overall, in a simplistic view, the data structure operations is represented as
377following: 377following:
378 378
379Initialization / modification: 379Initialization / modification:
380 +-----+ /- opp_enable 380 +-----+ /- dev_pm_opp_enable
381opp_add --> | opp | <------- 381dev_pm_opp_add --> | opp | <-------
382 | +-----+ \- opp_disable 382 | +-----+ \- dev_pm_opp_disable
383 \-------> domain_info(device) 383 \-------> domain_info(device)
384 384
385Search functions: 385Search functions:
386 /-- opp_find_freq_ceil ---\ +-----+ 386 /-- dev_pm_opp_find_freq_ceil ---\ +-----+
387domain_info<---- opp_find_freq_exact -----> | opp | 387domain_info<---- dev_pm_opp_find_freq_exact -----> | opp |
388 \-- opp_find_freq_floor ---/ +-----+ 388 \-- dev_pm_opp_find_freq_floor ---/ +-----+
389 389
390Retrieval functions: 390Retrieval functions:
391+-----+ /- opp_get_voltage 391+-----+ /- dev_pm_opp_get_voltage
392| opp | <--- 392| opp | <---
393+-----+ \- opp_get_freq 393+-----+ \- dev_pm_opp_get_freq
394 394
395domain_info <- opp_get_opp_count 395domain_info <- dev_pm_opp_get_opp_count
diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt
index 3f10b39b0346..89a8816990ff 100644
--- a/Documentation/power/power_supply_class.txt
+++ b/Documentation/power/power_supply_class.txt
@@ -135,11 +135,11 @@ CAPACITY_LEVEL - capacity level. This corresponds to
135POWER_SUPPLY_CAPACITY_LEVEL_*. 135POWER_SUPPLY_CAPACITY_LEVEL_*.
136 136
137TEMP - temperature of the power supply. 137TEMP - temperature of the power supply.
138TEMP_ALERT_MIN - minimum battery temperature alert value in milli centigrade. 138TEMP_ALERT_MIN - minimum battery temperature alert.
139TEMP_ALERT_MAX - maximum battery temperature alert value in milli centigrade. 139TEMP_ALERT_MAX - maximum battery temperature alert.
140TEMP_AMBIENT - ambient temperature. 140TEMP_AMBIENT - ambient temperature.
141TEMP_AMBIENT_ALERT_MIN - minimum ambient temperature alert value in milli centigrade. 141TEMP_AMBIENT_ALERT_MIN - minimum ambient temperature alert.
142TEMP_AMBIENT_ALERT_MAX - maximum ambient temperature alert value in milli centigrade. 142TEMP_AMBIENT_ALERT_MAX - maximum ambient temperature alert.
143 143
144TIME_TO_EMPTY - seconds left for battery to be considered empty (i.e. 144TIME_TO_EMPTY - seconds left for battery to be considered empty (i.e.
145while battery powers a load) 145while battery powers a load)
diff --git a/Documentation/power/powercap/powercap.txt b/Documentation/power/powercap/powercap.txt
new file mode 100644
index 000000000000..1e6ef164e07a
--- /dev/null
+++ b/Documentation/power/powercap/powercap.txt
@@ -0,0 +1,236 @@
1Power Capping Framework
2==================================
3
4The power capping framework provides a consistent interface between the kernel
5and the user space that allows power capping drivers to expose the settings to
6user space in a uniform way.
7
8Terminology
9=========================
10The framework exposes power capping devices to user space via sysfs in the
11form of a tree of objects. The objects at the root level of the tree represent
12'control types', which correspond to different methods of power capping. For
13example, the intel-rapl control type represents the Intel "Running Average
14Power Limit" (RAPL) technology, whereas the 'idle-injection' control type
15corresponds to the use of idle injection for controlling power.
16
17Power zones represent different parts of the system, which can be controlled and
18monitored using the power capping method determined by the control type the
19given zone belongs to. They each contain attributes for monitoring power, as
20well as controls represented in the form of power constraints. If the parts of
21the system represented by different power zones are hierarchical (that is, one
22bigger part consists of multiple smaller parts that each have their own power
23controls), those power zones may also be organized in a hierarchy with one
24parent power zone containing multiple subzones and so on to reflect the power
25control topology of the system. In that case, it is possible to apply power
26capping to a set of devices together using the parent power zone and if more
27fine grained control is required, it can be applied through the subzones.
28
29
30Example sysfs interface tree:
31
32/sys/devices/virtual/powercap
33??? intel-rapl
34 ??? intel-rapl:0
35 ?   ??? constraint_0_name
36 ?   ??? constraint_0_power_limit_uw
37 ?   ??? constraint_0_time_window_us
38 ?   ??? constraint_1_name
39 ?   ??? constraint_1_power_limit_uw
40 ?   ??? constraint_1_time_window_us
41 ?   ??? device -> ../../intel-rapl
42 ?   ??? energy_uj
43 ?   ??? intel-rapl:0:0
44 ?   ?   ??? constraint_0_name
45 ?   ?   ??? constraint_0_power_limit_uw
46 ?   ?   ??? constraint_0_time_window_us
47 ?   ?   ??? constraint_1_name
48 ?   ?   ??? constraint_1_power_limit_uw
49 ?   ?   ??? constraint_1_time_window_us
50 ?   ?   ??? device -> ../../intel-rapl:0
51 ?   ?   ??? energy_uj
52 ?   ?   ??? max_energy_range_uj
53 ?   ?   ??? name
54 ?   ?   ??? enabled
55 ?   ?   ??? power
56 ?   ?   ?   ??? async
57 ?   ?   ?   []
58 ?   ?   ??? subsystem -> ../../../../../../class/power_cap
59 ?   ?   ??? uevent
60 ?   ??? intel-rapl:0:1
61 ?   ?   ??? constraint_0_name
62 ?   ?   ??? constraint_0_power_limit_uw
63 ?   ?   ??? constraint_0_time_window_us
64 ?   ?   ??? constraint_1_name
65 ?   ?   ??? constraint_1_power_limit_uw
66 ?   ?   ??? constraint_1_time_window_us
67 ?   ?   ??? device -> ../../intel-rapl:0
68 ?   ?   ??? energy_uj
69 ?   ?   ??? max_energy_range_uj
70 ?   ?   ??? name
71 ?   ?   ??? enabled
72 ?   ?   ??? power
73 ?   ?   ?   ??? async
74 ?   ?   ?   []
75 ?   ?   ??? subsystem -> ../../../../../../class/power_cap
76 ?   ?   ??? uevent
77 ?   ??? max_energy_range_uj
78 ?   ??? max_power_range_uw
79 ?   ??? name
80 ?   ??? enabled
81 ?   ??? power
82 ?   ?   ??? async
83 ?   ?   []
84 ?   ??? subsystem -> ../../../../../class/power_cap
85 ?   ??? enabled
86 ?   ??? uevent
87 ??? intel-rapl:1
88 ?   ??? constraint_0_name
89 ?   ??? constraint_0_power_limit_uw
90 ?   ??? constraint_0_time_window_us
91 ?   ??? constraint_1_name
92 ?   ??? constraint_1_power_limit_uw
93 ?   ??? constraint_1_time_window_us
94 ?   ??? device -> ../../intel-rapl
95 ?   ??? energy_uj
96 ?   ??? intel-rapl:1:0
97 ?   ?   ??? constraint_0_name
98 ?   ?   ??? constraint_0_power_limit_uw
99 ?   ?   ??? constraint_0_time_window_us
100 ?   ?   ??? constraint_1_name
101 ?   ?   ??? constraint_1_power_limit_uw
102 ?   ?   ??? constraint_1_time_window_us
103 ?   ?   ??? device -> ../../intel-rapl:1
104 ?   ?   ??? energy_uj
105 ?   ?   ??? max_energy_range_uj
106 ?   ?   ??? name
107 ?   ?   ??? enabled
108 ?   ?   ??? power
109 ?   ?   ?   ??? async
110 ?   ?   ?   []
111 ?   ?   ??? subsystem -> ../../../../../../class/power_cap
112 ?   ?   ??? uevent
113 ?   ??? intel-rapl:1:1
114 ?   ?   ??? constraint_0_name
115 ?   ?   ??? constraint_0_power_limit_uw
116 ?   ?   ??? constraint_0_time_window_us
117 ?   ?   ??? constraint_1_name
118 ?   ?   ??? constraint_1_power_limit_uw
119 ?   ?   ??? constraint_1_time_window_us
120 ?   ?   ??? device -> ../../intel-rapl:1
121 ?   ?   ??? energy_uj
122 ?   ?   ??? max_energy_range_uj
123 ?   ?   ??? name
124 ?   ?   ??? enabled
125 ?   ?   ??? power
126 ?   ?   ?   ??? async
127 ?   ?   ?   []
128 ?   ?   ??? subsystem -> ../../../../../../class/power_cap
129 ?   ?   ??? uevent
130 ?   ??? max_energy_range_uj
131 ?   ??? max_power_range_uw
132 ?   ??? name
133 ?   ??? enabled
134 ?   ??? power
135 ?   ?   ??? async
136 ?   ?   []
137 ?   ??? subsystem -> ../../../../../class/power_cap
138 ?   ??? uevent
139 ??? power
140 ?   ??? async
141 ?   []
142 ??? subsystem -> ../../../../class/power_cap
143 ??? enabled
144 ??? uevent
145
146The above example illustrates a case in which the Intel RAPL technology,
147available in Intel® IA-64 and IA-32 Processor Architectures, is used. There is one
148control type called intel-rapl which contains two power zones, intel-rapl:0 and
149intel-rapl:1, representing CPU packages. Each of these power zones contains
150two subzones, intel-rapl:j:0 and intel-rapl:j:1 (j = 0, 1), representing the
151"core" and the "uncore" parts of the given CPU package, respectively. All of
152the zones and subzones contain energy monitoring attributes (energy_uj,
153max_energy_range_uj) and constraint attributes (constraint_*) allowing controls
154to be applied (the constraints in the 'package' power zones apply to the whole
155CPU packages and the subzone constraints only apply to the respective parts of
156the given package individually). Since Intel RAPL doesn't provide instantaneous
157power value, there is no power_uw attribute.
158
159In addition to that, each power zone contains a name attribute, allowing the
160part of the system represented by that zone to be identified.
161For example:
162
163cat /sys/class/power_cap/intel-rapl/intel-rapl:0/name
164package-0
165
166The Intel RAPL technology allows two constraints, short term and long term,
167with two different time windows to be applied to each power zone. Thus for
168each zone there are 2 attributes representing the constraint names, 2 power
169limits and 2 attributes representing the sizes of the time windows. Such that,
170constraint_j_* attributes correspond to the jth constraint (j = 0,1).
171
172For example:
173 constraint_0_name
174 constraint_0_power_limit_uw
175 constraint_0_time_window_us
176 constraint_1_name
177 constraint_1_power_limit_uw
178 constraint_1_time_window_us
179
180Power Zone Attributes
181=================================
182Monitoring attributes
183----------------------
184
185energy_uj (rw): Current energy counter in micro joules. Write "0" to reset.
186If the counter can not be reset, then this attribute is read only.
187
188max_energy_range_uj (ro): Range of the above energy counter in micro-joules.
189
190power_uw (ro): Current power in micro watts.
191
192max_power_range_uw (ro): Range of the above power value in micro-watts.
193
194name (ro): Name of this power zone.
195
196It is possible that some domains have both power ranges and energy counter ranges;
197however, only one is mandatory.
198
199Constraints
200----------------
201constraint_X_power_limit_uw (rw): Power limit in micro watts, which should be
202applicable for the time window specified by "constraint_X_time_window_us".
203
204constraint_X_time_window_us (rw): Time window in micro seconds.
205
206constraint_X_name (ro): An optional name of the constraint
207
208constraint_X_max_power_uw(ro): Maximum allowed power in micro watts.
209
210constraint_X_min_power_uw(ro): Minimum allowed power in micro watts.
211
212constraint_X_max_time_window_us(ro): Maximum allowed time window in micro seconds.
213
214constraint_X_min_time_window_us(ro): Minimum allowed time window in micro seconds.
215
216Except power_limit_uw and time_window_us other fields are optional.
217
218Common zone and control type attributes
219----------------------------------------
220enabled (rw): Enable/Disable controls at zone level or for all zones using
221a control type.
222
223Power Cap Client Driver Interface
224==================================
225The API summary:
226
227Call powercap_register_control_type() to register control type object.
228Call powercap_register_zone() to register a power zone (under a given
229control type), either as a top-level power zone or as a subzone of another
230power zone registered earlier.
231The number of constraints in a power zone and the corresponding callbacks have
232to be defined prior to calling powercap_register_zone() to register that zone.
233
234To Free a power zone call powercap_unregister_zone().
235To free a control type object call powercap_unregister_control_type().
236Detailed API can be generated using kernel-doc on include/linux/powercap.h.
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index 71d8fe4e75d3..b6ce00b2be9a 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -145,11 +145,13 @@ The action performed by the idle callback is totally dependent on the subsystem
145if the device can be suspended (i.e. if all of the conditions necessary for 145if the device can be suspended (i.e. if all of the conditions necessary for
146suspending the device are satisfied) and to queue up a suspend request for the 146suspending the device are satisfied) and to queue up a suspend request for the
147device in that case. If there is no idle callback, or if the callback returns 147device in that case. If there is no idle callback, or if the callback returns
1480, then the PM core will attempt to carry out a runtime suspend of the device; 1480, then the PM core will attempt to carry out a runtime suspend of the device,
149in essence, it will call pm_runtime_suspend() directly. To prevent this (for 149also respecting devices configured for autosuspend. In essence this means a
150example, if the callback routine has started a delayed suspend), the routine 150call to pm_runtime_autosuspend() (do note that drivers needs to update the
151should return a non-zero value. Negative error return codes are ignored by the 151device last busy mark, pm_runtime_mark_last_busy(), to control the delay under
152PM core. 152this circumstance). To prevent this (for example, if the callback routine has
153started a delayed suspend), the routine must return a non-zero value. Negative
154error return codes are ignored by the PM core.
153 155
154The helper functions provided by the PM core, described in Section 4, guarantee 156The helper functions provided by the PM core, described in Section 4, guarantee
155that the following constraints are met with respect to runtime PM callbacks for 157that the following constraints are met with respect to runtime PM callbacks for
@@ -308,7 +310,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
308 - execute the subsystem-level idle callback for the device; returns an 310 - execute the subsystem-level idle callback for the device; returns an
309 error code on failure, where -EINPROGRESS means that ->runtime_idle() is 311 error code on failure, where -EINPROGRESS means that ->runtime_idle() is
310 already being executed; if there is no callback or the callback returns 0 312 already being executed; if there is no callback or the callback returns 0
311 then run pm_runtime_suspend(dev) and return its result 313 then run pm_runtime_autosuspend(dev) and return its result
312 314
313 int pm_runtime_suspend(struct device *dev); 315 int pm_runtime_suspend(struct device *dev);
314 - execute the subsystem-level suspend callback for the device; returns 0 on 316 - execute the subsystem-level suspend callback for the device; returns 0 on
@@ -545,13 +547,11 @@ helper functions described in Section 4. In that case, pm_runtime_resume()
545should be used. Of course, for this purpose the device's runtime PM has to be 547should be used. Of course, for this purpose the device's runtime PM has to be
546enabled earlier by calling pm_runtime_enable(). 548enabled earlier by calling pm_runtime_enable().
547 549
548If the device bus type's or driver's ->probe() callback runs 550It may be desirable to suspend the device once ->probe() has finished.
549pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts, 551Therefore the driver core uses the asyncronous pm_request_idle() to submit a
550they will fail returning -EAGAIN, because the device's usage counter is 552request to execute the subsystem-level idle callback for the device at that
551incremented by the driver core before executing ->probe(). Still, it may be 553time. A driver that makes use of the runtime autosuspend feature, may want to
552desirable to suspend the device as soon as ->probe() has finished, so the driver 554update the last busy mark before returning from ->probe().
553core uses pm_runtime_put_sync() to invoke the subsystem-level idle callback for
554the device at that time.
555 555
556Moreover, the driver core prevents runtime PM callbacks from racing with the bus 556Moreover, the driver core prevents runtime PM callbacks from racing with the bus
557notifier callback in __device_release_driver(), which is necessary, because the 557notifier callback in __device_release_driver(), which is necessary, because the
@@ -654,7 +654,7 @@ out the following operations:
654 __pm_runtime_disable() with 'false' as the second argument for every device 654 __pm_runtime_disable() with 'false' as the second argument for every device
655 right before executing the subsystem-level .suspend_late() callback for it. 655 right before executing the subsystem-level .suspend_late() callback for it.
656 656
657 * During system resume it calls pm_runtime_enable() and pm_runtime_put_sync() 657 * During system resume it calls pm_runtime_enable() and pm_runtime_put()
658 for every device right after executing the subsystem-level .resume_early() 658 for every device right after executing the subsystem-level .resume_early()
659 callback and right after executing the subsystem-level .resume() callback 659 callback and right after executing the subsystem-level .resume() callback
660 for it, respectively. 660 for it, respectively.
diff --git a/Documentation/pps/pps.txt b/Documentation/pps/pps.txt
index d35dcdd82ff6..c03b1be5eb15 100644
--- a/Documentation/pps/pps.txt
+++ b/Documentation/pps/pps.txt
@@ -66,6 +66,21 @@ In LinuxPPS the PPS sources are simply char devices usually mapped
66into files /dev/pps0, /dev/pps1, etc.. 66into files /dev/pps0, /dev/pps1, etc..
67 67
68 68
69PPS with USB to serial devices
70------------------------------
71
72It is possible to grab the PPS from an USB to serial device. However,
73you should take into account the latencies and jitter introduced by
74the USB stack. Users has reported clock instability around +-1ms when
75synchronized with PPS through USB. This isn't suited for time server
76synchronization.
77
78If your device doesn't report PPS, you can check that the feature is
79supported by its driver. Most of the time, you only need to add a call
80to usb_serial_handle_dcd_change after checking the DCD status (see
81ch341 and pl2303 examples).
82
83
69Coding example 84Coding example
70-------------- 85--------------
71 86
diff --git a/Documentation/ptp/testptp.c b/Documentation/ptp/testptp.c
index f59ded066108..a74d0a84d329 100644
--- a/Documentation/ptp/testptp.c
+++ b/Documentation/ptp/testptp.c
@@ -100,6 +100,11 @@ static long ppb_to_scaled_ppm(int ppb)
100 return (long) (ppb * 65.536); 100 return (long) (ppb * 65.536);
101} 101}
102 102
103static int64_t pctns(struct ptp_clock_time *t)
104{
105 return t->sec * 1000000000LL + t->nsec;
106}
107
103static void usage(char *progname) 108static void usage(char *progname)
104{ 109{
105 fprintf(stderr, 110 fprintf(stderr,
@@ -112,6 +117,8 @@ static void usage(char *progname)
112 " -f val adjust the ptp clock frequency by 'val' ppb\n" 117 " -f val adjust the ptp clock frequency by 'val' ppb\n"
113 " -g get the ptp clock time\n" 118 " -g get the ptp clock time\n"
114 " -h prints this message\n" 119 " -h prints this message\n"
120 " -k val measure the time offset between system and phc clock\n"
121 " for 'val' times (Maximum 25)\n"
115 " -p val enable output with a period of 'val' nanoseconds\n" 122 " -p val enable output with a period of 'val' nanoseconds\n"
116 " -P val enable or disable (val=1|0) the system clock PPS\n" 123 " -P val enable or disable (val=1|0) the system clock PPS\n"
117 " -s set the ptp clock time from the system time\n" 124 " -s set the ptp clock time from the system time\n"
@@ -133,8 +140,12 @@ int main(int argc, char *argv[])
133 struct itimerspec timeout; 140 struct itimerspec timeout;
134 struct sigevent sigevent; 141 struct sigevent sigevent;
135 142
143 struct ptp_clock_time *pct;
144 struct ptp_sys_offset *sysoff;
145
146
136 char *progname; 147 char *progname;
137 int c, cnt, fd; 148 int i, c, cnt, fd;
138 149
139 char *device = DEVICE; 150 char *device = DEVICE;
140 clockid_t clkid; 151 clockid_t clkid;
@@ -144,14 +155,19 @@ int main(int argc, char *argv[])
144 int extts = 0; 155 int extts = 0;
145 int gettime = 0; 156 int gettime = 0;
146 int oneshot = 0; 157 int oneshot = 0;
158 int pct_offset = 0;
159 int n_samples = 0;
147 int periodic = 0; 160 int periodic = 0;
148 int perout = -1; 161 int perout = -1;
149 int pps = -1; 162 int pps = -1;
150 int settime = 0; 163 int settime = 0;
151 164
165 int64_t t1, t2, tp;
166 int64_t interval, offset;
167
152 progname = strrchr(argv[0], '/'); 168 progname = strrchr(argv[0], '/');
153 progname = progname ? 1+progname : argv[0]; 169 progname = progname ? 1+progname : argv[0];
154 while (EOF != (c = getopt(argc, argv, "a:A:cd:e:f:ghp:P:sSt:v"))) { 170 while (EOF != (c = getopt(argc, argv, "a:A:cd:e:f:ghk:p:P:sSt:v"))) {
155 switch (c) { 171 switch (c) {
156 case 'a': 172 case 'a':
157 oneshot = atoi(optarg); 173 oneshot = atoi(optarg);
@@ -174,6 +190,10 @@ int main(int argc, char *argv[])
174 case 'g': 190 case 'g':
175 gettime = 1; 191 gettime = 1;
176 break; 192 break;
193 case 'k':
194 pct_offset = 1;
195 n_samples = atoi(optarg);
196 break;
177 case 'p': 197 case 'p':
178 perout = atoi(optarg); 198 perout = atoi(optarg);
179 break; 199 break;
@@ -376,6 +396,47 @@ int main(int argc, char *argv[])
376 } 396 }
377 } 397 }
378 398
399 if (pct_offset) {
400 if (n_samples <= 0 || n_samples > 25) {
401 puts("n_samples should be between 1 and 25");
402 usage(progname);
403 return -1;
404 }
405
406 sysoff = calloc(1, sizeof(*sysoff));
407 if (!sysoff) {
408 perror("calloc");
409 return -1;
410 }
411 sysoff->n_samples = n_samples;
412
413 if (ioctl(fd, PTP_SYS_OFFSET, sysoff))
414 perror("PTP_SYS_OFFSET");
415 else
416 puts("system and phc clock time offset request okay");
417
418 pct = &sysoff->ts[0];
419 for (i = 0; i < sysoff->n_samples; i++) {
420 t1 = pctns(pct+2*i);
421 tp = pctns(pct+2*i+1);
422 t2 = pctns(pct+2*i+2);
423 interval = t2 - t1;
424 offset = (t2 + t1) / 2 - tp;
425
426 printf("system time: %ld.%ld\n",
427 (pct+2*i)->sec, (pct+2*i)->nsec);
428 printf("phc time: %ld.%ld\n",
429 (pct+2*i+1)->sec, (pct+2*i+1)->nsec);
430 printf("system time: %ld.%ld\n",
431 (pct+2*i+2)->sec, (pct+2*i+2)->nsec);
432 printf("system/phc clock time offset is %ld ns\n"
433 "system clock time delay is %ld ns\n",
434 offset, interval);
435 }
436
437 free(sysoff);
438 }
439
379 close(fd); 440 close(fd);
380 return 0; 441 return 0;
381} 442}
diff --git a/Documentation/pwm.txt b/Documentation/pwm.txt
index 1039b68fe9c6..93cb97974986 100644
--- a/Documentation/pwm.txt
+++ b/Documentation/pwm.txt
@@ -39,7 +39,7 @@ New users should use the pwm_get() function and pass to it the consumer
39device or a consumer name. pwm_put() is used to free the PWM device. Managed 39device or a consumer name. pwm_put() is used to free the PWM device. Managed
40variants of these functions, devm_pwm_get() and devm_pwm_put(), also exist. 40variants of these functions, devm_pwm_get() and devm_pwm_put(), also exist.
41 41
42After being requested a PWM has to be configured using: 42After being requested, a PWM has to be configured using:
43 43
44int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns); 44int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns);
45 45
@@ -94,7 +94,7 @@ for new drivers to use the generic PWM framework.
94A new PWM controller/chip can be added using pwmchip_add() and removed 94A new PWM controller/chip can be added using pwmchip_add() and removed
95again with pwmchip_remove(). pwmchip_add() takes a filled in struct 95again with pwmchip_remove(). pwmchip_add() takes a filled in struct
96pwm_chip as argument which provides a description of the PWM chip, the 96pwm_chip as argument which provides a description of the PWM chip, the
97number of PWM devices provider by the chip and the chip-specific 97number of PWM devices provided by the chip and the chip-specific
98implementation of the supported PWM operations to the framework. 98implementation of the supported PWM operations to the framework.
99 99
100Locking 100Locking
diff --git a/Documentation/s390/s390dbf.txt b/Documentation/s390/s390dbf.txt
index fcaf0b4efba2..3da163383c93 100644
--- a/Documentation/s390/s390dbf.txt
+++ b/Documentation/s390/s390dbf.txt
@@ -158,6 +158,16 @@ Return Value: none
158Description: Sets new actual debug level if new_level is valid. 158Description: Sets new actual debug level if new_level is valid.
159 159
160--------------------------------------------------------------------------- 160---------------------------------------------------------------------------
161bool debug_level_enabled (debug_info_t * id, int level);
162
163Parameter: id: handle for debug log
164 level: debug level
165
166Return Value: True if level is less or equal to the current debug level.
167
168Description: Returns true if debug events for the specified level would be
169 logged. Otherwise returns false.
170---------------------------------------------------------------------------
161void debug_stop_all(void); 171void debug_stop_all(void);
162 172
163Parameter: none 173Parameter: none
diff --git a/Documentation/scheduler/sched-arch.txt b/Documentation/scheduler/sched-arch.txt
index b1b8587b86f0..9290de703450 100644
--- a/Documentation/scheduler/sched-arch.txt
+++ b/Documentation/scheduler/sched-arch.txt
@@ -65,11 +65,6 @@ Possible arch/ problems
65 65
66Possible arch problems I found (and either tried to fix or didn't): 66Possible arch problems I found (and either tried to fix or didn't):
67 67
68h8300 - Is such sleeping racy vs interrupts? (See #4a).
69 The H8/300 manual I found indicates yes, however disabling IRQs
70 over the sleep mean only NMIs can wake it up, so can't fix easily
71 without doing spin waiting.
72
73ia64 - is safe_halt call racy vs interrupts? (does it sleep?) (See #4a) 68ia64 - is safe_halt call racy vs interrupts? (does it sleep?) (See #4a)
74 69
75sh64 - Is sleeping racy vs interrupts? (See #4a) 70sh64 - Is sleeping racy vs interrupts? (See #4a)
diff --git a/Documentation/security/00-INDEX b/Documentation/security/00-INDEX
index 414235c1fcfc..45c82fd3e9d3 100644
--- a/Documentation/security/00-INDEX
+++ b/Documentation/security/00-INDEX
@@ -22,3 +22,5 @@ keys.txt
22 - description of the kernel key retention service. 22 - description of the kernel key retention service.
23tomoyo.txt 23tomoyo.txt
24 - documentation on the TOMOYO Linux Security Module. 24 - documentation on the TOMOYO Linux Security Module.
25IMA-templates.txt
26 - documentation on the template management mechanism for IMA.
diff --git a/Documentation/security/IMA-templates.txt b/Documentation/security/IMA-templates.txt
new file mode 100644
index 000000000000..a777e5f1df5b
--- /dev/null
+++ b/Documentation/security/IMA-templates.txt
@@ -0,0 +1,87 @@
1 IMA Template Management Mechanism
2
3
4==== INTRODUCTION ====
5
6The original 'ima' template is fixed length, containing the filedata hash
7and pathname. The filedata hash is limited to 20 bytes (md5/sha1).
8The pathname is a null terminated string, limited to 255 characters.
9To overcome these limitations and to add additional file metadata, it is
10necessary to extend the current version of IMA by defining additional
11templates. For example, information that could be possibly reported are
12the inode UID/GID or the LSM labels either of the inode and of the process
13that is accessing it.
14
15However, the main problem to introduce this feature is that, each time
16a new template is defined, the functions that generate and display
17the measurements list would include the code for handling a new format
18and, thus, would significantly grow over the time.
19
20The proposed solution solves this problem by separating the template
21management from the remaining IMA code. The core of this solution is the
22definition of two new data structures: a template descriptor, to determine
23which information should be included in the measurement list; a template
24field, to generate and display data of a given type.
25
26Managing templates with these structures is very simple. To support
27a new data type, developers define the field identifier and implement
28two functions, init() and show(), respectively to generate and display
29measurement entries. Defining a new template descriptor requires
30specifying the template format, a string of field identifiers separated
31by the '|' character. While in the current implementation it is possible
32to define new template descriptors only by adding their definition in the
33template specific code (ima_template.c), in a future version it will be
34possible to register a new template on a running kernel by supplying to IMA
35the desired format string. In this version, IMA initializes at boot time
36all defined template descriptors by translating the format into an array
37of template fields structures taken from the set of the supported ones.
38
39After the initialization step, IMA will call ima_alloc_init_template()
40(new function defined within the patches for the new template management
41mechanism) to generate a new measurement entry by using the template
42descriptor chosen through the kernel configuration or through the newly
43introduced 'ima_template=' kernel command line parameter. It is during this
44phase that the advantages of the new architecture are clearly shown:
45the latter function will not contain specific code to handle a given template
46but, instead, it simply calls the init() method of the template fields
47associated to the chosen template descriptor and store the result (pointer
48to allocated data and data length) in the measurement entry structure.
49
50The same mechanism is employed to display measurements entries.
51The functions ima[_ascii]_measurements_show() retrieve, for each entry,
52the template descriptor used to produce that entry and call the show()
53method for each item of the array of template fields structures.
54
55
56
57==== SUPPORTED TEMPLATE FIELDS AND DESCRIPTORS ====
58
59In the following, there is the list of supported template fields
60('<identifier>': description), that can be used to define new template
61descriptors by adding their identifier to the format string
62(support for more data types will be added later):
63
64 - 'd': the digest of the event (i.e. the digest of a measured file),
65 calculated with the SHA1 or MD5 hash algorithm;
66 - 'n': the name of the event (i.e. the file name), with size up to 255 bytes;
67 - 'd-ng': the digest of the event, calculated with an arbitrary hash
68 algorithm (field format: [<hash algo>:]digest, where the digest
69 prefix is shown only if the hash algorithm is not SHA1 or MD5);
70 - 'n-ng': the name of the event, without size limitations.
71
72
73Below, there is the list of defined template descriptors:
74 - "ima": its format is 'd|n';
75 - "ima-ng" (default): its format is 'd-ng|n-ng'.
76
77
78
79==== USE ====
80
81To specify the template descriptor to be used to generate measurement entries,
82currently the following methods are supported:
83
84 - select a template descriptor among those supported in the kernel
85 configuration ('ima-ng' is the default choice);
86 - specify a template descriptor name from the kernel command line through
87 the 'ima_template=' parameter.
diff --git a/Documentation/security/keys.txt b/Documentation/security/keys.txt
index 7b4145d00452..a4c33f1a7c6d 100644
--- a/Documentation/security/keys.txt
+++ b/Documentation/security/keys.txt
@@ -865,15 +865,14 @@ encountered:
865 calling processes has a searchable link to the key from one of its 865 calling processes has a searchable link to the key from one of its
866 keyrings. There are three functions for dealing with these: 866 keyrings. There are three functions for dealing with these:
867 867
868 key_ref_t make_key_ref(const struct key *key, 868 key_ref_t make_key_ref(const struct key *key, bool possession);
869 unsigned long possession);
870 869
871 struct key *key_ref_to_ptr(const key_ref_t key_ref); 870 struct key *key_ref_to_ptr(const key_ref_t key_ref);
872 871
873 unsigned long is_key_possessed(const key_ref_t key_ref); 872 bool is_key_possessed(const key_ref_t key_ref);
874 873
875 The first function constructs a key reference from a key pointer and 874 The first function constructs a key reference from a key pointer and
876 possession information (which must be 0 or 1 and not any other value). 875 possession information (which must be true or false).
877 876
878 The second function retrieves the key pointer from a reference and the 877 The second function retrieves the key pointer from a reference and the
879 third retrieves the possession flag. 878 third retrieves the possession flag.
@@ -961,14 +960,17 @@ payload contents" for more information.
961 the argument will not be parsed. 960 the argument will not be parsed.
962 961
963 962
964(*) Extra references can be made to a key by calling the following function: 963(*) Extra references can be made to a key by calling one of the following
964 functions:
965 965
966 struct key *__key_get(struct key *key);
966 struct key *key_get(struct key *key); 967 struct key *key_get(struct key *key);
967 968
968 These need to be disposed of by calling key_put() when they've been 969 Keys so references will need to be disposed of by calling key_put() when
969 finished with. The key pointer passed in will be returned. If the pointer 970 they've been finished with. The key pointer passed in will be returned.
970 is NULL or CONFIG_KEYS is not set then the key will not be dereferenced and 971
971 no increment will take place. 972 In the case of key_get(), if the pointer is NULL or CONFIG_KEYS is not set
973 then the key will not be dereferenced and no increment will take place.
972 974
973 975
974(*) A key's serial number can be obtained by calling: 976(*) A key's serial number can be obtained by calling:
diff --git a/Documentation/serial/driver b/Documentation/serial/driver
index 067c47d46917..c3a7689a90e6 100644
--- a/Documentation/serial/driver
+++ b/Documentation/serial/driver
@@ -264,10 +264,6 @@ hardware.
264 Locking: none. 264 Locking: none.
265 Interrupts: caller dependent. 265 Interrupts: caller dependent.
266 266
267 set_wake(port,state)
268 Enable/disable power management wakeup on serial activity. Not
269 currently implemented.
270
271 type(port) 267 type(port)
272 Return a pointer to a string constant describing the specified 268 Return a pointer to a string constant describing the specified
273 port, or return NULL, in which case the string 'unknown' is 269 port, or return NULL, in which case the string 'unknown' is
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 95731a08f257..b8dd0df76952 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -616,7 +616,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
616 616
617 As default, snd-dummy drivers doesn't allocate the real buffers 617 As default, snd-dummy drivers doesn't allocate the real buffers
618 but either ignores read/write or mmap a single dummy page to all 618 but either ignores read/write or mmap a single dummy page to all
619 buffer pages, in order to save the resouces. If your apps need 619 buffer pages, in order to save the resources. If your apps need
620 the read/ written buffer data to be consistent, pass fake_buffer=0 620 the read/ written buffer data to be consistent, pass fake_buffer=0
621 option. 621 option.
622 622
diff --git a/Documentation/sound/alsa/Audiophile-Usb.txt b/Documentation/sound/alsa/Audiophile-Usb.txt
index 654dd3b694a8..e7a5ed4dcae8 100644
--- a/Documentation/sound/alsa/Audiophile-Usb.txt
+++ b/Documentation/sound/alsa/Audiophile-Usb.txt
@@ -232,7 +232,7 @@ The parameter can be given:
232 # modprobe snd-usb-audio index=1 device_setup=0x09 232 # modprobe snd-usb-audio index=1 device_setup=0x09
233 233
234 * Or while configuring the modules options in your modules configuration file 234 * Or while configuring the modules options in your modules configuration file
235 (tipically a .conf file in /etc/modprobe.d/ directory: 235 (typically a .conf file in /etc/modprobe.d/ directory:
236 alias snd-card-1 snd-usb-audio 236 alias snd-card-1 snd-usb-audio
237 options snd-usb-audio index=1 device_setup=0x09 237 options snd-usb-audio index=1 device_setup=0x09
238 238
diff --git a/Documentation/sound/alsa/CMIPCI.txt b/Documentation/sound/alsa/CMIPCI.txt
index 16935c8561f7..4e36e6e809ca 100644
--- a/Documentation/sound/alsa/CMIPCI.txt
+++ b/Documentation/sound/alsa/CMIPCI.txt
@@ -87,7 +87,7 @@ with 4 channels,
87 87
88and use the interleaved 4 channel data. 88and use the interleaved 4 channel data.
89 89
90There are some control switchs affecting to the speaker connections: 90There are some control switches affecting to the speaker connections:
91 91
92"Line-In Mode" - an enum control to change the behavior of line-in 92"Line-In Mode" - an enum control to change the behavior of line-in
93 jack. Either "Line-In", "Rear Output" or "Bass Output" can 93 jack. Either "Line-In", "Rear Output" or "Bass Output" can
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt
index f911e3656209..85c362d8ea34 100644
--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -28,6 +28,7 @@ ALC269/270/275/276/28x/29x
28 alc269-dmic Enable ALC269(VA) digital mic workaround 28 alc269-dmic Enable ALC269(VA) digital mic workaround
29 alc271-dmic Enable ALC271X digital mic workaround 29 alc271-dmic Enable ALC271X digital mic workaround
30 inv-dmic Inverted internal mic workaround 30 inv-dmic Inverted internal mic workaround
31 headset-mic Indicates a combined headset (headphone+mic) jack
31 lenovo-dock Enables docking station I/O for some Lenovos 32 lenovo-dock Enables docking station I/O for some Lenovos
32 dell-headset-multi Headset jack, which can also be used as mic-in 33 dell-headset-multi Headset jack, which can also be used as mic-in
33 dell-headset-dock Headset jack (without mic-in), and also dock I/O 34 dell-headset-dock Headset jack (without mic-in), and also dock I/O
diff --git a/Documentation/sound/alsa/compress_offload.txt b/Documentation/sound/alsa/compress_offload.txt
index fd74ff26376e..630c492c3dc2 100644
--- a/Documentation/sound/alsa/compress_offload.txt
+++ b/Documentation/sound/alsa/compress_offload.txt
@@ -217,12 +217,12 @@ Not supported:
217 would be enabled with ALSA kcontrols. 217 would be enabled with ALSA kcontrols.
218 218
219- Audio policy/resource management. This API does not provide any 219- Audio policy/resource management. This API does not provide any
220 hooks to query the utilization of the audio DSP, nor any premption 220 hooks to query the utilization of the audio DSP, nor any preemption
221 mechanisms. 221 mechanisms.
222 222
223- No notion of underun/overrun. Since the bytes written are compressed 223- No notion of underrun/overrun. Since the bytes written are compressed
224 in nature and data written/read doesn't translate directly to 224 in nature and data written/read doesn't translate directly to
225 rendered output in time, this does not deal with underrun/overun and 225 rendered output in time, this does not deal with underrun/overrun and
226 maybe dealt in user-library 226 maybe dealt in user-library
227 227
228Credits: 228Credits:
diff --git a/Documentation/sound/alsa/soc/DPCM.txt b/Documentation/sound/alsa/soc/DPCM.txt
new file mode 100644
index 000000000000..0110180b7ac6
--- /dev/null
+++ b/Documentation/sound/alsa/soc/DPCM.txt
@@ -0,0 +1,380 @@
1Dynamic PCM
2===========
3
41. Description
5==============
6
7Dynamic PCM allows an ALSA PCM device to digitally route its PCM audio to
8various digital endpoints during the PCM stream runtime. e.g. PCM0 can route
9digital audio to I2S DAI0, I2S DAI1 or PDM DAI2. This is useful for on SoC DSP
10drivers that expose several ALSA PCMs and can route to multiple DAIs.
11
12The DPCM runtime routing is determined by the ALSA mixer settings in the same
13way as the analog signal is routed in an ASoC codec driver. DPCM uses a DAPM
14graph representing the DSP internal audio paths and uses the mixer settings to
15determine the patch used by each ALSA PCM.
16
17DPCM re-uses all the existing component codec, platform and DAI drivers without
18any modifications.
19
20
21Phone Audio System with SoC based DSP
22-------------------------------------
23
24Consider the following phone audio subsystem. This will be used in this
25document for all examples :-
26
27| Front End PCMs | SoC DSP | Back End DAIs | Audio devices |
28
29 *************
30PCM0 <------------> * * <----DAI0-----> Codec Headset
31 * *
32PCM1 <------------> * * <----DAI1-----> Codec Speakers
33 * DSP *
34PCM2 <------------> * * <----DAI2-----> MODEM
35 * *
36PCM3 <------------> * * <----DAI3-----> BT
37 * *
38 * * <----DAI4-----> DMIC
39 * *
40 * * <----DAI5-----> FM
41 *************
42
43This diagram shows a simple smart phone audio subsystem. It supports Bluetooth,
44FM digital radio, Speakers, Headset Jack, digital microphones and cellular
45modem. This sound card exposes 4 DSP front end (FE) ALSA PCM devices and
46supports 6 back end (BE) DAIs. Each FE PCM can digitally route audio data to any
47of the BE DAIs. The FE PCM devices can also route audio to more than 1 BE DAI.
48
49
50
51Example - DPCM Switching playback from DAI0 to DAI1
52---------------------------------------------------
53
54Audio is being played to the Headset. After a while the user removes the headset
55and audio continues playing on the speakers.
56
57Playback on PCM0 to Headset would look like :-
58
59 *************
60PCM0 <============> * * <====DAI0=====> Codec Headset
61 * *
62PCM1 <------------> * * <----DAI1-----> Codec Speakers
63 * DSP *
64PCM2 <------------> * * <----DAI2-----> MODEM
65 * *
66PCM3 <------------> * * <----DAI3-----> BT
67 * *
68 * * <----DAI4-----> DMIC
69 * *
70 * * <----DAI5-----> FM
71 *************
72
73The headset is removed from the jack by user so the speakers must now be used :-
74
75 *************
76PCM0 <============> * * <----DAI0-----> Codec Headset
77 * *
78PCM1 <------------> * * <====DAI1=====> Codec Speakers
79 * DSP *
80PCM2 <------------> * * <----DAI2-----> MODEM
81 * *
82PCM3 <------------> * * <----DAI3-----> BT
83 * *
84 * * <----DAI4-----> DMIC
85 * *
86 * * <----DAI5-----> FM
87 *************
88
89The audio driver processes this as follows :-
90
91 1) Machine driver receives Jack removal event.
92
93 2) Machine driver OR audio HAL disables the Headset path.
94
95 3) DPCM runs the PCM trigger(stop), hw_free(), shutdown() operations on DAI0
96 for headset since the path is now disabled.
97
98 4) Machine driver or audio HAL enables the speaker path.
99
100 5) DPCM runs the PCM ops for startup(), hw_params(), prepapre() and
101 trigger(start) for DAI1 Speakers since the path is enabled.
102
103In this example, the machine driver or userspace audio HAL can alter the routing
104and then DPCM will take care of managing the DAI PCM operations to either bring
105the link up or down. Audio playback does not stop during this transition.
106
107
108
109DPCM machine driver
110===================
111
112The DPCM enabled ASoC machine driver is similar to normal machine drivers
113except that we also have to :-
114
115 1) Define the FE and BE DAI links.
116
117 2) Define any FE/BE PCM operations.
118
119 3) Define widget graph connections.
120
121
1221 FE and BE DAI links
123---------------------
124
125| Front End PCMs | SoC DSP | Back End DAIs | Audio devices |
126
127 *************
128PCM0 <------------> * * <----DAI0-----> Codec Headset
129 * *
130PCM1 <------------> * * <----DAI1-----> Codec Speakers
131 * DSP *
132PCM2 <------------> * * <----DAI2-----> MODEM
133 * *
134PCM3 <------------> * * <----DAI3-----> BT
135 * *
136 * * <----DAI4-----> DMIC
137 * *
138 * * <----DAI5-----> FM
139 *************
140
141For the example above we have to define 4 FE DAI links and 6 BE DAI links. The
142FE DAI links are defined as follows :-
143
144static struct snd_soc_dai_link machine_dais[] = {
145 {
146 .name = "PCM0 System",
147 .stream_name = "System Playback",
148 .cpu_dai_name = "System Pin",
149 .platform_name = "dsp-audio",
150 .codec_name = "snd-soc-dummy",
151 .codec_dai_name = "snd-soc-dummy-dai",
152 .dynamic = 1,
153 .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
154 .dpcm_playback = 1,
155 },
156 .....< other FE and BE DAI links here >
157};
158
159This FE DAI link is pretty similar to a regular DAI link except that we also
160set the DAI link to a DPCM FE with the "dynamic = 1". The supported FE stream
161directions should also be set with the "dpcm_playback" and "dpcm_capture"
162flags. There is also an option to specify the ordering of the trigger call for
163each FE. This allows the ASoC core to trigger the DSP before or after the other
164components (as some DSPs have strong requirements for the ordering DAI/DSP
165start and stop sequences).
166
167The FE DAI above sets the codec and code DAIs to dummy devices since the BE is
168dynamic and will change depending on runtime config.
169
170The BE DAIs are configured as follows :-
171
172static struct snd_soc_dai_link machine_dais[] = {
173 .....< FE DAI links here >
174 {
175 .name = "Codec Headset",
176 .cpu_dai_name = "ssp-dai.0",
177 .platform_name = "snd-soc-dummy",
178 .no_pcm = 1,
179 .codec_name = "rt5640.0-001c",
180 .codec_dai_name = "rt5640-aif1",
181 .ignore_suspend = 1,
182 .ignore_pmdown_time = 1,
183 .be_hw_params_fixup = hswult_ssp0_fixup,
184 .ops = &haswell_ops,
185 .dpcm_playback = 1,
186 .dpcm_capture = 1,
187 },
188 .....< other BE DAI links here >
189};
190
191This BE DAI link connects DAI0 to the codec (in this case RT5460 AIF1). It sets
192the "no_pcm" flag to mark it has a BE and sets flags for supported stream
193directions using "dpcm_playback" and "dpcm_capture" above.
194
195The BE has also flags set for ignoring suspend and PM down time. This allows
196the BE to work in a hostless mode where the host CPU is not transferring data
197like a BT phone call :-
198
199 *************
200PCM0 <------------> * * <----DAI0-----> Codec Headset
201 * *
202PCM1 <------------> * * <----DAI1-----> Codec Speakers
203 * DSP *
204PCM2 <------------> * * <====DAI2=====> MODEM
205 * *
206PCM3 <------------> * * <====DAI3=====> BT
207 * *
208 * * <----DAI4-----> DMIC
209 * *
210 * * <----DAI5-----> FM
211 *************
212
213This allows the host CPU to sleep whilst the DSP, MODEM DAI and the BT DAI are
214still in operation.
215
216A BE DAI link can also set the codec to a dummy device if the code is a device
217that is managed externally.
218
219Likewise a BE DAI can also set a dummy cpu DAI if the CPU DAI is managed by the
220DSP firmware.
221
222
2232 FE/BE PCM operations
224----------------------
225
226The BE above also exports some PCM operations and a "fixup" callback. The fixup
227callback is used by the machine driver to (re)configure the DAI based upon the
228FE hw params. i.e. the DSP may perform SRC or ASRC from the FE to BE.
229
230e.g. DSP converts all FE hw params to run at fixed rate of 48k, 16bit, stereo for
231DAI0. This means all FE hw_params have to be fixed in the machine driver for
232DAI0 so that the DAI is running at desired configuration regardless of the FE
233configuration.
234
235static int dai0_fixup(struct snd_soc_pcm_runtime *rtd,
236 struct snd_pcm_hw_params *params)
237{
238 struct snd_interval *rate = hw_param_interval(params,
239 SNDRV_PCM_HW_PARAM_RATE);
240 struct snd_interval *channels = hw_param_interval(params,
241 SNDRV_PCM_HW_PARAM_CHANNELS);
242
243 /* The DSP will covert the FE rate to 48k, stereo */
244 rate->min = rate->max = 48000;
245 channels->min = channels->max = 2;
246
247 /* set DAI0 to 16 bit */
248 snd_mask_set(&params->masks[SNDRV_PCM_HW_PARAM_FORMAT -
249 SNDRV_PCM_HW_PARAM_FIRST_MASK],
250 SNDRV_PCM_FORMAT_S16_LE);
251 return 0;
252}
253
254The other PCM operation are the same as for regular DAI links. Use as necessary.
255
256
2573 Widget graph connections
258--------------------------
259
260The BE DAI links will normally be connected to the graph at initialisation time
261by the ASoC DAPM core. However, if the BE codec or BE DAI is a dummy then this
262has to be set explicitly in the driver :-
263
264/* BE for codec Headset - DAI0 is dummy and managed by DSP FW */
265{"DAI0 CODEC IN", NULL, "AIF1 Capture"},
266{"AIF1 Playback", NULL, "DAI0 CODEC OUT"},
267
268
269Writing a DPCM DSP driver
270=========================
271
272The DPCM DSP driver looks much like a standard platform class ASoC driver
273combined with elements from a codec class driver. A DSP platform driver must
274implement :-
275
276 1) Front End PCM DAIs - i.e. struct snd_soc_dai_driver.
277
278 2) DAPM graph showing DSP audio routing from FE DAIs to BEs.
279
280 3) DAPM widgets from DSP graph.
281
282 4) Mixers for gains, routing, etc.
283
284 5) DMA configuration.
285
286 6) BE AIF widgets.
287
288Items 6 is important for routing the audio outside of the DSP. AIF need to be
289defined for each BE and each stream direction. e.g for BE DAI0 above we would
290have :-
291
292SND_SOC_DAPM_AIF_IN("DAI0 RX", NULL, 0, SND_SOC_NOPM, 0, 0),
293SND_SOC_DAPM_AIF_OUT("DAI0 TX", NULL, 0, SND_SOC_NOPM, 0, 0),
294
295The BE AIF are used to connect the DSP graph to the graphs for the other
296component drivers (e.g. codec graph).
297
298
299Hostless PCM streams
300====================
301
302A hostless PCM stream is a stream that is not routed through the host CPU. An
303example of this would be a phone call from handset to modem.
304
305
306 *************
307PCM0 <------------> * * <----DAI0-----> Codec Headset
308 * *
309PCM1 <------------> * * <====DAI1=====> Codec Speakers/Mic
310 * DSP *
311PCM2 <------------> * * <====DAI2=====> MODEM
312 * *
313PCM3 <------------> * * <----DAI3-----> BT
314 * *
315 * * <----DAI4-----> DMIC
316 * *
317 * * <----DAI5-----> FM
318 *************
319
320In this case the PCM data is routed via the DSP. The host CPU in this use case
321is only used for control and can sleep during the runtime of the stream.
322
323The host can control the hostless link either by :-
324
325 1) Configuring the link as a CODEC <-> CODEC style link. In this case the link
326 is enabled or disabled by the state of the DAPM graph. This usually means
327 there is a mixer control that can be used to connect or disconnect the path
328 between both DAIs.
329
330 2) Hostless FE. This FE has a virtual connection to the BE DAI links on the DAPM
331 graph. Control is then carried out by the FE as regular PCM operations.
332 This method gives more control over the DAI links, but requires much more
333 userspace code to control the link. Its recommended to use CODEC<->CODEC
334 unless your HW needs more fine grained sequencing of the PCM ops.
335
336
337CODEC <-> CODEC link
338--------------------
339
340This DAI link is enabled when DAPM detects a valid path within the DAPM graph.
341The machine driver sets some additional parameters to the DAI link i.e.
342
343static const struct snd_soc_pcm_stream dai_params = {
344 .formats = SNDRV_PCM_FMTBIT_S32_LE,
345 .rate_min = 8000,
346 .rate_max = 8000,
347 .channels_min = 2,
348 .channels_max = 2,
349};
350
351static struct snd_soc_dai_link dais[] = {
352 < ... more DAI links above ... >
353 {
354 .name = "MODEM",
355 .stream_name = "MODEM",
356 .cpu_dai_name = "dai2",
357 .codec_dai_name = "modem-aif1",
358 .codec_name = "modem",
359 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
360 | SND_SOC_DAIFMT_CBM_CFM,
361 .params = &dai_params,
362 }
363 < ... more DAI links here ... >
364
365These parameters are used to configure the DAI hw_params() when DAPM detects a
366valid path and then calls the PCM operations to start the link. DAPM will also
367call the appropriate PCM operations to disable the DAI when the path is no
368longer valid.
369
370
371Hostless FE
372-----------
373
374The DAI link(s) are enabled by a FE that does not read or write any PCM data.
375This means creating a new FE that is connected with a virtual path to both
376DAI links. The DAI links will be started when the FE PCM is started and stopped
377when the FE PCM is stopped. Note that the FE PCM cannot read or write data in
378this configuration.
379
380
diff --git a/Documentation/sound/alsa/soc/codec.txt b/Documentation/sound/alsa/soc/codec.txt
index bce23a4a7875..db5f9c9ae149 100644
--- a/Documentation/sound/alsa/soc/codec.txt
+++ b/Documentation/sound/alsa/soc/codec.txt
@@ -1,22 +1,23 @@
1ASoC Codec Driver 1ASoC Codec Class Driver
2================= 2=======================
3 3
4The codec driver is generic and hardware independent code that configures the 4The codec class driver is generic and hardware independent code that configures
5codec to provide audio capture and playback. It should contain no code that is 5the codec, FM, MODEM, BT or external DSP to provide audio capture and playback.
6specific to the target platform or machine. All platform and machine specific 6It should contain no code that is specific to the target platform or machine.
7code should be added to the platform and machine drivers respectively. 7All platform and machine specific code should be added to the platform and
8machine drivers respectively.
8 9
9Each codec driver *must* provide the following features:- 10Each codec class driver *must* provide the following features:-
10 11
11 1) Codec DAI and PCM configuration 12 1) Codec DAI and PCM configuration
12 2) Codec control IO - using I2C, 3 Wire(SPI) or both APIs 13 2) Codec control IO - using RegMap API
13 3) Mixers and audio controls 14 3) Mixers and audio controls
14 4) Codec audio operations 15 4) Codec audio operations
16 5) DAPM description.
17 6) DAPM event handler.
15 18
16Optionally, codec drivers can also provide:- 19Optionally, codec drivers can also provide:-
17 20
18 5) DAPM description.
19 6) DAPM event handler.
20 7) DAC Digital mute control. 21 7) DAC Digital mute control.
21 22
22Its probably best to use this guide in conjunction with the existing codec 23Its probably best to use this guide in conjunction with the existing codec
@@ -64,26 +65,9 @@ struct snd_soc_dai_driver wm8731_dai = {
642 - Codec control IO 652 - Codec control IO
65-------------------- 66--------------------
66The codec can usually be controlled via an I2C or SPI style interface 67The codec can usually be controlled via an I2C or SPI style interface
67(AC97 combines control with data in the DAI). The codec drivers provide 68(AC97 combines control with data in the DAI). The codec driver should use the
68functions to read and write the codec registers along with supplying a 69Regmap API for all codec IO. Please see include/linux/regmap.h and existing
69register cache:- 70codec drivers for example regmap usage.
70
71 /* IO control data and register cache */
72 void *control_data; /* codec control (i2c/3wire) data */
73 void *reg_cache;
74
75Codec read/write should do any data formatting and call the hardware
76read write below to perform the IO. These functions are called by the
77core and ALSA when performing DAPM or changing the mixer:-
78
79 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
80 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
81
82Codec hardware IO functions - usually points to either the I2C, SPI or AC97
83read/write:-
84
85 hw_write_t hw_write;
86 hw_read_t hw_read;
87 71
88 72
893 - Mixers and audio controls 733 - Mixers and audio controls
@@ -127,7 +111,7 @@ Defines a stereo enumerated control
127 111
1284 - Codec Audio Operations 1124 - Codec Audio Operations
129-------------------------- 113--------------------------
130The codec driver also supports the following ALSA operations:- 114The codec driver also supports the following ALSA PCM operations:-
131 115
132/* SoC audio ops */ 116/* SoC audio ops */
133struct snd_soc_ops { 117struct snd_soc_ops {
diff --git a/Documentation/sound/alsa/soc/dapm.txt b/Documentation/sound/alsa/soc/dapm.txt
index 05bf5a0eee41..6faab4880006 100644
--- a/Documentation/sound/alsa/soc/dapm.txt
+++ b/Documentation/sound/alsa/soc/dapm.txt
@@ -21,7 +21,7 @@ level power systems.
21 21
22There are 4 power domains within DAPM 22There are 4 power domains within DAPM
23 23
24 1. Codec domain - VREF, VMID (core codec and audio power) 24 1. Codec bias domain - VREF, VMID (core codec and audio power)
25 Usually controlled at codec probe/remove and suspend/resume, although 25 Usually controlled at codec probe/remove and suspend/resume, although
26 can be set at stream time if power is not needed for sidetone, etc. 26 can be set at stream time if power is not needed for sidetone, etc.
27 27
@@ -30,7 +30,7 @@ There are 4 power domains within DAPM
30 machine driver and responds to asynchronous events e.g when HP 30 machine driver and responds to asynchronous events e.g when HP
31 are inserted 31 are inserted
32 32
33 3. Path domain - audio susbsystem signal paths 33 3. Path domain - audio subsystem signal paths
34 Automatically set when mixer and mux settings are changed by the user. 34 Automatically set when mixer and mux settings are changed by the user.
35 e.g. alsamixer, amixer. 35 e.g. alsamixer, amixer.
36 36
@@ -63,14 +63,22 @@ Audio DAPM widgets fall into a number of types:-
63 o Line - Line Input/Output (and optional Jack) 63 o Line - Line Input/Output (and optional Jack)
64 o Speaker - Speaker 64 o Speaker - Speaker
65 o Supply - Power or clock supply widget used by other widgets. 65 o Supply - Power or clock supply widget used by other widgets.
66 o Regulator - External regulator that supplies power to audio components.
67 o Clock - External clock that supplies clock to audio components.
68 o AIF IN - Audio Interface Input (with TDM slot mask).
69 o AIF OUT - Audio Interface Output (with TDM slot mask).
70 o Siggen - Signal Generator.
71 o DAI IN - Digital Audio Interface Input.
72 o DAI OUT - Digital Audio Interface Output.
73 o DAI Link - DAI Link between two DAI structures */
66 o Pre - Special PRE widget (exec before all others) 74 o Pre - Special PRE widget (exec before all others)
67 o Post - Special POST widget (exec after all others) 75 o Post - Special POST widget (exec after all others)
68 76
69(Widgets are defined in include/sound/soc-dapm.h) 77(Widgets are defined in include/sound/soc-dapm.h)
70 78
71Widgets are usually added in the codec driver and the machine driver. There are 79Widgets can be added to the sound card by any of the component driver types.
72convenience macros defined in soc-dapm.h that can be used to quickly build a 80There are convenience macros defined in soc-dapm.h that can be used to quickly
73list of widgets of the codecs and machines DAPM widgets. 81build a list of widgets of the codecs and machines DAPM widgets.
74 82
75Most widgets have a name, register, shift and invert. Some widgets have extra 83Most widgets have a name, register, shift and invert. Some widgets have extra
76parameters for stream name and kcontrols. 84parameters for stream name and kcontrols.
@@ -80,11 +88,13 @@ parameters for stream name and kcontrols.
80------------------------- 88-------------------------
81 89
82Stream Widgets relate to the stream power domain and only consist of ADCs 90Stream Widgets relate to the stream power domain and only consist of ADCs
83(analog to digital converters) and DACs (digital to analog converters). 91(analog to digital converters), DACs (digital to analog converters),
92AIF IN and AIF OUT.
84 93
85Stream widgets have the following format:- 94Stream widgets have the following format:-
86 95
87SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert), 96SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert),
97SND_SOC_DAPM_AIF_IN(name, stream, slot, reg, shift, invert)
88 98
89NOTE: the stream name must match the corresponding stream name in your codec 99NOTE: the stream name must match the corresponding stream name in your codec
90snd_soc_codec_dai. 100snd_soc_codec_dai.
@@ -94,6 +104,11 @@ e.g. stream widgets for HiFi playback and capture
94SND_SOC_DAPM_DAC("HiFi DAC", "HiFi Playback", REG, 3, 1), 104SND_SOC_DAPM_DAC("HiFi DAC", "HiFi Playback", REG, 3, 1),
95SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1), 105SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1),
96 106
107e.g. stream widgets for AIF
108
109SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0),
110SND_SOC_DAPM_AIF_OUT("AIF1TX", "AIF1 Capture", 0, SND_SOC_NOPM, 0, 0),
111
97 112
982.2 Path Domain Widgets 1132.2 Path Domain Widgets
99----------------------- 114-----------------------
@@ -121,12 +136,14 @@ If you dont want the mixer elements prefixed with the name of the mixer widget,
121you can use SND_SOC_DAPM_MIXER_NAMED_CTL instead. the parameters are the same 136you can use SND_SOC_DAPM_MIXER_NAMED_CTL instead. the parameters are the same
122as for SND_SOC_DAPM_MIXER. 137as for SND_SOC_DAPM_MIXER.
123 138
1242.3 Platform/Machine domain Widgets 139
125----------------------------------- 1402.3 Machine domain Widgets
141--------------------------
126 142
127Machine widgets are different from codec widgets in that they don't have a 143Machine widgets are different from codec widgets in that they don't have a
128codec register bit associated with them. A machine widget is assigned to each 144codec register bit associated with them. A machine widget is assigned to each
129machine audio component (non codec) that can be independently powered. e.g. 145machine audio component (non codec or DSP) that can be independently
146powered. e.g.
130 147
131 o Speaker Amp 148 o Speaker Amp
132 o Microphone Bias 149 o Microphone Bias
@@ -146,12 +163,12 @@ static int spitz_mic_bias(struct snd_soc_dapm_widget* w, int event)
146SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias), 163SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias),
147 164
148 165
1492.4 Codec Domain 1662.4 Codec (BIAS) Domain
150---------------- 167-----------------------
151 168
152The codec power domain has no widgets and is handled by the codecs DAPM event 169The codec bias power domain has no widgets and is handled by the codecs DAPM
153handler. This handler is called when the codec powerstate is changed wrt to any 170event handler. This handler is called when the codec powerstate is changed wrt
154stream event or by kernel PM events. 171to any stream event or by kernel PM events.
155 172
156 173
1572.5 Virtual Widgets 1742.5 Virtual Widgets
@@ -169,15 +186,16 @@ After all the widgets have been defined, they can then be added to the DAPM
169subsystem individually with a call to snd_soc_dapm_new_control(). 186subsystem individually with a call to snd_soc_dapm_new_control().
170 187
171 188
1723. Codec Widget Interconnections 1893. Codec/DSP Widget Interconnections
173================================ 190====================================
174 191
175Widgets are connected to each other within the codec and machine by audio paths 192Widgets are connected to each other within the codec, platform and machine by
176(called interconnections). Each interconnection must be defined in order to 193audio paths (called interconnections). Each interconnection must be defined in
177create a map of all audio paths between widgets. 194order to create a map of all audio paths between widgets.
178 195
179This is easiest with a diagram of the codec (and schematic of the machine audio 196This is easiest with a diagram of the codec or DSP (and schematic of the machine
180system), as it requires joining widgets together via their audio signal paths. 197audio system), as it requires joining widgets together via their audio signal
198paths.
181 199
182e.g., from the WM8731 output mixer (wm8731.c) 200e.g., from the WM8731 output mixer (wm8731.c)
183 201
@@ -247,16 +265,9 @@ machine and includes the codec. e.g.
247 o Mic Jack 265 o Mic Jack
248 o Codec Pins 266 o Codec Pins
249 267
250When a codec pin is NC it can be marked as not used with a call to 268Endpoints are added to the DAPM graph so that their usage can be determined in
251 269order to save power. e.g. NC codecs pins will be switched OFF, unconnected
252snd_soc_dapm_set_endpoint(codec, "Widget Name", 0); 270jacks can also be switched OFF.
253
254The last argument is 0 for inactive and 1 for active. This way the pin and its
255input widget will never be powered up and consume power.
256
257This also applies to machine widgets. e.g. if a headphone is connected to a
258jack then the jack can be marked active. If the headphone is removed, then
259the headphone jack can be marked inactive.
260 271
261 272
2625 DAPM Widget Events 2735 DAPM Widget Events
diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/alsa/soc/machine.txt
index d50c14df3411..74056dba52be 100644
--- a/Documentation/sound/alsa/soc/machine.txt
+++ b/Documentation/sound/alsa/soc/machine.txt
@@ -1,8 +1,10 @@
1ASoC Machine Driver 1ASoC Machine Driver
2=================== 2===================
3 3
4The ASoC machine (or board) driver is the code that glues together the platform 4The ASoC machine (or board) driver is the code that glues together all the
5and codec drivers. 5component drivers (e.g. codecs, platforms and DAIs). It also describes the
6relationships between each componnent which include audio paths, GPIOs,
7interrupts, clocking, jacks and voltage regulators.
6 8
7The machine driver can contain codec and platform specific code. It registers 9The machine driver can contain codec and platform specific code. It registers
8the audio subsystem with the kernel as a platform device and is represented by 10the audio subsystem with the kernel as a platform device and is represented by
diff --git a/Documentation/sound/alsa/soc/platform.txt b/Documentation/sound/alsa/soc/platform.txt
index d57efad37e0a..3a08a2c9150c 100644
--- a/Documentation/sound/alsa/soc/platform.txt
+++ b/Documentation/sound/alsa/soc/platform.txt
@@ -1,9 +1,9 @@
1ASoC Platform Driver 1ASoC Platform Driver
2==================== 2====================
3 3
4An ASoC platform driver can be divided into audio DMA and SoC DAI configuration 4An ASoC platform driver class can be divided into audio DMA drivers, SoC DAI
5and control. The platform drivers only target the SoC CPU and must have no board 5drivers and DSP drivers. The platform drivers only target the SoC CPU and must
6specific code. 6have no board specific code.
7 7
8Audio DMA 8Audio DMA
9========= 9=========
@@ -64,3 +64,16 @@ Each SoC DAI driver must provide the following features:-
64 5) Suspend and resume (optional) 64 5) Suspend and resume (optional)
65 65
66Please see codec.txt for a description of items 1 - 4. 66Please see codec.txt for a description of items 1 - 4.
67
68
69SoC DSP Drivers
70===============
71
72Each SoC DSP driver usually supplies the following features :-
73
74 1) DAPM graph
75 2) Mixer controls
76 3) DMA IO to/from DSP buffers (if applicable)
77 4) Definition of DSP front end (FE) PCM devices.
78
79Please see DPCM.txt for a description of item 4.
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index 9d4c1d18ad44..26b7ee491df8 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -290,13 +290,24 @@ Default value is "/sbin/hotplug".
290kptr_restrict: 290kptr_restrict:
291 291
292This toggle indicates whether restrictions are placed on 292This toggle indicates whether restrictions are placed on
293exposing kernel addresses via /proc and other interfaces. When 293exposing kernel addresses via /proc and other interfaces.
294kptr_restrict is set to (0), there are no restrictions. When 294
295kptr_restrict is set to (1), the default, kernel pointers 295When kptr_restrict is set to (0), the default, there are no restrictions.
296printed using the %pK format specifier will be replaced with 0's 296
297unless the user has CAP_SYSLOG. When kptr_restrict is set to 297When kptr_restrict is set to (1), kernel pointers printed using the %pK
298(2), kernel pointers printed using %pK will be replaced with 0's 298format specifier will be replaced with 0's unless the user has CAP_SYSLOG
299regardless of privileges. 299and effective user and group ids are equal to the real ids. This is
300because %pK checks are done at read() time rather than open() time, so
301if permissions are elevated between the open() and the read() (e.g via
302a setuid binary) then %pK will not leak kernel pointers to unprivileged
303users. Note, this is a temporary solution only. The correct long-term
304solution is to do the permission checks at open() time. Consider removing
305world read permissions from files that use %pK, and using dmesg_restrict
306to protect against uses of %pK in dmesg(8) if leaking kernel pointer
307values to unprivileged users is a concern.
308
309When kptr_restrict is set to (2), kernel pointers printed using
310%pK will be replaced with 0's regardless of privileges.
300 311
301============================================================== 312==============================================================
302 313
@@ -355,6 +366,82 @@ utilize.
355 366
356============================================================== 367==============================================================
357 368
369numa_balancing
370
371Enables/disables automatic page fault based NUMA memory
372balancing. Memory is moved automatically to nodes
373that access it often.
374
375Enables/disables automatic NUMA memory balancing. On NUMA machines, there
376is a performance penalty if remote memory is accessed by a CPU. When this
377feature is enabled the kernel samples what task thread is accessing memory
378by periodically unmapping pages and later trapping a page fault. At the
379time of the page fault, it is determined if the data being accessed should
380be migrated to a local memory node.
381
382The unmapping of pages and trapping faults incur additional overhead that
383ideally is offset by improved memory locality but there is no universal
384guarantee. If the target workload is already bound to NUMA nodes then this
385feature should be disabled. Otherwise, if the system overhead from the
386feature is too high then the rate the kernel samples for NUMA hinting
387faults may be controlled by the numa_balancing_scan_period_min_ms,
388numa_balancing_scan_delay_ms, numa_balancing_scan_period_max_ms,
389numa_balancing_scan_size_mb, numa_balancing_settle_count sysctls and
390numa_balancing_migrate_deferred.
391
392==============================================================
393
394numa_balancing_scan_period_min_ms, numa_balancing_scan_delay_ms,
395numa_balancing_scan_period_max_ms, numa_balancing_scan_size_mb
396
397Automatic NUMA balancing scans tasks address space and unmaps pages to
398detect if pages are properly placed or if the data should be migrated to a
399memory node local to where the task is running. Every "scan delay" the task
400scans the next "scan size" number of pages in its address space. When the
401end of the address space is reached the scanner restarts from the beginning.
402
403In combination, the "scan delay" and "scan size" determine the scan rate.
404When "scan delay" decreases, the scan rate increases. The scan delay and
405hence the scan rate of every task is adaptive and depends on historical
406behaviour. If pages are properly placed then the scan delay increases,
407otherwise the scan delay decreases. The "scan size" is not adaptive but
408the higher the "scan size", the higher the scan rate.
409
410Higher scan rates incur higher system overhead as page faults must be
411trapped and potentially data must be migrated. However, the higher the scan
412rate, the more quickly a tasks memory is migrated to a local node if the
413workload pattern changes and minimises performance impact due to remote
414memory accesses. These sysctls control the thresholds for scan delays and
415the number of pages scanned.
416
417numa_balancing_scan_period_min_ms is the minimum time in milliseconds to
418scan a tasks virtual memory. It effectively controls the maximum scanning
419rate for each task.
420
421numa_balancing_scan_delay_ms is the starting "scan delay" used for a task
422when it initially forks.
423
424numa_balancing_scan_period_max_ms is the maximum time in milliseconds to
425scan a tasks virtual memory. It effectively controls the minimum scanning
426rate for each task.
427
428numa_balancing_scan_size_mb is how many megabytes worth of pages are
429scanned for a given scan.
430
431numa_balancing_settle_count is how many scan periods must complete before
432the schedule balancer stops pushing the task towards a preferred node. This
433gives the scheduler a chance to place the task on an alternative node if the
434preferred node is overloaded.
435
436numa_balancing_migrate_deferred is how many page migrations get skipped
437unconditionally, after a page migration is skipped because a page is shared
438with other tasks. This reduces page migration overhead, and determines
439how much stronger the "move task near its memory" policy scheduler becomes,
440versus the "move memory near its task" memory management policy, for workloads
441with shared memory.
442
443==============================================================
444
358osrelease, ostype & version: 445osrelease, ostype & version:
359 446
360# cat osrelease 447# cat osrelease
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index 79a797eb3e87..1fbd4eb7b64a 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -119,8 +119,11 @@ other appears as 0 when read.
119 119
120dirty_background_ratio 120dirty_background_ratio
121 121
122Contains, as a percentage of total system memory, the number of pages at which 122Contains, as a percentage of total available memory that contains free pages
123the background kernel flusher threads will start writing out dirty data. 123and reclaimable pages, the number of pages at which the background kernel
124flusher threads will start writing out dirty data.
125
126The total avaiable memory is not equal to total system memory.
124 127
125============================================================== 128==============================================================
126 129
@@ -151,9 +154,11 @@ interval will be written out next time a flusher thread wakes up.
151 154
152dirty_ratio 155dirty_ratio
153 156
154Contains, as a percentage of total system memory, the number of pages at which 157Contains, as a percentage of total available memory that contains free pages
155a process which is generating disk writes will itself start writing out dirty 158and reclaimable pages, the number of pages at which a process which is
156data. 159generating disk writes will itself start writing out dirty data.
160
161The total avaiable memory is not equal to total system memory.
157 162
158============================================================== 163==============================================================
159 164
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt
index 8cb4d7842a5f..0e307c94809a 100644
--- a/Documentation/sysrq.txt
+++ b/Documentation/sysrq.txt
@@ -11,27 +11,29 @@ regardless of whatever else it is doing, unless it is completely locked up.
11You need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when 11You need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when
12configuring the kernel. When running a kernel with SysRq compiled in, 12configuring the kernel. When running a kernel with SysRq compiled in,
13/proc/sys/kernel/sysrq controls the functions allowed to be invoked via 13/proc/sys/kernel/sysrq controls the functions allowed to be invoked via
14the SysRq key. By default the file contains 1 which means that every 14the SysRq key. The default value in this file is set by the
15possible SysRq request is allowed (in older versions SysRq was disabled 15CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE config symbol, which itself defaults
16by default, and you were required to specifically enable it at run-time 16to 1. Here is the list of possible values in /proc/sys/kernel/sysrq:
17but this is not the case any more). Here is the list of possible values
18in /proc/sys/kernel/sysrq:
19 0 - disable sysrq completely 17 0 - disable sysrq completely
20 1 - enable all functions of sysrq 18 1 - enable all functions of sysrq
21 >1 - bitmask of allowed sysrq functions (see below for detailed function 19 >1 - bitmask of allowed sysrq functions (see below for detailed function
22 description): 20 description):
23 2 - enable control of console logging level 21 2 = 0x2 - enable control of console logging level
24 4 - enable control of keyboard (SAK, unraw) 22 4 = 0x4 - enable control of keyboard (SAK, unraw)
25 8 - enable debugging dumps of processes etc. 23 8 = 0x8 - enable debugging dumps of processes etc.
26 16 - enable sync command 24 16 = 0x10 - enable sync command
27 32 - enable remount read-only 25 32 = 0x20 - enable remount read-only
28 64 - enable signalling of processes (term, kill, oom-kill) 26 64 = 0x40 - enable signalling of processes (term, kill, oom-kill)
29 128 - allow reboot/poweroff 27 128 = 0x80 - allow reboot/poweroff
30 256 - allow nicing of all RT tasks 28 256 = 0x100 - allow nicing of all RT tasks
31 29
32You can set the value in the file by the following command: 30You can set the value in the file by the following command:
33 echo "number" >/proc/sys/kernel/sysrq 31 echo "number" >/proc/sys/kernel/sysrq
34 32
33The number may be written here either as decimal or as hexadecimal
34with the 0x prefix. CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE must always be
35written in hexadecimal.
36
35Note that the value of /proc/sys/kernel/sysrq influences only the invocation 37Note that the value of /proc/sys/kernel/sysrq influences only the invocation
36via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always 38via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always
37allowed (by a user with admin privileges). 39allowed (by a user with admin privileges).
diff --git a/Documentation/timers/00-INDEX b/Documentation/timers/00-INDEX
index a9248da5cdbc..ef2ccbf77fa2 100644
--- a/Documentation/timers/00-INDEX
+++ b/Documentation/timers/00-INDEX
@@ -8,5 +8,9 @@ hpet_example.c
8 - sample hpet timer test program 8 - sample hpet timer test program
9hrtimers.txt 9hrtimers.txt
10 - subsystem for high-resolution kernel timers 10 - subsystem for high-resolution kernel timers
11NO_HZ.txt
12 - Summary of the different methods for the scheduler clock-interrupts management.
13timers-howto.txt
14 - how to insert delays in the kernel the right (tm) way.
11timer_stats.txt 15timer_stats.txt
12 - timer usage statistics 16 - timer usage statistics
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt
index ea2d35d64d26..bd365988e8d8 100644
--- a/Documentation/trace/ftrace.txt
+++ b/Documentation/trace/ftrace.txt
@@ -655,7 +655,11 @@ explains which is which.
655 read the irq flags variable, an 'X' will always 655 read the irq flags variable, an 'X' will always
656 be printed here. 656 be printed here.
657 657
658 need-resched: 'N' task need_resched is set, '.' otherwise. 658 need-resched:
659 'N' both TIF_NEED_RESCHED and PREEMPT_NEED_RESCHED is set,
660 'n' only TIF_NEED_RESCHED is set,
661 'p' only PREEMPT_NEED_RESCHED is set,
662 '.' otherwise.
659 663
660 hardirq/softirq: 664 hardirq/softirq:
661 'H' - hard irq occurred inside a softirq. 665 'H' - hard irq occurred inside a softirq.
diff --git a/Documentation/trace/tracepoints.txt b/Documentation/trace/tracepoints.txt
index ac4170dd0f24..6b018b53177a 100644
--- a/Documentation/trace/tracepoints.txt
+++ b/Documentation/trace/tracepoints.txt
@@ -114,3 +114,8 @@ core kernel image or in modules.
114If the tracepoint has to be used in kernel modules, an 114If the tracepoint has to be used in kernel modules, an
115EXPORT_TRACEPOINT_SYMBOL_GPL() or EXPORT_TRACEPOINT_SYMBOL() can be 115EXPORT_TRACEPOINT_SYMBOL_GPL() or EXPORT_TRACEPOINT_SYMBOL() can be
116used to export the defined tracepoints. 116used to export the defined tracepoints.
117
118Note: The convenience macro TRACE_EVENT provides an alternative way to
119 define tracepoints. Check http://lwn.net/Articles/379903,
120 http://lwn.net/Articles/381064 and http://lwn.net/Articles/383362
121 for a series of articles with more details.
diff --git a/Documentation/usb/gadget_configfs.txt b/Documentation/usb/gadget_configfs.txt
index 8ec2a67c39b7..4cf53e406613 100644
--- a/Documentation/usb/gadget_configfs.txt
+++ b/Documentation/usb/gadget_configfs.txt
@@ -26,7 +26,7 @@ Linux provides a number of functions for gadgets to use.
26Creating a gadget means deciding what configurations there will be 26Creating a gadget means deciding what configurations there will be
27and which functions each configuration will provide. 27and which functions each configuration will provide.
28 28
29Configfs (please see Documentation/filesystems/configfs/*) lends itslef nicely 29Configfs (please see Documentation/filesystems/configfs/*) lends itself nicely
30for the purpose of telling the kernel about the above mentioned decision. 30for the purpose of telling the kernel about the above mentioned decision.
31This document is about how to do it. 31This document is about how to do it.
32 32
@@ -99,7 +99,7 @@ directories must be created:
99$ mkdir configs/<name>.<number> 99$ mkdir configs/<name>.<number>
100 100
101where <name> can be any string which is legal in a filesystem and the 101where <name> can be any string which is legal in a filesystem and the
102<numebr> is the configuration's number, e.g.: 102<number> is the configuration's number, e.g.:
103 103
104$ mkdir configs/c.1 104$ mkdir configs/c.1
105 105
@@ -327,7 +327,7 @@ from the buffer to the cs), but it is up to the implementer of the
327two functions to decide what they actually do. 327two functions to decide what they actually do.
328 328
329typedef struct configured_structure cs; 329typedef struct configured_structure cs;
330typedef struc specific_attribute sa; 330typedef struct specific_attribute sa;
331 331
332 sa 332 sa
333 +----------------------------------+ 333 +----------------------------------+
diff --git a/Documentation/virtual/kvm/00-INDEX b/Documentation/virtual/kvm/00-INDEX
new file mode 100644
index 000000000000..641ec9220179
--- /dev/null
+++ b/Documentation/virtual/kvm/00-INDEX
@@ -0,0 +1,24 @@
100-INDEX
2 - this file.
3api.txt
4 - KVM userspace API.
5cpuid.txt
6 - KVM-specific cpuid leaves (x86).
7devices/
8 - KVM_CAP_DEVICE_CTRL userspace API.
9hypercalls.txt
10 - KVM hypercalls.
11locking.txt
12 - notes on KVM locks.
13mmu.txt
14 - the x86 kvm shadow mmu.
15msr.txt
16 - KVM-specific MSRs (x86).
17nested-vmx.txt
18 - notes on nested virtualization for Intel x86 processors.
19ppc-pv.txt
20 - the paravirtualization interface on PowerPC.
21review-checklist.txt
22 - review checklist for KVM patches.
23timekeeping.txt
24 - timekeeping virtualization for x86-based architectures.
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index 858aecf21db2..a30035dd4c26 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -1122,9 +1122,9 @@ struct kvm_cpuid2 {
1122 struct kvm_cpuid_entry2 entries[0]; 1122 struct kvm_cpuid_entry2 entries[0];
1123}; 1123};
1124 1124
1125#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX 1 1125#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0)
1126#define KVM_CPUID_FLAG_STATEFUL_FUNC 2 1126#define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1)
1127#define KVM_CPUID_FLAG_STATE_READ_NEXT 4 1127#define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2)
1128 1128
1129struct kvm_cpuid_entry2 { 1129struct kvm_cpuid_entry2 {
1130 __u32 function; 1130 __u32 function;
@@ -1810,6 +1810,50 @@ registers, find a list below:
1810 PPC | KVM_REG_PPC_TLB3PS | 32 1810 PPC | KVM_REG_PPC_TLB3PS | 32
1811 PPC | KVM_REG_PPC_EPTCFG | 32 1811 PPC | KVM_REG_PPC_EPTCFG | 32
1812 PPC | KVM_REG_PPC_ICP_STATE | 64 1812 PPC | KVM_REG_PPC_ICP_STATE | 64
1813 PPC | KVM_REG_PPC_TB_OFFSET | 64
1814 PPC | KVM_REG_PPC_SPMC1 | 32
1815 PPC | KVM_REG_PPC_SPMC2 | 32
1816 PPC | KVM_REG_PPC_IAMR | 64
1817 PPC | KVM_REG_PPC_TFHAR | 64
1818 PPC | KVM_REG_PPC_TFIAR | 64
1819 PPC | KVM_REG_PPC_TEXASR | 64
1820 PPC | KVM_REG_PPC_FSCR | 64
1821 PPC | KVM_REG_PPC_PSPB | 32
1822 PPC | KVM_REG_PPC_EBBHR | 64
1823 PPC | KVM_REG_PPC_EBBRR | 64
1824 PPC | KVM_REG_PPC_BESCR | 64
1825 PPC | KVM_REG_PPC_TAR | 64
1826 PPC | KVM_REG_PPC_DPDES | 64
1827 PPC | KVM_REG_PPC_DAWR | 64
1828 PPC | KVM_REG_PPC_DAWRX | 64
1829 PPC | KVM_REG_PPC_CIABR | 64
1830 PPC | KVM_REG_PPC_IC | 64
1831 PPC | KVM_REG_PPC_VTB | 64
1832 PPC | KVM_REG_PPC_CSIGR | 64
1833 PPC | KVM_REG_PPC_TACR | 64
1834 PPC | KVM_REG_PPC_TCSCR | 64
1835 PPC | KVM_REG_PPC_PID | 64
1836 PPC | KVM_REG_PPC_ACOP | 64
1837 PPC | KVM_REG_PPC_VRSAVE | 32
1838 PPC | KVM_REG_PPC_LPCR | 64
1839 PPC | KVM_REG_PPC_PPR | 64
1840 PPC | KVM_REG_PPC_ARCH_COMPAT 32
1841 PPC | KVM_REG_PPC_TM_GPR0 | 64
1842 ...
1843 PPC | KVM_REG_PPC_TM_GPR31 | 64
1844 PPC | KVM_REG_PPC_TM_VSR0 | 128
1845 ...
1846 PPC | KVM_REG_PPC_TM_VSR63 | 128
1847 PPC | KVM_REG_PPC_TM_CR | 64
1848 PPC | KVM_REG_PPC_TM_LR | 64
1849 PPC | KVM_REG_PPC_TM_CTR | 64
1850 PPC | KVM_REG_PPC_TM_FPSCR | 64
1851 PPC | KVM_REG_PPC_TM_AMR | 64
1852 PPC | KVM_REG_PPC_TM_PPR | 64
1853 PPC | KVM_REG_PPC_TM_VRSAVE | 64
1854 PPC | KVM_REG_PPC_TM_VSCR | 32
1855 PPC | KVM_REG_PPC_TM_DSCR | 64
1856 PPC | KVM_REG_PPC_TM_TAR | 64
1813 1857
1814ARM registers are mapped using the lower 32 bits. The upper 16 of that 1858ARM registers are mapped using the lower 32 bits. The upper 16 of that
1815is the register group type, or coprocessor number: 1859is the register group type, or coprocessor number:
@@ -2304,7 +2348,31 @@ Possible features:
2304 Depends on KVM_CAP_ARM_EL1_32BIT (arm64 only). 2348 Depends on KVM_CAP_ARM_EL1_32BIT (arm64 only).
2305 2349
2306 2350
23074.83 KVM_GET_REG_LIST 23514.83 KVM_ARM_PREFERRED_TARGET
2352
2353Capability: basic
2354Architectures: arm, arm64
2355Type: vm ioctl
2356Parameters: struct struct kvm_vcpu_init (out)
2357Returns: 0 on success; -1 on error
2358Errors:
2359 ENODEV: no preferred target available for the host
2360
2361This queries KVM for preferred CPU target type which can be emulated
2362by KVM on underlying host.
2363
2364The ioctl returns struct kvm_vcpu_init instance containing information
2365about preferred CPU target type and recommended features for it. The
2366kvm_vcpu_init->features bitmap returned will have feature bits set if
2367the preferred target recommends setting these features, but this is
2368not mandatory.
2369
2370The information returned by this ioctl can be used to prepare an instance
2371of struct kvm_vcpu_init for KVM_ARM_VCPU_INIT ioctl which will result in
2372in VCPU matching underlying host.
2373
2374
23754.84 KVM_GET_REG_LIST
2308 2376
2309Capability: basic 2377Capability: basic
2310Architectures: arm, arm64 2378Architectures: arm, arm64
@@ -2323,8 +2391,7 @@ struct kvm_reg_list {
2323This ioctl returns the guest registers that are supported for the 2391This ioctl returns the guest registers that are supported for the
2324KVM_GET_ONE_REG/KVM_SET_ONE_REG calls. 2392KVM_GET_ONE_REG/KVM_SET_ONE_REG calls.
2325 2393
2326 23944.85 KVM_ARM_SET_DEVICE_ADDR
23274.84 KVM_ARM_SET_DEVICE_ADDR
2328 2395
2329Capability: KVM_CAP_ARM_SET_DEVICE_ADDR 2396Capability: KVM_CAP_ARM_SET_DEVICE_ADDR
2330Architectures: arm, arm64 2397Architectures: arm, arm64
@@ -2362,7 +2429,7 @@ must be called after calling KVM_CREATE_IRQCHIP, but before calling
2362KVM_RUN on any of the VCPUs. Calling this ioctl twice for any of the 2429KVM_RUN on any of the VCPUs. Calling this ioctl twice for any of the
2363base addresses will return -EEXIST. 2430base addresses will return -EEXIST.
2364 2431
23654.85 KVM_PPC_RTAS_DEFINE_TOKEN 24324.86 KVM_PPC_RTAS_DEFINE_TOKEN
2366 2433
2367Capability: KVM_CAP_PPC_RTAS 2434Capability: KVM_CAP_PPC_RTAS
2368Architectures: ppc 2435Architectures: ppc
@@ -2661,6 +2728,77 @@ and usually define the validity of a groups of registers. (e.g. one bit
2661}; 2728};
2662 2729
2663 2730
27314.81 KVM_GET_EMULATED_CPUID
2732
2733Capability: KVM_CAP_EXT_EMUL_CPUID
2734Architectures: x86
2735Type: system ioctl
2736Parameters: struct kvm_cpuid2 (in/out)
2737Returns: 0 on success, -1 on error
2738
2739struct kvm_cpuid2 {
2740 __u32 nent;
2741 __u32 flags;
2742 struct kvm_cpuid_entry2 entries[0];
2743};
2744
2745The member 'flags' is used for passing flags from userspace.
2746
2747#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0)
2748#define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1)
2749#define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2)
2750
2751struct kvm_cpuid_entry2 {
2752 __u32 function;
2753 __u32 index;
2754 __u32 flags;
2755 __u32 eax;
2756 __u32 ebx;
2757 __u32 ecx;
2758 __u32 edx;
2759 __u32 padding[3];
2760};
2761
2762This ioctl returns x86 cpuid features which are emulated by
2763kvm.Userspace can use the information returned by this ioctl to query
2764which features are emulated by kvm instead of being present natively.
2765
2766Userspace invokes KVM_GET_EMULATED_CPUID by passing a kvm_cpuid2
2767structure with the 'nent' field indicating the number of entries in
2768the variable-size array 'entries'. If the number of entries is too low
2769to describe the cpu capabilities, an error (E2BIG) is returned. If the
2770number is too high, the 'nent' field is adjusted and an error (ENOMEM)
2771is returned. If the number is just right, the 'nent' field is adjusted
2772to the number of valid entries in the 'entries' array, which is then
2773filled.
2774
2775The entries returned are the set CPUID bits of the respective features
2776which kvm emulates, as returned by the CPUID instruction, with unknown
2777or unsupported feature bits cleared.
2778
2779Features like x2apic, for example, may not be present in the host cpu
2780but are exposed by kvm in KVM_GET_SUPPORTED_CPUID because they can be
2781emulated efficiently and thus not included here.
2782
2783The fields in each entry are defined as follows:
2784
2785 function: the eax value used to obtain the entry
2786 index: the ecx value used to obtain the entry (for entries that are
2787 affected by ecx)
2788 flags: an OR of zero or more of the following:
2789 KVM_CPUID_FLAG_SIGNIFCANT_INDEX:
2790 if the index field is valid
2791 KVM_CPUID_FLAG_STATEFUL_FUNC:
2792 if cpuid for this function returns different values for successive
2793 invocations; there will be several entries with the same function,
2794 all with this flag set
2795 KVM_CPUID_FLAG_STATE_READ_NEXT:
2796 for KVM_CPUID_FLAG_STATEFUL_FUNC entries, set if this entry is
2797 the first entry to be read by a cpu
2798 eax, ebx, ecx, edx: the values returned by the cpuid instruction for
2799 this function/index combination
2800
2801
26646. Capabilities that can be enabled 28026. Capabilities that can be enabled
2665----------------------------------- 2803-----------------------------------
2666 2804
diff --git a/Documentation/virtual/kvm/cpuid.txt b/Documentation/virtual/kvm/cpuid.txt
index 22ff659bc0fb..3c65feb83010 100644
--- a/Documentation/virtual/kvm/cpuid.txt
+++ b/Documentation/virtual/kvm/cpuid.txt
@@ -43,6 +43,13 @@ KVM_FEATURE_CLOCKSOURCE2 || 3 || kvmclock available at msrs
43KVM_FEATURE_ASYNC_PF || 4 || async pf can be enabled by 43KVM_FEATURE_ASYNC_PF || 4 || async pf can be enabled by
44 || || writing to msr 0x4b564d02 44 || || writing to msr 0x4b564d02
45------------------------------------------------------------------------------ 45------------------------------------------------------------------------------
46KVM_FEATURE_STEAL_TIME || 5 || steal time can be enabled by
47 || || writing to msr 0x4b564d03.
48------------------------------------------------------------------------------
49KVM_FEATURE_PV_EOI || 6 || paravirtualized end of interrupt
50 || || handler can be enabled by writing
51 || || to msr 0x4b564d04.
52------------------------------------------------------------------------------
46KVM_FEATURE_PV_UNHALT || 7 || guest checks this feature bit 53KVM_FEATURE_PV_UNHALT || 7 || guest checks this feature bit
47 || || before enabling paravirtualized 54 || || before enabling paravirtualized
48 || || spinlock support. 55 || || spinlock support.
diff --git a/Documentation/virtual/kvm/devices/vfio.txt b/Documentation/virtual/kvm/devices/vfio.txt
new file mode 100644
index 000000000000..ef51740c67ca
--- /dev/null
+++ b/Documentation/virtual/kvm/devices/vfio.txt
@@ -0,0 +1,22 @@
1VFIO virtual device
2===================
3
4Device types supported:
5 KVM_DEV_TYPE_VFIO
6
7Only one VFIO instance may be created per VM. The created device
8tracks VFIO groups in use by the VM and features of those groups
9important to the correctness and acceleration of the VM. As groups
10are enabled and disabled for use by the VM, KVM should be updated
11about their presence. When registered with KVM, a reference to the
12VFIO-group is held by KVM.
13
14Groups:
15 KVM_DEV_VFIO_GROUP
16
17KVM_DEV_VFIO_GROUP attributes:
18 KVM_DEV_VFIO_GROUP_ADD: Add a VFIO group to VFIO-KVM device tracking
19 KVM_DEV_VFIO_GROUP_DEL: Remove a VFIO group from VFIO-KVM device tracking
20
21For each, kvm_device_attr.addr points to an int32_t file descriptor
22for the VFIO group.
diff --git a/Documentation/virtual/kvm/locking.txt b/Documentation/virtual/kvm/locking.txt
index 41b7ac9884b5..f8869410d40c 100644
--- a/Documentation/virtual/kvm/locking.txt
+++ b/Documentation/virtual/kvm/locking.txt
@@ -132,10 +132,14 @@ See the comments in spte_has_volatile_bits() and mmu_spte_update().
132------------ 132------------
133 133
134Name: kvm_lock 134Name: kvm_lock
135Type: raw_spinlock 135Type: spinlock_t
136Arch: any 136Arch: any
137Protects: - vm_list 137Protects: - vm_list
138 - hardware virtualization enable/disable 138
139Name: kvm_count_lock
140Type: raw_spinlock_t
141Arch: any
142Protects: - hardware virtualization enable/disable
139Comment: 'raw' because hardware enabling/disabling must be atomic /wrt 143Comment: 'raw' because hardware enabling/disabling must be atomic /wrt
140 migration. 144 migration.
141 145
@@ -151,3 +155,14 @@ Type: spinlock_t
151Arch: any 155Arch: any
152Protects: -shadow page/shadow tlb entry 156Protects: -shadow page/shadow tlb entry
153Comment: it is a spinlock since it is used in mmu notifier. 157Comment: it is a spinlock since it is used in mmu notifier.
158
159Name: kvm->srcu
160Type: srcu lock
161Arch: any
162Protects: - kvm->memslots
163 - kvm->buses
164Comment: The srcu read lock must be held while accessing memslots (e.g.
165 when using gfn_to_* functions) and while accessing in-kernel
166 MMIO/PIO address->device structure mapping (kvm->buses).
167 The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
168 if it is needed by multiple functions.
diff --git a/Documentation/vm/00-INDEX b/Documentation/vm/00-INDEX
index 5481c8ba3412..a39d06680e1c 100644
--- a/Documentation/vm/00-INDEX
+++ b/Documentation/vm/00-INDEX
@@ -4,10 +4,12 @@ active_mm.txt
4 - An explanation from Linus about tsk->active_mm vs tsk->mm. 4 - An explanation from Linus about tsk->active_mm vs tsk->mm.
5balance 5balance
6 - various information on memory balancing. 6 - various information on memory balancing.
7hugepage-mmap.c 7cleancache.txt
8 - Example app using huge page memory with the mmap system call. 8 - Intro to cleancache and page-granularity victim cache.
9hugepage-shm.c 9frontswap.txt
10 - Example app using huge page memory with Sys V shared memory system calls. 10 - Outline frontswap, part of the transcendent memory frontend.
11highmem.txt
12 - Outline of highmem and common issues.
11hugetlbpage.txt 13hugetlbpage.txt
12 - a brief summary of hugetlbpage support in the Linux kernel. 14 - a brief summary of hugetlbpage support in the Linux kernel.
13hwpoison.txt 15hwpoison.txt
@@ -16,21 +18,23 @@ ksm.txt
16 - how to use the Kernel Samepage Merging feature. 18 - how to use the Kernel Samepage Merging feature.
17locking 19locking
18 - info on how locking and synchronization is done in the Linux vm code. 20 - info on how locking and synchronization is done in the Linux vm code.
19map_hugetlb.c
20 - an example program that uses the MAP_HUGETLB mmap flag.
21numa 21numa
22 - information about NUMA specific code in the Linux vm. 22 - information about NUMA specific code in the Linux vm.
23numa_memory_policy.txt 23numa_memory_policy.txt
24 - documentation of concepts and APIs of the 2.6 memory policy support. 24 - documentation of concepts and APIs of the 2.6 memory policy support.
25overcommit-accounting 25overcommit-accounting
26 - description of the Linux kernels overcommit handling modes. 26 - description of the Linux kernels overcommit handling modes.
27page-types.c
28 - Tool for querying page flags
29page_migration 27page_migration
30 - description of page migration in NUMA systems. 28 - description of page migration in NUMA systems.
31pagemap.txt 29pagemap.txt
32 - pagemap, from the userspace perspective 30 - pagemap, from the userspace perspective
33slub.txt 31slub.txt
34 - a short users guide for SLUB. 32 - a short users guide for SLUB.
33soft-dirty.txt
34 - short explanation for soft-dirty PTEs
35transhuge.txt
36 - Transparent Hugepage Support, alternative way of using hugepages.
35unevictable-lru.txt 37unevictable-lru.txt
36 - Unevictable LRU infrastructure 38 - Unevictable LRU infrastructure
39zswap.txt
40 - Intro to compressed cache for swap pages
diff --git a/Documentation/vm/split_page_table_lock b/Documentation/vm/split_page_table_lock
new file mode 100644
index 000000000000..6dea4fd5c961
--- /dev/null
+++ b/Documentation/vm/split_page_table_lock
@@ -0,0 +1,94 @@
1Split page table lock
2=====================
3
4Originally, mm->page_table_lock spinlock protected all page tables of the
5mm_struct. But this approach leads to poor page fault scalability of
6multi-threaded applications due high contention on the lock. To improve
7scalability, split page table lock was introduced.
8
9With split page table lock we have separate per-table lock to serialize
10access to the table. At the moment we use split lock for PTE and PMD
11tables. Access to higher level tables protected by mm->page_table_lock.
12
13There are helpers to lock/unlock a table and other accessor functions:
14 - pte_offset_map_lock()
15 maps pte and takes PTE table lock, returns pointer to the taken
16 lock;
17 - pte_unmap_unlock()
18 unlocks and unmaps PTE table;
19 - pte_alloc_map_lock()
20 allocates PTE table if needed and take the lock, returns pointer
21 to taken lock or NULL if allocation failed;
22 - pte_lockptr()
23 returns pointer to PTE table lock;
24 - pmd_lock()
25 takes PMD table lock, returns pointer to taken lock;
26 - pmd_lockptr()
27 returns pointer to PMD table lock;
28
29Split page table lock for PTE tables is enabled compile-time if
30CONFIG_SPLIT_PTLOCK_CPUS (usually 4) is less or equal to NR_CPUS.
31If split lock is disabled, all tables guaded by mm->page_table_lock.
32
33Split page table lock for PMD tables is enabled, if it's enabled for PTE
34tables and the architecture supports it (see below).
35
36Hugetlb and split page table lock
37---------------------------------
38
39Hugetlb can support several page sizes. We use split lock only for PMD
40level, but not for PUD.
41
42Hugetlb-specific helpers:
43 - huge_pte_lock()
44 takes pmd split lock for PMD_SIZE page, mm->page_table_lock
45 otherwise;
46 - huge_pte_lockptr()
47 returns pointer to table lock;
48
49Support of split page table lock by an architecture
50---------------------------------------------------
51
52There's no need in special enabling of PTE split page table lock:
53everything required is done by pgtable_page_ctor() and pgtable_page_dtor(),
54which must be called on PTE table allocation / freeing.
55
56Make sure the architecture doesn't use slab allocator for page table
57allocation: slab uses page->slab_cache and page->first_page for its pages.
58These fields share storage with page->ptl.
59
60PMD split lock only makes sense if you have more than two page table
61levels.
62
63PMD split lock enabling requires pgtable_pmd_page_ctor() call on PMD table
64allocation and pgtable_pmd_page_dtor() on freeing.
65
66Allocation usually happens in pmd_alloc_one(), freeing in pmd_free() and
67pmd_free_tlb(), but make sure you cover all PMD table allocation / freeing
68paths: i.e X86_PAE preallocate few PMDs on pgd_alloc().
69
70With everything in place you can set CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK.
71
72NOTE: pgtable_page_ctor() and pgtable_pmd_page_ctor() can fail -- it must
73be handled properly.
74
75page->ptl
76---------
77
78page->ptl is used to access split page table lock, where 'page' is struct
79page of page containing the table. It shares storage with page->private
80(and few other fields in union).
81
82To avoid increasing size of struct page and have best performance, we use a
83trick:
84 - if spinlock_t fits into long, we use page->ptr as spinlock, so we
85 can avoid indirect access and save a cache line.
86 - if size of spinlock_t is bigger then size of long, we use page->ptl as
87 pointer to spinlock_t and allocate it dynamically. This allows to use
88 split lock with enabled DEBUG_SPINLOCK or DEBUG_LOCK_ALLOC, but costs
89 one more cache line for indirect access;
90
91The spinlock_t allocated in pgtable_page_ctor() for PTE table and in
92pgtable_pmd_page_ctor() for PMD table.
93
94Please, never access page->ptl directly -- use appropriate helper.
diff --git a/Documentation/vm/zswap.txt b/Documentation/vm/zswap.txt
index 7e492d8aaeaf..00c3d31e7971 100644
--- a/Documentation/vm/zswap.txt
+++ b/Documentation/vm/zswap.txt
@@ -8,7 +8,7 @@ significant performance improvement if reads from the compressed cache are
8faster than reads from a swap device. 8faster than reads from a swap device.
9 9
10NOTE: Zswap is a new feature as of v3.11 and interacts heavily with memory 10NOTE: Zswap is a new feature as of v3.11 and interacts heavily with memory
11reclaim. This interaction has not be fully explored on the large set of 11reclaim. This interaction has not been fully explored on the large set of
12potential configurations and workloads that exist. For this reason, zswap 12potential configurations and workloads that exist. For this reason, zswap
13is a work in progress and should be considered experimental. 13is a work in progress and should be considered experimental.
14 14
@@ -23,7 +23,7 @@ Some potential benefits:
23    drastically reducing life-shortening writes. 23    drastically reducing life-shortening writes.
24 24
25Zswap evicts pages from compressed cache on an LRU basis to the backing swap 25Zswap evicts pages from compressed cache on an LRU basis to the backing swap
26device when the compressed pool reaches it size limit. This requirement had 26device when the compressed pool reaches its size limit. This requirement had
27been identified in prior community discussions. 27been identified in prior community discussions.
28 28
29To enabled zswap, the "enabled" attribute must be set to 1 at boot time. e.g. 29To enabled zswap, the "enabled" attribute must be set to 1 at boot time. e.g.
@@ -37,7 +37,7 @@ the backing swap device in the case that the compressed pool is full.
37 37
38Zswap makes use of zbud for the managing the compressed memory pool. Each 38Zswap makes use of zbud for the managing the compressed memory pool. Each
39allocation in zbud is not directly accessible by address. Rather, a handle is 39allocation in zbud is not directly accessible by address. Rather, a handle is
40return by the allocation routine and that handle must be mapped before being 40returned by the allocation routine and that handle must be mapped before being
41accessed. The compressed memory pool grows on demand and shrinks as compressed 41accessed. The compressed memory pool grows on demand and shrinks as compressed
42pages are freed. The pool is not preallocated. 42pages are freed. The pool is not preallocated.
43 43
@@ -56,7 +56,7 @@ in the swap_map goes to 0) the swap code calls the zswap invalidate function,
56via frontswap, to free the compressed entry. 56via frontswap, to free the compressed entry.
57 57
58Zswap seeks to be simple in its policies. Sysfs attributes allow for one user 58Zswap seeks to be simple in its policies. Sysfs attributes allow for one user
59controlled policies: 59controlled policy:
60* max_pool_percent - The maximum percentage of memory that the compressed 60* max_pool_percent - The maximum percentage of memory that the compressed
61 pool can occupy. 61 pool can occupy.
62 62