clockevent: sun4i: Fill the irq field in the clockevent structure

The clock event structure irq field was not filled previously to the
interrupt we're using.

This was resulting in the timer not being used at all when using a
configuration with SMP enabled on a system with several CPUs, and with
the cpumask set to the cpu_possible_mask.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
clocksource: sun4i: change CPU mask to cpu_possible_mask

The interrupt for the timer is a shared processor interrupt, so any CPU
found in the system can handle it. Switch to our cpumask to
cpu_possible_mask instead of cpumask_of(0).

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Add smp support for Allwinner A20(sunxi 7i).

This patch adds SMP support for the Allwinner A20 SoC. This SoC uses an IP to, among other things, handle the CPU-related configuration, like the power clamp, the boot address of the secondary CPUS, etc. We thus need to map this IP during the prepare_cpu SMP operation, before bringing up the secondary CPU in the secondary_startup operation.

Signed-off-by: Fan Rong <cinifr@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Add cpuconfig nodes in dts for smp configure.

Cpu Configure regiser can be used for reset and boot smp cpus in allwiner's A20.

Signed-off-by: Fan Rong <cinifr@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
ARM: sunxi: dts: fix cubietruck sata power pin

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: UGLY UGLY hack to use the arch timers

The current sunxi-uboot does not properly setup the arch timers (making
their virtual part not usable). This UGLY UGLY patch hacks around this, this
is just a quick hack to see how having better timers helps some other things.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi-mci: Add driver for SD/MMC hosts found within Allwinner A1X SoCs

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi-mci: Implement GPIO polling and correct clock handling

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi-mci: use clk_sunxi_mmc_phase_control from sunxi-clk driver

Instead of a private copy.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi-mci: Add a few missing register writes / value from the android code

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi-mci: Cleanup error logging

Don't log error on timeout of opcodes for which a timeout is normal when
using an sd / mmc card. Remove double logging of some errors, and move
logging of data direction to dump_err().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi-mci: Remove not-needed and not-working sunxi_mmc_wait_access_done()

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi-mmc: Remove dead code / vars

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi-mci: Don't mix dma_alloc_writecombine with free_coherent

Use the less exotic (and correct on older ARM cpu cores) dma_alloc_coherent,
note this makes no different on ARMv7.

Also pass in our device pointer to the dma functions, instead of NULL.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi-mci: Get regulator first

Getting the regulator may cause our probing to be deferred, so do it first,
otherwise we may end up calling things like clk_get multiple times until
we succeed, leaking references.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi-mci: Properly set caps

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi-mci: Turn on IDMA controller after all setup is done

Specifically set the interrupt mask, and the segment list address before
turning it on. Note the code for setting the segment list address is moved
to a different function entirely, as that needs to be done only once.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi: dts: Add SD/MMC 0 host device for Allwinner A20

HdG:
Changed drive strength for the mmc / sdio pins from 0 to 3, this is necessary
to make high frequency sdcard/sdio modes work reliable.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi: dts: Enabe MMC 0 for CubieBoard2

HdG:
Dropped the unneeded "reg = <0>;" and related parts from the vcc_3v3_reg
section.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi: dts: Enable MMC 0 on the cubietruck

Signed-off-by: Hans de Goede <hdegoede@redhat.com>