EIP197/97 Crypto Driver
=======================

Introduction
------------
The EIP197/97 is a hybrid packet engine designed to off-load various security
protocols such as IPsec ESP, IPsec AH, SRTP, SSL, TLS, DTLS and MACsec.

The EIP197 uses firmware, which is loaded by the driver during the probe process.
EIP97 has no firmware support.

Both EIP197 and EIP97 have 4 hardware rings that can be used for
cryptographic operations.

This document provides a brief overview on EIP197/97 driver usage.

Kernel Infrastructure
---------------------
The EIP197/97 driver uses Kernel crypto infrastructure, for more information
refer to: http://www.chronox.de/crypto-API/

Linux Kernel Image
------------------
As mentioned above, EIP197 driver loads firmware into the engine.
Due to that fact, the EIP197 driver should be compiled as a module (The
driver should be probed only after the file system is mounted).

The kernel object file (named crypto_safexcel) is generated in:
./drivers/crypto/inside-secure/crypto_safexcel.ko

Device-Tree
-----------
Refer to: Documentation/devicetree/bindings/crypto/inside_secure_eip.txt

Firmware (for EIP197 only)
--------------------------
The EIP197 driver loads two firmware images into the engine:
	- ipue.bin:	Input Pull-Up micro-Engine
	- ifpp.bin:	Input Flow Post-Processor micro-Engine

The driver expects to find the firmware images in /lib/firmware/eip197,
if the firmware images aren't present there, the probe process of
the EIP197 driver fails.

Basic Usage
-----------
Currently EIP197/97 are avaialble on several Marvell SoC:
Armada8040 - 2 EIP197 engines.
Armada7040 - 1 EIP197 engine.
Armada3700 - 1 EIP97 engine.

Currently, due to Kernel crypto API limitations, the EIP197 driver
operates only with one engine in the Kernel (support of multiple engines
is planned as future work).

The user may select the number of rings (up to 4 per engine) using a module
parameter named "rings"::

		> insmode crypto_safexcel.ko rings=x,y

	- x: number of rings on EIP197-0 engine
	- y: number of rings on EIP197-1 engine
	     (For device with more than one engine, such as Armada8040)

In Armada8040, due to the Kernel limitation stated above, the first
engine with rings!=0 will be used.

+---------------+---------------+----------+----------+-----------------+
| Device	|   rings	| EIP197-0 | EIP197-1 | Operating 	|
|		|		| EIP97-0  |          | Engine		|
+===============+===============+==========+==========+=================+
| Armada3700	|   rings=4	|     4    |    N/A   |      0		|
+---------------+---------------+----------+----------+-----------------+
| Armada7040	|   rings=4	|     4    |    N/A   |      0		|
+---------------+---------------+----------+----------+-----------------+
| Armada8040	|   rings=4,0   |     4    |     0    |      0		|
|		+---------------+----------+----------+-----------------+
|		|   rings=0,4   |     0    |     4    |      1		|
|		+---------------+----------+----------+-----------------+
|		|   rings=4,4   |     4    |     4    |      0		|
|		+---------------+----------+----------+-----------------+
|		|   rings=3,4   |     3    |     4    |      0		|
|		+---------------+----------+----------+-----------------+
|		|   rings=4,3   |     4    |     3    |      0		|
+---------------+---------------+----------+----------+-----------------+

If "rings" is not provided, the default value is:
	- Armada3700: rings=4
	- Armada7040: rings=4
	- Armada8040: rings=4,4 (Operating engine is engine 0)
