ARM: EDMA: Fix clearing of unused list for DT DMA resources

HWMOD removal for MMC is breaking edma_start as the events are being manually
triggered due to unused channel list not being clear.

The above issue is fixed by reading the "dmas" property from the DT node if it
exists and clearing the bits in the unused channel list if the dma controller
used by any device is EDMA. For this purpose we use the of_* helpers to parse
the arguments in the dmas phandle list.

Also introduced is a minor clean up of a checkpatch error in old code.

Reviewed-by: Sekhar Nori <nsekhar@ti.com>
Reported-by: Balaji T K <balajitk@ti.com>
Cc: Pantel Antoniou <panto@antoniou-consulting.com>
Signed-off-by: Joel Fernandes <joelf@ti.com>
[Applied base patches]
dma: edma: Split out PaRAM set calculations into its own function

PaRAM set calculation is abstracted into its own function to
enable better reuse for other DMA cases such as cyclic. We adapt
the Slave SG case to use the new function.

This provides a much cleaner abstraction to the internals of the
PaRAM set. However, any PaRAM attributes that are not common to
all DMA types must be set separately such as setting of interrupts.
This function takes care of the most-common attributes.

Also added comments clarifying A-sync case calculations.

Signed-off-by: Joel Fernandes <joelf@ti.com>
dma: edma: Add support for Cyclic DMA

Using the PaRAM configuration function that we split for reuse by the
different DMA types, we implement Cyclic DMA support.
For the cyclic case, we pass different configuration parameters to this
function, and handle all the Cyclic-specific functionality separately.

Callbacks to the DMA users are handled using vchan_cyclic_callback in
the virt-dma layer. Linking is handled the same way as the slave SG case
except for the last slot where we link it back to the first one in a
cyclic fashion.

For continuity, we check for cases where no.of periods is great than the
MAX number of slots the driver can allocate for a particular descriptor
and error out on such cases.

Signed-off-by: Joel Fernandes <joelf@ti.com>
dma: edma: Increase maximum SG limit to 20

davinci-pcm uses 16 as the no.of periods. With this, in EDMA we have to
allocate atleast 17 slots: 1 slot for channel, and 16 slots the periods.

Due to this, the MAX_NR_SG limitation causes problems, set it to 20 to make
cyclic DMA work when davinci-pcm is converted to use DMA Engine.

Signed-off-by: Joel Fernandes <joelf@ti.com>
dma: edma: Add DMA memcpy support

Signed-off-by: Joel Fernandes <joelf@ti.com>
[Applied dma patches]
omap4: hwmod: Add hwmod data for aes1 crypto module

    Crypto modules AES0/1 belong to:
       PD_L4_PER power domain
       CD_L4_SEC clock domain
       On the L3, the AES modules are mapped to
       L3_CLK2: Peripherals and multimedia sub clock domain

We add hwmod data for the same.

Signed-off-by: Joel Fernandes <joelf@ti.com>
omap4: hwmod: add hwmod data for DES3DES

Signed-off-by: Joel Fernandes <joelf@ti.com>
crypto: omap-des: Add omap-des driver for OMAP4/AM43xx

Add omap-des driver with platform data for OMAP4. Support added for DES
ECB and CBC modes.

Where possible, code is reused from omap-aes driver with changes made for
adjusting key size, block size, removing non-existent encryption modes
and adding support for OMAP4 platform data and offsets.

Tests have been conducted with the CRYPTO test manager, and functionality
is verified at different page length alignments.

Signed-off-by: Joel Fernandes <joelf@ti.com>
crypto: omap-des: Add config and build options

Add config and build options for the newly added omap-des driver.

Signed-off-by: Joel Fernandes <joelf@ti.com>
crypto: omap-des: Add triple DES (des3_ede) support to driver

OMAP DES module supports 3DES operation where 3 64-bit keys are used to
perform a DES encrypt-decrypt-encrypt (ede) operation on a buffer.

v2 changes:
Address review comments from Rajendra at: https://lkml.org/lkml/2013/8/30/116

Signed-off-by: Joel Fernandes <joelf@ti.com>
[Applied crypto patches]
omap4: dts: Add node for AES

OMAP4 has an AES module that uses the omap-aes crypto driver.
Add DT entries for the same.

Signed-off-by: Joel Fernandes <joelf@ti.com>
omap4: dts: Add node for DES3DES module

OMAP4 has an DES3DES  module that uses the omap-des crypto driver.
Add DT entries for the same.

Signed-off-by: Joel Fernandes <joelf@ti.com>
ARM: dts: Add SHAM data and documentation for AM33XX

Add the generic AM33XX SHAM module's device tree data and
enable it for the am335x-evm, am335x-evmsk, and am335x-bone
platforms.  Also add Documentation file describing the data
for the SHAM module.

CC: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
ARM: dts: Add AES data and documentation for AM33XX

Add the generic AM33XX AES module's device tree data and
enable it for the am335x-evm, am335x-evmsk, and am335x-bone
platforms.  Also add Documentation file describing the data
for the AES module.

CC: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
am33xx: dts: Fix AES interrupt number

Signed-off-by: Joel Fernandes <joelf@ti.com>
ARM: am437x: dts: Add AES node for am437x

AM437x SoC has AES module similar to the one on OMAP4.
Add DT node for the same.

Signed-off-by: Joel Fernandes <joelf@ti.com>
ARM: am437x: dts: Add DES node for am437x

AM437x SoC has a DES3DES module similar to the one on OMAP4.
Add DT node for the same.

Signed-off-by: Joel Fernandes <joelf@ti.com>