diff mbox series

[v6,14/17] dt-bindings: arm: hisilicon: convert hisilicon,hip04-bootwrapper bindings to json-schema

Message ID 20200930031712.2365-15-thunder.leizhen@huawei.com
State New
Headers show
Series add support for Hisilicon SD5203 SoC | expand

Commit Message

Zhen Lei Sept. 30, 2020, 3:17 a.m. UTC
Convert the Hisilicon Bootwrapper boot method binding to DT schema format
using json-schema.

The property boot-method contains two groups of physical address range
information: bootwrapper and relocation. The "uint32-array" type is not
suitable for it, because the field "address" and "size" may occupy one or
two cells respectively. Use "minItems: 1" and "maxItems: 2" to allow it
can be written in "<addr size addr size>" or "<addr size>, <addr size>"
format.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

---
 .../hisilicon/controller/hip04-bootwrapper.yaml    | 34 ++++++++++++++++++++++
 .../controller/hisilicon,hip04-bootwrapper.txt     |  9 ------
 2 files changed, 34 insertions(+), 9 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/hisilicon/controller/hip04-bootwrapper.yaml
 delete mode 100644 Documentation/devicetree/bindings/arm/hisilicon/controller/hisilicon,hip04-bootwrapper.txt

-- 
1.8.3

Comments

Krzysztof Kozlowski Oct. 1, 2020, 6:41 a.m. UTC | #1
On Wed, Sep 30, 2020 at 11:17:09AM +0800, Zhen Lei wrote:
> Convert the Hisilicon Bootwrapper boot method binding to DT schema format

> using json-schema.

> 

> The property boot-method contains two groups of physical address range

> information: bootwrapper and relocation. The "uint32-array" type is not

> suitable for it, because the field "address" and "size" may occupy one or

> two cells respectively. Use "minItems: 1" and "maxItems: 2" to allow it

> can be written in "<addr size addr size>" or "<addr size>, <addr size>"

> format.

> 

> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

> ---

>  .../hisilicon/controller/hip04-bootwrapper.yaml    | 34 ++++++++++++++++++++++

>  .../controller/hisilicon,hip04-bootwrapper.txt     |  9 ------

>  2 files changed, 34 insertions(+), 9 deletions(-)

>  create mode 100644 Documentation/devicetree/bindings/arm/hisilicon/controller/hip04-bootwrapper.yaml

>  delete mode 100644 Documentation/devicetree/bindings/arm/hisilicon/controller/hisilicon,hip04-bootwrapper.txt

> 

> diff --git a/Documentation/devicetree/bindings/arm/hisilicon/controller/hip04-bootwrapper.yaml b/Documentation/devicetree/bindings/arm/hisilicon/controller/hip04-bootwrapper.yaml

> new file mode 100644

> index 000000000000000..7378159e61df998

> --- /dev/null

> +++ b/Documentation/devicetree/bindings/arm/hisilicon/controller/hip04-bootwrapper.yaml

> @@ -0,0 +1,34 @@

> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

> +%YAML 1.2

> +---

> +$id: http://devicetree.org/schemas/arm/hisilicon/controller/hip04-bootwrapper.yaml#

> +$schema: http://devicetree.org/meta-schemas/core.yaml#

> +

> +title: Bootwrapper boot method

> +

> +maintainers:

> +  - Wei Xu <xuwei5@hisilicon.com>

> +

> +description: Bootwrapper boot method (software protocol on SMP)

> +

> +properties:

> +  compatible:

> +    items:

> +      - const: hisilicon,hip04-bootwrapper

> +

> +  boot-method:

> +    description: |

> +      Address and size of boot method.

> +      [0]: bootwrapper physical address

> +      [1]: bootwrapper size

> +      [2]: relocation physical address

> +      [3]: relocation size


Intead: items with each item description (bootwrapper address,
relocation address). This way also min/max Items should not be needed.

Best regards,
Krzysztof


> +    minItems: 1

> +    maxItems: 2

> +
Zhen Lei Oct. 10, 2020, 10:07 a.m. UTC | #2
On 2020/10/1 14:41, Krzysztof Kozlowski wrote:
> On Wed, Sep 30, 2020 at 11:17:09AM +0800, Zhen Lei wrote:

>> Convert the Hisilicon Bootwrapper boot method binding to DT schema format

>> using json-schema.

>>

>> The property boot-method contains two groups of physical address range

