Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2063084pxy; Sat, 24 Apr 2021 04:09:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6q4LER4VBTShUzfa0UOomzaguKUlD8C1AHBbAUjcg3Z5CnmA1SKjj0WX/5W8HiK1Cw1IA X-Received: by 2002:a17:902:b60d:b029:e6:7a9:7f4 with SMTP id b13-20020a170902b60db02900e607a907f4mr8281946pls.3.1619262560326; Sat, 24 Apr 2021 04:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619262560; cv=none; d=google.com; s=arc-20160816; b=EbL5z2aRxomza1it+St1c+Etf5DzfBkUcRoyUtIBIvoH7AM5OAYWRtNfJOohQbfpYx 2+uXiKB/NElrBIZ/Ln525XMS5Q59QhPp5DshYdPlH3b9u3ngLHpXJTip8S5A+CgkrmD0 JvKmmq78FmkFurwn5ylUD3rU/LOeE7q6RE4gT1wR072j9zvfGFc1f5JTZ0PHzE2yk3ZT ZOQTnyHoB9Tqm/JEe0mFifJc7rWu4jsIowLXeEjnDCqvECnYqMAAYdRl+DzrubRE0j2y L1XD0SP6bBC4aCZxorhB74k5lYJ4iJLVHm6e48fSvhSWYoKOAMsSlv7n9uJMQNSlpLNS 4tBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mt+USGcgMuYRSvhgvaBBu5wVT3FzFNAP4aN4m/X9RA0=; b=KQ76om0V+JPa2WWNwSQIrNnGCIFaXQyd6OzvrtckxP0d21b4S893Cq/9pieq5/lYD4 kJvBe9klWC8cJpQf16wPH5XHDrJBeS9kj18nojTHoT/9gzXF7aFHKMCWSeHZmVs8o3nA ELBL5unLTdTIX5p+ENtHtJXd3an80zQbHv3tZleWbrRGg61eBzSq5vlenOHSheiBGTnb zqrAIYjsENueZfV7OwnGi1d+RQXKiezM6TMf3jsgDGXR/1w8Q6capQXboFq2KZYQu/P0 2iAIdy6rmEXdnSDOKYk2fTSEqErOFGaOVpcvL1IuWYNnfPxd6iq5Xn8juIkt6DXTxqou 3hBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=dP34j55+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c23si10456791pfr.122.2021.04.24.04.09.07; Sat, 24 Apr 2021 04:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=dP34j55+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236706AbhDXLHh (ORCPT + 99 others); Sat, 24 Apr 2021 07:07:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231925AbhDXLHB (ORCPT ); Sat, 24 Apr 2021 07:07:01 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74568C061756; Sat, 24 Apr 2021 04:06:22 -0700 (PDT) Received: from mwalle01.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:fa59:71ff:fe9b:b851]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 5C15222255; Sat, 24 Apr 2021 13:06:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1619262380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mt+USGcgMuYRSvhgvaBBu5wVT3FzFNAP4aN4m/X9RA0=; b=dP34j55+3DThW1LIQWyGoET38bQeZRoYrlFVCAiJzMMsTT/lyjD02Nd9tqsqk0kFBVm3Fi L01xN9kozNL0RXnDQmIQj7uGsvzQVOh9JK4TjWrN6e4aaKQZz93oofKqq55HElt+RloFs6 Sx38VwCWHqnebf3RWhj/1bwzXb/qKfw= From: Michael Walle To: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Srinivas Kandagatla , Michael Walle Subject: [PATCH v2 3/5] dt-bindings: mtd: add OTP bindings Date: Sat, 24 Apr 2021 13:06:06 +0200 Message-Id: <20210424110608.15748-4-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210424110608.15748-1-michael@walle.cc> References: <20210424110608.15748-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Flash devices can have one-time-programmable regions. Add a nvmem binding so they can be used as a nvmem provider. Signed-off-by: Michael Walle --- Changes since v1: - drop "mtd-" prefix for the compatible strings Changes since RFC: - added missing "$" - dropped first example - use real device compatibles Please note, that this will lead to an error without patch 4/5, which introduces that property for the jedec,spi-nor. Should I keep it seperate or should I squash that patch into this one? .../devicetree/bindings/mtd/mtd.yaml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/mtd.yaml b/Documentation/devicetree/bindings/mtd/mtd.yaml index 086b0ecd1604..376b679cfc70 100644 --- a/Documentation/devicetree/bindings/mtd/mtd.yaml +++ b/Documentation/devicetree/bindings/mtd/mtd.yaml @@ -21,6 +21,25 @@ properties: based name) in order to ease flash device identification and/or describe what they are used for. +patternProperties: + "^otp(-[0-9]+)?$": + type: object + $ref: ../nvmem/nvmem.yaml# + + description: | + An OTP memory region. Some flashes provide a one-time-programmable + memory whose content can either be programmed by a user or is already + pre-programmed by the factory. Some flashes might provide both. + + properties: + compatible: + enum: + - user-otp + - factory-otp + + required: + - compatible + additionalProperties: true examples: @@ -36,4 +55,35 @@ examples: }; }; + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + + flash@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + + otp-1 { + compatible = "factory-otp"; + #address-cells = <1>; + #size-cells = <1>; + + electronic-serial-number@0 { + reg = <0 8>; + }; + }; + + otp-2 { + compatible = "user-otp"; + #address-cells = <1>; + #size-cells = <1>; + + mac-address@0 { + reg = <0 6>; + }; + }; + }; + }; + ... -- 2.20.1