Commit Graph

858 Commits

Author SHA1 Message Date
Mona Hossain fe0ab0ccc9 crypto: msm: Verify source and destination data lengths
Check to confirm the sum of length of the source
and destination segments is equal to the total length
sent by client.

Change-Id: Ib10b8f792591631060135022d81f1f08c424ee66
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-23 10:56:29 -07:00
Mona Hossain fc804beeb7 crypto: msm: Check destination buffer write access
Use VERIFY_WRITE to check write access to destination buffers
before writing to them.

Change-Id: If9708695e85659bb25e13762c54dd50abd9577c7
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-23 10:27:44 -07:00
Linux Build Service Account b8b19e0caf Merge "crypto: Kconfig: fsm9900: Add Hardware crypto module." 2013-09-19 07:07:50 -07:00
Rohit Vaswani aaa958ef05 crypto: Kconfig: fsm9900: Add Hardware crypto module.
Add hardware crypto module for fsm9900 target.

Change-Id: I60c922bbf9156df96232d789d771d3433c85aefe
Acked-by: Kaushik Sikdar <ksikdar@qti.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2013-09-18 14:57:34 -07:00
Zhen Kong 87a63da5d9 crypto: msm: multiple qcrypto support
This patch provides support for multiple qcrypto devices
with the qcrypto driver.

Change-Id: I36b0a802dcf92a438353f5961fab0bfddc53268a
Acked-by: Chemin Hsieh <cheminh@qti.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2013-09-12 14:48:54 -07:00
Zhen Kong b2b91ba5d5 crypto: msm: fix issues in ce clock disable processing
In the situation of more than one requests, the ce clock may get
errorneously disabled even when there are active requests. The
scaling operation is then modified to fix the problem and ensure
all requests are completed when disable the clock. We also clean
up the related codes.

Change-Id: Icc4675fa7b3818f6f8befb513b56d9ae051b98de
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2013-09-12 14:48:22 -07:00
Mona Hossain 1152424d0e crypto: msm: Add support for setting XTS data unit size
Based on the context flags set by client, set XTS_DU_SIZE
register to sector size of 1KB, or the actual total length
of the packet.

Change-Id: Id461a27013f99301c3ca9e714f397f33c3f6ba03
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 17:28:15 -07:00
Mona Hossain ac940280b2 crypto: msm: Handle error case
Release memory and disable clk when sps_init fails.

Change-Id: I3bfb11e7b7d7584e7d64afbbd3475d809fa720ad
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 17:21:03 -07:00
Mona Hossain e76994652b crypto: msm: Fix Uninitialized flags
Due to uninitialized "flags" field in the request structure,
incorrect choices are made in the qce driver layer with
regards to setting crypto hardware registers.

Initializing the flags fixes this incorrect setting of the
registers.

Change-Id: Ic40319ea5e15e66cbafd28f727a9bcc6ea41b1ca
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 17:19:27 -07:00
Rohit Vaswani 6c443b0101 crypto: msm: multiple qce50 support
In some platforms such as fsm9900, multiple instances of qce50 hw
may be supported.  Each qce50 HW has an ndp-bam. Each qce50 HW
can support multiple instances of qce_dev platform device.
Each qce_dev has its own configured pipe set and associated qce50 HW,
defined by crypto-base and bam-pipe-pair fields in the device tree files.
This patch based on io address, it decides to create a new qce50 hw
instance or use the existing known instance at device probe time.

Furthermore, this patch does iomap for only once for each HW BAM instance
to avoid issue with bam driver. If modprobe, and rmmod of qcedev,
and qcrypto are not in first in last out order, kernel may crash in
bam driver in the last rmmod.
This saves virtual space for IO if multiple instances of qcedev
share the same instance of HW BAM.

Change-Id: I1565b1976981b0512832ff793e0adb29c4be3ccc
Acked-by: Chemin Hsieh <cheminh@qti.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2013-09-04 17:19:07 -07:00
Zhen Kong 87b049525f crypto: msm: optimize ce bandwith scaling
Encryption processing at qcrypto driver includes three main steps:
set ce high bandwidth and enable ce clock in cra_init, then send
encrytion request, and at last set ce low bandwidth and disable
clock in cra_exit. This process is fine for the use case where
there are lots of requests between cra_init and cra_exit, but will
introduce large overhead for mmc layer disk encryption as it calls
cra_init, queue request and cra_exit for every encryption request.

It is not necessary to set low bandwidth and disable clock for every
encrypt request when it is completed. So we delay these scaling down
tasks for a while, and just scale down the last request when timer
expires so as to amortize and decrease the overhead.

Change-Id: I6a59066343f01950b66f4e886d40a9f27ce211c3
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2013-09-04 17:17:20 -07:00
Mona Hossain 80c42643a4 crypto: msm: Remove check for minor and step version
The only version that needs verifiation is major version to ensure
HW CE 5.0 is being used.  Minor and step versions checks are not
needed to gate driver loading.

Change-Id: I2052f511f3f2286da78a9c8d4ccf9803fbd6f204
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 17:12:15 -07:00
Rohit Vaswani 87cbf16b0c crypto: msm: fix aead combined mode decipher problem
Fix -EBADMSG error for crypto 5.1 and above for aead decipher.
bam dma input/output length should include asso data plus iv plus crypto
data, and excluding MAC result for deciphering.

Change-Id: I0aaa666dbe96185cf0a81a542b3df02d4f6ebf88
Acked-by: Chemin Hsieh <cheminh@qti.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2013-09-04 17:10:46 -07:00
Zhen Kong 4a634b9473 crypto: msm: set ce_shared flag as zero when using BAM HW
CE HW sharing is not supported when BAM hardware is used, so
we need to set the corresponding ce_shared flag as zero in
qcedev_probe().

Change-Id: I28f0cb9c453a473970742f80fc16379ec7183771
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2013-09-04 17:09:42 -07:00
Hariprasad Dhalinarasimha 0e52a88e4f crypto: msm: Add support for aead
Add support for aead mode algorithms (simultaneous auth
and cipher operations)

Change-Id: I22cc530f8fe822504649cb3c60030a729e1305c2
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-04 17:00:12 -07:00
Zhen Kong fa24bfa7b5 crypto: msm: check NULL pointer in _qcrypto_setkey_des()
add NULL pointer check before des_ekey()

Change-Id: I57c40b82fc5141c1666c3fd493b43e962f0d1ae9
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2013-09-04 16:59:06 -07:00
Mona Hossain 53fc568f48 crypto: msm: Designate memory chunk for ignore_buffer
Memory was not assigned to ignore_buffer pointer and uninitialized
pointer was being used.

Change-Id: Ie7c372aeafdfe17b9bb70d38666fa81c3df1e043
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:53:29 -07:00
Mona Hossain cb825b4508 crypto: msm: Process keydata for HW/PIPE key use case
When client sets HW_KEY flag, driver should ignore key data
and length when client issues set_key request.
When client sets PIPE_KEY flag, driver should ignore key data.

Change-Id: I550d1d2a217e6b9c9de50064bfafe72f9f32e6e1
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:50:03 -07:00
Mona Hossain 040b3e2b8d crypto: msm: Add support for setting ctx flags
Currently there is no way of instructing the crypto driver
to use HW specific capabilities. The kernel crypto framework
does not expose any API to set any specific HW feature flags:
ex: use of HW key,  use of PIPE keys, setting XTS data unit
size.

