All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-arm-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	"maintainer:BROADCOM IPROC ARM ARCHITECTURE" 
	<bcm-kernel-feedback-list@broadcom.com>,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	Sugaya Taichi <sugaya.taichi@socionext.com>,
	Olof Johansson <olof@lixom.net>, Andrew Jeffery <andrew@aj.id.au>,
	Lubomir Rintel <lkundrak@v3.sk>,
	"moderated list:BROADCOM IPROC ARM ARCHITECTURE" 
	<linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" 
	<linux-rpi-kernel@lists.infradead.org>
Subject: Re: [PATCH 11/12] dt-bindings: arm: Document Broadcom SoCs 'secondary-boot-reg'
Date: Tue, 4 Feb 2020 10:19:54 +0100	[thread overview]
Message-ID: <20200204091954.4zdxow4ijqnmvbdj@gilmour.lan> (raw)
In-Reply-To: <2744136e-a6e7-de19-4142-04f7edf0c6ea@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3649 bytes --]

On Mon, Feb 03, 2020 at 09:29:30PM -0800, Florian Fainelli wrote:
>
>
> On 2/3/2020 12:34 AM, Maxime Ripard wrote:
> > On Sun, Feb 02, 2020 at 01:18:26PM -0800, Florian Fainelli wrote:
> >> diff --git a/Documentation/devicetree/bindings/arm/cpus.yaml b/Documentation/devicetree/bindings/arm/cpus.yaml
> >> index c23c24ff7575..6f56a623c1cd 100644
> >> --- a/Documentation/devicetree/bindings/arm/cpus.yaml
> >> +++ b/Documentation/devicetree/bindings/arm/cpus.yaml
> >> @@ -272,6 +272,22 @@ properties:
> >>        While optional, it is the preferred way to get access to
> >>        the cpu-core power-domains.
> >>
> >> +  secondary-boot-reg:
> >> +    $ref: '/schemas/types.yaml#/definitions/uint32'
> >> +    description: |
> >> +      Required for systems that have an "enable-method" property value of
> >> +      "brcm,bcm11351-cpu-method", "brcm,bcm23550" or "brcm,bcm-nsp-smp".
> >> +
> >> +      This includes the following SoCs: |
> >> +      BCM11130, BCM11140, BCM11351, BCM28145, BCM28155, BCM21664, BCM23550
> >> +      BCM58522, BCM58525, BCM58535, BCM58622, BCM58623, BCM58625, BCM88312
> >> +
> >> +      The secondary-boot-reg property is a u32 value that specifies the
> >> +      physical address of the register used to request the ROM holding pen
> >> +      code release a secondary CPU. The value written to the register is
> >> +      formed by encoding the target CPU id into the low bits of the
> >> +      physical start address it should jump to.
> >> +
> >
> > You can make the requirement explicit (and enforced by the schemas) using:
> >
> > if:
> >   properties:
> >     enable-method:
> >       contains:
> >         enum:
> > 	  - brcm,bcm11351-cpu-method
> > 	  - brcm,bcm23550
> > 	  - brcm,bcm-nsp-smp
> >
> > then:
> >   required:
> >     - secondary-boot-reg
>
> Thanks! That was exactly what I was looking for, it seems to be matching
> a bit too greedily though:
>
>   DTC     arch/arm/boot/dts/bcm2836-rpi-2-b.dt.yaml
>   CHECK   arch/arm/boot/dts/bcm2836-rpi-2-b.dt.yaml
> /home/ff944844/dev/linux/arch/arm/boot/dts/bcm2836-rpi-2-b.dt.yaml:
> cpu@0: 'secondary-boot-reg' is a required property
> /home/ff944844/dev/linux/arch/arm/boot/dts/bcm2836-rpi-2-b.dt.yaml:
> cpu@1: 'secondary-boot-reg' is a required property
> /home/ff944844/dev/linux/arch/arm/boot/dts/bcm2836-rpi-2-b.dt.yaml:
> cpu@2: 'secondary-boot-reg' is a required property
> /home/ff944844/dev/linux/arch/arm/boot/dts/bcm2836-rpi-2-b.dt.yaml:
> cpu@3: 'secondary-boot-reg' is a required property
>   DTC     arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dt.yaml
>
> not sure why though as your example appears correct.

Yeah, sorry, that's on me :)

The nodes that are generating this error are the cpu@[0-3] ones, and
they don't have the enable-method property at all.

This is because if needs a schema, and will only try to validate the
schema under then if the one under if is valid.

The one under if contains a list of values for enable-method, but in
the case where enable-method is absent, the schema will be valid, and
thus the schema under then will be applied.

What we actually want to express is "if there's an enable-method
property, and that property contains those three values, then you need
to have a secondary-boot-reg property."

So you need:

