forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/soc/actions/owl-sps.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0+
12 /*
23 * Actions Semi Owl Smart Power System (SPS)
34 *
....@@ -5,11 +6,6 @@
56 * Author: Actions Semi, Inc.
67 *
78 * Copyright (c) 2017 Andreas Färber
8
- *
9
- * This program is free software; you can redistribute it and/or modify it
10
- * under the terms of the GNU General Public License as published by the
11
- * Free Software Foundation; either version 2 of the License, or (at your
12
- * option) any later version.
139 */
1410
1511 #include <linux/of_address.h>
....@@ -18,6 +14,7 @@
1814 #include <linux/soc/actions/owl-sps.h>
1915 #include <dt-bindings/power/owl-s500-powergate.h>
2016 #include <dt-bindings/power/owl-s700-powergate.h>
17
+#include <dt-bindings/power/owl-s900-powergate.h>
2118
2219 struct owl_sps_domain_info {
2320 const char *name;
....@@ -244,9 +241,66 @@
244241 .domains = s700_sps_domains,
245242 };
246243
244
+static const struct owl_sps_domain_info s900_sps_domains[] = {
245
+ [S900_PD_GPU_B] = {
246
+ .name = "GPU_B",
247
+ .pwr_bit = 3,
248
+ },
249
+ [S900_PD_VCE] = {
250
+ .name = "VCE",
251
+ .pwr_bit = 4,
252
+ },
253
+ [S900_PD_SENSOR] = {
254
+ .name = "SENSOR",
255
+ .pwr_bit = 5,
256
+ },
257
+ [S900_PD_VDE] = {
258
+ .name = "VDE",
259
+ .pwr_bit = 6,
260
+ },
261
+ [S900_PD_HDE] = {
262
+ .name = "HDE",
263
+ .pwr_bit = 7,
264
+ },
265
+ [S900_PD_USB3] = {
266
+ .name = "USB3",
267
+ .pwr_bit = 8,
268
+ },
269
+ [S900_PD_DDR0] = {
270
+ .name = "DDR0",
271
+ .pwr_bit = 9,
272
+ },
273
+ [S900_PD_DDR1] = {
274
+ .name = "DDR1",
275
+ .pwr_bit = 10,
276
+ },
277
+ [S900_PD_DE] = {
278
+ .name = "DE",
279
+ .pwr_bit = 13,
280
+ },
281
+ [S900_PD_NAND] = {
282
+ .name = "NAND",
283
+ .pwr_bit = 14,
284
+ },
285
+ [S900_PD_USB2_H0] = {
286
+ .name = "USB2_H0",
287
+ .pwr_bit = 15,
288
+ },
289
+ [S900_PD_USB2_H1] = {
290
+ .name = "USB2_H1",
291
+ .pwr_bit = 16,
292
+ },
293
+};
294
+
295
+static const struct owl_sps_info s900_sps_info = {
296
+ .num_domains = ARRAY_SIZE(s900_sps_domains),
297
+ .domains = s900_sps_domains,
298
+};
299
+
247300 static const struct of_device_id owl_sps_of_matches[] = {
248301 { .compatible = "actions,s500-sps", .data = &s500_sps_info },
249302 { .compatible = "actions,s700-sps", .data = &s700_sps_info },
303
+ { .compatible = "actions,s900-sps", .data = &s900_sps_info },
250304 { }
251305 };
252306