From patchwork Wed Jun 26 23:57:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 167866 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1587475ilk; Wed, 26 Jun 2019 17:00:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvqKFGVUgoeU8MSEigKi7QV19a9XGXQG52JQNFbKpBSMm9Lx0iGO/YnRq5CxodSvGj9+Ca X-Received: by 2002:a17:90a:350c:: with SMTP id q12mr2221480pjb.46.1561593605169; Wed, 26 Jun 2019 17:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561593605; cv=none; d=google.com; s=arc-20160816; b=vGcOsxURnlOfsoH/xFlQvZE59VLqe1XG45ddtUpwdgLtBJaMbcjgt90aHu6XFcayXm 5NEU15ep8uig3ZfNh68oSBCBn1H5J6pU+X38tBiEjFg8/ZVGlF+BhVya8TypvmnB/0JY DvgtIRTRg+ekx3xh7oYJjKwRW9hLkHKv1rJQYxuBR51NMyAAk8O101031eCzaOdx3VxF VFMCEIgwYiXtKcGl2pt7hNfgMaO3Z9oaqFx8NYaYm2Pa4wNQkkNC/8dCbDqAMtcMwKjd +yjMOcokoddFXiMcM8yhm6VeO6HrnpxC+GHzHV9BsNkMOATaC2p8a4tZhrjKe5wIwCVd DN6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=53IaqpMPerVQvE5lpwCouRahQV8Om4olnk1aH2ko0g8=; b=jL2MVEFzUh1PYzRSf1LCnBrrNjlEcMZ/tAuPNGXceWu/f4GGto1DENR3Tilq9sC/u+ jh66xs/oJqbnlKkG64hngjgOpoKb1CK/HjwyvYq5RuAwrN4aZeh6TnBzICDdJCzvUaz3 XNM3WiuIPb3WlKZs2Jww/0Li3OD4U4QEVykLniqEtmF5XdnlhiIyuzqJJhZTTEz6nhjU kxVLPe2ktw2HNQl9j/n2Ec7nPihYDf0qYcPhuTtxZTjjGGkFql6kr+b9RmY9Oh5iQIfD 3KcuVGmisH9ZdGFK3eGrpKPNHBchHYXUT8VhYiWbkPPgLtIokYiG5JMVWdydBWkjXpwm hvpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a17si3211157pjq.101.2019.06.26.17.00.04; Wed, 26 Jun 2019 17:00:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726596AbfF0AAE (ORCPT + 8 others); Wed, 26 Jun 2019 20:00:04 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:35760 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726385AbfF0AAE (ORCPT ); Wed, 26 Jun 2019 20:00:04 -0400 Received: by mail-io1-f68.google.com with SMTP id m24so759525ioo.2; Wed, 26 Jun 2019 17:00:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=53IaqpMPerVQvE5lpwCouRahQV8Om4olnk1aH2ko0g8=; b=fyerAui09rzodqkgck6mCAQTJNiB2/oMvJtyO4bs1E9J+RHMcLUcH5vhe2lr9T5Eqn bVarnAOA05Stgo2ue12yMWpvDI/iboXBBovnatKAk8eMuPNqJ6ahEwxlsFS5DeH02EAA t1gwVC/kMNI7CRCR+qa10x0r2PQAXa/lodOInEzkrRyqLzIP1/BihXpHqsxIdFdVErOf GyRLLziLGjJ78vppXtcwVlAm6XPnT1jAwmqGvgr9XBjPmZhXy2/rkytn6GtWPxdekf4v dBEF7khtOwhlLZ4T0fNGw6xHM1IDxXJ1E12mkZeu5URRknncTOLzR3QXOau36gQ5EAQr 3uMQ== X-Gm-Message-State: APjAAAVH2qMLklp+zijU8aPCHXngdvsKRJ3qKcowO7T10AKQ3kx4OrU7 kg16nnDMvYIHu/WbZ+pbZ8ExHwc= X-Received: by 2002:a02:a384:: with SMTP id y4mr866306jak.77.1561593602990; Wed, 26 Jun 2019 17:00:02 -0700 (PDT) Received: from localhost.localdomain ([64.188.179.243]) by smtp.googlemail.com with ESMTPSA id l2sm359969ioh.20.2019.06.26.17.00.02 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 17:00:02 -0700 (PDT) From: Rob Herring To: Paul Walmsley , linux-riscv@lists.infradead.org, Palmer Dabbelt Cc: Lorenzo Pieralisi , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dt-bindings: riscv: Limit cpus schema to only check RiscV 'cpu' nodes Date: Wed, 26 Jun 2019 17:57:59 -0600 Message-Id: <20190626235759.3615-1-robh@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Matching on the 'cpus' node was a bad choice because the schema is incorrectly applied to non-RiscV cpus nodes. As we now have a common cpus schema which checks the general structure, it is also redundant to do so in the Risc-V CPU schema. The downside is one could conceivably mix different architecture's cpu nodes or have typos in the compatible string. The latter problem pretty much exists for every schema. Signed-off-by: Rob Herring --- .../devicetree/bindings/riscv/cpus.yaml | 143 ++++++++---------- 1 file changed, 61 insertions(+), 82 deletions(-) -- 2.20.1 diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml b/Documentation/devicetree/bindings/riscv/cpus.yaml index 27f02ec4bb45..67e54251eb90 100644 --- a/Documentation/devicetree/bindings/riscv/cpus.yaml +++ b/Documentation/devicetree/bindings/riscv/cpus.yaml @@ -10,97 +10,76 @@ maintainers: - Paul Walmsley - Palmer Dabbelt -allOf: - - $ref: /schemas/cpus.yaml# - properties: - $nodename: - const: cpus - description: Container of cpu nodes - - '#address-cells': - const: 1 - description: | - A single unsigned 32-bit integer uniquely identifies each RISC-V - hart in a system. (See the "reg" node under the "cpu" node, - below). - - '#size-cells': - const: 0 + compatible: + items: + - enum: + - sifive,rocket0 + - sifive,e5 + - sifive,e51 + - sifive,u54-mc + - sifive,u54 + - sifive,u5 + - const: riscv + description: + Identifies that the hart uses the RISC-V instruction set + and identifies the type of the hart. + + mmu-type: + allOf: + - $ref: "/schemas/types.yaml#/definitions/string" + - enum: + - riscv,sv32 + - riscv,sv39 + - riscv,sv48 + description: + Identifies the MMU address translation mode used on this + hart. These values originate from the RISC-V Privileged + Specification document, available from + https://riscv.org/specifications/ + + riscv,isa: + allOf: + - $ref: "/schemas/types.yaml#/definitions/string" + - enum: + - rv64imac + - rv64imafdc + description: + Identifies the specific RISC-V instruction set architecture + supported by the hart. These are documented in the RISC-V + User-Level ISA document, available from + https://riscv.org/specifications/ + + timebase-frequency: + type: integer + minimum: 1 + description: + Specifies the clock frequency of the system timer in Hz. + This value is common to all harts on a single system image. + + interrupt-controller: + type: object + description: Describes the CPU's local interrupt controller -patternProperties: - '^cpu@[0-9a-f]+$': properties: - compatible: - type: array - items: - - enum: - - sifive,rocket0 - - sifive,e5 - - sifive,e51 - - sifive,u54-mc - - sifive,u54 - - sifive,u5 - - const: riscv - description: - Identifies that the hart uses the RISC-V instruction set - and identifies the type of the hart. - - mmu-type: - allOf: - - $ref: "/schemas/types.yaml#/definitions/string" - - enum: - - riscv,sv32 - - riscv,sv39 - - riscv,sv48 - description: - Identifies the MMU address translation mode used on this - hart. These values originate from the RISC-V Privileged - Specification document, available from - https://riscv.org/specifications/ - - riscv,isa: - allOf: - - $ref: "/schemas/types.yaml#/definitions/string" - - enum: - - rv64imac - - rv64imafdc - description: - Identifies the specific RISC-V instruction set architecture - supported by the hart. These are documented in the RISC-V - User-Level ISA document, available from - https://riscv.org/specifications/ + '#interrupt-cells': + const: 1 - timebase-frequency: - type: integer - minimum: 1 - description: - Specifies the clock frequency of the system timer in Hz. - This value is common to all harts on a single system image. - - interrupt-controller: - type: object - description: Describes the CPU's local interrupt controller - - properties: - '#interrupt-cells': - const: 1 - - compatible: - const: riscv,cpu-intc - - interrupt-controller: true + compatible: + const: riscv,cpu-intc - required: - - '#interrupt-cells' - - compatible - - interrupt-controller + interrupt-controller: true required: - - riscv,isa - - timebase-frequency + - '#interrupt-cells' + - compatible - interrupt-controller +required: + - riscv,isa + - timebase-frequency + - interrupt-controller + examples: - | // Example 1: SiFive Freedom U540G Development Kit