Commit 720419f0 authored by Brijesh Singh's avatar Brijesh Singh Committed by Herbert Xu
Browse files

crypto: ccp - Introduce the AMD Secure Processor device



The CCP device is part of the AMD Secure Processor. In order to expand
the usage of the AMD Secure Processor, create a framework that allows
functional components of the AMD Secure Processor to be initialized and
handled appropriately.

Signed-off-by: default avatarBrijesh Singh <brijesh.singh@amd.com>
Acked-by: default avatarGary R Hook <gary.hook@amd.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 970e8303
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -540,11 +540,11 @@ config CRYPTO_DEV_ATMEL_ECC
	  will be called atmel-ecc.
	  will be called atmel-ecc.


config CRYPTO_DEV_CCP
config CRYPTO_DEV_CCP
	bool "Support for AMD Cryptographic Coprocessor"
	bool "Support for AMD Secure Processor"
	depends on ((X86 && PCI) || (ARM64 && (OF_ADDRESS || ACPI))) && HAS_IOMEM
	depends on ((X86 && PCI) || (ARM64 && (OF_ADDRESS || ACPI))) && HAS_IOMEM
	help
	help
	  The AMD Cryptographic Coprocessor provides hardware offload support
	  The AMD Secure Processor provides support for the Cryptographic Coprocessor
	  for encryption, hashing and related operations.
	  (CCP) and the Platform Security Processor (PSP) devices.


if CRYPTO_DEV_CCP
if CRYPTO_DEV_CCP
	source "drivers/crypto/ccp/Kconfig"
	source "drivers/crypto/ccp/Kconfig"
+14 −7
Original line number Original line Diff line number Diff line
config CRYPTO_DEV_CCP_DD
config CRYPTO_DEV_CCP_DD
	tristate "Cryptographic Coprocessor device driver"
	tristate "Secure Processor device driver"
	depends on CRYPTO_DEV_CCP
	default m
	default m
	help
	  Provides AMD Secure Processor device driver.
	  If you choose 'M' here, this module will be called ccp.

config CRYPTO_DEV_SP_CCP
	bool "Cryptographic Coprocessor device"
	default y
	depends on CRYPTO_DEV_CCP_DD
	select HW_RANDOM
	select HW_RANDOM
	select DMA_ENGINE
	select DMA_ENGINE
	select DMADEVICES
	select DMADEVICES
	select CRYPTO_SHA1
	select CRYPTO_SHA1
	select CRYPTO_SHA256
	select CRYPTO_SHA256
	help
	help
	  Provides the interface to use the AMD Cryptographic Coprocessor
	  Provides the support for AMD Cryptographic Coprocessor (CCP) device
	  which can be used to offload encryption operations such as SHA,
	  which can be used to offload encryption operations such as SHA, AES
	  AES and more. If you choose 'M' here, this module will be called
	  and more.
	  ccp.


config CRYPTO_DEV_CCP_CRYPTO
config CRYPTO_DEV_CCP_CRYPTO
	tristate "Encryption and hashing offload support"
	tristate "Encryption and hashing offload support"
	depends on CRYPTO_DEV_CCP_DD
	default m
	default m
	depends on CRYPTO_DEV_CCP_DD
	depends on CRYPTO_DEV_SP_CCP
	select CRYPTO_HASH
	select CRYPTO_HASH
	select CRYPTO_BLKCIPHER
	select CRYPTO_BLKCIPHER
	select CRYPTO_AUTHENC
	select CRYPTO_AUTHENC
+2 −2
Original line number Original line Diff line number Diff line
obj-$(CONFIG_CRYPTO_DEV_CCP_DD) += ccp.o
obj-$(CONFIG_CRYPTO_DEV_CCP_DD) += ccp.o
ccp-objs := ccp-dev.o \
ccp-objs  := sp-dev.o ccp-platform.o
ccp-$(CONFIG_CRYPTO_DEV_SP_CCP) += ccp-dev.o \
	    ccp-ops.o \
	    ccp-ops.o \
	    ccp-dev-v3.o \
	    ccp-dev-v3.o \
	    ccp-dev-v5.o \
	    ccp-dev-v5.o \
	    ccp-platform.o \
	    ccp-dmaengine.o \
	    ccp-dmaengine.o \
	    ccp-debugfs.o
	    ccp-debugfs.o
ccp-$(CONFIG_PCI) += ccp-pci.o
ccp-$(CONFIG_PCI) += ccp-pci.o
+1 −3
Original line number Original line Diff line number Diff line
@@ -359,8 +359,7 @@ static void ccp_irq_bh(unsigned long data)


static irqreturn_t ccp_irq_handler(int irq, void *data)
static irqreturn_t ccp_irq_handler(int irq, void *data)
{
{
	struct device *dev = data;
	struct ccp_device *ccp = (struct ccp_device *)data;
	struct ccp_device *ccp = dev_get_drvdata(dev);


	ccp_disable_queue_interrupts(ccp);
	ccp_disable_queue_interrupts(ccp);
	if (ccp->use_tasklet)
	if (ccp->use_tasklet)
@@ -597,6 +596,5 @@ const struct ccp_vdata ccpv3 = {
	.version = CCP_VERSION(3, 0),
	.version = CCP_VERSION(3, 0),
	.setup = NULL,
	.setup = NULL,
	.perform = &ccp3_actions,
	.perform = &ccp3_actions,
	.bar = 2,
	.offset = 0x20000,
	.offset = 0x20000,
};
};
+1 −4
Original line number Original line Diff line number Diff line
@@ -769,8 +769,7 @@ static void ccp5_irq_bh(unsigned long data)


static irqreturn_t ccp5_irq_handler(int irq, void *data)
static irqreturn_t ccp5_irq_handler(int irq, void *data)
{
{
	struct device *dev = data;
	struct ccp_device *ccp = (struct ccp_device *)data;
	struct ccp_device *ccp = dev_get_drvdata(dev);


	ccp5_disable_queue_interrupts(ccp);
	ccp5_disable_queue_interrupts(ccp);
	ccp->total_interrupts++;
	ccp->total_interrupts++;
@@ -1113,7 +1112,6 @@ const struct ccp_vdata ccpv5a = {
	.version = CCP_VERSION(5, 0),
	.version = CCP_VERSION(5, 0),
	.setup = ccp5_config,
	.setup = ccp5_config,
	.perform = &ccp5_actions,
	.perform = &ccp5_actions,
	.bar = 2,
	.offset = 0x0,
	.offset = 0x0,
};
};


@@ -1122,6 +1120,5 @@ const struct ccp_vdata ccpv5b = {
	.dma_chan_attr = DMA_PRIVATE,
	.dma_chan_attr = DMA_PRIVATE,
	.setup = ccp5other_config,
	.setup = ccp5other_config,
	.perform = &ccp5_actions,
	.perform = &ccp5_actions,
	.bar = 2,
	.offset = 0x0,
	.offset = 0x0,
};
};
Loading