[rpi01] arm: Workaround potential hang in cpu_v6_do_idle

Entering WFI state with an outstanding instruction cache read in flight
can hang the ARM core, so you have to be very careful to preload the
region following the WFI into the cache before going to sleep. We do
this by going round a loop once with the mcr instructions conditionally
disabled before doing it for real.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
[SA: added explanation from https://github.com/raspberrypi/linux/issues/20]
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi01] arm: Add disable function for the SP804

The SP804 on the BCM2835 is yet another variant and isn't required
as there's another free running counter available.

Add a function to allow it to be disabled.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi01] bcm2708: Add BCM2708/BCM2835

Family: BCM2708
Model: BCM2835

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Signed-off-by: Dom Cobley <dc4@broadcom.com>
[SA: minimal version of mach]
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>

bcm2708: Fix UART code in mach/uncompress.h
bcm2708: fix mach/debug-macro.S so that early printk works

Note that you need to boot the compressed kernel (zImage) so that the
UART is configured at boot, or your kernel will hang when it tries to
access the UART.

Signed-off-by: Chris Boot <bootc@bootc.net>

bcm2835: Device tree

Interrupt controller, UART0 (AMBA PL011 serial console), UART1
(16550-like, unused), frame buffer display, etc.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Chris Boot <bootc@bootc.net>
[rpi02] bcm2708_wdog: Add watchdog

Variable timeout watchdog (1 to 16 seconds).

This is required to be able to reboot (using a 150us timeout).

[SA: registers and required values derived from Dom Cobley's kernel]
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi02] bcm-mbox: Add Broadcom VideoCore mailbox driver

Quite an interesting interface... with a very small message size

Registers and required values derived from Dom Cobley's kernel

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi02] bcm2708_fb: Add support for frame buffer display

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
[SA: reorganise to use device tree and bcm-mbox]
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi02] video: Add Raspberry Pi logo

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
[SA: use logo_rpi_clut224 instead of overwriting logo_linux_clut224]
Signed-off-by: Simon Arlott <sa.me.uk>
[rpi02] bcm-vc-power: Add Broadcom VideoCore power driver

Mailbox messages derived from Dom Cobley's kernel
Implementation created by testing with the device and
information from https://github.com/raspberrypi/linux/issues/23

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi02] pinctrl-bcm2708: Add pinctrl/pinmux support

TODO: pinconf support

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[CB: Rewrite including GPIO chip device]
Signed-off-by: Chris Boot <bootc@bootc.net>
[rpi02] spi-bcm2708: SPI driver for bcm2708

This is an SPI driver for the BCM2708 platform including the BCM2835 as
used in the Raspberry Pi.

Thanks to csoutreach / A Robinson for his driver which I used as an
inspiration. You can find his version here:

http://piface.openlx.org.uk/raspberry-pi-spi-kernel-driver-available-for

Signed-off-by: Chris Boot <bootc@bootc.net>
[rpi02] i2c-bcm2708: BCM2708 I2C driver

Signed-off-by: Chris Boot <bootc@bootc.net>
[rpi02] list: add list_last_entry

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi02] bcm2708_dma: Add Broadcom BCM2708 DMA engine driver

Supports MEMCPY, MEMSET, INTERRUPT, SLAVE, SG, CYCLIC, INTERLEAVE

The hardware can also do simple INTERLEAVE backwards in either
direction.

CACHE_LINE_SIZE and CACHE_LINE_MASK from Dom Cobley's kernel.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi02] sdhci-of-bcm2708: initial implementation supporting PIO mode only

bcm2708_sdhci_clock_delay derived from Dom Cobley's kernel.
Quirks determined by testing with the hardware.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi02] sdhci-of-bcm2708: add DMA support

Hardware behaviour (of needing to communicate as if PIO mode but then
do DMA) derived from Dom Cobley's kernel. Implementation determined by
testing with the hardware.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi03] amba-pl011: Don't send a character during startup

This causes a corrupted character to be sent and
there's no explanation for why it is required.

If it worked correctly it would send an extra 0x00
which isn't appropriate either.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi03] sdhci: don't use unlikely()

If CONFIG_MMC_SDHCI_IO_ACCESSORS is Y then it's actually
quite likely (but not guaranteed) that the host will use
these ops on every access.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi03] sd: report clock speed in SD card initialisation failure message

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
[rpi03] sd: don't use high speed mode if card initialisation keeps failing

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>