1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
|
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
#include <linux/string.h>
#include <linux/aee.h>
#include <linux/i2c.h>
#include <linux/of_fdt.h>
#include <asm/setup.h>
#include <linux/lockdep.h>
#ifndef CONFIG_ARM64
#include <mach/irqs.h>
#else
#include <linux/irqchip/mt-gic.h>
#endif
#include <mach/mt_cirq.h>
#include <mach/mt_spm_sleep.h>
#include <mach/mt_clkmgr.h>
#include <mach/mt_cpuidle.h>
#include <mach/wd_api.h>
#include <mach/eint.h>
#include <mach/mtk_ccci_helper.h>
#include <mach/mt_cpufreq.h>
#include <mach/upmu_common.h>
#ifdef CONFIG_MD32_SUPPORT
#include <mach/md32_helper.h>
#endif
#include "mach/mt_pmic_wrap.h"
#if 0
#include <cust_gpio_usage.h>
#endif
//FIXME: for K2 fpga early porting
#if 0
#include <mach/mt_dramc.h>
#endif
#include <mt_i2c.h>
#include "mt_spm_internal.h"
#include "../../pmic_wrap/mt6735/pwrap_hal.h"
#include <mach/upmu_common.h>
#include <mach/upmu_sw.h>
#include <mach/upmu_hw.h>
#include <mach/mt_vcore_dvfs.h>
#include <mach/mt_dramc.h>
// for MP0,1 AXI_CONFIG
#ifdef CONFIG_OF
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/of_address.h>
#endif
#include <mach/mt_secure_api.h>
/**************************************
* only for internal debug
**************************************/
#ifdef CONFIG_MTK_LDVT
#define SPM_PWAKE_EN 0
#define SPM_PCMWDT_EN 0
#define SPM_BYPASS_SYSPWREQ 1
#else
#define SPM_PWAKE_EN 1
#define SPM_PCMWDT_EN 1
#define SPM_BYPASS_SYSPWREQ 0
#endif
#define SPM_PCMTIMER_DIS 0
#if defined(CONFIG_ARCH_MT6753)
#include <mach/hotplug.h>
#else
#define K2_MCUCFG_BASE (0xF0200000) //0x1020_0000
#define MP0_AXI_CONFIG (K2_MCUCFG_BASE + 0x2C)
#define MP1_AXI_CONFIG (K2_MCUCFG_BASE + 0x22C)
#define ACINACTM (1<<4)
#endif
#define I2C_CHANNEL 2
int spm_dormant_sta = MT_CPU_DORMANT_RESET;
int spm_ap_mdsrc_req_cnt = 0;
u32 spm_suspend_flag = 0;
struct wake_status suspend_info[20];
u32 log_wakesta_cnt = 0;
u32 log_wakesta_index = 0;
u8 spm_snapshot_golden_setting = 0;
/**********************************************************
* PCM code for suspend
**********************************************************/
#if defined(CONFIG_ARCH_MT6735)
static const u32 suspend_binary[] = {
0x81429801, 0xd80001e5, 0x17c07c1f, 0x18c0001f, 0x10001138, 0x1910001f,
0x10001138, 0xa1108404, 0xe0c00004, 0x1910001f, 0x10001138, 0x1a00001f,
0x10006604, 0xc0c03de0, 0xe2200007, 0x1a00001f, 0x100062c4, 0x1890001f,
0x100062c4, 0xa0940402, 0x1b00001f, 0x10000001, 0x1910001f, 0x10006310,
0x80c39001, 0xd8200443, 0xe2000002, 0x80c10001, 0x1b00001f, 0xbf7ce7ff,
0xd8200443, 0x17c07c1f, 0x1b00001f, 0x7f7ce7ff, 0xf0000000, 0x17c07c1f,
0x81429801, 0xd8000665, 0x17c07c1f, 0x18c0001f, 0x10001138, 0x1910001f,
0x10001138, 0x81308404, 0xe0c00004, 0x1910001f, 0x10001138, 0x1a00001f,
0x10006604, 0xc0c03de0, 0xe2200007, 0x1a00001f, 0x100062c4, 0x1890001f,
0x100062c4, 0x80b40402, 0x1b00001f, 0x00801001, 0x1910001f, 0x10006310,
0x80c39001, 0xd82008c3, 0xe2000002, 0x80c10001, 0x1b00001f, 0x6ffcf7ff,
0xd80008c3, 0x17c07c1f, 0x1b00001f, 0xaffce7ff, 0xf0000000, 0x17c07c1f,
0x81f58407, 0x81f68407, 0x1800001f, 0x17cf0f3f, 0x1b80001f, 0x20000000,
0x1800001f, 0x17cf0f16, 0xa1d28407, 0x81f20407, 0x81409801, 0xd8000b25,
0x17c07c1f, 0x18c0001f, 0x10006234, 0xc0c02960, 0x1200041f, 0x80310400,
0x1b80001f, 0x2000000a, 0xa0110400, 0x81f00407, 0xa1dd0407, 0x18c0001f,
0x100062d8, 0xc0c02c20, 0x1200041f, 0x81fd0407, 0xc2803ec0, 0x1290041f,
0x1b00001f, 0x6ffcf7ff, 0xf0000000, 0x17c07c1f, 0x1b00001f, 0x2f7ce7ff,
0x1b80001f, 0x20000004, 0xd80013ec, 0x17c07c1f, 0x1880001f, 0x10006320,
0xc0c02f40, 0xe080000f, 0xd8200f43, 0x17c07c1f, 0x1b00001f, 0x6ffcf7ff,
0xd00013e0, 0x17c07c1f, 0xe080001f, 0x81409801, 0xd80011c5, 0x17c07c1f,
0x18c0001f, 0x10214094, 0x1910001f, 0x1020e374, 0xe0c00004, 0x18c0001f,
0x10214098, 0x1910001f, 0x1020e378, 0xe0c00004, 0x1910001f, 0x10213378,
0x18c0001f, 0x10006234, 0xc0c02b40, 0x17c07c1f, 0x18c0001f, 0x100062d8,
0xc0c02d40, 0x17c07c1f, 0xc2803ec0, 0x1290841f, 0xa1d20407, 0x81f28407,
0xa1d68407, 0x1800001f, 0x17cf0f3f, 0x1800001f, 0x17ff0f3f, 0x19c0001f,
0x001c2397, 0x1b00001f, 0x2f7cefff, 0xf0000000, 0x17c07c1f, 0x1910001f,
0x102135cc, 0x81411801, 0xd8001585, 0x17c07c1f, 0x18c0001f, 0x10006240,
0xe0e00016, 0xe0e0001e, 0xe0e0000e, 0xe0e0000f, 0x803e0400, 0x1b80001f,
0x20000222, 0x80380400, 0x1b80001f, 0x20000280, 0x803b0400, 0x1b80001f,
0x2000001a, 0x803d0400, 0x1b80001f, 0x20000208, 0x80340400, 0x80310400,
0xe8208000, 0x10210044, 0x00000100, 0x1b80001f, 0x20000068, 0x1b80001f,
0x2000000a, 0x18c0001f, 0x10006240, 0xe0e0000d, 0xd8001c45, 0x17c07c1f,
0x1b80001f, 0x20000020, 0x18c0001f, 0x102130f0, 0x1910001f, 0x102130f0,
0xa9000004, 0x10000000, 0xe0c00004, 0x1b80001f, 0x2000000a, 0x89000004,
0xefffffff, 0xe0c00004, 0x18c0001f, 0x102140f4, 0x1910001f, 0x102140f4,
0xa9000004, 0x02000000, 0xe0c00004, 0x1b80001f, 0x2000000a, 0x89000004,
0xfdffffff, 0xe0c00004, 0x1910001f, 0x102140f4, 0x81fa0407, 0x81f08407,
0xe8208000, 0x10006354, 0x001fdaa3, 0xa9c00007, 0x60010000, 0xc2803ec0,
0x1291041f, 0x1b00001f, 0xbf7ce7ff, 0x1950001f, 0x100062c4, 0x80c41401,
0xd8001e83, 0x17c07c1f, 0x1b00001f, 0xaffce7ff, 0xf0000000, 0x17c07c1f,
0x1b80001f, 0x20000fdf, 0x1a50001f, 0x10006608, 0x80c9a401, 0x810ba401,
0x10920c1f, 0xa0979002, 0x80ca2401, 0xa0938c02, 0x8080080d, 0xd82022e2,
0x17c07c1f, 0x81f08407, 0xa9c00007, 0x60010000, 0x1b00001f, 0x2f7ce7ff,
0x1b80001f, 0x20000004, 0xd800292c, 0x17c07c1f, 0x1b00001f, 0xbf7ce7ff,
0x1950001f, 0x100062c4, 0x80c41401, 0xd8002923, 0x17c07c1f, 0x1b00001f,
0xaffce7ff, 0xd0002920, 0x17c07c1f, 0x89c00007, 0x9ffeffff, 0x1900001f,
0x40000000, 0x18d0001f, 0x40000000, 0xe1000003, 0xc0c03060, 0x1080041f,
0x1880001f, 0x10006320, 0xc0c02de0, 0xe080000f, 0xd8002063, 0x17c07c1f,
0xe080001f, 0xa1da0407, 0xe8208000, 0x10210048, 0x00000100, 0x1b80001f,
0x20000068, 0xa0110400, 0xa0140400, 0xa0180400, 0xa01b0400, 0xa01d0400,
0x1b80001f, 0x20000068, 0xa01e0400, 0x1b80001f, 0x20000104, 0x81411801,
0xd80027c5, 0x17c07c1f, 0x18c0001f, 0x10006240, 0xc0c02d40, 0x17c07c1f,
0xc2803ec0, 0x1291841f, 0x1b00001f, 0x6ffcf7ff, 0x1950001f, 0x100062c4,
0x80c41401, 0xd8202923, 0x17c07c1f, 0x1b00001f, 0x7f7ce7ff, 0xf0000000,
0x17c07c1f, 0xe0f07f16, 0x1380201f, 0xe0f07f1e, 0x1380201f, 0xe0f07f0e,
0x1b80001f, 0x20000100, 0xe0f07f0c, 0xe0f07f0d, 0xe0f07e0d, 0xe0f07c0d,
0xe0f0780d, 0xe0f0700d, 0xf0000000, 0x17c07c1f, 0xe0f07f0d, 0xe0f07f1d,
0xe0f07f1f, 0xe0f07f1e, 0xe0f07f12, 0xf0000000, 0x17c07c1f, 0xe0e00016,
0x1380201f, 0xe0e0001e, 0x1380201f, 0xe0e0000e, 0xe0e0000c, 0xe0e0000d,
0xf0000000, 0x17c07c1f, 0xe0e0000f, 0xe0e0001e, 0xe0e00012, 0xf0000000,
0x17c07c1f, 0x1112841f, 0xa1d08407, 0xd8202ea4, 0x80eab401, 0xd8002e23,
0x01200404, 0x1a00001f, 0x10006814, 0xe2000003, 0xf0000000, 0x17c07c1f,
0xa1d00407, 0x1b80001f, 0x20000100, 0x80ea3401, 0x1a00001f, 0x10006814,
0xe2000003, 0xf0000000, 0x17c07c1f, 0x81499801, 0xd82031c5, 0x17c07c1f,
0xd82036e2, 0x17c07c1f, 0x18d0001f, 0x40000000, 0x18d0001f, 0x70000000,
0xd80030c2, 0x00a00402, 0x814a1801, 0xd8203325, 0x17c07c1f, 0xd82036e2,
0x17c07c1f, 0x18d0001f, 0x40000000, 0x18d0001f, 0x80000000, 0xd8003222,
0x00a00402, 0x814a9801, 0xd8203485, 0x17c07c1f, 0xd82036e2, 0x17c07c1f,
0x18d0001f, 0x40000000, 0x18d0001f, 0xc0000000, 0xd8003382, 0x00a00402,
0x814c1801, 0xd82035e5, 0x17c07c1f, 0xd82036e2, 0x17c07c1f, 0x18d0001f,
0x40000000, 0x18d0001f, 0xa0000000, 0xd80034e2, 0x00a00402, 0xd82036e2,
0x17c07c1f, 0x18d0001f, 0x40000000, 0x18d0001f, 0x40000000, 0xd80035e2,
0x00a00402, 0xf0000000, 0x17c07c1f, 0x81441801, 0xd8203945, 0x17c07c1f,
0x1a00001f, 0x10006604, 0xc0c03de0, 0xe2200004, 0xc0c03060, 0x1092041f,
0xc0c03de0, 0xe2200003, 0xc0c03060, 0x1092041f, 0xc0c03de0, 0xe2200002,
0xc0c03060, 0x1092041f, 0x1a00001f, 0x100062c4, 0x1890001f, 0x100062c4,
0xa0908402, 0xe2000002, 0x1b00001f, 0x00801001, 0xf0000000, 0x17c07c1f,
0x1a00001f, 0x100062c4, 0x1890001f, 0x100062c4, 0x80b08402, 0xe2000002,
0x81441801, 0xd8203d65, 0x17c07c1f, 0x1a00001f, 0x10006604, 0xc0c03de0,
0xe2200003, 0xc0c03060, 0x1092041f, 0xc0c03de0, 0xe2200004, 0xc0c03060,
0x1092041f, 0xc0c03de0, 0xe2200005, 0xc0c03060, 0x1092041f, 0x1b00001f,
0x00000801, 0xf0000000, 0x17c07c1f, 0x18d0001f, 0x10006604, 0x10cf8c1f,
0xd8203de3, 0x17c07c1f, 0xf0000000, 0x17c07c1f, 0x18c0001f, 0x10006b18,
0x1910001f, 0x10006b18, 0xa1002804, 0xe0c00004, 0xf0000000, 0x17c07c1f,
0x17c07c1f, 0x17c07c1f, 0x1840001f, 0x00000001, 0xa1d48407, 0x1990001f,
0x10006b08, 0xe8208000, 0x10006b18, 0x00000000, 0x81441801, 0xd8204565,
0x17c07c1f, 0x1910001f, 0x100062c4, 0x80849001, 0x1a00001f, 0x10006b0c,
0x1950001f, 0x10006b0c, 0xa1508805, 0xe2000005, 0x18c0001f, 0x2f7ce7ff,
0x80809001, 0x81600801, 0xa0d59403, 0xa0d60803, 0xd8004465, 0x17c07c1f,
0x80841001, 0x81600801, 0xa0db9403, 0xa0de0803, 0xd8004465, 0x17c07c1f,
0x80f60403, 0xe8208000, 0x10006310, 0x0b160c38, 0x13000c1f, 0x1b80001f,
0xd00f0000, 0xd00045a0, 0x17c07c1f, 0x1b00001f, 0x2f7ce7ff, 0x81469801,
0xd8204705, 0x17c07c1f, 0x1b80001f, 0xd00f0000, 0x8880000c, 0x2f7ce7ff,
0xd80069a2, 0x17c07c1f, 0xd0004740, 0x17c07c1f, 0x1b80001f, 0x500f0000,
0xe8208000, 0x10006354, 0x001fdaa3, 0xc0c078c0, 0x81401801, 0xd8004c65,
0x17c07c1f, 0x81f60407, 0x18c0001f, 0x10006200, 0xc0c07740, 0x12807c1f,
0xe8208000, 0x1000625c, 0x00000001, 0x1b80001f, 0x20000080, 0xc0c07740,
0x1280041f, 0x18c0001f, 0x10006208, 0xc0c07740, 0x12807c1f, 0xe8208000,
0x10006244, 0x00000001, 0x1b80001f, 0x20000080, 0xc0c07740, 0x1280041f,
0x18c0001f, 0x10006290, 0xc0c07740, 0x12807c1f, 0xc0c07740, 0x1280041f,
0x18c0001f, 0x100062dc, 0xe0c00001, 0xc2803ec0, 0x1292041f, 0x81469801,
0xd8004d45, 0x17c07c1f, 0x8880000c, 0x2f7ce7ff, 0xd8006502, 0x17c07c1f,
0xc0c07960, 0x17c07c1f, 0x18c0001f, 0x10006294, 0xe0f07fff, 0xe0e00fff,
0xe0e000ff, 0x81449801, 0xd80051c5, 0x17c07c1f, 0x1a00001f, 0x10006604,
0xe2200001, 0xc0c03de0, 0x17c07c1f, 0xe2200006, 0x18c0001f, 0x10001130,
0x1910001f, 0x10001130, 0xa1108404, 0xe0c00004, 0xc0c03de0, 0x17c07c1f,
0xe8208000, 0x1000110c, 0x00000454, 0xe8208000, 0x10001110, 0x00003e62,
0xe8208000, 0x10001114, 0x00000454, 0xe8208000, 0x10001118, 0x00002262,
0xa1d38407, 0xa1d98407, 0xa0108400, 0xa0120400, 0xa0148400, 0xa0150400,
0xa0158400, 0xa01b8400, 0xa01c0400, 0xa01c8400, 0xa0188400, 0xa0190400,
0xa0198400, 0x81441801, 0xd8205665, 0x17c07c1f, 0x1910001f, 0x10006b0c,
0x1a00001f, 0x100062c4, 0x1950001f, 0x100062c4, 0x80809001, 0x81748405,
0xa1548805, 0xe2000005, 0x1a00001f, 0x10006b0c, 0x80c51801, 0x81308404,
0xa1108c04, 0xe2000004, 0x1b00001f, 0x2f7ce7ff, 0x80c09401, 0xc8e03723,
0x17c07c1f, 0xe8208000, 0x10006310, 0x0b1603f8, 0x1950001f, 0x100062c4,
0x80841401, 0x81600801, 0x18c0001f, 0xaf7ce7ff, 0xa0de0803, 0xa0db9403,
0x13000c1f, 0xc0c03de0, 0xe2200002, 0x1b80001f, 0x90100000, 0x80c00001,
0xc8c00903, 0x17c07c1f, 0x18d0001f, 0x10006284, 0x80810c01, 0xd8205c22,
0x17c07c1f, 0x18d0001f, 0x100062c4, 0x80840c01, 0xd8005c22, 0x17c07c1f,
0x18c0001f, 0x10001138, 0x1910001f, 0x10001138, 0xa1108404, 0xe0c00004,
0x1910001f, 0x10001138, 0x1a00001f, 0x10006604, 0xe2200007, 0x1a00001f,
0x100062c4, 0x1890001f, 0x100062c4, 0xa0940402, 0xe2000002, 0x80c10001,
0xc8c01423, 0x17c07c1f, 0x1b00001f, 0x2f7ce7ff, 0x18c0001f, 0x10006294,
0xe0e001fe, 0xe0e003fc, 0xe0e007f8, 0xe0e00ff0, 0x1b80001f, 0x20000020,
0xe0f07ff0, 0xe0f07f00, 0x81449801, 0xd80060a5, 0x17c07c1f, 0x1a00001f,
0x10006604, 0xe2200006, 0xc0c03de0, 0x17c07c1f, 0xe2200000, 0x18c0001f,
0x10001130, 0x1910001f, 0x10001130, 0x81308404, 0xe0c00004, 0xc0c03de0,
0x17c07c1f, 0x1b80001f, 0x200016a8, 0xc0c03de0, 0xe2200003, 0x1880001f,
0x1000110c, 0xe0a00618, 0x1880001f, 0x10001114, 0xe0a00618, 0x18d0001f,
0x10006b6c, 0x1880001f, 0x10001110, 0xe0800003, 0x1880001f, 0x10001118,
0x11080c1f, 0xe0800004, 0x80388400, 0x80390400, 0x80398400, 0x1b80001f,
0x20000300, 0x803b8400, 0x803c0400, 0x803c8400, 0x1b80001f, 0x20000300,
0x80348400, 0x80350400, 0x80358400, 0x1b80001f, 0x20000104, 0x10007c1f,
0x81f38407, 0x81f98407, 0x81f90407, 0x81f40407, 0x81401801, 0xd80069a5,
0x17c07c1f, 0x18c0001f, 0x100062dc, 0xe0c0001f, 0x18c0001f, 0x10006290,
0x1212841f, 0xc0c074c0, 0x12807c1f, 0xc0c074c0, 0x1280041f, 0x18c0001f,
0x10006208, 0x1212841f, 0xc0c074c0, 0x12807c1f, 0xe8208000, 0x10006244,
0x00000000, 0x1b80001f, 0x20000080, 0xc0c074c0, 0x1280041f, 0x18c0001f,
0x10006200, 0x1212841f, 0xc0c074c0, 0x12807c1f, 0xe8208000, 0x1000625c,
0x00000000, 0x1b80001f, 0x20000080, 0xc0c074c0, 0x1280041f, 0xe8208000,
0x10006824, 0x000f0000, 0x81f48407, 0xa1d60407, 0x81f10407, 0xa1db0407,
0xe8208000, 0x10006310, 0x0b160008, 0xc2803ec0, 0x1293841f, 0x18c0001f,
0x10006b14, 0xe0c0000c, 0x18c0001f, 0x10006b68, 0x1950001f, 0x100063c0,
0xe0c00005, 0x81441801, 0xd8207045, 0x10c0041f, 0x1910001f, 0x100062c4,
0x80849001, 0x1a00001f, 0x10006b0c, 0x1910001f, 0x10006b0c, 0xa0908804,
0xe2000002, 0x81441801, 0xd8207045, 0x10c0041f, 0x1910001f, 0x100062c4,
0x80809001, 0x81600801, 0xa0d59403, 0xa0d60803, 0xd8006fe5, 0x17c07c1f,
0x80841001, 0x81600801, 0xa0db9403, 0xa0de0803, 0xd8006fe5, 0x17c07c1f,
0x80f60403, 0xe8208000, 0x10006310, 0x0b160c38, 0x13000c1f, 0x1b80001f,
0x900a0000, 0x88900001, 0x10006814, 0xd8206da2, 0x17c07c1f, 0x18d0001f,
0x10006b6c, 0x78a00003, 0x0000beef, 0xd8007262, 0x17c07c1f, 0xc0c07a00,
0x17c07c1f, 0xd0006da0, 0x17c07c1f, 0x1910001f, 0x10006b0c, 0x1a00001f,
0x100062c4, 0x1950001f, 0x100062c4, 0x80809001, 0x81748405, 0xa1548805,
0xe2000005, 0x80841401, 0xd8007442, 0x8204b401, 0xc8c00008, 0x17c07c1f,
0x1ac0001f, 0x55aa55aa, 0x10007c1f, 0xf0000000, 0xd80075ca, 0x17c07c1f,
0xe2e00036, 0x17c07c1f, 0x17c07c1f, 0xe2e0003e, 0x1380201f, 0xe2e0003c,
0xd820770a, 0x17c07c1f, 0x1b80001f, 0x20000018, 0xe2e0007c, 0x1b80001f,
0x20000003, 0xe2e0005c, 0xe2e0004c, 0xe2e0004d, 0xf0000000, 0x17c07c1f,
0xd80077ea, 0x17c07c1f, 0xe2e0004f, 0xe2e0006f, 0xe2e0002f, 0xd820788a,
0x17c07c1f, 0xe2e0002e, 0xe2e0003e, 0xe2e00032, 0xf0000000, 0x17c07c1f,
0xa1d10407, 0x1b80001f, 0x20000020, 0xf0000000, 0x17c07c1f, 0xa1d40407,
0x1391841f, 0xa1d90407, 0xf0000000, 0x17c07c1f, 0x1900001f, 0x10006014,
0x1950001f, 0x10006014, 0xa1508405, 0xe1000005, 0x1900001f, 0x10006814,
0xe100001f, 0x812ab401, 0xd8007b24, 0x17c07c1f, 0x1880001f, 0x10006284,
0x18d0001f, 0x10006284, 0x80f20403, 0xe0800003, 0x80f08403, 0xe0800003,
0x1900001f, 0x10006014, 0x1950001f, 0x10006014, 0x81708405, 0xe1000005,
0x1900001f, 0x10006b6c, 0xe100001f, 0x81441801, 0xd8007f65, 0x17c07c1f,
0x18c0001f, 0x10001138, 0x1910001f, 0x10001138, 0xa1108404, 0xe0c00004,
0x1910001f, 0x10001138, 0x1a00001f, 0x10006604, 0xe2200007, 0xf0000000,
0x17c07c1f
};
static struct pcm_desc suspend_pcm = {
.version = "pcm_suspend_v34.5.11.3_20150601-vproc_workaround",
.base = suspend_binary,
.size = 1021,
.sess = 2,
.replace = 0,
.vec0 = EVENT_VEC(23, 1, 0, 0), /* FUNC_MD_VRF18_WAKEUP */
.vec1 = EVENT_VEC(28, 1, 0, 36), /* FUNC_MD_VRF18_SLEEP */
.vec2 = EVENT_VEC(11, 1, 0, 72), /* FUNC_26M_WAKEUP */
.vec3 = EVENT_VEC(12, 1, 0, 106), /* FUNC_26M_SLEEP */
.vec4 = EVENT_VEC(30, 1, 0, 161), /* FUNC_APSRC_WAKEUP */
.vec5 = EVENT_VEC(31, 1, 0, 246), /* FUNC_APSRC_SLEEP */
.vec6 = EVENT_VEC(11, 1, 0, 441), /* FUNC_VCORE_HIGH */
.vec7 = EVENT_VEC(12, 1, 0, 468), /* FUNC_VCORE_LOW */
};
#elif defined(CONFIG_ARCH_MT6735M)
static const u32 suspend_binary[] = {
0x81429801, 0xd80001e5, 0x17c07c1f, 0x18c0001f, 0x10001124, 0x1910001f,
0x10001124, 0xa1108404, 0xe0c00004, 0x1910001f, 0x10001124, 0x1a00001f,
0x10006604, 0xc0c03da0, 0xe2200007, 0x1a00001f, 0x100062c4, 0x1890001f,
0x100062c4, 0xa0940402, 0x1b00001f, 0x10000001, 0x1910001f, 0x10006310,
0x80c39001, 0xd8200443, 0xe2000002, 0x80c10001, 0x1b00001f, 0xbf7ce7ff,
0xd8200443, 0x17c07c1f, 0x1b00001f, 0x7f7ce7ff, 0xf0000000, 0x17c07c1f,
0x81429801, 0xd8000665, 0x17c07c1f, 0x18c0001f, 0x10001124, 0x1910001f,
0x10001124, 0x81308404, 0xe0c00004, 0x1910001f, 0x10001124, 0x1a00001f,
0x10006604, 0xc0c03da0, 0xe2200007, 0x1a00001f, 0x100062c4, 0x1890001f,
0x100062c4, 0x80b40402, 0x1b00001f, 0x00801001, 0x1910001f, 0x10006310,
0x80c39001, 0xd82008c3, 0xe2000002, 0x80c10001, 0x1b00001f, 0x6ffcf7ff,
0xd80008c3, 0x17c07c1f, 0x1b00001f, 0xaffce7ff, 0xf0000000, 0x17c07c1f,
0x81f58407, 0x81f68407, 0x1800001f, 0x17cf0f3f, 0x1b80001f, 0x20000000,
0x1800001f, 0x17cf0f16, 0xa1d28407, 0x81f20407, 0x81409801, 0xd8000b25,
0x17c07c1f, 0x18c0001f, 0x10006234, 0xc0c02920, 0x1200041f, 0x80310400,
0x1b80001f, 0x2000000a, 0xa0110400, 0x81f00407, 0xa1dd0407, 0x18c0001f,
0x100062d8, 0xc0c02be0, 0x1200041f, 0x81fd0407, 0xc2803e80, 0x1290041f,
0x1b00001f, 0x6ffcf7ff, 0xf0000000, 0x17c07c1f, 0x1b00001f, 0x2f7ce7ff,
0x1b80001f, 0x20000004, 0xd80013ec, 0x17c07c1f, 0x1880001f, 0x10006320,
0xc0c02f00, 0xe080000f, 0xd8200f43, 0x17c07c1f, 0x1b00001f, 0x6ffcf7ff,
0xd00013e0, 0x17c07c1f, 0xe080001f, 0x81409801, 0xd80011c5, 0x17c07c1f,
0x18c0001f, 0x10214094, 0x1910001f, 0x1020e374, 0xe0c00004, 0x18c0001f,
0x10214098, 0x1910001f, 0x1020e378, 0xe0c00004, 0x1910001f, 0x10213378,
0x18c0001f, 0x10006234, 0xc0c02b00, 0x17c07c1f, 0x18c0001f, 0x100062d8,
0xc0c02d00, 0x17c07c1f, 0xc2803e80, 0x1290841f, 0xa1d20407, 0x81f28407,
0xa1d68407, 0x1800001f, 0x17cf0f3f, 0x1800001f, 0x17ff0f3f, 0x19c0001f,
0x001c2397, 0x1b00001f, 0x2f7cefff, 0xf0000000, 0x17c07c1f, 0x81411801,
0xd8001545, 0x17c07c1f, 0x18c0001f, 0x10006240, 0xe0e00016, 0xe0e0001e,
0xe0e0000e, 0xe0e0000f, 0x803e0400, 0x1b80001f, 0x20000222, 0x80380400,
0x1b80001f, 0x20000280, 0x803b0400, 0x1b80001f, 0x2000001a, 0x803d0400,
0x1b80001f, 0x20000208, 0x80340400, 0x80310400, 0xe8208000, 0x10210044,
0x00000100, 0x1b80001f, 0x20000068, 0x1b80001f, 0x2000000a, 0x18c0001f,
0x10006240, 0xe0e0000d, 0xd8001c05, 0x17c07c1f, 0x1b80001f, 0x20000020,
0x18c0001f, 0x102130f0, 0x1910001f, 0x102130f0, 0xa9000004, 0x10000000,
0xe0c00004, 0x1b80001f, 0x2000000a, 0x89000004, 0xefffffff, 0xe0c00004,
0x18c0001f, 0x102140f4, 0x1910001f, 0x102140f4, 0xa9000004, 0x02000000,
0xe0c00004, 0x1b80001f, 0x2000000a, 0x89000004, 0xfdffffff, 0xe0c00004,
0x1910001f, 0x102140f4, 0x81fa0407, 0x81f08407, 0xe8208000, 0x10006354,
0x001fdaa3, 0xa9c00007, 0x60010000, 0xc2803e80, 0x1291041f, 0x1b00001f,
0xbf7ce7ff, 0x1950001f, 0x100062c4, 0x80c41401, 0xd8001e43, 0x17c07c1f,
0x1b00001f, 0xaffce7ff, 0xf0000000, 0x17c07c1f, 0x1b80001f, 0x20000fdf,
0x1a50001f, 0x10006608, 0x80c9a401, 0x810ba401, 0x10920c1f, 0xa0979002,
0x80ca2401, 0xa0938c02, 0x8080080d, 0xd82022a2, 0x17c07c1f, 0x81f08407,
0xa9c00007, 0x60010000, 0x1b00001f, 0x2f7ce7ff, 0x1b80001f, 0x20000004,
0xd80028ec, 0x17c07c1f, 0x1b00001f, 0xbf7ce7ff, 0x1950001f, 0x100062c4,
0x80c41401, 0xd80028e3, 0x17c07c1f, 0x1b00001f, 0xaffce7ff, 0xd00028e0,
0x17c07c1f, 0x89c00007, 0x9ffeffff, 0x1900001f, 0x40000000, 0x18d0001f,
0x40000000, 0xe1000003, 0xc0c03020, 0x1080041f, 0x1880001f, 0x10006320,
0xc0c02da0, 0xe080000f, 0xd8002023, 0x17c07c1f, 0xe080001f, 0xa1da0407,
0xe8208000, 0x10210048, 0x00000100, 0x1b80001f, 0x20000068, 0xa0110400,
0xa0140400, 0xa0180400, 0xa01b0400, 0xa01d0400, 0x1b80001f, 0x20000068,
0xa01e0400, 0x1b80001f, 0x20000104, 0x81411801, 0xd8002785, 0x17c07c1f,
0x18c0001f, 0x10006240, 0xc0c02d00, 0x17c07c1f, 0xc2803e80, 0x1291841f,
0x1b00001f, 0x6ffcf7ff, 0x1950001f, 0x100062c4, 0x80c41401, 0xd82028e3,
0x17c07c1f, 0x1b00001f, 0x7f7ce7ff, 0xf0000000, 0x17c07c1f, 0xe0f07f16,
0x1380201f, 0xe0f07f1e, 0x1380201f, 0xe0f07f0e, 0x1b80001f, 0x20000100,
0xe0f07f0c, 0xe0f07f0d, 0xe0f07e0d, 0xe0f07c0d, 0xe0f0780d, 0xe0f0700d,
0xf0000000, 0x17c07c1f, 0xe0f07f0d, 0xe0f07f1d, 0xe0f07f1f, 0xe0f07f1e,
0xe0f07f12, 0xf0000000, 0x17c07c1f, 0xe0e00016, 0x1380201f, 0xe0e0001e,
0x1380201f, 0xe0e0000e, 0xe0e0000c, 0xe0e0000d, 0xf0000000, 0x17c07c1f,
0xe0e0000f, 0xe0e0001e, 0xe0e00012, 0xf0000000, 0x17c07c1f, 0x1112841f,
0xa1d08407, 0xd8202e64, 0x80eab401, 0xd8002de3, 0x01200404, 0x1a00001f,
0x10006814, 0xe2000003, 0xf0000000, 0x17c07c1f, 0xa1d00407, 0x1b80001f,
0x20000100, 0x80ea3401, 0x1a00001f, 0x10006814, 0xe2000003, 0xf0000000,
0x17c07c1f, 0x81499801, 0xd8203185, 0x17c07c1f, 0xd82036a2, 0x17c07c1f,
0x18d0001f, 0x40000000, 0x18d0001f, 0x70000000, 0xd8003082, 0x00a00402,
0x814a1801, 0xd82032e5, 0x17c07c1f, 0xd82036a2, 0x17c07c1f, 0x18d0001f,
0x40000000, 0x18d0001f, 0x80000000, 0xd80031e2, 0x00a00402, 0x814a9801,
0xd8203445, 0x17c07c1f, 0xd82036a2, 0x17c07c1f, 0x18d0001f, 0x40000000,
0x18d0001f, 0xc0000000, 0xd8003342, 0x00a00402, 0x814c1801, 0xd82035a5,
0x17c07c1f, 0xd82036a2, 0x17c07c1f, 0x18d0001f, 0x40000000, 0x18d0001f,
0xa0000000, 0xd80034a2, 0x00a00402, 0xd82036a2, 0x17c07c1f, 0x18d0001f,
0x40000000, 0x18d0001f, 0x40000000, 0xd80035a2, 0x00a00402, 0xf0000000,
0x17c07c1f, 0x81441801, 0xd8203905, 0x17c07c1f, 0x1a00001f, 0x10006604,
0xc0c03da0, 0xe2200004, 0xc0c03020, 0x1092041f, 0xc0c03da0, 0xe2200003,
0xc0c03020, 0x1092041f, 0xc0c03da0, 0xe2200002, 0xc0c03020, 0x1092041f,
0x1a00001f, 0x100062c4, 0x1890001f, 0x100062c4, 0xa0908402, 0xe2000002,
0x1b00001f, 0x00801001, 0xf0000000, 0x17c07c1f, 0x1a00001f, 0x100062c4,
0x1890001f, 0x100062c4, 0x80b08402, 0xe2000002, 0x81441801, 0xd8203d25,
0x17c07c1f, 0x1a00001f, 0x10006604, 0xc0c03da0, 0xe2200003, 0xc0c03020,
0x1092041f, 0xc0c03da0, 0xe2200004, 0xc0c03020, 0x1092041f, 0xc0c03da0,
0xe2200005, 0xc0c03020, 0x1092041f, 0x1b00001f, 0x00000801, 0xf0000000,
0x17c07c1f, 0x18d0001f, 0x10006604, 0x10cf8c1f, 0xd8203da3, 0x17c07c1f,
0xf0000000, 0x17c07c1f, 0x18c0001f, 0x10006b18, 0x1910001f, 0x10006b18,
0xa1002804, 0xe0c00004, 0xf0000000, 0x17c07c1f, 0x17c07c1f, 0x17c07c1f,
0x17c07c1f, 0x17c07c1f, 0x1840001f, 0x00000001, 0xa1d48407, 0x1990001f,
0x10006b08, 0xe8208000, 0x10006b18, 0x00000000, 0x81441801, 0xd8204565,
0x17c07c1f, 0x1910001f, 0x100062c4, 0x80849001, 0x1a00001f, 0x10006b0c,
0x1950001f, 0x10006b0c, 0xa1508805, 0xe2000005, 0x18c0001f, 0x2f7ce7ff,
0x80809001, 0x81600801, 0xa0d59403, 0xa0d60803, 0xd8004465, 0x17c07c1f,
0x80841001, 0x81600801, 0xa0db9403, 0xa0de0803, 0xd8004465, 0x17c07c1f,
0x80f60403, 0xe8208000, 0x10006310, 0x0b160c38, 0x13000c1f, 0x1b80001f,
0xd00f0000, 0xd00045a0, 0x17c07c1f, 0x1b00001f, 0x2f7ce7ff, 0x81469801,
0xd8204705, 0x17c07c1f, 0x1b80001f, 0xd00f0000, 0x8880000c, 0x2f7ce7ff,
0xd80069a2, 0x17c07c1f, 0xd0004740, 0x17c07c1f, 0x1b80001f, 0x500f0000,
0xe8208000, 0x10006354, 0x001fdaa3, 0xc0c078c0, 0x81401801, 0xd8004c65,
0x17c07c1f, 0x81f60407, 0x18c0001f, 0x10006200, 0xc0c07740, 0x12807c1f,
0xe8208000, 0x1000625c, 0x00000001, 0x1b80001f, 0x20000080, 0xc0c07740,
0x1280041f, 0x18c0001f, 0x10006208, 0xc0c07740, 0x12807c1f, 0xe8208000,
0x10006244, 0x00000001, 0x1b80001f, 0x20000080, 0xc0c07740, 0x1280041f,
0x18c0001f, 0x10006290, 0xc0c07740, 0x12807c1f, 0xc0c07740, 0x1280041f,
0x18c0001f, 0x100062dc, 0xe0c00001, 0xc2803e80, 0x1292041f, 0x81469801,
0xd8004d45, 0x17c07c1f, 0x8880000c, 0x2f7ce7ff, 0xd8006502, 0x17c07c1f,
0xc0c07960, 0x17c07c1f, 0x18c0001f, 0x10006294, 0xe0f07fff, 0xe0e00fff,
0xe0e000ff, 0x81449801, 0xd80051c5, 0x17c07c1f, 0x1a00001f, 0x10006604,
0xe2200001, 0xc0c03da0, 0x17c07c1f, 0xe2200006, 0x18c0001f, 0x1000111c,
0x1910001f, 0x1000111c, 0xa1108404, 0xe0c00004, 0xc0c03da0, 0x17c07c1f,
0xe8208000, 0x100010f8, 0x00000454, 0xe8208000, 0x100010fc, 0x00003e62,
0xe8208000, 0x10001100, 0x00000454, 0xe8208000, 0x10001104, 0x00002262,
0xa1d38407, 0xa1d98407, 0xa0108400, 0xa0120400, 0xa0148400, 0xa0150400,
0xa0158400, 0xa01b8400, 0xa01c0400, 0xa01c8400, 0xa0188400, 0xa0190400,
0xa0198400, 0x81441801, 0xd8205665, 0x17c07c1f, 0x1910001f, 0x10006b0c,
0x1a00001f, 0x100062c4, 0x1950001f, 0x100062c4, 0x80809001, 0x81748405,
0xa1548805, 0xe2000005, 0x1a00001f, 0x10006b0c, 0x80c51801, 0x81308404,
0xa1108c04, 0xe2000004, 0x1b00001f, 0x2f7ce7ff, 0x80c09401, 0xc8e036e3,
0x17c07c1f, 0xe8208000, 0x10006310, 0x0b1603f8, 0x1950001f, 0x100062c4,
0x80841401, 0x81600801, 0x18c0001f, 0xaf7ce7ff, 0xa0de0803, 0xa0db9403,
0x13000c1f, 0xc0c03da0, 0xe2200002, 0x1b80001f, 0x90100000, 0x80c00001,
0xc8c00903, 0x17c07c1f, 0x18d0001f, 0x10006284, 0x80810c01, 0xd8205c22,
0x17c07c1f, 0x18d0001f, 0x100062c4, 0x80840c01, 0xd8005c22, 0x17c07c1f,
0x18c0001f, 0x10001124, 0x1910001f, 0x10001124, 0xa1108404, 0xe0c00004,
0x1910001f, 0x10001124, 0x1a00001f, 0x10006604, 0xe2200007, 0x1a00001f,
0x100062c4, 0x1890001f, 0x100062c4, 0xa0940402, 0xe2000002, 0x80c10001,
0xc8c01423, 0x17c07c1f, 0x1b00001f, 0x2f7ce7ff, 0x18c0001f, 0x10006294,
0xe0e001fe, 0xe0e003fc, 0xe0e007f8, 0xe0e00ff0, 0x1b80001f, 0x20000020,
0xe0f07ff0, 0xe0f07f00, 0x81449801, 0xd80060a5, 0x17c07c1f, 0x1a00001f,
0x10006604, 0xe2200006, 0xc0c03da0, 0x17c07c1f, 0xe2200000, 0x18c0001f,
0x1000111c, 0x1910001f, 0x1000111c, 0x81308404, 0xe0c00004, 0xc0c03da0,
0x17c07c1f, 0x1b80001f, 0x200016a8, 0xc0c03da0, 0xe2200003, 0x1880001f,
0x100010f8, 0xe0a00618, 0x1880001f, 0x10001100, 0xe0a00618, 0x18d0001f,
0x10006b6c, 0x1880001f, 0x100010fc, 0xe0800003, 0x1880001f, 0x10001104,
0x11080c1f, 0xe0800004, 0x80388400, 0x80390400, 0x80398400, 0x1b80001f,
0x20000300, 0x803b8400, 0x803c0400, 0x803c8400, 0x1b80001f, 0x20000300,
0x80348400, 0x80350400, 0x80358400, 0x1b80001f, 0x20000104, 0x10007c1f,
0x81f38407, 0x81f98407, 0x81f90407, 0x81f40407, 0x81401801, 0xd80069a5,
0x17c07c1f, 0x18c0001f, 0x100062dc, 0xe0c0001f, 0x18c0001f, 0x10006290,
0x1212841f, 0xc0c074c0, 0x12807c1f, 0xc0c074c0, 0x1280041f, 0x18c0001f,
0x10006208, 0x1212841f, 0xc0c074c0, 0x12807c1f, 0xe8208000, 0x10006244,
0x00000000, 0x1b80001f, 0x20000080, 0xc0c074c0, 0x1280041f, 0x18c0001f,
0x10006200, 0x1212841f, 0xc0c074c0, 0x12807c1f, 0xe8208000, 0x1000625c,
0x00000000, 0x1b80001f, 0x20000080, 0xc0c074c0, 0x1280041f, 0xe8208000,
0x10006824, 0x000f0000, 0x81f48407, 0xa1d60407, 0x81f10407, 0xa1db0407,
0xe8208000, 0x10006310, 0x0b160008, 0xc2803e80, 0x1293841f, 0x18c0001f,
0x10006b14, 0xe0c0000c, 0x18c0001f, 0x10006b68, 0x1950001f, 0x100063c0,
0xe0c00005, 0x81441801, 0xd8207045, 0x10c0041f, 0x1910001f, 0x100062c4,
0x80849001, 0x1a00001f, 0x10006b0c, 0x1910001f, 0x10006b0c, 0xa0908804,
0xe2000002, 0x81441801, 0xd8207045, 0x10c0041f, 0x1910001f, 0x100062c4,
0x80809001, 0x81600801, 0xa0d59403, 0xa0d60803, 0xd8006fe5, 0x17c07c1f,
0x80841001, 0x81600801, 0xa0db9403, 0xa0de0803, 0xd8006fe5, 0x17c07c1f,
0x80f60403, 0xe8208000, 0x10006310, 0x0b160c38, 0x13000c1f, 0x1b80001f,
0x900a0000, 0x88900001, 0x10006814, 0xd8206da2, 0x17c07c1f, 0x18d0001f,
0x10006b6c, 0x78a00003, 0x0000beef, 0xd8007262, 0x17c07c1f, 0xc0c07a00,
0x17c07c1f, 0xd0006da0, 0x17c07c1f, 0x1910001f, 0x10006b0c, 0x1a00001f,
0x100062c4, 0x1950001f, 0x100062c4, 0x80809001, 0x81748405, 0xa1548805,
0xe2000005, 0x80841401, 0xd8007442, 0x8204b401, 0xc8c00008, 0x17c07c1f,
0x1ac0001f, 0x55aa55aa, 0x10007c1f, 0xf0000000, 0xd80075ca, 0x17c07c1f,
0xe2e00036, 0x17c07c1f, 0x17c07c1f, 0xe2e0003e, 0x1380201f, 0xe2e0003c,
0xd820770a, 0x17c07c1f, 0x1b80001f, 0x20000018, 0xe2e0007c, 0x1b80001f,
0x20000003, 0xe2e0005c, 0xe2e0004c, 0xe2e0004d, 0xf0000000, 0x17c07c1f,
0xd80077ea, 0x17c07c1f, 0xe2e0004f, 0xe2e0006f, 0xe2e0002f, 0xd820788a,
0x17c07c1f, 0xe2e0002e, 0xe2e0003e, 0xe2e00032, 0xf0000000, 0x17c07c1f,
0xa1d10407, 0x1b80001f, 0x20000020, 0xf0000000, 0x17c07c1f, 0xa1d40407,
0x1391841f, 0xa1d90407, 0xf0000000, 0x17c07c1f, 0x1900001f, 0x10006014,
0x1950001f, 0x10006014, 0xa1508405, 0xe1000005, 0x1900001f, 0x10006814,
0xe100001f, 0x812ab401, 0xd8007b24, 0x17c07c1f, 0x1880001f, 0x10006284,
0x18d0001f, 0x10006284, 0x80f20403, 0xe0800003, 0x80f08403, 0xe0800003,
0x1900001f, 0x10006014, 0x1950001f, 0x10006014, 0x81708405, 0xe1000005,
0x1900001f, 0x10006b6c, 0xe100001f, 0x81441801, 0xd8007f65, 0x17c07c1f,
0x18c0001f, 0x10001124, 0x1910001f, 0x10001124, 0xa1108404, 0xe0c00004,
0x1910001f, 0x10001124, 0x1a00001f, 0x10006604, 0xe2200007, 0xf0000000,
0x17c07c1f
};
static struct pcm_desc suspend_pcm = {
.version = "pcm_suspend_v0.5.4.2_20150601-vproc_workaround",
.base = suspend_binary,
.size = 1021,
.sess = 2,
.replace = 0,
.vec0 = EVENT_VEC(23, 1, 0, 0), /* FUNC_MD_VRF18_WAKEUP */
.vec1 = EVENT_VEC(28, 1, 0, 36), /* FUNC_MD_VRF18_SLEEP */
.vec2 = EVENT_VEC(11, 1, 0, 72), /* FUNC_26M_WAKEUP */
.vec3 = EVENT_VEC(12, 1, 0, 106), /* FUNC_26M_SLEEP */
.vec4 = EVENT_VEC(30, 1, 0, 161), /* FUNC_APSRC_WAKEUP */
.vec5 = EVENT_VEC(31, 1, 0, 244), /* FUNC_APSRC_SLEEP */
.vec6 = EVENT_VEC(11, 1, 0, 439), /* FUNC_VCORE_HIGH */
.vec7 = EVENT_VEC(12, 1, 0, 466), /* FUNC_VCORE_LOW */
};
#elif defined(CONFIG_ARCH_MT6753)
static const u32 suspend_binary[] = {
0x81429801, 0xd80000e5, 0x17c07c1f, 0x1a00001f, 0x10006604, 0xc0c03e00,
0xe2200007, 0x1a00001f, 0x100062c4, 0x1890001f, 0x100062c4, 0xa0940402,
0xe2000002, 0x10c0041f, 0x81008801, 0x81601001, 0xa0d59403, 0xa0d61003,
0xa0de0403, 0x1910001f, 0x10006310, 0x81439001, 0xd82003e5, 0x13000c1f,
0x80c10001, 0x1b00001f, 0xbf7ce7ff, 0xd82003e3, 0x17c07c1f, 0x1b00001f,
0x7f7ce7ff, 0xf0000000, 0x17c07c1f, 0x81429801, 0xd8000505, 0x17c07c1f,
0x1a00001f, 0x10006604, 0xc0c03e00, 0xe2200009, 0x1a00001f, 0x100062c4,
0x1890001f, 0x100062c4, 0x80b40402, 0xe2000002, 0x10c0041f, 0x81008801,
0x81601001, 0xa0d59403, 0xa0d61003, 0xa0db8403, 0x1910001f, 0x10006310,
0x81439001, 0xd8200805, 0x13000c1f, 0x80c10001, 0x1b00001f, 0x6ffcf7ff,
0xd8000803, 0x17c07c1f, 0x1b00001f, 0xaffce7ff, 0xf0000000, 0x17c07c1f,
0x81f58407, 0x81f68407, 0x1800001f, 0x17cf0f3f, 0x1b80001f, 0x20000000,
0x1800001f, 0x17cf0f16, 0xa1d28407, 0x81f20407, 0x81409801, 0xd8000a65,
0x17c07c1f, 0x18c0001f, 0x10006234, 0xc0c02840, 0x1200041f, 0x80310400,
0x1b80001f, 0x2000000a, 0xa0110400, 0x81f00407, 0xa1dd0407, 0x18c0001f,
0x100062d8, 0xc0c02b00, 0x1200041f, 0x81fd0407, 0xc2803ee0, 0x1290041f,
0x1b00001f, 0x6ffcf7ff, 0xf0000000, 0x17c07c1f, 0x1b00001f, 0x2f7ce7ff,
0x1b80001f, 0x20000004, 0xd800132c, 0x17c07c1f, 0x1880001f, 0x10006320,
0xc0c02e20, 0xe080000f, 0xd8200e83, 0x17c07c1f, 0x1b00001f, 0x6ffcf7ff,
0xd0001320, 0x17c07c1f, 0xe080001f, 0x81409801, 0xd8001105, 0x17c07c1f,
0x18c0001f, 0x10214094, 0x1910001f, 0x1020e374, 0xe0c00004, 0x18c0001f,
0x10214098, 0x1910001f, 0x1020e378, 0xe0c00004, 0x1910001f, 0x10213378,
0x18c0001f, 0x10006234, 0xc0c02a20, 0x17c07c1f, 0x18c0001f, 0x100062d8,
0xc0c02c20, 0x17c07c1f, 0xc2803ee0, 0x1290841f, 0xa1d20407, 0x81f28407,
0xa1d68407, 0x1800001f, 0x17cf0f3f, 0x1800001f, 0x17ff0f3f, 0x19c0001f,
0x001c2397, 0x1b00001f, 0x2f7cefff, 0xf0000000, 0x17c07c1f, 0x81411801,
0xd8001485, 0x17c07c1f, 0x18c0001f, 0x10006240, 0xe0e00016, 0xe0e0001e,
0xe0e0000e, 0xe0e0000f, 0x803e0400, 0x1b80001f, 0x20000222, 0x80380400,
0x1b80001f, 0x20000280, 0x803b0400, 0x1b80001f, 0x2000001a, 0x803d0400,
0x1b80001f, 0x20000208, 0x80340400, 0x80310400, 0xe8208000, 0x10210044,
0x00000100, 0x1b80001f, 0x20000068, 0x1b80001f, 0x2000000a, 0x18c0001f,
0x10006240, 0xe0e0000d, 0xd8001b45, 0x17c07c1f, 0x1b80001f, 0x20000020,
0x18c0001f, 0x102130f0, 0x1910001f, 0x102130f0, 0xa9000004, 0x10000000,
0xe0c00004, 0x1b80001f, 0x2000000a, 0x89000004, 0xefffffff, 0xe0c00004,
0x18c0001f, 0x102140f4, 0x1910001f, 0x102140f4, 0xa9000004, 0x02000000,
0xe0c00004, 0x1b80001f, 0x2000000a, 0x89000004, 0xfdffffff, 0xe0c00004,
0x1910001f, 0x102140f4, 0x81fa0407, 0x81f08407, 0xe8208000, 0x10006354,
0x001fdaa3, 0xa9c00007, 0x60010000, 0xc2803ee0, 0x1291041f, 0x1b00001f,
0xbf7ce7ff, 0x1950001f, 0x100062c4, 0x80c41401, 0xd8001d83, 0x17c07c1f,
0x1b00001f, 0xaffce7ff, 0xf0000000, 0x17c07c1f, 0x1b80001f, 0x20000fdf,
0x1a50001f, 0x10006608, 0x80c9a401, 0x810ba401, 0x10920c1f, 0xa0979002,
0x80ca2401, 0xa0938c02, 0x8080080d, 0xd82021e2, 0x17c07c1f, 0x81f08407,
0xa9c00007, 0x60010000, 0x1b00001f, 0x2f7ce7ff, 0x1b80001f, 0x20000004,
0xd800280c, 0x17c07c1f, 0x1b00001f, 0xbf7ce7ff, 0x1950001f, 0x100062c4,
0x80c41401, 0xd8002803, 0x17c07c1f, 0x1b00001f, 0xaffce7ff, 0xd0002800,
0x17c07c1f, 0x89c00007, 0x9ffeffff, 0x1900001f, 0x40000000, 0x18d0001f,
0x40000000, 0xe1000003, 0xc0c02f40, 0x1080041f, 0x1880001f, 0x10006320,
0xc0c02cc0, 0xe080000f, 0xd8001f63, 0x17c07c1f, 0xe080001f, 0xa1da0407,
0xe8208000, 0x10210048, 0x00000100, 0x1b80001f, 0x20000068, 0xa0110400,
0xa0140400, 0xa8000000, 0x04410000, 0x1b80001f, 0x20000068, 0xa01e0400,
0x1b80001f, 0x20000104, 0x81411801, 0xd80026a5, 0x17c07c1f, 0x18c0001f,
0x10006240, 0xc0c02c20, 0x17c07c1f, 0xc2803ee0, 0x1291841f, 0x1b00001f,
0x6ffcf7ff, 0x1950001f, 0x100062c4, 0x80c41401, 0xd8202803, 0x17c07c1f,
0x1b00001f, 0x7f7ce7ff, 0xf0000000, 0x17c07c1f, 0xe0f07f16, 0x1380201f,
0xe0f07f1e, 0x1380201f, 0xe0f07f0e, 0x1b80001f, 0x20000100, 0xe0f07f0c,
0xe0f07f0d, 0xe0f07e0d, 0xe0f07c0d, 0xe0f0780d, 0xe0f0700d, 0xf0000000,
0x17c07c1f, 0xe0f07f0d, 0xe0f07f1d, 0xe0f07f1f, 0xe0f07f1e, 0xe0f07f12,
0xf0000000, 0x17c07c1f, 0xe0e00016, 0x1380201f, 0xe0e0001e, 0x1380201f,
0xe0e0000e, 0xe0e0000c, 0xe0e0000d, 0xf0000000, 0x17c07c1f, 0xe0e0000f,
0xe0e0001e, 0xe0e00012, 0xf0000000, 0x17c07c1f, 0x1112841f, 0xa1d08407,
0xd8202d84, 0x80eab401, 0xd8002d03, 0x01200404, 0x1a00001f, 0x10006814,
0xe2000003, 0xf0000000, 0x17c07c1f, 0xa1d00407, 0x1b80001f, 0x20000100,
0x80ea3401, 0x1a00001f, 0x10006814, 0xe2000003, 0xf0000000, 0x17c07c1f,
0x81499801, 0xd82030a5, 0x17c07c1f, 0xd82035c2, 0x17c07c1f, 0x18d0001f,
0x40000000, 0x18d0001f, 0x70000000, 0xd8002fa2, 0x00a00402, 0x814a1801,
0xd8203205, 0x17c07c1f, 0xd82035c2, 0x17c07c1f, 0x18d0001f, 0x40000000,
0x18d0001f, 0x80000000, 0xd8003102, 0x00a00402, 0x814a9801, 0xd8203365,
0x17c07c1f, 0xd82035c2, 0x17c07c1f, 0x18d0001f, 0x40000000, 0x18d0001f,
0xc0000000, 0xd8003262, 0x00a00402, 0x814c1801, 0xd82034c5, 0x17c07c1f,
0xd82035c2, 0x17c07c1f, 0x18d0001f, 0x40000000, 0x18d0001f, 0xa0000000,
0xd80033c2, 0x00a00402, 0xd82035c2, 0x17c07c1f, 0x18d0001f, 0x40000000,
0x18d0001f, 0x40000000, 0xd80034c2, 0x00a00402, 0xf0000000, 0x17c07c1f,
0x81441801, 0xd8203825, 0x17c07c1f, 0x1a00001f, 0x10006604, 0xc0c03e00,
0xe2200004, 0xc0c02f40, 0x1093041f, 0xc0c03e00, 0xe2200003, 0xc0c02f40,
0x1093041f, 0xc0c03e00, 0xe2200002, 0xc0c02f40, 0x1093041f, 0x1a00001f,
0x100062c4, 0x1890001f, 0x100062c4, 0xa0908402, 0xe2000002, 0x10c0041f,
0x81040801, 0x81601001, 0xa0db9403, 0xa0de1003, 0xa0d60403, 0x13000c1f,
0xf0000000, 0x17c07c1f, 0x1a00001f, 0x100062c4, 0x1890001f, 0x100062c4,
0x80b08402, 0xe2000002, 0x81441801, 0xd8203ce5, 0x17c07c1f, 0x1a00001f,
0x10006604, 0xc0c03e00, 0xe2200003, 0xc0c02f40, 0x1093041f, 0xc0c03e00,
0xe2200004, 0xc0c02f40, 0x1093041f, 0xc0c03e00, 0xe2200005, 0xc0c02f40,
0x1093041f, 0x10c0041f, 0x81040801, 0x81601001, 0xa0db9403, 0xa0de1003,
0xa0d58403, 0x13000c1f, 0xf0000000, 0x17c07c1f, 0x18d0001f, 0x10006604,
0x10cf8c1f, 0xd8203e03, 0x17c07c1f, 0xf0000000, 0x17c07c1f, 0x18c0001f,
0x10006b18, 0x1910001f, 0x10006b18, 0xa1002804, 0xe0c00004, 0xf0000000,
0x17c07c1f, 0x17c07c1f, 0x1840001f, 0x00000001, 0xa1d48407, 0x1990001f,
0x10006b08, 0xe8208000, 0x10006b18, 0x00000000, 0x81441801, 0xd8204445,
0x17c07c1f, 0x1910001f, 0x100062c4, 0x80849001, 0x1a00001f, 0x10006b0c,
0x1950001f, 0x10006b0c, 0xa1508805, 0xe2000005, 0x18c0001f, 0x2f7ce7ff,
0x80841001, 0x81600801, 0xa0db9403, 0xa0de0803, 0xe8208000, 0x10006310,
0x0b160038, 0x13000c1f, 0x1b80001f, 0xd00f0000, 0xd0004480, 0x17c07c1f,
0x1b00001f, 0x2f7ce7ff, 0x81469801, 0xd82045e5, 0x17c07c1f, 0x1b80001f,
0xd00f0000, 0x8880000c, 0x2f7ce7ff, 0xd8006382, 0x17c07c1f, 0xd0004620,
0x17c07c1f, 0x1b80001f, 0x500f0000, 0xe8208000, 0x10006354, 0x001fdaa3,
0xc0c07400, 0x81401801, 0xd8004b45, 0x17c07c1f, 0x81f60407, 0x18c0001f,
0x10006200, 0xc0c07280, 0x12807c1f, 0xe8208000, 0x1000625c, 0x00000001,
0x1b80001f, 0x20000080, 0xc0c07280, 0x1280041f, 0x18c0001f, 0x10006208,
0xc0c07280, 0x12807c1f, 0xe8208000, 0x10006244, 0x00000001, 0x1b80001f,
0x20000080, 0xc0c07280, 0x1280041f, 0x18c0001f, 0x10006290, 0xc0c07280,
0x12807c1f, 0xc0c07280, 0x1280041f, 0x18c0001f, 0x100062dc, 0xe0c00001,
0xc2803ee0, 0x1292041f, 0x81469801, 0xd8004c25, 0x17c07c1f, 0x8880000c,
0x2f7ce7ff, 0xd8005ee2, 0x17c07c1f, 0x18c0001f, 0x10006294, 0xe0f07fff,
0xe0e00fff, 0xe0e000ff, 0x81449801, 0xd8004fa5, 0x17c07c1f, 0x1a00001f,
0x10006604, 0x814d1801, 0xd8204ee5, 0x17c07c1f, 0xe2200006, 0xc0c07540,
0x12807c1f, 0xc0c03e00, 0x17c07c1f, 0xc2803ee0, 0x1294041f, 0xd0004fa0,
0x17c07c1f, 0xc0c03e00, 0xe2200001, 0xc0c03e00, 0xe2200006, 0xc0c03e00,
0xe220000a, 0xc0c074a0, 0x17c07c1f, 0xa1d38407, 0xa1d98407, 0x1800001f,
0x00000012, 0x1800001f, 0x00000e12, 0x1800001f, 0x03800e12, 0x1800001f,
0x038e0e12, 0x81441801, 0xd8205385, 0x17c07c1f, 0x1910001f, 0x10006b0c,
0x1a00001f, 0x100062c4, 0x1950001f, 0x100062c4, 0x80809001, 0x81748405,
0xa1548805, 0xe2000005, 0x1a00001f, 0x10006b0c, 0x80c51801, 0x81308404,
0xa1108c04, 0xe2000004, 0xe8208000, 0x10006310, 0x0b1603f8, 0x1950001f,
0x100062c4, 0x80841401, 0x81600801, 0x18c0001f, 0xaf7ce7ff, 0xa0de0803,
0xa0db9403, 0x13000c1f, 0x1b80001f, 0x90100000, 0x80c00001, 0xc8c00843,
0x17c07c1f, 0x18d0001f, 0x10006284, 0x80810c01, 0xd82057c2, 0x17c07c1f,
0x18d0001f, 0x100062c4, 0x80840c01, 0xd80057c2, 0x17c07c1f, 0x1a00001f,
0x10006604, 0xe2200007, 0x1a00001f, 0x100062c4, 0xa0940403, 0xe2000002,
0x80c10001, 0xc8c01363, 0x17c07c1f, 0x1b00001f, 0x2f7ce7ff, 0x18c0001f,
0x10006294, 0xe0e001fe, 0xe0e003fc, 0xe0e007f8, 0xe0e00ff0, 0x1b80001f,
0x20000020, 0xe0f07ff0, 0xe0f07f00, 0x1800001f, 0x03800e12, 0x1b80001f,
0x20000300, 0x1800001f, 0x00000e12, 0x1b80001f, 0x20000300, 0x1800001f,
0x00000012, 0x1b80001f, 0x20000104, 0x10007c1f, 0x81f38407, 0x81f98407,
0x81f90407, 0x81f40407, 0x81449801, 0xd8005ee5, 0x17c07c1f, 0x1a00001f,
0x10006604, 0x814d1801, 0xd8205de5, 0x17c07c1f, 0xe2200008, 0xc0c07540,
0x1280041f, 0xc0c03e00, 0x17c07c1f, 0x1b80001f, 0x20001c70, 0xd0005ee0,
0x17c07c1f, 0xc0c03e00, 0xe2200008, 0xc0c03e00, 0xe2200000, 0x1b80001f,
0x200016a8, 0xc0c03e00, 0xe220000b, 0x81401801, 0xd8006385, 0x17c07c1f,
0x18c0001f, 0x100062dc, 0xe0c0001f, 0x18c0001f, 0x10006290, 0x1212841f,
0xc0c07000, 0x12807c1f, 0xc0c07000, 0x1280041f, 0x18c0001f, 0x10006208,
0x1212841f, 0xc0c07000, 0x12807c1f, 0xe8208000, 0x10006244, 0x00000000,
0x1b80001f, 0x20000080, 0xc0c07000, 0x1280041f, 0x18c0001f, 0x10006200,
0x1212841f, 0xc0c07000, 0x12807c1f, 0xe8208000, 0x1000625c, 0x00000000,
0x1b80001f, 0x20000080, 0xc0c07000, 0x1280041f, 0xe8208000, 0x10006824,
0x000f0000, 0x81f48407, 0xa1d60407, 0x81f10407, 0xa1db0407, 0xe8208000,
0x10006310, 0x0b160008, 0xc2803ee0, 0x1293841f, 0x18c0001f, 0x10006b14,
0xe0c0000c, 0x18c0001f, 0x10006b68, 0x1950001f, 0x100063c0, 0xe0c00005,
0x81441801, 0xd8206ac5, 0x10c0041f, 0x1910001f, 0x100062c4, 0x80849001,
0x1a00001f, 0x10006b0c, 0x1910001f, 0x10006b0c, 0xa0908804, 0xe2000002,
0x89000002, 0xfffffe43, 0xe2000004, 0x1a00001f, 0x10006608, 0x1890001f,
0x10006608, 0x89000002, 0xfd67ffff, 0xe2000004, 0x81441801, 0xd8206ac5,
0x10c0041f, 0x1910001f, 0x100062c4, 0x80809001, 0x81600801, 0xa0d59403,
0xa0d60803, 0x80841001, 0x81600801, 0xa0db9403, 0xa0de0803, 0xe8208000,
0x10006310, 0x0b160c38, 0x81469801, 0xd8206b85, 0x17c07c1f, 0xe8208000,
0x100063e0, 0x00000001, 0x13000c1f, 0x1b80001f, 0x900a0000, 0x88900001,
0x10006814, 0xd82068c2, 0x17c07c1f, 0x18d0001f, 0x10006b6c, 0x78a00003,
0x0000beef, 0xd8006da2, 0x17c07c1f, 0xc0c07bc0, 0x17c07c1f, 0xd00068c0,
0x17c07c1f, 0x1910001f, 0x10006b0c, 0x1a00001f, 0x100062c4, 0x1950001f,
0x100062c4, 0x80809001, 0x81748405, 0xa1548805, 0xe2000005, 0x80841401,
0xd8006f82, 0x8204b401, 0xc8c00008, 0x17c07c1f, 0x1ac0001f, 0x55aa55aa,
0x10007c1f, 0xf0000000, 0xd800710a, 0x17c07c1f, 0xe2e00036, 0x17c07c1f,
0x17c07c1f, 0xe2e0003e, 0x1380201f, 0xe2e0003c, 0xd820724a, 0x17c07c1f,
0x1b80001f, 0x20000018, 0xe2e0007c, 0x1b80001f, 0x20000003, 0xe2e0005c,
0xe2e0004c, 0xe2e0004d, 0xf0000000, 0x17c07c1f, 0xd800732a, 0x17c07c1f,
0xe2e0004f, 0xe2e0006f, 0xe2e0002f, 0xd82073ca, 0x17c07c1f, 0xe2e0002e,
0xe2e0003e, 0xe2e00032, 0xf0000000, 0x17c07c1f, 0xa1d10407, 0x1b80001f,
0x20000020, 0xf0000000, 0x17c07c1f, 0xa1d40407, 0x1391841f, 0xa1d90407,
0xf0000000, 0x17c07c1f, 0xe8208000, 0x11012014, 0x00000002, 0xe8208000,
0x11012020, 0x00000001, 0xe8208000, 0x11012004, 0x000000d6, 0xe8208000,
0x11012040, 0x00000000, 0x1a00001f, 0x11012000, 0xd820798a, 0x17c07c1f,
0xe220000a, 0xe22000f6, 0xe8208000, 0x11012024, 0x00000001, 0x1890001f,
0x11012024, 0x1b80001f, 0x20000158, 0xe220008a, 0xe2200001, 0xe8208000,
0x11012024, 0x00000001, 0x1b80001f, 0x20000158, 0xd0007b80, 0x17c07c1f,
0xe220008a, 0xe2200000, 0xe8208000, 0x11012024, 0x00000001, 0x1890001f,
0x11012024, 0x1b80001f, 0x20000158, 0xe220000a, 0xe22000f4, 0xe8208000,
0x11012024, 0x00000001, 0x1b80001f, 0x20000158, 0xf0000000, 0x17c07c1f,
0x1900001f, 0x10006014, 0x1950001f, 0x10006014, 0xa1508405, 0xe1000005,
0x1900001f, 0x10006814, 0xe100001f, 0x812ab401, 0xd8007ce4, 0x17c07c1f,
0x1880001f, 0x10006284, 0x18d0001f, 0x10006284, 0x80f20403, 0xe0800003,
0x80f08403, 0xe0800003, 0x1900001f, 0x10006014, 0x1950001f, 0x10006014,
0x81708405, 0xe1000005, 0x1900001f, 0x10006b6c, 0xe100001f, 0xf0000000,
0x17c07c1f
};
static struct pcm_desc suspend_pcm = {
.version = "pcm_suspend_v0.2.4.1.6.4.1_20151216",
.base = suspend_binary,
.size = 1021,
.sess = 2,
.replace = 0,
.vec0 = EVENT_VEC(23, 1, 0, 0), /* FUNC_MD_VRF18_WAKEUP */
.vec1 = EVENT_VEC(28, 1, 0, 33), /* FUNC_MD_VRF18_SLEEP */
.vec2 = EVENT_VEC(11, 1, 0, 66), /* FUNC_26M_WAKEUP */
.vec3 = EVENT_VEC(12, 1, 0, 100), /* FUNC_26M_SLEEP */
.vec4 = EVENT_VEC(30, 1, 0, 155), /* FUNC_APSRC_WAKEUP */
.vec5 = EVENT_VEC(31, 1, 0, 238), /* FUNC_APSRC_SLEEP */
.vec6 = EVENT_VEC(11, 1, 0, 432), /* FUNC_VCORE_HIGH */
.vec7 = EVENT_VEC(12, 1, 0, 464), /* FUNC_VCORE_LOW */
};
#else
//ERROR
#endif
/**************************************
* SW code for suspend
**************************************/
#define SPM_SYSCLK_SETTLE 99 /* 3ms */
#define WAIT_UART_ACK_TIMES 10 /* 10 * 10us */
#define SPM_WAKE_PERIOD 600 /* sec */
#define WAKE_SRC_FOR_SUSPEND \
(WAKE_SRC_KP | WAKE_SRC_EINT | WAKE_SRC_CONN_WDT | WAKE_SRC_CCIF0_MD | WAKE_SRC_CCIF1_MD | WAKE_SRC_CONN2AP | \
WAKE_SRC_USB_CD | WAKE_SRC_USB_PDN | WAKE_SRC_SEJ | \
/*WAKE_SRC_SYSPWREQ |*/ WAKE_SRC_MD_WDT | WAKE_SRC_C2K_WDT | WAKE_SRC_CLDMA_MD)
#define WAKE_SRC_FOR_MD32 0 \
//(WAKE_SRC_AUD_MD32)
#define spm_is_wakesrc_invalid(wakesrc) (!!((u32)(wakesrc) & 0xc0003803))
#define reg_read(addr) __raw_readl(IOMEM(addr))
#define reg_write(addr, val) mt_reg_sync_writel((val), ((void *)addr))
#if defined (CONFIG_OF)
//#define MCUCFG_NODE "mediatek,MCUCFG"
//static unsigned long mcucfg_base;
//static unsigned long mcucfg_phys_base;
extern void __iomem *_mcucfg_base;
extern void __iomem *_mcucfg_phys_base;
#undef MCUCFG_BASE
#define MCUCFG_BASE (_mcucfg_base)
#else //#if defined (CONFIG_OF)
#undef MCUCFG_BASE
#define MCUCFG_BASE 0xF0200000
#endif //#if defined (CONFIG_OF)
// MCUCFG registers
#define MP0_AXI_CONFIG (MCUCFG_BASE + 0x2C)
#define MP0_AXI_CONFIG_PHYS (_mcucfg_phys_base + 0x2C)
#define MP1_AXI_CONFIG (MCUCFG_BASE + 0x22C)
#define MP1_AXI_CONFIG_PHYS (_mcucfg_phys_base + 0x22C)
#define ACINACTM (1<<4)
#if defined(CONFIG_ARM_PSCI) || defined(CONFIG_MTK_PSCI)
#define MCUSYS_SMC_WRITE(addr, val) mcusys_smc_write_phy(addr##_PHYS, val)
#else
#define MCUSYS_SMC_WRITE(addr, val) mcusys_smc_write(addr, val)
#endif
#ifdef CONFIG_MTK_RAM_CONSOLE
#define SPM_AEE_RR_REC 1
#else
#define SPM_AEE_RR_REC 0
#endif
#if SPM_AEE_RR_REC
enum spm_suspend_step
{
SPM_SUSPEND_ENTER=0,
SPM_SUSPEND_ENTER_WFI,
SPM_SUSPEND_LEAVE_WFI,
SPM_SUSPEND_LEAVE
};
extern void aee_rr_rec_spm_suspend_val(u32 val);
extern u32 aee_rr_curr_spm_suspend_val(void);
#endif
//FIXME: Denali early porting
#if 0
int __attribute__((weak)) exec_ccci_kern_func_by_md_id(int md_id, unsigned int id, char *buf, unsigned int len){}
int __attribute__((weak)) get_dynamic_period(int first_use, int first_wakeup_time, int battery_capacity_level){}
#else
extern int get_dynamic_period(int first_use, int first_wakeup_time, int battery_capacity_level);
#endif
extern int mt_irq_mask_all(struct mtk_irq_mask *mask);
extern int mt_irq_mask_restore(struct mtk_irq_mask *mask);
extern void mt_irq_unmask_for_sleep(unsigned int irq);
extern int request_uart_to_sleep(void);
extern int request_uart_to_wakeup(void);
extern void mtk_uart_restore(void);
extern void dump_uart_reg(void);
static struct pwr_ctrl suspend_ctrl = {
.wake_src = WAKE_SRC_FOR_SUSPEND,
.wake_src_md32 = WAKE_SRC_FOR_MD32,
.r0_ctrl_en = 1,
.r7_ctrl_en = 1,
.infra_dcm_lock = 1,
.wfi_op = WFI_OP_AND,
.ca7top_idle_mask = 0,
.ca15top_idle_mask = 0,
.mcusys_idle_mask = 0,
.disp_req_mask = 0,
.mfg_req_mask = 0,
.md1_req_mask = 0,
.md2_req_mask = 0,
.md32_req_mask = 0,
.md_apsrc_sel = 0,
.md2_apsrc_sel = 0,
.lte_mask = 1,
.conn_mask = 0,
#if 0
.ccif0_to_ap_mask = 1,
.ccif0_to_md_mask = 1,
.ccif1_to_ap_mask = 1,
.ccif1_to_md_mask = 1,
.ccifmd_md1_event_mask = 1,
.ccifmd_md2_event_mask = 1,
#endif
//.pcm_f26m_req = 1,
.ca7_wfi0_en = 1,
.ca7_wfi1_en = 1,
.ca7_wfi2_en = 1,
.ca7_wfi3_en = 1,
.ca15_wfi0_en = 1,
.ca15_wfi1_en = 1,
.ca15_wfi2_en = 1,
.ca15_wfi3_en = 1,
#if SPM_BYPASS_SYSPWREQ
.syspwreq_mask = 1,
#endif
};
struct spm_lp_scen __spm_suspend = {
.pcmdesc = &suspend_pcm,
.pwrctrl = &suspend_ctrl,
.wakestatus = &suspend_info[0],
};
void spm_i2c_control(u32 channel, bool onoff)
{
return;
#if 0
//static int pdn = 0;
static bool i2c_onoff = 0;
#ifdef CONFIG_OF
void __iomem *base;
#else
u32 base;//, i2c_clk;
#endif
switch(channel)
{
case 0:
base = SPM_I2C0_BASE;
//i2c_clk = MT_CG_INFRA_I2C0;
break;
case 1:
base = SPM_I2C1_BASE;
//i2c_clk = MT_CG_INFRA_I2C1;
break;
case 2:
base = SPM_I2C2_BASE;
//i2c_clk = MT_CG_INFRA_I2C2;
break;
default:
base = SPM_I2C2_BASE;
break;
}
if ((1 == onoff) && (0 == i2c_onoff))
{
i2c_onoff = 1;
#if 0
#if 1
pdn = spm_read(INFRA_PDN_STA0) & (1U << i2c_clk);
spm_write(INFRA_PDN_CLR0, pdn); /* power on I2C */
#else
pdn = clock_is_on(i2c_clk);
if (!pdn)
enable_clock(i2c_clk, "spm_i2c");
#endif
#endif
spm_write(base + OFFSET_CONTROL, 0x0); /* init I2C_CONTROL */
spm_write(base + OFFSET_TRANSAC_LEN, 0x1); /* init I2C_TRANSAC_LEN */
spm_write(base + OFFSET_EXT_CONF, 0x0); /* init I2C_EXT_CONF */
spm_write(base + OFFSET_IO_CONFIG, 0x0); /* init I2C_IO_CONFIG */
spm_write(base + OFFSET_HS, 0x102); /* init I2C_HS */
}
else
if ((0 == onoff) && (1 == i2c_onoff))
{
i2c_onoff = 0;
#if 0
#if 1
spm_write(INFRA_PDN_SET0, pdn); /* restore I2C power */
#else
if (!pdn)
disable_clock(i2c_clk, "spm_i2c");
#endif
#endif
}
else
ASSERT(1);
#endif
}
extern unsigned int mt_get_clk_mem_sel(void);
/*
static bool spm_set_suspend_pcm_ver(u32 *suspend_flags)
{
u32 flag;
flag = *suspend_flags;
if(mt_get_clk_mem_sel()==MEMPLL3PLL)
{
__spm_suspend.pcmdesc = &suspend_pcm_3pll;
flag |= SPM_VCORE_DVS_DIS;
}
else if(mt_get_clk_mem_sel()==MEMPLL1PLL)
{
__spm_suspend.pcmdesc = &suspend_pcm_1pll;
flag &= ~SPM_VCORE_DVS_DIS;
}
else
return false;
*suspend_flags = flag;
return true;
}
*/
#if 0
static void spm_suspend_pre_process(struct pwr_ctrl *pwrctrl)
{
#if 0
u32 rdata1 = 0, rdata2 = 0;
#endif
/* set PMIC WRAP table for suspend power control */
mt_cpufreq_set_pmic_phase(PMIC_WRAP_PHASE_SUSPEND);
spm_i2c_control(I2C_CHANNEL, 1);
#if 0
/* for infra pdn (emi driving) */
spm_write(0xF0004000, spm_read(0xF0004000) | (1 << 24));
/* MEMPLL control for SPM */
spm_write(0xF000F5C8, 0x3010F030);
spm_write(0xF000F5CC, 0x50101010);
#endif
//spm_write(0xF0001070 , spm_read(0xF0001070) | (1 << 21)); // 26:26 enable
//spm_write(0xF0000204 , spm_read(0xF0000204) | (1 << 0)); // BUS 26MHz enable
//spm_write(0xF0001108 , 0x0);
#ifdef CONFIG_MD32_SUPPORT
//spm_write(MD32_BASE+0x2C, (spm_read(MD32_BASE+0x2C) & ~0xFFFF) | 0xcafe);
#endif
#if 0
pwrap_read(0x2c2, &rdata1);
pwrap_write(0x2c2, 0x0123);
pwrap_read(0x2c2, &rdata2);
if(rdata2 != 0x0123)
{
spm_crit2("suspend pmic wrapper 0x2c2, rdata1 = 0x%x, rdata2 = 0x%x\n", rdata1, rdata2);
BUG();
}
#endif
}
#endif
#if 0
static void spm_suspend_post_process(struct pwr_ctrl *pwrctrl)
{
#if 0
u32 rdata1 = 0, rdata2 = 0;
pwrap_read(0x2c2, &rdata1);
pwrap_write(0x2c2, 0x3210);
pwrap_read(0x2c2, &rdata2);
if(rdata2 != 0x3210)
{
spm_crit2("resume pmic wrapper 0x2c2, rdata1 = 0x%x, rdata2 = 0x%x\n", rdata1, rdata2);
BUG();
}
#endif
#ifdef CONFIG_MD32_SUPPORT
//spm_write(MD32_BASE+0x2C, spm_read(MD32_BASE+0x2C) & ~0xFFFF);
#endif
/* set PMIC WRAP table for normal power control */
mt_cpufreq_set_pmic_phase(PMIC_WRAP_PHASE_NORMAL);
spm_i2c_control(I2C_CHANNEL, 0);
}
#endif
static void spm_set_sysclk_settle(void)
{
u32 md_settle, settle;
/* get MD SYSCLK settle */
spm_write(SPM_CLK_CON, spm_read(SPM_CLK_CON) | CC_SYSSETTLE_SEL);
spm_write(SPM_CLK_SETTLE, 0);
md_settle = spm_read(SPM_CLK_SETTLE);
/* SYSCLK settle = MD SYSCLK settle but set it again for MD PDN */
spm_write(SPM_CLK_SETTLE, SPM_SYSCLK_SETTLE - md_settle);
settle = spm_read(SPM_CLK_SETTLE);
spm_crit2("md_settle = %u, settle = %u\n", md_settle, settle);
}
static void spm_kick_pcm_to_run(struct pwr_ctrl *pwrctrl)
{
/* enable PCM WDT (normal mode) to start count if needed */
#if SPM_PCMWDT_EN
{
u32 con1;
con1 = spm_read(SPM_PCM_CON1) & ~(CON1_PCM_WDT_WAKE_MODE | CON1_PCM_WDT_EN);
spm_write(SPM_PCM_CON1, CON1_CFG_KEY | con1);
if (spm_read(SPM_PCM_TIMER_VAL) > PCM_TIMER_MAX)
spm_write(SPM_PCM_TIMER_VAL, PCM_TIMER_MAX);
spm_write(SPM_PCM_WDT_TIMER_VAL, spm_read(SPM_PCM_TIMER_VAL) + PCM_WDT_TIMEOUT);
spm_write(SPM_PCM_CON1, con1 | CON1_CFG_KEY | CON1_PCM_WDT_EN);
}
#endif
#if SPM_PCMTIMER_DIS
{
u32 con1; //CONFIG_MTK_LDVT is enable? Otherwise why con1: /mt_spm_sleep.c:523:9: error: 'con1' undeclared (first use in this function)
con1 = spm_read(SPM_PCM_CON1) & ~(CON1_PCM_TIMER_EN);
spm_write(SPM_PCM_CON1, con1 | CON1_CFG_KEY);
}
#endif
/* init PCM_PASR_DPD_0 for DPD */
spm_write(SPM_PCM_PASR_DPD_0, 0);
//FIXME: for K2 fpga early porting
#if 0
/* make MD32 work in suspend: fscp_ck = CLK26M */
clkmux_sel(MT_MUX_SCP, 0, "SPM-Sleep");
#endif
__spm_kick_pcm_to_run(pwrctrl);
}
static void spm_trigger_wfi_for_sleep(struct pwr_ctrl *pwrctrl)
{
//FIXME: for K2 fpga early porting
#if 0
sync_hw_gating_value(); /* for Vcore DVFS */
#endif
#if defined(CONFIG_ARCH_MT6753)
u32 v0, v1;
#endif
if (is_cpu_pdn(pwrctrl->pcm_flags)) {
spm_dormant_sta = mt_cpu_dormant(CPU_SHUTDOWN_MODE/* | DORMANT_SKIP_WFI*/);
switch (spm_dormant_sta)
{
case MT_CPU_DORMANT_RESET:
break;
case MT_CPU_DORMANT_ABORT:
break;
case MT_CPU_DORMANT_BREAK:
break;
case MT_CPU_DORMANT_BYPASS:
break;
}
} else {
spm_dormant_sta = -1;
#if defined(CONFIG_ARCH_MT6753)
//spm_write(MP0_AXI_CONFIG, spm_read(MP0_AXI_CONFIG) | 0x10);
//spm_write(MP1_AXI_CONFIG, spm_read(MP1_AXI_CONFIG) | 0x10);
//backup MPx_AXI_CONFIG
v0 = reg_read(MP0_AXI_CONFIG);
v1 = reg_read(MP1_AXI_CONFIG);
//disable snoop function
MCUSYS_SMC_WRITE(MP0_AXI_CONFIG, v0 | ACINACTM);
MCUSYS_SMC_WRITE(MP1_AXI_CONFIG, v1 | ACINACTM);
#else
//spm_write(MP0_AXI_CONFIG, spm_read(MP0_AXI_CONFIG) | ACINACTM);
#endif
wfi_with_sync();
#if defined(CONFIG_ARCH_MT6753)
//spm_write(MP0_AXI_CONFIG, spm_read(MP0_AXI_CONFIG) & ~0x10);
//spm_write(MP1_AXI_CONFIG, spm_read(MP1_AXI_CONFIG) & ~0x10);
//restore MP0_AXI_CONFIG
MCUSYS_SMC_WRITE(MP0_AXI_CONFIG, v0);
MCUSYS_SMC_WRITE(MP1_AXI_CONFIG, v1);
#else
// spm_write(MP0_AXI_CONFIG, spm_read(MP0_AXI_CONFIG) & ~ACINACTM);
#endif
}
if (is_infra_pdn(pwrctrl->pcm_flags))
mtk_uart_restore();
}
static void spm_clean_after_wakeup(void)
{
/* disable PCM WDT to stop count if needed */
#if SPM_PCMWDT_EN
spm_write(SPM_PCM_CON1, CON1_CFG_KEY | (spm_read(SPM_PCM_CON1) & ~CON1_PCM_WDT_EN));
#endif
#if SPM_PCMTIMER_DIS
spm_write(SPM_PCM_CON1, CON1_CFG_KEY | (spm_read(SPM_PCM_CON1) | CON1_PCM_TIMER_EN));
#endif
__spm_clean_after_wakeup();
//FIXME: for K2 fpga early porting
#if 0
/* restore clock mux: fscp_ck = SYSPLL1_D2 */
clkmux_sel(MT_MUX_SCP, 1, "SPM-Sleep");
#endif
}
static wake_reason_t spm_output_wake_reason(struct wake_status *wakesta, struct pcm_desc *pcmdesc)
{
wake_reason_t wr;
u32 md32_flag = 0;
u32 md32_flag2 = 0;
wr = __spm_output_wake_reason(wakesta, pcmdesc, true);
#if 1
memcpy(&suspend_info[log_wakesta_cnt], wakesta, sizeof(struct wake_status));
suspend_info[log_wakesta_cnt].log_index = log_wakesta_index;
if (10 <= log_wakesta_cnt)
{
log_wakesta_cnt = 0;
spm_snapshot_golden_setting = 0;
}
else
{
log_wakesta_cnt++;
log_wakesta_index++;
}
#if 0
else
{
if (2 != spm_snapshot_golden_setting)
{
if ((0x90100000 == wakesta->event_reg) && (0x140001f == wakesta->debug_flag))
spm_snapshot_golden_setting = 1;
}
}
#endif
if (0xFFFFFFF0 <= log_wakesta_index)
log_wakesta_index = 0;
#endif
#ifdef CONFIG_MD32_SUPPORT
md32_flag = spm_read(MD32_BASE+0x2C);
md32_flag2 = spm_read(MD32_BASE+0x30);
#endif
spm_crit2("suspend dormant state = %d, md32_flag = 0x%x, md32_flag2 = %d\n", spm_dormant_sta, md32_flag, md32_flag2);
spm_crit2("log_wakesta_index = %d\n", log_wakesta_index);
if (0 != spm_ap_mdsrc_req_cnt)
spm_crit2("warning: spm_ap_mdsrc_req_cnt = %d, r7[ap_mdsrc_req] = 0x%x\n", spm_ap_mdsrc_req_cnt, spm_read(SPM_POWER_ON_VAL1) & (1<<17));
if (wakesta->r12 & WAKE_SRC_EINT)
mt_eint_print_status();
#if 0
if (wakesta->debug_flag & (1 << 18))
{
spm_crit2("MD32 suspned pmic wrapper error");
BUG();
}
if (wakesta->debug_flag & (1 << 19))
{
spm_crit2("MD32 resume pmic wrapper error");
BUG();
}
#endif
if (wakesta->r12 & WAKE_SRC_CLDMA_MD)
exec_ccci_kern_func_by_md_id(0, ID_GET_MD_WAKEUP_SRC, NULL, 0);
return wr;
}
#if SPM_PWAKE_EN
static u32 spm_get_wake_period(int pwake_time, wake_reason_t last_wr)
{
int period = SPM_WAKE_PERIOD;
if (pwake_time < 0) {
/* use FG to get the period of 1% battery decrease */
period = get_dynamic_period(last_wr != WR_PCM_TIMER ? 1 : 0, SPM_WAKE_PERIOD, 1);
if (period <= 0) {
spm_warn("CANNOT GET PERIOD FROM FUEL GAUGE\n");
period = SPM_WAKE_PERIOD;
}
} else {
period = pwake_time;
spm_crit2("pwake = %d\n", pwake_time);
}
if (period > 36 * 3600) /* max period is 36.4 hours */
period = 36 * 3600;
return period;
}
#endif
/*
* wakesrc: WAKE_SRC_XXX
* enable : enable or disable @wakesrc
* replace: if true, will replace the default setting
*/
int spm_set_sleep_wakesrc(u32 wakesrc, bool enable, bool replace)
{
unsigned long flags;
if (spm_is_wakesrc_invalid(wakesrc))
return -EINVAL;
spin_lock_irqsave(&__spm_lock, flags);
if (enable) {
if (replace)
__spm_suspend.pwrctrl->wake_src = wakesrc;
else
__spm_suspend.pwrctrl->wake_src |= wakesrc;
} else {
if (replace)
__spm_suspend.pwrctrl->wake_src = 0;
else
__spm_suspend.pwrctrl->wake_src &= ~wakesrc;
}
spin_unlock_irqrestore(&__spm_lock, flags);
return 0;
}
/*
* wakesrc: WAKE_SRC_XXX
*/
u32 spm_get_sleep_wakesrc(void)
{
return __spm_suspend.pwrctrl->wake_src;
}
#if 0
static void uart_mhl_gpio_sleep_ctrl(bool suspend)
{
static int mhl_ws_gpio_mode= 0;
static int mhl_ck_gpio_mode= 0;
static int mhl_dat_gpio_mode= 0;
if(suspend == true)
{
#ifdef GPIO_MHL_I2S_OUT_WS_PIN
mhl_ws_gpio_mode = mt_get_gpio_mode(GPIO_MHL_I2S_OUT_WS_PIN);
mhl_ck_gpio_mode = mt_get_gpio_mode(GPIO_MHL_I2S_OUT_CK_PIN);
mhl_dat_gpio_mode = mt_get_gpio_mode(GPIO_MHL_I2S_OUT_DAT_PIN);
mt_set_gpio_mode(GPIO_MHL_I2S_OUT_WS_PIN, GPIO_MODE_GPIO);
mt_set_gpio_mode(GPIO_MHL_I2S_OUT_CK_PIN, GPIO_MODE_01);
mt_set_gpio_mode(GPIO_MHL_I2S_OUT_DAT_PIN, GPIO_MODE_02);
mt_set_gpio_mode(GPIO_MHL_I2S_OUT_WS_PIN, GPIO_MODE_00);
mt_set_gpio_dir(GPIO_MHL_I2S_OUT_WS_PIN, GPIO_DIR_IN);
mt_set_gpio_pull_enable(GPIO_MHL_I2S_OUT_WS_PIN, GPIO_PULL_ENABLE);
mt_set_gpio_pull_select(GPIO_MHL_I2S_OUT_WS_PIN, GPIO_PULL_DOWN);
mt_set_gpio_mode(GPIO_MHL_I2S_OUT_CK_PIN, GPIO_MODE_00);
mt_set_gpio_dir(GPIO_MHL_I2S_OUT_CK_PIN, GPIO_DIR_IN);
mt_set_gpio_pull_enable(GPIO_MHL_I2S_OUT_CK_PIN, GPIO_PULL_ENABLE);
mt_set_gpio_pull_select(GPIO_MHL_I2S_OUT_CK_PIN, GPIO_PULL_DOWN);
mt_set_gpio_mode(GPIO_MHL_I2S_OUT_DAT_PIN, GPIO_MODE_00);
mt_set_gpio_dir(GPIO_MHL_I2S_OUT_DAT_PIN, GPIO_DIR_IN);
mt_set_gpio_pull_enable(GPIO_MHL_I2S_OUT_DAT_PIN, GPIO_PULL_ENABLE);
mt_set_gpio_pull_select(GPIO_MHL_I2S_OUT_DAT_PIN, GPIO_PULL_DOWN);
#endif
}
else
{
#ifdef GPIO_MHL_I2S_OUT_WS_PIN
mt_set_gpio_mode(GPIO_MHL_I2S_OUT_WS_PIN, mhl_ws_gpio_mode);
mt_set_gpio_mode(GPIO_MHL_I2S_OUT_CK_PIN, mhl_ck_gpio_mode);
mt_set_gpio_mode(GPIO_MHL_I2S_OUT_DAT_PIN, mhl_dat_gpio_mode);
#endif
}
}
#endif
#if SPM_AEE_RR_REC
void spm_suspend_aee_init(void)
{
aee_rr_rec_spm_suspend_val(0);
}
#endif
#include <cust_pmic.h>
#ifndef DISABLE_DLPT_FEATURE
extern int get_dlpt_imix_spm(void);
#endif
wake_reason_t spm_go_to_sleep(u32 spm_flags, u32 spm_data)
{
u32 sec = 2;
int wd_ret;
struct wake_status wakesta;
unsigned long flags;
unsigned long temp_a, temp_b;
unsigned int temp_c;
#if defined(CONFIG_ARCH_MT6735)
unsigned int curr_ddr_khz;
#endif
struct mtk_irq_mask mask;
struct wd_api *wd_api;
static wake_reason_t last_wr = WR_NONE;
struct pcm_desc *pcmdesc;
struct pwr_ctrl *pwrctrl;
#ifndef DISABLE_DLPT_FEATURE
get_dlpt_imix_spm();
#endif
#if SPM_AEE_RR_REC
spm_suspend_aee_init();
aee_rr_rec_spm_suspend_val(1<<SPM_SUSPEND_ENTER);
#endif
/*
if(spm_set_suspend_pcm_ver(&spm_flags)==false) {
spm_crit2("mempll setting error %x\n",mt_get_clk_mem_sel());
last_wr = WR_UNKNOWN;
return last_wr;
}
*/
pcmdesc = __spm_suspend.pcmdesc;
pwrctrl = __spm_suspend.pwrctrl;
set_pwrctrl_pcm_flags(pwrctrl, spm_flags);
set_pwrctrl_pcm_data(pwrctrl, spm_data);
#if SPM_PWAKE_EN
sec = spm_get_wake_period(-1 /* FIXME */, last_wr);
#endif
pwrctrl->timer_val = sec * 32768;
wd_ret = get_wd_api(&wd_api);
if (!wd_ret)
wd_api->wd_suspend_notify();
//FIXME: wait for golden setting
#if 0
{
extern int snapshot_golden_setting(const char *func, const unsigned int line);
extern bool is_already_snap_shot;
if (!is_already_snap_shot)
snapshot_golden_setting(__func__, 0);
}
#endif
//spm_suspend_pre_process(pwrctrl);
lockdep_off();
spin_lock_irqsave(&__spm_lock, flags);
mt_irq_mask_all(&mask);
mt_irq_unmask_for_sleep(SPM_IRQ0_ID);
mt_cirq_clone_gic();
mt_cirq_enable();
spm_set_sysclk_settle();
#if defined(CONFIG_ARCH_MT6753)
__spm_enable_i2c4_clk();
if (vcorefs_get_curr_voltage() == VCORE_1_P_25_UV)
vcorefs_list_kicker_request();
#endif
#if defined(CONFIG_ARCH_MT6735)
curr_ddr_khz = get_ddr_khz();
if (curr_ddr_khz == FDDR_S0_KHZ) // ddr 1280
dram_do_dfs_by_fh(FDDR_S1_KHZ); // ddr 938
spm_crit2("ddr in = %u, get ddr = %u\n", curr_ddr_khz, get_ddr_khz());
#endif
spm_crit2("sec = %u, wakesrc = 0x%x (%u)(%u)\n",
sec, pwrctrl->wake_src, is_cpu_pdn(pwrctrl->pcm_flags), is_infra_pdn(pwrctrl->pcm_flags));
if (request_uart_to_sleep()) {
last_wr = WR_UART_BUSY;
goto RESTORE_IRQ;
}
#if 0
///only for mhl i2s/uart share gpio issue on k2 platform
uart_mhl_gpio_sleep_ctrl(true);
#endif
__spm_reset_and_init_pcm(pcmdesc);
__spm_kick_im_to_fetch(pcmdesc);
__spm_init_pcm_register();
__spm_init_event_vector(pcmdesc);
__spm_set_power_control(pwrctrl);
__spm_set_wakeup_event(pwrctrl);
mt_cpufreq_set_pmic_phase(PMIC_WRAP_PHASE_SUSPEND);
//hw mode
//temp_b = 0x1;
//pmic_config_interface_nolock(MT6328_PMIC_RG_VRF18_0_ON_CTRL_ADDR, temp_b, MT6328_PMIC_RG_VRF18_0_ON_CTRL_MASK, MT6328_PMIC_RG_VRF18_0_ON_CTRL_SHIFT);
/*
temp_a = spm_read(PMIC_WRAP_DVFS_WDATA5);
temp_b = spm_read(PMIC_WRAP_DVFS_WDATA4);
spm_write(SPM_PCM_PASR_DPD_3, (temp_a << 16)|temp_b);
temp_a = spm_read(PMIC_WRAP_DVFS_WDATA3);
temp_b = spm_read(PMIC_WRAP_DVFS_WDATA2);
spm_write(SPM_PCM_PASR_DPD_2, (temp_a << 16)|temp_b);
*/
#if defined(CONFIG_ARCH_MT6735)
temp_a = spm_read(PMIC_WRAP_DVFS_WDATA2);
temp_b = spm_read(PMIC_WRAP_DVFS_WDATA3);
spm_write(SPM_PCM_PASR_DPD_3, (temp_b << 16)|temp_a);
#elif defined(CONFIG_ARCH_MT6735M)
temp_a = spm_read(PMIC_WRAP_DVFS_WDATA2);
temp_b = spm_read(PMIC_WRAP_DVFS_WDATA3);
spm_write(SPM_PCM_PASR_DPD_3, (temp_b << 16)|temp_a);
#elif defined(CONFIG_ARCH_MT6753)
spm_write(PMIC_WRAP_DVFS_ADR10, 0x454);
spm_write(PMIC_WRAP_DVFS_WDATA10, 0x3E62);
spm_write(PMIC_WRAP_DVFS_ADR11, 0x454);
spm_write(PMIC_WRAP_DVFS_WDATA11, 0x2262);
#else
#endif
spm_kick_pcm_to_run(pwrctrl);
#if SPM_AEE_RR_REC
aee_rr_rec_spm_suspend_val(aee_rr_curr_spm_suspend_val()|(1<<SPM_SUSPEND_ENTER_WFI));
#endif
spm_trigger_wfi_for_sleep(pwrctrl);
mt_cpufreq_set_pmic_phase(PMIC_WRAP_PHASE_NORMAL);
#if SPM_AEE_RR_REC
aee_rr_rec_spm_suspend_val(aee_rr_curr_spm_suspend_val()|(1<<SPM_SUSPEND_LEAVE_WFI));
#endif
__spm_get_wakeup_status(&wakesta);
spm_clean_after_wakeup();
#if 0
///only for mhl i2s/uart share gpio issue on k2 platform
uart_mhl_gpio_sleep_ctrl(false);
#endif
request_uart_to_wakeup();
last_wr = spm_output_wake_reason(&wakesta, pcmdesc);
pmic_read_interface_nolock(MT6328_VRF18_0_CON0, &temp_c, 0xFFFF, 0);
spm_crit2("VRF18_0 = 0x%x\n", temp_c);
#if defined(CONFIG_ARCH_MT6735)
if (curr_ddr_khz == FDDR_S0_KHZ) // ddr 1280
dram_do_dfs_by_fh(FDDR_S0_KHZ); // ddr 1280
spm_crit2("ddr out = %u, get ddr = %u\n", curr_ddr_khz, get_ddr_khz());
#endif
#if defined(CONFIG_ARCH_MT6753)
if (vcorefs_get_curr_voltage() == VCORE_1_P_25_UV)
vcorefs_list_kicker_request();
__spm_disable_i2c4_clk();
#endif
RESTORE_IRQ:
mt_cirq_flush();
mt_cirq_disable();
mt_irq_mask_restore(&mask);
spin_unlock_irqrestore(&__spm_lock, flags);
lockdep_on();
//spm_suspend_post_process(pwrctrl);
if (!wd_ret)
wd_api->wd_resume_notify();
#if SPM_AEE_RR_REC
aee_rr_rec_spm_suspend_val(aee_rr_curr_spm_suspend_val()|(1<<SPM_SUSPEND_LEAVE));
#endif
return last_wr;
}
bool spm_is_md_sleep(void)
{
return !( (spm_read(SPM_PCM_REG13_DATA) & R13_MD1_SRCLKENA) | (spm_read(SPM_PCM_REG13_DATA) & R13_MD2_SRCLKENA));
}
bool spm_is_md1_sleep(void)
{
return !(spm_read(SPM_PCM_REG13_DATA) & R13_MD1_SRCLKENA);
}
bool spm_is_md2_sleep(void)
{
return !(spm_read(SPM_PCM_REG13_DATA) & R13_MD2_SRCLKENA);
}
bool spm_is_conn_sleep(void)
{
return !(spm_read(SPM_PCM_REG13_DATA) & R13_CONN_SRCLKENA);
}
void spm_set_wakeup_src_check(void)
{
/* clean wakeup event raw status */
spm_write(SPM_SLEEP_WAKEUP_EVENT_MASK, 0xFFFFFFFF);
/* set wakeup event */
spm_write(SPM_SLEEP_WAKEUP_EVENT_MASK, ~WAKE_SRC_FOR_SUSPEND);
}
bool spm_check_wakeup_src(void)
{
u32 wakeup_src;
/* check wanek event raw status */
wakeup_src = spm_read(SPM_SLEEP_ISR_RAW_STA);
if (wakeup_src)
{
spm_crit2("WARNING: spm_check_wakeup_src = 0x%x", wakeup_src);
return 1;
}
else
return 0;
}
void spm_poweron_config_set(void)
{
unsigned long flags;
spin_lock_irqsave(&__spm_lock, flags);
/* enable register control */
spm_write(SPM_POWERON_CONFIG_SET, (SPM_PROJECT_CODE << 16) | (1U << 0));
spin_unlock_irqrestore(&__spm_lock, flags);
}
void spm_md32_sram_con(u32 value)
{
unsigned long flags;
spin_lock_irqsave(&__spm_lock, flags);
/* enable register control */
spm_write(SPM_MD32_SRAM_CON, value);
spin_unlock_irqrestore(&__spm_lock, flags);
}
//FIXME: for K2 fpga early porting
#if 0
#define hw_spin_lock_for_ddrdfs() \
do { \
spm_write(0xF0050090, 0x8000); \
} while (!(spm_read(0xF0050090) & 0x8000))
#define hw_spin_unlock_for_ddrdfs() \
spm_write(0xF0050090, 0x8000)
#else
#define hw_spin_lock_for_ddrdfs()
#define hw_spin_unlock_for_ddrdfs()
#endif
void spm_ap_mdsrc_req(u8 set)
{
unsigned long flags;
u32 i = 0;
u32 md_sleep = 0;
if (set)
{
spin_lock_irqsave(&__spm_lock, flags);
if (spm_ap_mdsrc_req_cnt < 0)
{
spm_crit2("warning: set = %d, spm_ap_mdsrc_req_cnt = %d\n", set, spm_ap_mdsrc_req_cnt);
//goto AP_MDSRC_REC_CNT_ERR;
spin_unlock_irqrestore(&__spm_lock, flags);
}
else
{
spm_ap_mdsrc_req_cnt++;
hw_spin_lock_for_ddrdfs();
spm_write(SPM_POWER_ON_VAL1, spm_read(SPM_POWER_ON_VAL1) | (1 << 17));
hw_spin_unlock_for_ddrdfs();
spin_unlock_irqrestore(&__spm_lock, flags);
/* if md_apsrc_req = 1'b0, wait 26M settling time (3ms) */
if (0 == (spm_read(SPM_PCM_REG13_DATA) & R13_MD1_APSRC_REQ))
{
md_sleep = 1;
mdelay(3);
}
/* Check ap_mdsrc_ack = 1'b1 */
while(0 == (spm_read(SPM_PCM_REG13_DATA) & R13_AP_MD1SRC_ACK))
{
if (10 > i++)
{
mdelay(1);
}
else
{
spm_crit2("WARNING: MD SLEEP = %d, spm_ap_mdsrc_req CAN NOT polling AP_MD1SRC_ACK\n", md_sleep);
//goto AP_MDSRC_REC_CNT_ERR;
break;
}
}
}
}
else
{
spin_lock_irqsave(&__spm_lock, flags);
spm_ap_mdsrc_req_cnt--;
if (spm_ap_mdsrc_req_cnt < 0)
{
spm_crit2("warning: set = %d, spm_ap_mdsrc_req_cnt = %d\n", set, spm_ap_mdsrc_req_cnt);
//goto AP_MDSRC_REC_CNT_ERR;
}
else
{
if (0 == spm_ap_mdsrc_req_cnt)
{
hw_spin_lock_for_ddrdfs();
spm_write(SPM_POWER_ON_VAL1, spm_read(SPM_POWER_ON_VAL1) & ~(1 << 17));
hw_spin_unlock_for_ddrdfs();
}
}
spin_unlock_irqrestore(&__spm_lock, flags);
}
//AP_MDSRC_REC_CNT_ERR:
// spin_unlock_irqrestore(&__spm_lock, flags);
}
void spm_output_sleep_option(void)
{
spm_notice("PWAKE_EN:%d, PCMWDT_EN:%d, BYPASS_SYSPWREQ:%d, I2C_CHANNEL:%d\n",
SPM_PWAKE_EN, SPM_PCMWDT_EN, SPM_BYPASS_SYSPWREQ, I2C_CHANNEL);
}
MODULE_DESCRIPTION("SPM-Sleep Driver v0.1");
|