The driver currently uses a specific key pattern to decide
when to instruct HW to use HW_KEY (uses key pattern of all
zeros) and when to use PIPE_KEY (uses key pattern of all 0xF's).
This limits the use of the specific key pattern from ever being
used for any crypto operation.

Adding support for crypto client to set flags to indicate when
to use HW KEY, PIPE KEY, size removes the limitation on the key
patterns that can be used by the driver.

Adding XTS data unit size flags allows the client to take
advantage of the hardware capability to set data unit size
for XTS operations.

Change-Id: I0d1417a6d3c990e0750dbd90e3816f45fec8d693
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:48:53 -07:00
Hariprasad Dhalinarasimha e1ecd2afa4 crypto: msm: Add support to register BAM in satellite mode.
There exist scenarios on some platforms where the same CE HW used in
crypto driver is shared with the crypto driver in secure execution
environment. In these case, crypto BAM is set to operate in master
mode by secure EE. Hence it needs to be registered to operate in
satellite mode by HLOS crypto driver.

Change-Id: Ibc5e06aac09c53dd6e1b419b871d9da3f82ab63d
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-04 16:47:58 -07:00
Mona Hossain ce0509bb16 crypto: msm: Add support_hw_key flag
Add support_hw_key, hw_key flag to indicate if use of
HW KEY is supported by the driver.

Change-Id: If7976f5891afa211631597b8dab93ff17f0fa5c5
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:47:09 -07:00
Rohit Vaswani fe953c98bb crypto: msm: ota: multiple ota devices support.
This patch provides multiple hw devices support for ota crypto driver.
The driver dynamically allocates hardware resources for each ota crypto
operations. Further more, the stat structure in the driver
is changed to support device tree.

Change-Id: I701fe08ecc51f53ddbe6e2b76b2fb65ab79190d2
Acked-by: Chemin Hsieh <cheminh@qti.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2013-09-04 16:45:45 -07:00
Hariprasad Dhalinarasimha 42b3dedd9d crypto: Kconfig: 8610: Add Hardware crypto module.
Add hardware crypto module for 8610 target.

Change-Id: I15733e6569c78c20ec629a5031f9744286349811
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-04 16:42:37 -07:00
Hariprasad Dhalinarasimha 0abb17a850 crypto:msm: Remove hardware sharing check.
CRYPTO clocks has to be enabled regardless of hardware sharing,
hence remove the hardware sharing check.

Change-Id: I551e8a97768e0526783a6ccfe9a214f1a9de148e
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-04 16:41:22 -07:00
Mona Hossain 556f5e9d5f crypto: msm: Add failure logs
When SPS driver reports a failure to process a request,
we need to output the sps_iovec_contents that was issued
to the SPS driver.

Change-Id: I84d48880cade41e5b9ce652f4dba1a84b857fb72
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:40:27 -07:00
Mona Hossain b33fe9a9c7 crypto: msm: Check for invalid byte offset field
There is potential for HEAP corruption when the
byte offset field is set to a huge value.

Change-Id: Idd851cf3ec57627aba7d8250914cd18ccdd697ec
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:40:13 -07:00
Hariprasad Dhalinarasimha d42142435a crypto:msm: Fix crypto 5 aes(ccm) issue.
This patch handles the operation completion status
during the completion of a crypto operation properly.
The crypto device status register is clear at the beginning of
each operation.

Change-Id: I54e38160c939c17fe58ebdce44f8080b3837e3e7
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-04 16:36:32 -07:00
Hariprasad Dhalinarasimha 4397fb00d2 crypto: msm: Fix handling of AES CCM error
AES-CCM error does not report proper status to qcrypto driver.
If prior operation AES CCM operation has an error, (ex: MAC_FAILED),
it never gets cleared. Subsequent operation will report the same bit
error. Fix is to clear the status register before firing off an
operation

Further more, any AES-CCM error due to MAC failed is not logged
properly. Add aead_msg_fail if aead opearation is fine, but MAC
comparison fails the integrity checking.

Change-Id: Id9057a0f3fdf0be0b4e09185ae3a31d52ffd9c01
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-04 16:34:11 -07:00
Mona Hossain 450a3e95d1 crypto: msm: Fix AES-CCM failure
For decrypt operation AUTH_POS bit is set incorrectly to 0x02
resulting in the authentication being done before decryption.
For decryption, the AUTH_POS field should be configured to 0x1
(or 0x3) to ensure authentication is occurring after decryption.

Change-Id: Ieaf10a653c6e77994c285e573d7fd787634631a2
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:30:41 -07:00
Mona Hossain 55e1694921 crypto: msm: Fix issue of crypto driver referencing pdev->id
On platform that use device tree to pass board or architecture
specific information rather than via platform device structure,
the id field of platform_device structure is no longer valid.
It was used to identify different instance of Crypto engine.
With device tree, this is set to -1.

The crypto driver modules (qcrypto and qcedev) refers to pdev->id
mostly to update statistics counters. With invalid pdev->id,
the counter does not increment, and would corrupt memory as it
update counters in _qcrypto_stat[-1] and _qcedev_stat[-1].

This patch removes all reference to pdev->id.

Change-Id: Ia8723c6eb5e91806223696efb1bf1a480ff2d831
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:29:59 -07:00
Mona Hossain ad72a7116b crypto: msm: Replace sg API with scatterwalk_sg_ API
replace  sg_copy_to_buffer(), and sg_copy_from_buffer()
in crypto driver with version that uses scatterwalk_sg_next
to traverse the sg list.

After setting up an IPsec tunnel with DES-CBC encryption and HMAC-SHA1
authentication, following messages were displayed while running a few ping
packets.

[ 121.773780] bytes copied=0x8 bytes to copy= 0x58
[ 122.781008] bytes copied=0x8 bytes to copy= 0x58
[ 123.781113] bytes copied=0x8 bytes to copy= 0x58
[ 124.781175] bytes copied=0x8 bytes to copy= 0x58

This kind of messages are displayed when sg_copy_to_buffer() or
sg_copy_from_buffer() fail to copy entire data. They were able to
copy only part of it.

This happens because sg_copy_to_buffer() and sg_copy_from_buffer()
do not recognize scatter-buffer buffer used in Crypto. It needs to
use scatterwalk APIs to traverse the scatter-buffer list.

To address this issue, qcrypto_copy_from_buffer() and
qcrypto_copy_to_buffer() functions are newly added. These are similar
to sg_copy_to_buffer() and sg_copy_from_buffer(), but they understand
the scatter-gather list used in Linux crypto subsystem.

Change-Id: I71167e7e56aee8ddaa405f30a3f9f5dab426e6c8
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:29:57 -07:00
Mona Hossain 231e9eb3eb crypto: msm: Fix failure in qce_close
CE clk needs to be enabled when invoking sps_exit.  Further
more, memory allocated for pipe FIFOs should not be de-allocated
before calling sps_exit, as it is still referenced in sps_exit.

Change-Id: I66cbd7d92ed7ad74d5b4eca23fe3a327501b2e1b
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:29:56 -07:00
Mona Hossain f045b5a904 crypto: msm: Fix kmalloc() with GFP_KERNEL flag issue in irq.
There exists scenarios where packet processing is done in softirq
which runs in interrupt context. Blocking call is not allowed in
interrupt context. The qcrypto driver tries to allocate memory in
several places, and some of them were done in interrupt context.

In some cases, to meet the alignment requirement of some versions
of Crypto5 engine, _copy_source() is called that  make a copy of
the data. This calls kmalloc() with GFP_KERNEL flag. This flag cannot
be used in interrupt context since the caller may get blocked until
the kernel finds requested memory.

To avoid this, all the memory allocation requests in interrupt context
were changed to use GFP_ATOMIC flag instead.

Change-Id: I3b86af00f3d7737c38b94e748ae083f58576dda5
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:29:13 -07:00
Mona Hossain 72701916bb crypto: msm: Fix HW register addresses
Mismatch of qce50 HW definitions in include file and SWI.

Change-Id: Ic5a01588841b8d245ac9fbea333d019b3ed1e937
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:28:48 -07:00
Mona Hossain a189f170b5 crypto: msm: Fix driver crash when running AES-CBC decryption
The cause of the crash is due to uninitialized variable "areq" used in
ablk_cipher_req().

When the areq is pulled from pce_dev->areq, it is not valid and is
uninitialized. Since we already have the valid pointer to areq from
qce_req structure, we do not need to redefine areq.

Change-Id: Ib63ec65dc9df5f87ff470c04cfe5fbb66c19199a
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:28:46 -07:00
Mona Hossain c885b8f48b crypto: msm: Fix configuration when using CD
Add support to determine when to use command descriptor (CD)
based on register settings and set flag to indicate BAM
global device control is managed remotely. This configuration
is used when the device does not support accessing CE HW
registers using BAM command descriptors (HW registers are
not managed locally by BAM).

Change-Id: Ic3195db03ecc73e98b7dd3407ccc5402e703b362
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:27:40 -07:00
Mona Hossain 02643c8fa2 crypto: msm: Add checks for input parameters
Add checks for incorrect inputs for hash and cipher
operation.  Add error logs for incorrect input parameters.

Change-Id: Ifced6a3388621fd2b051e06de8f02d36636f2ebb
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:26:54 -07:00
Mona Hossain 6c22ed0626 crypto: msm: Optimize CE setup
Use previously configured register setting instead of
determining what bits needs to be set per operation.

Change-Id: Ie22c0ce4dd5ca14b030ec8ad6feaaf511535b145
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:26:53 -07:00
Mona Hossain 40e0b67640 crypto: msm: Configure CE HW register directly
Some chipsets that support CE 5.0 HW does not support
setting CE HW registers via BAM command element/descriptors.
These registers need to be set directly.

This patch adds support to configure CE HW registers directly
without using BAM consumer pipe.

Change-Id: I0707fcd5bf132c9462b8c6a30f6f7d8f8dd6fd86
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:26:52 -07:00
Hariprasad Dhalinarasimha 4a20000f7b crypto: Kconfig: 8x26: Add Hardware crypto module.
Add hardware crypto module for 8x26 target.

Change-Id: If42de3968d4fbe8920f1334e4d633c942118a000
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-04 16:25:24 -07:00
Mona Hossain ae3ff92b6a crypto: msm: Remove consumer pipe callback
Remove registration of call back function and the call back
function for consumer pipe operation.

The callback  does not do anything significant but
add to the latency per operation.

Change-Id: Id272a1311e2c3e2872091b599ac40f590fb9b0f7
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:23:30 -07:00
Mona Hossain d89cf413e5 crypto: msm: Increase max num of descriptors
There exist scenarios where memory gets corrupted due
to the limitation on the number of descriptors that
can fit into the PIPE descriptor FIFO.

The fix is to increase the max number of descriptor by
128 (to 0x500).

Change-Id: I770374043ad11cf320ca1bec1f00840b10b86218
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:22:37 -07:00
Mona Hossain 1a8cd7ed5e crypto: msm: Add support for clk scaling and gating
Add support for enabling clk before initiating crypto
operation and disabling clk after all crypto operations
are complete.
Expose qce_clk_enable() and qce_clk_disable() APIs for
qce clients (qcedev and qcrypto).
Add clk scaling and gating in the qcedev and qcrypto
driver modules.

Change-Id: I6ab96f6b62f2401bf721483448601d52af1be19e
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:22:34 -07:00
Mona Hossain 4b8ba2de84 crypto: msm: Check for valid key length for HMAC operation
Check to ensure keylength is valid for HMAC operation.

Change-Id: I7f0075cad2dc1f011e32309b3e96641cfc4dcd9e
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:20:22 -07:00
Mona Hossain 8a5b4b483a crypto: msm: Fix failure to process AES-XTS 256 key
For AES-XTS 256 mode, key size is 64 bytes (twice the
AES key size of 32 bytes).  The driver  only checks for
AES key size and not specifically for xts key size.
The driver checks for AES key size and return a failure
for AES XTS 256 where key size is 64 bytes

Fix is to check for valid keys for XTS algorithm.

Change-Id: Ia7bafa5b5c13eab018a2e1d729a82c8d329a092e
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:19:52 -07:00
Mona Hossain 37fa11ad93 crypto: msm: Fix failure in XTS operation
When using PIPE keys, the XTS_DU_SIZE register is hardcoded to
512 Bytes.  For transfers that are smaller than 512 bytes,
the crypto operation hangs waiting for more data.

The fix is to set XTS_DU_SIZE to minimum of packet size and 512
bytes.

Change-Id: I0dea9fadc71c599df700c1431f793e7cbb9997b0
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:18:56 -07:00
Mona Hossain c98741cca8 crypto: msm: Fix size of descriptor buffer
When the number of entries in the scatter gather list is larger
than 64, crypto operation fail.  This is due to incorrect use
of macro to allocate memory for the descriptor size.

Fix is to replace use of QCE_SIZE_BAM_DSCR with the size of the
sps_iovec data structure. Further, more use the correct macro when
reporting the size of the descriptor to BAM.

Change-Id: I4396ad8407b6b91d7a34367a2777cb920f81457b
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:18:11 -07:00
Mona Hossain c4b665b6b8 crypto: msm: Fix XO shutdown issues
ce-core_src clk is being left on preventing device from going
into low power mode. Furthere more, clks are enabled without
checking if the handle is valid.
This fix removes enabling of ce_crore_src_clk. Also checks if
clk handle is valid before enabling them.

Change-Id: Ieb64b4b11385838ba18dd05d47ccc978e5b1bdf1
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:14:05 -07:00
Mona Hossain 003d24ff32 crypto: msm: Refactor/clean-up clock code
Add clk enable/disable and init/deinit APIs.
These APIs will be used in future to allow clk scaling and
gating by clients.

Change-Id: I08503972b9ed77633e14d81711aa92c61df7a0ad
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:13:19 -07:00
Mona Hossain 9fea93c8bd crypto: msm: Add support for using PIPE keys
Based on the encryption key value, check if the request
requires using the PIPE keys. If so, set appropriate
configuration registers to indicate to HW to use PIPE keys.

Change-Id: I8ddf6c7b372dc63479e1bd105bbcb8c127ff1513
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:12:24 -07:00
Mona Hossain 417243db5d crypto: msm: Fix stress test failure
Stress test case scenarios involving a cipher operation for a large
packet (> 32KB) followed by a hash operation (of any data packet size)
fails, with the hash operation hanging.

The failure is due to the sps driver invoking the incorrect callback
for the subsequent hash operation. Instead of invoking the registered
hash operation callback,  it  invokes the previously registered cipher
operation callback.

The fix is to set the correct flag bits for the event when registering
the callback before invoking sps_register_event() and also removing
the SPS_EOT_EVENT flag when registering the sps_connect pipe information.

Change-Id: Ia9ef774e2900df61f18298349fb4b5f4dc4d34b2
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:11:42 -07:00
Mona Hossain ec1787b46a crypto: msm: Set the shared field of ce_hw_support data structure
Add the "shared" field in the ce_hw_support data structure.
This field indicates if the crypto HW used by the HLOS crypto
driver is being shared across multiple execution environment(s).

Change-Id: Ie8038c6bc7268dab2353f3a7f24b59d37aad2bb8
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:11:16 -07:00
Mona Hossain c914a25f88 crypto: msm: Remove incorrect flag settings for producer pipe
Remove EOT flag set on the data descriptor issued on the producer
PIPE. As per the hardware documentation EOT flag does not need
to bet set for producer pipe descriptors.

Change-Id: Iec05ff6b7db1b9a1c94bc8a23f8ba8c9bc45b446
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:08:53 -07:00
Mona Hossain 1cc04c9125 crypto: msm: Reset encr_cfg before auth operation
Before starting any  authentication operation we need to
ensure all encryption related configurations are invalid.
This is done by setting the encryption config register to 0.

Change-Id: I294834c78a46063bb3c564cdebcaafbc5f846952
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:08:44 -07:00
Laura Abbott 1f72e99245 crypto: msm: Remove use of PMEM
PMEM functionality is deprecated.
Remove all references to CONFIG_ANDROID_PMEM.
Remove all pmem related functionalities.

Change-Id: I70e5e308e37d25f8b0e788dbad6617925e4331bd
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 16:07:43 -07:00
Hariprasad Dhalinarasimha 9ac8304ebe crypto: msm: Add validation checks for memory cleanup
Add validation checks to handle memory freeing &
prevent NULL pointer access.

Change-Id: I6e82ea56754fb12b467d5ecb642411017c1e18c6
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-04 16:05:34 -07:00
Mona Hossain 48c89d5c07 crypto: msm: Remove use of index to address sg entry
Treating scatter gather list as an array is and referencing
entries with indexes results in incorrect sg entries.
Tnis is because the sg entries are not contiguous in some
scenarios.

Fix is to use scatterwalk_sg_next() to traverse the sg list.

Change-Id: I1d7ebec779fa18c3ab5f0a6f357ef7fb53d3e9ab
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:58:14 -07:00
Hariprasad Dhalinarasimha 09abedd1af crypto: Fix potential crash due to unbound array & null pointer access.
Fix the null pointer errors and valid index checking for arrays to
fix potential kernel crash.

Change-Id: Iabf7f73dcfe5a544e3fe83f1e67ec1161f989fac
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-04 15:57:58 -07:00
Mona Hossain e933044389 crypto: msm: Remove use of sg_virt
Using sg_virt() on scatter list entries, that is designated
for buffers in high memory pages, results in returning a 0
address; NULL pointer is returned.  This is due to the fact
that high memory pages are by definition unmapped. Hence
sg_virt() does not work for such pages.  Dereferencing this
NULL pointer to copy data from/to results in kernel panic.

Remove all cases of sg_virt() API use case.

Change-Id: I5a007f5d198dff8265f0247aa83adf04b9511f5d
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:56:24 -07:00
Mona Hossain 9434fcaf03 crypto: msm: Fix kernel panic in sg_virt() call
There exists scenarios, where data is copied from client's
scatter gather list (sglist) to a locally allocated buffer.
In these cases, the driver uses sg_virt() API to retrieve
the virtual address of the buffer for each of the sglist
entry.

Using sg_virt() on scatter list entries, that is designated
for buffers in high memory pages, results in returning a 0
address; NULL pointer is returned.  This is due to the fact
that high memory pages are by definition unmapped. Hence
sg_virt() does not work for such pages.  Dereferencing this
NULL pointer to copy data from/to results in kernel panic.

Fix is to use sg_copy_from_buffer()/sg_copy_to_buffer() to
copy data between a local buffer and the buffer pointed to by
the sglist. These APIs temporarily  maps the memory addresed
by each of the sglist entries using kmap() and copies data
from this mapped segments to the requested local buffer.

Change-Id: Ibaaf218f3f86a35c67368c7b2ee57189db207bca
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:56:09 -07:00
Mona Hossain 3b632e5b3b crypto: msm: Add checks for memalloc failure
Add error logs when memory allocation fails.  Return
error if memory allocation fails.

Change-Id: I64e1223b34d976220e8ab56690b38312822532fd
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:56:08 -07:00
Mona Hossain a727e3b2d1 crypto: msm: Fix kernel crash due to use of sg_next
sg_next() may find wrong scatter-gather buffer in crypto subsystem,
and this causes a kernel crash. scatterwalk_sg_next() should be used
instead in crypto related drivers.

Change-Id: Ia8b87a91165e915d3b0709331a83e3b40bd02493
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:56:06 -07:00
Mona Hossain 2304d05a25 crypto:msm: Increase descriptor FIFO size
The Current BAM descriptor FIFO is set to 512 bytes and
can accomodate 32 descriptor entries (each entry being 8 bytes
and pointing to a unique sg entry from the sg list). There
exists clienta that can issue a scatter gather list with
more than 32 entries.

Increasing the size to accomodate a max of 1024  entries
allows driver to process all clients request successfully.

Change-Id: Ide111de0ef001642543c503574b7f080185f9c8b
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:55:57 -07:00
Mona Hossain 80cef55ba8 crypto: msm: Fix address for PIPE KEYs
PIPE KEY address are incorrect. This patch fixes these
incorrrect addresses.

Change-Id: I3e5069da6e2c99f24f706bef8a53e605b95d707b
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:51:07 -07:00
Mona Hossain d7d73fcba7 crypto: msm: Fix failure to process large packets
When performing a crypto operation of packet size larger
than 32KB -1 Bytes (max supported by BAM HW), the operation hangs.

The root casue was identified to be in one of the accumulators of
NDP_BAM not being given enough time to clear prior to when the EOT is
seen from the crypto core.

The workaround to the above issue in NDP_BAM is to precess the data
descriptors in in the producer PIPE in 2 steps.
- Enable INT for the second last descriptor prior to sending the last
  results dump data descriptor to BAM
- Once the interrupt is fired,  then only issue the result dump data
  descriptor to be process by BAM

The above changes results in allowing enough time for the accumulators
to clear before the last results dump data descriptor is processed by
BAM.

Change-Id: I46be19857fc22bae7aec2b2798ca487ee49fafd1
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:50:21 -07:00
Rohit Vaswani e884bf71ca crypto: Use scatterwalk APIs in crypto
sg_next() may find wrong scatter-gather buffer in crypto subsystem,
and this causes a kernel crash. scatterwalk_sg_next() should be used
instead in crypto related drivers.

Change-Id: Ibb454bc8a8b2c0318e55cd12ba3e4ca2f3647e36
Acked-by: Ho Lee <holee@qti.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2013-09-04 15:48:31 -07:00
Hariprasad Dhalinarasimha 4128cd3f6f msm: crypto: Enable crypto driver on msm9625
Enable the qce50 crypto driver for msm9625 target.

Change-Id: Id2f490e80df17b1257c8296022d20cdc69e86335
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-04 15:44:53 -07:00
Mona Hossain 3cc48333a5 crypto: msm: Add support for HW key
OEM specific HW key (primary  hardware key) is XPU protected by
trustzone and is not accessible by HLOS.

Only the Qualcomm specific HW key (secondary key) is made
available to HLOS. This patch removes access to OEM specific HW
key and replaces with the QC HW KEY.

Change-Id: I7a22218c4673c57d385eaaa8d445a93e7bc300f6
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:38:59 -07:00
Mona Hossain 7171e8ce9c crypto: msm: Fix failure to load both crypto modules
When the crypto driver modules, qcedev and qcrypto are both
configured to be built-in (not loadable), one of the probe
call fails.

This is due to both of them trying to register the same
CE BAM device to sps driver: both invokes "sps_register_bam_device".
BAM devices need to be registered only once.

Fix is to use a flag to indicate if the BAM device is already
registered and maintain a bam_register count for the number of
request made for this registration.

Also since we dont need to initialize the bam_register count in
the init function, the module_init/module_exit are removed

Change-Id: I1ba9a0320f049d605b4aecf013a46997f5bccfda
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:38:36 -07:00
Mona Hossain 0e6005094c crypto: msm: Unlock mutex before exiting function
When an error is encountered while trying to register a BAM
device, unlock the mutex before returning with an error.

Change-Id: I71fd8c3e69cee23406992ec61aeab0191d26fb71
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:38:36 -07:00
Mona Hossain b79c5c3c41 crypto: Add wait states for hash/hmac operations
Currently, hash (SHA1/256/hmac) operation occasionally results
in an incorrect hash value. This is due to the premature reading
of the AUTH_IV register done before the last SHA block is processed.
There needs to be enough delay (wait states) before the AUTH_IV
register is read to extract the hash value.

The current implementation has 2 wait states. Adding 2 more wait states
for hash operations, resolves the issue.

The wait states are calculated based on the inputs from the hardware
team with regards to the time taken to process the last block of 16
bytes of the data packet.

Change-Id: I4f9e784fbfca62d6636d87dc44c1bf9992e3b3e4
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:34:38 -07:00
Mona Hossain 280c64167f crypto: msm: Add support for AES-CCM algorithm
AES-CCM  mode is currently failing due to numerous issues.
Following fixes have been made to make AES CCM  mode operations
pass:
- Initialize the hash commandlist
- Set LAST bit in ENCR_CFG register to indicate single operation
- Set AUTH_SEC_CFG register correctly  for decryption

Change-Id: I15d1e48046246e9ca7441a6214869abfa9f62edf
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:34:35 -07:00
Mona Hossain de6be594ae crypto: msm: Set command descriptor size to burst size multiple
Remove dummy command elements added for the DES/DES3 CBC algorithm.
In order for proved perfromance, the  descriptor (data and command)
size sent to the BAM needs to be multiple of burst size (set to 64B).

Change-Id: If9b0cef79f15da73b18d55c24c32f4c0b7b1216a
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:30:53 -07:00
Mona Hossain a25ba454fe crypto: msm: Fix failure on XTS mode
XTs mode of operation fails with a crash or hangs in some cases.
This failure is due to numerous reason:
- CRYPTO_XTS_DU_SIZE address is incorrect resulting
  in not setting the register correctly
- xts_du_size command list pointer was NULL. This results in
  the operation crashing due to dereferenciong of a NULL pointer
- XTS KEY register was not set correctly, resulting in
  incorrect results for encrypt/decrypt operation

After fixing the above XTS mode of operation is passing.

Change-Id: I1cfcfaf0ecae61510d3d4372c49a412d65d7bc40
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:30:52 -07:00
Mona Hossain cbc3d42bdf crypto: msm: Fix counter IV calculation
CTR mode operation fails due to incorrect CNTR IV  returned
for large size packets.  For large packets, adding the number
of crypto blocks (16 byte chunks) to the CNTR_IV3 register
sometimes results in oevrflowing the register and hence an
incorrect value is reported back.

The counter IV for CTR/XTS mode is calculated incorrectly.
Th fix is to account for roll over scenarios. when the updated
counter value exceeds 0xFFFFFFFF.

Change-Id: I9343c520ce17871145eb9678d5fed9d718ddc089
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:30:52 -07:00
Mona Hossain 0fb0ea2fe6 crypto: Fix CBC mode failure
Multiple back to back CBC packets encryption followed by
decryption operation is failing.  This failure is due to
incorrect CNTR IV  calculated at the end of the operation
that is used in the subsequent operation.

Fixed the value of the cntr iv for decryption mode.
The CNTR IV should point to the last  16 bytes of the
encrypted data packet.

Change-Id: Ibca400a3a34ab448e54508f4019410edaaca4977
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:29:02 -07:00
Mona Hossain c9a9f9ce44 crypto: Fix HMAC failure
HMAC operation for small and large packets are failing.
This is due to 2 reason:
- Packet size set for each operation is larger than what is
  supported by the BAM hardware.
- Byte count value read after the end of the operation is of
  incorrect  byte order.
Fix is to decrease the max packet to the  max of (32KB-64) and
fix byte order when storing the byte count value from the register
dump of the results at the end of the operation.

Change-Id: Ieb91ab2ad22cb8a08a575c058b7178e532bea7d7
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:29:01 -07:00
Mona Hossain 5ca4d664e6 crypto: Add support for sharing CE
Add pipe locking logic. Before accessing the CE HW,
lock all other pipes from accessing the same CE HW.
After the operation is complete, unblock the pipes.
The pipe pairs should also belong to the same group.

Change-Id: Ie696ad0efcb4b38c1fd43b315d468067bb3b8a1a
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:18:00 -07:00
Ramesh Masavarapu a7654bde87 crypto: Set the BAM execution enviornment parameter.
Currently the BAM's execution enviornment parameter is not set.
Without setting this parameter, there would be no interrupts handled
on HLOS.

Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
2013-09-04 15:16:54 -07:00
Ramesh Masavarapu 483fc8134b crypto: Enable AXI clock for Crypto Engine.
Currently the AXI clock is not enabled for the crypto driver.
Without this clock enabled, data will not be transferred
between the DDR and the Crypto Engine.This fix enables the
AXI clock.

Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
2013-09-04 15:16:11 -07:00
Ramesh Masavarapu f0a44bbf20 crypto: Set INT flag on producer pipe.
The Crypto Engine hardware does not generate an End of Transfer (EOT)
interrupt for SHA algorithms. This issue is solved by:

 -Adding an INT flag for the last descriptor on the producer pipe.

Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
2013-09-04 15:16:10 -07:00
Ramesh Masavarapu e52918a8df crypto: Removed NWD flag from intermediate descriptors.
The NWD flag had to be enabled only on the last data descriptor
and not in intermediate descriptors.

Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
2013-09-04 15:16:09 -07:00
Ramesh Masavarapu bc20bd1cb0 crypto: Align command descriptors to burst size.
According to the hardware design, Crypto Engine 5.0
hardware expects all descriptors to be burst-size
aligned for performance reasons. In the case of using
descriptors, unaligned addresses have a huge performance
impact. In this case it might cause h/w to take longer
processing times when compared to the crypto driver directly
setting the registers via processor.

Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
2013-09-04 15:16:09 -07:00
Ramesh Masavarapu 56d90aea83 crypto: Fix byte order alignment on data packets.
Crypto cipher/authentication operation yields incorrect results.
Although the operation is succesfull, the resulting data bytes
seems to be incorrect. The data input/outout needs to be
configured to be in little endian format.

The fix is to set the LITTLE ENDIAN flag in the CRYPTO_CONFIG
register, after configuring the crypto hardware registers and
prior to setting the GO_PROC register. This way, the little
endian format kicks in for the the data descriptor transfer
only, resulting in correct order in which bytes are input and
output.

Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
2013-09-04 15:16:08 -07:00
Hariprasad Dhalinarasimha 2ab358ab31 crypto: Fix QCEDEV platform data initialization.
Initialize the platform data before it is being used for bus scaling.

Change-Id: Ie41ddec08b52b44ae735469dd8f3052e3469eeff
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-04 15:11:38 -07:00
Mona Hossain 43cbd0c3a0 crypto: Add support for crypto engine 5.0
Add new register definitions for QCE5.0 Hardware
Add new HAL (qce50.c) for interfacing with CE 5.0 hardware:
-- Implement the new interface to BAM (instead of data mover).
-- Add support for multiple Pipes.
-- Add support for use of HW key.

Change-Id: I69dc3993f607553d4752f9f9fb4fdfe1a09a6345
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:05:18 -07:00
Mona Hossain 19cd301779 crypto: Fix HMAC failure
Incorrect HMAC values are generated in following scenarios.

- In case of a single transfer with a packet shorter than the
block size, the HMAC generated is incorrect. This is due to
the "FIRST" bit in AUTH_CFG register not being set.  When calling
HMAC_final for a transfer with a single packet (with no prior HMAC
updates), the "FIRST" and "LAST" bit in AUTH_CFG register needs to
be set. Currently FIRST bit is being cleared incorrectly for all
scenarios.

- In a scenario of a mac key input larger than block size, the key
needs to be hashed. The key hashing operation is crashing. This is
due to a NULL, unintialized pointer to the device handle. This is
fixed by intializing the pointer correctly. Further more, key size
is uninitialized, resulting in corruption of buffer.

Change-Id: Iec736f2130e509fcaf631a2c71c5483514666617
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:02:18 -07:00
Mona Hossain 39569d9e4e crypto: Add device tree support for crypto drivers
Add device tree support for qcedev and qcrypto device drivers.
Add documentations for associated bindings.

Change-Id: Ib76986af5d9e30263a559329acbca401ec3304d2
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-09-04 15:01:39 -07:00
Stephen Boyd ee3406fe69 crypto: Add MSM crypto drivers
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-09-04 14:47:05 -07:00
Vakul Garg 85acabeb3c crypto: caam - Fixed the memory out of bound overwrite issue
commit 9c23b7d3d6bda41e2a27375df705485523a96dc8 upstream.

When kernel is compiled with CONFIG_SLUB_DEBUG=y and
CRYPTO_MANAGER_DISABLE_TESTS=n, during kernel bootup, the kernel
reports error given below. The root cause is that in function
hash_digest_key(), for allocating descriptor, insufficient memory was
being allocated. The required number of descriptor words apart from
input and output pointers are 8 (instead of 6).

=============================================================================
BUG dma-kmalloc-32 (Not tainted): Redzone overwritten
-----------------------------------------------------------------------------

Disabling lock debugging due to kernel taint
INFO: 0xdec5dec0-0xdec5dec3. First byte 0x0 instead of 0xcc
INFO: Allocated in ahash_setkey+0x60/0x594 age=7 cpu=1 pid=1257
        __kmalloc+0x154/0x1b4
        ahash_setkey+0x60/0x594
        test_hash+0x260/0x5a0
        alg_test_hash+0x48/0xb0
        alg_test+0x84/0x228
        cryptomgr_test+0x4c/0x54
        kthread+0x98/0x9c
        ret_from_kernel_thread+0x64/0x6c
INFO: Slab 0xc0bd0ba0 objects=19 used=2 fp=0xdec5d0d0 flags=0x0081
INFO: Object 0xdec5dea0 @offset=3744 fp=0x5c200014

Bytes b4 dec5de90: 00 00 00 00 00 00 00 00 5a 5a 5a 5a 5a 5a 5a 5a
........ZZZZZZZZ
Object dec5dea0: b0 80 00 0a 84 41 00 0d f0 40 00 00 00 67 3f c0
.....A...@...g?.
Object dec5deb0: 00 00 00 50 2c 14 00 50 f8 40 00 00 1e c5 d0 00
...P,..P.@......
Redzone dec5dec0: 00 00 00 14                                      ....
Padding dec5df68: 5a 5a 5a 5a 5a 5a 5a 5a
ZZZZZZZZ
Call Trace:
[dec65b60] [c00071b4] show_stack+0x4c/0x168 (unreliable)
[dec65ba0] [c00d4ec8] check_bytes_and_report+0xe4/0x11c
[dec65bd0] [c00d507c] check_object+0x17c/0x23c
[dec65bf0] [c0550a00] free_debug_processing+0xf4/0x294
[dec65c20] [c0550bdc] __slab_free+0x3c/0x294
[dec65c80] [c03f0744] ahash_setkey+0x4e0/0x594
[dec65cd0] [c01ef138] test_hash+0x260/0x5a0
[dec65e50] [c01ef4c0] alg_test_hash+0x48/0xb0
[dec65e70] [c01eecc4] alg_test+0x84/0x228
[dec65ee0] [c01ec640] cryptomgr_test+0x4c/0x54
[dec65ef0] [c005adc0] kthread+0x98/0x9c
[dec65f40] [c000e1ac] ret_from_kernel_thread+0x64/0x6c
FIX dma-kmalloc-32: Restoring 0xdec5dec0-0xdec5dec3=0xcc

Change-Id: I0c7a1048053e811025d1c3b487940f87345c8f5d
Signed-off-by: Vakul Garg <vakul@freescale.com>
Reviewed-by: Geanta Neag Horia Ioan-B05471 <horia.geanta@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-04 16:50:57 +08:00
Linus Torvalds 822b4b6fe3 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu:
 "This fixes a build problem in sahara and temporarily disables two new
  optimisations because of performance regressions until a permanent fix
  is ready"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: sahara - fix building as module
  crypto: blowfish - disable AVX2 implementation
  crypto: twofish - disable AVX2 implementation
2013-06-10 13:25:50 -07:00
Arnd Bergmann 68be0b1ae3 crypto: sahara - fix building as module
The sahara crypto driver has an incorrect MODULE_DEVICE_TABLE, which
prevents us from actually building this driver as a loadable module.

sahara_dt_ids is a of_device_id array, so we have to use
MODULE_DEVICE_TABLE(of, ...).

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Javier Martin <javier.martin@vista-silicon.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-06-05 16:36:20 +08:00
Linus Torvalds 30a9e50143 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu:
 "This push fixes a crash in the new sha256_ssse3 driver as well as a
  DMA setup/teardown bug in caam"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: sha256_ssse3 - fix stack corruption with SSSE3 and AVX implementations
  crypto: caam - fix inconsistent assoc dma mapping direction
2013-05-28 10:09:38 -07:00
Kent Yoder 1ad936e850 drivers/crypto/nx: Fixes for multiple races and issues
Fixes a race on driver init with registering algorithms where the
driver status flag wasn't being set before self testing started.

  Added the cra_alignmask field for CBC and ECB modes.

  Fixed a bug in GCM where AES block size was being used instead of
authsize.

  Removed use of blkcipher_walk routines for scatterlist processing.
Corner cases in the code prevent us from processing an entire
scatterlist at a time and walking the buffers in block sized chunks
turns out to be unecessary anyway.

  Fixed off-by-one error in saving off extra data in the sha code.

  Fixed accounting error for number of bytes processed in the sha code.

Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-24 18:11:10 +10:00
Horia Geanta 286233e604 crypto: caam - fix inconsistent assoc dma mapping direction
req->assoc is dma mapped BIDIRECTIONAL and unmapped TO_DEVICE.
Since it is read-only for the device, use TO_DEVICE both for mapping
and unmapping.

Cc: <stable@vger.kernel.org> # 3.9, 3.8
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-05-14 10:37:57 +08:00
Linus Torvalds 797994f81a Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto update from Herbert Xu:

 - XTS mode optimisation for twofish/cast6/camellia/aes on x86

 - AVX2/x86_64 implementation for blowfish/twofish/serpent/camellia

 - SSSE3/AVX/AVX2 optimisations for sha256/sha512

 - Added driver for SAHARA2 crypto accelerator

 - Fix for GMAC when used in non-IPsec secnarios

 - Added generic CMAC implementation (including IPsec glue)

 - IP update for crypto/atmel

 - Support for more than one device in hwrng/timeriomem

 - Added Broadcom BCM2835 RNG driver

 - Misc fixes

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (59 commits)
  crypto: caam - fix job ring cleanup code
  crypto: camellia - add AVX2/AES-NI/x86_64 assembler implementation of camellia cipher
  crypto: serpent - add AVX2/x86_64 assembler implementation of serpent cipher
  crypto: twofish - add AVX2/x86_64 assembler implementation of twofish cipher
  crypto: blowfish - add AVX2/x86_64 implementation of blowfish cipher
  crypto: tcrypt - add async cipher speed tests for blowfish
  crypto: testmgr - extend camellia test-vectors for camellia-aesni/avx2
  crypto: aesni_intel - fix Kconfig problem with CRYPTO_GLUE_HELPER_X86
  crypto: aesni_intel - add more optimized XTS mode for x86-64
  crypto: x86/camellia-aesni-avx - add more optimized XTS code
  crypto: cast6-avx: use new optimized XTS code
  crypto: x86/twofish-avx - use optimized XTS code
  crypto: x86 - add more optimized XTS-mode for serpent-avx
  xfrm: add rfc4494 AES-CMAC-96 support
  crypto: add CMAC support to CryptoAPI
  crypto: testmgr - add empty test vectors for null ciphers
  crypto: testmgr - add AES GMAC test vectors
  crypto: gcm - fix rfc4543 to handle async crypto correctly
  crypto: gcm - make GMAC work when dst and src are different
  hwrng: timeriomem - added devicetree hooks
  ...
2013-05-02 14:53:12 -07:00
Linus Torvalds 99c6bcf46d ARM: arm-soc multiplatform updates for 3.10
More multiplatform enablement for ARM platforms. The ones converted in
 this branch are:
 - bcm2835
 - cns3xxx
 - sirf
 - nomadik
 - msx
 - spear
 - tegra
 - ux500
 
 We're getting close to having most of them converted!
 
 One of the larger platforms remaining is Samsung Exynos, and there are
 a bunch of supporting patches in this merge window for it. There was a
 patch in this branch to a early version of multiplatform conversion,
 but it ended up being reverted due to need of more bake time. The
 revert commit is part of the branch since it would have required
 rebasing multiple dependent branches and they were stable by then.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRgg99AAoJEIwa5zzehBx3n78P/j0w/8v+F4dM29ba5M/tqbFI
 e3wpeFykZ/HJH+FFIEYfIablpfHsLB0LEMh0dZmwHESFC6eR0RfGL2jOkpfcH9Ne
 7B/JIFN4l1iwqqKCXf+QbYL6e8YFxlJkg6BIB4KhNgliQoO/ASP/8EbcgROYuxmN
 KPVdw9laUCCvb5Ogh2NWVAkBHhVGAEiqK20r4TQz8alI8RUmMleWM3o+wLBWVhOO
 d3gtYSfuFSbrJfbpKSdycLizoV/NekdOC1A9Ov9YuOdw8DzNbrThCRQtu0tIUgxN
 JjfnGlEJLsJS9SESfr8SYWxTuhe/lB2dGqjQPvRtl2HGBhbtTlnWfQ0k2ZHdeJuD
 J50SLrGA2gN9E5PlHJXjYk8uhhGIq8bNTJ//CtDkfKTq1D7PuHVEpEctsaz3BBbM
 U+x9zP2v4FB+yrZu8w+gkQY/wDgHsxj08mT6BK0+l8ePdyQV22CvwmM5XlJFI03x
 5J0nLYiYfef+ZN9rGgVrQbn+yv+IEkE4DmeiscjeVJE5LVdVrDpYGfx7UA7V0UA7
 i3KRVpNKuy1v7GJDnKlEBPkmB+vgXTRXUPDVCuC4n0Hi5PYj4es1gY6AoXGF90wm
 vtKxGr/2XDLP7Ro+m0OXMttSgQShnmbrbOngfkWcFwUmG7cB3SSUUOGKM+2LNnXM
 MJTqVhPjkZ2GYBi/J6S/
 =4hSo
 -----END PGP SIGNATURE-----

Merge tag 'multiplatform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC multiplatform updates from Olof Johansson:
 "More multiplatform enablement for ARM platforms.  The ones converted
  in this branch are:

   - bcm2835
   - cns3xxx
   - sirf
   - nomadik
   - msx
   - spear
   - tegra
   - ux500

  We're getting close to having most of them converted!

  One of the larger platforms remaining is Samsung Exynos, and there are
  a bunch of supporting patches in this merge window for it.  There was
  a patch in this branch to a early version of multiplatform conversion,
  but it ended up being reverted due to need of more bake time.  The
  revert commit is part of the branch since it would have required
  rebasing multiple dependent branches and they were stable by then"

* tag 'multiplatform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (70 commits)
  mmc: sdhci-s3c: Fix operation on non-single image Samsung platforms
  clocksource: nomadik-mtu: fix up clocksource/timer
  Revert "ARM: exynos: enable multiplatform support"
  ARM: SPEAr13xx: Fix typo "ARCH_HAVE_CPUFREQ"
  ARM: exynos: enable multiplatform support
  rtc: s3c: make header file local
  mtd: onenand/samsung: make regs-onenand.h file local
  thermal/exynos: remove unnecessary header inclusions
  mmc: sdhci-s3c: remove platform dependencies
  ARM: samsung: move mfc device definition to s5p-dev-mfc.c
  ARM: exynos: move debug-macro.S to include/debug/
  ARM: exynos: prepare for sparse IRQ
  ARM: exynos: introduce EXYNOS_ATAGS symbol
  ARM: tegra: build assembly files with -march=armv7-a
  ARM: Push selects for TWD/SCU into machine entries
  ARM: ux500: build hotplug.o for ARMv7-a
  ARM: ux500: move to multiplatform
  ARM: ux500: make remaining headers local
  ARM: ux500: make irqs.h local to platform
  ARM: ux500: get rid of <mach/[hardware|db8500-regs].h>
  ...
2013-05-02 09:38:16 -07:00
Linus Torvalds 5d434fcb25 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial tree updates from Jiri Kosina:
 "Usual stuff, mostly comment fixes, typo fixes, printk fixes and small
  code cleanups"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (45 commits)
  mm: Convert print_symbol to %pSR
  gfs2: Convert print_symbol to %pSR
  m32r: Convert print_symbol to %pSR
  iostats.txt: add easy-to-find description for field 6
  x86 cmpxchg.h: fix wrong comment
  treewide: Fix typo in printk and comments
  doc: devicetree: Fix various typos
  docbook: fix 8250 naming in device-drivers
  pata_pdc2027x: Fix compiler warning
  treewide: Fix typo in printks
  mei: Fix comments in drivers/misc/mei
  treewide: Fix typos in kernel messages
  pm44xx: Fix comment for "CONFIG_CPU_IDLE"
  doc: Fix typo "CONFIG_CGROUP_CGROUP_MEMCG_SWAP"
  mmzone: correct "pags" to "pages" in comment.
  kernel-parameters: remove outdated 'noresidual' parameter
  Remove spurious _H suffixes from ifdef comments
  sound: Remove stray pluses from Kconfig file
  radio-shark: Fix printk "CONFIG_LED_CLASS"
  doc: put proper reference to CONFIG_MODULE_SIG_ENFORCE
  ...
2013-04-30 09:36:50 -07:00
Vakul Garg 3862de1f6c crypto: caam - fix job ring cleanup code
The job ring init function creates a platform device for each job ring.
While the job ring is shutdown, e.g. while caam module removal, its
platform device was not being removed. This leads to failure while
reinsertion and then removal of caam module second time.

The following kernel crash dump appears when caam module is reinserted
and then removed again. This patch fixes it.

root@p4080ds:~# rmmod caam.ko
Unable to handle kernel paging request for data at address 0x00000008
Faulting instruction address: 0xf94aca18
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=8 P4080 DS
Modules linked in: caam(-) qoriq_dbg(O) [last unloaded: caam]
NIP: f94aca18 LR: f94aca18 CTR: c029f950
REGS: eac47d60 TRAP: 0300   Tainted: G           O  (3.8.4-rt2)
MSR: 00029002 <CE,EE,ME>  CR: 22022484  XER: 20000000
DEAR: 00000008, ESR: 00000000
TASK = e49dfaf0[2110] 'rmmod' THREAD: eac46000 CPU: 1
GPR00: f94ad3f4 eac47e10 e49dfaf0 00000000 00000005 ea2ac210 ffffffff 00000000
GPR08: c286de68 e4977ce0 c029b1c0 00000001 c029f950 10029738 00000000 100e0000
GPR16: 00000000 10023d00 1000cbdc 1000cb8c 1000cbb8 00000000 c07dfecc 00000000
GPR24: c07e0000 00000000 1000cbd8 f94e0000 ffffffff 00000000 ea53cd40 00000000
NIP [f94aca18] caam_reset_hw_jr+0x18/0x1c0 [caam]
LR [f94aca18] caam_reset_hw_jr+0x18/0x1c0 [caam]
Call Trace:
[eac47e10] [eac47e30] 0xeac47e30 (unreliable)
[eac47e20] [f94ad3f4] caam_jr_shutdown+0x34/0x220 [caam]
[eac47e60] [f94ac0e4] caam_remove+0x54/0xb0 [caam]
[eac47e80] [c029fb38] __device_release_driver+0x68/0x120
[eac47e90] [c02a05c8] driver_detach+0xd8/0xe0
[eac47eb0] [c029f8e0] bus_remove_driver+0xa0/0x110
[eac47ed0] [c00768e4] sys_delete_module+0x144/0x270
[eac47f40] [c000e2f0] ret_from_syscall+0x0/0x3c

Signed-off-by: Vakul Garg <vakul@freescale.com>
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Reviewed-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-04-25 21:09:07 +08:00
Kim Phillips 96aef9a8ba crypto: caam - static constify error data
checkstack reports report_deco_status(), report_ccb_status() as
particularly excessive stack users.  Move their lookup tables
off the stack and put them in .rodata.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-04-25 21:01:43 +08:00
Kim Phillips 66b3e8879f crypto: caam - change key gen functions to return signed int
commit 2af8f4a "crypto: caam - coccicheck fixes" added error
return values yet neglected to change the type from unsigned.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-04-25 21:01:43 +08:00
Arnd Bergmann 71f6424023 Merge branch 'mxs/cleanup' into next/multiplatform
This is a dependency for mxs/multiplatform

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Conflicts:
	drivers/clocksource/Makefile
2013-04-09 16:02:14 +02:00
Linus Walleij 174e779662 ARM: ux500: get rid of <mach/[hardware|db8500-regs].h>
This removes <mach/hardware.h> and <mach/db8500-regs.h>
from the Ux500, merging them into the local include
"db8500-regs.h" in mach-ux500. There is some impact
outside the ux500 machine, but most of it is dealt with
in earlier patches.

Contains portions of a clean-up patch from Arnd Bergmann.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-04-08 13:59:28 +02:00
Linus Walleij d47cbd5bce crypto: ux500 - add missing comma
Commit 4f31f5b19e
"PM / crypto / ux500: Use struct dev_pm_ops for power management"
add a new line to the driver struct but missed to add a
trailing comma, causing build errors when crypto is
selected. This adds the missing comma.

This was not noticed until now because the crypto block
is not in the ux500 defconfig. A separate patch will
be submitted to fix this.

Cc: <stable@vger.kernel.org> # 3.8.x
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Magnus Myrstedt <magnus.p.persson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-04-05 21:02:17 +08:00
Wei Yongjun eb16796302 crypto: ux500 - fix error return code in hash_dma_final()
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-04-03 09:06:28 +08:00
Sachin Kamat 5cec26e984 crypto: picoxcell - Use of_match_ptr() macro
This eliminates having an #ifdef returning NULL for the case
when OF is disabled.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-22 18:13:55 +08:00
Vakul Garg cb7d5662d7 crypto: caam - Fix missing init of '.type' in AEAD algos.
Following AEAD algo templates are updated for '.type' initialization.
	(a) authenc(hmac(sha224),cbc(aes))
	(b) authenc(hmac(sha384),cbc(aes))
	(c) authenc(hmac(sha224),cbc(des3_ede))
	(d) authenc(hmac(sha384),cbc(des3_ede))
	(e) authenc(hmac(sha224),cbc(des))
	(f) authenc(hmac(sha384),cbc(des))

Signed-off-by: Vakul Garg <vakul@freescale.com>
Reviewed-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-22 18:13:54 +08:00
Vakul Garg 575c1bd549 crypto: caam - set RDB bit in security configuration register
This change is required for post SEC-5.0 devices which have RNG4.
Setting RDB in security configuration register allows CAAM to use the
"Random Data Buffer" to be filled by a single request. The Random Data
Buffer is large enough for ten packets to get their IVs from a single
request. If the Random Data Buffer is not enabled, then each IV causes a
separate request, and RNG4 hardware cannot keep up resulting in lower
IPSEC throughput if random IVs are used.

Signed-off-by: Vakul Garg <vakul@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-22 18:13:54 +08:00
Mihnea Dobrescu-Balaur 1643a35fea crypto: ux500 - replace kmalloc and then memcpy with kmemdup
Signed-off-by: Mihnea Dobrescu-Balaur <mihneadb@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-21 17:44:41 +08:00
Javier Martin 5de8875281 crypto: sahara - Add driver for SAHARA2 accelerator.
SAHARA2 HW module is included in the i.MX27 SoC from
Freescale. It is capable of performing cipher algorithms
such as AES, 3DES..., hashing and RNG too.

This driver provides support for AES-CBC and AES-ECB
by now.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-21 17:44:41 +08:00
Horia Geanta 246bbedb9a Revert "crypto: caam - add IPsec ESN support"
This reverts commit 891104ed00.

Current IPsec ESN implementation for authencesn(cbc(aes), hmac(sha))
(separate encryption and integrity algorithms) does not conform
to RFC4303.

ICV is generated by hashing the sequence
SPI, SeqNum-High, SeqNum-Low, IV, Payload
instead of
SPI, SeqNum-Low, IV, Payload, SeqNum-High.

Cc: <stable@vger.kernel.org> # 3.8, 3.7
Reported-by: Chaoxing Lin <Chaoxing.Lin@ultra-3eti.com>
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Reviewed-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-21 17:36:03 +08:00
Horia Geanta 991155bacb Revert "crypto: talitos - add IPsec ESN support"
This reverts commit e763eb699b.

Current IPsec ESN implementation for authencesn(cbc(aes), hmac(sha))
(separate encryption and integrity algorithms) does not conform
to RFC4303.

ICV is generated by hashing the sequence
SPI, SeqNum-High, SeqNum-Low, IV, Payload
instead of
SPI, SeqNum-Low, IV, Payload, SeqNum-High.

Cc: <stable@vger.kernel.org> # 3.8, 3.7
Reported-by: Chaoxing Lin <Chaoxing.Lin@ultra-3eti.com>
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Reviewed-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-21 17:36:02 +08:00
Masanari Iida cf2fbdd26f treewide: Fix typos in printk and comment
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-03-18 14:57:53 +01:00
Paul Bolle ae8488a507 crypto: caam - fix typo "CRYPTO_AHASH"
The Kconfig entry for CAAM's hash algorithm implementations has always
selected CRYPTO_AHASH. But there's no corresponding Kconfig symbol.

It seems it was intended to select CRYPTO_HASH, like other crypto
drivers do. That would apparently (indirectly) select CRYPTO_HASH2,
which would enable the ahash functionality this driver uses.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Reviewed-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-10 18:16:36 +08:00
Sachin Kamat 0261370268 crypto: omap-sham - Use module_platform_driver macro
module_platform_driver() makes the code simpler by eliminating boilerplate
code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-10 18:16:36 +08:00
Sachin Kamat 94e51df9d6 crypto: omap-aes - Use module_platform_driver macro
module_platform_driver() makes the code simpler by eliminating boilerplate
code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-10 18:16:35 +08:00
Joel A Fernandes bbbaa37428 crypto: omap-aes - Use pm_runtime_put instead of pm_runtime_put_sync in tasklet
After DMA is complete, the omap_aes_finish_req function is called as
a part of the done_task tasklet. During this its atomic and any calls
to pm functions should not assume they wont sleep.

The patch replaces a call to pm_runtime_put_sync (which can sleep) with
pm_runtime_put thus fixing a kernel panic observed on AM33xx SoC during
AES operation.

Tested on an AM33xx SoC device (beaglebone board).
To reproduce the problem, I used the tcrypt kernel module as:
modprobe tcrypt sec=2 mode=500

Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
Cc: David S. Miller <davem@davemloft.net>
Acked-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-10 16:46:44 +08:00
Joel A Fernandes e68af48251 crypto: omap-sham - Use pm_runtime_put instead of pm_runtime_put_sync in tasklet
After DMA is complete, the omap_sham_finish_req function is called as
a part of the done_task tasklet. During this its atomic and any calls
to pm functions should not assume they wont sleep.

The patch replaces a call to pm_runtime_put_sync (which can sleep) with
pm_runtime_put thus fixing a kernel panic observed on AM33xx SoC during
SHA operation.

Tested on an AM33xx SoC device (beaglebone board).
To reproduce the problem, used the tcrypt kernel module as:
modprobe tcrypt sec=2 mode=403

Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
Cc: David S. Miller <davem@davemloft.net>
Acked-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-10 16:46:44 +08:00
Syam Sidhardhan fb1dd79480 crypto: bfin_crc - Fix possible NULL pointer dereference
If we define dev_dbg(), then there is a possible NULL pointer
dereference.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-10 16:46:43 +08:00
Nicolas Royer d4905b38d1 crypto: atmel-sha - add support for latest release of the IP (0x410)
Updates from IP release 0x320 to 0x400:
 - add DMA support (previous IP revision use PDC)
 - add DMA double input buffer support
 - add SHA224 support

Update from IP release 0x400 to 0x410:
 - add SHA384 and SHA512 support

Signed-off-by: Nicolas Royer <nicolas@eukrea.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Eric Bénard <eric@eukrea.com>
Tested-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-10 16:46:42 +08:00
Nicolas Royer 1f858040c2 crypto: atmel-tdes - add support for latest release of the IP (0x700)
Update from previous IP release (0x600):
 - add DMA support (previous IP release use PDC)

Signed-off-by: Nicolas Royer <nicolas@eukrea.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Eric Bénard <eric@eukrea.com>
Tested-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-10 16:46:42 +08:00
Nicolas Royer cadc4ab8f6 crypto: atmel-aes - add support for latest release of the IP (0x130)
Updates from previous IP release (0x120):
 - add cfb64 support
 - add DMA double input buffer support

Signed-off-by: Nicolas Royer <nicolas@eukrea.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Eric Bénard <eric@eukrea.com>
Tested-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-03-10 16:46:42 +08:00
Linus Torvalds 32dc43e40a Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto update from Herbert Xu:
 "Here is the crypto update for 3.9:

   - Added accelerated implementation of crc32 using pclmulqdq.

   - Added test vector for fcrypt.

   - Added support for OMAP4/AM33XX cipher and hash.

   - Fixed loose crypto_user input checks.

   - Misc fixes"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (43 commits)
  crypto: user - ensure user supplied strings are nul-terminated
  crypto: user - fix empty string test in report API
  crypto: user - fix info leaks in report API
  crypto: caam - Added property fsl,sec-era in SEC4.0 device tree binding.
  crypto: use ERR_CAST
  crypto: atmel-aes - adjust duplicate test
  crypto: crc32-pclmul - Kill warning on x86-32
  crypto: x86/twofish - assembler clean-ups: use ENTRY/ENDPROC, localize jump labels
  crypto: x86/sha1 - assembler clean-ups: use ENTRY/ENDPROC
  crypto: x86/serpent - use ENTRY/ENDPROC for assember functions and localize jump targets
  crypto: x86/salsa20 - assembler cleanup, use ENTRY/ENDPROC for assember functions and rename ECRYPT_* to salsa20_*
  crypto: x86/ghash - assembler clean-up: use ENDPROC at end of assember functions
  crypto: x86/crc32c - assembler clean-up: use ENTRY/ENDPROC
  crypto: cast6-avx: use ENTRY()/ENDPROC() for assembler functions
  crypto: cast5-avx: use ENTRY()/ENDPROC() for assembler functions and localize jump targets
  crypto: camellia-x86_64/aes-ni: use ENTRY()/ENDPROC() for assembler functions and localize jump targets
  crypto: blowfish-x86_64: use ENTRY()/ENDPROC() for assembler functions and localize jump targets
  crypto: aesni-intel - add ENDPROC statements for assembler functions
  crypto: x86/aes - assembler clean-ups: use ENTRY/ENDPROC, localize jump targets
  crypto: testmgr - add test vector for fcrypt
  ...
2013-02-25 15:56:15 -08:00
Julia Lawall 7b5c253c88 crypto: atmel-aes - adjust duplicate test
Delete successive tests to the same location.  The code tested the result
of a previous allocation, that itself was already tested.  It is changed to
test the result of the most recent allocation.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@s exists@
local idexpression y;
expression x,e;
@@

*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
 { ... when forall
   return ...; }
... when != \(y = e\|y += e\|y -= e\|y |= e\|y &= e\|y++\|y--\|&y\)
    when != \(XT_GETPAGE(...,y)\|WMI_CMD_BUF(...)\)
*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
 { ... when forall
   return ...; }
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-02-04 21:16:52 +08:00
Mark A. Greer c3c3b3292d crypto: omap-sham - Fix compile errors when CONFIG_OF not defined
Fix the compile errors created by commit 2545e8d
(crypto: omap-sham - Add Device Tree Support)
when CONFIG_OF is not defined.  This includes
changing omap_sham_get_res_dev() to omap_sham_get_res_of()
and creating an empty version of omap_sham_of_match[].

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:46 +11:00
Jingoo Han 5c22ba6619 crypto: s5p-sss - Use devm_clk_get()
Use devm_clk_get() rather than clk_get() to make cleanup paths
more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:44 +11:00
Mark A. Greer f9fb69e73c crypto: omap-aes - Add CTR algorithm Support
The OMAP3 and OMAP4/AM33xx versions of the AES crypto
module support the CTR algorithm in addition to ECB
and CBC that the OMAP2 version of the module supports.

So, OMAP2 and OMAP3 share a common register set but
OMAP3 supports CTR while OMAP2 doesn't.  OMAP4/AM33XX
uses a different register set from OMAP2/OMAP3 and
also supports CTR.

To add this support, use the platform_data introduced
in an ealier commit to hold the list of algorithms
supported by the current module.  The probe routine
will use that list to register the correct algorithms.

Note: The code being integrated is from the TI AM33xx SDK
and was written by Greg Turner <gkmturner@gmail.com> and
Herman Schuurman (current email unknown) while at TI.

CC: Greg Turner <gkmturner@gmail.com>
CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:44 +11:00
Mark A. Greer 0d35583a13 crypto: omap-aes - Add OMAP4/AM33XX AES Support
Add support for the OMAP4 version of the AES module
that is present on OMAP4 and AM33xx SoCs.

The modules have several differences including register
offsets and how DMA is triggered.  To handle these
differences, a platform_data structure is defined and
contains routine pointers, register offsets, and bit
offsets within registers.  OMAP2/OMAP3-specific routines
are suffixed with '_omap2' and OMAP4/AM33xx routines are
suffixed with '_omap4'.

Note: The code being integrated is from the TI AM33xx SDK
and was written by Greg Turner <gkmturner@gmail.com> and
Herman Schuurman (current email unknown) while at TI.

CC: Greg Turner <gkmturner@gmail.com>
CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:44 +11:00
Mark A. Greer b4b87a934c crypto: omap-aes - Convert to dma_request_slave_channel_compat()
Use the dma_request_slave_channel_compat() call instead of
the dma_request_channel() call to request a DMA channel.
This allows the omap-aes driver use different DMA engines.

CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:43 +11:00
Mark A. Greer bc69d124d8 crypto: omap-aes - Add Device Tree Support
Add Device Tree suport to the omap-aes crypto
driver.  Currently, only support for OMAP2 and
OMAP3 is being added but support for OMAP4 will
be added in a subsequent patch.

CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:43 +11:00
Mark A. Greer 44f04c1d6f crypto: omap-aes - Remove usage of private DMA API
Remove usage of the private OMAP DMA API.
The dmaengine API will be used instead.

CC: Russell King <rmk+kernel@arm.linux.org.uk>
CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:42 +11:00
Mark A. Greer ebedbf7902 crypto: omap-aes - Add code to use dmaengine API
Add code to use the new dmaengine API alongside
the existing DMA code that uses the private
OMAP DMA API.  The API to use is chosen by
defining or undefining 'OMAP_AES_DMA_PRIVATE'.

CC: Russell King <rmk+kernel@arm.linux.org.uk>
CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:42 +11:00
Mark A. Greer 0635fb3a3c crypto: omap-aes - Add suspend/resume support
Add suspend/resume support to the OMAP AES driver.

CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:42 +11:00
Mark A. Greer 5946c4a5e7 crypto: omap-aes - Convert to use pm_runtime API
Convert the omap-aes crypto driver to use the
pm_runtime API instead of the clk API.

CC: Kevin Hilman <khilman@deeprootsystems.com>
CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:41 +11:00
Mark A. Greer 7219368b05 crypto: omap-aes - Don't reset controller for every operation
The AES controller only needs to be reset once and that will
be done by the hwmod infrastructure, if possible.  Therefore,
remove the reset code from the omap-aes driver.

CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:41 +11:00
Mark A. Greer 05f369a89a crypto: omap-aes - Remmove unnecessary pr_info noise
Remove the unnecessary pr_info() calls from omap_aes_probe()
and omap_aes_mod_init().

CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:41 +11:00
Julia Lawall 17bebdcd5c crypto: bfin_crc - reposition free_irq to avoid access to invalid data
The data referenced by an interrupt handler should not be freed before the
interrupt is ended.  The handler is bfin_crypto_crc_handler.  It may refer
to crc->regs, which is released by the iounmap.

Furthermore, the second argument to all calls to free_irq is incorrect.  It
should be the same as the last argument of request_irq, which is crc,
rather than crc->dev.

The semantic match that finds the first problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@fn exists@
expression list es;
expression a,b;
identifier f;
@@

if (...) {
  ... when any
  free_irq(a,b);
  ... when any
  f(es);
  ... when any
  return ...;
}

@@
expression list fn.es;
expression fn.a,fn.b;
identifier fn.f;
@@

*f(es);
... when any
*free_irq(a,b);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-20 10:16:40 +11:00
Tony Lindgren a62a6e98c3 ARM: OMAP2+: Disable code that currently does not work with multiplaform
We still need to fix up few places for multiplatform support,
but that can proceed separately. Fix the issue by making the
problem drivers depends !ARCH_MULTIPLATFORM for now.

The remaining pieces that are not multiplatform compatible
for omap2+ SoCs are:

1. Some drivers are using custom omap_dm_timer calls

There are two drivers that are directly usign omap hardware
timers for PWM and DSP clocking: drivers/media/rc/ir-rx51.c and
drivers/staging/tidspbridge/core/dsp-clock.c. These can be
fixed for multiplatform by allowing a minimal set of hardware
timers to be accessed, and for some functionality by using the
hrtimer framework.

2. Hardware OMAP4_ERRATA_I688 needs to be fixed up

This can't be enabled for multiplatform configurations in
it's current form. It may be possible to fix it up to do
instruction replacement early on during init. Luckily it
looks like this errata does not seem to get hit with
mainline kernel code alone at least currently.

3. Legacy header needed for omap-sham.c

Looks like it still needs mach/irqs.h for omap1 that
does not exist for multiplatform systems. Just ifdef
it for now.

4. Mailbox is waiting to get moved to drivers

Disable it for now to avoid adding a dependency to the
mailbox patches.

Cc: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Cc: Sean Young <sean@mess.org>
Cc: "Víctor Manuel Jáquez Leal" <vjaquez@igalia.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
[tony@atomide.com: updated to disable mailbox]
Signed-off-by: Tony Lindgren <tony@atomide.com>
2013-01-11 11:24:20 -08:00
Mark A. Greer d20fb18be2 crypto: omap-sham - Add SHA224 and SHA256 Support
The OMAP4/AM33xx version of the SHAM crypto module
supports SHA224 and SHA256 in addition to MD5 and
SHA1 that the OMAP2 version of the module supports.

To add this support, use the platform_data introduced
in an ealier commit to hold the list of algorithms
supported by the current module.  The probe routine
will use that list to register the correct algorithms.

Note: The code being integrated is from the TI AM33xx SDK
and was written by Greg Turner <gkmturner@gmail.com> and
Herman Schuurman (current email unknown) while at TI.

CC: Greg Turner <gkmturner@gmail.com>
CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-05 21:43:58 +11:00
Mark A. Greer 0d373d6032 crypto: omap-sham - Add OMAP4/AM33XX SHAM Support
Add support for the OMAP4 version of the SHAM module
that is present on OMAP4 and AM33xx SoCs.

The modules have several differences including register
offsets, hardware XORing, and how DMA is triggered.
To handle these differences, a platform_data structure
is defined and contains routine pointers, register offsets,
bit shifts within registers, and flags to indicate whether
the hardware supports XORing and provides SHA1 results in
big or little endian.  OMAP2/OMAP3-specific routines are
suffixed with '_omap2' and OMAP4/AM33xx routines are suffixed
with '_omap4'.

Note: The code being integrated is from the TI AM33xx SDK
and was written by Greg Turner <gkmturner@gmail.com> and
Herman Schuurman (current email unknown) while at TI.

CC: Greg Turner <gkmturner@gmail.com>
CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-05 21:43:58 +11:00
Mark A. Greer 0e87e73f4a crypto: omap-sham - Convert to dma_request_slave_channel_compat()
Use the dma_request_slave_channel_compat() call instead of
the dma_request_channel() call to request a DMA channel.
This allows the omap-sham driver use different DMA engines.

CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-05 21:43:57 +11:00
Mark A. Greer 03feec9cc6 crypto: omap-sham - Add Device Tree Support
Add Device Tree suport to the omap-sham crypto
driver.  Currently, only support for OMAP2 and
OMAP3 is being added but support for OMAP4 will
be added in a subsequent patch.

CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-05 21:43:57 +11:00
Mark A. Greer dd49a69e8e crypto: omap-sham - Remove usage of private DMA API
Remove usage of the private OMAP DMA API.
The dmaengine API will be used instead.

CC: Russell King <rmk+kernel@arm.linux.org.uk>
CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-05 21:43:57 +11:00
Mark A. Greer dfd061d5a8 crypto: omap-sham - Add code to use dmaengine API
Add code to use the new dmaengine API alongside
the existing DMA code that uses the private
OMAP DMA API.  The API to use is chosen by
defining or undefining 'OMAP_SHAM_DMA_PRIVATE'.

This is a transitional change and the code that uses
the private DMA API will be removed in an upcoming
commit.

CC: Russell King <rmk+kernel@arm.linux.org.uk>
CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-05 21:43:56 +11:00
Mark A. Greer 3b3f440023 crypto: omap-sham - Add suspend/resume support
Add suspend/resume support to the OMAP SHAM driver.

CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-05 21:43:56 +11:00
Mark A. Greer b359f034c8 crypto: omap-sham - Convert to use pm_runtime API
Convert the omap-sham crypto driver to use the
pm_runtime API instead of the clk API.

CC: Kevin Hilman <khilman@deeprootsystems.com>
CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-05 21:43:56 +11:00
Mark A. Greer 3ff59bcee7 crypto: omap-sham - Remove unnecessary pr_info noise
Remove the unnecessary pr_info() call in omap_sham_mod_init().

CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-01-05 21:43:55 +11:00
Greg Kroah-Hartman 49cfe4db2d Drivers: crypto: remove __dev* attributes.
CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitdata,
and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Kent Yoder <key@linux.vnet.ibm.com>
Cc: Jamie Iles <jamie@jamieiles.com>
Cc: Kim Phillips <kim.phillips@freescale.com>
Cc: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Cc: Alex Porosanu <alexandru.porosanu@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-03 15:57:02 -08:00
Linus Torvalds 16e024f30c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc update from Benjamin Herrenschmidt:
 "The main highlight is probably some base POWER8 support.  There's more
  to come such as transactional memory support but that will wait for
  the next one.

  Overall it's pretty quiet, or rather I've been pretty poor at picking
  things up from patchwork and reviewing them this time around and Kumar
  no better on the FSL side it seems..."

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (73 commits)
  powerpc+of: Rename and fix OF reconfig notifier error inject module
  powerpc: mpc5200: Add a3m071 board support
  powerpc/512x: don't compile any platform DIU code if the DIU is not enabled
  powerpc/mpc52xx: use module_platform_driver macro
  powerpc+of: Export of_reconfig_notifier_[register,unregister]
  powerpc/dma/raidengine: add raidengine device
  powerpc/iommu/fsl: Add PAMU bypass enable register to ccsr_guts struct
  powerpc/mpc85xx: Change spin table to cached memory
  powerpc/fsl-pci: Add PCI controller ATMU PM support
  powerpc/86xx: fsl_pcibios_fixup_bus requires CONFIG_PCI
  drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS]
  powerpc/85xx: p1022ds: Use NULL instead of 0 for pointers
  powerpc: Disable relocation on exceptions when kexecing
  powerpc: Enable relocation on during exceptions at boot
  powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function
  powerpc: Add wrappers to enable/disable relocation on exceptions
  powerpc: Add set_mode hcall
  powerpc: Setup relocation on exceptions for bare metal systems
  powerpc: Move initial mfspr LPCR out of __init_LPCR
  powerpc: Add relocation on exception vector handlers
  ...