>> information: bootwrapper and relocation. The "uint32-array" type is not

>> suitable for it, because the field "address" and "size" may occupy one or

>> two cells respectively. Use "minItems: 1" and "maxItems: 2" to allow it

>> can be written in "<addr size addr size>" or "<addr size>, <addr size>"

>> format.

>>

>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

>> ---

>>  .../hisilicon/controller/hip04-bootwrapper.yaml    | 34 ++++++++++++++++++++++

>>  .../controller/hisilicon,hip04-bootwrapper.txt     |  9 ------

>>  2 files changed, 34 insertions(+), 9 deletions(-)

>>  create mode 100644 Documentation/devicetree/bindings/arm/hisilicon/controller/hip04-bootwrapper.yaml

>>  delete mode 100644 Documentation/devicetree/bindings/arm/hisilicon/controller/hisilicon,hip04-bootwrapper.txt

>>

>> diff --git a/Documentation/devicetree/bindings/arm/hisilicon/controller/hip04-bootwrapper.yaml b/Documentation/devicetree/bindings/arm/hisilicon/controller/hip04-bootwrapper.yaml

>> new file mode 100644

>> index 000000000000000..7378159e61df998

>> --- /dev/null

>> +++ b/Documentation/devicetree/bindings/arm/hisilicon/controller/hip04-bootwrapper.yaml

>> @@ -0,0 +1,34 @@

>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

>> +%YAML 1.2

>> +---

>> +$id: http://devicetree.org/schemas/arm/hisilicon/controller/hip04-bootwrapper.yaml#

>> +$schema: http://devicetree.org/meta-schemas/core.yaml#

>> +

>> +title: Bootwrapper boot method

>> +

>> +maintainers:

>> +  - Wei Xu <xuwei5@hisilicon.com>

>> +

>> +description: Bootwrapper boot method (software protocol on SMP)

>> +

>> +properties:

>> +  compatible:

>> +    items:

>> +      - const: hisilicon,hip04-bootwrapper

>> +

>> +  boot-method:

>> +    description: |

>> +      Address and size of boot method.

>> +      [0]: bootwrapper physical address

>> +      [1]: bootwrapper size

>> +      [2]: relocation physical address

>> +      [3]: relocation size

> 

> Intead: items with each item description (bootwrapper address,

> relocation address). This way also min/max Items should not be needed.


I think it's needed. "reg" also specifies maxItems.

> 

> Best regards,

> Krzysztof

> 

> 

>> +    minItems: 1

>> +    maxItems: 2

>> +

> 

> .

>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/arm/hisilicon/controller/hip04-bootwrapper.yaml b/Documentation/devicetree/bindings/arm/hisilicon/controller/hip04-bootwrapper.yaml
new file mode 100644
index 000000000000000..7378159e61df998
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/hisilicon/controller/hip04-bootwrapper.yaml
@@ -0,0 +1,34 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/hisilicon/controller/hip04-bootwrapper.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bootwrapper boot method
+
+maintainers:
+  - Wei Xu <xuwei5@hisilicon.com>
+
+description: Bootwrapper boot method (software protocol on SMP)
+
+properties:
+  compatible:
+    items:
+      - const: hisilicon,hip04-bootwrapper
+
+  boot-method:
+    description: |
+      Address and size of boot method.
+      [0]: bootwrapper physical address
+      [1]: bootwrapper size
+      [2]: relocation physical address
+      [3]: relocation size
+    minItems: 1
+    maxItems: 2
+
+required:
+  - compatible
+  - boot-method
+
+additionalProperties: false
+...
diff --git a/Documentation/devicetree/bindings/arm/hisilicon/controller/hisilicon,hip04-bootwrapper.txt b/Documentation/devicetree/bindings/arm/hisilicon/controller/hisilicon,hip04-bootwrapper.txt
deleted file mode 100644
index b0d53333f4fdae1..000000000000000
--- a/Documentation/devicetree/bindings/arm/hisilicon/controller/hisilicon,hip04-bootwrapper.txt
+++ /dev/null
@@ -1,9 +0,0 @@ 
-Bootwrapper boot method (software protocol on SMP):
-
-Required Properties:
-- compatible: "hisilicon,hip04-bootwrapper";
-- boot-method: Address and size of boot method.
-  [0]: bootwrapper physical address
-  [1]: bootwrapper size
-  [2]: relocation physical address
-  [3]: relocation size