Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caam #19

Open
wants to merge 2 commits into
base: linux-linaro-lsk-v3.14-mx6
Choose a base branch
from
Open

caam #19

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions arch/arm/boot/dts/imx6qdl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@
interrupt-parent = <&intc>;
ranges;

caam_sm: caam-sm@00100000 {
compatible = "fsl,imx6q-caam-sm";
reg = <0x00100000 0x3fff>;
};

dma_apbh: dma-apbh@00110000 {
compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh";
reg = <0x00110000 0x2000>;
Expand All @@ -103,6 +108,12 @@
clocks = <&clks 106>;
};

irq_sec_vio: caam_secvio {
compatible = "fsl,imx6q-caam-secvio";
interrupts = <0 20 0x04>;
secvio_src = <0x8000001d>;
};

gpmi: gpmi-nand@00112000 {
compatible = "fsl,imx6q-gpmi-nand";
#address-cells = <1>;
Expand Down Expand Up @@ -672,6 +683,11 @@
clock-names = "main_clk";
};

caam_snvs: caam-snvs@020cc000 {
compatible = "fsl,imx6q-caam-snvs";
reg = <0x020cc000 0x4000>;
};

snvs@020cc000 {
compatible = "fsl,sec-v4.0-mon", "simple-bus";
#address-cells = <1>;
Expand Down
75 changes: 51 additions & 24 deletions drivers/crypto/caam/Kconfig
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
config CRYPTO_DEV_FSL_CAAM
tristate "Freescale CAAM-Multicore driver backend"
depends on FSL_SOC
depends on FSL_SOC || ARCH_MXC
help
Enables the driver module for Freescale's Cryptographic Accelerator
and Assurance Module (CAAM), also known as the SEC version 4 (SEC4).
This module creates job ring devices, and configures h/w
This module adds a job ring operation interface, and configures h/w
to operate as a DPAA component automatically, depending
on h/w feature availability.

To compile this driver as a module, choose M here: the module
will be called caam.

config CRYPTO_DEV_FSL_CAAM_JR
tristate "Freescale CAAM Job Ring driver backend"
depends on CRYPTO_DEV_FSL_CAAM
default y
help
Enables the driver module for Job Rings which are part of
Freescale's Cryptographic Accelerator
and Assurance Module (CAAM). This module adds a job ring operation
interface.

To compile this driver as a module, choose M here: the module
will be called caam_jr.

config CRYPTO_DEV_FSL_CAAM_RINGSIZE
int "Job Ring size"
depends on CRYPTO_DEV_FSL_CAAM_JR
depends on CRYPTO_DEV_FSL_CAAM
range 2 9
default "9"
help
Expand All @@ -44,7 +31,7 @@ config CRYPTO_DEV_FSL_CAAM_RINGSIZE

config CRYPTO_DEV_FSL_CAAM_INTC
bool "Job Ring interrupt coalescing"
depends on CRYPTO_DEV_FSL_CAAM_JR
depends on CRYPTO_DEV_FSL_CAAM
default n
help
Enable the Job Ring's interrupt coalescing feature.
Expand Down Expand Up @@ -75,7 +62,7 @@ config CRYPTO_DEV_FSL_CAAM_INTC_TIME_THLD

config CRYPTO_DEV_FSL_CAAM_CRYPTO_API
tristate "Register algorithm implementations with the Crypto API"
depends on CRYPTO_DEV_FSL_CAAM && CRYPTO_DEV_FSL_CAAM_JR
depends on CRYPTO_DEV_FSL_CAAM
default y
select CRYPTO_ALGAPI
select CRYPTO_AUTHENC
Expand All @@ -89,7 +76,7 @@ config CRYPTO_DEV_FSL_CAAM_CRYPTO_API

config CRYPTO_DEV_FSL_CAAM_AHASH_API
tristate "Register hash algorithm implementations with Crypto API"
depends on CRYPTO_DEV_FSL_CAAM && CRYPTO_DEV_FSL_CAAM_JR
depends on CRYPTO_DEV_FSL_CAAM
default y
select CRYPTO_HASH
help
Expand All @@ -101,7 +88,7 @@ config CRYPTO_DEV_FSL_CAAM_AHASH_API

config CRYPTO_DEV_FSL_CAAM_RNG_API
tristate "Register caam device for hwrng API"
depends on CRYPTO_DEV_FSL_CAAM && CRYPTO_DEV_FSL_CAAM_JR
depends on CRYPTO_DEV_FSL_CAAM
default y
select CRYPTO_RNG
select HW_RANDOM
Expand All @@ -112,10 +99,50 @@ config CRYPTO_DEV_FSL_CAAM_RNG_API
To compile this as a module, choose M here: the module
will be called caamrng.

config CRYPTO_DEV_FSL_CAAM_DEBUG
bool "Enable debug output in CAAM driver"
config CRYPTO_DEV_FSL_CAAM_RNG_TEST
boolean "Test caam rng"
depends on CRYPTO_DEV_FSL_CAAM_RNG_API
default n
help
Selecting this will enable self-test for caam rng.

config CRYPTO_DEV_FSL_CAAM_SM
tristate "CAAM Secure Memory / Keystore API (EXPERIMENTAL)"
default n
help
Enables use of a prototype kernel-level Keystore API with CAAM
Secure Memory for insertion/extraction of bus-protected secrets.

config CRYPTO_DEV_FSL_CAAM_SM_SLOTSIZE
int "Size of each keystore slot in Secure Memory"
depends on CRYPTO_DEV_FSL_CAAM_SM
range 5 9
default 7
help
Select size of allocation units to divide Secure Memory pages into
(the size of a "slot" as referenced inside the API code).
Established as powers of two.
Examples:
5 => 32 bytes
6 => 64 bytes
7 => 128 bytes
8 => 256 bytes
9 => 512 bytes

config CRYPTO_DEV_FSL_CAAM_SM_TEST
tristate "CAAM Secure Memory - Keystore Test/Example (EXPERIMENTAL)"
depends on CRYPTO_DEV_FSL_CAAM_SM
default n
help
Example thread to exercise the Keystore API and to verify that
stored and recovered secrets can be used for general purpose
encryption/decryption.

config CRYPTO_DEV_FSL_CAAM_SECVIO
tristate "CAAM/SNVS Security Violation Handler (EXPERIMENTAL)"
depends on CRYPTO_DEV_FSL_CAAM
default n
help
Selecting this will enable printing of various debug
information in the CAAM driver.
Enables installation of an interrupt handler with registrable
handler functions which can be specified to act on the consequences
of a security violation.
10 changes: 4 additions & 6 deletions drivers/crypto/caam/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#
# Makefile for the CAAM backend and dependent components
#
ifeq ($(CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG), y)
EXTRA_CFLAGS := -DDEBUG
endif

obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM) += caam.o
obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_JR) += caam_jr.o
obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API) += caamalg.o
obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API) += caamhash.o
obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API) += caamrng.o
obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_SM) += sm_store.o
obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST) += sm_test.o
obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO) += secvio.o

caam-objs := ctrl.o
caam_jr-objs := jr.o key_gen.o error.o
caam-objs := ctrl.o jr.o error.o key_gen.o
Loading