if:
  # If the enable-method property contains one of those values
  properties:
    enable-method:
      contains:
        enum:
          - brcm,bcm11351-cpu-method
          - brcm,bcm23550
          - brcm,bcm-nsp-smp

  # and if enable method is present
  required:
    - enable-method

# Then we need secondary-boot-reg too
then:
  required:
    - secondary-boot-reg

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Maxime Ripard <maxime@cerno.tech>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org,
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
	<linux-rpi-kernel@lists.infradead.org>,
	Scott Branden <sbranden@broadcom.com>,
	Lubomir Rintel <lkundrak@v3.sk>,
	Sugaya Taichi <sugaya.taichi@socionext.com>,
	Ray Jui <rjui@broadcom.com>,
	open list <linux-kernel@vger.kernel.org>,
	Andrew Jeffery <andrew@aj.id.au>,
	Rob Herring <robh+dt@kernel.org>,
	"maintainer:BROADCOM IPROC ARM ARCHITECTURE"
	<bcm-kernel-feedback-list@broadcom.com>,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	Olof Johansson <olof@lixom.net>,
	linux-arm-kernel@vger.kernel.org,
	"moderated list:BROADCOM IPROC ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 11/12] dt-bindings: arm: Document Broadcom SoCs 'secondary-boot-reg'
Date: Tue, 4 Feb 2020 10:19:54 +0100	[thread overview]
Message-ID: <20200204091954.4zdxow4ijqnmvbdj@gilmour.lan> (raw)
In-Reply-To: <2744136e-a6e7-de19-4142-04f7edf0c6ea@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3649 bytes --]

On Mon, Feb 03, 2020 at 09:29:30PM -0800, Florian Fainelli wrote:
>
>
> On 2/3/2020 12:34 AM, Maxime Ripard wrote:
> > On Sun, Feb 02, 2020 at 01:18:26PM -0800, Florian Fainelli wrote:
> >> diff --git a/Documentation/devicetree/bindings/arm/cpus.yaml b/Documentation/devicetree/bindings/arm/cpus.yaml
> >> index c23c24ff7575..6f56a623c1cd 100644
> >> --- a/Documentation/devicetree/bindings/arm/cpus.yaml
> >> +++ b/Documentation/devicetree/bindings/arm/cpus.yaml
> >> @@ -272,6 +272,22 @@ properties:
> >>        While optional, it is the preferred way to get access to
> >>        the cpu-core power-domains.
> >>
> >> +  secondary-boot-reg:
> >> +    $ref: '/schemas/types.yaml#/definitions/uint32'
> >> +    description: |
> >> +      Required for systems that have an "enable-method" property value of
> >> +      "brcm,bcm11351-cpu-method", "brcm,bcm23550" or "brcm,bcm-nsp-smp".
> >> +
> >> +      This includes the following SoCs: |
> >> +      BCM11130, BCM11140, BCM11351, BCM28145, BCM28155, BCM21664, BCM23550
> >> +      BCM58522, BCM58525, BCM58535, BCM58622, BCM58623, BCM58625, BCM88312
> >> +
> >> +      The secondary-boot-reg property is a u32 value that specifies the
> >> +      physical address of the register used to request the ROM holding pen
> >> +      code release a secondary CPU. The value written to the register is
> >> +      formed by encoding the target CPU id into the low bits of the
> >> +      physical start address it should jump to.
> >> +
> >
> > You can make the requirement explicit (and enforced by the schemas) using:
> >
> > if:
> >   properties:
> >     enable-method:
> >       contains:
> >         enum:
> > 	  - brcm,bcm11351-cpu-method
> > 	  - brcm,bcm23550
> > 	  - brcm,bcm-nsp-smp
> >
> > then:
> >   required:
> >     - secondary-boot-reg
>
> Thanks! That was exactly what I was looking for, it seems to be matching
> a bit too greedily though:
>
>   DTC     arch/arm/boot/dts/bcm2836-rpi-2-b.dt.yaml
>   CHECK   arch/arm/boot/dts/bcm2836-rpi-2-b.dt.yaml
> /home/ff944844/dev/linux/arch/arm/boot/dts/bcm2836-rpi-2-b.dt.yaml:
> cpu@0: 'secondary-boot-reg' is a required property
> /home/ff944844/dev/linux/arch/arm/boot/dts/bcm2836-rpi-2-b.dt.yaml:
> cpu@1: 'secondary-boot-reg' is a required property
> /home/ff944844/dev/linux/arch/arm/boot/dts/bcm2836-rpi-2-b.dt.yaml:
> cpu@2: 'secondary-boot-reg' is a required property
> /home/ff944844/dev/linux/arch/arm/boot/dts/bcm2836-rpi-2-b.dt.yaml:
> cpu@3: 'secondary-boot-reg' is a required property
>   DTC     arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dt.yaml
>
> not sure why though as your example appears correct.

