APPLIED: ARM: bcm2835: perf_event support for Raspberry-Pi

The following patch enables performance counter support on Raspberry-Pi.

We have this working on the 2708 based rasp-pi kernels by manually putting
the device registration in the platform files.

This change does things properly in a device tree.  The boot messages look
proper, but my rasp-pi hangs somewhere in USB enabling when running a
stock 3.13-rc6 kernel so I have been unable to fully test this change.

I also understand that the rasp-pi 1176 pmu support is missing the
overflow interrupt.  I'm not sure if that's true of all 2835
implementations.  If not, then this patch will need to be changed a bit.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
[swarren, fixed DT node sort order]
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
APPLIED: ARM: bcm2835: add dmaengine driver to device tree

This adds the definitions for the BCM2835 dmaengine driver
to the device tree. The dma-channel-mask is currently
fixed. Later it should be set via the firmware.

Signed-off-by: Florian Meier <florian.meier@koalo.de>
[swarren, fixed DT node sort order]
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
APPLIED: ARM: bcm2835: add I2S driver to device tree

This adds the definitions for the BCM2835 I2S driver
to the device tree. Some GPIO settings are needed for
the correct pin functions.

Signed-off-by: Florian Meier <florian.meier@koalo.de>
[swarren: fixed DT node sort order, simplified DT label name, removed
RPI .dts file changs, since use of I2S is a user-added option.]
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
APPLIED: ARM: bcm2835: fix DT node sort order

Re-order all the DT nodes so that they're ordered by their reg address.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
APPLIED: ARM: bcm2835: node name unit address cleanup

DT nodes that contain a reg property should include a unit address in
their name. Add the missing unit addresses.

The unit address in a node name must match the value in the reg property.
Fix the cases where they don't match.

Don't fix the /clocks/* node names yet; that causes problems the clock
driver to attempt to register multiple clocks with the same name, which
fails.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
v2:
* Fix existing mismatching unit addresses.
* Don't touch the /clocks/* nodes.
clk: fixed-rate: use full DT node name

clk-fixed-rate currently names clocks according to a node's name without
the unit address. When faced with the legal and technically correct DT
structure below, this causes rgistration attempts for 3 clocks with the
same name, 2 of which fail.

	clocks {
		compatible = "simple-bus";
		#address-cells = <1>;
		#size-cells = <0>;

		clk_mmc: clock@0 {
			compatible = "fixed-clock";
			reg = <0>;
...
		clk_i2c: clock@1 {
			compatible = "fixed-clock";
			reg = <1>;
...
		clk_spi: clock@2 {
			compatible = "fixed-clock";
			reg = <2>;
...

Solve this by naming the clocks after the full node name rather than the
short version (e.g. /clocks/clock@0).

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
Note that if this is accepted, I intend to submit a patch for the RPi DTS
which uses the naming structure above, so it might be useful to place this
patch in its own branch. Or, I could submit the cleanup after 3.15-rc1.
ARM: bcm2835: fix clock DT node names

DT nodes should be named according to the type of object that they
represent rather than the identity. DT nodes that contain a reg
property should include a unit address in their name. Fix these issues.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
This is the bcm2835 patch which depends on patch 1. I guess this could
also go through the clk tree if that makes it easier, although there's
always the small risk of conflicts if you do that.
LOCAL: ARM: bcm2835: enable USB debugging

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
LOCAL HACK: ARM: bcm2835: enable enc28j60 SPI device

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
LOCAL HACK: Add TSL2563 to device tree

Notes:
* i2c-bcm2835.c change already sent as:
  [PATCH] I2C: BCM2835: Linking platform nodes to adapter nodes
* Clean TSL driver changes already sent as:
  [PATCHv2] iio:light:tsl2563: Add DT support
* Everything else is a local hack