2012-12-18 09:58:09 -08:00
Benjamin Herrenschmidt 376bddd344 Merge remote-tracking branch 'agust/next' into next
Brings some 52xx updates. Also manually merged tools/perf/perf.h.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-12-18 10:22:27 +11:00
Linus Torvalds 1ed55eac3b Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto update from Herbert Xu:

 - Added aesni/avx/x86_64 implementations for camellia.

 - Optimised AVX code for cast5/serpent/twofish/cast6.

 - Fixed vmac bug with unaligned input.

 - Allow compression algorithms in FIPS mode.

 - Optimised crc32c implementation for Intel.

 - Misc fixes.

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (32 commits)
  crypto: caam - Updated SEC-4.0 device tree binding for ERA information.
  crypto: testmgr - remove superfluous initializers for xts(aes)
  crypto: testmgr - allow compression algs in fips mode
  crypto: testmgr - add larger crc32c test vector to test FPU path in crc32c_intel
  crypto: testmgr - clean alg_test_null entries in alg_test_descs[]
  crypto: testmgr - remove fips_allowed flag from camellia-aesni null-tests
  crypto: cast5/cast6 - move lookup tables to shared module
  padata: use __this_cpu_read per-cpu helper
  crypto: s5p-sss - Fix compilation error
  crypto: picoxcell - Add terminating entry for platform_device_id table
  crypto: omap-aes - select BLKCIPHER2
  crypto: camellia - add AES-NI/AVX/x86_64 assembler implementation of camellia cipher
  crypto: camellia-x86_64 - share common functions and move structures and function definitions to header file
  crypto: tcrypt - add async speed test for camellia cipher
  crypto: tegra-aes - fix error-valued pointer dereference
  crypto: tegra - fix missing unlock on error case
  crypto: cast5/avx - avoid using temporary stack buffers
  crypto: serpent/avx - avoid using temporary stack buffers
  crypto: twofish/avx - avoid using temporary stack buffers
  crypto: cast6/avx - avoid using temporary stack buffers
  ...
