ipq807x: add Qualcomm Atheros IPQ807x target
[openwrt/staging/nbd.git] / target / linux / ipq807x / patches-5.15 / 0079-v6.2-dt-bindings-arm-qcom-document-qcom-msm-id-and-qcom-b.patch
1 From 77faa07c185c969e742cbb3e6aa487a11b0b616c Mon Sep 17 00:00:00 2001
2 From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 Date: Tue, 30 Aug 2022 09:57:42 +0300
4 Subject: [PATCH] dt-bindings: arm: qcom: document qcom,msm-id and
5 qcom,board-id
6
7 The top level qcom,msm-id and qcom,board-id properties are utilized by
8 bootloaders on Qualcomm MSM platforms to determine which device tree
9 should be used and passed to the kernel.
10
11 The commit b32e592d3c28 ("devicetree: bindings: Document qcom board
12 compatible format") from 2015 was a consensus during discussion about
13 upstreaming qcom,msm-id and qcom,board-id fields. There are however still
14 problems with that consensus:
15 1. It was reached 7 years ago but it turned out its implementation did
16 not reach all possible products.
17
18 2. Initially additional tool (dtbTool) was needed for parsing these
19 fields to create a QCDT image consisting of multiple DTBs, later the
20 bootloaders were improved and they use these qcom,msm-id and
21 qcom,board-id properties directly.
22
23 3. Extracting relevant information from the board compatible requires
24 this additional tool (dtbTool), which makes the build process more
25 complicated and not easily reproducible (DTBs are modified after the
26 kernel build).
27
28 4. Some versions of Qualcomm bootloaders expect these properties even
29 when booting with a single DTB. The community is stuck with these
30 bootloaders thus they require properties in the DTBs.
31
32 Since several upstreamed Qualcomm SoC-based boards require these
33 properties to properly boot and the properties are reportedly used by
34 bootloaders, document them along with the bindings header with constants
35 used by: bootloader, some DTS and socinfo driver.
36
37 Link: https://lore.kernel.org/r/a3c932d1-a102-ce18-deea-18cbbd05ecab@linaro.org/
38 Co-developed-by: Kumar Gala <galak@codeaurora.org>
39 Signed-off-by: Kumar Gala <galak@codeaurora.org>
40 Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
41 Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
42 Reviewed-by: Rob Herring <robh@kernel.org>
43 Signed-off-by: Bjorn Andersson <andersson@kernel.org>
44 Link: https://lore.kernel.org/r/20220830065744.161163-2-krzysztof.kozlowski@linaro.org
45 ---
46 include/dt-bindings/arm/qcom,ids.h | 155 +++++++++++++++++++++++++++++
47 1 file changed, 155 insertions(+)
48 create mode 100644 include/dt-bindings/arm/qcom,ids.h
49
50 --- /dev/null
51 +++ b/include/dt-bindings/arm/qcom,ids.h
52 @@ -0,0 +1,155 @@
53 +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
54 +/*
55 + * Copyright (c) 2015, The Linux Foundation. All rights reserved.
56 + * Copyright (c) 2022 Linaro Ltd
57 + * Author: Krzysztof Kozlowski <krzk@kernel.org> based on previous work of Kumar Gala.
58 + */
59 +#ifndef _DT_BINDINGS_ARM_QCOM_IDS_H
60 +#define _DT_BINDINGS_ARM_QCOM_IDS_H
61 +
62 +/*
63 + * The MSM chipset and hardware revision used by Qualcomm bootloaders, DTS for
64 + * older chipsets (qcom,msm-id) and in socinfo driver:
65 + */
66 +#define QCOM_ID_MSM8960 87
67 +#define QCOM_ID_APQ8064 109
68 +#define QCOM_ID_MSM8660A 122
69 +#define QCOM_ID_MSM8260A 123
70 +#define QCOM_ID_APQ8060A 124
71 +#define QCOM_ID_MSM8974 126
72 +#define QCOM_ID_MPQ8064 130
73 +#define QCOM_ID_MSM8960AB 138
74 +#define QCOM_ID_APQ8060AB 139
75 +#define QCOM_ID_MSM8260AB 140
76 +#define QCOM_ID_MSM8660AB 141
77 +#define QCOM_ID_MSM8626 145
78 +#define QCOM_ID_MSM8610 147
79 +#define QCOM_ID_APQ8064AB 153
80 +#define QCOM_ID_MSM8226 158
81 +#define QCOM_ID_MSM8526 159
82 +#define QCOM_ID_MSM8110 161
83 +#define QCOM_ID_MSM8210 162
84 +#define QCOM_ID_MSM8810 163
85 +#define QCOM_ID_MSM8212 164
86 +#define QCOM_ID_MSM8612 165
87 +#define QCOM_ID_MSM8112 166
88 +#define QCOM_ID_MSM8225Q 168
89 +#define QCOM_ID_MSM8625Q 169
90 +#define QCOM_ID_MSM8125Q 170
91 +#define QCOM_ID_APQ8064AA 172
92 +#define QCOM_ID_APQ8084 178
93 +#define QCOM_ID_APQ8074 184
94 +#define QCOM_ID_MSM8274 185
95 +#define QCOM_ID_MSM8674 186
96 +#define QCOM_ID_MSM8974PRO_AC 194
97 +#define QCOM_ID_MSM8126 198
98 +#define QCOM_ID_APQ8026 199
99 +#define QCOM_ID_MSM8926 200
100 +#define QCOM_ID_MSM8326 205
101 +#define QCOM_ID_MSM8916 206
102 +#define QCOM_ID_MSM8994 207
103 +#define QCOM_ID_APQ8074PRO_AA 208
104 +#define QCOM_ID_APQ8074PRO_AB 209
105 +#define QCOM_ID_APQ8074PRO_AC 210
106 +#define QCOM_ID_MSM8274PRO_AA 211
107 +#define QCOM_ID_MSM8274PRO_AB 212
108 +#define QCOM_ID_MSM8274PRO_AC 213
109 +#define QCOM_ID_MSM8674PRO_AA 214
110 +#define QCOM_ID_MSM8674PRO_AB 215
111 +#define QCOM_ID_MSM8674PRO_AC 216
112 +#define QCOM_ID_MSM8974PRO_AA 217
113 +#define QCOM_ID_MSM8974PRO_AB 218
114 +#define QCOM_ID_APQ8028 219
115 +#define QCOM_ID_MSM8128 220
116 +#define QCOM_ID_MSM8228 221
117 +#define QCOM_ID_MSM8528 222
118 +#define QCOM_ID_MSM8628 223
119 +#define QCOM_ID_MSM8928 224
120 +#define QCOM_ID_MSM8510 225
121 +#define QCOM_ID_MSM8512 226
122 +#define QCOM_ID_MSM8936 233
123 +#define QCOM_ID_MSM8939 239
124 +#define QCOM_ID_APQ8036 240
125 +#define QCOM_ID_APQ8039 241
126 +#define QCOM_ID_MSM8996 246
127 +#define QCOM_ID_APQ8016 247
128 +#define QCOM_ID_MSM8216 248
129 +#define QCOM_ID_MSM8116 249
130 +#define QCOM_ID_MSM8616 250
131 +#define QCOM_ID_MSM8992 251
132 +#define QCOM_ID_APQ8094 253
133 +#define QCOM_ID_MDM9607 290
134 +#define QCOM_ID_APQ8096 291
135 +#define QCOM_ID_MSM8998 292
136 +#define QCOM_ID_MSM8953 293
137 +#define QCOM_ID_MDM8207 296
138 +#define QCOM_ID_MDM9207 297
139 +#define QCOM_ID_MDM9307 298
140 +#define QCOM_ID_MDM9628 299
141 +#define QCOM_ID_APQ8053 304
142 +#define QCOM_ID_MSM8996SG 305
143 +#define QCOM_ID_MSM8996AU 310
144 +#define QCOM_ID_APQ8096AU 311
145 +#define QCOM_ID_APQ8096SG 312
146 +#define QCOM_ID_SDM660 317
147 +#define QCOM_ID_SDM630 318
148 +#define QCOM_ID_APQ8098 319
149 +#define QCOM_ID_SDM845 321
150 +#define QCOM_ID_MDM9206 322
151 +#define QCOM_ID_IPQ8074 323
152 +#define QCOM_ID_SDA660 324
153 +#define QCOM_ID_SDM658 325
154 +#define QCOM_ID_SDA658 326
155 +#define QCOM_ID_SDA630 327
156 +#define QCOM_ID_SDM450 338
157 +#define QCOM_ID_SDA845 341
158 +#define QCOM_ID_IPQ8072 342
159 +#define QCOM_ID_IPQ8076 343
160 +#define QCOM_ID_IPQ8078 344
161 +#define QCOM_ID_SDM636 345
162 +#define QCOM_ID_SDA636 346
163 +#define QCOM_ID_SDM632 349
164 +#define QCOM_ID_SDA632 350
165 +#define QCOM_ID_SDA450 351
166 +#define QCOM_ID_SM8250 356
167 +#define QCOM_ID_IPQ8070 375
168 +#define QCOM_ID_IPQ8071 376
169 +#define QCOM_ID_IPQ8072A 389
170 +#define QCOM_ID_IPQ8074A 390
171 +#define QCOM_ID_IPQ8076A 391
172 +#define QCOM_ID_IPQ8078A 392
173 +#define QCOM_ID_SM6125 394
174 +#define QCOM_ID_IPQ8070A 395
175 +#define QCOM_ID_IPQ8071A 396
176 +#define QCOM_ID_IPQ6018 402
177 +#define QCOM_ID_IPQ6028 403
178 +#define QCOM_ID_IPQ6000 421
179 +#define QCOM_ID_IPQ6010 422
180 +#define QCOM_ID_SC7180 425
181 +#define QCOM_ID_SM6350 434
182 +#define QCOM_ID_SM8350 439
183 +#define QCOM_ID_SC8280XP 449
184 +#define QCOM_ID_IPQ6005 453
185 +#define QCOM_ID_QRB5165 455
186 +#define QCOM_ID_SM8450 457
187 +#define QCOM_ID_SM7225 459
188 +#define QCOM_ID_SA8295P 460
189 +#define QCOM_ID_SA8540P 461
190 +#define QCOM_ID_SM8450_2 480
191 +#define QCOM_ID_SM8450_3 482
192 +#define QCOM_ID_SC7280 487
193 +#define QCOM_ID_SC7180P 495
194 +#define QCOM_ID_SM6375 507
195 +
196 +/*
197 + * The board type and revision information, used by Qualcomm bootloaders and
198 + * DTS for older chipsets (qcom,board-id):
199 + */
200 +#define QCOM_BOARD_ID(a, major, minor) \
201 + (((major & 0xff) << 16) | ((minor & 0xff) << 8) | QCOM_BOARD_ID_##a)
202 +
203 +#define QCOM_BOARD_ID_MTP 8
204 +#define QCOM_BOARD_ID_DRAGONBOARD 10
205 +#define QCOM_BOARD_ID_SBC 24
206 +
207 +#endif /* _DT_BINDINGS_ARM_QCOM_IDS_H */