Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp37607ybp; Tue, 8 Oct 2019 13:38:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwveKcWtG8VOOwSU4clIyhNfsyRKij277Qsi+WH0pFsbEzVB/6rx+GegWl5oP1Otj15pIzW X-Received: by 2002:a17:906:8308:: with SMTP id j8mr29711708ejx.142.1570567090860; Tue, 08 Oct 2019 13:38:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570567090; cv=none; d=google.com; s=arc-20160816; b=JBfiFbIZE8uOgslOIb18Iqs76kGiSHbiSE9Qim2jEbsu44+m8OkZvxw0wy0ukaYEGt xr3ikpjLXR7BE4WfJulfzhPnmkBhsntkC6+l900Ggy+Nx8J/cNQYp6VEKUAvjYlpGP7H VH+iTAv6sG7E+FuivfGCxOZJOTKq0cPqY6f7qEDQBkm3ScseWLYodz2O7jGjkpI/9IE2 CgTtczWXy9aXd7UJhjTaNYYz+fCRd4uUuBgIt2a6gwdNVh+jkXxi0O2RObMFbSlSMEGQ L3xuLFehbYQL3qTNfxA0lvCmtdasevmm28HVsBb70cGEpiga1KnmrikJAfkZY6KaRx0g OE8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=8OWcoGS3BEEoyWgrBo7bn7YYjPQqdrXR3vAw8gPm390=; b=Se2cw+oUjAePRdX7l32gJsQiytotOwpturWcf1aau3j8EJF8kitI5ifXJX7fPMEF4p WpssEhNXvMzxktgF0TpHNxmHHXfRJtOANfvPWxXigsVEPGJx4WwdBig61n6IvDhu4ABh 7rgr+mG0r0v18aJeaOAVRsAtZ0SZywHt5AIw0NGJZYkaNyZNFF7d0edNzqwb9FhEZk4g OpoTMrELQjSANvXtjbz4ZdpWkm5CAl1cA9j+QI6A5/pImNRd78kMgJ32xKbtd543k5zT cGsg0RhLS1zSIL9Hqs8zgmn5w7vmQRMx+XkrcN/HNTAkm+ZgjhDdDzySQcM1kObGAIHh IxhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=EuCNcLZV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13si84361edx.156.2019.10.08.13.37.41; Tue, 08 Oct 2019 13:38:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=EuCNcLZV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730988AbfJHUgY (ORCPT + 99 others); Tue, 8 Oct 2019 16:36:24 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:36633 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730832AbfJHUgY (ORCPT ); Tue, 8 Oct 2019 16:36:24 -0400 Received: by mail-io1-f68.google.com with SMTP id b136so39546415iof.3 for ; Tue, 08 Oct 2019 13:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=8OWcoGS3BEEoyWgrBo7bn7YYjPQqdrXR3vAw8gPm390=; b=EuCNcLZVNf49hDvCPEgJMlmxJKp6smESQklkNVCOknnb3tENPXH9DS2w2K6gUPaD9p mxOpyyAZ5mCYKmDxd6VdYLB4IFs962l+pZaSzoDSReYOXxT4vGkjjYvR5d/dfOdCrbcA PISeEiH+FfU7yJSOO9NgNqCV3rdSNXCW9aBXyGLAwfb/gHS+LfHDwOxxA4Dvw7ELV58L PIBBH+NOOSwq0FQ6LVfO+QdFvli5+QaXowwSSBNxCwrUJ3ssW7u9Tx++WWogJ0noAeeG d6E5GsIWbfSA/ALTqgEOdvj+RG0a/5q5RQdR0mn3/l6sLMYPIyWoYoBjVGsierSY4FYs jibw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=8OWcoGS3BEEoyWgrBo7bn7YYjPQqdrXR3vAw8gPm390=; b=YZnFZPo8YtylsMa1ZpQlUBHdm6pFoV3pXVSy3XA1PjQGD/pn9H9x7Q8zwuGbMK4Y4Q KAw+mWzW3ASyqIknCgAOlZaGCdlta3H1lik8NgbeQtB2alQ9CihskqiN6yMfJ2v2YSyr iwh33BWSJ1wg1keKrEBDsDm4gCkPnY1Yjpq870qVHXNpvf1HDWBZcU9iiDYShAFYySKI zz9R6Z58ykX9g0rzc1qLqhviOGRNIufrr038z3iDYbJ2zRkbSwzFN0gY0/CGqe8AW4dl lST1hJssXhx30ngQO8nhf8sC8Vm+Evo7W0/Yi5TJVCwaRrcGofZW5kXqTPx7Kux0L2lT caaw== X-Gm-Message-State: APjAAAUVK0WETPVNZ63AWGx9TbPwUqeELkTUYN+bHzKgpQzkpupH8smp Y56ZCEDGtR9+EjWtMVBZT8RBlA== X-Received: by 2002:a92:d7ce:: with SMTP id g14mr23019363ilq.269.1570566982399; Tue, 08 Oct 2019 13:36:22 -0700 (PDT) Received: from localhost ([64.62.168.194]) by smtp.gmail.com with ESMTPSA id m9sm39438ion.65.2019.10.08.13.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2019 13:36:21 -0700 (PDT) Date: Tue, 8 Oct 2019 13:36:20 -0700 (PDT) From: Paul Walmsley X-X-Sender: paulw@viisi.sifive.com To: Rob Herring cc: Palmer Dabbelt , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Albert Ou , linux-riscv@lists.infradead.org Subject: Re: [PATCH v2] dt-bindings: riscv: Fix CPU schema errors In-Reply-To: Message-ID: References: <20190925131252.19359-1-robh@kernel.org> User-Agent: Alpine 2.21.9999 (DEB 301 2018-08-15) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Sep 2019, Rob Herring wrote: > On Wed, Sep 25, 2019 at 4:24 PM Palmer Dabbelt wrote: > > > > On Wed, 25 Sep 2019 06:12:52 PDT (-0700), robh@kernel.org wrote: > > > Fix the errors in the RiscV CPU DT schema: > > > > > > Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@0: 'timebase-frequency' is a required property > > > Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@1: 'timebase-frequency' is a required property > > > Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@0: compatible:0: 'riscv' is not one of ['sifive,rocket0', 'sifive,e5', 'sifive,e51', 'sifive,u54-mc', 'sifive,u54', 'sifive,u5'] > > > Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@0: compatible: ['riscv'] is too short > > > Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@0: 'timebase-frequency' is a required property > > > > > > Fixes: 4fd669a8c487 ("dt-bindings: riscv: convert cpu binding to json-schema") > > > Cc: Paul Walmsley > > > Cc: Palmer Dabbelt > > > Cc: Albert Ou > > > Cc: linux-riscv@lists.infradead.org > > > Signed-off-by: Rob Herring > > > --- > > > v2: > > > - Add timebase-frequency to simulator example. > > > > > > .../devicetree/bindings/riscv/cpus.yaml | 26 ++++++++++--------- > > > 1 file changed, 14 insertions(+), 12 deletions(-) > > > > > > diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml b/Documentation/devicetree/bindings/riscv/cpus.yaml > > > index b261a3015f84..eb0ef19829b6 100644 > > > --- a/Documentation/devicetree/bindings/riscv/cpus.yaml > > > +++ b/Documentation/devicetree/bindings/riscv/cpus.yaml > > > @@ -24,15 +24,17 @@ description: | > > > > > > properties: > > > compatible: > > > - items: > > > - - enum: > > > - - sifive,rocket0 > > > - - sifive,e5 > > > - - sifive,e51 > > > - - sifive,u54-mc > > > - - sifive,u54 > > > - - sifive,u5 > > > - - const: riscv > > > + oneOf: > > > + - items: > > > + - enum: > > > + - sifive,rocket0 > > > + - sifive,e5 > > > + - sifive,e51 > > > + - sifive,u54-mc > > > + - sifive,u54 > > > + - sifive,u5 > > > + - const: riscv > > > + - const: riscv # Simulator only > > > description: > > > Identifies that the hart uses the RISC-V instruction set > > > and identifies the type of the hart. The above part of this patch looks fine to me, and please consider that portion of this patch acked. > > > @@ -67,8 +69,6 @@ properties: > > > lowercase to simplify parsing. > > > > > > 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. > > > @@ -102,9 +102,9 @@ examples: > > > cpus { > > > #address-cells = <1>; > > > #size-cells = <0>; > > > - timebase-frequency = <1000000>; > > > cpu@0 { > > > clock-frequency = <0>; > > > + timebase-frequency = <1000000>; > > > compatible = "sifive,rocket0", "riscv"; > > > device_type = "cpu"; > > > i-cache-block-size = <64>; > > > @@ -120,6 +120,7 @@ examples: > > > }; > > > cpu@1 { > > > clock-frequency = <0>; > > > + timebase-frequency = <1000000>; > > > compatible = "sifive,rocket0", "riscv"; > > > d-cache-block-size = <64>; > > > d-cache-sets = <64>; > > > @@ -153,6 +154,7 @@ examples: > > > device_type = "cpu"; > > > reg = <0>; > > > compatible = "riscv"; > > > + timebase-frequency = <1000000>; > > > riscv,isa = "rv64imafdc"; > > > mmu-type = "riscv,sv48"; > > > interrupt-controller { > > > > Looking at this spec > > > > https://github.com/devicetree-org/devicetree-specification/releases/download/v0.2/devicetree-specification-v0.2.pdf > > > > section 3.7 says > > > > Properties that have identical values across cpu nodes may be placed in the > > /cpus node instead. A client program must > > first examine a specific cpu node, but if an expected property is not found > > then it should look at the parent /cpus node. > > This results in a less verbose representation of properties which are > > identical across all CPUs. > > The cpu sections of the spec are certainly not perfect. They are > largely from PPC with only the most obviously things wrong fixed... [ ... ] > > I just bring this up because we've got an outstanding > > bug in our port where we're not respecting what section 3.7 says and are only > > looking at /cpus/timebase-frequency instead of /cpus/cpu@*/timebase-frequency, > > and I'm wondering if the fix should allow for looking at > > /cpus/timebase-frequency or just not bother. > > It's perfectly fine for some deviation for each arch or being more > restrictive. For Arm, we've generally gone the direction of everything > goes into the cpu nodes. So tell me what you want, I just need the > warnings gone. We probably should keep the timebase-frequency at the /cpus level, since that's how the current public silicon behaves, and that's how our kernel code currently works. Do you want to patch the schemas for that, or would you like us to? - Paul