2012-12-15 12:35:19 -08:00
Linus Torvalds a11da7df65 ARM: arm-soc: power management and clock changes
This branch contains a largeish set of updates of power management and
 clock setup. The bulk of it is for OMAP/AM33xx platforms, but also a
 few around hotplug/suspend/resume on Exynos.
 
 It includes a split-up of some of the OMAP clock data into separate
 files which adds to the diffstat, but gross delta is fairly reasonable.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQySrdAAoJEIwa5zzehBx3XBMQAJCgrE/I1vbuiENiVMLpQkN7
 0Y5t89SwoALnme5jsM8vW/H0o6b163FfH+249UNs6dyk6MdCqqSv8cQVvSfCKRKn
 m4JTXS6njSnYgU025klNU9W3FyMuFcgH8b63+c5+sCcqfvdkxrjpNoKqAYNxQlgJ
 6DHgHCKZP3JB1e2EFqViw0GJgZIjTNxlWvx8XLcAShSapQ+Ovq/iAcKo41o7ZadB
 4zV//VkBMv0TLNTs6SoR0EO8qM+2nIUKE8fgPrRxvvb98tuasKPvlSq9VUeIjnYk
 kWjNTQYbD1IkrAMPYrwcpLU3xkEr14wrKDBtPK6GdCDcXzdyKq3fzROOXNsqrLmn
 Y8PkY+J39B59F0DKjyrCjasZyi0tQQV6ps5Xm2X2CB003GWEbo1yu+BodShYEyaL
 7OvkLiVpOtq+LOYcsScHtOGdO9le2O3yZevNRvlrCDCvJUYbXNjaM9ZrWcQuTlJc
 oseYNSRPaIP5PMv2c+Xup9qh/dyAjj8g6gSi9BlDvwVOu/+Cf3laaCAXaFph22jT
 /m8fW2paiP5UJ0gSt1MLAGFxKi0YI/Qxck8G11LJxUwMZd3SIfOPUAY27tnNC4yL
 GRynOi3BFRMUAe/Leu2qgwEyoME5nHn+OmAKb36WTYH/HL+PGzHq84e+Wfdan8ha
 YcSKc1A52LSoYTi4XTUX
 =h2Qo
 -----END PGP SIGNATURE-----

Merge tag 'pm-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC power management and clock changes from Olof Johansson:
 "This branch contains a largeish set of updates of power management and
  clock setup.  The bulk of it is for OMAP/AM33xx platforms, but also a
  few around hotplug/suspend/resume on Exynos.

  It includes a split-up of some of the OMAP clock data into separate
  files which adds to the diffstat, but gross delta is fairly reasonable."

* tag 'pm-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (60 commits)
  ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h
  ASoC: OMAP: mcbsp fixes for enabling ARM multiplatform support
  watchdog: OMAP: fixup for ARM multiplatform support
  ARM: EXYNOS: Add flush_cache_all in suspend finisher
  ARM: EXYNOS: Remove scu_enable from cpuidle
  ARM: EXYNOS: Fix soft reboot hang after suspend/resume
  ARM: EXYNOS: Add support for rtc wakeup
  ARM: EXYNOS: fix the hotplug for Cortex-A15
  ARM: OMAP2+: omap_device: Correct resource handling for DT boot
  ARM: OMAP2+: hwmod: Add possibility to count hwmod resources based on type
  ARM: OMAP2+: hwmod: Add support for per hwmod/module context lost count
  ARM: OMAP2+: PRM: initialize some PRM functions early
  ARM: OMAP2+: voltage: fixup oscillator handling when CONFIG_PM=n
  ARM: OMAP4: USB: power down MUSB PHY during boot
  ARM: OMAP2+: clock: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP2xxx: clock: drop obsolete clock data
  ARM: OMAP2: clock: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP3+: DPLL: drop !CONFIG_COMMON_CLK sections
  ARM: AM33xx: clock: drop obsolete clock data
  ARM: OMAP3xxx: clk: drop obsolete clock data
  ...
2012-12-13 10:58:20 -08:00
Linus Torvalds b8edf848e9 ARM: arm-soc: multiplatform conversion patches
Here are more patches in the progression towards multiplatform, sparse
 irq conversions in particular.
 
 Tegra has a handful of cleanups and general groundwork, but is
 not quite there yet on full enablement.
 
 Platforms that are enabled through this branch are VT8500 and Zynq. note
 that i.MX was converted in one of the earlier cleanup branches as
 well (before we started a separate topic for multiplatform). And both
 new platforms for this merge window, sunxi and bcm, were merged with
 multiplatform support enabled.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQySb/AAoJEIwa5zzehBx3Wo4P/0GrpUhB/qwuhgy43MA2I1Dv
 tnyuFvsfW9uRExcw2IwT39GFls98QUM9TwQxPqOTHVf+u0LkYMZ9aDeWJOdj3RvG
 H70Ypj4gZDrzZAFr2TUf8NnYGHd6G2EcMn3261Hjfd7YrswCjsMPvgRns7VOyHCa
 deif3KcLu3+HzxvuzqlVlTuSAagCQbfqqnTQduMRdJPHT3X3sXwl7ABW+qfOoeYC
 rjqIbjdh5dB1d/f7igtgBbXjSTnVz/Mr1+wk4rp9Xr1Wv0IXvIaSKjK2Df8ZuNAk
 aQ6mMy/oDVxlDSrYv0F7lB40/rsZcPqz8+fgYJ2FnvCpIM7z7NeTWD2kQJ2UaQ/s
 VunShloRxF8It6104EVWZDfEA9NvVBcCALSze0NukqiHZRZYGUzxRNQDrncaksC9
 Lm+Z16cUWogsZq7VDCgXYQJeakPQfBDnsx7siMvAbOgvtpSClxuwhdC/czJiix7h
 BcpA+l5xSviUhHvzHhDt9iJxHjbUmo1xLDvaZSgj2OjAj257JcwaNBCk5BjZTCwe
 xZmQu1FjwaGtjLiG6QY0WJRsq1hiFRIb/MaWar/WpfqADFqARoambGFUjOl+P4Mu
 DIM5Z0AS04H+pLuP1QOz/yXxOPEP6Ri36to6XrgzfL/XGet5LW2P59xXxhcWC/OL
 /3IAcQrsAqh4aGMOstW1
 =UJlh
 -----END PGP SIGNATURE-----

Merge tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC multiplatform conversion patches from Olof Johansson:
 "Here are more patches in the progression towards multiplatform, sparse
  irq conversions in particular.

  Tegra has a handful of cleanups and general groundwork, but is not
  quite there yet on full enablement.

  Platforms that are enabled through this branch are VT8500 and Zynq.
  Note that i.MX was converted in one of the earlier cleanup branches as
  well (before we started a separate topic for multiplatform).  And both
  new platforms for this merge window, sunxi and bcm, were merged with
  multiplatform support enabled."

Fix up conflicts mostly as per Olof.

* tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (29 commits)
  ARM: zynq: Remove all unused mach headers
  ARM: zynq: add support for ARCH_MULTIPLATFORM
  ARM: zynq: make use of debug_ll_io_init()
  ARM: zynq: remove TTC early mapping
  ARM: tegra: move debug-macro.S to include/debug
  ARM: tegra: don't include iomap.h from debug-macro.S
  ARM: tegra: decouple uncompress.h and debug-macro.S
  ARM: tegra: simplify DEBUG_LL UART selection options
  ARM: tegra: select SPARSE_IRQ
  ARM: tegra: enhance timer.c to get IO address from device tree
  ARM: tegra: enhance timer.c to get IRQ info from device tree
  ARM: timer: fix checkpatch warnings
  ARM: tegra: add TWD to device tree
  ARM: tegra: define DT bindings for and instantiate RTC
  ARM: tegra: define DT bindings for and instantiate timer
  clocksource/mtu-nomadik: use apb_pclk
  clk: ux500: Register mtu apb_pclocks
  ARM: plat-nomadik: convert platforms to SPARSE_IRQ
  mfd/db8500-prcmu: use the irq_domain_add_simple()
  mfd/ab8500-core: use irq_domain_add_simple()
  ...
2012-12-13 10:57:16 -08:00
Linus Torvalds d01e4afdbb ARM: arm-soc: Cleanups on various subarchitectures
Cleanup patches for various ARM platforms and some of their associated
 drivers. There's also a branch in here that enables Freescale i.MX to be
 part of the multiplatform support -- the first "big" SoC that is moved
 over (more multiplatform work comes in a separate branch later during
 the merge window).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQx2p9AAoJEIwa5zzehBx3aPUQAIjV3VDf/ACkA4KUQu0BFg5U
 57OIkl6RCZvfKhYgq5+6OJ2AK6VkGh9PqTmXkDS7Nj3QMS/uWcb3U419aPJsd3Z/
 vNGpTl+J/YcAcFrKMqTyNv98TAiAOJlpm70CqmRbkhpMfoJb7//1JKqGTJPBO+tj
 8ZEwNGC0WbRNOSQTY/TTAhbZE1sqXwKy9mDLGmcwqKBY8H1TFHyPB6yWYFSxMHxS
 JAegbYhYO9FawOOLoi9ovT+2vUR9vDu0xxV4zUK9f5DqKcCb/wYuN0QkusjnEutm
 RfIt7iXHHzi35YPxtlrGgSz9EIYXKAafSzkgf3Ydpjci5DH/vbVexm/CT+V+SwOT
 SvucYJMALI/aOEFJWN/50L6B9zipSrWb51tK7WFXz/sUCrMQrXH3Mu99mjHZXSoL
 1cylsvs3DFQC7vHFLSjRpX6eJdfE+Hb0LZ878eXSbDVCOnU8odAQrofugqfmeVDk
 eN0+BWmchJgvljOiKVUQMC3PCquCaAAO1lm/HU7bWPlVigTuHSW0uisDyCYAtlt1
 dGxnbbhoFJvSH7CMOoMO7hIFnoNJEe6+uVUuwA/+iJouMXMJLoY6Da4L72h1Mp81
 o4Hr6Kxly/SMtURZ/6pCycx5ahb5TaahstYAoe7Qp1dMj5U2m6fUVfKkG7tUx1CW
 MIuvN3qJeW2qKWKmZRVM
 =zfPd
 -----END PGP SIGNATURE-----

Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC cleanups on various subarchitectures from Olof Johansson:
 "Cleanup patches for various ARM platforms and some of their associated
  drivers.  There's also a branch in here that enables Freescale i.MX to
  be part of the multiplatform support -- the first "big" SoC that is
  moved over (more multiplatform work comes in a separate branch later
  during the merge window)."

