Input: atmel_tsadcc: fix compilation as a module

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Change internal SRAM memory type to "MT_MEMORY_SO"

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Change the internal SRAM memory type MT_MEMORY_NONCACHED

Because MT_DEVICE is not executable in armv7, we change
the the internal SRAM memory type to MT_MEMORY_SO as commit
5fe012d4aee98ef82df66e6763882c735902ed0f,
but MT_MEMORY_SO is strongly ordered, this feature is not required
for the internal SRAM memory.

So we change the internal SRAM memory type to MT_MEMORY_NONCACHED.
As it seems that caching this internal SRAM memory is not necessary,
we chose the this memory type.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
pm/ddr: make ddr-sdram enter self refresh mode when excuting pm and cpuidle

Change the implementation of function to be used on other boards with ddr-sdram.

inline void at91sam9g45_standby(void)
==>
inline void at91sam_ddr_standby(unsigned int bank)

Add support to at91sam9x5ek, at91sam9n12ek

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
pm/sama5d3: add pm support for sama5d3xek

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
pm: disable UPLL when excuting PM

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
mmc: atmel-mci: pio hang on block errors

The driver is doing, by default, multi-block reads. When a block error
occurs, card/block.c instigates a single block read: "mmcblk0: retrying
using single block read".  It leaves the sg chain intact and just changes
the length attribute for the first sg entry and the overall sg_len
parameter.  When atmci_read_data_pio is called to read the single block
of data it ignores the sg_len and expects to read more than 512 bytes as
it sees there are multiple items in the sg list. No more data comes as
the controller has only been commanded to get one block.

Signed-off-by: Terry Barnaby <terry@beam.ltd.uk>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: stable <stable@vger.kernel.org> # 3.2+
Signed-off-by: Chris Ball <cjb@laptop.org>
dmaengine: at_hdmac: fix race condition in atc_advance_work()

The BUG_ON() directive is triggered probably due to a latency
modification following inclusion of commit c10d73671ad3 ("softirq:
reduce latencies").  This condition has not been met before 3.9-rc1 and
doesn't trigger without this patch.

We now make sure that DMA channel is idle before calling
atc_complete_all() which makes the BUG_ON() "protection" useless.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ARM: at91: add LUT entry to at91sam9g45 resources

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
ARM: at91/DT: at91sam9x5ek: fix USB host property to enable port C

Device Tree "num-ports" property of USB host node has to be
set to maximum number of ports available.
The possibility to activate a particular port is done by specifying the proper
gpio configuration for its vbus.

This patch fixes the USB host node by configuring the 3 ports available on the
product and letting "port A" available for USB gadget usage.

Reported-by: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Bo Shen <voice.shen@atmel.com>

Conflicts:
	arch/arm/boot/dts/at91sam9x5ek.dtsi
sama5d3: make the led D2 as heartbeat.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
sama5d33ek: enable led D3

Signed-off-by: Josh Wu <josh.wu@atmel.com>
serial: at91: distinguish usart and uart

Distinguish usart and uart by read ip name register,
The usart read name is USAR,
The uart and dbgu read name is DBGU.

Signed-off-by: Elen Song <elen.song@atmel.com>
serial: at91: make UART support dma and pdc transfers

Because the UART lack of receive timeout register, so we use a timer to trigger
data receive.
The DBGU is regarded as UART.

Signed-off-by: Elen Song <elen.song@atmel.com>
ARM: at91: dts: add all serial dma configurations for sama5d3x

Signed-off-by: Elen Song <elen.song@atmel.com>
ARM: at91: add missing uart clocks DT entries for sama5d3

Add clocks to clock lookup table for uart DT entries.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
mtd: atmel_nand: pmecc: fix bug fail to correct bit error in 1024-bytes sector

The PMECC use BCH algorithm to correct error. In BCH algorithm, the primitive
polynomial value is GF(2^13) for 512-bytes sector size. And it is GF(2^14) for
1024-bytes sector size.

This patch will choose correct degree of the remainders(13 or 14) for
different sector size.
Tested in AT91SAM9X5-EK with MLC nand flash.

More detail can be refered to section 5.4.1 of:
  AT91SAM ARM-based Embedded MPU Application Note
  <http://www.atmel.com/Images/doc11127.pdf>

Signed-off-by: Josh Wu <josh.wu@atmel.com>
sama5d3: add sama5d36 chip id and name.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
sama5d36: reigster perriperal clock for sama5d36 cpu

Signed-off-by: Josh Wu <josh.wu@atmel.com>
sama5d36: add d36 dts, which is D35 + lcd.

Signed-off-by: Josh Wu <josh.wu@atmel.com>