From patchwork Sat Feb 24 11:45:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 205821 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1104949dyb; Sat, 24 Feb 2024 03:46:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXCDZGA6b1D0NV/ZpZguz/ylwDeJQptL5MEefAyzydi9Vv+tR0rpCi9Xog3CPBPjkJsmb98JofOLCqOckvOfqHltakDKg== X-Google-Smtp-Source: AGHT+IE43TQqSAxqeZRWHT8RCxTRl/hxP5dnk0ilbo15F27OaR3p+Lkbgmp7/Wlh5tPZlM8GSoD2 X-Received: by 2002:a17:903:258d:b0:1dc:63fd:39c1 with SMTP id jb13-20020a170903258d00b001dc63fd39c1mr1909429plb.54.1708775176694; Sat, 24 Feb 2024 03:46:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708775176; cv=pass; d=google.com; s=arc-20160816; b=MPN0hOV9/alwz6cB0prOTqpvFf5oqPZVE7j+aHQk6iBCQGK72hAuTHN5wmLcqdVKG4 vBHjckAh/yJzcx56/Q3nrY82McAotnsXotR1bqm91zIUAQPX9HQuoM4YPgTaIwgj9c9i fH/6HJepY0Wj+fKijwogazd2hQN4VgE9/FjoDdUmpzVUXR8ZPaE2QMk0030hnfmfV5j5 HpHyQBlcmKd3DXdUQzIJ+S8lWFeTczCogn2AnpUoTJU6ZEDvsO9fl9yCfakw4bfbFAnU GOVUpwu9GXRcPpzl2AjrVhM1tvYGxrIik73czif6YYNg6DBUkNgj7d+/Umnfo0uF7xcL WkKA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=wh2ymzOPVRAR/yzwJtBUdFQu1uqttH3VxrKrEqGY3XU=; fh=3podjJk0UlP544BUncw9FPdwIiLSoiFiT1rKSBe254A=; b=LnhOHX3HHDy5XygBgYn0WE1VgupEr8c2pVm2ifFAgBBVskRKnQrfFMujj3A9KA9mbW pQ2c1CnP+uo2VQuTo6gY5W4ErnG6NYkbd7xG9ayd2gWyk04F6JGOUKlXoIzcDF+rr068 2lgv+CI+OzRVH2uNAOvq8j3ht8l7VvuSvOr4a/jFAthMOXPNa6pTm0izkttbNS2JFn/y SjB+SpuU3vlXKaNFCqm6bJ66CzCaSOdZRbO03PBj+kDFXsS18yDctV/drvk+sgDnf/vM gVWNaim25PL1gJaMuhyCS0UUQl8d0ofirIyNqYEECzRgQhq1IB6jFPXHkzO8f9+zzZpL ZHGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SMTf/rSV"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79604-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79604-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f17-20020a170902ce9100b001db8cd7492asi752152plg.86.2024.02.24.03.46.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:46:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79604-ouuuleilei=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=@linaro.org header.s=google header.b="SMTf/rSV"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79604-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79604-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 834E7283C49 for ; Sat, 24 Feb 2024 11:46:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C7D33D970; Sat, 24 Feb 2024 11:45:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SMTf/rSV" Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 CE32025775 for ; Sat, 24 Feb 2024 11:45:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775145; cv=none; b=OZZmFYXIMDm73Fw+ITLqLSsjPDxNXPS7GL1FkD1km1GrcxWKY2CyUA8sx6kbXA9uIsaVnUsJ9PophR9mP8PsacWfPz/MuVlQJDYM4A3BxweGzpg0C7mDLVIno/avu00XcOZ18icBHy2QnB48Pvd5MPxqPQtYma7E7n3orD51A8o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775145; c=relaxed/simple; bh=F+AI7i5rKfjspsGK2+mgDUMQZG0c9+Wwx+/HYfJ7OGE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vB5dPcbU26GCbve95sP4RHbWmW/vlfO/MSmZpHnmz7XR+Tv+rjxMonAv50LMcCGSw3WczIWQ7GLcWwqIq6sbU4INjdTGhceOD+ktpGwbvCTitCZZmZ26GVTdxJYWuE/33W1kgrBOe4mwRYEcynVRWWABre8Jj+CfIheGHu3D7pE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=SMTf/rSV; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-512f3e75391so205048e87.2 for ; Sat, 24 Feb 2024 03:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708775142; x=1709379942; 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=wh2ymzOPVRAR/yzwJtBUdFQu1uqttH3VxrKrEqGY3XU=; b=SMTf/rSV0vFXHUr/q4t8KE5EDZmkRrhx9n2d7ot/Ps+RI9AD8ft94EWjlIIqYqjWYU nbOmubUhslnypoDHQharAhFeT+XOXIwkMu1K/yNd1YW4dP1cbVqClGW/jgAm/QHgaoAZ no26X1Fc8BAkkxnGF7BhzX3jwV08Zy8jIpyqYK9cOi2a7fJNW/BoUhjQqvQhooNEvheR N0cntoFLpDO6zsvGlaEZqZB/EBDFz6gmt9T7bz/zc+P/mMbonuscIn3A1QptWRxCD37b NIveMxntbw/2Ki7XzTG+ELL6nmlUCgVqrwOloH0GZEV6jJb4b/j5KlbGtp54s8bYVe6D 5a/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708775142; x=1709379942; 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=wh2ymzOPVRAR/yzwJtBUdFQu1uqttH3VxrKrEqGY3XU=; b=MNs92/OaFrSyOR5ZH7a5tUFhJB1t8KWu4TGwc94YSEQ/pXRk0esE9b4vHLHGPfvjVU FhIOtEwGVKQM6ksAUWaoiMTVHC0xEWFcxbghJrb7xdzGkBlb02TWuEfA7pJEpoPOr1R+ fE7sgXbJw9XwWrpoNg71Dy+BVT1um11hkIg16xDDBkIb6YClfMJYBFGYsYaburhHo6N9 koY1pAi64erR19iuAb474s3xUju9Vb1ro3jIALZv8aJk+ORMsE5YrUhvv2v5/3fuiJ2L UngUa90wqrGRNJILhFtOl0WPMxdoj5a5sKnbOEJWZ6aA/+7GOuUT5zU+rJ41a7xl7E4Z Gjcw== X-Gm-Message-State: AOJu0YxqBKjHwdnJKTFLVfTOtYL9xZkZgBUoDboro5u1LcMCz0FAWgEZ qmBEFHcu2q1dxHb5acB0b6PAVNX/t59FufCwI3otx4TpPlBkYvYT/zeQKRAN/gQ= X-Received: by 2002:a19:2d10:0:b0:512:a741:95fb with SMTP id k16-20020a192d10000000b00512a74195fbmr1428978lfj.28.1708775141935; Sat, 24 Feb 2024 03:45:41 -0800 (PST) Received: from localhost.localdomain (82-132-212-111.dab.02.net. [82.132.212.111]) by smtp.gmail.com with ESMTPSA id jp10-20020a170906f74a00b00a3e209b225asm517826ejb.43.2024.02.24.03.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:45:41 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Rob Herring , Srinivas Kandagatla Subject: [PATCH 01/11] nvmem: fixed-cell: Simplify nested if/then schema Date: Sat, 24 Feb 2024 11:45:06 +0000 Message-Id: <20240224114516.86365-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> References: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1485; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=+t8xb6FTxyUQaM/SqNPVlxBKCT9nYlThK/83CSBDAJw=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBl2dbLhk0Dgc84279u/3UKyKxqUW6mSv9XPTh2I NPnCqzW6mCJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZdnWywAKCRB6of1ZxzRV N5bNB/9QWzZyB7EQbSXQqdjCr2uCEbz1yU139uXYTO9vT2gOoxH4NjTml1lzVBnfAu53tBrylqg TriEehHVy5tZ7+4te3Ty1CNlk+Se5MlOAZzKFmNOI43oVIFYiywcltv5P6sqF+BkkOlNcbAHVcc EpdbRCzwIuzBqE4eICLcYkuoQiG9X5dtVB8GnTGFaqdO8SG1h46ungzE4qLOxqnAVtmrkgRdfrp Ee4rukCR397xissAMgkbrG3MdJ5Wa0lT1omSqRizSFFO9zbYA8tlIm+vNwFJt37d8DlvJksK40r Vfk3eFtF5iM7uqsTISWjVd4tC9lghMmwCkUeR+1TwHydfy5u X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791780639644653466 X-GMAIL-MSGID: 1791780639644653466 From: Rob Herring There's no reason to have a nested if/then schema as checking for compatible being present and containing 'mac-base' can all be done in one 'if' schema. Signed-off-by: Rob Herring Signed-off-by: Srinivas Kandagatla --- .../bindings/nvmem/layouts/fixed-cell.yaml | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml b/Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml index ac2381e66027..8b3826243ddd 100644 --- a/Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml +++ b/Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml @@ -36,20 +36,18 @@ properties: allOf: - if: + properties: + compatible: + contains: + const: mac-base required: [ compatible ] then: - if: - properties: - compatible: - contains: - const: mac-base - then: - properties: - "#nvmem-cell-cells": - description: The first argument is a MAC address offset. - const: 1 - required: - - "#nvmem-cell-cells" + properties: + "#nvmem-cell-cells": + description: The first argument is a MAC address offset. + const: 1 + required: + - "#nvmem-cell-cells" required: - reg From patchwork Sat Feb 24 11:45:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 205822 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1105052dyb; Sat, 24 Feb 2024 03:46:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXsSIvyBEDm9zxXg1LLJelX+Jjbd4Zz1jcr+c58P1F+RlI4fOkmcYMTn3xm8T7MZ36q7Z15c7Wqi0nKwZxx9w0rs4Ko+w== X-Google-Smtp-Source: AGHT+IHO0pA8rEhzXH+Xv7P1y18aZ+JZN7aNLoS3/KnLTYDWZa9uYQ9qB8HxVKGSWSoNhwbd10ij X-Received: by 2002:a05:6512:2210:b0:512:b35f:b90d with SMTP id h16-20020a056512221000b00512b35fb90dmr1557056lfu.31.1708775195552; Sat, 24 Feb 2024 03:46:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708775195; cv=pass; d=google.com; s=arc-20160816; b=U5xunzEGKjBvH5qN6zVCzxEJT8DymbujySzUKox94SoJDfKhQ+MsVCc2XWRyov/RbO v1FHn37ZDwJb27962Y8OGXbDxcSlK0Hx4pdJXDLzlcU2sMXwF+gNqdwcbccrwBbqtAbg NkiNlxomNu/ZZVDy5wkDXu5N0/a/S66GygGwB85pXYwauNZ5UWsjcwVCuzLbiwj/iXIm HsNIs28qJvtHY4jOjzzF4dvpqT6XkVdxOtz+Cgn1ftAC+QS6uUbLjQosn/4aaSkWKSS8 ITAtolfM56fL5v9FnCp+RaGP7E0uXyClhykzPlTYbXJSnkzutGIv4lCybFuPpYIdTNrP kj8g== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=L5kcNjCxGNrVdzgJ/HQjMCheDz6E3QdP/jU7AXEAj0s=; fh=NljMyi0Y5wDgNQVF5ZF5Zf96qt9xhRFdfHgxvFQPvlw=; b=Q2vFaNs/T1afLkAzAefE98GQYgxFHWDBNId6geyo0H51Rn6uXYdkGFAyFV/uwvzwLD CmN8GIftyLR2VRRHPTymTldB7m3qZLSEjV+4nOXdPyxyNgE19JtuG7ONUUquwLV3qJI5 uwqPwnuYkvXhAoD0D+LFFxGvbOAIyLx69oieMuhglWTcXZco273hVwYclgtRUJkyBwC2 1iI4OppWb53rI8MR9Eon/Z2afK+/2nsdmgoy25t/OAKuDmomfbPrNWsyuI0GSEVN9/vY P0NlXWcEMyzdA9TzBBOve8A4LeyQ3YKJWbAUM4ug3ZjcCRMtB3m5/Mnt134XBPDhI9AW BRPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qVdG11WZ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79605-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79605-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gt23-20020a170906f21700b00a3ea0890aa2si458980ejb.36.2024.02.24.03.46.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:46:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79605-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qVdG11WZ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79605-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79605-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 022F51F21A17 for ; Sat, 24 Feb 2024 11:46:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38AE43F9D6; Sat, 24 Feb 2024 11:45:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qVdG11WZ" Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.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 EBAFD31A60 for ; Sat, 24 Feb 2024 11:45:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775147; cv=none; b=MTgBfSJsoDSX3e7qAvyedAP9geAdw8J1qPBmzO5+OPdK7KeoAWXKJTXEtNlo19hGbvChS4j+8iEODJozwKEZlYTIzYNBLwqUwwLq/5g/WnCVGHbBTbSab1r2iebIOQpRN0JWOWuqRLr3a3shclYNAAGY+kCQ6W4Z+XJpkiiN0CI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775147; c=relaxed/simple; bh=6wfl0TuMkpxBuqdM0cE3yXIiTFs3ob8LWNxFXfhudpM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jiQwD/Sg3+yU0iXUrJ7cBxeYgm63zV1sadN0v8NWJlomTI2DMDGhnamAcIswDxu+Vmjjub8xiZ4obqUMWBgAMk7mdxckVgWeEj37JGJST25aR/FG776pSv3CZQGSjIXQej8hJ3zO+ie3fFD4hiujXuCVl5CStwOaz60MzYES6XU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=qVdG11WZ; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-565a2c4cc1aso552654a12.2 for ; Sat, 24 Feb 2024 03:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708775143; x=1709379943; 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=L5kcNjCxGNrVdzgJ/HQjMCheDz6E3QdP/jU7AXEAj0s=; b=qVdG11WZ2lxk3vTfdeZJewjLZ9HdNsnoTxtHgJd8DmAeQl2ihPe2A7aSebaBCjzAHe 3CuIPrxkFwrLtzRw3GoBaSULan6Yve3ELOSpKQQiTRr81bRDB6Y/7NYLYEZPkRgaIXUL uWwZwssfG2DIgRi1DdYkQ6RsCHTq+GFEVoLQCoaFInYCJJIh0/vJZzwrj+lATK1P7TYm Ba9q1lP7ew0BSZYMaZk7HFJyDi9nP6G5wRnT/D5ph++GGpFSS0V+wyMLj6gQc4RVKUiR XVF0cq+ZeFZD7yemmbQ05DL21MwWzSWvYdCUQluAaIWEP51/SkV5z9eItXcre6JxzXwn sE3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708775143; x=1709379943; 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=L5kcNjCxGNrVdzgJ/HQjMCheDz6E3QdP/jU7AXEAj0s=; b=c2Sn1xlwVyMb6083K+UnuWxevQxms9+NBvU/RApS2+lhV5zBgqQE/0WFlBPOdJMtch T2a8f1kHTfv1VUh1PLALwwMu0HmffMB5uEpXl6QduOvT57D7dc9Km2Oa3CKpH4h5MGJc joi3YTMZQwWzxyYpfesgzlXpu/OuXzz9lBkdASG6eZi/a8sDuuTemdc+FJuheiepjS5Q AcP0EGltsZ7UOqE0LPZE5SDnNkiuBh0C4Fwpuf4dpg8bW+z6SLyNmGO2fOQz0P10eu02 hZ9TOTbcgbMfE/pP5nThkmvev6dgFWpdyORkVWyvDR3AcvgTS8C0KC3nH7xIi1JR87gx j3TQ== X-Gm-Message-State: AOJu0Yy5bwGrz9OBFWm1AaVn8e+gP23eO/hKzTssDIrHnTLtDyq9vbZ2 IdXhqfTqUqd5sUQXG6SRzcY5IEmc75uLPzZqtn6FyU6i3CIvrCjVYtPQYEOD0uI= X-Received: by 2002:a17:906:b349:b0:a3e:fce7:9393 with SMTP id cd9-20020a170906b34900b00a3efce79393mr1371848ejb.10.1708775143241; Sat, 24 Feb 2024 03:45:43 -0800 (PST) Received: from localhost.localdomain (82-132-212-111.dab.02.net. [82.132.212.111]) by smtp.gmail.com with ESMTPSA id jp10-20020a170906f74a00b00a3e209b225asm517826ejb.43.2024.02.24.03.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:45:42 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, William-tw Lin , AngeloGioacchino Del Regno , Srinivas Kandagatla Subject: [PATCH 02/11] nvmem: mtk-efuse: Register MediaTek socinfo driver from efuse Date: Sat, 24 Feb 2024 11:45:07 +0000 Message-Id: <20240224114516.86365-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> References: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2307; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=0uQx/zVOu7lJjRsFUrqs5vdvlqNChuBmzKOHBVqwmHw=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBl2dbLCPgH0z3n6Nwl7UGuUwlXLwwHF2jW7zaWR nJx1N7na/yJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZdnWywAKCRB6of1ZxzRV Nz+iB/wLQma5Z4fdz3xVK6d3GaDGSS1AbIMORJFNFYcJFdiU3q63Ovqg8OiL9QtUtAvkcb2fpmE CaH1TPF5yTmT9PGGyiov/j2LXQtLAX3AayQbnNprpS1Hwgz5KbO5b3Urgzr+svsjYH03mK4SOo0 ck12eVJMGZkthzha5DoYU+Qt48/u3x4mQQfzaeWzUnYE9sbVtiBBqMB+swQdOvgaX+iZe/pZeUY VZmjH2GniXQqFOYtbzMwoIaiInSCyrlrdbCaOJOsf22GeMsEFy7XSh/zX72N4ra4IPdp8oGn8Wf EdUYtqdd1oTdcC5Ssa5iBdFAHyGVeEx+wGr+gY55Ocp0564w X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791780659124367667 X-GMAIL-MSGID: 1791780659124367667 From: William-tw Lin The socinfo driver reads chip information from eFuses and does not need any devicetree node. Register it from mtk-efuse. While at it, also add the name for this driver's nvmem_config. Signed-off-by: William-tw Lin Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/mtk-efuse.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/nvmem/mtk-efuse.c b/drivers/nvmem/mtk-efuse.c index 84f05b40a411..f5bebcecf9bd 100644 --- a/drivers/nvmem/mtk-efuse.c +++ b/drivers/nvmem/mtk-efuse.c @@ -68,6 +68,7 @@ static int mtk_efuse_probe(struct platform_device *pdev) struct nvmem_config econfig = {}; struct mtk_efuse_priv *priv; const struct mtk_efuse_pdata *pdata; + struct platform_device *socinfo; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) @@ -85,11 +86,20 @@ static int mtk_efuse_probe(struct platform_device *pdev) econfig.size = resource_size(res); econfig.priv = priv; econfig.dev = dev; + econfig.name = "mtk-efuse"; if (pdata->uses_post_processing) econfig.fixup_dt_cell_info = &mtk_efuse_fixup_dt_cell_info; nvmem = devm_nvmem_register(dev, &econfig); + if (IS_ERR(nvmem)) + return PTR_ERR(nvmem); - return PTR_ERR_OR_ZERO(nvmem); + socinfo = platform_device_register_data(&pdev->dev, "mtk-socinfo", + PLATFORM_DEVID_AUTO, NULL, 0); + if (IS_ERR(socinfo)) + dev_info(dev, "MediaTek SoC Information will be unavailable\n"); + + platform_set_drvdata(pdev, socinfo); + return 0; } static const struct mtk_efuse_pdata mtk_mt8186_efuse_pdata = { @@ -108,8 +118,17 @@ static const struct of_device_id mtk_efuse_of_match[] = { }; MODULE_DEVICE_TABLE(of, mtk_efuse_of_match); +static void mtk_efuse_remove(struct platform_device *pdev) +{ + struct platform_device *socinfo = platform_get_drvdata(pdev); + + if (!IS_ERR_OR_NULL(socinfo)) + platform_device_unregister(socinfo); +} + static struct platform_driver mtk_efuse_driver = { .probe = mtk_efuse_probe, + .remove_new = mtk_efuse_remove, .driver = { .name = "mediatek,efuse", .of_match_table = mtk_efuse_of_match, From patchwork Sat Feb 24 11:45:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 205823 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1105166dyb; Sat, 24 Feb 2024 03:47:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUIW9etBqaMYUjyVO449h07hjVVVFO1sAdP61W4nLTMM9YfYV0eIzlf/YZBFA63aTuI140D47CgmDjxM12bb4PXmdSIWQ== X-Google-Smtp-Source: AGHT+IG6GFR2aVSyEx4Rpb3KdX9eFNNSdAMXf3CVZK8OgVkgUv9tSyL4nOewqVqW/nswFgFCMnej X-Received: by 2002:ac8:59d3:0:b0:42e:60db:24ca with SMTP id f19-20020ac859d3000000b0042e60db24camr2357519qtf.26.1708775222447; Sat, 24 Feb 2024 03:47:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708775222; cv=pass; d=google.com; s=arc-20160816; b=ij94NACdTdaeMEDDijzsMiYFvoqNXpoKJH7fCo8gC9SAoEZcn03TCRq9RFzi+5uDLO xErKob/E/p1k18Ff8Tvz0NYlK0ROC1GnqMhKEaPsK7597aoRA7AuBKP+pJMjCF3NTw6W Xend87us5B+Kcl3S1rb6IPOCn6xuJBtXKJVEq8W+BV2+CLrgkofKxbWi3E3x4LhZ4WLv sc3eFp7DI4sWQnnpPV8ixFWGe8DusT6r24eampTYKYnm1Rq6TXLpDRraXKbkQzoalA5o UR044fKdP1Tdtvgg4dvs68cIZKy24ylHefUxaF6/FXNSjPADh7v2g0RleIOAwrGTOgAg I9oA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ftlPy5iUSBiEG7hkLYK5QF6hb+D3xmG+8r6qGtLsN9Q=; fh=7PagI3UPb4w22blrkhZSwe3UdppbaMAVcT6NEi5bDcU=; b=if6PqU+MpT8jK3u4QaT9udMUAGMQTvDY6GvCUG/9Pk3HILuDyjQqUwTONxjsUQLtfV IqhsA3P7oJ2qLpYxdAr52OLT5Q0mJSVf0FwhtFDlTA3Sct7mAu932m0hywo2mgr3sJWg OagUSZj+JzHnXUPiOu39rNU28AtCVl78qNJfmit5EG4+W8x7B/TvkJscrmgf+CTpfRKj m9zl2LRrWHTzSOIhxRTgE5u3LE98h4EwJLa7mxb0w8ZT3XuBWf/sCldX1ppO42MgMmXH s/uoZ3GAZXEFuzlgyYQ5rTN86lwsMETZ/BdPshNl8hgCOHTRoxZtWlEQwb8T6+s0s8nT 2ABg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=shmlPHus; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79606-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79606-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z24-20020ac87118000000b0042e165bf31dsi899577qto.93.2024.02.24.03.47.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:47:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79606-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=shmlPHus; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79606-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79606-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 33FD61C2141D for ; Sat, 24 Feb 2024 11:47:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6649B42077; Sat, 24 Feb 2024 11:45:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="shmlPHus" Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.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 4ECBD3C473 for ; Sat, 24 Feb 2024 11:45:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775149; cv=none; b=OZn+Xz+hYr89+qE0EvTztpd9ivdoteszdmBJ2g4+mO2G6nS58FVZ19FxcUJVgUhS8vD+UsCJBZy+d+pjhlW1q0WTKnHJdL0rQ/gsIqwWT3p344RVdSOyBnQBazqPGdQlvGkXaDKO/5sGJMjLJQ+hBZg8/64/bJdxBe4ZmYaZ28w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775149; c=relaxed/simple; bh=IC5A3pZTbDPbGSPDFbfcuoQTduPSqtKVd0/010GNXf4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pMQiNve03dLwu7j0lUmd+OG9DKmoRM9YTneZ7aRWeTdvc1VUQ5IRHtgkGVxWEahAmiU7HzS5bX0QHqXflGw0W7fjDU7SbUXnSEuhth9mAypWKMFpeoh1FQ4NMhr9aWMLDJdSMV5PH17bHVLFo2V3miJHQ94fEUyolKAC1En7olg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=shmlPHus; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a3e85a76fa8so151267866b.1 for ; Sat, 24 Feb 2024 03:45:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708775144; x=1709379944; 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=ftlPy5iUSBiEG7hkLYK5QF6hb+D3xmG+8r6qGtLsN9Q=; b=shmlPHusiIFTp3LEp8dzre3vorB+OaI5TPhGdtyGPpIVm3fxH0KtrlaijBevEQ3BQo 0u9CGHT+jmgCqoESFIm42ywWQ8L8AGGuFIlZWHIQsl6Wek5f/cuL58E4ubotPNpfwQg6 V5xjOAZYulTak71JgqTS/s4m76l02noyyrRt5EXk9d97rIgkQ5Xe7XWi5AJOI5YE57Pw TaoWnyecKtIsUf3W0BVKZxVYnswIYxdvNNcwIhjpTk6OAWIS68jS/x8CzT75eeQPnL0r R2lfIkWo/+SIsOxFnArolq1hkt2Wta6EhsCSxoS7vnzX8/6PghVfRGxOcEZ/eH0F9Bkq kkQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708775144; x=1709379944; 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=ftlPy5iUSBiEG7hkLYK5QF6hb+D3xmG+8r6qGtLsN9Q=; b=fAJrPVCRqZ4sIdYD1ZJYQeQglPesb9oIQp4CRtOyewwQH9dT0O+VTy+Bi5Im4ygpw0 2PcEWsAzyapLfAWlo6BwJJWUg5swgFVvu6aP4bVykOghioolwIBD0+jsu74L/s5A+3LE kzGeojM+7qj6PhKchqtyW5aAR5FCWigZJCZxEqHoitgM3M02UUh8cJMyd1Ze8IyDdUVe bDOojklDv9avK04S7avOYmbyLzVjI/6jh2FJJxQycs4rzFL+S/RD+gv6GZm19ERRh1d/ HMCNEfByrR+y3WGYD43PwGUqTKSTPUWBo7AoEopebUVAPreBSZq6L4XHuLyHG8tOm/ek 5cyw== X-Gm-Message-State: AOJu0Yz3sv4lxJDK7+tTDJtGnU36bf0+ypJ+NvozRiQaytups52RpCP4 tEEkrXROm+OmU+Bs9Nfuyzo+hmtLWbB3l13A+wZE3k3/vx3JvD307AuYpf603pk= X-Received: by 2002:a17:906:52cb:b0:a3f:b6f8:3969 with SMTP id w11-20020a17090652cb00b00a3fb6f83969mr1364284ejn.9.1708775144700; Sat, 24 Feb 2024 03:45:44 -0800 (PST) Received: from localhost.localdomain (82-132-212-111.dab.02.net. [82.132.212.111]) by smtp.gmail.com with ESMTPSA id jp10-20020a170906f74a00b00a3e209b225asm517826ejb.43.2024.02.24.03.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:45:44 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Praveen Teja Kundanala , Krzysztof Kozlowski , Srinivas Kandagatla Subject: [PATCH 03/11] dt-bindings: nvmem: Convert xlnx,zynqmp-nvmem.txt to yaml Date: Sat, 24 Feb 2024 11:45:08 +0000 Message-Id: <20240224114516.86365-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> References: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3412; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=5gPT65/cQJCVAohnxbVMvhSFCBOGKQLLlzRupY1vB5Y=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBl2dbLAL3DFHySKyBIcdz8yGcCF4wREK67ZeJgp E7FGNIhmu+JATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZdnWywAKCRB6of1ZxzRV N0LwCACz8JguxCensUsY5lTy3iKwl+SyUvKKPQKz5D6ixsKdyM+0hbZ6q5zckO2PvxGoPul1ByL TFg56EQopxi3kRskxOC4onaBts1mWoJ+8d8ckm5czcaNrPls0DHRzMP9ePypdwHLKFL7bTjPQcY XGJeh7EsCkgmfA1aeyWKEY6T1U3+w4pI2M+1bkCdw59piUMEoN+VgaioKPUCZSvknEyfci8QhE+ w3TvvdKUwmL8+sWDWoMxalc3pRE1VaTPgI6pc8NKhyHIBr4QsiAbNx05Iu4r7qlGEIPkimRwd9R 3Lg8m+S7vjthHvLA933kZ2vGhSfVXcuOPeCyw+bRaVKl0p98 X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791780687807231981 X-GMAIL-MSGID: 1791780687807231981 From: Praveen Teja Kundanala Convert the xlnx,zynqmp-nvmem.txt to yaml. Signed-off-by: Praveen Teja Kundanala Reviewed-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla --- .../bindings/nvmem/xlnx,zynqmp-nvmem.txt | 46 ------------------- .../bindings/nvmem/xlnx,zynqmp-nvmem.yaml | 42 +++++++++++++++++ 2 files changed, 42 insertions(+), 46 deletions(-) delete mode 100644 Documentation/devicetree/bindings/nvmem/xlnx,zynqmp-nvmem.txt create mode 100644 Documentation/devicetree/bindings/nvmem/xlnx,zynqmp-nvmem.yaml diff --git a/Documentation/devicetree/bindings/nvmem/xlnx,zynqmp-nvmem.txt b/Documentation/devicetree/bindings/nvmem/xlnx,zynqmp-nvmem.txt deleted file mode 100644 index 4881561b3a02..000000000000 --- a/Documentation/devicetree/bindings/nvmem/xlnx,zynqmp-nvmem.txt +++ /dev/null @@ -1,46 +0,0 @@ --------------------------------------------------------------------------- -= Zynq UltraScale+ MPSoC nvmem firmware driver binding = --------------------------------------------------------------------------- -The nvmem_firmware node provides access to the hardware related data -like soc revision, IDCODE... etc, By using the firmware interface. - -Required properties: -- compatible: should be "xlnx,zynqmp-nvmem-fw" - -= Data cells = -Are child nodes of silicon id, bindings of which as described in -bindings/nvmem/nvmem.txt - -------- - Example -------- -firmware { - zynqmp_firmware: zynqmp-firmware { - compatible = "xlnx,zynqmp-firmware"; - method = "smc"; - - nvmem_firmware { - compatible = "xlnx,zynqmp-nvmem-fw"; - #address-cells = <1>; - #size-cells = <1>; - - /* Data cells */ - soc_revision: soc_revision { - reg = <0x0 0x4>; - }; - }; - }; -}; - -= Data consumers = -Are device nodes which consume nvmem data cells. - -For example: - pcap { - ... - - nvmem-cells = <&soc_revision>; - nvmem-cell-names = "soc_revision"; - - ... - }; diff --git a/Documentation/devicetree/bindings/nvmem/xlnx,zynqmp-nvmem.yaml b/Documentation/devicetree/bindings/nvmem/xlnx,zynqmp-nvmem.yaml new file mode 100644 index 000000000000..917c40d5c382 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/xlnx,zynqmp-nvmem.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/xlnx,zynqmp-nvmem.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Zynq UltraScale+ MPSoC Non Volatile Memory interface + +description: | + The ZynqMP MPSoC provides access to the hardware related data + like SOC revision, IDCODE and specific purpose efuses. + +maintainers: + - Kalyani Akula + - Praveen Teja Kundanala + +allOf: + - $ref: nvmem.yaml# + +properties: + compatible: + const: xlnx,zynqmp-nvmem-fw + +required: + - compatible + +unevaluatedProperties: false + +examples: + - | + nvmem { + compatible = "xlnx,zynqmp-nvmem-fw"; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + soc_revision: soc-revision@0 { + reg = <0x0 0x4>; + }; + }; + }; From patchwork Sat Feb 24 11:45:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 205824 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1105172dyb; Sat, 24 Feb 2024 03:47:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWtuD6cFJJ461zIOreRV0ABnz0OcycK1FnO7aXKJAWjb6cOiwJdHciObOS2RGxb5K/XP/WggrZFxaAhdkWPqg1Tp26mDA== X-Google-Smtp-Source: AGHT+IHTOBfBnqj1meYuAD5gc0qjxFaVKKIUQfkvjlG0i9Dez3zMmM36DkOzICtZyvns+Bjc9bpq X-Received: by 2002:ac8:5cc2:0:b0:42e:72f6:cec7 with SMTP id s2-20020ac85cc2000000b0042e72f6cec7mr1942254qta.20.1708775223059; Sat, 24 Feb 2024 03:47:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708775223; cv=pass; d=google.com; s=arc-20160816; b=VYw1aUdyiM+bvaVsvlTG1v0en4xGUcoMkl5GXkgjt+LFYYAV7eJhgx6FIAD7xAUNzH 34F9zWmtQVo+7m69OttCGb1W5Bu5HqNpEV7G743j+C4CIvH0JKa3dtZD2Jb/KHiRzyuC 5+fIRIhSPuj9Mq+WqIVVz5A3BvP8BmdwpxpknKotBm7bJLv7GuBVWTZejSNrGR8JqCUZ izPGGiFt8VqCoVLhXK+T8q17vXZvbIUhmpOzDQp6OeznKYdX1wmaqbzNo2+Rn68t14Og aDsXD/7hC49aj21BuKteEJmU+souT6aPjrrqaN3IKMM1QPEmKwGJ7LzwhV2Hv+xcGpiz ljAw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bzveBIxLakGfD0cdsIZlA0dFteMRKWG3Vk1FrE3imik=; fh=tVhp40Oqf+tPK0dh+8u+SQK9ywlrpw/Mv5UaPMTZFWA=; b=C+3+izKUI1G7l3d7kUgvuyBdltRpfaOohvdQEoafzo38hu3Dva7XUKi9Qh74FzZrtF uHSxW0twzU5rm1p1A7sOUiYjI6PN332LDtDKyDQkC1FOc5ATzImS+KOshDX3QfXKSSZf 2OenvkHwvT68u0Rgmlqskn8oLsOj3j8vFnfY5K+PGc9LignledRHKEVBD94QtwyjqQZO 4Fc1NL21Crx6ced3ue7LHNUs+8I/qcOFHmkgJ2EKfxrwGDuHxitsLFco/FFFYbfBKyNF fKOR4EjeI1ZXWfyLnItVoyZB7EJmx0kOR8WzEoSpmHrM28c36u9gLH5NClFUmbt68G6G csXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mSW3TjKI; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79607-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79607-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a4-20020a05620a16c400b007879cadbc8esi837648qkn.394.2024.02.24.03.47.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:47:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79607-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mSW3TjKI; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79607-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79607-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D4C421C2192C for ; Sat, 24 Feb 2024 11:47:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D78243162; Sat, 24 Feb 2024 11:45:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mSW3TjKI" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 B48EB3CF73 for ; Sat, 24 Feb 2024 11:45:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775149; cv=none; b=ldvK+kroS4I/9Ria1WIF1AOcMDAr/5d+fJmvzLCfPHLjf/RZI9jATb3m1UkAIj5+Mof2MwELoDTUNpOlc6pFLyfGWMxUz6PxuEAgwRBEoS89SkhMtFWn/2+IREyLmLOo04+UuaP+6YPikHpyvfjYbkfXWyrz+Imsj8syOzg25FI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775149; c=relaxed/simple; bh=5dyZQ4Vh9bJV/vcHRhq/mZBaQkKJnsxChAlx3FjeSIQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=f2WKKlRPppgu7EY1q+1++nn1cNqD7bphcXgIIZQr6bRWQR3EFF3QVMd+YhZcqc9zNkCbI00xSpVDYcG9gQ8KZErucWKD7zidtSrpyq+L0w3hXSgF4OIhGO3QP4PFCgtQbb6fmaJ3cV5zd8xdJ2RsxSug/AohpKDhWFB70qIp1Zs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=mSW3TjKI; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a2f22bfb4e6so185793266b.0 for ; Sat, 24 Feb 2024 03:45:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708775146; x=1709379946; 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=bzveBIxLakGfD0cdsIZlA0dFteMRKWG3Vk1FrE3imik=; b=mSW3TjKIYY+7ZSEo1F2LR3XHUoL5dV/nM0ICKVQpRWlQtKSY2ABeh1mLESqX1jhdhv A65HuSsbdP8AUKavIe3IMquPZWUbI5PA9XslbL7pZTd+u6J3H4nXnrkoFAWuLvT2Z//I 9Uc6o1bK1Azq9efn6UbCp+yM2l8scGpSYWHPo4zVJhaAQGiFG+KX0v8NXxLwzxKmqFgj 9tjO1muQ34D7bAruZ7MvvI9rnOVQSHwyPpqU1KegkKR7euodPZO0ZeoueDSmd9ZqTgiR 0VYY6dwY9wDwGhhOTqeFU/WA6F4RqjufTG3GpFR+JLKE2weOI5/XUgjZIB/OVgJi7FXW uojg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708775146; x=1709379946; 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=bzveBIxLakGfD0cdsIZlA0dFteMRKWG3Vk1FrE3imik=; b=ECPnwMui8IHktpzj05lnGMuUo8BZ1rbt0FqrEPJ0RupUxF1gsUuDJ9lpcrtzuaVvcj 32XBZ1YPPWWDDNnKVt+nFj+tI85x4Os2h8AfdI4RrMdok3l4Wb3bXXdjD0koS+Wj0Y6x 57nsC4i5Gf6Rk78XX+Srf4+KDvkuogUadRCvL/wRBX32m0g3O19h9P+OcJoNposDlolB t+XecAXxl6iWoqtnjx0lZIsFDPqxd8a6xW1I2xK+nhSHgt4Ty7/IGIl+crDsWyCbPpKl N/yOefcmnjb6jq1q/rcwjKZYWh6uIg/wuuFfIhIlfTBe1P0/8JZ7/Ne9CsuARQGT3dnW PDUQ== X-Gm-Message-State: AOJu0YxVQntupO2/UpTzaO+qQPkIKEUM97THfFG7G0rcbtRoepVvwFLD mOsrekcHxfmNWH7F6T2YtRN9YQ9GE5y9gsJD7J4/YcNzElwsDnX8cIUi2tGeCyM= X-Received: by 2002:a17:906:b154:b0:a3f:d1e3:b906 with SMTP id bt20-20020a170906b15400b00a3fd1e3b906mr1207657ejb.25.1708775146148; Sat, 24 Feb 2024 03:45:46 -0800 (PST) Received: from localhost.localdomain (82-132-212-111.dab.02.net. [82.132.212.111]) by smtp.gmail.com with ESMTPSA id jp10-20020a170906f74a00b00a3e209b225asm517826ejb.43.2024.02.24.03.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:45:45 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Rob Herring , Michael Walle , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Srinivas Kandagatla Subject: [PATCH 04/11] dt-bindings: nvmem: add common definition of nvmem-cell-cells Date: Sat, 24 Feb 2024 11:45:09 +0000 Message-Id: <20240224114516.86365-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> References: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1691; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=P2NyplVumNiZcg9Mp9j9BQ+uKvSsw6Ugatz/uYFEo5g=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBl2dbLP88NrJkVscZYIWbXKQs9FH11RQ745UlG+ Ddwg/LmySqJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZdnWywAKCRB6of1ZxzRV N5yzCACCYmIcLpgKardB0yXudbiR8EXRIABl++s0xY87Y/nZdne0nZPCHlSDiZXbbYPF+LXcFro sbuUBAWgRH++oHq/FaDaAZW8M2SQ95mNEucN5rIz5N5LaOpQ24NirQ/blwp8nH/uZh49iauHRIl dATWX9FgT4rFZXtdJRZe7J2zGPEksVWlQZV6xRIwHNW8qu9cglGTiZcf7GaERaQ0Op55ki4JFlL aksxd81gKuHSabOhyAQsK2b2LwMicwlNughluqrG1rlFjiW476zS+Jg7bogNr/jg2+htCmtzW1S 7fxYAdivFDFVmxBK9u19YdcGV07gOkRAXq9/x4oVDwtmv+LW X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791780688311375124 X-GMAIL-MSGID: 1791780688311375124 From: Krzysztof Kozlowski Linux kernel NVMEM consumer bindings define phandle to NVMEM cells ("nvmem-cells"), thus we also want the common definition of property defining number of cells encoding that specifier, so the Suggested-by: Rob Herring Reported-by: Michael Walle Closes: https://github.com/devicetree-org/dt-schema/pull/89 Reported-by: Rafał Miłecki Closes: https://lore.kernel.org/linux-arm-kernel/20221121105830.7411-1-zajec5@gmail.com/#r Closes: https://lore.kernel.org/all/bdf7751b-0421-485d-8382-26c084f09d7d@gmail.com/ Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla --- .../bindings/nvmem/nvmem-provider.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/nvmem-provider.yaml diff --git a/Documentation/devicetree/bindings/nvmem/nvmem-provider.yaml b/Documentation/devicetree/bindings/nvmem/nvmem-provider.yaml new file mode 100644 index 000000000000..4009a9a03841 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/nvmem-provider.yaml @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/nvmem-provider.yaml# +$schema: http://devicetree.org/meta-schemas/base.yaml# + +title: NVMEM (Non Volatile Memory) Provider + +maintainers: + - Srinivas Kandagatla + +select: true + +properties: + '#nvmem-cell-cells': + enum: [0, 1] + +additionalProperties: true From patchwork Sat Feb 24 11:45:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 205826 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1105335dyb; Sat, 24 Feb 2024 03:47:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUSh7snNpF9iWdY4ri7Huk6WIld75MDU0tRI7vMzoQn/jCp0/XfrrHnACsSg0Vof1QJ4XbfK2n+Pfw6+74KSeCxD/ZkTg== X-Google-Smtp-Source: AGHT+IHZDlny88amQkXvzodTNg7OOURjdocnfziw3/B/mF1yG4pEqqz7xCnV5ppOnjK8BUYySKHz X-Received: by 2002:a05:6358:5794:b0:17b:570c:7eb7 with SMTP id m20-20020a056358579400b0017b570c7eb7mr2690006rwf.11.1708775257046; Sat, 24 Feb 2024 03:47:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708775257; cv=pass; d=google.com; s=arc-20160816; b=bmuZAgt3oyYMLh1LHlynNjyxNomHfdbxPoICiyJDksOBIRMJriA10hNg5Y32ZckXP1 9JoDJ1lhkfHnJetAV4CHnrvWTf91O48msSrvqt+vjBLIr9So28rqN0BVUmAijtbVJ9f+ jJtB2yFJiInhksnS6XviEywC/C65UzdR3zIS/7wFXJ2sc8gMjoGzZYR3Vbl42f8PEUbH eEb2pISL1amGYcbfkuaZzUAqrOnrnRtTl0QRkflU3Is/P1dAoY81/bYEGYeF+bfcMDS1 7qnW8NAu4oi9i/jtNFywgq3lK1FhstVnyYlasfdxslKyVIbRg5p2A8tBoKZYXulfeJx5 KYVg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=KS7rA/j/L/KU0dU/sRV2PuU9yP8zgIZOoE7Q38qopHQ=; fh=lcvWR0F/ahilfffzHu/+r5ZW7P1Q1kq5tu23wohSRqg=; b=Sq52szaX6V52tEUhC+uCDHuuGesMIX9atX6fpskVbXVMXTsNT0RpwxJE/nH98AfMr7 nM4YbxLntAFMtRRgXkXtU5NYQY8nrKE8DrP1qumcQ+xul3MDNDKT+R1OeaK9cqj/ma4x XZhRzEVBin6pvCZ0ogexfZqMBvYe5l7vVmi8wqxc2x9ER7qNp0Cl9ZRp1Feh8SDRxsIT RjRJCeZGn3SIyTQg/F2Bogqi9CRb/dSMWldFkAw05RCCJckbQ0PiJQMZ5PeDXXbzqxbD Sw7lh6lruezf2zha42uay7/U9Txp5xYRjxUSLAWrM2Xm61tix8ouiTmE5YrROJuG/9s5 XPkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MMvyNwe6; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79608-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79608-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id pm6-20020a17090b3c4600b0029956277b6csi847089pjb.134.2024.02.24.03.47.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:47:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79608-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MMvyNwe6; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79608-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79608-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 686B6B21B13 for ; Sat, 24 Feb 2024 11:47:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D89204642A; Sat, 24 Feb 2024 11:45:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MMvyNwe6" Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (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 04CC53E480 for ; Sat, 24 Feb 2024 11:45:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775150; cv=none; b=dNC4yj914iL5WV61NcIZwGize39GEB34ogIuOZP2RcrlJw4uWLkv2K/VGcUe8LDq32R5blKJklRdZyqSrWmwnLVSnVGYkgSNhsGleGHSbaMF+aNNni37gjtiT7zhBR002tOdNnrtsF+x2LJSUxJ9N9QqdNgRvjQxL1yGPy3SbQw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775150; c=relaxed/simple; bh=TbDZm2pwUw8Ya9qzVKpSjCAgn7dP8FU3JF75JugC5nU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uWkkoNZUJ5C4wtsvpyPSvtLpM2HxeNI3W9MC75awugB6Ql+IXqxRHJ/JJzc08AJFA8LsnOKlwIeYBeiVdvQleSNA2sPQxjQAH2tZVfW6IDHGDMIZKUgzegBJA/S0V+ZJDrEC2RJ9d9Qao/VIw+hz/nxL8S3bGVZvZoWkq1o2oSg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=MMvyNwe6; arc=none smtp.client-ip=209.85.208.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-565b86c9943so157072a12.1 for ; Sat, 24 Feb 2024 03:45:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708775147; x=1709379947; 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=KS7rA/j/L/KU0dU/sRV2PuU9yP8zgIZOoE7Q38qopHQ=; b=MMvyNwe6GUpxO6s0RoNG3cbLH9ak5cfjT3ha1dIGTZU2KtTPQxA5n56vXx11pImZ52 ACqty84BQUfr1c/58aHzOGwNWVCVnOJD7yvk7Do1VbhXaI3RnvYqw3M0PogBYeIMam4C HegkGq+LN+ZRMMxDMH1MW64s1nGmczT3j38V1he4qB1gSH/vQJ4FmwpPWLuedJz/7tT4 uuG7gwoRaiYnBMMB5vrjgwdkuLS2qVh/p1ZTCFhjRyFL6NH2Z0WgtyJLYaKrfHpomh9H AHxu+IVnMWMGEezij8iCgxJNP7r0IblJqL+TM5ihOsFM0dJDLrRGwd2+zmoYSUj178AU 9X0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708775147; x=1709379947; 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=KS7rA/j/L/KU0dU/sRV2PuU9yP8zgIZOoE7Q38qopHQ=; b=vuAtTplW2I4KkuN6XzA0w4Tr4uOJcRa8M4uxlZu+sKvVYVJOISCQWkCr3piFlUiHhX VFgUgRqmYzbpyLVu11TUJuUzizohU6pZi691NtYDkrMn/RgY7dfqvkY6nfE7NHLwN/hW 3fsEKr63EcB/hwoeVTyQP2BNKZe6IZ9zdpSJCZSCl5mJy5EUbbUhrE9zYtziyoO6NAI7 2IqII6/YYyV+ON0EUMAWrLlOPqK7+J36WMYbngQ/fvxPsXKVyXGiIb+1XNSJCQ5/kTkV SooJtbhk5bg0AF9/zCxyEBVgG8ULmtptLudAYLgjZNvoQ0t54/oLpUf4fjQ/RM6eyoCe DoDA== X-Gm-Message-State: AOJu0YzuvPNjvazUgZ5FK0n4oYtsniRPJNX0KZ+bdUIxwRH7DhcgiAHG 42SGuJZDz1KhKFgg0C+vcMmXxCF5l5PVxnmFne5N+8aVnYiokAzX0LSMQFeb6r7U7DvsbUMNYUk E X-Received: by 2002:a17:907:208f:b0:a3f:421:26a5 with SMTP id pv15-20020a170907208f00b00a3f042126a5mr2049003ejb.12.1708775147368; Sat, 24 Feb 2024 03:45:47 -0800 (PST) Received: from localhost.localdomain (82-132-212-111.dab.02.net. [82.132.212.111]) by smtp.gmail.com with ESMTPSA id jp10-20020a170906f74a00b00a3e209b225asm517826ejb.43.2024.02.24.03.45.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:45:46 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Praveen Teja Kundanala , Michal Simek , Srinivas Kandagatla Subject: [PATCH 05/11] firmware: xilinx: Add ZynqMP efuse access API Date: Sat, 24 Feb 2024 11:45:10 +0000 Message-Id: <20240224114516.86365-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> References: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3247; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=ztYMB5wlPQ7riX2muOA67ef80NdW44Fd2iBr8KYguME=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBl2dbLlGDOcJPROfJzSEXMs0DTxp5duuzEnVdNw 2oaDOxR3vmJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZdnWywAKCRB6of1ZxzRV N6JzCAC3GZfAyTzAGLMBlClY2F68xTQYaHOEYMk2pdwdLlXg4VySFjldXzkgZ8BGVNtpSOePFAu C9UJx+VSfM2w89AvpgywCzWhdC7hBipyZ3g6OKEsxWOgfJaC3gYc9LqqIH+LBgE/zRkS0ITfdUr FrZzBzyO/zY5rbopj25K4lNhn20QBalmqZF8QSVLyrNGI0tb3xJLMEcV2YdN/qD6woC6WSbjPAA yrX3EBy6/QLd95BCMva9HBTxh1DYyyb9saHTJ4nlmHdXnyeWvy5Gaowf21ugUA5R93/ySJ5Dz6W gFrLTJDRD4r0wq+IJvND3MaqeH0px4JoDhW/PmQIjIgNinwc X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791780723928469230 X-GMAIL-MSGID: 1791780723928469230 From: Praveen Teja Kundanala Add zynqmp_pm_efuse_access API in the ZynqMP firmware for read/write access of efuse memory. Signed-off-by: Praveen Teja Kundanala Acked-by: Michal Simek Signed-off-by: Srinivas Kandagatla --- drivers/firmware/xilinx/zynqmp.c | 25 +++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 8 ++++++++ 2 files changed, 33 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 79789f0563f6..9bc45357e1a8 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -3,6 +3,7 @@ * Xilinx Zynq MPSoC Firmware layer * * Copyright (C) 2014-2022 Xilinx, Inc. + * Copyright (C) 2022 - 2023, Advanced Micro Devices, Inc. * * Michal Simek * Davorin Mista @@ -1384,6 +1385,30 @@ int zynqmp_pm_aes_engine(const u64 address, u32 *out) } EXPORT_SYMBOL_GPL(zynqmp_pm_aes_engine); +/** + * zynqmp_pm_efuse_access - Provides access to efuse memory. + * @address: Address of the efuse params structure + * @out: Returned output value + * + * Return: Returns status, either success or error code. + */ +int zynqmp_pm_efuse_access(const u64 address, u32 *out) +{ + u32 ret_payload[PAYLOAD_ARG_CNT]; + int ret; + + if (!out) + return -EINVAL; + + ret = zynqmp_pm_invoke_fn(PM_EFUSE_ACCESS, ret_payload, 2, + upper_32_bits(address), + lower_32_bits(address)); + *out = ret_payload[1]; + + return ret; +} +EXPORT_SYMBOL_GPL(zynqmp_pm_efuse_access); + /** * zynqmp_pm_sha_hash - Access the SHA engine to calculate the hash * @address: Address of the data/ Address of output buffer where diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 9a7e52739251..1a069a56c961 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -3,6 +3,7 @@ * Xilinx Zynq MPSoC Firmware layer * * Copyright (C) 2014-2021 Xilinx + * Copyright (C) 2022 - 2023, Advanced Micro Devices, Inc. * * Michal Simek * Davorin Mista @@ -171,6 +172,7 @@ enum pm_api_id { PM_CLOCK_GETPARENT = 44, PM_FPGA_READ = 46, PM_SECURE_AES = 47, + PM_EFUSE_ACCESS = 53, PM_FEATURE_CHECK = 63, }; @@ -562,6 +564,7 @@ int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, const u32 qos, const enum zynqmp_pm_request_ack ack); int zynqmp_pm_aes_engine(const u64 address, u32 *out); +int zynqmp_pm_efuse_access(const u64 address, u32 *out); int zynqmp_pm_sha_hash(const u64 address, const u32 size, const u32 flags); int zynqmp_pm_fpga_load(const u64 address, const u32 size, const u32 flags); int zynqmp_pm_fpga_get_status(u32 *value); @@ -749,6 +752,11 @@ static inline int zynqmp_pm_aes_engine(const u64 address, u32 *out) return -ENODEV; } +static inline int zynqmp_pm_efuse_access(const u64 address, u32 *out) +{ + return -ENODEV; +} + static inline int zynqmp_pm_sha_hash(const u64 address, const u32 size, const u32 flags) { From patchwork Sat Feb 24 11:45:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 205825 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1105330dyb; Sat, 24 Feb 2024 03:47:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXuVgGfqTN+EIGOjYKFtaMhKo6hhh/sXjZW1/DKNHRuJenIT9wU1msq9XKMfI3oe7bfA8Imx+FLL9u6aKgONRdviInFYw== X-Google-Smtp-Source: AGHT+IEjDgJFGD5bZrSZuKtgUwP11S7tnCc/D5DRkGqxMxJJujqmGt9ttwQBEj0HCutLyRjp71uo X-Received: by 2002:a05:6a21:2d8c:b0:1a0:f1dd:eb5c with SMTP id ty12-20020a056a212d8c00b001a0f1ddeb5cmr460430pzb.0.1708775256201; Sat, 24 Feb 2024 03:47:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708775256; cv=pass; d=google.com; s=arc-20160816; b=GMFrWvldp8vYKqt6ZY/d7ni8TAjAnM9G6oWi/BAKQve7Z3iwEpiBmZ0+bfMRW2ITev xTThzyHa+ShTX6ulv57xQXsx841FBIAqLQEPn0ELFufZRYpqkeyw+o7fuHKXPEjrAw7b O4ox1YmpkChS8i52iVmon3BbGoP577W7XpMbw/WC0ndsu3MQcnzjReE8Z0Rg7efRtcDb qP43wEOLzqHV+5QWGjXL6Pa668vPiKT4y/gIHqmL2GZEfL84HariHpO1wRPKEnL/0ywO Rs+we7J1GRJcKrS+8LGkuGKYhksKVxNIe5cXZ1rzeaUWoWH0oUiXjgaFWf3+fjMtrsZ0 SacA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=1mR91Nlk8bU7hN1mKQvT/jofMFqB5jMPs1+IzmpRfSw=; fh=fOoBdycKl22DA+Q4ONYo9zOShRZP9uJfcKe6T9LiXEc=; b=eX3r/N4vIvJDEeSVuy92p1VzTMElaS0umCnYvjNPOGs4r8NrE13VmsQo2EMtOykGU3 8Y2b2tPTJPHiteFCPrNabBuN13+QJr0PfaGj5ImVg5KV2zfP2L3xFFNSXyB+J5rdYbkI z9fkSxOS7uipXA/CIhVyBmyr4PZYavrXTLnFktpsjNt9P17k/kDlprN3AZT3kDUEZeIX LI0pxdSq/5OrnbQb8HJrg103yFJz47N+2EAGiaEeytT+sB+1BjzoSPQwiKqRWV6uGTKj 0CnrZzWlaRWFEIqwSQMoTPSiIbe6Yefy38ArINV56SsH1sK2I54w8GHss30brR+h6M4w IZ5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="GuVkbI/f"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79609-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79609-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k16-20020aa788d0000000b006e0733b3439si790623pff.296.2024.02.24.03.47.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:47:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79609-ouuuleilei=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=@linaro.org header.s=google header.b="GuVkbI/f"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79609-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79609-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 0B97A283C6F for ; Sat, 24 Feb 2024 11:47:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 006B447A5D; Sat, 24 Feb 2024 11:45:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GuVkbI/f" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 2FC2D3F9D4 for ; Sat, 24 Feb 2024 11:45:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775152; cv=none; b=mYZ7ndDyFABaZZOzfi5d8sA4FGdAAtgpkTV3aKYCooYXF6MbTLtjIpiDZW82xStmVPgYcY1GK/mSERD1O5b/RnrayA/NOwj9KtX2lYJ9ymVqMhTq81IEdj+S3zYTefSB82W8bfAelQiilAfnmQtbUKcfUoh0L69DfVh32u/RKew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775152; c=relaxed/simple; bh=LBYbJJcKNkovxCNxqMFmQnZVJ0MhhcOaMIIez5oaN/0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KUokQgrWDc7nk5gKa6pp6vm3C8lh0VURq7Q6MvX3T2+n77k36Rp2PxyItxe38LyQAqa27JE/FdQzZ4DIFMy865VFwjdf0F6dp6VoGiLo2+/MOYqWnHO710+ORvbJz0MFf9o0kSsUvqDidWnME9T5BmY8QrtSpC0nXLhNl5YJFHg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=GuVkbI/f; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a3e75e30d36so319555566b.1 for ; Sat, 24 Feb 2024 03:45:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708775148; x=1709379948; 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=1mR91Nlk8bU7hN1mKQvT/jofMFqB5jMPs1+IzmpRfSw=; b=GuVkbI/fjSAXY/O+/Wkp5ShwKRPx8j2PanpK8m/lK8FLdfR93EAlF5oC75ss2vKKyL Atx5DiHRPqS5MGcqgVgchZbAzDpvEy7a7RfO3CcfMhXUiVrtSjwkWzu4Z28KnPOYLN+h xlKnuNxkC7dsfrSJ1PDjO6X+96mO3PzZOPgzSgJJkTpecIVDWpVHZVabYIEwPjxwMV7U /XM2DTIjaez9ynCn34LB6mErhRkJpxGLrv45/P4auRcYaFhHDSK5f5A0qzfbQWA8o0mR 6bs7q04auqpN8/LYSFQhRd6RK+R12OJ7uhDT0O/70yR9+WxCVVOIBb8kw275Ew3JJn2p Xydg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708775148; x=1709379948; 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=1mR91Nlk8bU7hN1mKQvT/jofMFqB5jMPs1+IzmpRfSw=; b=UKDLN0g2Z9gFxA/tBZHZR7uQj0Gc22GWV5KXZzacumKJ15VA0gnNbKjAN7cNBPHl1z Isj5oPRYvJGlIuZVoDVgR4rfQw98ejlRm+uO4h8dd9vOabjYmPA1ZYBZfGNtW+0BdSE2 h0kJsUlVHEKuOJsGmkfDSEFPkqYLlbfg/5Q31HwqiTTfAHLfcrlPWA0IyIP4ZoZ658gR 5kTaqwC4JQbIAzteuq/hQLpygGTAJdN7J0sLGzY2nrURglV4KG3lrGp0NFnQ2lchUZv4 WoqIN8CRxGI7CDwSjpbUTQRXZQwdtUwoqIhg3Dy1W+UHRnjx7+0qY+PDHYpCyH/Les+4 470A== X-Gm-Message-State: AOJu0YwufAth07UWmM3NIWYZ2k/xEk+6fkLefgDVjxj8D7JEP+azwiGL Cr6y8gdHEFCyuuDdpLdJz5ADZPYs057ZwujzhHhS8b0IMcqZxeVGdxcBDNr4uyo= X-Received: by 2002:a17:906:718d:b0:a3f:8dea:85f7 with SMTP id h13-20020a170906718d00b00a3f8dea85f7mr1958294ejk.15.1708775148504; Sat, 24 Feb 2024 03:45:48 -0800 (PST) Received: from localhost.localdomain (82-132-212-111.dab.02.net. [82.132.212.111]) by smtp.gmail.com with ESMTPSA id jp10-20020a170906f74a00b00a3e209b225asm517826ejb.43.2024.02.24.03.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:45:48 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Praveen Teja Kundanala , Kalyani Akula , Srinivas Kandagatla Subject: [PATCH 06/11] nvmem: zynqmp_nvmem: zynqmp_nvmem_probe cleanup Date: Sat, 24 Feb 2024 11:45:11 +0000 Message-Id: <20240224114516.86365-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> References: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2643; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=P2cGF0VtfcCt36gLWA03f5z+B2HP6m3MQtEOR09ei5k=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBl2dbLtUXHVO3V0pwG/elzGVXwkjhsvd+/Oq7tJ sXVBhpvAyeJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZdnWywAKCRB6of1ZxzRV N9SQB/4v0TpoIJ/h4H9frZHRj07Cv7m/Xs4KHhUbSNlOiTTOqlDYYFwliOI5GYjjEbFAiPZI8ce k/wToFqt2g88Ezdg1SB9soMp+tQEvJ3vqSkCFTm7vqUFZcBL52mVbh42O+HK0JTrLkUsDqTuYN8 3F+ljhIIXWfx6pim4kXdR1rXv9HBrIUkajLy/4tToHCgmz9HpmcvEOp6U8gA96duF8M54LTxEly klKtR5hqwaZCX21dy8owqvYwfcK6pzBAQBBn+xuwcu/XZA7hNc2PoX6OrBPtspaBFHH9Gbg/0Sr 0L0/CVx2v7Y9wDaDTTgmHCWXGW7YzSKS1uTQiCSNYPAikHOS X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791780722927307956 X-GMAIL-MSGID: 1791780722927307956 From: Praveen Teja Kundanala - Remove static nvmem_config declaration - Remove zynqmp_nvmem_data Signed-off-by: Praveen Teja Kundanala Acked-by: Kalyani Akula Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/zynqmp_nvmem.c | 37 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/drivers/nvmem/zynqmp_nvmem.c b/drivers/nvmem/zynqmp_nvmem.c index 7f15aa89a9d0..391d8e88b270 100644 --- a/drivers/nvmem/zynqmp_nvmem.c +++ b/drivers/nvmem/zynqmp_nvmem.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2019 Xilinx, Inc. + * Copyright (C) 2022 - 2023, Advanced Micro Devices, Inc. */ #include @@ -11,36 +12,25 @@ #define SILICON_REVISION_MASK 0xF -struct zynqmp_nvmem_data { - struct device *dev; - struct nvmem_device *nvmem; -}; static int zynqmp_nvmem_read(void *context, unsigned int offset, void *val, size_t bytes) { + struct device *dev = context; int ret; - int idcode, version; - struct zynqmp_nvmem_data *priv = context; + int idcode; + int version; ret = zynqmp_pm_get_chipid(&idcode, &version); if (ret < 0) return ret; - dev_dbg(priv->dev, "Read chipid val %x %x\n", idcode, version); + dev_dbg(dev, "Read chipid val %x %x\n", idcode, version); *(int *)val = version & SILICON_REVISION_MASK; return 0; } -static struct nvmem_config econfig = { - .name = "zynqmp-nvmem", - .owner = THIS_MODULE, - .word_size = 1, - .size = 1, - .read_only = true, -}; - static const struct of_device_id zynqmp_nvmem_match[] = { { .compatible = "xlnx,zynqmp-nvmem-fw", }, { /* sentinel */ }, @@ -50,21 +40,18 @@ MODULE_DEVICE_TABLE(of, zynqmp_nvmem_match); static int zynqmp_nvmem_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct zynqmp_nvmem_data *priv; + struct nvmem_config econfig = {}; - priv = devm_kzalloc(dev, sizeof(struct zynqmp_nvmem_data), GFP_KERNEL); - if (!priv) - return -ENOMEM; - - priv->dev = dev; + econfig.name = "zynqmp-nvmem"; + econfig.owner = THIS_MODULE; + econfig.word_size = 1; + econfig.size = 1; econfig.dev = dev; econfig.add_legacy_fixed_of_cells = true; + econfig.read_only = true; econfig.reg_read = zynqmp_nvmem_read; - econfig.priv = priv; - - priv->nvmem = devm_nvmem_register(dev, &econfig); - return PTR_ERR_OR_ZERO(priv->nvmem); + return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &econfig)); } static struct platform_driver zynqmp_nvmem_driver = { From patchwork Sat Feb 24 11:45:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 205828 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1105450dyb; Sat, 24 Feb 2024 03:48:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU4SBblsCeItEOAxkPMMnX/bBOb2un1xa0luJSZljPjWzfgA6A6KcxeIKuzBIUrvAkGbUsrgT2UI1J03o4IJXLxI96OYQ== X-Google-Smtp-Source: AGHT+IGQfDquT7osKib9vuVmb8gr6QbPtyWIVqt6TINvncPl7V7nz10GqUkImiaogn/sA8qJHcsh X-Received: by 2002:aa7:d912:0:b0:565:6bbc:3834 with SMTP id a18-20020aa7d912000000b005656bbc3834mr1469388edr.32.1708775286824; Sat, 24 Feb 2024 03:48:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708775286; cv=pass; d=google.com; s=arc-20160816; b=eNCCczS8hLRCM93rWmfo9eUKRYqsgeLY47WPCiKJlxfTvcERIy6+/8WIjcEhxD7Ho0 LDd7NlyvCc83PFJPoxQjmK1jGO7frCPbR0hu1Jtu6dafrAtqF5PRYmsL9iLwMnJ7D8Bx 3Wlm6ujRiS7qz2gWhE5SDBs8Q3E2VoHbLK0BVrudPEXxcYFcsa3LfCQRTYEhdXYo4bQM MX+zfvq3ojRUF7AbRiRLn2EiGkO2HXdXDuv0sPZr97gWbtgi7mmikzjjk9OADnl3dVoH Xf9pr52X+L1cffH3l24ZaWVddLxDvqUeJLJ58Ak1ASKFYjqb5VPTCeK9zPuS3qVf2Efw fomg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=9tJ4KEGjzL+YJpDElkQ+pXC7NYnzSGlRxyULw1fk5Yw=; fh=fOoBdycKl22DA+Q4ONYo9zOShRZP9uJfcKe6T9LiXEc=; b=Qe0VVMYa5WpnzNjJZd8+FlMp5EVgYUre/oxzvjorW/Wfs+YI213rdRuaVYRVz6HGe/ HHj40XA3DdLIQsiz2VOcKsn67FHFBvUvneN6TixTJqGwJXwSrMN2ADqpLOrsMlr1zgbf HG1cdl69aYJJN5dTTvdKGFVE55/xX7qVxV77MiTIiv0STNGSL25CGG2vElOaW8bwiS7Y a3gtXx1ElFyjVvvbqBAAVn494wno9jvUn1j1zHSYHkO9xBoAdhCI/IKFTOjBL3C/F/nf Uw7aKbHA4xOU5fE1u5KrmR2jtJtnpLpHixVISGtRQxdc0JoXtLmWeR5i9aBIKVrOBdOY NPmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c4g6m9CL; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79610-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79610-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id e12-20020a056402088c00b005658339575bsi434932edy.523.2024.02.24.03.48.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:48:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79610-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c4g6m9CL; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79610-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79610-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2A59F1F2267C for ; Sat, 24 Feb 2024 11:48:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 050B3482E2; Sat, 24 Feb 2024 11:45:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="c4g6m9CL" Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.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 489563FB28 for ; Sat, 24 Feb 2024 11:45:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775153; cv=none; b=rT1smHJmudssq9v5MIgAoHJJPj3mi7eZdtk49BijzkFGXS23bs7Rl0MEwSOuq7jDWW6W1yQuw/5PqqckO4JJLD+vR6bJO0xU/iu+Dj7vvrXZAsxXPFCyM9s09QesiFqsJr1dCRE6hyIHEYfTxV1s0vfb10DzigSP/XYr5u/SrNU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775153; c=relaxed/simple; bh=AOKLF1lo0DNZST/F5xk/mQGDH9EWrbhFAsirn0KaH6U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Jd1650sUWslyNOTL7Sf4evbnvkOyTu9AJ1gdrSBf11MqFWEwMUsAON7IeaABQqzVw/zfCloychG/poQUe8kLJjj5La0noP9kh2V8EylbVMU48VEirydEZuM23L5AQh4W06cOllh9MTVyEatIH3aZkYz/RzA8iYrUNGe151gk0C8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=c4g6m9CL; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a3e891b5e4eso187156166b.0 for ; Sat, 24 Feb 2024 03:45:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708775149; x=1709379949; 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=9tJ4KEGjzL+YJpDElkQ+pXC7NYnzSGlRxyULw1fk5Yw=; b=c4g6m9CL7wAzvl9Do3rpHKwsnYdoNEjjmkvfP51ch37wCwiu9O4zqEcXE5lWY5NmqN zrYMUibXT7G8+TCv3ZkfCZPhyUyT2NVGPlj9L8qIJj2/ojXLQ/5yAdpEy03bE1Ll1YS1 TCl+dbsptLTUs/9628XDtdyZRL47sLOnI/ICtjwsNe/EJcB5lTyowU7bgh9muGI8FDP8 Txe9aKgkGzhEy88qNOZODVTc0EeulNBxf0P2XFhOcU5hyO3FHM2JjwdzSoblBlQmYWIY FZWTvULzuiZJa2G8Y//035B/S6B/MZYVCEHmRHWDJNC1/fNrhFO2ogbmsL7aBcfy6g0K PzAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708775149; x=1709379949; 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=9tJ4KEGjzL+YJpDElkQ+pXC7NYnzSGlRxyULw1fk5Yw=; b=phOewcJ2yh4cE6kTEfNwZQp5TlrHhKMTLYtFZqtqR7U99ykdaC8ynN6bhl8fBl/UCX Y+I8hmjIkyavWiJiYtyKdOcjSvOwr47MVSHYjFnMfp6LwdlNSfbqqCJCRe/Z2/Ge5BV0 tOXcMUhkKEF8ApkSSyiDJ9PwShHbwie7oyXdKrfimMr2NdrlVaysZ5buUacXyQY+HH4r 9GbTLegR6a0gTP/gK/0DwslmCNgFDYvO3qPmM+MgQ/RPS/E6RJsWrG1VhwOSjW29+Pr6 x7ZWtXapvoVEpcxGhXrN0ABwB7e0EwnZ7yjWVUqJTPWQj/DqD0fD9lafgBwxVGiv9i9m KD4Q== X-Gm-Message-State: AOJu0YxJj1fendKYbdk10E8aPSJl4rxov3gtz7xD6EIc0iWSKc3hB4YK 1tTQZGNNcFpbeWgbgpP1JOewnakqQjR6u6Au+f7hBqYhhvdSu33IWx9zdf5aDww= X-Received: by 2002:a17:906:3c05:b0:a3f:db30:8999 with SMTP id h5-20020a1709063c0500b00a3fdb308999mr1577246ejg.4.1708775149714; Sat, 24 Feb 2024 03:45:49 -0800 (PST) Received: from localhost.localdomain (82-132-212-111.dab.02.net. [82.132.212.111]) by smtp.gmail.com with ESMTPSA id jp10-20020a170906f74a00b00a3e209b225asm517826ejb.43.2024.02.24.03.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:45:49 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Praveen Teja Kundanala , Kalyani Akula , Srinivas Kandagatla Subject: [PATCH 07/11] nvmem: zynqmp_nvmem: Add support to access efuse Date: Sat, 24 Feb 2024 11:45:12 +0000 Message-Id: <20240224114516.86365-8-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> References: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6929; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=uNEk6qD/B90EI4wNpkm2x5253pB8VJ0Bolh0DlxUGyE=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBl2dbLU7b2cRWRzjWafKxtCAEIq0J4cAk9/9q60 OpiWbSYZJ2JATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZdnWywAKCRB6of1ZxzRV N/V/CACkS9VKEFiUnxyyH0Z/lFzStLT39pZSkjpB3Lls1GoJ1L58GM+05k2MkahhA/vzUfbx5jr YrfNUoP2G+ydwJrCvPfe1heXcTXs513JGb/sBdrgrgRnnVY6iPep5xuVEwFUWDyrFy/NvkTa3NT 0nx21WyuPkICyue58Fgc/n3H+YaaE3M6PWH0gJm5FXztmQ1ozuS/QSJyF8wKenrBfw2mV4ZVOzQ 1KPtCCt+lvkKe5rOAdPbKpQYRjxR8F5VsE/QlQ7VFl2U5WX1f66IvQ5ik5RQeR3aSalWfgp1cG1 ictARCYKxw5DlTYtTUyEBSz4UamPYzSQ8nTeC9CBKXdI3bPM X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791780755343680299 X-GMAIL-MSGID: 1791780755343680299 From: Praveen Teja Kundanala Add support to read/write efuse memory map of ZynqMP. Below are the offsets of ZynqMP efuse memory map 0 - SOC version(read only) 0xC - 0xFC -ZynqMP specific purpose efuses 0x100 - 0x17F - Physical Unclonable Function(PUF) efuses repurposed as user efuses Signed-off-by: Praveen Teja Kundanala Acked-by: Kalyani Akula Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/zynqmp_nvmem.c | 186 +++++++++++++++++++++++++++++++++-- 1 file changed, 176 insertions(+), 10 deletions(-) diff --git a/drivers/nvmem/zynqmp_nvmem.c b/drivers/nvmem/zynqmp_nvmem.c index 391d8e88b270..8682adaacd69 100644 --- a/drivers/nvmem/zynqmp_nvmem.c +++ b/drivers/nvmem/zynqmp_nvmem.c @@ -4,6 +4,7 @@ * Copyright (C) 2022 - 2023, Advanced Micro Devices, Inc. */ +#include #include #include #include @@ -11,24 +12,189 @@ #include #define SILICON_REVISION_MASK 0xF +#define P_USER_0_64_UPPER_MASK GENMASK(31, 16) +#define P_USER_127_LOWER_4_BIT_MASK GENMASK(3, 0) +#define WORD_INBYTES 4 +#define SOC_VER_SIZE 0x4 +#define EFUSE_MEMORY_SIZE 0x177 +#define UNUSED_SPACE 0x8 +#define ZYNQMP_NVMEM_SIZE (SOC_VER_SIZE + UNUSED_SPACE + \ + EFUSE_MEMORY_SIZE) +#define SOC_VERSION_OFFSET 0x0 +#define EFUSE_START_OFFSET 0xC +#define EFUSE_END_OFFSET 0xFC +#define EFUSE_PUF_START_OFFSET 0x100 +#define EFUSE_PUF_MID_OFFSET 0x140 +#define EFUSE_PUF_END_OFFSET 0x17F +#define EFUSE_NOT_ENABLED 29 +/* + * efuse access type + */ +enum efuse_access { + EFUSE_READ = 0, + EFUSE_WRITE +}; + +/** + * struct xilinx_efuse - the basic structure + * @src: address of the buffer to store the data to be write/read + * @size: read/write word count + * @offset: read/write offset + * @flag: 0 - represents efuse read and 1- represents efuse write + * @pufuserfuse:0 - represents non-puf efuses, offset is used for read/write + * 1 - represents puf user fuse row number. + * + * this structure stores all the required details to + * read/write efuse memory. + */ +struct xilinx_efuse { + u64 src; + u32 size; + u32 offset; + enum efuse_access flag; + u32 pufuserfuse; +}; + +static int zynqmp_efuse_access(void *context, unsigned int offset, + void *val, size_t bytes, enum efuse_access flag, + unsigned int pufflag) +{ + struct device *dev = context; + struct xilinx_efuse *efuse; + dma_addr_t dma_addr; + dma_addr_t dma_buf; + size_t words = bytes / WORD_INBYTES; + int ret; + int value; + char *data; + + if (bytes % WORD_INBYTES != 0) { + dev_err(dev, "Bytes requested should be word aligned\n"); + return -EOPNOTSUPP; + } + + if (pufflag == 0 && offset % WORD_INBYTES) { + dev_err(dev, "Offset requested should be word aligned\n"); + return -EOPNOTSUPP; + } + + if (pufflag == 1 && flag == EFUSE_WRITE) { + memcpy(&value, val, bytes); + if ((offset == EFUSE_PUF_START_OFFSET || + offset == EFUSE_PUF_MID_OFFSET) && + value & P_USER_0_64_UPPER_MASK) { + dev_err(dev, "Only lower 4 bytes are allowed to be programmed in P_USER_0 & P_USER_64\n"); + return -EOPNOTSUPP; + } + + if (offset == EFUSE_PUF_END_OFFSET && + (value & P_USER_127_LOWER_4_BIT_MASK)) { + dev_err(dev, "Only MSB 28 bits are allowed to be programmed for P_USER_127\n"); + return -EOPNOTSUPP; + } + } + + efuse = dma_alloc_coherent(dev, sizeof(struct xilinx_efuse), + &dma_addr, GFP_KERNEL); + if (!efuse) + return -ENOMEM; -static int zynqmp_nvmem_read(void *context, unsigned int offset, - void *val, size_t bytes) + data = dma_alloc_coherent(dev, sizeof(bytes), + &dma_buf, GFP_KERNEL); + if (!data) { + ret = -ENOMEM; + goto efuse_data_fail; + } + + if (flag == EFUSE_WRITE) { + memcpy(data, val, bytes); + efuse->flag = EFUSE_WRITE; + } else { + efuse->flag = EFUSE_READ; + } + + efuse->src = dma_buf; + efuse->size = words; + efuse->offset = offset; + efuse->pufuserfuse = pufflag; + + zynqmp_pm_efuse_access(dma_addr, (u32 *)&ret); + if (ret != 0) { + if (ret == EFUSE_NOT_ENABLED) { + dev_err(dev, "efuse access is not enabled\n"); + ret = -EOPNOTSUPP; + } else { + dev_err(dev, "Error in efuse read %x\n", ret); + ret = -EPERM; + } + goto efuse_access_err; + } + + if (flag == EFUSE_READ) + memcpy(val, data, bytes); +efuse_access_err: + dma_free_coherent(dev, sizeof(bytes), + data, dma_buf); +efuse_data_fail: + dma_free_coherent(dev, sizeof(struct xilinx_efuse), + efuse, dma_addr); + + return ret; +} + +static int zynqmp_nvmem_read(void *context, unsigned int offset, void *val, size_t bytes) { struct device *dev = context; int ret; + int pufflag = 0; int idcode; int version; - ret = zynqmp_pm_get_chipid(&idcode, &version); - if (ret < 0) - return ret; + if (offset >= EFUSE_PUF_START_OFFSET && offset <= EFUSE_PUF_END_OFFSET) + pufflag = 1; + + switch (offset) { + /* Soc version offset is zero */ + case SOC_VERSION_OFFSET: + if (bytes != SOC_VER_SIZE) + return -EOPNOTSUPP; + + ret = zynqmp_pm_get_chipid((u32 *)&idcode, (u32 *)&version); + if (ret < 0) + return ret; + + dev_dbg(dev, "Read chipid val %x %x\n", idcode, version); + *(int *)val = version & SILICON_REVISION_MASK; + break; + /* Efuse offset starts from 0xc */ + case EFUSE_START_OFFSET ... EFUSE_END_OFFSET: + case EFUSE_PUF_START_OFFSET ... EFUSE_PUF_END_OFFSET: + ret = zynqmp_efuse_access(context, offset, val, + bytes, EFUSE_READ, pufflag); + break; + default: + *(u32 *)val = 0xDEADBEEF; + ret = 0; + break; + } + + return ret; +} + +static int zynqmp_nvmem_write(void *context, + unsigned int offset, void *val, size_t bytes) +{ + int pufflag = 0; + + if (offset < EFUSE_START_OFFSET || offset > EFUSE_PUF_END_OFFSET) + return -EOPNOTSUPP; - dev_dbg(dev, "Read chipid val %x %x\n", idcode, version); - *(int *)val = version & SILICON_REVISION_MASK; + if (offset >= EFUSE_PUF_START_OFFSET && offset <= EFUSE_PUF_END_OFFSET) + pufflag = 1; - return 0; + return zynqmp_efuse_access(context, offset, + val, bytes, EFUSE_WRITE, pufflag); } static const struct of_device_id zynqmp_nvmem_match[] = { @@ -45,11 +211,11 @@ static int zynqmp_nvmem_probe(struct platform_device *pdev) econfig.name = "zynqmp-nvmem"; econfig.owner = THIS_MODULE; econfig.word_size = 1; - econfig.size = 1; + econfig.size = ZYNQMP_NVMEM_SIZE; econfig.dev = dev; econfig.add_legacy_fixed_of_cells = true; - econfig.read_only = true; econfig.reg_read = zynqmp_nvmem_read; + econfig.reg_write = zynqmp_nvmem_write; return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &econfig)); } From patchwork Sat Feb 24 11:45:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 205827 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1105442dyb; Sat, 24 Feb 2024 03:48:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWxFI9LDzX83xnYgwc8PTErI2FesHkB7BZR5u6fkSpSTLSr41jQo6kYhVSzKK6umPonipdiDeQiz8grjfaltRJrjU0qpA== X-Google-Smtp-Source: AGHT+IGck+izasFs7Un9qEliFa0hWdhmJJOiTaoV4fMYTkxz8zJ1Y45kR83kqrftpDzouURc0OM8 X-Received: by 2002:ac2:488f:0:b0:512:bdd7:a932 with SMTP id x15-20020ac2488f000000b00512bdd7a932mr1296843lfc.8.1708775284855; Sat, 24 Feb 2024 03:48:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708775284; cv=pass; d=google.com; s=arc-20160816; b=fM3ifh87N0ebJ4cmFv8g0WhsOe3Ib/DXy9Da26yoXX2Is4BaHINO0sUsQ/ntFmHvLT irI13ckFNSZ+6p1L4hEYNKGMGPJGwga+VlvoY507dtL5tT+p1+at4//HzIpOeO1NQV3G aUBqcRO3A4IDoHIFY7haY/YjQHY9TJftOS+5COLx15seBwaajOgykko3GTJT/dr8eg23 crlvrILUqVaa7tkW7Fb34WS3oQPPckfYR+voI8EcjhjqV0KGy6Gv+UQsW3tFwn38eYS4 e1jr2wXWrK2KNQYphknWWZRbeHMkQYFvHCf2qWX4KtwGciuNYqc97SDZifyNwvLnl82d sDuQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Tr7GZOkOAgNmtVmjzk3ZYZlo6pqWv5vhnfTOY0veyUE=; fh=C1uMkeNJ5zhFYeQvpGzrkKt2hba9FMBX12XWEjr0Gzg=; b=Oczia+mgwAcCKWYG/YCTBleQqXrVhNxIdJofC2/5OjcaahYjebexqFBv3aDo0krLHQ e979czISNPUH+gYc2XlPgei7obYE+c5DGqJFUxWGGN5TimX/8T9xgdRF5aUi5UtXNS1U c/ALLQhLl59RoQ8u+JhbPn4VkIjr9KXzW1akAE4YAg6x/3P9vr2zBbbRzPwFRAeKudVC /EyJBZ7Qxkm+5aKNiX31JgDaNd4V1wOi7Y6CCx4qVAkW0NDfJ9/s3qii/MzbRIBXYHs8 m+4hcmkQvZZFux3FTUd3hFqx/yP6BAQZWsouvpA5Io2zti4Pc3BDLPqhbVKzY+yF/I2y X9SA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qxuve0Bz; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79611-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79611-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id e12-20020a056402088c00b005658339575bsi434932edy.523.2024.02.24.03.48.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:48:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79611-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qxuve0Bz; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79611-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79611-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 633931F217E9 for ; Sat, 24 Feb 2024 11:48:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E286A482EB; Sat, 24 Feb 2024 11:45:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qxuve0Bz" Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 826104317B for ; Sat, 24 Feb 2024 11:45:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775154; cv=none; b=QV90zujDvtPsJAPuHdwTmkimH86KYXeQFOxnJ1WAL84nOngjCnKHVt83e4z5yLH4SR1VEuDB4uBtVb7yWVzveoXncW/JwmKC7mdihjyILPF9ssTfu5LdIrXPhDxLR0PMLMzJ4/NTf9UXEXMRqECA9XKub2cAnfmCmzfyu/RW7zg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775154; c=relaxed/simple; bh=TA4ETXsx3S0GLeuWu5ZSJ8+45soZV64UoCsLNAcK9Lw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tx/GEKN4EMMZ+v4zXzYiajbEzkC6mNhguzrAjLoV+ezliLpgYXTmz+hjpM3JioXr9ilwHLVu7s1yYPtb+NWX1BpHiMsSZck5Aqf4UDaq07K4TvlJ9gsXSiKM0ac0+TP554YiWBJaoGDZXlJqY0xwh/hK/l5CylDlv0FsdA4YrL8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=qxuve0Bz; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-563c0f13cabso1782438a12.3 for ; Sat, 24 Feb 2024 03:45:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708775151; x=1709379951; 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=Tr7GZOkOAgNmtVmjzk3ZYZlo6pqWv5vhnfTOY0veyUE=; b=qxuve0Bz+RSfJaoNoPMB+sPjLnrsKTtC68lHIpPru2M3bjajGQsOWjQKKmy+cQKKPw K42eOrrb12xhVWNiZgmsGmlkQDkkiVSMjRfLg98Bph3YbPqQiUHUzozQMZZsOddqPx18 dteIy6anFTsCIiMK69huaLtX4vvFtWz2u09S/WXMDVuuIcd6LgFazEfquzGdKyPs5Fum Z3wjjMI3gVA0GDk2q1NGCZGjwdZsh9AmCMQQ9aCBc5nBU7MRQ1ZQp1lh5k8BiX/Av7am f2US46G/ZvisovPP6KxgQs9vuILW+7OwTsaH7HfjDefe8J095rw9JgcMN871asv7Fvqc IK8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708775151; x=1709379951; 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=Tr7GZOkOAgNmtVmjzk3ZYZlo6pqWv5vhnfTOY0veyUE=; b=dfsYHTEcp1GwTJwYuV+YEN3QkqsrbsK4DYxoj1L/GovcWRqv8okYkUBtcQyJM9fzHV 1fU03Lqpv7Z+BKF17b0IQZTdGt+/1Hlts6rOqS74XQBZNlT3zTxIqbaloT5nEQalRYy+ LipWcfbfoGT2ZkllBhQ/Ug49b5LlHwxAJ8AK4iRfEii0e1UMOqyR0osNplAgNQk6Uo6B aUh9UgEC0yQjKFS4UT165BDU+n/TnapSEA4GoChTaAl3OGqubLPb4dGilZYSPfB6gfBX VKuhlPU8eqK/UOdqUmw0nbVSyTsZLEiNBF1ni0p2s4bYfH/4MPq+66mqvXAtEdB+ozxg ARnw== X-Gm-Message-State: AOJu0YxOO6P55aMkzuxoBKUkHY2s0AJ5fTpXy7pGea3w0Hbf3SYvtcLD 9UDD/AUA0W6H2jjxpsOfmSF6uJEgE71Yxe2FDJ7Hn8U57ab0Ho0xZRVJqNZGcw8= X-Received: by 2002:a17:906:2b05:b0:a3e:74f5:f933 with SMTP id a5-20020a1709062b0500b00a3e74f5f933mr1408082ejg.12.1708775150951; Sat, 24 Feb 2024 03:45:50 -0800 (PST) Received: from localhost.localdomain (82-132-212-111.dab.02.net. [82.132.212.111]) by smtp.gmail.com with ESMTPSA id jp10-20020a170906f74a00b00a3e209b225asm517826ejb.43.2024.02.24.03.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:45:50 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Praveen Teja Kundanala , Srinivas Kandagatla Subject: [PATCH 08/11] MAINTAINERS: Add maintainers for ZynqMP NVMEM driver Date: Sat, 24 Feb 2024 11:45:13 +0000 Message-Id: <20240224114516.86365-9-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> References: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=914; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=FVGxPxo7dhefAgv0+pTOuq3PsgkfA3XqEYIs5C/hUlk=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBl2dbLVMAMEyMDgFRsk7UM4RKH5C9b4/vOUmW64 8T+/CnvY9iJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZdnWywAKCRB6of1ZxzRV N6eaB/0S7VoAO4aDysPHYTx6ZQbvF1A0D2z6nD1IfjlhgmGdgopX6eKtOBO3w0oT8yT7C7C3AMT PDoeThT7DgTrzi/KPgqozg0s/NN9GcE36CQVWnX4ZUiyL0/u8lk21nvh/Q0+wjfTkLm0XmcUGjX 0hTT8wlcRfI/zwvSPscVhgy+RfMPWFj56S4ufO1cT3xakA2pWVkMktkWgMLKpZ1SP0CEkZKlVZA 6A6GgKgtcqQAXVssR14+EO3RxnjSLOpE4cT/Dp7UnG6E2l6qVvpNqfmqXiwOUqmsAsSFbWvVkKW X4WRjpAwKsrmD6mCWbPR1XYLvBihzdOKN//ri8FTgU7YVsF+ X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791780752998973384 X-GMAIL-MSGID: 1791780752998973384 From: Praveen Teja Kundanala Add maintainers for ZynqMP NVMEM driver and driver document. Signed-off-by: Praveen Teja Kundanala Signed-off-by: Srinivas Kandagatla --- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8d1052fa6a69..b3103e03015e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -24233,6 +24233,14 @@ M: Harsha S: Maintained F: drivers/crypto/xilinx/zynqmp-sha.c +XILINX ZYNQMP NVMEM DRIVER +M: Praveen Teja Kundanala +M: Kalyani Akula +R: Michal Simek +S: Maintained +F: Documentation/devicetree/bindings/nvmem/xlnx,zynqmp-nvmem.yaml +F: drivers/nvmem/zynqmp_nvmem.c + XILLYBUS DRIVER M: Eli Billauer L: linux-kernel@vger.kernel.org From patchwork Sat Feb 24 11:45:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 205829 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1105517dyb; Sat, 24 Feb 2024 03:48:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWP/szxCRNm2DBRfl99QboFHGhsPvFtOtbi5n11I3fvmwRs6E5coDatD48hjC4sCngH2wBfl7VBj39W8fX82ckkpU7aVw== X-Google-Smtp-Source: AGHT+IHcvgbLzh201QqDOxaPXM4mTbhi4m0Bo5CR2+HYXsFn34ibfUalPSfH3mEMeKOHdZ77o2Rp X-Received: by 2002:a17:907:20b4:b0:a3f:86f0:cf6a with SMTP id pw20-20020a17090720b400b00a3f86f0cf6amr1439940ejb.16.1708775301039; Sat, 24 Feb 2024 03:48:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708775301; cv=pass; d=google.com; s=arc-20160816; b=ZxBqjIaxZQAG2HBTxVHUz79F68FURHtvRgsoZ8extcos70ogcQAtuSdVOBhVaQBk2Z wLaNfcrqEp+JCtgy1R0bgzW9hyE6JdInNfmt8rhDvqcSKgCD2nekm5JgnAYPSiPq8NWx ElBb+3N0JNd8TbXcxK96GPzsQZ9o6iUgEVO25eyt6KAgFyVu5n4SOQprl059JOTJYihR x/w6drytPEP+EQsHJ4Q7NLws0O2H0XdJuVGuazMK7u0vGohyx2MJVfD+sjSA6MERByZQ alCX0pAL/De8VhYiLHyKpsSS3fagcZIKWuYuNwirgT5/PA88GhDybNiWd+Da00+C06sm zFrw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=URkw6QL3Oq/n4HIqTGKXvI0jPn9hoyzzXsS9+93dgl8=; fh=lwiaz9xUg0emiuzTgwJFLXAvDUx0/39QDaCsa9q6Gwo=; b=z20SeTNrXXN8JgLYoqC6cs/I3EXwzLBXeeX8qu1MO83FZ29OCUSNAZkhrp9biXMTkB GxpxwQU97ukSQ7UgTm54D3OTKfWz5V37Q14Jo4s8eRcqVPhnEsctFhBfERDe3rkO620p hqHCvZMp5x2Q8gNvfgfqBcWdteRBlTs2Sz8NxZWa13XDAC4Hc5P4sSB0/6RoAUafcJte AEhf/8DYjjKnTSJKxIEf0DBdYjy4lAXUEfA47xwI4ofkt1CYy8L5Weje3vFYGVoark2e MdDQ3AxfoE3XmezahILMrmqqyOVFS1X3Yjte8wCobysdSrOgow0GTUlu4pst2lA6uYV4 0TaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hE+dd33k; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79612-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79612-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j22-20020a1709066dd600b00a3f4e9e6783si472671ejt.522.2024.02.24.03.48.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:48:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79612-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hE+dd33k; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79612-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79612-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9B6C81F22405 for ; Sat, 24 Feb 2024 11:48:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F7764C3DE; Sat, 24 Feb 2024 11:45:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hE+dd33k" Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 A3EEC45BF1 for ; Sat, 24 Feb 2024 11:45:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775155; cv=none; b=cW+bcm+h+9AQ64WvlfKnC0iMhRp25W9KcrIakoP8nqRWBxVzfssNZocTe0kpX5xkDpxmlMpXit40BlJ93fiv5da1faex2Y1CC/FpXegggSDdJEm/0UksQPPwpe08ZGEFtdBKDZQKzR6ahyV2/lAY7bJLfXU6oNs2IRHF6V3914k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775155; c=relaxed/simple; bh=hRacKiyoOozAs2YwTKpgReT2IizopoY29GJ/KuQJzc4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=bYp4QltMgeV6+ka//290v4J+I/q577Pzlor580DpP/BYPMKr8LLTixgWRXTJt7TBxl/Skf8bIaj+EqJUZrzxExgwjTqjAEOvmhFJSA7qUF8L82Ber7txWmyJarPB7QaSN1XpdH1rtusq+3bbaB+eYAzClOFNEMhMMwVPWTpFdwk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=hE+dd33k; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a3e550ef31cso195951166b.3 for ; Sat, 24 Feb 2024 03:45:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708775152; x=1709379952; 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=URkw6QL3Oq/n4HIqTGKXvI0jPn9hoyzzXsS9+93dgl8=; b=hE+dd33kQKPztXu216g7h+auQ4Ksw4lB4+8L7kLCuiDgiFNTFPcya9fK41lvXSHD0T i1eRyZ85TPPvgYwYLxb8e1yFcE2TyxTz2lk+gqAb40emLj3LSHGYqM4SzFJLT4uJc8In pkRcFSfuKw1JCNswKwIkAP/G7TOveShhKDHRgP5oeYHOCLmsvqNejhBFLHpXC1Ui3+/0 GF/vKqEXGKZMPL39QKisWxLFw7uPnFr6TTaJTpF0b01/gEIciN1Ky38Gg57R/ebG331a r4Pg0QYSrEClVhkm/qVOjWdWEt6M5lz9t3kQLREjwaVytMN6x1OQlXnwFo6ZA1/UclQ7 TSaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708775152; x=1709379952; 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=URkw6QL3Oq/n4HIqTGKXvI0jPn9hoyzzXsS9+93dgl8=; b=XLp4qPsYaKwHA2m55oSDYrYhVhhcnEwpwEaCQNTCMJ0oakmYC27+jAd/4qObCsdCtq Vf69vW4Jupd+VWCKTpRLBqmQe4DjD4W0RGVgV+5V4om19tzJcor2B/kLNVXs3hzgPMcp 3NfJcBuCNFWwKm2kv/0gdOJ6qayo3xlgFV2addQR/MPnkT3jaYVr3nQMXLXzmLV9Abb+ bwiJeXcQCNZIl62gb/ZlRjXi3fGBShLety1VTCi6CfqiZPRuNG3Hq7t1PetrqsZbENFr w+u+T0TdGkHF+YvSpJZTvGiEHV2AjUb5cf04mTWRSJdpPt5zJ2lERhhuEH5IiylKN5C2 exUw== X-Gm-Message-State: AOJu0YyPQ5eqBe240D7duQSa9lJK1ltAVSbWoVOv+buuHYGMBJohTdH4 MEKTDWtdNAjQNcRrI/Yf+CT3RAsJqm/8Wc2XqFYU5/b2xFZK0g4AlZqMFWA7rCY= X-Received: by 2002:a17:906:f15a:b0:a3e:66b5:d65f with SMTP id gw26-20020a170906f15a00b00a3e66b5d65fmr1364758ejb.67.1708775152267; Sat, 24 Feb 2024 03:45:52 -0800 (PST) Received: from localhost.localdomain (82-132-212-111.dab.02.net. [82.132.212.111]) by smtp.gmail.com with ESMTPSA id jp10-20020a170906f74a00b00a3e209b225asm517826ejb.43.2024.02.24.03.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:45:51 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Chen-Yu Tsai , AngeloGioacchino Del Regno , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Srinivas Kandagatla Subject: [PATCH 09/11] nvmem: mtk-efuse: Drop NVMEM device name Date: Sat, 24 Feb 2024 11:45:14 +0000 Message-Id: <20240224114516.86365-10-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> References: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1143; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=LEPiqIe9wBwdCEI4P2jYHCIQnpNr5K0HnCD0iOgejQk=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBl2dbMfoh4mpVIdPSn++fEFATNn4svgaGXpjR3i vH8rIVjdSGJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZdnWzAAKCRB6of1ZxzRV NySMB/0aBffAawyRKQzW4dVgLR2bNJiKwVW0LoncNsH7PKekAQXhPjEu7AWzYnCTo0zNtOldSE0 W+9wbQ6DDSCSqYmOcpd/UClepnkBIFypGGu4pvYMwcBHQRxy2NIHxxc2elcYjWLEljRsYTpp5UO LxgZT6fxqYCZPixHMAMGLLVb64GoNMq1HECZoLvU1o4XiAt6F2jyXvfdl9imIkJcoR9k2l19MeD CzTCUvpgltHd9ZrnqbGkscZ0h11KKsUqL3pfDgOUjUWibdsNHhtPq44c+oCrhR6YjiICTaSz12Z al0WW8sq52jyBimagdV9R3g9l3qTG3ISxvARLCYNiPX408Aw X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791780769788518776 X-GMAIL-MSGID: 1791780769788518776 From: Chen-Yu Tsai The MT8183 has not one but two efuse devices. The static name and ID causes the second efuse device to fail to probe, due to duplicate sysfs entries. With the rework of the mtk-socinfo driver, lookup by name is no longer necessary. The custom name can simply be dropped. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Tested-by: Nícolas F. R. A. Prado Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/mtk-efuse.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/nvmem/mtk-efuse.c b/drivers/nvmem/mtk-efuse.c index f5bebcecf9bd..9caf04667341 100644 --- a/drivers/nvmem/mtk-efuse.c +++ b/drivers/nvmem/mtk-efuse.c @@ -86,7 +86,6 @@ static int mtk_efuse_probe(struct platform_device *pdev) econfig.size = resource_size(res); econfig.priv = priv; econfig.dev = dev; - econfig.name = "mtk-efuse"; if (pdata->uses_post_processing) econfig.fixup_dt_cell_info = &mtk_efuse_fixup_dt_cell_info; nvmem = devm_nvmem_register(dev, &econfig); From patchwork Sat Feb 24 11:45:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 205830 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1105585dyb; Sat, 24 Feb 2024 03:48:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXT0bOrzzi07um87fWHTrrin2OiyppUTiNmXvyVbfw5FkJa2MqlKWaqLP1zNBXPcr9TmXba1GWg4QPwdsA+VVH6fL+MWA== X-Google-Smtp-Source: AGHT+IHpHkRd1lVPq5VRf/LAdq+papiC5FQgj2jFpyaSvBfjORizBxLW+ImVIpq1fUR/FFQWmy7b X-Received: by 2002:a05:6a00:4ba4:b0:6e4:148e:2946 with SMTP id kt4-20020a056a004ba400b006e4148e2946mr2223445pfb.25.1708775318689; Sat, 24 Feb 2024 03:48:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708775318; cv=pass; d=google.com; s=arc-20160816; b=j35grVMgeWc6uo4ESyxH8Algt8hsVq4xpp/xXIsU4I/vdtHkqKcFIL1oLaU8IVZQfq 4fyB5DODw1tY77FITrDw7evAj+UMbcN8cvt6lf6kLYHrgi7HienylLXk13eLGNW68VbG fhh8+VdoetFzBel5D89J+4CC3JrBk3HcQki8kMrK8K7NgHscpD11mCgrdRLwn2LjNzYJ SY7vcFwcomUONEIGo9SZwwSQBYGSju1tGAbsUWl0W51Uj5dT29cKDFWKVSqGLdf4G6fs nQcW47KK6OzepuN5BeQXhdo2MWlLlm+amFTlQFyX3FMY/LTyg/6KEo1hIrm1alGh1RxD yeeg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qtChYB+TgygG9shwdHbx8fKoevWTRa0yIf7GVv2xElo=; fh=6VhtCzn6pZr2D9HeZcIuBYe2DzWP/+OdIuhUMYimlac=; b=ZDd9bI4zErnKlx4ImV3VdxAcK7/r3sGxe7CNbLhgNzFjQc10sVxI4gCiJ+I+jj8exo JPojoCTh80plwv9B7paPsdPhgKsVnKMfPCsaMHarIaJ3Fp2aczV5q5eea4DNUxW7n5BZ CZ89HC7q9Wvq2tFIAUO7Bx+uYXr5sk+aG69NjiD2p9hYKm0ctQE/N1nUO+m9MU3cokEo hh4pV/fPjvFmpWpcq9JQcFTaUA43P8w9TfYqOJaeh/7s2HS/3TcAX57GKmJivsyVeumL 3c4FUvZoXs6THScBl2q4pU6PHoOVvcDmsYrb1uyGhP2Cs8cb+f4um9VrMMA6x+zvbB8n UC8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C9RvLeJW; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79613-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79613-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y1-20020aa79e01000000b006e4fdca612asi254458pfq.13.2024.02.24.03.48.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:48:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79613-ouuuleilei=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=@linaro.org header.s=google header.b=C9RvLeJW; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79613-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79613-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 810A5283EC1 for ; Sat, 24 Feb 2024 11:48:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFABB4CB47; Sat, 24 Feb 2024 11:45:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="C9RvLeJW" Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.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 8F46347F45 for ; Sat, 24 Feb 2024 11:45:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775157; cv=none; b=ETEfpMXxCHGw8cAZn3xfdvMF7ZqTb5qoIFr2+t9mhOGTID5cqST7+FunY/x5M9IFuQaHuiUfI9nxxwVwibjsicIA1r0dBvaLqeLReUp+W2+oG9uepZ3xh7iXLx3RV+hhaJFRpnMOFwf+6MohALdvtRvimgZgCVfKnIWz5e7WYcU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775157; c=relaxed/simple; bh=qePmAjtuUmkhoRgEQQyBxfVAGVP8TSqgY/vpB1bKGqE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aMv5BqVmosQKpyOt8iTbY7B+k4ULIZlj9JCkrByWU2e3ifxdh/7I4nScJprpEB0QqEtMXcmeQJyGLVdrFMhd3yNc+rhIX4tz+pInKIxI9lMtZnZCvlvsB4MioWTWkafYAEkONO403aSqRtYhCm3IwDbmAoWPnvPXpptvnXimDm8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=C9RvLeJW; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a3d484a58f6so235387266b.3 for ; Sat, 24 Feb 2024 03:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708775154; x=1709379954; 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=qtChYB+TgygG9shwdHbx8fKoevWTRa0yIf7GVv2xElo=; b=C9RvLeJW5iaxq5inY3zmX/T9DViyc+3POeS9F97wYoXP9Gze83U520A1jQ/a+77TMc 9rZqiFvyATABvBj+WWNVBxRGH4ADF4FOfnMZIiRz03Vm3MZqbB4q38F5tKyaOC4koV+o RMTFDfnPJv3wNbOmpJeVOxyrZO2JmOuMbEIDW6ocR1M3oejrDtHZWNdY98zj6cYvY4hv UTzp7ytW2AgxH7A0vF5QJnFIcI9AVEI8ndwvaO6tj+ktvk85jPGILzZoRCbawC8G9X1+ znK08ZK8arAX0Fn4WV3SpKMRhdRNkuhNdLOjVQxwcs4TNoMDmI6BB/wD3TrBaUPr1Pn6 VX0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708775154; x=1709379954; 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=qtChYB+TgygG9shwdHbx8fKoevWTRa0yIf7GVv2xElo=; b=XChamYsKcIALQhPHJ4/CMgIGjkLNefCkaA9YXmFVB+QuQRcQHkqawrhAvv/YPxZ9p5 nMLADBV5kjuafFN/xYBvdg0Gue837oqCm80KZngN1yPW/+U1qOY9k0l8t4bIiAQGtM3Y bY7JAkfHocNND2TXpgpHjFnCeVl0sDSMuwZPPR4tmW5CKVRXuJ4My4/5onB7q5bH7CDr Hu4O3sUhvIhe+S7m7iiarGhmW4+XVKFavaYEIhms56ift58p8bRWM0hhDV0tChX8lMUp 1RJFfslt1WciH18PzBwxJo/e5gINbCsqIyCea5QOFnPyHpFT6XUegEUBCdapwmIPWnfl c/Vw== X-Gm-Message-State: AOJu0YzK1EsqRSCUfNMaYOuDOmXg5stDygsdcbQXXPBdwiotJN7dblIk RsI1TCuZ0BXpagTDZJmMpIug6EN0tBf3Z5yPTnuIDSnxCyAcKgugF+eURcE5u2c= X-Received: by 2002:a17:906:ae48:b0:a3f:4516:ecf2 with SMTP id lf8-20020a170906ae4800b00a3f4516ecf2mr1506415ejb.32.1708775153722; Sat, 24 Feb 2024 03:45:53 -0800 (PST) Received: from localhost.localdomain (82-132-212-111.dab.02.net. [82.132.212.111]) by smtp.gmail.com with ESMTPSA id jp10-20020a170906f74a00b00a3e209b225asm517826ejb.43.2024.02.24.03.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:45:53 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, "Ricardo B. Marliere" , Srinivas Kandagatla Subject: [PATCH 10/11] nvmem: core: make nvmem_layout_bus_type const Date: Sat, 24 Feb 2024 11:45:15 +0000 Message-Id: <20240224114516.86365-11-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> References: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1198; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=oroRW+eWACABp1DyN2gHfe1cb5uDZcxEYMDPbkXgEzc=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBl2dbMU1i5dkCaPx0DtDqGaZ2hoRzjAiH1iUJY8 FBYasybkBiJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZdnWzAAKCRB6of1ZxzRV N7bNB/9oDtL9RE1lkQSk0+5RrKT6y3tqPK4C7Na//B1cH9J5y0gsgL8xV+bM9rLuO1y/fdcvxQg rHThGclMwNm7fYYCT7KzVC+O0aE0UEjwb4s63rk6LDX4LGNw2GsgQ6dkrK6neGfw4qYsWHVGnzi reMRvErbDNnBl7sEDBVUVb4X/6dqEiFxR8uwwiM9UPSe5Q1wIV7+FCxKzcy+ZSVAHOjoOJtLtMO ZDGHplP6cx5r7ocgS7/ra298UTVf9wW9iVlC7R83YtQc0mDS4rox504D4c5zVvTCfpmtcGGUG9t lMCixjzcQuzTgfudNHYltBgTgpdN77S308bOh/ibTIBrtsF+ X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791780788580229192 X-GMAIL-MSGID: 1791780788580229192 From: "Ricardo B. Marliere" Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), the driver core can properly handle constant struct bus_type, move the nvmem_layout_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere Reviewed-by: Greg Kroah-Hartman Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/layouts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvmem/layouts.c b/drivers/nvmem/layouts.c index 6a6aa58369ff..8b5e2de138eb 100644 --- a/drivers/nvmem/layouts.c +++ b/drivers/nvmem/layouts.c @@ -45,7 +45,7 @@ static void nvmem_layout_bus_remove(struct device *dev) return drv->remove(layout); } -static struct bus_type nvmem_layout_bus_type = { +static const struct bus_type nvmem_layout_bus_type = { .name = "nvmem-layout", .match = nvmem_layout_bus_match, .probe = nvmem_layout_bus_probe, From patchwork Sat Feb 24 11:45:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 205831 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1105616dyb; Sat, 24 Feb 2024 03:48:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVY3N8uz/XD/GdY4TJviiWK3d6Mj5nxaIuOe+TwoaDE1hNvqycU44EEcxaTBFfkU2zzDfI4RnTNiy3OTcvmLdSvpTvy2A== X-Google-Smtp-Source: AGHT+IE6T+yzQvt6/F631enrfw0Kq8GuDx4sXcSilsKz4XMB5TI+h7tFviVqcw60jcZQVtqrAm3o X-Received: by 2002:a17:906:470e:b0:a3f:eff9:7f44 with SMTP id y14-20020a170906470e00b00a3feff97f44mr1377253ejq.61.1708775328007; Sat, 24 Feb 2024 03:48:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708775327; cv=pass; d=google.com; s=arc-20160816; b=Acsxf4FbDBZ5KmOxeEbLWvb67iMeqCq17YuLyP3M7inyKgaU5oFILQJgdYVJkw43h3 Bth695L2nW/mMKyyR4GkHMWNfTC9VfT+WcENiOt1YXc+18aOfYdPBrEKS/pud5y8Busl iibhiEP5yhSRzN41PBeUZGj6rYb9Kcspk4eWrwaQ0IsCMjWAjHpAhXR5ZNzJ6uQRi9bt lAYPLt7rEykMy/kl3DZxA7zJmqc7D1CG+Tc6yfH0VABT502lCK5QKMTxSqXTd0WE+IvG Ot5tPADE7ktMNcVdDW92BID6S6n0oZVOfjgCmPy3GKHyLrB4j8s8GvgaZnJbNpRs1UJP HAtQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Y492RWEJd5wja5KAvcbQOaDOMx8y5RKUhmHOdEQLHO0=; fh=HQ5KWliOAGNv4a+DFJ4mVsHelzfgE9JqLETPCZobwJA=; b=hx6JmzhaS+f4wKCB1nH72I5SlQFs8j9HzknOS+zDMLlsQBpS3vLCdjnVWGYc2cSCWO MwXpCEFPHo0wpKNZoczh7mzLvDgLYpHapThn8FXwGYWV7BJZQXZCCMgfzuaetLPqNl5g 8Suy6CVsb1wbdW5zwXnq8SlgXqxBHU0CFi2/zuAvLu5NW0kFAF+Y0Vz5zTTmCxpLhatJ uMNwDL051ar8i1M51nB9YT43Vtl5RaADD4cx/LAXZ9mbukNoiIHsxOllmOgPj8psto6y hHD3avQ4DuLFmmejf8OzP1GnNOYmbFBWOT+RE+KgYTSLrqo3s2J1cyb5C9o7oOpv+b4W elkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J5AWNTxo; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79614-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79614-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id xa4-20020a170907b9c400b00a3f70bcbfdbsi464323ejc.271.2024.02.24.03.48.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:48:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79614-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J5AWNTxo; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-79614-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79614-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 938001F2267C for ; Sat, 24 Feb 2024 11:48:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2D774CE0F; Sat, 24 Feb 2024 11:46:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="J5AWNTxo" Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 9F3D7481DD for ; Sat, 24 Feb 2024 11:45:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775158; cv=none; b=MGuQQDQR1t2DRE3G9f0SeQ5f9tpSTJZV7+rURIUnCiS+lNg7dwePnF9l5h+ZhLX5yHbbaUV1XrxS6yJ0/+pH4Ykj3yMyNKLf6aOfkPxq/bizJNjJ9cpAmaT9K6wwFkHKGkxcVLIqOF5gRblcdL00y8actKlYjGbO37UOOGLpF8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708775158; c=relaxed/simple; bh=LM+xTq6J4+xN/3hkhq0Y8g9M/pd/4r9GnJzSkbJ03lc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q43u2acp0GBPWYU+fXoFAOc+eUkmdReU3uttBTN9Y6f6vpGIxt3dux35dYEEHCAmTst4vkNfmSEC65bMqL5ScSF4ol3h2gXMfAnYXjvu1kwlrIHpOJQh/Yslbp2uMwZ6sLWuOZ4Rs/zlMKZQNlQFq1KQHTDO4UUAcjwYzvaYA6o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=J5AWNTxo; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a3e85a76fa8so151274566b.1 for ; Sat, 24 Feb 2024 03:45:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708775155; x=1709379955; 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=Y492RWEJd5wja5KAvcbQOaDOMx8y5RKUhmHOdEQLHO0=; b=J5AWNTxop2RDkptAX2nvIAIuSz+2DOVXOtSreC06ZCmveGDTJDipw+U9NzBTkKxTnM WV35HPtCe/w093DGNEJKg22URcSJ875p+iaY61DeDJfyvpyPP+WSDqnFvBZi8r2lX/Pq 2EqSkZCJjdpv2g9IpTSZ20A3gxsmWdsdJdLbTHW1vbJkWvUsyFuhwbxRy09jBYhmkaG/ YvlWZoqRcoQnEUMxV4VEiXrIi0u7lyi2txaWn87xHmdG+3r/JtTq8znan1OXpjbujVTW /stZ1s/LbhPGQ4AEzsz7GA9Ej9P7b7arj7wVZqwH+eOxelzJYC058FpzGHmBn2T+I9sP PkyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708775155; x=1709379955; 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=Y492RWEJd5wja5KAvcbQOaDOMx8y5RKUhmHOdEQLHO0=; b=w6yNN25q9ZwaNMl4J2RMokB0zv9aIZgMJT2Tl/dPecQZ8fxIuckPlBT9W9/tUHf4jW pUlX3oKAFKmX2R0uSmJB162qNA7ntUp8Xv7bscYJovA1jhHmCmWjnav7nv1WkAiwrh6A n/6eLENtcm5HuLG+eBGLXIOg5bz1nd+2X26hYWI1xu06Jb4k/0dkxXNoBYVR0BTIHMLM BQLnrmgYjxwjvkt0F91aVB0Qd3tlMxuo9vpNfYFjpS4vrCZpgjub30gfYHnx7IQxKiNe Tfkki6omvFdVbSloaZksMZjZTa6vCR4HhbusLYMqbLd4kGE9tnyKAUi2A6h+oUHUszru hDKg== X-Gm-Message-State: AOJu0YxCHoSm0lzsqkAKcBiIaqw9pVw2v9Aqwzl9yHU2dLSwwyWKIIyG Swzs/uTX34sCfzsPUYCFJxeKlWEb9cu9kvSmbIDjHNxKVbhytZzpVcAbD0JtfeI= X-Received: by 2002:a17:906:c448:b0:a3e:9e4d:dafb with SMTP id ck8-20020a170906c44800b00a3e9e4ddafbmr1336122ejb.29.1708775155042; Sat, 24 Feb 2024 03:45:55 -0800 (PST) Received: from localhost.localdomain (82-132-212-111.dab.02.net. [82.132.212.111]) by smtp.gmail.com with ESMTPSA id jp10-20020a170906f74a00b00a3e209b225asm517826ejb.43.2024.02.24.03.45.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:45:54 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Markus Schneider-Pargmann , Srinivas Kandagatla Subject: [PATCH 11/11] nvmem: core: Print error on wrong bits DT property Date: Sat, 24 Feb 2024 11:45:16 +0000 Message-Id: <20240224114516.86365-12-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> References: <20240224114516.86365-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1055; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=uroTY94WYSRKwirx4GTT/pxJsWbg17Tq/2L7JU2HVts=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBl2dbM9vgaNdhVQEZmZBLe9WFY1YItaepN6vO/N t1fl0xkOKiJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZdnWzAAKCRB6of1ZxzRV N21CCACZw7dzFNz2c+Re7cGe52bU1nOZIU1SflLg8Nayn7PrEGrDbAhu5rvye+voYX/rxJ53GV3 VcGABSvqlIh/vAYBlmCAJGFGmR+7eZsj7GTmzREqhNFX3/Sa0dYavhxqwV7PCuIS7f3kXzHmTQB SsK6F9l739Ev+3AYMjz0WdemRzIL7rKA8uABZLQFGweCG19Ugy2JNper9Sv0128qunofkyjPmXQ x+I+zEb7dX1o6umTUV8pOtsl0v96d3hmnInsLc15nL6KuVPfZD0Zxmljp0MVNKggmkY3MrxuBue XogfKiIuhwL/vLLaNNfV4X3ahVjqhM0d8xNcuN4aaD0wGi/K X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791780798221313398 X-GMAIL-MSGID: 1791780798221313398 From: Markus Schneider-Pargmann The algorithms in nvmem core are built with the constraint that bit_offset < 8. If bit_offset is greater the results are wrong. Print an error if the devicetree 'bits' property is outside of the valid range and abort parsing. Signed-off-by: Markus Schneider-Pargmann Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 980123fb4dde..a9832b5a608e 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -806,6 +806,11 @@ static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_nod if (addr && len == (2 * sizeof(u32))) { info.bit_offset = be32_to_cpup(addr++); info.nbits = be32_to_cpup(addr); + if (info.bit_offset >= BITS_PER_BYTE || info.nbits < 1) { + dev_err(dev, "nvmem: invalid bits on %pOF\n", child); + of_node_put(child); + return -EINVAL; + } } info.np = of_node_get(child);