From patchwork Tue Nov 14 05:05:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavitrakumar Managutte X-Patchwork-Id: 13454773 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63491BE5B for ; Tue, 14 Nov 2023 05:05:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=vayavyalabs.com header.i=@vayavyalabs.com header.b="BK5D0tvm" Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4542F19F for ; Mon, 13 Nov 2023 21:05:47 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1cc29f39e7aso33057265ad.0 for ; Mon, 13 Nov 2023 21:05:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vayavyalabs.com; s=google; t=1699938347; x=1700543147; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hTtSrAP4jWORbvsSbS/00id+Ekv9jBPe4+FdIMW8zyU=; b=BK5D0tvmjO8WIZAFHzMAgpKnEpN/R2yy+ZfJlD+QAId/U2oluvDy8dWD2PkBa4KOq7 PzVk5DXm8RQiz6jR8+p4TuBu5wdq4IBUaqmJbKswuErwlRylW3odLBuA1kpM2QensLEw rvrcOlwCIpOn7/5+bu2tJGtW+VZM2rXrr9NS0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699938347; x=1700543147; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hTtSrAP4jWORbvsSbS/00id+Ekv9jBPe4+FdIMW8zyU=; b=gmQRmf4TpKiobzmiiKYCEWU/HgY6hO88FdC6PkwMkZREmm1C636pi6jX55jdoplP/Y LpepOTMDU5VAlcksb4W2Vpjb4jYQZEAbhoM7eukcaIxsu6CCYL/urJH7XuKI1Sue+pJM lS7nu1Z7+LBhlfE/LgZ5dArYpJmvNmNSicmqGIhZVke9uzQCYYA+aPFCZGYH4g8tK1k+ bSZsRyv+ueGBzFwPVnnoMlP4djPzRcWFfHwQ2Of7ybyW70rYZlxebaLt5knkkZgf/+8G lF15eQnYYc5Z68Na8jS1mLxLK2Yv2YQNOUNsOhar+GubojnmQwtoLYujvzNuFLhZo4+k bofw== X-Gm-Message-State: AOJu0YwxagLop3A5OfN5jwb4B0Yb2E8V0VpkilKVnfA2NDerFjAnyYnS dHkqOgfa6wNpeS0MGhXzpqZakg== X-Google-Smtp-Source: AGHT+IEUIgplqc/vrWi58w9bY+c0zCRvaPm2kLAl4QXC/pAkfhk8eznykeHoKZiN7Hd1j9z3BhOfYQ== X-Received: by 2002:a17:902:d4c9:b0:1cc:53ed:cc78 with SMTP id o9-20020a170902d4c900b001cc53edcc78mr1420319plg.15.1699938346703; Mon, 13 Nov 2023 21:05:46 -0800 (PST) Received: from localhost.localdomain ([103.108.57.9]) by smtp.gmail.com with ESMTPSA id a20-20020a170902ee9400b001b896686c78sm4910131pld.66.2023.11.13.21.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 21:05:46 -0800 (PST) From: Pavitrakumar M To: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org Cc: manjunath.hadli@vayavyalabs.com, Pavitrakumar M , shwetar , Ruud Derwig Subject: [PATCH 2/4] Add SPACC Kconfig and Makefile Date: Tue, 14 Nov 2023 10:35:23 +0530 Message-Id: <20231114050525.471854-3-pavitrakumarm@vayavyalabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231114050525.471854-1-pavitrakumarm@vayavyalabs.com> References: <20231114050525.471854-1-pavitrakumarm@vayavyalabs.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: shwetar Signed-off-by: Pavitrakumar M Acked-by: Ruud Derwig --- drivers/crypto/dwc-spacc/Kconfig | 95 +++++++++++++++++++++++++++++++ drivers/crypto/dwc-spacc/Makefile | 16 ++++++ 2 files changed, 111 insertions(+) create mode 100644 drivers/crypto/dwc-spacc/Kconfig create mode 100644 drivers/crypto/dwc-spacc/Makefile diff --git a/drivers/crypto/dwc-spacc/Kconfig b/drivers/crypto/dwc-spacc/Kconfig new file mode 100644 index 000000000000..cde9caa60531 --- /dev/null +++ b/drivers/crypto/dwc-spacc/Kconfig @@ -0,0 +1,95 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config CRYPTO_DEV_SPACC + tristate "Support for dw_spacc Security protocol accelerators" + depends on HAS_DMA + default y + + help + This enables support for the HASH/CIPHER/AEAD hw accelerator which can be found + on dw_spacc IP. + +config CRYPTO_DEV_SPACC_CIPHER + bool "Enable CIPHER functionality" + depends on CRYPTO_DEV_SPACC + default y + select CRYPTO_SKCIPHER + select CRYPTO_LIB_DES + select CRYPTO_AES + select CRYPTO_CBC + select CRYPTO_ECB + select CRYPTO_CTR + select CRYPTO_XTS + select CRYPTO_CTS + select CRYPTO_OFB + select CRYPTO_CFB + select CRYPTO_SM4_GENERIC + select CRYPTO_CHACHA20 + + help + Say y to enable Cipher functionality of SPACC. + +config CRYPTO_DEV_SPACC_HASH + bool "Enable HASH functionality" + depends on CRYPTO_DEV_SPACC + default y + select CRYPTO_HASH + select CRYPTO_SHA1 + select CRYPTO_MD5 + select CRYPTO_SHA256 + select CRYPTO_SHA512 + select CRYPTO_HMAC + select CRYPTO_SM3 + select CRYPTO_CMAC + select CRYPTO_MICHAEL_MIC + select CRYPTO_XCBC + select CRYPTO_AES + select CRYPTO_SM4_GENERIC + + help + Say y to enable Hash functionality of SPACC. + +config CRYPTO_DEV_SPACC_AEAD + bool "Enable AEAD functionality" + depends on CRYPTO_DEV_SPACC + default y + select CRYPTO_AEAD + select CRYPTO_AUTHENC + select CRYPTO_AES + select CRYPTO_SM4_GENERIC + select CRYPTO_CHACHAPOLY1305 + select CRYPTO_GCM + select CRYPTO_CCM + + help + Say y to enable AEAD functionality of SPACC. + +config CRYPTO_DEV_SPACC_AUTODETECT + bool "Enable Autodetect functionality" + depends on CRYPTO_DEV_SPACC + default y + help + Say y to enable Autodetect functionality + +config CRYPTO_DEV_SPACC_DEBUG_TRACE_IO + bool "Enable Trace MMIO reads/writes stats" + depends on CRYPTO_DEV_SPACC + default n + help + Say y to enable Trace MMIO reads/writes stats. + To Debug and trace IO register read/write opration + +config CRYPTO_DEV_SPACC_DEBUG_TRACE_DDT + bool "Enable Trace DDT entries stats" + default n + depends on CRYPTO_DEV_SPACC + help + Say y to enable Enable Trace DDT entries stats. + To Debug and trace DDT opration + +config CRYPTO_DEV_SPACC_SECURE_MODE + bool "Enable Spacc secure mode stats" + default n + depends on CRYPTO_DEV_SPACC + help + Say y to enable Spacc secure modes diff --git a/drivers/crypto/dwc-spacc/Makefile b/drivers/crypto/dwc-spacc/Makefile new file mode 100644 index 000000000000..bf46c8e13a31 --- /dev/null +++ b/drivers/crypto/dwc-spacc/Makefile @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_CRYPTO_DEV_SPACC) += snps-spacc.o +snps-spacc-objs = spacc_hal.o spacc_core.o \ +spacc_manager.o spacc_interrupt.o spacc_device.o + +ifeq ($(CONFIG_CRYPTO_DEV_SPACC_HASH),y) +snps-spacc-objs += spacc_ahash.o +endif + +ifeq ($(CONFIG_CRYPTO_DEV_SPACC_CIPHER),y) +snps-spacc-objs += spacc_skcipher.o +endif + +ifeq ($(CONFIG_CRYPTO_DEV_SPACC_AEAD),y) +snps-spacc-objs += spacc_aead.o +endif