1# SPDX-License-Identifier: Apache-2.0
2#
3# Copyright (c) 2023, Nordic Semiconductor ASA
4
5## A pykwalify schema for basic validation of the structure of a SoC
6## metadata YAML file.
7##
8# The soc.yml file is a simple list of key value pairs containing SoCs
9# located and the current structure level.
10schema;cpucluster-schema:
11  required: false
12  type: seq
13  sequence:
14    - type: map
15      mapping:
16        name:
17          required: true
18          type: str
19
20schema;soc-schema:
21  required: false
22  type: seq
23  sequence:
24    - type: map
25      mapping:
26        name:
27          required: true # Note: either name or extend is required, but that is handled in python
28          type: str
29        cpuclusters:
30          include: cpucluster-schema
31
32schema;soc-extend-schema:
33  required: false
34  type: seq
35  sequence:
36    - type: map
37      mapping:
38        name:
39          required: false # Note: either name or extend is required, but that is handled in python
40          type: str
41        extend:
42          required: false # Note: either name or extend is required, but that is handled in python
43          type: str
44        cpuclusters:
45          include: cpucluster-schema
46
47schema;series-schema:
48  required: false
49  type: seq
50  sequence:
51    - type: map
52      mapping:
53        name:
54          required: true
55          type: str
56        socs:
57          required: false
58          include: soc-schema
59
60type: map
61mapping:
62  family:
63    required: false
64    type: seq
65    sequence:
66      - type: map
67        mapping:
68          name:
69            required: true
70            type: str
71          series:
72            include: series-schema
73          socs:
74            include: soc-schema
75  series:
76    include: series-schema
77  socs:
78    include: soc-extend-schema
79  vendor:
80    required: false
81    type: str
82    desc: SoC series of the SoC.
83          This field is of informational use and can be used for filtering of SoCs.
84  comment:
85    required: false
86    type: str
87    desc: Free form comment with extra information regarding the SoC.
88  runners:
89    type: map
90    mapping:
91      priority:
92        type: int
93        desc: |
94              Priority of this flash run once configuration. The highest value data will be used
95              instead of any with lower priorities. If omitted, will default to 0.
96      run_once:
97        type: map
98        desc: |
99              Allows for restricting west flash commands when using sysbuild to run once per given
100              grouping of board targets. This is to allow for future image program cycles to not
101              erase the flash of a device which has just been programmed by another image.
102        mapping:
103          regex;(.*):
104            type: seq
105            desc: |
106                  A dictionary of commands which should be limited to running once per invocation
107                  of west flash for a given set of flash runners and board targets.
108            sequence:
109              - type: map
110                mapping:
111                  run:
112                    required: true
113                    type: str
114                    enum: ['first', 'last']
115                    desc: |
116                          If first, will run this command once when the first image is flashed, if
117                          last, will run this command once when the final image is flashed.
118                  runners:
119                    required: true
120                    type: seq
121                    sequence:
122                      - type: str
123                        desc: |
124                              A list of flash runners that this applies to, can use `all` to apply
125                              to all runners.
126                  groups:
127                    required: true
128                    type: seq
129                    sequence:
130                      - type: map
131                        desc: |
132                              A grouping of board targets which the command should apply to. Can
133                              be used multiple times to have multiple groups.
134                        mapping:
135                          qualifiers:
136                            required: true
137                            type: seq
138                            sequence:
139                              - type: str
140                                desc: |
141                                      A board qualifier to match against in regex form. Must be one
142                                      entry per board target, a single regex entry will not match
143                                      two board targets even if they both match.
144