Conflicts fixed as per Olof, including a silent semantic one in
arch/arm/mach-omap2/board-generic.c (omap_prcm_restart() was renamed to
omap3xxx_restart(), and a new user of the old name was added).

* tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (189 commits)
  ARM: omap: fix typo on timer cleanup
  ARM: EXYNOS: Remove unused regs-mem.h file
  ARM: EXYNOS: Remove unused non-dt support for dwmci controller
  ARM: Kirkwood: Use hw_pci.ops instead of hw_pci.scan
  ARM: OMAP3: cm-t3517: use GPTIMER for system clock
  ARM: OMAP2+: timer: remove CONFIG_OMAP_32K_TIMER
  ARM: SAMSUNG: use devm_ functions for ADC driver
  ARM: EXYNOS: no duplicate mask/unmask in eint0_15
  ARM: S3C24XX: SPI clock channel setup is fixed for S3C2443
  ARM: EXYNOS: Remove i2c0 resource information and setting of device names
  ARM: Kirkwood: checkpatch cleanups
  ARM: Kirkwood: Fix sparse warnings.
  ARM: Kirkwood: Remove unused includes
  ARM: kirkwood: cleanup lsxl board includes
  ARM: integrator: use BUG_ON where possible
  ARM: integrator: push down SC dependencies
  ARM: integrator: delete static UART1 mapping
  ARM: integrator: delete SC mapping on the CP
  ARM: integrator: remove static CP syscon mapping
  ARM: integrator: remove static AP syscon mapping
  ...
2012-12-12 11:51:39 -08:00
Linus Torvalds 8287361abc ARM: arm-soc: Header cleanups
This is a collection of header file cleanups, mostly for OMAP and AT91,
 that keeps moving the platforms in the direction of multiplatform by
 removing the need for mach-dependent header files used in drivers and
 other places.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQx2reAAoJEIwa5zzehBx3Z/oQAIHp8aXbUD0GvbBPQ2vIydZ8
 Qfdh2ypbyFB9GSLmPP6BhurEFUcwmW3MH2r9Kq68omPt4XxrFEt1SdEn3TgZlhTY
 YYzEv2DLbWfmKCDBFAEFullsfVkrpggyou5ty30YVp/u2lVLvChpkciE5/9HADy5
 uoh/W2KZcLE51tvnbRy/1DBaOtxEdCjJ9hTaef7FCB9ugOG+yMDYwIPRW/b4fNA6
 o/1NuZTWp0H4ePRG2oqLxYnjSiF63DVTJZjSJ+c5gW34bWgh8+/xzaLFA9U++/ig
 meGUD1Oe65+ctr+Wk2mV29eb02jauUe6qvkwt+iFIDDopgc2mn5BcW+ENpgpjhe3
 6l3ClRd94qh4cMWzqDa5PZCdetshiKqSH2IGpKS/dHNB1h5sBP7CCbvbalwzWd5n
 qjfkPC7kSFyU3XV+9SEAXE6HLKsiMQy9kRcKOMdTE5BA4FEAZk0wfiG9WcVCvS2D
 9tDC3X0aScyXx4Mkd4wIAZVhY68QuI17fPft9zZSj691YiUW5cR2yF1qbCka0yd5
 pHu/QSZg1+dUitMUvMPQmWJ15jnAtEYUtV/8zQFFVchgkxlrW+UtvW3zxghB6D+J
 ZwcjAMfQQz9fLoMQXlVovjQIhYsjw3SlV62ReBH7eyPs3+KfPIBn7Ks6mVQs3dS5
 AMUWORsB5u92XHl9EL9C
 =aggA
 -----END PGP SIGNATURE-----

Merge tag 'headers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC Header cleanups from Olof Johansson:
 "This is a collection of header file cleanups, mostly for OMAP and
  AT91, that keeps moving the platforms in the direction of
  multiplatform by removing the need for mach-dependent header files
  used in drivers and other places."

Fix up mostly trivial conflicts as per Olof.

* tag 'headers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (106 commits)
  ARM: OMAP2+: Move iommu/iovmm headers to platform_data
  ARM: OMAP2+: Make some definitions local
  ARM: OMAP2+: Move iommu2 to drivers/iommu/omap-iommu2.c
  ARM: OMAP2+: Move plat/iovmm.h to include/linux/omap-iommu.h
  ARM: OMAP2+: Move iopgtable header to drivers/iommu/
  ARM: OMAP: Merge iommu2.h into iommu.h
  atmel: move ATMEL_MAX_UART to platform_data/atmel.h
  ARM: OMAP: Remove omap_init_consistent_dma_size()
  arm: at91: move at91rm9200 rtc header in drivers/rtc
  arm: at91: move reset controller header to arm/arm/mach-at91
  arm: at91: move pit define to the driver
  arm: at91: move at91_shdwc.h to arch/arm/mach-at91
  arm: at91: move board header to arch/arm/mach-at91
  arn: at91: move at91_tc.h to arch/arm/mach-at91
  arm: at91 move at91_aic.h to arch/arm/mach-at91
  arm: at91 move board.h to arch/arm/mach-at91
  arm: at91: move platfarm_data to include/linux/platform_data/atmel.h
  arm: at91: drop machine defconfig
  ARM: OMAP: Remove NEED_MACH_GPIO_H
  ARM: OMAP: Remove unnecessary mach and plat includes
  ...
2012-12-12 11:45:16 -08:00
Olof Johansson 48d224d1ef Remaining patches to allow omap2+ to build with multiplatform
enabled. Unfortunately the DMA header patch had to be redone
 to avoid adding new multiplatform specific include paths, the
 other patches are just trivial compile fixes.
 
 Note that this does not yet contain the necessary Kconfig
 changes as we are still waiting for some drivers to get
 fixed up first.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQuOZOAAoJEBvUPslcq6Vz9wIQAM/L8NQFGZy8Z5wIMV6MMHRl
 maChJfhyHXAP4f/MHKz+bO1CDxUNzbgDvDdrraJl/KLypHClpHMcy8QI2EpsSqBu
 EZfBZpwZhChVTExnpcmCOFX7QC5ASP13XPMkz9iA8+gMM8r9gNTiNKYpHbBI24zu
 PmyNbsxfXILUdGZgi532+MaEr1szHcyqb5cgQqIg/yPJ5lJ4FIDMCg4d+N4DGrWp
 5WIFWt3yZ0bu/W5UTR7sSRuafjHatfoueh6Z31IBQYj556WBjJrl6rkSPZGEzFik
 uAsWIJI/QAGyBpH7VYKea9+bZsSOGirF4pZM21yLcyjpgd81ojTygMl63nkaxfyg
 3aPm3aljSOtkhOs8xeR9FKhyx9jML6jbxGT3WtCjDsEVeyMgl52ltkfVSJWxmdSt
 asgQu+ZZLGvPF/CmQRx0aeOrqZCr+5y+yfSJbNHHHx6Rv3RMFwzTJJESgA9nx9WH
 qrY7xEbsXXOSV3d8v9PvI42iFxp9mK6XvA0XewpFRZAN/GfsrAQZGYRK2mrhbWZh
 aYv9Hz3W/tXM31/9cQMnel6WI9tWUFCqWIjkJrko1vMFvYZ/XQDCrXg47D4O+z40
 +CK2xhcmLtuv1Zr9zahuW0YvXfDdc6eptyDDhYvKKjE2BnxxREdsT7WZoV3sc7qI
 rNg1z8rLxFPp+n4buqTe
 =w+UN
 -----END PGP SIGNATURE-----

Merge tag 'tags/omap-for-v3.8/cleanup-multiplatform-no-clock-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/pm2

From Tony Lindgren:
Remaining patches to allow omap2+ to build with multiplatform
enabled. Unfortunately the DMA header patch had to be redone
to avoid adding new multiplatform specific include paths, the
other patches are just trivial compile fixes.

Note that this does not yet contain the necessary Kconfig
changes as we are still waiting for some drivers to get
fixed up first.

* tag 'tags/omap-for-v3.8/cleanup-multiplatform-no-clock-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h
  ASoC: OMAP: mcbsp fixes for enabling ARM multiplatform support
  watchdog: OMAP: fixup for ARM multiplatform support

Conflicts due to surrounding changes in:
	arch/arm/mach-omap2/omap_hwmod_2420_data.c
	arch/arm/mach-omap2/omap_hwmod_2430_data.c

Signed-off-by: Olof Johansson <olof@lixom.net>
2012-11-30 21:47:21 -08:00
Tony Lindgren 45c3eb7d3a ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h
Based on earlier discussions[1] we attempted to find a suitable
location for the omap DMA header in commit 2b6c4e73 (ARM: OMAP:
DMA: Move plat/dma.h to plat-omap/dma-omap.h) until the conversion
to dmaengine is complete.

Unfortunately that was before I was able to try to test compile
of the ARM multiplatform builds for omap2+, and the end result
was not very good.

So I'm creating yet another all over the place patch to cut the
last dependency for building omap2+ for ARM multiplatform. After
this, we have finally removed the driver dependencies to the
arch/arm code, except for few drivers that are being worked on.

The other option was to make the <plat-omap/dma-omap.h> path
to work, but we'd have to add some new header directory to for
multiplatform builds.

Or we would have to manually include arch/arm/plat-omap/include
again from arch/arm/Makefile for omap2+.

Neither of these alternatives sound appealing as they will
likely lead addition of various other headers exposed to the
drivers, which we want to avoid for the multiplatform kernels.

Since we already have a minimal include/linux/omap-dma.h,
let's just use that instead and add a note to it to not
use the custom omap DMA functions any longer where possible.

Note that converting omap DMA to dmaengine depends on
dmaengine supporting automatically incrementing the FIFO
address at the device end, and converting all the remaining
legacy drivers. So it's going to be few more merge windows.

[1] https://patchwork.kernel.org/patch/1519591/#

cc: Russell King <linux@arm.linux.org.uk>
cc: Kevin Hilman <khilman@ti.com>
cc: "Benoît Cousson" <b-cousson@ti.com>
cc: Herbert Xu <herbert@gondor.apana.org.au>
cc: "David S. Miller" <davem@davemloft.net>
cc: Vinod Koul <vinod.koul@intel.com>
cc: Dan Williams <djbw@fb.com>
cc: Mauro Carvalho Chehab <mchehab@infradead.org>
cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
cc: David Woodhouse <dwmw2@infradead.org>
cc: Kyungmin Park <kyungmin.park@samsung.com>
cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
cc: Hans Verkuil <hans.verkuil@cisco.com>
cc: Vaibhav Hiremath <hvaibhav@ti.com>
cc: Lokesh Vutla <lokeshvutla@ti.com>
cc: Rusty Russell <rusty@rustcorp.com.au>
cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
cc: Afzal Mohammed <afzal@ti.com>
cc: linux-crypto@vger.kernel.org
cc: linux-media@vger.kernel.org
cc: linux-mtd@lists.infradead.org
cc: linux-usb@vger.kernel.org
cc: linux-fbdev@vger.kernel.org
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-30 08:41:50 -08:00
Krzysztof Hałasa 9792eb1d72 IXP4xx crypto: MOD_AES{128,192,256} already include key size.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
2012-11-22 03:36:15 +00:00
Krzysztof Hałasa 9665c52b10 IXP4xx: ixp4xx_crypto driver requires Queue Manager and NPE drivers.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
2012-11-22 03:35:48 +00:00
Olof Johansson 46e8a79eb5 ARM: tegra: single-zImage preparation work
Various cleanups and enhancements are made to core Tegra code towards the
 aim of including Tegra in a multi-platform ARM kernel:
 
 RTC, timer, and TWD are configured via device tree.
 
 SPARSE_IRQ is enabled.
 
 Tegra's debug_ll options are simplified, and the macros brought into
 line with other multi-platform implementations, and moved to the new
 common location.
 
 Two headers still need to be eliminated in order to include Tegra in a
 multi-platform kernel/ <mach/{clk,powergate}.h>. A new common API needs
 to be invented to replace parts of clk.h. powergate.h might be replaced
 by regulators; this needs more investigation.
 
 This pull request is based on tegra-for-3.8-dt, followed by a merge of
 arm-soc's devel/debug_ll_init branch.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQppQBAAoJEMzrak5tbycxoz0P/REooomHVeI5CNyKMxp0rzQv
 dSGfnWD2nuRJ3k36VOdGpa+BYW/xjYuYdIAKNrfAEnfeQRbYp1VGIfyjgMEcx7Yi
 TzNmangYj+9f60u1MQq2YQytFFtgfcG1utTIuvKKhuJ/pZEjCkYKBQjNOLFuetaI
 oCxNDklcnCn5zxUGsQwpxxMf+A1Ja6tPHkqdN2p+0OQpUpr0i2mCMMrSPEHY0RgV
 zRBhsIwwe9eTAOPkZmr6SnCVIAs2rANVnBfZGJC/k9bT7cckhmL/EcGZLBIvRe8L
 gD4HtZsltNwbCh/cV4qIvx/nUaW1No/iqvQERtgAGWQtCUp/Jgmy3roV4zzWBiOR
 /N88kBaO5fw7crVFDMLTlHVKc2IKWTzSnpEUIllLw/G8ySjW5tjXP57gaxb712BU
 KYmcl6KFZ8Uu8OfyDYR6dRPtk+ayqAhSqBql+NveOWLk+nYFFyoob62FPTFq64eu
 MwM1BKlFKxLmMUeBTpSJXG/rtVkE+kgocZrB6GEofhIn7gjELqsaWutOJ6LYQ4wY
 i4N0NcBA3/oFu7N9T7yY+mKJCwRovyrpqW3Lp62xvns8+Y2ziUNxY4e0NvopzIOi
 GYz+ktI3CT1cZv9zkdEI+TOnRrWze8N7Xzt9ii8SD456to5wcaRCjmpATnNIKTTi
 uLmNaB6M9+mTjIXR8MDb
 =qXVf
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-3.8-single-zimage' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into next/multiplatform

From Stephen Warren:
ARM: tegra: single-zImage preparation work

Various cleanups and enhancements are made to core Tegra code towards the
aim of including Tegra in a multi-platform ARM kernel:

RTC, timer, and TWD are configured via device tree.

SPARSE_IRQ is enabled.

Tegra's debug_ll options are simplified, and the macros brought into
line with other multi-platform implementations, and moved to the new
common location.

Two headers still need to be eliminated in order to include Tegra in a
multi-platform kernel/ <mach/{clk,powergate}.h>. A new common API needs
to be invented to replace parts of clk.h. powergate.h might be replaced
by regulators; this needs more investigation.

This pull request is based on tegra-for-3.8-dt, followed by a merge of
arm-soc's devel/debug_ll_init branch.

* tag 'tegra-for-3.8-single-zimage' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra: (58 commits)
  ARM: tegra: move debug-macro.S to include/debug
  ARM: tegra: don't include iomap.h from debug-macro.S
  ARM: tegra: decouple uncompress.h and debug-macro.S
  ARM: tegra: simplify DEBUG_LL UART selection options
  ARM: tegra: select SPARSE_IRQ
  ARM: tegra: enhance timer.c to get IO address from device tree
  ARM: tegra: enhance timer.c to get IRQ info from device tree
  ARM: timer: fix checkpatch warnings
  ARM: tegra: add TWD to device tree
  ARM: tegra: define DT bindings for and instantiate RTC
  ARM: tegra: define DT bindings for and instantiate timer
  ARM: tegra: whistler: enable HDMI port
  ARM: tegra: tec: Enable HDMI output
  ARM: tegra: plutux: Enable HDMI output
  ARM: tegra: tamonten: Add host1x support
  ARM: tegra: trimslice: enable HDMI port
  ARM: tegra: harmony: enable HDMI port
  ARM: tegra: Add Tegra30 host1x support
  ARM: tegra: Add Tegra20 host1x support
  ARM: tegra: trimslice: enable SPI flash
  ...
2012-11-21 00:31:08 -08:00
Olof Johansson bcc5155d05 ARM: tegra: cleanup for 3.8
Various trivial cleanup changes of the Tegra code for 3.8.
 
 Many of the changes simply remove useless #include statements, which
 enable those headers to be removed or moved later, as work towards
 multi-platform zImage support.
 
 <mach/{iram,io}map.h> are moved up to arch/arm/mach-tegra to prevent
 any new code outside mach-tegra from using them.
 
 Finally, the regulator definitions in all board device tree files are
 updated to use the new simpler syntax that was agreed upon.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQpo5eAAoJEMzrak5tbycxhpoQAIZPMMXemJP7Hqvtx0iza5jG
 LVbBqb+sTEhESpdd43XeMK8n9umjVszseRJYm3vbekJp3crVE/Z0ikTTzmDUiwIj
 iz1t9U1i+EsAVZ977DF68InA/lWociKVqaDO4WEN4YZ19zGQJbghFKVic5yVZvNq
 hRWNvDUkRi+9FJHS7wBHQNuRIghSDxh90zFoc0UUs12J2z2OjXKPYypU7Ttp6aUY
 rBvuDlqRQ9SjFxuE2dYDvEWnB69ONL7LauAkSkoqgXGGP1a6v5pphm+Y3badCOrO
 q5hGUpvzO+DTfOncj5dlZedRq9vjS/QEF+qJQFvMPrUpv8QkOulY4nf7w/sYmk9o
 Rhm9G6BxFGDMdxruA9SBkqjEzPcI9cT18FRYkMtsHfWwUgu6NUB6bMhc++R6rOJS
 JNkH+DoWuEsGP2RyopZZEjKlrCxPv3vNNOz4wkaLH+gEQvE9EZ5mkqy8xNYQbMBb
 Yv93TCADrX9tw/3JfWjB6/WhZ9GVBcSie0hcW+2Nm7lUzzQ8q9DKMZobG20+KHBZ
 /+L4NmK7DR5u8M6xnZqPat2VAraFxYZFjy3Xd50ul7PphfJnR4c7ITqt4u6lJ6hn
 Bnc7/DNM5hgAncH+APon1tffLMqgsJphC4Chn7y7Y/wSYi216IA21pmSrrmpKkh9
 OqBOasN9GVmmHVnxNzHn
 =aH3p
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-3.8-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into next/cleanup

From Stephen Warren:
ARM: tegra: cleanup for 3.8

Various trivial cleanup changes of the Tegra code for 3.8.

Many of the changes simply remove useless #include statements, which
enable those headers to be removed or moved later, as work towards
multi-platform zImage support.

<mach/{iram,io}map.h> are moved up to arch/arm/mach-tegra to prevent
any new code outside mach-tegra from using them.

Finally, the regulator definitions in all board device tree files are
updated to use the new simpler syntax that was agreed upon.

