From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1038334FF74 for ; Tue, 12 May 2026 22:44:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778625850; cv=none; b=VcRPP73hFN3o0ZnKXzq07SoJKPzWkRK3SupPEi09PPw6Ml2IYhCyVa/4KLoDYNjFSFWhCdwtfftQv6ex6IOCRdB1dcjmBFIeUEuSa9yYnBtI0PscdGaeEFqKrzAMwkqXGHbjzQX3EfySTV3pZhM8qf/sbcrIU54BckkwxMTHiUw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778625850; c=relaxed/simple; bh=Iygz6kxtjgTJhJ/FVqNj8TG+65E7r4WPqcUg1cz3yPo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=nHJIUE33aLTB+/uwpHzmPOgnvAYcOE1FQKktvTfV4HVWso9zd2cAyGxIrSeYFCe60j/jBaivRYqDNWEfHOGyt9xkqR/4S5OYVJPTBdtJrt1lN4BPuH3t1pHdPRefkS8iDPTPb5GBhPCuIRbh7GSX99eOZu6bufSDZRfnFarQAPg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Yuzmrjs6; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Yuzmrjs6" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4891b02a0acso6258165e9.3 for ; Tue, 12 May 2026 15:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778625847; x=1779230647; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=cPxmplJASoE7i3DAWTstEUF/mwjYvLDna7DGnqxuUrc=; b=Yuzmrjs6S4iY60MHmjV3pbA+KA+ZqS6qzmqdgTm+tTJkcNIKUV6ACY7sH0zUX/A65F QWt1bodBI46dWhjssWSHomeBi8j8r9PaTHnkkSDDjliEpVLKnLwUsecdP4IFv4vA9mxg YPZu5t5j9M3GzRtBrPFVmzBddmrvwt13o0fxLat9Vl+AgJr6j/xTwI76ZINScRMjd7Ge KPUrJECgYyRg6YJTkvrGnhGHGkHMi8+OP36qgnRiWxF2m9YhfBYZQC8zfPI+bUYKRjaF PyBmspTOIgL3RJCk9J0Djv+O4AZBIruLRDB7BMU9h8+i/n6W+XffLpenSUvIH3HBiaq+ LeLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778625847; x=1779230647; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cPxmplJASoE7i3DAWTstEUF/mwjYvLDna7DGnqxuUrc=; b=EdHHKZHVJGLvJsQb0uHORuHeNJXbaH/p5RCO7jxXQ/pmz9cvOBminsZwP6QtCV2bHe Sm3rQ/T78h80eY7x/Wt3E/9Xv1uBCNBNtB3yt+lyq3w+EWqS97z/gfTt/9GDteks0aMZ cP6uz5NpO1vE5tJmo8Rue9yZeJYeEF9mKwWpwSEW4fT3M6NiwPt9K4gFnmO/X/APj/De +RkHVyzlmxrMnCGf5qanX50QrNF/TrYGdRJlNxjPvl30zfANjjfwU4VuHnhhK+ISAulQ lYKyRSvxiW0+5mi6n80cSDg3XJIXaQY5YZPBoZ9fkcXI3DZxy7lgul+/xjTTNYsOnkCV JTCQ== X-Forwarded-Encrypted: i=1; AFNElJ9FJLzaW46BitU+Wbahxhq2rRAoXmwemdoDKGeSeE1GUmk68o3v7a6B9qyQHmMfQZX2eOhYsNgHbBT0n0w=@vger.kernel.org X-Gm-Message-State: AOJu0YzHwa3Vnj93N6yoA0uOQCFQFbkMPOwelYChDWfgVkNP7X6Mqza1 zaKAI3xaxLlOz1LxT6QFTVvkv8qlIvu3A/O0GMvxFKkdDjEf2DzUxC8QlaDjvA== X-Gm-Gg: Acq92OFcprXXvdbPHjo6n0ZglFYGbt9li3baY0dW39O3krJ8zlw+F8lav5pKYz3ZkjN qfHSCpnpMtHCKi6BkjDIiI+OP/QrID8HqhuxhlPBk/yvxn2/3e1dcDqGeQTHXzCbh1pVzmT+5kW 2h9xC2dVkAre8y1NZAnvOxfsHLdSFB+SiGyDyOUbg4VBjvMTQJCumbqF35Ehg/Tkgr8Oi3lkD+1 4rfP00BhAslUMyyXi7gjeQRtgbJXpaz9eUGfGNmz9RpqHNGMHgqRywNhbss7lDtUa8w1F/SBx3s iqkAWQ0faSdjctHL2rvUtWDRltcV3nimzJljFpxiOW0TzVv8mPYfjPKPfzGI16z0FuMpCYjbObX Ca8Nc/clNwA93F+h2AB3MH6tmjhKjWz52Lzpc3p2l9M4R99YqlD+MXakgPodWxi8jWbEf3/ZIsW wDY6JoqfqTmYod2jo0NYl8Gt9LqHBXevgFD53342IksXt9JyOsSSIKWhP4yZBMVOw= X-Received: by 2002:a05:600c:c4b7:b0:48a:6848:527 with SMTP id 5b1f17b1804b1-48fc9a4e9f5mr4178665e9.7.1778625847438; Tue, 12 May 2026 15:44:07 -0700 (PDT) Received: from menon.v.cablecom.net (84-74-0-139.dclient.hispeed.ch. [84.74.0.139]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48fce385ea5sm3194025e9.14.2026.05.12.15.44.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2026 15:44:07 -0700 (PDT) From: Lothar Rubusch To: thorsten.blum@linux.dev, herbert@gondor.apana.org.au, davem@davemloft.net, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, l.rubusch@gmail.com Subject: [PATCH 00/12] crypto: atmel - refactor common i2c support and add SHA256 ahash support Date: Tue, 12 May 2026 22:43:37 +0000 Message-Id: <20260512224349.64621-1-l.rubusch@gmail.com> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series restructures the Atmel secure element drivers around a shared atmel-i2c core and adds SHA256 ahash support for ATSHA204A and ECC based devices. The existing drivers duplicated substantial parts of the transport, RNG, EEPROM and device management logic. This series consolidates the common functionality into the shared i2c core and converts the client drivers to capability based allocation. The series also introduces per-device timing configuration through match data, moves sanity checks and RNG handling into the core driver, updates workqueue handling and cleans up internal constants and helper definitions. The final patch adds SHA256 ahash support using the hardware SHA engine provided by the devices. ATSHA204A devices require software-side SHA256 padding according to FIPS 180-4, while newer ECC devices provide a dedicated SHA final command and perform padding internally in hardware. Supporting the SHA engine also requires changes to the command transport path. SHA operations must execute as a strict uninterrupted sequence consisting of SHA INIT, one or more SHA COMPUTE commands and, for ECC devices, a terminating SHA FINAL command. The device loses its internal SHA state if it enters sleep mode or if unrelated commands are interleaved during the transaction. To satisfy these hardware requirements, the send/receive path is split into a low-level transfer helper and a higher-level wrapper managing wakeup, sleep and locking. SHA operations keep the device awake and hold the i2c lock for the full duration of the hashing transaction. The series has been tested on ATSHA204A and ATECC508A devices. Tests are ongoing/pending on ATECC608A and ATECC608B. --- Lothar Rubusch (12): crypto: atmel - introduce shared I2C client management crypto: atmel - move capability-based client allocation into i2c core crypto: atmel - remove obsolete CONFIG_OF guard crypto: atmel - add per-device timing and match-data driven configuration crypto: atmel - move RNG support into common i2c core crypto: atmel - move EEPROM access support into common i2c core crypto: atmel - expose CONFIG zone through sysfs crypto: atmel - move device sanity check to core driver crypto: atmel - check client data in remove callbacks crypto: atmel - update workqueue flags and add flush on exit crypto: atmel - refactor and localize driver constants crypto: atmel - add SHA256 ahash support drivers/crypto/atmel-ecc.c | 252 +++++++----- drivers/crypto/atmel-i2c.c | 679 +++++++++++++++++++++++++++++---- drivers/crypto/atmel-i2c.h | 180 +++++---- drivers/crypto/atmel-sha204a.c | 284 +++++++------- 4 files changed, 1010 insertions(+), 385 deletions(-) Signed-off-by: Lothar Rubusch base-commit: f7dd32c5179d7755de18e21d5674b08f9e5cb180 -- 2.53.0