Yeah, sorry, that's on me :)

The nodes that are generating this error are the cpu@[0-3] ones, and
they don't have the enable-method property at all.

This is because if needs a schema, and will only try to validate the
schema under then if the one under if is valid.

The one under if contains a list of values for enable-method, but in
the case where enable-method is absent, the schema will be valid, and
thus the schema under then will be applied.

What we actually want to express is "if there's an enable-method
property, and that property contains those three values, then you need
to have a secondary-boot-reg property."

So you need:

if:
  # If the enable-method property contains one of those values
  properties:
    enable-method:
      contains:
        enum:
          - brcm,bcm11351-cpu-method
          - brcm,bcm23550
          - brcm,bcm-nsp-smp

  # and if enable method is present
  required:
    - enable-method

# Then we need secondary-boot-reg too
then:
  required:
    - secondary-boot-reg

Maxime

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-02-04  9:20 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-02 21:18 [PATCH 00/12] dt-bindings: arm: bcm: Convert boards to YAML Florian Fainelli
2020-02-02 21:18 ` Florian Fainelli
2020-02-02 21:18 ` [PATCH 01/12] dt-bindings: arm: bcm: Convert Cygnus " Florian Fainelli
2020-02-02 21:18   ` Florian Fainelli
2020-02-03  8:29   ` Maxime Ripard
2020-02-03  8:29     ` Maxime Ripard
2020-02-02 21:18 ` [PATCH 02/12] dt-bindings: arm: bcm: Convert Hurricane 2 " Florian Fainelli
2020-02-02 21:18   ` Florian Fainelli
2020-02-02 21:18 ` [PATCH 03/12] dt-bindings: arm: bcm: Convert Northstar Plus " Florian Fainelli
2020-02-02 21:18   ` Florian Fainelli
2020-02-02 21:18 ` [PATCH 04/12] dt-bindings: arm: bcm: Convert Northstar 2 " Florian Fainelli
2020-02-02 21:18   ` Florian Fainelli
2020-02-02 21:18 ` [PATCH 05/12] dt-bindings: arm: bcm: Convert Stingray " Florian Fainelli
2020-02-02 21:18   ` Florian Fainelli
2020-02-02 21:18 ` [PATCH 06/12] dt-bindings: arm: bcm: Convert BCM21664 " Florian Fainelli
2020-02-02 21:18   ` Florian Fainelli
2020-02-03  8:30   ` Maxime Ripard
2020-02-03  8:30     ` Maxime Ripard
2020-02-02 21:18 ` [PATCH 07/12] dt-bindings: arm: bcm: Convert BCM23550 " Florian Fainelli
2020-02-02 21:18   ` Florian Fainelli
2020-02-02 21:18 ` [PATCH 08/12] dt-bindings: arm: bcm: Convert BCM4708 " Florian Fainelli
2020-02-02 21:18   ` Florian Fainelli
2020-02-03  8:31   ` Maxime Ripard
2020-02-03  8:31     ` Maxime Ripard
2020-02-02 21:18 ` [PATCH 09/12] dt-bindings: arm: bcm: Convert BCM11351 " Florian Fainelli
2020-02-02 21:18   ` Florian Fainelli
2020-02-02 21:18 ` [PATCH 10/12] dt-bindings: arm: bcm: Convert Vulcan " Florian Fainelli
2020-02-02 21:18   ` Florian Fainelli
2020-02-02 21:30   ` Rob Herring
2020-02-02 21:30     ` Rob Herring
2020-02-02 21:18 ` [PATCH 11/12] dt-bindings: arm: Document Broadcom SoCs 'secondary-boot-reg' Florian Fainelli
2020-02-02 21:18   ` Florian Fainelli
2020-02-03  8:34   ` Maxime Ripard
2020-02-03  8:34     ` Maxime Ripard
2020-02-04  5:29     ` Florian Fainelli
2020-02-04  5:29       ` Florian Fainelli
2020-02-04  9:19       ` Maxime Ripard [this message]
2020-02-04  9:19         ` Maxime Ripard
2020-02-02 21:18 ` [PATCH 12/12] dt-bindings: arm: bcm: Convert BCM2835 firmware binding to YAML Florian Fainelli
2020-02-02 21:18   ` Florian Fainelli
2020-02-03 10:14   ` Rob Herring
2020-02-03 10:14     ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200204091954.4zdxow4ijqnmvbdj@gilmour.lan \
    --to=maxime@cerno.tech \
    --cc=andrew@aj.id.au \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-kernel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=lkundrak@v3.sk \
    --cc=mark.rutland@arm.com \
    --cc=nsaenzjulienne@suse.de \
    --cc=olof@lixom.net \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=sugaya.taichi@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.