* tag 'tegra-for-3.8-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra:
  ARM: tegra: move irammap.h to mach-tegra
  ARM: tegra: move iomap.h to mach-tegra
  ARM: tegra: remove <mach/dma.h>
  ARM: tegra: move tegra-ahb.h out of arch/arm/mach-tegra/
  ARM: tegra: remove unnecessary includes of <mach/*.h>
  iommu: tegra: remove include of <mach/iomap.h>
  staging: nvec: remove include of <mach/iomap.h>
  crypto: tegra: remove include of <mach/clk.h>
  ARM: tegra: update *.dts for regulator-compatible deprecation
  usb: phy: tegra remove include of <mach/iomap.h>
  usb: host: tegra remove include of <mach/iomap.h>
2012-11-21 00:17:40 -08:00
Nathan Fontenot 1cf3d8b3d2 powerpc+of: Add of node/property notification chain for adds and removes
This patch moves the notification chain for updates to the device tree
from the powerpc/pseries code to the base OF code. This makes this
functionality available to all architectures.

Additionally the notification chain is updated to allow notifications
for property add/remove/update. To make this work a pointer to a new
struct (of_prop_reconfig) is passed to the routines in the notification chain.
The of_prop_reconfig property contains a pointer to the node containing the
property and a pointer to the property itself. In the case of property
updates, the property pointer refers to the new property.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-11-15 12:56:41 +11:00
Sachin Kamat a465348ff5 crypto: s5p-sss - Fix compilation error
struct s3c2410_dma_client gets defined multiple times as it is defined
in more than one header file. Changing it at the header file level causes
many more build breakages as they are interdependent in a complex way.
Hence fixing this problem by using the mach version of the header file.

Without this patch, following build error is observed:
arch/arm/plat-samsung/include/plat/dma-pl330.h:106:27: error:
redefinition of struct s3c2410_dma_client

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-11-09 17:32:33 +08:00
Axel Lin 14198dd64b crypto: picoxcell - Add terminating entry for platform_device_id table
The platform_device_id table is supposed to be zero-terminated.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Jamie Iles <jamie@jamieiles.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-11-09 17:32:33 +08:00
Sebastian Andrzej Siewior d87d77128f crypto: omap-aes - select BLKCIPHER2
without it:
|drivers/built-in.o:(.data+0x14588): undefined reference to `crypto_ablkcipher_type'
|drivers/built-in.o:(.data+0x14668): undefined reference to `crypto_ablkcipher_type'

Not sure when this broke.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-11-09 17:32:32 +08:00
Wei Yongjun d48e366e6e crypto: tegra-aes - fix error-valued pointer dereference
clk_put(dd->aes_clk) will dereference an error-valued pointer since the
dd->aes_clk is a ERR_PTR() value. The correct check is call clk_put()
if !IS_ERR(dd->aes_clk).

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-11-09 17:32:27 +08:00
Stephen Warren f39b158d66 crypto: tegra: remove include of <mach/clk.h>
Nothing from this file is used, and the file will hopefully be deleted
soon.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-11-05 11:36:05 -07:00
Linus Walleij 865fab601b ARM: plat-nomadik: move DMA40 header to <linux/platform_data>
This moves the DMA40 platform data header from <plat/ste_dma40.h>
to <linux/platform_data/dma-ste-dma40.h> where is belongs.

Cc: Dan Williams <djbw@fb.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Ola Lilja <ola.o.lilja@stericsson.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Andreas Westin <andreas.westin@stericsson.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2012-11-05 09:55:32 +01:00
Wei Yongjun 3200da8d9a crypto: tegra - fix missing unlock on error case
Add the missing unlock on the error handling path in function
tegra_aes_get_random() and tegra_aes_rng_reset().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-10-24 21:10:56 +08:00
Tony Lindgren 94c657853b Merge branch 'omap-for-v3.8/cleanup-headers-dma' into omap-for-v3.8/cleanup-headers
Conflicts:
	drivers/crypto/omap-aes.c
	drivers/crypto/omap-sham.c
	drivers/dma/omap-dma.c
2012-10-17 10:01:30 -07:00
Tony Lindgren 27615a97b2 ARM: OMAP: Trivial driver changes to remove include plat/cpu.h
Drivers should not use cpu_is_omap or cpu_class_is_omap macros,
they should be private to the platform init code. And we'll be
removing plat/cpu.h and only have a private soc.h for the
arch/arm/*omap* code.

This patch is intended as preparation for the core omap changes
and removes the need to include plat/cpu.h from several drivers.
This is needed for the ARM common zImage support.

These changes are OK to do because:

- omap-rng.c does not need plat/cpu.h

- omap-aes.c and omap-sham.c get the proper platform_data
  passed to them so they don't need extra checks in the driver

- omap-dma.c and omap-pcm.c can test the arch locally as
  omap1 and omap2 cannot be compiled together because of
  conflicting compiler flags

Cc: Deepak Saxena <dsaxena@plexity.net>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David S. Miller <davem@davemloft.net>
Cc: Venkatraman S <svenkatr@ti.com>
Cc: Chris Ball <cjb@laptop.org>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <djbw@fb.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-crypto@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
[tony@atomide.com: mmc changes folded in to an earlier patch]
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-15 16:24:23 -07:00
Lokesh Vutla 2b6c4e7324 ARM: OMAP: DMA: Move plat/dma.h to plat-omap/dma-omap.h
Move plat/dma.h to plat-omap/dma-omap.h as part of single
zImage work

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-15 14:04:53 -07:00
Wei Yongjun 7291a932c6 crypto: talitos - convert to use be16_add_cpu()
Convert cpu_to_be16(be16_to_cpu(E1) + E2) to use be16_add_cpu().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-10-15 22:18:26 +08:00
Linus Torvalds 5e090ed7af ARM: soc: late platform updates
This branch contains updates to OMAP and Marvell platforms (kirkwood,
 dove, mvebu) that came in after we had done the big multiplatform merges,
 so they were kept separate from the rest, and not separated into the
 traditional topics of cleanup/driver/platform features.
 
 For OMAP, the updates are:
 - Runtime PM conversions for the GPMC and RNG IP blocks
 - Preparation patches for the OMAP common clock framework conversion
 - clkdev alias additions required by other drivers
 - Performance Monitoring Unit (PMU) support for OMAP2, 3, and non-4430 OMAP4
 - OMAP hwmod code and data improvements
 - Preparation patches for the IOMMU runtime PM conversion
 - Preparation patches for OMAP4 full-chip retention support
 
 For Kirkwood/Dove/mvebu:
 
 - New driver for "address decoder controller" for mvebu, which
   is a piece of hardware that configures addressable devices and
   peripherals. First user is the boot rom aperture on armada XP since
   it is needed for SMP support.
 - New device tree bindings for peripherals such as gpio-fan, iconnect
   nand, mv_cesa and the above address decoder controller.
 - Some defconfig updates, mostly to enable new DT boards and a few drivers.
 - New drivers using the pincontrol subsystem for dove, kirkwood and mvebu
 - New clean gpio driver for mvebu
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQblIiAAoJEIwa5zzehBx3J1EP/1pxMqjVKQDXxak+A6g8a7r0
 hUTjqfiA9nZ4st+nk3PKJL9DNkoTEoZZqXghYRA+N6ej4hAaFJX1izgQDtjtjfRE
 s2izZuxGka8Oiic6FpCUoQnMORg10tSLgyvlHNW4hXy3qpe2C4u1D2GJwA/GPeLQ
 lHREekcJ3RKWutpG2hMtCT+9Bm4AwnnMY5uO39gxoXeMn6RoaACNIyYxz0NeL5bV
 GDuawi7Pc4KJTXX+D/VU0o7VtksiUO8YBczFEra/9khSL/RI2PFalIX3DKiioqvA
 yUA11d9proqojIdfdjVRPBHnIMl49H8ohBwbQfKnkNz9msl1BKN5PbakKls97mQ+
 vaJpoACnc/3x4P/izEpwry5XqeIl5S5mwz4R4+fojpWpp4JPcly/cAKMAsXf5WRi
 NF50E4D/8ysHE8WuBU5YHFgEEbn3nXkRbNMgdYtUwzixdmNJNaU8+33BJo34c4j0
 DNktiEdKUBoiiEdsC1MgH86olD/sFNUxvXBub30hhOywoapgQE61fGQGxG38DV/K
 kspTHz9SKUrmgbYEyMNOhz4paRrheYxx9cAgKP7Hp7m4Gu8d6ZqRqLqN9hbAbLuW
 TbH2FpqcjSw4KnYYCepTixJ3dhGiICiILWHfsW3qCj5Le3YVwedCpBCL1/I+RqEP
 kYTToVhur/T1yamHAmBi
 =xVaJ
 -----END PGP SIGNATURE-----

Merge tag 'soc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull late ARM soc platform updates from Olof Johansson:
 "This branch contains updates to OMAP and Marvell platforms (kirkwood,
  dove, mvebu) that came in after we had done the big multiplatform
  merges, so they were kept separate from the rest, and not separated
  into the traditional topics of cleanup/driver/platform features.

  For OMAP, the updates are:
   - Runtime PM conversions for the GPMC and RNG IP blocks
   - Preparation patches for the OMAP common clock framework conversion
   - clkdev alias additions required by other drivers
   - Performance Monitoring Unit (PMU) support for OMAP2, 3, and
     non-4430 OMAP4
   - OMAP hwmod code and data improvements
   - Preparation patches for the IOMMU runtime PM conversion
   - Preparation patches for OMAP4 full-chip retention support

  For Kirkwood/Dove/mvebu:
   - New driver for "address decoder controller" for mvebu, which is a
     piece of hardware that configures addressable devices and
     peripherals.  First user is the boot rom aperture on armada XP
     since it is needed for SMP support.
   - New device tree bindings for peripherals such as gpio-fan, iconnect
     nand, mv_cesa and the above address decoder controller.
   - Some defconfig updates, mostly to enable new DT boards and a few
     drivers.
   - New drivers using the pincontrol subsystem for dove, kirkwood and
     mvebu
   - New clean gpio driver for mvebu"

* tag 'soc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (98 commits)
  ARM: mvebu: fix build breaks from multi-platform conversion
  ARM: OMAP4460/4470: PMU: Enable PMU for OMAP4460/70
  ARM: OMAP2+: PMU: Add runtime PM support
  ARM: OMAP4430: PMU: prepare to create PMU device via HWMOD
  ARM: OMAP2+: PMU: Convert OMAP2/3 devices to use HWMOD
  ARM: OMAP3: hwmod data: Add debugss HWMOD data
  ARM: OMAP2+: clockdomain/hwmod: add workaround for EMU clockdomain idle problems
  ARM: OMAP: Add a timer attribute for timers that can interrupt the DSP
  hwrng: OMAP: remove SoC restrictions from driver registration
  ARM: OMAP: split OMAP1, OMAP2+ RNG device registration
  hwrng: OMAP: convert to use runtime PM
  hwrng: OMAP: store per-device data in per-device variables, not file statics
  ARM: OMAP2xxx: hwmod/CM: add RNG integration data
  ARM: OMAP2+: gpmc: minimal driver support
  ARM: OMAP2+: gpmc: Adapt to HWMOD
  ARM: OMAP2/3: hwmod data: add gpmc
  ARM: OMAP4: hwmod data: add mmu hwmod for ipu and dsp
  ARM: OMAP3: hwmod data: add mmu data for iva and isp
  ARM: OMAP: iommu: fix including iommu.h without IOMMU_API selected
  ARM: OMAP4: hwmod data: add missing HWMOD_NO_IDLEST flags to some PRCM IP blocks
  ...
2012-10-07 20:55:16 +09:00
Linus Torvalds 5f3d2f2e1a Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc updates from Benjamin Herrenschmidt:
 "Some highlights in addition to the usual batch of fixes:

   - 64TB address space support for 64-bit processes by Aneesh Kumar

   - Gavin Shan did a major cleanup & re-organization of our EEH support
     code (IBM fancy PCI error handling & recovery infrastructure) which
     paves the way for supporting different platform backends, along
     with some rework of the PCIe code for the PowerNV platform in order
     to remove home made resource allocations and instead use the
     generic code (which is possible after some small improvements to it
     done by Gavin).

   - Uprobes support by Ananth N Mavinakayanahalli

   - A pile of embedded updates from Freescale folks, including new SoC
     and board supports, more KVM stuff including preparing for 64-bit
     BookE KVM support, ePAPR 1.1 updates, etc..."

Fixup trivial conflicts in drivers/scsi/ipr.c

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (146 commits)
  powerpc/iommu: Fix multiple issues with IOMMU pools code
  powerpc: Fix VMX fix for memcpy case
  driver/mtd:IFC NAND:Initialise internal SRAM before any write
  powerpc/fsl-pci: use 'Header Type' to identify PCIE mode
  powerpc/eeh: Don't release eeh_mutex in eeh_phb_pe_get
  powerpc: Remove tlb batching hack for nighthawk
  powerpc: Set paca->data_offset = 0 for boot cpu
  powerpc/perf: Sample only if SIAR-Valid bit is set in P7+
  powerpc/fsl-pci: fix warning when CONFIG_SWIOTLB is disabled
  powerpc/mpc85xx: Update interrupt handling for IFC controller
  powerpc/85xx: Enable USB support in p1023rds_defconfig
  powerpc/smp: Do not disable IPI interrupts during suspend
  powerpc/eeh: Fix crash on converting OF node to edev
  powerpc/eeh: Lock module while handling EEH event
  powerpc/kprobe: Don't emulate store when kprobe stwu r1
  powerpc/kprobe: Complete kprobe and migrate exception frame
  powerpc/kprobe: Introduce a new thread flag
  powerpc: Remove unused __get_user64() and __put_user64()
  powerpc/eeh: Global mutex to protect PE tree
  powerpc/eeh: Remove EEH PE for normal PCI hotplug
  ...
2012-10-06 03:16:12 +09:00
Linus Torvalds d66e6737d4 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto update from Herbert Xu:
 - Optimised AES/SHA1 for ARM.
 - IPsec ESN support in talitos and caam.
 - x86_64/avx implementation of cast5/cast6.
 - Add/use multi-algorithm registration helpers where possible.
 - Added IBM Power7+ in-Nest support.
 - Misc fixes.

Fix up trivial conflicts in crypto/Kconfig due to the sparc64 crypto
config options being added next to the new ARM ones.

[ Side note: cut-and-paste duplicate help texts make those conflicts
  harder to read than necessary, thanks to git being smart about
  minimizing conflicts and maximizing the common parts... ]

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (71 commits)
  crypto: x86/glue_helper - fix storing of new IV in CBC encryption
  crypto: cast5/avx - fix storing of new IV in CBC encryption
  crypto: tcrypt - add missing tests for camellia and ghash
  crypto: testmgr - make test_aead also test 'dst != src' code paths
  crypto: testmgr - make test_skcipher also test 'dst != src' code paths
  crypto: testmgr - add test vectors for CTR mode IV increasement
  crypto: testmgr - add test vectors for partial ctr(cast5) and ctr(cast6)
  crypto: testmgr - allow non-multi page and multi page skcipher tests from same test template
  crypto: caam - increase TRNG clocks per sample
  crypto, tcrypt: remove local_bh_disable/enable() around local_irq_disable/enable()
  crypto: tegra-aes - fix error return code
  crypto: crypto4xx - fix error return code
  crypto: hifn_795x - fix error return code
  crypto: ux500 - fix error return code
  crypto: caam - fix error IDs for SEC v5.x RNG4
  hwrng: mxc-rnga - Access data via structure
  hwrng: mxc-rnga - Adapt clocks to new i.mx clock framework
  crypto: caam - add IPsec ESN support
  crypto: 842 - remove .cra_list initialization
  Revert "[CRYPTO] cast6: inline bloat--"
  ...
2012-10-04 09:06:34 -07:00
Linus Torvalds a20acf99f7 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next
Pull sparc updates from David Miller:
 "Largely this is simply adding support for the Niagara 4 cpu.

  Major areas are perf events (chip now supports 4 counters and can
  monitor any event on each counter), crypto (opcodes are availble for
  sha1, sha256, sha512, md5, crc32c, AES, DES, CAMELLIA, and Kasumi
  although the last is unsupported since we lack a generic crypto layer
  Kasumi implementation), and an optimized memcpy.

  Finally some cleanups by Peter Senna Tschudin."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next: (47 commits)
  sparc64: Fix trailing whitespace in NG4 memcpy.
  sparc64: Fix comment type in NG4 copy from user.
  sparc64: Add SPARC-T4 optimized memcpy.
  drivers/sbus/char: removes unnecessary semicolon
  arch/sparc/kernel/pci_sun4v.c: removes unnecessary semicolon
  sparc64: Fix function argument comment in camellia_sparc64_key_expand asm.
  sparc64: Fix IV handling bug in des_sparc64_cbc_decrypt
  sparc64: Add auto-loading mechanism to crypto-opcode drivers.
  sparc64: Add missing pr_fmt define to crypto opcode drivers.
  sparc64: Adjust crypto priorities.
  sparc64: Use cpu_pgsz_mask for linear kernel mapping config.
  sparc64: Probe cpu page size support more portably.
  sparc64: Support 2GB and 16GB page sizes for kernel linear mappings.
  sparc64: Fix bugs in unrolled 256-bit loops.
  sparc64: Avoid code duplication in crypto assembler.
  sparc64: Unroll CTR crypt loops in AES driver.
  sparc64: Unroll ECB decryption loops in AES driver.
  sparc64: Unroll ECB encryption loops in AES driver.
  sparc64: Add ctr mode support to AES driver.
  sparc64: Move AES driver over to a methods based implementation.
  ...
2012-10-02 12:57:42 -07:00
Kim Phillips a5bbf6fa79 crypto: caam - increase TRNG clocks per sample
we need to configure the TRNG to use more clocks per sample
to handle the two back-to-back 64KiB random descriptor requests
on higher frequency P5040s.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-09-27 13:32:15 +08:00
Peter Senna Tschudin 35c41db8f9 crypto: tegra-aes - fix error return code
Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-09-27 13:32:15 +08:00
Peter Senna Tschudin b48ae1df54 crypto: crypto4xx - fix error return code
Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-09-27 13:32:15 +08:00
Peter Senna Tschudin c2ff861d96 crypto: hifn_795x - fix error return code
Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-09-27 13:32:14 +08:00
Peter Senna Tschudin 79c09c122f crypto: ux500 - fix error return code
Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Reviewed-by: Arun Murthy <arunrmurthy83@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-09-27 13:32:14 +08:00
Horia Geanta 39ab735835 crypto: caam - fix error IDs for SEC v5.x RNG4
According to SEC v5.0-v5.3 reference manuals.

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-09-27 13:32:14 +08:00
Olof Johansson d6a93ceb3f Merge branch 'kirkwood/dt' of git://git.infradead.org/users/jcooper/linux into late/kirkwood
From Jason Cooper:

New bindings:
  - iconnect nand and keys
  - mv_cesa
  - gpio-fan

* 'kirkwood/dt' of git://git.infradead.org/users/jcooper/linux:
  ARM: kirkwood: Use devicetree to define DNS-32[05] fan
  hwmon: Add devicetree bindings to gpio-fan
  Crypto: CESA: Add support for DT based instantiation.
  ARM: Kirkwood: Describe iconnect nand in DT.
  ARM: Kirkwood: Describe iconnect keys in DT.
2012-09-22 13:24:09 -07:00
Andrew Lunn f37fbd36c5 Crypto: CESA: Add support for DT based instantiation.
Based on work by Michael Walle and Jason Cooper.

Added support for getting the interrupt number and address of SRAM
from DT.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>

Conflicts:

	arch/arm/mach-kirkwood/board-dt.c
2012-09-22 14:40:00 +00:00
Olof Johansson e3a66aa33a Merge branch 'multiplatform/platform-data' into next/multiplatform
* multiplatform/platform-data:
  ARM: spear: move platform_data definitions
  ARM: samsung: move platform_data definitions
  ARM: orion: move platform_data definitions
  ARM: nomadik: move platform_data definitions
  ARM: w90x900: move platform_data definitions
  ARM: vt8500: move platform_data definitions
  ARM: tegra: move sdhci platform_data definition
  ARM: sa1100: move platform_data definitions
  ARM: pxa: move platform_data definitions
  ARM: netx: move platform_data definitions
  ARM: msm: move platform_data definitions
  ARM: imx: move platform_data definitions
  ARM: ep93xx: move platform_data definitions
  ARM: davinci: move platform_data definitions
  ARM: at91: move platform_data definitions

Conflicts due to removed files:
	arch/arm/mach-tegra/board-harmony.c
	arch/arm/mach-tegra/board-trimslice.c

Conflicts due to code removal:
	arch/arm/mach-tegra/board-paz00.c

Context conflicts in:
	drivers/mmc/host/sdhci-tegra.c
	drivers/net/irda/pxaficp_ir.c

Signed-off-by: Olof Johansson <olof@lixom.net>
2012-09-22 01:07:21 -07:00
David S. Miller 1080362425 sparc64: Adjust crypto priorities.
Make the crypto opcode implementations have a higher priority than
those provides by the ring buffer based Niagara crypto device.

Also, several crypto opcode hashes were not setting the priority value
at all.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-15 09:06:30 -07:00
Arnd Bergmann db298da2c3 ARM: nomadik: move platform_data definitions
Platform data for device drivers should be defined in
include/linux/platform_data/*.h, not in the architecture
and platform specific directories.

This moves such data out of the nomadik include directories

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Alessandro Rubini <rubini@unipv.it>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: STEricsson <STEricsson_nomadik_linux@list.st.com>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Andreas Westin <andreas.westin@stericsson.com>
2012-09-14 11:19:00 +02:00
Linus Torvalds 274a2f5ddb Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu:
 "This fixes the authenc self-test crash as well as a missing export of
  a symbol used by a module."

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: authenc - Fix crash with zero-length assoc data
  crypto/caam: Export gen_split_key symbol for other modules
2012-09-12 07:14:17 +08:00
Benjamin Herrenschmidt fff34b3412 Merge branch 'merge' into next
Brings in various bug fixes from 3.6-rcX
2012-09-07 09:48:59 +10:00
Horia Geanta 891104ed00 crypto: caam - add IPsec ESN support
Support for ESNs (extended sequence numbers).
Tested with strongswan by connecting back-to-back P1010RDB with P2020RDB.

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-09-07 04:17:07 +08:00
Sachin Kamat 49d30d3d5f crypto: geode-aes - Use module_pci_driver
module_pci_driver makes the code simpler by eliminating
module_init and module_exit calls.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-09-07 04:17:03 +08:00
Wei Yongjun 21a5b95f56 crypto: remove duplicated include
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-09-07 04:17:03 +08:00
Kim Phillips 2af8f4a272 crypto: caam - coccicheck fixes
use true/false for bool, fix code alignment, and fix two allocs with
no test.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-09-07 04:17:03 +08:00
Devendra Naga 6bbb98ddfc crypto: ux500/hash - remove unneeded return at ux500_hash_mod_fini
Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-09-07 04:17:03 +08:00
Ben Collins 3b75a2c126 crypto/caam: Export gen_split_key symbol for other modules
In 3.6-rc3, without this patch, the following error occurs with a modular build:

ERROR: "gen_split_key" [drivers/crypto/caam/caamhash.ko] undefined!
ERROR: "gen_split_key" [drivers/crypto/caam/caamalg.ko] undefined!

Signed-off-by: Ben Collins <ben.c@servergy.com>
Cc: Yuan Kang <Yuan.Kang@freescale.com>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-09-07 04:07:35 +08:00
Michael Ellerman 7187dafc1e powerpc/crypto: Remove users of virt_to_abs() and phys_to_abs() in nx crypto driver
phys_to_abs() is a nop, don't use it.

virt_to_abs() is just a wrapper around __pa(), call __pa() directly.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-09-05 15:18:42 +10:00
Horia Geanta e763eb699b crypto: talitos - add IPsec ESN support
Support for ESNs (extended sequence numbers).
Tested with strongswan on a P2020RDB back-to-back setup.
Extracted from /etc/ipsec.conf:
esp=aes-sha1-esn-modp4096!

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-28 23:56:30 +08:00
Horia Geanta 79fd31d355 crypto: talitos - support for assoc data provided as scatterlist
Generate a link table in case assoc data is a scatterlist.
While at it, add support for handling non-contiguous assoc data and iv.

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-28 23:56:27 +08:00
Horia Geanta 2a1cfe46b1 crypto: talitos - change type and name for [src|dst]_is_chained
It's more natural to think of these vars as bool rather than int.

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-28 23:56:26 +08:00
Horia Geanta 602499a342 crypto: talitos - prune unneeded descriptor allocation param
talitos_edesc_alloc does not need hash_result param.
Checking whether dst scatterlist is NULL or not is all that is required.

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-28 23:56:26 +08:00
Horia Geanta 60542505b0 crypto: talitos - fix icv management on outbound direction
For IPsec encryption, in the case when:
-the input buffer is fragmented (edesc->src_nents > 0)
-the output buffer is not fragmented (edesc->dst_nents = 0)
the ICV is not output in the link table, but after the encrypted payload.

Copying the ICV must be avoided in this case; consequently the condition
edesc->dma_len > 0 must be more specific, i.e. must depend on the type
of the output buffer - fragmented or not.

Testing was performed by modifying testmgr to support src != dst,
since currently native kernel IPsec does in-place encryption
(src == dst).

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-28 23:56:26 +08:00
Kim Phillips b286e00304 crypto: talitos - consolidate common cra_* assignments
the entry points and geniv definitions for all aead,
ablkcipher, and hash algorithms are all common; move them to a
single assignment in talitos_alg_alloc().

This assumes it's ok to assign a setkey() on non-hmac algs.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-28 23:53:53 +08:00
Kim Phillips d4cd3283f6 crypto: talitos - consolidate cra_type assignments
lighten driver_algs[] by moving them to talitos_alg_alloc().

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-28 23:53:53 +08:00
Linus Torvalds 2d809dcd88 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu:
 "This push fixes a build error on 32-bit archs in the hifn driver as
  well as a potential deadlock in the caam driver."

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: caam - fix possible deadlock condition
  crypto: hifn_795x - fix 64bit division and undefined __divdi3 on 32bit archs
2012-08-23 21:58:04 -07:00
Kim Phillips ce026cb9cb crypto: caam - fix possible deadlock condition
commit "crypto: caam - use non-irq versions of spinlocks for job rings"
made two bad assumptions:

(a) The caam_jr_enqueue lock isn't used in softirq context.
Not true: jr_enqueue can be interrupted by an incoming net
interrupt and the received packet may be sent for encryption,
via caam_jr_enqueue in softirq context, thereby inducing a
deadlock.

This is evidenced when running netperf over an IPSec tunnel
between two P4080's, with spinlock debugging turned on:

[  892.092569] BUG: spinlock lockup on CPU#7, netperf/10634, e8bf5f70
[  892.098747] Call Trace:
[  892.101197] [eff9fc10] [c00084c0] show_stack+0x48/0x15c (unreliable)
[  892.107563] [eff9fc50] [c0239c2c] do_raw_spin_lock+0x16c/0x174
[  892.113399] [eff9fc80] [c0596494] _raw_spin_lock+0x3c/0x50
[  892.118889] [eff9fc90] [c0445e74] caam_jr_enqueue+0xf8/0x250
[  892.124550] [eff9fcd0] [c044a644] aead_decrypt+0x6c/0xc8
[  892.129625] BUG: spinlock lockup on CPU#5, swapper/5/0, e8bf5f70
[  892.129629] Call Trace:
[  892.129637] [effa7c10] [c00084c0] show_stack+0x48/0x15c (unreliable)
[  892.129645] [effa7c50] [c0239c2c] do_raw_spin_lock+0x16c/0x174
[  892.129652] [effa7c80] [c0596494] _raw_spin_lock+0x3c/0x50
[  892.129660] [effa7c90] [c0445e74] caam_jr_enqueue+0xf8/0x250
[  892.129666] [effa7cd0] [c044a644] aead_decrypt+0x6c/0xc8
[  892.129674] [effa7d00] [c0509724] esp_input+0x178/0x334
[  892.129681] [effa7d50] [c0519778] xfrm_input+0x77c/0x818
[  892.129688] [effa7da0] [c050e344] xfrm4_rcv_encap+0x20/0x30
[  892.129697] [effa7db0] [c04b90c8] ip_local_deliver+0x190/0x408
[  892.129703] [effa7de0] [c04b966c] ip_rcv+0x32c/0x898
[  892.129709] [effa7e10] [c048b998] __netif_receive_skb+0x27c/0x4e8
[  892.129715] [effa7e80] [c048d744] netif_receive_skb+0x4c/0x13c
[  892.129726] [effa7eb0] [c03c28ac] _dpa_rx+0x1a8/0x354
[  892.129732] [effa7ef0] [c03c2ac4] ingress_rx_default_dqrr+0x6c/0x108
[  892.129742] [effa7f10] [c0467ae0] qman_poll_dqrr+0x170/0x1d4
[  892.129748] [effa7f40] [c03c153c] dpaa_eth_poll+0x20/0x94
[  892.129754] [effa7f60] [c048dbd0] net_rx_action+0x13c/0x1f4
[  892.129763] [effa7fa0] [c003d1b8] __do_softirq+0x108/0x1b0
[  892.129769] [effa7ff0] [c000df58] call_do_softirq+0x14/0x24
[  892.129775] [ebacfe70] [c0004868] do_softirq+0xd8/0x104
[  892.129780] [ebacfe90] [c003d5a4] irq_exit+0xb8/0xd8
[  892.129786] [ebacfea0] [c0004498] do_IRQ+0xa4/0x1b0
[  892.129792] [ebacfed0] [c000fad8] ret_from_except+0x0/0x18
[  892.129798] [ebacff90] [c0009010] cpu_idle+0x94/0xf0
[  892.129804] [ebacffb0] [c059ff88] start_secondary+0x42c/0x430
[  892.129809] [ebacfff0] [c0001e28] __secondary_start+0x30/0x84
[  892.281474]
[  892.282959] [eff9fd00] [c0509724] esp_input+0x178/0x334
[  892.288186] [eff9fd50] [c0519778] xfrm_input+0x77c/0x818
[  892.293499] [eff9fda0] [c050e344] xfrm4_rcv_encap+0x20/0x30
[  892.299074] [eff9fdb0] [c04b90c8] ip_local_deliver+0x190/0x408
[  892.304907] [eff9fde0] [c04b966c] ip_rcv+0x32c/0x898
[  892.309872] [eff9fe10] [c048b998] __netif_receive_skb+0x27c/0x4e8
[  892.315966] [eff9fe80] [c048d744] netif_receive_skb+0x4c/0x13c
[  892.321803] [eff9feb0] [c03c28ac] _dpa_rx+0x1a8/0x354
[  892.326855] [eff9fef0] [c03c2ac4] ingress_rx_default_dqrr+0x6c/0x108
[  892.333212] [eff9ff10] [c0467ae0] qman_poll_dqrr+0x170/0x1d4
[  892.338872] [eff9ff40] [c03c153c] dpaa_eth_poll+0x20/0x94
[  892.344271] [eff9ff60] [c048dbd0] net_rx_action+0x13c/0x1f4
[  892.349846] [eff9ffa0] [c003d1b8] __do_softirq+0x108/0x1b0
[  892.355338] [eff9fff0] [c000df58] call_do_softirq+0x14/0x24
[  892.360910] [e7169950] [c0004868] do_softirq+0xd8/0x104
[  892.366135] [e7169970] [c003d5a4] irq_exit+0xb8/0xd8
[  892.371101] [e7169980] [c0004498] do_IRQ+0xa4/0x1b0
[  892.375979] [e71699b0] [c000fad8] ret_from_except+0x0/0x18
[  892.381466] [e7169a70] [c0445e74] caam_jr_enqueue+0xf8/0x250
[  892.387127] [e7169ab0] [c044ad4c] aead_givencrypt+0x6ac/0xa70
[  892.392873] [e7169b20] [c050a0b8] esp_output+0x2b4/0x570
[  892.398186] [e7169b80] [c0519b9c] xfrm_output_resume+0x248/0x7c0
[  892.404194] [e7169bb0] [c050e89c] xfrm4_output_finish+0x18/0x28
[  892.410113] [e7169bc0] [c050e8f4] xfrm4_output+0x48/0x98
[  892.415427] [e7169bd0] [c04beac0] ip_local_out+0x48/0x98
[  892.420740] [e7169be0] [c04bec7c] ip_queue_xmit+0x16c/0x490
[  892.426314] [e7169c10] [c04d6128] tcp_transmit_skb+0x35c/0x9a4
[  892.432147] [e7169c70] [c04d6f98] tcp_write_xmit+0x200/0xa04
[  892.437808] [e7169cc0] [c04c8ccc] tcp_sendmsg+0x994/0xcec
[  892.443213] [e7169d40] [c04eebfc] inet_sendmsg+0xd0/0x164
[  892.448617] [e7169d70] [c04792f8] sock_sendmsg+0x8c/0xbc
[  892.453931] [e7169e40] [c047aecc] sys_sendto+0xc0/0xfc
[  892.459069] [e7169f10] [c047b934] sys_socketcall+0x110/0x25c
[  892.464729] [e7169f40] [c000f480] ret_from_syscall+0x0/0x3c

(b) since the caam_jr_dequeue lock is only used in bh context,
then semantically it should use _bh spin_lock types.  spin_lock_bh
semantics are to disable back-halves, and used when a lock is shared
between softirq (bh) context and process and/or h/w IRQ context.
Since the lock is only used within softirq context, and this tasklet
is atomic, there is no need to do the additional work to disable
back halves.

This patch adds back-half disabling protection to caam_jr_enqueue
spin_locks to fix (a), and drops it from caam_jr_dequeue to fix (b).

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-20 16:35:40 +08:00
Tushar Behera 22eed1ca19 crypto: atmel - Remove possible typo error
Commit bd3c7b5c2a ("crypto: atmel - add Atmel AES driver") possibly
has a typo error of adding an extra CONFIG_.

CC: Nicolas Royer <nicolas@eukrea.com>
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-20 16:28:13 +08:00
Michael Ellerman 33b58b01ac crypto: nx - Remove virt_to_abs() usage in nx-842.c
virt_to_abs() is just a wrapper around __pa(), use __pa() directly.

We should be including <asm/page.h> to get __pa(). abs_addr.h will be
removed shortly so drop that.

We were getting of.h via abs_addr.h so we need to include that directly.

Having done all that, clean up the ordering of the includes.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-20 16:28:12 +08:00
Seth Jennings 0e16aafb12 powerpc/crypto: add 842 hardware compression driver
This patch adds the driver for interacting with the 842
compression accelerator on IBM Power7+ systems.

The device is a child of the Platform Facilities Option (PFO)
and shows up as a child of the IBM VIO bus.

The compression/decompression API takes the same arguments
as existing compression methods like lzo and deflate.  The 842
hardware operates on 4K hardware pages and the driver breaks up
input on 4K boundaries to submit it to the hardware accelerator.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-01 17:47:56 +08:00
Seth Jennings 322cacce0a powerpc/crypto: rework Kconfig
This patch creates a new submenu for the NX cryptographic
hardware accelerator and breaks the NX options into their own
Kconfig file under drivers/crypto/nx/Kconfig.

This will permit additional NX functionality to be easily
and more cleanly added in the future without touching
drivers/crypto/Makefile|Kconfig.

Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-01 17:47:52 +08:00
Kim Phillips 61bb86bba1 crypto: caam - set descriptor sharing type to SERIAL
SHARE_WAIT, whilst more optimal for association-less crypto,
has the ability to start thrashing the CCB descriptor/key
caches, given high levels of traffic across multiple security
associations (and thus keys).

Switch to using the SERIAL sharing type, which prefers
the last used CCB for the SA.  On a 2-DECO platform
such as the P3041, this can improve performance by
about 3.7%.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-01 17:47:31 +08:00
Shengzhou Liu 95bcaa3905 crypto: caam - add backward compatible string sec4.0
In some device trees of previous version, there were string "fsl,sec4.0".
To be backward compatible with device trees, we first check "fsl,sec-v4.0",
if it fails, then check for "fsl,sec4.0".

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>

extended to include new hash and rng code, which was omitted from
the previous version of this patch during a rebase of the SDK
version.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-01 17:47:31 +08:00
Kim Phillips 4a90507713 crypto: caam - fix possible deadlock condition
commit "crypto: caam - use non-irq versions of spinlocks for job rings"
made two bad assumptions:

(a) The caam_jr_enqueue lock isn't used in softirq context.
Not true: jr_enqueue can be interrupted by an incoming net
interrupt and the received packet may be sent for encryption,
via caam_jr_enqueue in softirq context, thereby inducing a
deadlock.

This is evidenced when running netperf over an IPSec tunnel
between two P4080's, with spinlock debugging turned on:

[  892.092569] BUG: spinlock lockup on CPU#7, netperf/10634, e8bf5f70
[  892.098747] Call Trace:
[  892.101197] [eff9fc10] [c00084c0] show_stack+0x48/0x15c (unreliable)
[  892.107563] [eff9fc50] [c0239c2c] do_raw_spin_lock+0x16c/0x174
[  892.113399] [eff9fc80] [c0596494] _raw_spin_lock+0x3c/0x50
[  892.118889] [eff9fc90] [c0445e74] caam_jr_enqueue+0xf8/0x250
[  892.124550] [eff9fcd0] [c044a644] aead_decrypt+0x6c/0xc8
[  892.129625] BUG: spinlock lockup on CPU#5, swapper/5/0, e8bf5f70
[  892.129629] Call Trace:
[  892.129637] [effa7c10] [c00084c0] show_stack+0x48/0x15c (unreliable)
[  892.129645] [effa7c50] [c0239c2c] do_raw_spin_lock+0x16c/0x174
[  892.129652] [effa7c80] [c0596494] _raw_spin_lock+0x3c/0x50
[  892.129660] [effa7c90] [c0445e74] caam_jr_enqueue+0xf8/0x250
[  892.129666] [effa7cd0] [c044a644] aead_decrypt+0x6c/0xc8
[  892.129674] [effa7d00] [c0509724] esp_input+0x178/0x334
[  892.129681] [effa7d50] [c0519778] xfrm_input+0x77c/0x818
[  892.129688] [effa7da0] [c050e344] xfrm4_rcv_encap+0x20/0x30
[  892.129697] [effa7db0] [c04b90c8] ip_local_deliver+0x190/0x408
[  892.129703] [effa7de0] [c04b966c] ip_rcv+0x32c/0x898
[  892.129709] [effa7e10] [c048b998] __netif_receive_skb+0x27c/0x4e8
[  892.129715] [effa7e80] [c048d744] netif_receive_skb+0x4c/0x13c
[  892.129726] [effa7eb0] [c03c28ac] _dpa_rx+0x1a8/0x354
[  892.129732] [effa7ef0] [c03c2ac4] ingress_rx_default_dqrr+0x6c/0x108
[  892.129742] [effa7f10] [c0467ae0] qman_poll_dqrr+0x170/0x1d4
[  892.129748] [effa7f40] [c03c153c] dpaa_eth_poll+0x20/0x94
[  892.129754] [effa7f60] [c048dbd0] net_rx_action+0x13c/0x1f4
[  892.129763] [effa7fa0] [c003d1b8] __do_softirq+0x108/0x1b0
[  892.129769] [effa7ff0] [c000df58] call_do_softirq+0x14/0x24
[  892.129775] [ebacfe70] [c0004868] do_softirq+0xd8/0x104
[  892.129780] [ebacfe90] [c003d5a4] irq_exit+0xb8/0xd8
[  892.129786] [ebacfea0] [c0004498] do_IRQ+0xa4/0x1b0
[  892.129792] [ebacfed0] [c000fad8] ret_from_except+0x0/0x18
[  892.129798] [ebacff90] [c0009010] cpu_idle+0x94/0xf0
[  892.129804] [ebacffb0] [c059ff88] start_secondary+0x42c/0x430
[  892.129809] [ebacfff0] [c0001e28] __secondary_start+0x30/0x84
[  892.281474]
[  892.282959] [eff9fd00] [c0509724] esp_input+0x178/0x334
[  892.288186] [eff9fd50] [c0519778] xfrm_input+0x77c/0x818
[  892.293499] [eff9fda0] [c050e344] xfrm4_rcv_encap+0x20/0x30
[  892.299074] [eff9fdb0] [c04b90c8] ip_local_deliver+0x190/0x408
[  892.304907] [eff9fde0] [c04b966c] ip_rcv+0x32c/0x898
[  892.309872] [eff9fe10] [c048b998] __netif_receive_skb+0x27c/0x4e8
[  892.315966] [eff9fe80] [c048d744] netif_receive_skb+0x4c/0x13c
[  892.321803] [eff9feb0] [c03c28ac] _dpa_rx+0x1a8/0x354
[  892.326855] [eff9fef0] [c03c2ac4] ingress_rx_default_dqrr+0x6c/0x108
[  892.333212] [eff9ff10] [c0467ae0] qman_poll_dqrr+0x170/0x1d4
[  892.338872] [eff9ff40] [c03c153c] dpaa_eth_poll+0x20/0x94
[  892.344271] [eff9ff60] [c048dbd0] net_rx_action+0x13c/0x1f4
[  892.349846] [eff9ffa0] [c003d1b8] __do_softirq+0x108/0x1b0
[  892.355338] [eff9fff0] [c000df58] call_do_softirq+0x14/0x24
[  892.360910] [e7169950] [c0004868] do_softirq+0xd8/0x104
[  892.366135] [e7169970] [c003d5a4] irq_exit+0xb8/0xd8
[  892.371101] [e7169980] [c0004498] do_IRQ+0xa4/0x1b0
[  892.375979] [e71699b0] [c000fad8] ret_from_except+0x0/0x18
[  892.381466] [e7169a70] [c0445e74] caam_jr_enqueue+0xf8/0x250
[  892.387127] [e7169ab0] [c044ad4c] aead_givencrypt+0x6ac/0xa70
[  892.392873] [e7169b20] [c050a0b8] esp_output+0x2b4/0x570
[  892.398186] [e7169b80] [c0519b9c] xfrm_output_resume+0x248/0x7c0
[  892.404194] [e7169bb0] [c050e89c] xfrm4_output_finish+0x18/0x28
[  892.410113] [e7169bc0] [c050e8f4] xfrm4_output+0x48/0x98
[  892.415427] [e7169bd0] [c04beac0] ip_local_out+0x48/0x98
[  892.420740] [e7169be0] [c04bec7c] ip_queue_xmit+0x16c/0x490
[  892.426314] [e7169c10] [c04d6128] tcp_transmit_skb+0x35c/0x9a4
[  892.432147] [e7169c70] [c04d6f98] tcp_write_xmit+0x200/0xa04
[  892.437808] [e7169cc0] [c04c8ccc] tcp_sendmsg+0x994/0xcec
[  892.443213] [e7169d40] [c04eebfc] inet_sendmsg+0xd0/0x164
[  892.448617] [e7169d70] [c04792f8] sock_sendmsg+0x8c/0xbc
[  892.453931] [e7169e40] [c047aecc] sys_sendto+0xc0/0xfc
[  892.459069] [e7169f10] [c047b934] sys_socketcall+0x110/0x25c
[  892.464729] [e7169f40] [c000f480] ret_from_syscall+0x0/0x3c

(b) since the caam_jr_dequeue lock is only used in bh context,
then semantically it should use _bh spin_lock types.  spin_lock_bh
semantics are to disable back-halves, and used when a lock is shared
between softirq (bh) context and process and/or h/w IRQ context.
Since the lock is only used within softirq context, and this tasklet
is atomic, there is no need to do the additional work to disable
back halves.

This patch adds back-half disabling protection to caam_jr_enqueue
spin_locks to fix (a), and drops it from caam_jr_dequeue to fix (b).

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-01 17:47:31 +08:00
Jussi Kivilinna e15aa3692d crypto: drivers - remove cra_list initialization
Initialization of cra_list is currently mixed, most ciphers initialize this
field and most shashes do not. Initialization however is not needed at all
since cra_list is initialized/overwritten in __crypto_register_alg() with
list_add(). Therefore perform cleanup to remove all unneeded initializations
of this field in 'crypto/drivers/'.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-geode@lists.infradead.org
Cc: Michal Ludvig <michal@logix.cz>
Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Cc: Varun Wadekar <vwadekar@nvidia.com>
Cc: Eric Bénard <eric@eukrea.com>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: Kent Yoder <key@linux.vnet.ibm.com>
Acked-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-08-01 17:47:28 +08:00
Linus Torvalds 3e9a97082f This patch series contains a major revamp of how we collect entropy
from interrupts for /dev/random and /dev/urandom.  The goal is to
 addresses weaknesses discussed in the paper "Mining your Ps and Qs:
 Detection of Widespread Weak Keys in Network Devices", by Nadia
 Heninger, Zakir Durumeric, Eric Wustrow, J. Alex Halderman, which will
 be published in the Proceedings of the 21st Usenix Security Symposium,
 August 2012.  (See https://factorable.net for more information and an
 extended version of the paper.)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABCAAGBQJQF/0DAAoJENNvdpvBGATwIowQAOep9QKtLrBvb2lwIRVmeiy8
 lRf7V/tYZnz4FePbR0W92JQfKYkCV8yyOO0bmeRzWL3v4m+lRwDTSyA1DDyQMoH+
 LOMzvDKSLJMSXTXdSOIr1WYACphViCR/9CrbMBCKSkYfZLJ1MdaEDxT3rcpTGD0T
 6iknUweiSkHHhkerU5yQL7FKzD5kYUe0hsF47w7QVlHRHJsW2fsZqkFoh+RpnhNw
 03u+djxNGBo9qV81vZ9D1b0vA9uRlEjoWOOEG2XE4M2iq6TUySueA72dQnCwunfi
 3kG/u1Swv2dgq6aRrP3H7zdwhYSourGxziu3jNhEKwKEohrxYY7xjNX3RVeTqP67
 AzlKsOTWpRLIDrzjSLlb8VxRQiZewu8Unex3e1G+eo20sbcIObHGrxNp7K00zZvd
 QZiMHhOwItwFTe4lBO+XbqH2JKbL9/uJmwh5EipMpQTraKO9E6N3CJiUHjzBLo2K
 iGDZxRMKf4gVJRwDxbbP6D70JPVu8ZJ09XVIpsXQ3Z1xNqaMF0QdCmP3ty56q1o0
 NvkSXxPKrijZs8Sk0rVDqnJ3ll8PuDnXMv5eDtL42VT818I5WxESn9djjwEanGv0
 TYxbFub/NRxmPEE5B2Js5FBpqsLf5f282OSMeS/5WLBbnHJR1OoPoAhGVpHvxntC
 bi5FC1OolqhvzVIdsqgt
 =u7KM
 -----END PGP SIGNATURE-----

Merge tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random

Pull random subsystem patches from Ted Ts'o:
 "This patch series contains a major revamp of how we collect entropy
  from interrupts for /dev/random and /dev/urandom.

  The goal is to addresses weaknesses discussed in the paper "Mining
  your Ps and Qs: Detection of Widespread Weak Keys in Network Devices",
  by Nadia Heninger, Zakir Durumeric, Eric Wustrow, J.  Alex Halderman,
  which will be published in the Proceedings of the 21st Usenix Security
  Symposium, August 2012.  (See https://factorable.net for more
  information and an extended version of the paper.)"

Fix up trivial conflicts due to nearby changes in
drivers/{mfd/ab3100-core.c, usb/gadget/omap_udc.c}

* tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random: (33 commits)
  random: mix in architectural randomness in extract_buf()
  dmi: Feed DMI table to /dev/random driver
  random: Add comment to random_initialize()
  random: final removal of IRQF_SAMPLE_RANDOM
  um: remove IRQF_SAMPLE_RANDOM which is now a no-op
  sparc/ldc: remove IRQF_SAMPLE_RANDOM which is now a no-op
  [ARM] pxa: remove IRQF_SAMPLE_RANDOM which is now a no-op
  board-palmz71: remove IRQF_SAMPLE_RANDOM which is now a no-op
  isp1301_omap: remove IRQF_SAMPLE_RANDOM which is now a no-op
  pxa25x_udc: remove IRQF_SAMPLE_RANDOM which is now a no-op
  omap_udc: remove IRQF_SAMPLE_RANDOM which is now a no-op
  goku_udc: remove IRQF_SAMPLE_RANDOM which was commented out
  uartlite: remove IRQF_SAMPLE_RANDOM which is now a no-op
  drivers: hv: remove IRQF_SAMPLE_RANDOM which is now a no-op
  xen-blkfront: remove IRQF_SAMPLE_RANDOM which is now a no-op
  n2_crypto: remove IRQF_SAMPLE_RANDOM which is now a no-op
  pda_power: remove IRQF_SAMPLE_RANDOM which is now a no-op
  i2c-pmcmsp: remove IRQF_SAMPLE_RANDOM which is now a no-op
  input/serio/hp_sdc.c: remove IRQF_SAMPLE_RANDOM which is now a no-op
  mfd: remove IRQF_SAMPLE_RANDOM which is now a no-op
  ...
2012-07-31 19:07:42 -07:00
Jussi Kivilinna 76f16f83ee crypto: hifn_795x - fix 64bit division and undefined __divdi3 on 32bit archs
Commit feb7b7ab928afa97a79a9c424e4e0691f49d63be changed NSEC_PER_SEC to 64-bit
constant, which causes "DIV_ROUND_UP(NSEC_PER_SEC, dev->pk_clk_freq)" to
generate __divdi3 call on 32-bit archs. Fix this by changing DIV_ROUND_UP to
DIV_ROUND_UP_ULL.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-07-30 15:50:54 +08:00
Linus Torvalds 25918f9811 ARM: SoC fixes
A mixed bag of fixes, some for merge window fallout (tegra, MXS), and
 a short series of fixes for marvell platforms that didn't make it in
 before 3.5.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQEfQ3AAoJEIwa5zzehBx3/+IP/05oy6/Hd1rG9JtkT/LTYlVu
 zZWsFdbjA/WaUtl+hqyHolUY74ZGAv0wllAUn+GSk5HPLGwMIgcZTmoNc7NXEDyh
 H6A8wlJFbgCL93Mj+483wrC5Uy1wtsYWS/VNbba6+LVmjX0mkjAi4Y+hjHz+dIO+
 IiMacpUpmpiL8S8RtOghMVdTPySdQJYIG9/6z6fbvDdG3uu8RlgPdVfXbmCjx9c6
 uicH7CtsG2if02YlyaRrYFQpl42aVPSZkwTVxpuZoCoEQxsPRMV8IKb7JLVh5yN0
 4LeDPaUGaLqCwgtDCTin5tzC0/K1cQX+f+cpYIX0zic4P+4mSoMb5k6gtwHas6+4
 6siGxFN9tGqKma9nx4PDiuGcLOmbg8vS8x9gOsZMg0ywtOjhTYZHmcI791LBW34P
 QQ01jub5gy5DyxYUbXMyLcidUrjEk6IKJc2tOgYniRDeFLj0PYPmCd1wTX228SnV
 TL5YLcakSx6xDD7Nsf5yvM3G5qwCMGQ3fCV30Vq+m2O3iAe+lmUfmBgl19rIF4wF
 uPRXbjOWo84mqF/tVVTW4h683AocQRNL2jTcCgg8LIu6zvGDQ07ex+7d662vo81Z
 vtUYWnbrl1DSKNEaNw1H/aRGQCaSMYYXt+LIi0n+Qy7LSMaFVdxvLYOeJqz6yA+W
 DTLD08qu4UpoQY2N+Kj5
 =HZB3
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "A mixed bag of fixes, some for merge window fallout (tegra, MXS), and
  a short series of fixes for marvell platforms that didn't make it in
  before 3.5."

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: mxs: fix compile error caused by prom_update_property change
  ARM: dt: tegra trimslice: enable USB2 port
  ARM: dt: tegra trimslice: add vbus-gpio property
  ARM: vt8500: Add maintainer for VT8500 architecture
  ARM: Kirkwood: Replace mrvl with marvell
  ARM: Orion: fix driver probe error handling with respect to clk
  ARM: Dove: Fixup ge00 initialisation
  ARM: Kirkwood: Fix PHY disable clk problems
  ARM: Kirkwood: Ensure runit clock always ticks.
  ARM: versatile: Don't use platform clock for Integrator & VE
  ARM: tegra: harmony: add regulator supply name and its input supply
2012-07-26 20:29:52 -07:00
Linus Torvalds 44a6b84421 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu:

 - Fixed algorithm construction hang when self-test fails.
 - Added SHA variants to talitos AEAD list.
 - New driver for Exynos random number generator.
 - Performance enhancements for arc4.
 - Added hwrng support to caam.
 - Added ahash support to caam.
 - Fixed bad kfree in aesni-intel.
 - Allow aesni-intel in FIPS mode.
 - Added atmel driver with support for AES/3DES/SHA.
 - Bug fixes for mv_cesa.
 - CRC hardware driver for BF60x family processors.

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (66 commits)
  crypto: twofish-avx - remove useless instruction
  crypto: testmgr - add aead cbc aes hmac sha1,256,512 test vectors
  crypto: talitos - add sha224, sha384 and sha512 to existing AEAD algorithms
  crypto: talitos - export the talitos_submit function
  crypto: talitos - move talitos structures to header file
  crypto: atmel - add new tests to tcrypt
  crypto: atmel - add Atmel SHA1/SHA256 driver
  crypto: atmel - add Atmel DES/TDES driver
  crypto: atmel - add Atmel AES driver
  ARM: AT91SAM9G45: add crypto peripherals
  crypto: testmgr - allow aesni-intel and ghash_clmulni-intel in fips mode
  hwrng: exynos - Add support for Exynos random number generator
  crypto: aesni-intel - fix wrong kfree pointer
  crypto: caam - ERA retrieval and printing for SEC device
  crypto: caam - Using alloc_coherent for caam job rings
  crypto: algapi - Fix hang on crypto allocation
  crypto: arc4 - now arc needs blockcipher support
  crypto: caam - one tasklet per job ring
  crypto: caam - consolidate memory barriers from job ring en/dequeue
  crypto: caam - only query h/w in job ring dequeue path
  ...
2012-07-26 13:00:59 -07:00
Arnd Bergmann c1f9c4227c Merge branch 'v3.5-rc7-fixes' of git://github.com/lunn/linux into fixes
From Andrew Lunn <andrew@lunn.ch>:

* 'v3.5-rc7-fixes' of git://github.com/lunn/linux:
  ARM: Kirkwood: Replace mrvl with marvell
  ARM: Orion: fix driver probe error handling with respect to clk
  ARM: Dove: Fixup ge00 initialisation
  ARM: Kirkwood: Fix PHY disable clk problems
  ARM: Kirkwood: Ensure runit clock always ticks.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-07-25 21:37:09 +02:00
Simon Baatz baffab28b1 ARM: Orion: fix driver probe error handling with respect to clk
The clk patches added code to get and enable clocks in the
respective driver probe functions.  If the probe function failed
for some reason after enabling the clock, the clock was not
disabled again in many cases.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Signed-off-by: Andrew Lumm <andrew@lunn.ch>
2012-07-25 17:06:21 +02:00
Linus Torvalds 97e7292ab5 arm-soc: clk changes
Clock support is moving to the clk subsystem. These tegra, omap and imx
 changes are for code that is still platform specific and not (yet)
 part of that subsystem.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIVAwUAUA2dh2CrR//JCVInAQLm6g//UD7Q6xc/1I9/k0c/V35o4FRgmOt9xIp2
 ofsB801AnYOOusFWkcBa8xb6zFQuNQwR6OflkYBBV+31Zp2cNHgF9SVxaYlh43MD
 iptUnCh8VzSEFFZGy1Vi3sdrKY5fw5dyffPjgv8HtWQzs4r8H+98UnNQFbkTwPft
 9TxAeH73LRm4uNI/E8OerYN78TOefBK8p6HXyNW//MCzb59aG73/iD3EACrAmvyY
 gtyhLMtPeZTUWh3Fy5vXd9cfCmzQOAH/ADeMxVyx2QFyb3vCcPoS8Z5plh3zIjMt
 Ze0KlhHkB5lfBGBOB3gA/7ItlclhL2qLNkuhM2CBgYg+WTZ4OqaJCv80+OK8X4i5
 XCVjuDG++CFH09jDnMPXeUBM6UHwRV3f/HIRhaL8nH+nq1mU5HzEGrvBZTnOIklI
 XNoOpAMVPih64vH8PIQL/8oXT+cNHyVkmKA2uqRKq+mgqC+FIjG7EKBmIVORr7eI
 HmDHtHpRZY9EpK/cfgykDl4ELDITEaaitxvk0uqchSj3SXjfmbBXNKKcInQhDKaZ
 TKRMCgzeTu4NXSrRyHAP2toKUQNSziB7mwL7aHD6LMloqP1jBVOyZpxAIVwt19lZ
 qBAAatYGYocbssypI/E4CptTn3uC3dQiXDHRNJkZC/4o5suZoW9wpT77yvQNR/YQ
 GBO0bhQCI0Y=
 =Cvpa
 -----END PGP SIGNATURE-----

Merge tag 'clk' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull arm-soc clk changes from Arnd Bergmann:
 "Clock support is moving to the clk subsystem.  These tegra, omap and
  imx changes are for code that is still platform specific and not (yet)
  part of that subsystem."

Fix up conflicts in arch/arm/mach-{imx/clk-imx51-imx53.c,omap2/Makefile}

* tag 'clk' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (23 commits)
  ARM: imx: clk-imx31: Fix clock id for rnga driver
  ARM: imx: add missing item to the list of clock event modes
  ARM: i.MX5x CSPI: Fixed clock name for CSPI
  ARM: i.MX5x clocks: Fix GPT clocks
  ARM: i.MX5x clocks: Fix parent for PWM clocks
  ARM: i.MX5x clocks: Add EPIT support
  ARM: mx27: Reenable silicon version print
  ARM: clk-imx27: Fix rtc clock id
  ARM: tegra: Provide clock for only one PWM controller
  ARM: tegra: Fix PWM clock programming
  ARM: OMAP3+: clock33xx: Add AM33XX clock tree data
  ARM: OMAP3+: clock: Move common clksel_rate & clock data to common file
  ARM: tegra: dma: rename driver name for clock to "tegra-apbdma"
  ARM: tegra: Remove second instance of uart clk
  crypto: add clk_prepare/clk_unprepare
  ASoC: tegra: add clk_prepare/clk_unprepare
  staging: nvec: add clk_prepare/clk_unprepare
  spi/tegra: add clk_prepare/clk_unprepare
  Input: tegra-kbc - add clk_prepare/clk_unprepare
  USB: ehci-tegra: add clk_prepare/clk_unprepare
  ...
2012-07-23 17:51:03 -07:00
Theodore Ts'o 9751bfd1c9 n2_crypto: remove IRQF_SAMPLE_RANDOM which is now a no-op
With the changes in the random tree, IRQF_SAMPLE_RANDOM is now a
no-op; interrupt randomness is now collected unconditionally in a very
low-overhead fashion; see commit 775f4b297b.  The IRQF_SAMPLE_RANDOM
flag was scheduled to be removed in 2009 on the
feature-removal-schedule, so this patch is preparation for the final
removal of this flag.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-07-19 10:39:12 -04:00
Horia Geanta 357fb60502 crypto: talitos - add sha224, sha384 and sha512 to existing AEAD algorithms
With this, now all combinations of
CBC: AES, 3DES-EDE
with
HMAC: SHA-1, SHA-224, SHA-256, SHA-384, SHA-512
are supported.

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-07-11 11:08:29 +08:00
Horia Geanta 865d506155 crypto: talitos - export the talitos_submit function
This patch exports the talitos_submit function so that on
need basis same can be used by other entities.

Signed-off-by: Sandeep Malik <Sandeep.Malik@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-07-11 11:08:29 +08:00
Horia Geanta d1a0eb98e7 crypto: talitos - move talitos structures to header file
This patch moves the talitos structure definitions from c file to its
header file so that the same can be shared on need basis.

Signed-off-by: Sandeep Malik <Sandeep.Malik@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-07-11 11:08:29 +08:00
Nicolas Royer ebc82efa1c crypto: atmel - add Atmel SHA1/SHA256 driver
Signed-off-by: Nicolas Royer <nicolas@eukrea.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Eric Bénard <eric@eukrea.com>
Tested-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-07-11 11:08:28 +08:00
Nicolas Royer 13802005d8 crypto: atmel - add Atmel DES/TDES driver
Signed-off-by: Nicolas Royer <nicolas@eukrea.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Eric Bénard <eric@eukrea.com>
Tested-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-07-11 11:08:14 +08:00
Nicolas Royer bd3c7b5c2a crypto: atmel - add Atmel AES driver
Signed-off-by: Nicolas Royer <nicolas@eukrea.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Eric Bénard <eric@eukrea.com>
Tested-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-07-11 11:07:40 +08:00
Alex Porosanu 82c2f9607b crypto: caam - ERA retrieval and printing for SEC device
This patch adds support for retrieving and printing of
SEC ERA information. It is useful for knowing beforehand
what features exist from the SEC point of view on a
certain SoC. Only era-s 1 to 4 are currently supported;
other eras will appear as unknown.

Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com>

- rebased onto current cryptodev master
- made caam_eras static

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-07-11 11:06:11 +08:00
Bharat Bhushan 1af8ea862c crypto: caam - Using alloc_coherent for caam job rings
The caam job rings (input/output job ring) are allocated using
dma_map_single(). These job rings can be visualized as the ring
buffers in which the jobs are en-queued/de-queued. The s/w enqueues
the jobs in input job ring which h/w dequeues and after processing
it copies the jobs in output job ring. Software then de-queues the
job from output ring. Using dma_map/unmap_single() is not preferred
way to allocate memory for this type of requirements because this
adds un-necessary complexity.

Example, if bounce buffer (SWIOTLB) will get used then to make any
change visible in this memory to other processing unit requires
dmap_unmap_single() or dma_sync_single_for_cpu/device(). The
dma_unmap_single() can not be used as this will free the bounce
buffer, this will require changing the job rings on running system
and I seriously doubt that it will be not possible or very complex
to implement. Also using dma_sync_single_for_cpu/device() will also
add unnecessary complexity.

The simple and preferred way is using dma_alloc_coherent() for these
type of memory requirements.

This resolves the Linux boot crash issue when "swiotlb=force" is set
in bootargs on systems which have memory more than 4G.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-07-11 11:06:10 +08:00
Rafael J. Wysocki 4f31f5b19e PM / crypto / ux500: Use struct dev_pm_ops for power management
Make the ux500 crypto driver define its PM callbacks through
struct dev_pm_ops objects rather than by using legacy PM hooks
in struct platform_driver.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2012-07-10 21:37:33 +02:00
Kim Phillips a0ca6ca022 crypto: caam - one tasklet per job ring
there is no noticeable benefit for multiple cores to process one
job ring's output ring: in fact, we can benefit from cache effects
of having the back-half stay on the core that receives a particular
ring's interrupts, and further relax general contention and the
locking involved with reading outring_used, since tasklets run
atomically.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:07 +08:00
Kim Phillips 14a8e29cc2 crypto: caam - consolidate memory barriers from job ring en/dequeue
Memory barriers are implied by the i/o register write implementation
(at least on Power).  So we can remove the redundant wmb() in
caam_jr_enqueue, and, in dequeue(), hoist the h/w done notification
write up to before we need to increment the head of the ring, and
save an smp_mb.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:07 +08:00
Kim Phillips a8ea07c21d crypto: caam - only query h/w in job ring dequeue path
Code was needlessly checking the s/w job ring when there
would be nothing to process if the h/w's output completion
ring were empty anyway.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:07 +08:00
Kim Phillips 4bba1e9f41 crypto: caam - use non-irq versions of spinlocks for job rings
The enqueue lock isn't used in any interrupt context, and
the dequeue lock isn't used in the h/w interrupt context,
only in bh context.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:06 +08:00
Kim Phillips 1a076689cd crypto: caam - disable IRQ coalescing by default
It has been observed that in zero-loss benchmarks, when a
slow traffic rate is being tested, the IRQ timer coalescing
parameter was set too high, and the ethernet controller
would start dropping packets because the job ring back half
wouldn't be executed in time before the ethernet controller
would fill its buffers, thereby significantly reducing the
zero-loss performance figures.

Empirical testing has shown that the best zero-loss performance
is achieved when IRQ coalescing is set to minimum values and/or
turned off, since apparently the job ring driver already implements
an adequately-performing general-purpose IRQ mitigation strategy
in software.

Whilst we could go with minimal count (2-8) and timing settings
(192-256), we prefer just turning h/w coalescing altogether off
to minimize setkey latency (due to split key generation), and
for consistent cross-SoC performance (the SEC vs. core clock
ratio changes).

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:06 +08:00
Kim Phillips 281922a1d4 crypto: caam - add support for SEC v5.x RNG4
The SEC v4.x' RNGB h/w block self-initialized.  RNG4, available
on SEC versions 5 and beyond, is based on a different standard
that requires manual initialization.

Also update any new errors From the SEC v5.2 reference manual:
The SEC v5.2's RNG4 unit reuses some error IDs, thus the addition
of rng_err_id_list over the CHA-independent err_id_list.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:06 +08:00
Kim Phillips e13af18a3e crypto: caam - assign 40-bit masks on SEC v5.0 and above
SEC v4.x were only 36-bit, SEC v5+ are 40-bit capable.
Also set a DMA mask for any job ring devices created.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:06 +08:00
Yuan Kang e24f7c9e87 crypto: caam - hwrng support
caam_read copies random bytes from two buffers into output.

caam rng can fill empty buffer 0xffff bytes at a time,
but the buffer sizes are rounded down to multiple of cacheline size.

Signed-off-by: Yuan Kang <Yuan.Kang@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:06 +08:00
Yuan Kang 643b39b031 crypto: caam - chaining support
support chained scatterlists for aead, ablkcipher and ahash.

Signed-off-by: Yuan Kang <Yuan.Kang@freescale.com>

- fix dma unmap leak
- un-unlikely src == dst, due to experience with AF_ALG

Signed-off-by: Kudupudi Ugendreshwar <B38865@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:05 +08:00
Yuan Kang b0e09bae37 crypto: caam - unkeyed ahash support
caam supports and registers unkeyed sha algorithms and md5.

Signed-off-by: Yuan Kang <Yuan.Kang@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:05 +08:00
Yuan Kang 045e36780f crypto: caam - ahash hmac support
caam supports ahash hmac with sha algorithms and md5.

Signed-off-by: Yuan Kang <Yuan.Kang@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:05 +08:00
Yuan Kang a299c83704 crypto: caam - link_tbl rename
- rename scatterlist and link_tbl functions
- link_tbl changed to sec4_sg
- sg_to_link_tbl_one changed to dma_to_sec4_sg_one,
  since no scatterlist is use

Signed-off-by: Yuan Kang <Yuan.Kang@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:05 +08:00
Yuan Kang 4c1ec1f930 crypto: caam - refactor key_gen, sg
create separate files for split key generation and scatterlist functions.

Signed-off-by: Yuan Kang <Yuan.Kang@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:05 +08:00
Yuan Kang 8009a383f2 crypto: caam - remove jr register/deregister
remove caam_jr_register and caam_jr_deregister
to allow sharing of job rings.

Signed-off-by: Yuan Kang <Yuan.Kang@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:04 +08:00
Yuan Kang 6ec4733493 crypto: caam - support external seq in/out lengths
functions for external storage of seq in/out lengths,
i.e., for 32-bit lengths.

These type-dependent functions automatically determine whether to
store the length internally (embedded in the command header word) or
externally (after the address pointer), based on size of the type
given.

Signed-off-by: Yuan Kang <Yuan.Kang@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:04 +08:00
Hemant Agrawal a23d80e0b7 crypto: caam - add PDB (Protocol Descriptor Block) definitions
Add a PDB header file to support building protocol descriptors.

Signed-off-by: Steve Cornelius <sec@pobox.com>
Signed-off-by: Hemant Agrawal <hemant@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:04 +08:00
Kim Phillips 991c569c5d crypto: caam - fix descriptor length adjustments for protocol descriptors
init_desc, by always ORing with 1 for the descriptor header inclusion
into the descriptor length, and init_sh_desc_pdb, by always specifying
the descriptor length modification for the PDB via options, would not
allow for odd length PDBs to be embedded in the constructed descriptor
length.  Fix this by simply changing the OR to an addition.

also round-up pdb_bytes to the next SEC command unit size, to
allow for, e.g., optional packet header bytes that aren't a
multiple of CAAM_CMD_SZ.

Reported-by: Radu-Andrei BULIE <radu.bulie@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Cc: Yashpal Dutta <yashpal.dutta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:03 +08:00
Yashpal Dutta c4b664063e crypto: caam - fix start index for Protocol shared descriptors
In case of protocol acceleration descriptors, Shared descriptor header must
carry size of header length + PDB length in words which will be skipped by
DECO while processing descriptor to provide first command word offset

Signed-off-by: Yashpal Dutta <yashpal.dutta@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:03 +08:00
Kim Phillips a68d259587 crypto: caam - fix input job ring element dma mapping size
SEC4 h/w gets configured in 32- vs. 36-bit physical
addressing modes depending on the size of dma_addr_t,
which is not always equal to sizeof(u32 *).

Also fixed alignment of a dma_unmap call whilst in there.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-27 14:42:03 +08:00