Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp124225lqa; Fri, 26 Apr 2024 17:14:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMorOa+gMDD8jj1xm8GKZYPIlzAmJLc447hd0Lh4Fa3/sZK2D+nuqiX0vD9QZlj/V6wZ8GLg9p0aPVxXQbdCATDkpC9/E3G0ScctfRDg== X-Google-Smtp-Source: AGHT+IGQct/mkrmasziX4OLaB/6fNAX5NDx6JlVbVL2mdNw5uzTN30VwJ/ipeN+e8KHm6C9dgyR7 X-Received: by 2002:a17:903:32cb:b0:1ea:9585:a1d7 with SMTP id i11-20020a17090332cb00b001ea9585a1d7mr4901812plr.37.1714176895534; Fri, 26 Apr 2024 17:14:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714176895; cv=pass; d=google.com; s=arc-20160816; b=Rl1Yp9+ye+ka+Tg+VQBBCrnsVrX7o72efQ7mRK0MJJ1Fh4YqtFZMytU0sVMfxOfBvF RR9N0qWxj+sINO840h59YgW54ez7gyzJP0R/kxu8gZAz4Z4gIUdvydOp9nLcS56vSWNk W301avB/5aT8MIRn2v8C3Bot+LnCW7UcgKoHcfPBYf48o1lEg5kcyFztVJ8GRcDe882D 6BcnFpPP7pgRV9tFhRaJ8nGOgXUpSZnBXUuGH7YPxh9l51Iqsm8ZBhl0u5Wr6MVY3OgR 9RxAo75U70lD2SsHvQE5cqHRrn0+ab13rkbyP7CfGDUuU6TuVeshaaFlGgG06QIaBFe8 GoJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=YV6AybQpNM5L7BmGh7OKWpSwXS2G3KXKiGflHVOVNWA=; fh=4TOMcrzkPemhEr1U5tqpA2Xq1X1GRNy7bsPyCbE3/wc=; b=vrKWcdNR8Xfd4mW2pNGO2cl8T+mX7Pu5MbeVy/ZoFFwM3tcWa2KQIZazRMnT68Dn8b O4rpizsBFi4inYPkHyAreO1dQOsWbsKmKqDSmficKGpJzEuS8oHf5qhZyjgRrqU2xEaA AOMogUWUETyfeN0nkJnlIXtTgJBrNqucvxdUQHdVvSg9eWCdf6LSyQzI1AqbjOy3GEz9 hqSFK6sQizcvdmJhh7M6teUs5QKdX7KhfC2XzugPc6QJ5AvVVg9rUjtSrARl1RWixMyM yfa0e2TGPifCnimS252tXs/X6GHbU/JGOO+aqpIDODvIjwJMYOiPTDGrRRymDUK4xVDs f0ow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gAwpVyia; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-160808-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160808-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a10-20020a170902b58a00b001eb2f25dbe1si1025317pls.443.2024.04.26.17.14.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 17:14:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160808-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gAwpVyia; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-160808-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160808-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2B1F02844C4 for ; Sat, 27 Apr 2024 00:14:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BEFD47464; Sat, 27 Apr 2024 00:14:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gAwpVyia" Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 79F2B6116; Sat, 27 Apr 2024 00:14:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714176887; cv=none; b=Ctbr+Tp9eLJlwleBdcBymsPQNg/pV4uWcuRZre5jdoPwHPjcZ8XUAcI7euQAQMlreRn9cmcgs68LQwPQTMf/PD89RmqRTmcxWP3M24Ce/i/Qs8Cb1GfiBVTzLoSgTN0hCXeqjyiy08JAo+nmfOG7ypNLiNhbfvGrBCCXV9WsI/o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714176887; c=relaxed/simple; bh=hcJaJfLMJFfzCLe9qFLyr3XZcJLOUaXp0xpxmscAAAU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=BlTbcQTj+Vt5g+2G1O7dvNk9vk6nBMPOulzkBTMrvoCj22Lwm/ZrxIcdMKTwYgOWUCasXrz2MNyXlqpgYBfA9feNuJkjXI+NZDhEbp30q9YZLHnvyVx45Zp78hCA50Gp6CSAMP/nPzq5l62NdsIwswy/qlf4lG3rgLTY82OlBVc= 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=gAwpVyia; arc=none smtp.client-ip=209.85.221.45 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 Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-34be34b3296so1971972f8f.1; Fri, 26 Apr 2024 17:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714176884; x=1714781684; 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=YV6AybQpNM5L7BmGh7OKWpSwXS2G3KXKiGflHVOVNWA=; b=gAwpVyia5JBgGKAxiTV1vrMcQlYeqZBRLWZUMMVAA1JxaI1W9Rrq/q/zSkhV4OfW2Y 1jV/+qkB+6xHJGHqcUwbDRp/Nlb/SZftktLDYBCgzBYn6gimOW3jLidiDST7/UVEHXr0 JVtxNAzNId4sr0jQeyfrrX7fyhL4LU7O9flYjf8atqkjZSVFIAWC6S1apzDAIGbz9TKd /8P9QhFBhAoWkjMC91UabLRVpvmf/JSX5jMXWH4pFDnNRn3pDrPDewF+otqKvt1fUMxy uAnzO6hhRybySQjIwCa6M5Bpg7vnU3e+uA4VqJWVQRbusiDRZ/Msaz4HSh9uS7TOruww op1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714176884; x=1714781684; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YV6AybQpNM5L7BmGh7OKWpSwXS2G3KXKiGflHVOVNWA=; b=Kyy0UEfZAyc2+YaA2U8r0GBZ8yKtC2s+CliXaQaA0QuLu9lzEdGPycDL0cJnosh83Z ymX7n69ClgmA1i9KOykdkPIUfduSBi2Hfg+iR4e2pf17tgAvDmDI7pZp9SvxGbkKhN5K lGJ2+vuCoX/oJQT5V6Szi8Twt4s16hQqq6g49EojV2xZ65t5j0WYQDNSW5ytJMOyroSk fu5lo8vvKHtyqIM4Ct4ka2F0rNQkXnKeJcT5dpS8LFauR0Fh4s/JO6JnQZVCWg7eqV9P 6bnqe2zc50UFLXVbBnesOGgdoTHcDVMLv1ClLke/Ra5pcylkDqd2zDTq7O+nhtblHYwo 6T4w== X-Forwarded-Encrypted: i=1; AJvYcCVIHWK3DL4qb22UmewgaEFDo9KSJ5gxutFJGNdimCxKrpVqGvf3S90i6u1AoR0CE2Zcnm/Gco6xLOGlwrK2ZUE0u1uceHXUGBDV35ODbLz8rNdvuDFwhWdv0gLrt8E844IvoZVmHrWETK5o X-Gm-Message-State: AOJu0YxyFyEspGoJt10sYvxsqjHv+NAg9av/RPBzn95m6mcALnhM7usM Z0QakR39KJnsi8+PewPQmMcSbWmsXwiCqa2kNPTe413XthHiKdEM X-Received: by 2002:adf:f5c7:0:b0:34a:d1d4:cb3c with SMTP id k7-20020adff5c7000000b0034ad1d4cb3cmr3481888wrp.39.1714176883758; Fri, 26 Apr 2024 17:14:43 -0700 (PDT) Received: from 2116bb4b8996.v.cablecom.net (84-72-156-211.dclient.hispeed.ch. [84.72.156.211]) by smtp.gmail.com with ESMTPSA id e7-20020a5d65c7000000b00349eb6eae3esm23748079wrw.4.2024.04.26.17.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 17:14:43 -0700 (PDT) From: Lothar Rubusch To: herbert@gondor.apana.org.au, davem@davemloft.net Cc: nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, l.rubusch@gmail.com Subject: [PATCH 0/5] crypto: atmel-sha204a - read out otp zone Date: Sat, 27 Apr 2024 00:14:34 +0000 Message-Id: <20240427001439.12726-1-l.rubusch@gmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Read out otp memory zone of this secure eeprom and rng chip. The chip has an otp zone and data zone, both still not accessed. The otp zone can be used to store persistently serial numbers or similar, if externally pre-configured. In any way the Atmel SHA204a needs to be preconfgured and fuse locked in order to be useful also for the already implemented RNG functionality. Placing data into the otp zone is optional. If empty, the chip returns 0xff on all field. The implementation passes the content to a new sysfs handle to userspace. If the chip is locked or not accessible no sysfs handle is set. Signed-off-by: Lothar Rubusch --- Lothar Rubusch (5): crypto: atmel-i2 - add missing arg description crypto: atmel-sha204a - remove unused includes crypto: atmel-i2c - rename read function crypto: atmel-sha204a - add reading from otp zone crypto: atmel-sha204a - provide the otp content drivers/crypto/atmel-i2c.c | 30 +++++++++++-- drivers/crypto/atmel-i2c.h | 8 +++- drivers/crypto/atmel-sha204a.c | 77 ++++++++++++++++++++++++++++++---- 3 files changed, 102 insertions(+), 13 deletions(-) -- 2.39.2